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
boolean compareStrings(XMLString s1, XMLString s2) { return (s1.toDouble() >= s2.toDouble()); // return s1.compareTo(s2) >= 0; }
boolean compareStrings(XMLString s1, XMLString s2) { return (s1.toDouble() >= s2.toDouble()); }
/** * Compare two strings for greater than or equal. * * * @param s1 First string to compare * @param s2 Second String to compare * * @return true if s1 is greater than or equal to s2 */
Compare two strings for greater than or equal
compareStrings
{ "repo_name": "itgeeker/jdk", "path": "src/com/sun/org/apache/xpath/internal/objects/XNodeSet.java", "license": "apache-2.0", "size": 23469 }
[ "com.sun.org.apache.xml.internal.utils.XMLString" ]
import com.sun.org.apache.xml.internal.utils.XMLString;
import com.sun.org.apache.xml.internal.utils.*;
[ "com.sun.org" ]
com.sun.org;
1,736,714
void saveNewTopping(CakeToppingInfo toppingInfo);
void saveNewTopping(CakeToppingInfo toppingInfo);
/** * Store new cake topping. */
Store new cake topping
saveNewTopping
{ "repo_name": "zik43/java-design-patterns", "path": "layers/src/main/java/com/iluwatar/layers/service/CakeBakingService.java", "license": "mit", "size": 2036 }
[ "com.iluwatar.layers.dto.CakeToppingInfo" ]
import com.iluwatar.layers.dto.CakeToppingInfo;
import com.iluwatar.layers.dto.*;
[ "com.iluwatar.layers" ]
com.iluwatar.layers;
1,941,463
public static Geometry readGeometry(ByteReader reader, GeometryFilter filter) throws IOException { return readGeometry(reader, filter, null); }
static Geometry function(ByteReader reader, GeometryFilter filter) throws IOException { return readGeometry(reader, filter, null); }
/** * Read a geometry from the byte reader * * @param reader * byte reader * @param filter * geometry filter * @return geometry * @throws IOException * upon failure to read * @since 2.0.3 */
Read a geometry from the byte reader
readGeometry
{ "repo_name": "ngageoint/geopackage-wkb-java", "path": "src/main/java/mil/nga/sf/wkb/GeometryReader.java", "license": "mit", "size": 24713 }
[ "java.io.IOException", "mil.nga.sf.Geometry", "mil.nga.sf.util.ByteReader", "mil.nga.sf.util.filter.GeometryFilter" ]
import java.io.IOException; import mil.nga.sf.Geometry; import mil.nga.sf.util.ByteReader; import mil.nga.sf.util.filter.GeometryFilter;
import java.io.*; import mil.nga.sf.*; import mil.nga.sf.util.*; import mil.nga.sf.util.filter.*;
[ "java.io", "mil.nga.sf" ]
java.io; mil.nga.sf;
2,251,629
@Override public boolean onScaleBegin(ScaleGestureDetector detector) { return true; }
boolean function(ScaleGestureDetector detector) { return true; }
/** * Responds to the beginning of a scaling gesture. Reported by new pointers going down. * * @param detector The detector reporting the event - use this to retrieve extended info * about event state. * @return Whether or not the detector should continue recognizing this gesture. For * example, if a gesture is beginning with a focal point outside of a region where it makes * sense, onScaleBegin() may return false to ignore the rest of the gesture. */
Responds to the beginning of a scaling gesture. Reported by new pointers going down
onScaleBegin
{ "repo_name": "vickychijwani/udacity-p3-super-duo", "path": "alexandria/app/src/main/java/it/jaschke/alexandria/BarcodeCaptureActivity.java", "license": "unlicense", "size": 17186 }
[ "android.view.ScaleGestureDetector" ]
import android.view.ScaleGestureDetector;
import android.view.*;
[ "android.view" ]
android.view;
779,008
@Override protected void refillLeft(){ if(!shouldRepeat && isSrollingDisabled) return; //prevent next layout calls to override override first init to scrolling disabled by falling to this branch if(getChildCount() == 0) return; final int leftScreenEdge = getScrollX(); View child = getChildAt(0); int currLayoutRight = child.getRight() - (int)(child.getWidth() * mSpacing); while(currLayoutRight > leftScreenEdge){ mFirstItemPosition--; if(mFirstItemPosition < 0) mFirstItemPosition = mAdapter.getCount()-1; child = getViewAtPosition(mFirstItemPosition); if(child == getChildAt(getChildCount() - 1)){ removeViewInLayout(child); } child = addAndMeasureChildHorizontal(child, LAYOUT_MODE_TO_BEFORE); currLayoutRight = layoutChildHorizontalToBefore(child, currLayoutRight, (LoopLayoutParams) child.getLayoutParams()); //update left edge of children in container mLeftChildEdge = child.getLeft(); //if selected view is going to screen, set selected state on him if(mFirstItemPosition == mSelectedPosition){ child.setSelected(true); } } }
void function(){ if(!shouldRepeat && isSrollingDisabled) return; if(getChildCount() == 0) return; final int leftScreenEdge = getScrollX(); View child = getChildAt(0); int currLayoutRight = child.getRight() - (int)(child.getWidth() * mSpacing); while(currLayoutRight > leftScreenEdge){ mFirstItemPosition--; if(mFirstItemPosition < 0) mFirstItemPosition = mAdapter.getCount()-1; child = getViewAtPosition(mFirstItemPosition); if(child == getChildAt(getChildCount() - 1)){ removeViewInLayout(child); } child = addAndMeasureChildHorizontal(child, LAYOUT_MODE_TO_BEFORE); currLayoutRight = layoutChildHorizontalToBefore(child, currLayoutRight, (LoopLayoutParams) child.getLayoutParams()); mLeftChildEdge = child.getLeft(); if(mFirstItemPosition == mSelectedPosition){ child.setSelected(true); } } }
/** * Checks and refills empty area on the left */
Checks and refills empty area on the left
refillLeft
{ "repo_name": "android-plugin/uexCoverFlow", "path": "src/it/moondroid/coverflow/components/ui/containers/FeatureCoverFlow.java", "license": "lgpl-3.0", "size": 44770 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
2,511,263
private synchronized void setState(int state) { if (D) Log.d(TAG, "setState() " + mState + " -> " + state); if (D) postStatus(TAG + ": state change: " + mState + " -> " + state); mState = state; // Give the new state to the Handler so the UI Activity can update mHandler.obtainMessage(AdhocPairingActivity.MESSAGE_STATE_CHANGE, state, -1).sendToTarget(); }
synchronized void function(int state) { if (D) Log.d(TAG, STR + mState + STR + state); if (D) postStatus(TAG + STR + mState + STR + state); mState = state; mHandler.obtainMessage(AdhocPairingActivity.MESSAGE_STATE_CHANGE, state, -1).sendToTarget(); }
/** * Set the current state of the chat connection * @param state An integer defining the current connection state */
Set the current state of the chat connection
setState
{ "repo_name": "stephansigg/ad-hoc-pairing", "path": "AdhocPairing_sources/src/com/pairing/AdhocPairing/PairingManager.java", "license": "gpl-2.0", "size": 25528 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
1,992,071
private void attachLine() { try { line = stage.getContentFactory().create(ILine.class, "line", UUID.randomUUID()); line.setLineWidth(10f); stage.addItem(line); } catch (ContentTypeNotBoundException e) { log.log(Level.SEVERE, "ContentTypeNotBoundException: " + e); } toggleVisibility(); }
void function() { try { line = stage.getContentFactory().create(ILine.class, "line", UUID.randomUUID()); line.setLineWidth(10f); stage.addItem(line); } catch (ContentTypeNotBoundException e) { log.log(Level.SEVERE, STR + e); } toggleVisibility(); }
/** * Attach line. */
Attach line
attachLine
{ "repo_name": "synergynet/synergynet3.1", "path": "synergynet3.1-parent/synergynet3-appsystem-core/src/main/java/synergynet3/feedbacksystem/FeedbackViewer.java", "license": "bsd-3-clause", "size": 5190 }
[ "java.util.UUID", "java.util.logging.Level" ]
import java.util.UUID; import java.util.logging.Level;
import java.util.*; import java.util.logging.*;
[ "java.util" ]
java.util;
1,966,411
public Builder configuration(Configuration configuration) { this.configuration = configuration; return this; }
Builder function(Configuration configuration) { this.configuration = configuration; return this; }
/** * The {@link Configuration} used to find the {@link FileSystem}. Optional. If not * specified, the default configuration will be used. */
The <code>Configuration</code> used to find the <code>FileSystem</code>. Optional. If not specified, the default configuration will be used
configuration
{ "repo_name": "whoschek/kite", "path": "kite-data/kite-data-hcatalog/src/main/java/org/kitesdk/data/hcatalog/HCatalogDatasetRepository.java", "license": "apache-2.0", "size": 4313 }
[ "org.apache.hadoop.conf.Configuration" ]
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.conf.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
647,493
@Override public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable environment) throws NamingException { Object result = super.getObjectInstance(obj, name, nameCtx, environment); // Can we process this request? if (result!=null) { Reference ref = (Reference) obj; RefAddr userAttr = ref.get("username"); RefAddr passAttr = ref.get("password"); if (userAttr.getContent()!=null && passAttr.getContent()!=null) { result = wrapDataSource(result,userAttr.getContent().toString(), passAttr.getContent().toString()); } } return result; }
Object function(Object obj, Name name, Context nameCtx, Hashtable environment) throws NamingException { Object result = super.getObjectInstance(obj, name, nameCtx, environment); if (result!=null) { Reference ref = (Reference) obj; RefAddr userAttr = ref.get(STR); RefAddr passAttr = ref.get(STR); if (userAttr.getContent()!=null && passAttr.getContent()!=null) { result = wrapDataSource(result,userAttr.getContent().toString(), passAttr.getContent().toString()); } } return result; }
/** * Create a new DataSource instance. * * @param obj The reference object describing the DataSource */
Create a new DataSource instance
getObjectInstance
{ "repo_name": "yuyupapa/OpenSource", "path": "apache-tomcat-6.0.48/java/org/apache/naming/factory/DataSourceLinkFactory.java", "license": "apache-2.0", "size": 5472 }
[ "java.util.Hashtable", "javax.naming.Context", "javax.naming.Name", "javax.naming.NamingException", "javax.naming.RefAddr", "javax.naming.Reference" ]
import java.util.Hashtable; import javax.naming.Context; import javax.naming.Name; import javax.naming.NamingException; import javax.naming.RefAddr; import javax.naming.Reference;
import java.util.*; import javax.naming.*;
[ "java.util", "javax.naming" ]
java.util; javax.naming;
1,231,665
public void displayPopUp(MouseEvent e, JPopupMenu popup) { displayPopUp((Component) e.getSource(), e, popup); }
void function(MouseEvent e, JPopupMenu popup) { displayPopUp((Component) e.getSource(), e, popup); }
/** * Display the specified popup menu with the source component and location * from the specified mouse event. * * @param e * the mouse event causing this popup to be displayed * @param popup * the popup menu to display */
Display the specified popup menu with the source component and location from the specified mouse event
displayPopUp
{ "repo_name": "hizhangqi/jmeter-1", "path": "src/core/org/apache/jmeter/gui/GuiPackage.java", "license": "apache-2.0", "size": 28688 }
[ "java.awt.Component", "java.awt.event.MouseEvent", "javax.swing.JPopupMenu" ]
import java.awt.Component; import java.awt.event.MouseEvent; import javax.swing.JPopupMenu;
import java.awt.*; import java.awt.event.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
2,556,662
protected List<SearchState> prepend(symbol sym, symbol nextSym1, symbol nextSym2, Set<lalr_state> guide) { List<SearchState> result = new LinkedList<>(); SearchState ss = this; StateItem si1src = ss.states1.get(0); StateItem si2src = ss.states2.get(0); Set<symbol> si1lookahead = nextSym1 == null ? StateItem.symbolSet(si1src.item.lookahead()) : symbolSet(nextSym1); Set<symbol> si2lookahead = nextSym2 == null ? StateItem.symbolSet(si2src.item.lookahead()) : symbolSet(nextSym2); Set<StateItem> prev1 = extendedSearch ? new HashSet<>(si1src.reverseTransition(sym, si1lookahead, guide)) : null; Set<StateItem> prev2 = extendedSearch ? new HashSet<>(si2src.reverseTransition(sym, si2lookahead, guide)) : null; List<StateItem> prev1ext = si1src.reverseTransition(sym, si1lookahead, extendedSearch ? null : guide); List<StateItem> prev2ext = si2src.reverseTransition(sym, si2lookahead, extendedSearch ? null : guide); for (StateItem psis1 : prev1ext) { boolean guided1 = extendedSearch ? prev1.contains(psis1) : true; StateItem psi1 = psis1 == null ? si1src : psis1; for (StateItem psis2 : prev2ext) { boolean guided2 = extendedSearch ? prev2.contains(psis2) : true; StateItem psi2 = psis2 == null ? si2src : psis2; // Only continue of the StateItems on both paths are the same. if (psi1 == si1src && psi2 == si2src) continue; if (psi1.state != psi2.state) continue; SearchState copy = ss.copy(); if (psis1 != null) copy.states1.add(0, psis1); if (psis2 != null) copy.states2.add(0, psis2); if (psis1 != null && copy.states1.get(0).item.dot_pos() + 1 == copy.states1.get(1).item.dot_pos()) { if (psis2 != null && copy.states2.get(0).item.dot_pos() + 1 == copy.states2.get(1).item.dot_pos()) { // Both are reverse transitions; add appropriate // derivation of the corresponding symbol used for // the reverse transition. Derivation deriv = new Derivation(sym); copy.derivs1.add(0, deriv); copy.derivs2.add(0, deriv); } else continue; } else if (psis2 != null && copy.states2.get(0).item.dot_pos() + 1 == copy.states2.get(1).item.dot_pos()) { continue; } // At this point, either reverse transition is made on both paths, // or reverse production is made on both paths. // Now, compute the complexity of the new search state. int prependSize = (psis1 == null ? 0 : 1) + (psis2 == null ? 0 : 1); int productionSteps = (psis1 == null ? 0 : productionSteps(Collections.singletonList(psis1), si1src)) + (psis2 == null ? 0 : productionSteps(Collections.singletonList(psis2), si2src)); copy.complexity += UNSHIFT_COST * (prependSize - productionSteps) + PRODUCTION_COST * productionSteps; if (!guided1 || !guided2) copy.complexity += EXTENDED_COST; result.add(copy); } } return result; }
List<SearchState> function(symbol sym, symbol nextSym1, symbol nextSym2, Set<lalr_state> guide) { List<SearchState> result = new LinkedList<>(); SearchState ss = this; StateItem si1src = ss.states1.get(0); StateItem si2src = ss.states2.get(0); Set<symbol> si1lookahead = nextSym1 == null ? StateItem.symbolSet(si1src.item.lookahead()) : symbolSet(nextSym1); Set<symbol> si2lookahead = nextSym2 == null ? StateItem.symbolSet(si2src.item.lookahead()) : symbolSet(nextSym2); Set<StateItem> prev1 = extendedSearch ? new HashSet<>(si1src.reverseTransition(sym, si1lookahead, guide)) : null; Set<StateItem> prev2 = extendedSearch ? new HashSet<>(si2src.reverseTransition(sym, si2lookahead, guide)) : null; List<StateItem> prev1ext = si1src.reverseTransition(sym, si1lookahead, extendedSearch ? null : guide); List<StateItem> prev2ext = si2src.reverseTransition(sym, si2lookahead, extendedSearch ? null : guide); for (StateItem psis1 : prev1ext) { boolean guided1 = extendedSearch ? prev1.contains(psis1) : true; StateItem psi1 = psis1 == null ? si1src : psis1; for (StateItem psis2 : prev2ext) { boolean guided2 = extendedSearch ? prev2.contains(psis2) : true; StateItem psi2 = psis2 == null ? si2src : psis2; if (psi1 == si1src && psi2 == si2src) continue; if (psi1.state != psi2.state) continue; SearchState copy = ss.copy(); if (psis1 != null) copy.states1.add(0, psis1); if (psis2 != null) copy.states2.add(0, psis2); if (psis1 != null && copy.states1.get(0).item.dot_pos() + 1 == copy.states1.get(1).item.dot_pos()) { if (psis2 != null && copy.states2.get(0).item.dot_pos() + 1 == copy.states2.get(1).item.dot_pos()) { Derivation deriv = new Derivation(sym); copy.derivs1.add(0, deriv); copy.derivs2.add(0, deriv); } else continue; } else if (psis2 != null && copy.states2.get(0).item.dot_pos() + 1 == copy.states2.get(1).item.dot_pos()) { continue; } int prependSize = (psis1 == null ? 0 : 1) + (psis2 == null ? 0 : 1); int productionSteps = (psis1 == null ? 0 : productionSteps(Collections.singletonList(psis1), si1src)) + (psis2 == null ? 0 : productionSteps(Collections.singletonList(psis2), si2src)); copy.complexity += UNSHIFT_COST * (prependSize - productionSteps) + PRODUCTION_COST * productionSteps; if (!guided1 !guided2) copy.complexity += EXTENDED_COST; result.add(copy); } } return result; }
/** * Attempt to prepend the given symbol to this search state, respecting * the given subsequent next symbol on each path. * @param sym * @param nextSym1 The expected next symbol for the first path. * If null, the expected next symbol is the lookahead set * of the corresponding item. * @param nextSym2 The expected next symbol for the second path. * If null, the expected next symbol is the lookahead set * of the corresponding item. * @param guide If not null, restricts the possible parser states to * this set; otherwise, explore all possible parser states * that can make the desired transition. * @return A set of SearchStates that result from successful prepending. * If prepending is not possible, this set is empty. */
Attempt to prepend the given symbol to this search state, respecting the given subsequent next symbol on each path
prepend
{ "repo_name": "liujed/polyglot-eclipse", "path": "tools/java_cup/src/parser/UnifiedExample.java", "license": "lgpl-2.1", "size": 67455 }
[ "java.util.Collections", "java.util.HashSet", "java.util.LinkedList", "java.util.List", "java.util.Set" ]
import java.util.Collections; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,293,349
@SuppressWarnings("nls") private final void handleRoomList(final RoomMessageProtocol.RoomList message) { if (message.getUser() == null || message.getUser().isEmpty()) { getSender().tell(new Status.Failure(new LobbyException("User (name) cannot be null or empty!")), getSelf()); } else if (users.get(message.getUser()) == null) { getSender().tell(new Status.Failure(new LobbyException(String.format("User: %1s is not connected to lobby: lobby-%2s", message.getUser(), locale.toString()))), getSelf()); } else { // Returns the rooms. getSender().tell(new RoomMessageProtocol.RoomList(message.getUser(), message.getLobby(), new ArrayList<>(rooms.keySet())), getSelf()); } }
@SuppressWarnings("nls") final void function(final RoomMessageProtocol.RoomList message) { if (message.getUser() == null message.getUser().isEmpty()) { getSender().tell(new Status.Failure(new LobbyException(STR)), getSelf()); } else if (users.get(message.getUser()) == null) { getSender().tell(new Status.Failure(new LobbyException(String.format(STR, message.getUser(), locale.toString()))), getSelf()); } else { getSender().tell(new RoomMessageProtocol.RoomList(message.getUser(), message.getLobby(), new ArrayList<>(rooms.keySet())), getSelf()); } }
/** * Handles a {@code room list} message. * <hr> * @param message Message to process. */
Handles a room list message.
handleRoomList
{ "repo_name": "ressec/thot", "path": "thot-akka/src/main/java/org/heliosphere/thot/akka/chat/server/lobby/LobbyActor.java", "license": "apache-2.0", "size": 10324 }
[ "java.util.ArrayList", "org.heliosphere.thot.akka.chat.server.room.RoomMessageProtocol" ]
import java.util.ArrayList; import org.heliosphere.thot.akka.chat.server.room.RoomMessageProtocol;
import java.util.*; import org.heliosphere.thot.akka.chat.server.room.*;
[ "java.util", "org.heliosphere.thot" ]
java.util; org.heliosphere.thot;
841,023
public static void createCourse(@NotNull final Course course, @NotNull final VirtualFile baseDir, @NotNull final File resourceRoot, @NotNull final Project project) { try { final List<Lesson> lessons = course.getLessons(); for (int i = 1; i <= lessons.size(); i++) { Lesson lesson = lessons.get(i - 1); lesson.setIndex(i); createLesson(lesson, baseDir, resourceRoot, project); } baseDir.createChildDirectory(project, EduNames.SANDBOX_DIR); File[] files = resourceRoot.listFiles( (dir, name) -> !name.contains(EduNames.LESSON) && !name.equals(EduNames.COURSE_META_FILE) && !name.equals(EduNames.HINTS)); if (files != null) { for (File file : files) { File dir = new File(baseDir.getPath(), file.getName()); if (file.isDirectory()) { FileUtil.copyDir(file, dir); continue; } FileUtil.copy(file, dir); } } } catch (IOException e) { LOG.error(e); } }
static void function(@NotNull final Course course, @NotNull final VirtualFile baseDir, @NotNull final File resourceRoot, @NotNull final Project project) { try { final List<Lesson> lessons = course.getLessons(); for (int i = 1; i <= lessons.size(); i++) { Lesson lesson = lessons.get(i - 1); lesson.setIndex(i); createLesson(lesson, baseDir, resourceRoot, project); } baseDir.createChildDirectory(project, EduNames.SANDBOX_DIR); File[] files = resourceRoot.listFiles( (dir, name) -> !name.contains(EduNames.LESSON) && !name.equals(EduNames.COURSE_META_FILE) && !name.equals(EduNames.HINTS)); if (files != null) { for (File file : files) { File dir = new File(baseDir.getPath(), file.getName()); if (file.isDirectory()) { FileUtil.copyDir(file, dir); continue; } FileUtil.copy(file, dir); } } } catch (IOException e) { LOG.error(e); } }
/** * Creates course directory in project user created * * @param baseDir project directory * @param resourceRoot directory where original course is stored */
Creates course directory in project user created
createCourse
{ "repo_name": "youdonghai/intellij-community", "path": "python/educational-core/student/src/com/jetbrains/edu/learning/courseGeneration/StudyGenerator.java", "license": "apache-2.0", "size": 5434 }
[ "com.intellij.openapi.project.Project", "com.intellij.openapi.util.io.FileUtil", "com.intellij.openapi.vfs.VirtualFile", "com.jetbrains.edu.learning.core.EduNames", "com.jetbrains.edu.learning.courseFormat.Course", "com.jetbrains.edu.learning.courseFormat.Lesson", "java.io.File", "java.io.IOException", "java.util.List", "org.jetbrains.annotations.NotNull" ]
import com.intellij.openapi.project.Project; import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.vfs.VirtualFile; import com.jetbrains.edu.learning.core.EduNames; import com.jetbrains.edu.learning.courseFormat.Course; import com.jetbrains.edu.learning.courseFormat.Lesson; import java.io.File; import java.io.IOException; import java.util.List; import org.jetbrains.annotations.NotNull;
import com.intellij.openapi.project.*; import com.intellij.openapi.util.io.*; import com.intellij.openapi.vfs.*; import com.jetbrains.edu.learning.*; import com.jetbrains.edu.learning.core.*; import java.io.*; import java.util.*; import org.jetbrains.annotations.*;
[ "com.intellij.openapi", "com.jetbrains.edu", "java.io", "java.util", "org.jetbrains.annotations" ]
com.intellij.openapi; com.jetbrains.edu; java.io; java.util; org.jetbrains.annotations;
2,894,292
public static MozuClient<com.mozu.api.contracts.commerceruntime.payments.Payment> getPaymentClient(String returnId, String paymentId, AuthTicket authTicket) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.ReturnUrl.getPaymentUrl(paymentId, returnId); String verb = "GET"; Class<?> clz = com.mozu.api.contracts.commerceruntime.payments.Payment.class; MozuClient<com.mozu.api.contracts.commerceruntime.payments.Payment> mozuClient = new MozuClient(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); if (authTicket != null) mozuClient.setUserAuth(authTicket); return mozuClient; }
static MozuClient<com.mozu.api.contracts.commerceruntime.payments.Payment> function(String returnId, String paymentId, AuthTicket authTicket) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.ReturnUrl.getPaymentUrl(paymentId, returnId); String verb = "GET"; Class<?> clz = com.mozu.api.contracts.commerceruntime.payments.Payment.class; MozuClient<com.mozu.api.contracts.commerceruntime.payments.Payment> mozuClient = new MozuClient(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); if (authTicket != null) mozuClient.setUserAuth(authTicket); return mozuClient; }
/** * Retrieves the details of a payment submitted as part of a refund associated with a customer return. * <p><pre><code> * MozuClient<com.mozu.api.contracts.commerceruntime.payments.Payment> mozuClient=GetPaymentClient( returnId, paymentId, authTicket); * client.setBaseAddress(url); * client.executeRequest(); * Payment payment = client.Result(); * </code></pre></p> * @param paymentId Unique identifier of the return payment to retrieve. * @param returnId Unique identifier of the return associated with the payment. * @param authTicket User Auth Ticket * @return Mozu.Api.MozuClient <com.mozu.api.contracts.commerceruntime.payments.Payment> * @see com.mozu.api.contracts.commerceruntime.payments.Payment */
Retrieves the details of a payment submitted as part of a refund associated with a customer return. <code><code> MozuClient mozuClient=GetPaymentClient( returnId, paymentId, authTicket); client.setBaseAddress(url); client.executeRequest(); Payment payment = client.Result(); </code></code>
getPaymentClient
{ "repo_name": "carsonreinke/mozu-java-sdk", "path": "src/main/java/com/mozu/api/clients/commerce/ReturnClient.java", "license": "mit", "size": 18485 }
[ "com.mozu.api.MozuClient", "com.mozu.api.MozuUrl", "com.mozu.api.security.AuthTicket" ]
import com.mozu.api.MozuClient; import com.mozu.api.MozuUrl; import com.mozu.api.security.AuthTicket;
import com.mozu.api.*; import com.mozu.api.security.*;
[ "com.mozu.api" ]
com.mozu.api;
1,862,014
void writeExternalizable(Object obj) throws IOException { Externalizable extObj = (Externalizable)obj; extObj.writeExternal(this); }
void writeExternalizable(Object obj) throws IOException { Externalizable extObj = (Externalizable)obj; extObj.writeExternal(this); }
/** * Writes externalizable object. * * @param obj Object. * @throws IOException In case of error. */
Writes externalizable object
writeExternalizable
{ "repo_name": "tkpanther/ignite", "path": "modules/core/src/main/java/org/apache/ignite/marshaller/optimized/OptimizedObjectOutputStream.java", "license": "apache-2.0", "size": 25249 }
[ "java.io.Externalizable", "java.io.IOException" ]
import java.io.Externalizable; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,008,395
protected CmsSubscriptionManager getSubscriptionManager() { return m_subscriptionManager; }
CmsSubscriptionManager function() { return m_subscriptionManager; }
/** * Returns the subscription manager.<p> * * @return the subscription manager */
Returns the subscription manager
getSubscriptionManager
{ "repo_name": "mediaworx/opencms-core", "path": "src/org/opencms/main/OpenCmsCore.java", "license": "lgpl-2.1", "size": 110979 }
[ "org.opencms.db.CmsSubscriptionManager" ]
import org.opencms.db.CmsSubscriptionManager;
import org.opencms.db.*;
[ "org.opencms.db" ]
org.opencms.db;
1,460,634
public void testGetMGFParameters() { String mdName = "SHA-1"; String mgfName = "MGF1"; AlgorithmParameterSpec mgfSpec = MGF1ParameterSpec.SHA1; PSource pSrc = PSource.PSpecified.DEFAULT; OAEPParameterSpec ps = new OAEPParameterSpec(mdName, mgfName, mgfSpec, pSrc); assertTrue("The returned value does not equal to the " + "value specified in the constructor.", ps.getMGFParameters() == mgfSpec); }
void function() { String mdName = "SHA-1"; String mgfName = "MGF1"; AlgorithmParameterSpec mgfSpec = MGF1ParameterSpec.SHA1; PSource pSrc = PSource.PSpecified.DEFAULT; OAEPParameterSpec ps = new OAEPParameterSpec(mdName, mgfName, mgfSpec, pSrc); assertTrue(STR + STR, ps.getMGFParameters() == mgfSpec); }
/** * getMGFParameters() method testing. */
getMGFParameters() method testing
testGetMGFParameters
{ "repo_name": "s20121035/rk3288_android5.1_repo", "path": "external/apache-harmony/crypto/src/test/api/java/org/apache/harmony/crypto/tests/javax/crypto/spec/OAEPParameterSpecTest.java", "license": "gpl-3.0", "size": 5944 }
[ "java.security.spec.AlgorithmParameterSpec", "java.security.spec.MGF1ParameterSpec", "javax.crypto.spec.OAEPParameterSpec", "javax.crypto.spec.PSource" ]
import java.security.spec.AlgorithmParameterSpec; import java.security.spec.MGF1ParameterSpec; import javax.crypto.spec.OAEPParameterSpec; import javax.crypto.spec.PSource;
import java.security.spec.*; import javax.crypto.spec.*;
[ "java.security", "javax.crypto" ]
java.security; javax.crypto;
2,327,437
protected int removeObject(Object toRemove) { Session session = null; int numDeleted = 0; session = HibernateFactory.getSession(); session.delete(toRemove); numDeleted++; return numDeleted; }
int function(Object toRemove) { Session session = null; int numDeleted = 0; session = HibernateFactory.getSession(); session.delete(toRemove); numDeleted++; return numDeleted; }
/** * Remove a Session from the DB * @param toRemove Object to be removed. * @return int number of objects affected. */
Remove a Session from the DB
removeObject
{ "repo_name": "hustodemon/spacewalk", "path": "java/code/src/com/redhat/rhn/common/hibernate/HibernateFactory.java", "license": "gpl-2.0", "size": 20341 }
[ "org.hibernate.Session" ]
import org.hibernate.Session;
import org.hibernate.*;
[ "org.hibernate" ]
org.hibernate;
565,638
List<String> vmSizesWithEncryptionAtHost();
List<String> vmSizesWithEncryptionAtHost();
/** * Gets the vmSizesWithEncryptionAtHost property: The vm sizes which enable encryption at host. * * @return the vmSizesWithEncryptionAtHost value. */
Gets the vmSizesWithEncryptionAtHost property: The vm sizes which enable encryption at host
vmSizesWithEncryptionAtHost
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/models/BillingResponseListResult.java", "license": "mit", "size": 1747 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,624,582
ProjectBuildingResult build( Artifact projectArtifact, boolean allowStubModel, ProjectBuildingRequest request ) throws ProjectBuildingException;
ProjectBuildingResult build( Artifact projectArtifact, boolean allowStubModel, ProjectBuildingRequest request ) throws ProjectBuildingException;
/** * Builds a project descriptor for the specified artifact. * * @param projectArtifact The POM artifact to build the project from, must not be {@code null}. * @param allowStubModel A flag controlling the case of a missing POM artifact. If {@code true} and the specified * POM artifact does not exist, a simple stub model will be returned. If {@code false}, an exception will * be thrown. * @param request The project building request that holds further parameters, must not be {@code null}. * @return The result of the project building, never {@code null}. * @throws ProjectBuildingException If the project descriptor could not be successfully built. */
Builds a project descriptor for the specified artifact
build
{ "repo_name": "gems-uff/oceano", "path": "core/src/test/resources/maven-3-trunk/maven-core/src/main/java/org/apache/maven/project/ProjectBuilder.java", "license": "mit", "size": 4747 }
[ "org.apache.maven.artifact.Artifact" ]
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.*;
[ "org.apache.maven" ]
org.apache.maven;
700,152
public long readUint32() throws IOException { return (read() << 24) | (read() << 16) | (read() << 8) | (read() & 0x00FF); }
long function() throws IOException { return (read() << 24) (read() << 16) (read() << 8) (read() & 0x00FF); }
/** * Reads and returns uint32 value. */
Reads and returns uint32 value
readUint32
{ "repo_name": "webos21/xi", "path": "java/jcl/src/java/org/apache/harmony/xnet/provider/jsse/SSLInputStream.java", "license": "apache-2.0", "size": 3793 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
6,149
public void setFile(OCFile file) { mFile = file; }
void function(OCFile file) { mFile = file; }
/** * Setter for the main {@link OCFile} handled by the activity. * * @param file Main {@link OCFile} to be handled by the activity. */
Setter for the main <code>OCFile</code> handled by the activity
setFile
{ "repo_name": "aleister09/android", "path": "src/main/java/com/owncloud/android/ui/activity/FileActivity.java", "license": "gpl-2.0", "size": 23121 }
[ "com.owncloud.android.datamodel.OCFile" ]
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.datamodel.*;
[ "com.owncloud.android" ]
com.owncloud.android;
1,592,518
public static boolean isDebugMode() { return isDebugAvailable() && Window.Location.getParameter("debug") != null; }
static boolean function() { return isDebugAvailable() && Window.Location.getParameter("debug") != null; }
/** * Checks if client side is in debug mode. Practically this is invoked by * adding ?debug parameter to URI. Please note that debug mode is always * disabled if production mode is enabled, but disabling production mode * does not automatically enable debug mode. * * @see #isProductionMode() * * @return true if client side is currently been debugged */
Checks if client side is in debug mode. Practically this is invoked by adding ?debug parameter to URI. Please note that debug mode is always disabled if production mode is enabled, but disabling production mode does not automatically enable debug mode
isDebugMode
{ "repo_name": "udayinfy/vaadin", "path": "client/src/com/vaadin/client/ApplicationConfiguration.java", "license": "apache-2.0", "size": 30304 }
[ "com.google.gwt.user.client.Window" ]
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.*;
[ "com.google.gwt" ]
com.google.gwt;
748,432
@Test @SuppressWarnings("boxing") public void testAccept() { WidgetNode widget = new WidgetNodeBuilder().setIsWidget(true).setName(DataTableWidgetRenderer.DATA_TABLE_WIDGET_NAME).build(); Assert.assertTrue(dataTableWidget.accept(widget)); widget = new WidgetNodeBuilder().setIsWidget(false).setName(DataTableWidgetRenderer.DATA_TABLE_WIDGET_NAME).build(); Assert.assertFalse(dataTableWidget.accept(widget)); widget = new WidgetNodeBuilder().setIsWidget(true).setName("").build(); Assert.assertFalse(dataTableWidget.accept(widget)); }
@SuppressWarnings(STR) void function() { WidgetNode widget = new WidgetNodeBuilder().setIsWidget(true).setName(DataTableWidgetRenderer.DATA_TABLE_WIDGET_NAME).build(); Assert.assertTrue(dataTableWidget.accept(widget)); widget = new WidgetNodeBuilder().setIsWidget(false).setName(DataTableWidgetRenderer.DATA_TABLE_WIDGET_NAME).build(); Assert.assertFalse(dataTableWidget.accept(widget)); widget = new WidgetNodeBuilder().setIsWidget(true).setName("").build(); Assert.assertFalse(dataTableWidget.accept(widget)); }
/** * Test accept method of widget. */
Test accept method of widget
testAccept
{ "repo_name": "SirmaITT/conservation-space-1.7.0", "path": "docker/sirma-platform/platform/seip-parent/platform/domain-model/instance-export/src/test/java/com/sirma/sep/export/renders/DataTableWidgetRendererTest.java", "license": "lgpl-3.0", "size": 80246 }
[ "com.sirma.sep.content.idoc.nodes.WidgetNode", "org.junit.Assert" ]
import com.sirma.sep.content.idoc.nodes.WidgetNode; import org.junit.Assert;
import com.sirma.sep.content.idoc.nodes.*; import org.junit.*;
[ "com.sirma.sep", "org.junit" ]
com.sirma.sep; org.junit;
1,275,904
@Test public void testAddInitializerAfterStart() throws ConcurrentException { initializer.start(); try { initializer.addInitializer(CHILD_INIT, new ChildBackgroundInitializer()); fail("Could add initializer after start()!"); } catch (final IllegalStateException istex) { initializer.get(); } }
void function() throws ConcurrentException { initializer.start(); try { initializer.addInitializer(CHILD_INIT, new ChildBackgroundInitializer()); fail(STR); } catch (final IllegalStateException istex) { initializer.get(); } }
/** * Tries to add another child initializer after the start() method has been * called. This should not be allowed. */
Tries to add another child initializer after the start() method has been called. This should not be allowed
testAddInitializerAfterStart
{ "repo_name": "mureinik/commons-lang", "path": "src/test/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializerTest.java", "license": "apache-2.0", "size": 14756 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,116,729
public void test_setText2() { MessageOnTheScreen mots = MessageOnTheScreen.getInstance(activity, false); mots.setText(activity, new String()); }
void function() { MessageOnTheScreen mots = MessageOnTheScreen.getInstance(activity, false); mots.setText(activity, new String()); }
/** * Setting new text as empty String should not result in any type of * exception. */
Setting new text as empty String should not result in any type of exception
test_setText2
{ "repo_name": "wlawski/libmots", "path": "tests/libmots-tests/src/net/wiktorlawski/messageonthescreen/test/MessageOnTheScreenTest.java", "license": "mit", "size": 11876 }
[ "net.wiktorlawski.messageonthescreen.MessageOnTheScreen" ]
import net.wiktorlawski.messageonthescreen.MessageOnTheScreen;
import net.wiktorlawski.messageonthescreen.*;
[ "net.wiktorlawski.messageonthescreen" ]
net.wiktorlawski.messageonthescreen;
890,406
DataStore getImportedKeys(TableIdentifier target) throws SQLException;
DataStore getImportedKeys(TableIdentifier target) throws SQLException;
/** * Returns a DataStore with the imported keys with the raw information copied from the result * of the DatabaseMetaData.getImportedKeys() * * These are "incoming" foreign keys to the passed table. * * @param target the table to check * @return foreign keys referencing the target table * @throws SQLException */
Returns a DataStore with the imported keys with the raw information copied from the result of the DatabaseMetaData.getImportedKeys() These are "incoming" foreign keys to the passed table
getImportedKeys
{ "repo_name": "Taller/sqlworkbench-plus", "path": "src/workbench/db/FKHandler.java", "license": "apache-2.0", "size": 4314 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,241,323
public void sendAxesToDashboard() { SmartDashboard.putNumber("Gamepad " + port + "Right Stick X:", Math708.round(getAxis(Gamepad.rightStick_X),2)); SmartDashboard.putNumber("Gamepad " + port + "Right Stick Y:", Math708.round(getAxis(Gamepad.rightStick_Y),2)); SmartDashboard.putNumber("Gamepad " + port + "Left Stick X:", Math708.round(getAxis(Gamepad.leftStick_X),2)); SmartDashboard.putNumber("Gamepad " + port + "Left Stick Y:", Math708.round(getAxis(Gamepad.leftStick_Y),2)); }
void function() { SmartDashboard.putNumber(STR + port + STR, Math708.round(getAxis(Gamepad.rightStick_X),2)); SmartDashboard.putNumber(STR + port + STR, Math708.round(getAxis(Gamepad.rightStick_Y),2)); SmartDashboard.putNumber(STR + port + STR, Math708.round(getAxis(Gamepad.leftStick_X),2)); SmartDashboard.putNumber(STR + port + STR, Math708.round(getAxis(Gamepad.leftStick_Y),2)); }
/** * Outputs the gamepad's axes to the SmartDashboard. */
Outputs the gamepad's axes to the SmartDashboard
sendAxesToDashboard
{ "repo_name": "ahctransformers/FRC-Steamworks", "path": "FRC-Steamworks-master/src/org/team708/util/Gamepad.java", "license": "mit", "size": 3705 }
[ "edu.wpi.first.wpilibj.smartdashboard.SmartDashboard" ]
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj.smartdashboard.*;
[ "edu.wpi.first" ]
edu.wpi.first;
1,303,288
public void setPageNumber(Object field) { if (field instanceof String) { try{ pageNumber = Integer.parseInt((String) field); }catch(NumberFormatException e){ pageNumber = 1; } } else { LogWriter.writeFormLog("{FormObject.setPageNumber} pagenumber being set to UNKNOWN type", false); } }
void function(Object field) { if (field instanceof String) { try{ pageNumber = Integer.parseInt((String) field); }catch(NumberFormatException e){ pageNumber = 1; } } else { LogWriter.writeFormLog(STR, false); } }
/** * set the page number for this form */
set the page number for this form
setPageNumber
{ "repo_name": "srnsw/xena", "path": "plugins/pdf/ext/src/jpedal_lgpl-3.83b38/src/org/jpedal/objects/raw/PdfObject.java", "license": "gpl-3.0", "size": 32110 }
[ "org.jpedal.utils.LogWriter" ]
import org.jpedal.utils.LogWriter;
import org.jpedal.utils.*;
[ "org.jpedal.utils" ]
org.jpedal.utils;
487,305
public void createBuffers(float[] positions, float[] colors) { FloatBuffer aTriangleVerticesBuffer; FloatBuffer aTriangleColorBuffer; vertexCount = positions.length/POSITION_DATA_SIZE; // Initialize the buffers. aTriangleVerticesBuffer = ByteBuffer.allocateDirect(positions.length * BYTES_PER_FLOAT) .order(ByteOrder.nativeOrder()).asFloatBuffer(); aTriangleColorBuffer = ByteBuffer.allocateDirect(colors.length * BYTES_PER_FLOAT) .order(ByteOrder.nativeOrder()).asFloatBuffer(); aTriangleVerticesBuffer.put(positions).position(0); aTriangleColorBuffer.put(colors).position(0); GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, glTriangleBuffer[0]); GLES20.glBufferData(GLES20.GL_ARRAY_BUFFER, aTriangleVerticesBuffer.capacity() * BYTES_PER_FLOAT, aTriangleVerticesBuffer, GLES20.GL_STATIC_DRAW); GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, glTriangleBuffer[1]); GLES20.glBufferData(GLES20.GL_ARRAY_BUFFER, aTriangleColorBuffer.capacity() * BYTES_PER_FLOAT, aTriangleColorBuffer, GLES20.GL_STATIC_DRAW); GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, 0); aTrianglePositionsBufferIdx = glTriangleBuffer[0]; aTriangleColorsBufferIdx = glTriangleBuffer[1]; aTriangleVerticesBuffer.limit(0); aTriangleVerticesBuffer = null; aTriangleColorBuffer.limit(0); aTriangleColorBuffer = null; }
void function(float[] positions, float[] colors) { FloatBuffer aTriangleVerticesBuffer; FloatBuffer aTriangleColorBuffer; vertexCount = positions.length/POSITION_DATA_SIZE; aTriangleVerticesBuffer = ByteBuffer.allocateDirect(positions.length * BYTES_PER_FLOAT) .order(ByteOrder.nativeOrder()).asFloatBuffer(); aTriangleColorBuffer = ByteBuffer.allocateDirect(colors.length * BYTES_PER_FLOAT) .order(ByteOrder.nativeOrder()).asFloatBuffer(); aTriangleVerticesBuffer.put(positions).position(0); aTriangleColorBuffer.put(colors).position(0); GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, glTriangleBuffer[0]); GLES20.glBufferData(GLES20.GL_ARRAY_BUFFER, aTriangleVerticesBuffer.capacity() * BYTES_PER_FLOAT, aTriangleVerticesBuffer, GLES20.GL_STATIC_DRAW); GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, glTriangleBuffer[1]); GLES20.glBufferData(GLES20.GL_ARRAY_BUFFER, aTriangleColorBuffer.capacity() * BYTES_PER_FLOAT, aTriangleColorBuffer, GLES20.GL_STATIC_DRAW); GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, 0); aTrianglePositionsBufferIdx = glTriangleBuffer[0]; aTriangleColorsBufferIdx = glTriangleBuffer[1]; aTriangleVerticesBuffer.limit(0); aTriangleVerticesBuffer = null; aTriangleColorBuffer.limit(0); aTriangleColorBuffer = null; }
/** * creates buffers for Triangle shape object * @param positions * @param colors */
creates buffers for Triangle shape object
createBuffers
{ "repo_name": "regar007/ShapesInOpenGLES2.0", "path": "app/src/main/java/com/regar007/shapesinopengles20/Shapes/Triangles.java", "license": "mit", "size": 6100 }
[ "java.nio.ByteBuffer", "java.nio.ByteOrder", "java.nio.FloatBuffer" ]
import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
830,841
public final <U14> Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, U14> map14(Function1<? super T14, ? extends U14> function) { return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, function.apply(v14)); }
final <U14> Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, U14> function(Function1<? super T14, ? extends U14> function) { return Tuple.tuple(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, function.apply(v14)); }
/** * Apply attribute 14 as argument to a function and return a new tuple with the substituted argument. */
Apply attribute 14 as argument to a function and return a new tuple with the substituted argument
map14
{ "repo_name": "amitjoy/jOOL", "path": "src/main/java/org/jooq/lambda/tuple/Tuple14.java", "license": "apache-2.0", "size": 23436 }
[ "org.jooq.lambda.function.Function1" ]
import org.jooq.lambda.function.Function1;
import org.jooq.lambda.function.*;
[ "org.jooq.lambda" ]
org.jooq.lambda;
631,877
public Observable<ServiceResponse<Page<SecurityRuleInner>>> listNextSinglePageAsync(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); }
Observable<ServiceResponse<Page<SecurityRuleInner>>> function(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException(STR); }
/** * Gets all security rules in a network security group. * ServiceResponse<PageImpl<SecurityRuleInner>> * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the PagedList&lt;SecurityRuleInner&gt; object wrapped in {@link ServiceResponse} if successful. */
Gets all security rules in a network security group
listNextSinglePageAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/implementation/SecurityRulesInner.java", "license": "mit", "size": 46827 }
[ "com.microsoft.azure.Page", "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse;
import com.microsoft.azure.*; import com.microsoft.rest.*;
[ "com.microsoft.azure", "com.microsoft.rest" ]
com.microsoft.azure; com.microsoft.rest;
737,832
PrincipalPrivilegeSet get_privilege_set(HiveObjectRef hiveObject, String user_name, List<String> group_names) throws MetaException, TException;
PrincipalPrivilegeSet get_privilege_set(HiveObjectRef hiveObject, String user_name, List<String> group_names) throws MetaException, TException;
/** * Return the privileges that the user, group have directly and indirectly through roles * on the given hiveObject * @param hiveObject * @param user_name * @param group_names * @return the privilege set * @throws MetaException * @throws TException */
Return the privileges that the user, group have directly and indirectly through roles on the given hiveObject
get_privilege_set
{ "repo_name": "winningsix/hive", "path": "metastore/src/java/org/apache/hadoop/hive/metastore/IMetaStoreClient.java", "license": "apache-2.0", "size": 53383 }
[ "java.util.List", "org.apache.hadoop.hive.metastore.api.HiveObjectRef", "org.apache.hadoop.hive.metastore.api.MetaException", "org.apache.hadoop.hive.metastore.api.PrincipalPrivilegeSet", "org.apache.thrift.TException" ]
import java.util.List; import org.apache.hadoop.hive.metastore.api.HiveObjectRef; import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.api.PrincipalPrivilegeSet; import org.apache.thrift.TException;
import java.util.*; import org.apache.hadoop.hive.metastore.api.*; import org.apache.thrift.*;
[ "java.util", "org.apache.hadoop", "org.apache.thrift" ]
java.util; org.apache.hadoop; org.apache.thrift;
2,371,869
public DmContentItemTO getItems(final String site, final String sub, final String relativePath, final int depth, boolean isPage, final String orderName, final boolean checkChildren, boolean populateDependencies) throws ContentNotFoundException; public DmContentItemTO getItems(DmContentItemTO rootItem,final String site, final String sub, final String relativePath, final int depth, boolean isPage, final String orderName, final boolean checkChildren) throws ContentNotFoundException;
DmContentItemTO function(final String site, final String sub, final String relativePath, final int depth, boolean isPage, final String orderName, final boolean checkChildren, boolean populateDependencies) throws ContentNotFoundException; DmContentItemTO function(DmContentItemTO rootItem,final String site, final String sub, final String relativePath, final int depth, boolean isPage, final String orderName, final boolean checkChildren) throws ContentNotFoundException;
/** * get content items from the given relativePath to the given depth * * @param site * @param sub * @param relativePath * the path to start pages from * @param depth * how many levels to walk down the tree * @param isPage * are those content items pages? * @param orderName * which order name to use to sort navigation pages * for floating pages, it will sort them by their internal names alphabetically * @param checkChildren * check each leaf has children or not. if so, # of children will be populate in numOfChildren property * @return root content item * @throws ContentNotFoundException */
get content items from the given relativePath to the given depth
getItems
{ "repo_name": "hlim/studio", "path": "alfresco-svcs/src/main/java/org/craftercms/cstudio/alfresco/dm/service/api/DmContentService.java", "license": "gpl-3.0", "size": 14699 }
[ "org.craftercms.cstudio.alfresco.dm.to.DmContentItemTO", "org.craftercms.cstudio.alfresco.service.exception.ContentNotFoundException" ]
import org.craftercms.cstudio.alfresco.dm.to.DmContentItemTO; import org.craftercms.cstudio.alfresco.service.exception.ContentNotFoundException;
import org.craftercms.cstudio.alfresco.dm.to.*; import org.craftercms.cstudio.alfresco.service.exception.*;
[ "org.craftercms.cstudio" ]
org.craftercms.cstudio;
1,783,123
public Optgroup appendText(String text){ return appendChild(new Text(text)); }
Optgroup function(String text){ return appendChild(new Text(text)); }
/** * Convenience method which appends a text node to this element * @param text the text to be appended * @return the node */
Convenience method which appends a text node to this element
appendText
{ "repo_name": "abdulmudabir/Gagawa", "path": "src/com/hp/gagawa/java/elements/Optgroup.java", "license": "mit", "size": 5076 }
[ "com.hp.gagawa.java.elements.Text" ]
import com.hp.gagawa.java.elements.Text;
import com.hp.gagawa.java.elements.*;
[ "com.hp.gagawa" ]
com.hp.gagawa;
1,850,770
public int doEndTag() throws JspException { if (name == null) { throw new JspException("[TagAttributeTag] No attribute name specified"); } try { PropertyUtils.setProperty(getParent(), name, value); return EVAL_PAGE; } catch (Exception x) { throw new JspException(x); } }
int function() throws JspException { if (name == null) { throw new JspException(STR); } try { PropertyUtils.setProperty(getParent(), name, value); return EVAL_PAGE; } catch (Exception x) { throw new JspException(x); } }
/** * Execute the tag. * * @return EVAL_PAGE. */
Execute the tag
doEndTag
{ "repo_name": "iritgo/iritgo-aktera", "path": "aktera-struts/src/main/java/de/iritgo/aktera/struts/tags/keel/TagAttributeTag.java", "license": "apache-2.0", "size": 2603 }
[ "javax.servlet.jsp.JspException", "org.apache.commons.beanutils.PropertyUtils" ]
import javax.servlet.jsp.JspException; import org.apache.commons.beanutils.PropertyUtils;
import javax.servlet.jsp.*; import org.apache.commons.beanutils.*;
[ "javax.servlet", "org.apache.commons" ]
javax.servlet; org.apache.commons;
40,047
void render(Graphics2D g);
void render(Graphics2D g);
/** * Draw the GameEntity to the graphics device. * * @param g */
Draw the GameEntity to the graphics device
render
{ "repo_name": "SnapGames/simple-java2d-engine", "path": "src/main/java/com/snapgames/s2de/core/entities/GameObject.java", "license": "apache-2.0", "size": 1338 }
[ "java.awt.Graphics2D" ]
import java.awt.Graphics2D;
import java.awt.*;
[ "java.awt" ]
java.awt;
774,155
public void setItems(final List<T> itemList, final Comparator<T> sameItemComparator, final Comparator<T> sameContentComparator) { if (DEBUG) { Log.e(TAG, "new items: " + itemList); Log.e(TAG, "old items: " + mItems); }
void function(final List<T> itemList, final Comparator<T> sameItemComparator, final Comparator<T> sameContentComparator) { if (DEBUG) { Log.e(TAG, STR + itemList); Log.e(TAG, STR + mItems); }
/** * Set a new item list to adapter. The Diffutil will compute the difference and dispatch it to * according position * * @param itemList List of new Items * @param sameItemComparator The comparator to determine if two item are same or not * @param sameContentComparator The comparator to determin if two item's content are same or not */
Set a new item list to adapter. The Diffutil will compute the difference and dispatch it to according position
setItems
{ "repo_name": "googlearchive/leanback-showcase", "path": "app/src/main/java/android/support/v17/leanback/supportleanbackshowcase/app/room/adapter/ListAdapter.java", "license": "apache-2.0", "size": 9530 }
[ "android.util.Log", "java.util.Comparator", "java.util.List" ]
import android.util.Log; import java.util.Comparator; import java.util.List;
import android.util.*; import java.util.*;
[ "android.util", "java.util" ]
android.util; java.util;
105,116
public static ModPacks modpacks() throws Exception { Gson gson = new Gson(); BufferedReader br; br = read("http://mage-tech.org/PAQ/ModPacks.json"); ModPacks modpacks = gson.fromJson(br, ModPacks.class); return modpacks; }
static ModPacks function() throws Exception { Gson gson = new Gson(); BufferedReader br; br = read("http: ModPacks modpacks = gson.fromJson(br, ModPacks.class); return modpacks; }
/** * gets the java object for mod packs * @return the mod pack object * @throws Exception */
gets the java object for mod packs
modpacks
{ "repo_name": "Isaac-Wheeler/PAQ-Installer-V4.0", "path": "Json/json/GetInstallInfo.java", "license": "mit", "size": 2143 }
[ "com.google.gson.Gson", "java.io.BufferedReader" ]
import com.google.gson.Gson; import java.io.BufferedReader;
import com.google.gson.*; import java.io.*;
[ "com.google.gson", "java.io" ]
com.google.gson; java.io;
2,182,284
public SourceFileWriter writeBlockEnd() throws IOException { indent--; writeIndent() .append("}") .append(CRLF) .append(CRLF); return this; }
SourceFileWriter function() throws IOException { indent--; writeIndent() .append("}") .append(CRLF) .append(CRLF); return this; }
/** * Writes the end of a block. * * @return A reference to this writer, for convenience. * @throws IOException If the operation failed. */
Writes the end of a block
writeBlockEnd
{ "repo_name": "DMDirc/Annotations", "path": "src/com/dmdirc/util/annotations/util/SourceFileWriter.java", "license": "mit", "size": 24244 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
874,055
protected User createUserAndInjectSecurityContext( Set<OrganisationUnit> organisationUnits, boolean allAuth, String... auths ) { return createUserAndInjectSecurityContext( organisationUnits, null, allAuth, auths ); }
User function( Set<OrganisationUnit> organisationUnits, boolean allAuth, String... auths ) { return createUserAndInjectSecurityContext( organisationUnits, null, allAuth, auths ); }
/** * Creates a user and injects into the security context with username * "username". Requires <code>identifiableObjectManager</code> and * <code>userService</code> to be injected into the test. * * @param organisationUnits the organisation units of the user. * @param allAuth whether to grant the ALL authority to user. * @param auths authorities to grant to user. * @return the user. */
Creates a user and injects into the security context with username "username". Requires <code>identifiableObjectManager</code> and <code>userService</code> to be injected into the test
createUserAndInjectSecurityContext
{ "repo_name": "vmluan/dhis2-core", "path": "dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java", "license": "bsd-3-clause", "size": 76838 }
[ "java.util.Set", "org.hisp.dhis.organisationunit.OrganisationUnit", "org.hisp.dhis.user.User" ]
import java.util.Set; import org.hisp.dhis.organisationunit.OrganisationUnit; import org.hisp.dhis.user.User;
import java.util.*; import org.hisp.dhis.organisationunit.*; import org.hisp.dhis.user.*;
[ "java.util", "org.hisp.dhis" ]
java.util; org.hisp.dhis;
2,730,177
public List<CmsProperty> readHistoryPropertyObjects(CmsDbContext dbc, I_CmsHistoryResource historyResource) throws CmsException { return getHistoryDriver(dbc).readProperties(dbc, historyResource); }
List<CmsProperty> function(CmsDbContext dbc, I_CmsHistoryResource historyResource) throws CmsException { return getHistoryDriver(dbc).readProperties(dbc, historyResource); }
/** * Reads the list of all <code>{@link CmsProperty}</code> objects that belongs to the given historical resource.<p> * * @param dbc the current database context * @param historyResource the historical resource to read the properties for * * @return the list of <code>{@link CmsProperty}</code> objects * * @throws CmsException if something goes wrong */
Reads the list of all <code><code>CmsProperty</code></code> objects that belongs to the given historical resource
readHistoryPropertyObjects
{ "repo_name": "ggiudetti/opencms-core", "path": "src/org/opencms/db/CmsDriverManager.java", "license": "lgpl-2.1", "size": 494693 }
[ "java.util.List", "org.opencms.file.CmsProperty", "org.opencms.main.CmsException" ]
import java.util.List; import org.opencms.file.CmsProperty; import org.opencms.main.CmsException;
import java.util.*; import org.opencms.file.*; import org.opencms.main.*;
[ "java.util", "org.opencms.file", "org.opencms.main" ]
java.util; org.opencms.file; org.opencms.main;
2,877,436
public BigRunner makeRemoveToolFromWorkspacesRunner(final String toolId) { // check for admin first final String currentUserId = getCurrentUserId(); if (currentUserId == null || !isUserAdmin(currentUserId)) { throw new SecurityException("current user (" + currentUserId + ") cannot push tool into worksites, only the admin can perform this operation"); } // get the tool final Tool tool = toolManager.getTool(toolId); if (tool == null) { throw new IllegalArgumentException("toolId (" + toolId + ") is invalid, could not find tool"); }
BigRunner function(final String toolId) { final String currentUserId = getCurrentUserId(); if (currentUserId == null !isUserAdmin(currentUserId)) { throw new SecurityException(STR + currentUserId + STR); } final Tool tool = toolManager.getTool(toolId); if (tool == null) { throw new IllegalArgumentException(STR + toolId + STR); }
/** * Create runner to remove the tool from all my workspaces * <br/> * NOTE: take steps to ensure this cannot be run more than once * * @param toolId the id of the tool you want to add (ie sakai.iclicker) * @return an object that can be used to track the process * @throws SecurityException if non-admin tries to use this * @throws IllegalArgumentException if the toolId is invalid * @throws RuntimeException if there is a failure */
Create runner to remove the tool from all my workspaces
makeRemoveToolFromWorkspacesRunner
{ "repo_name": "azeckoski/iclicker-sakai-integrate", "path": "src/main/java/org/sakaiproject/iclicker/logic/AbstractExternalLogic.java", "license": "gpl-3.0", "size": 48336 }
[ "org.sakaiproject.tool.api.Tool" ]
import org.sakaiproject.tool.api.Tool;
import org.sakaiproject.tool.api.*;
[ "org.sakaiproject.tool" ]
org.sakaiproject.tool;
2,653,131
protected Object convertToDate(final Class<?> type, final Object value, final String pattern) { final DateFormat df = new SimpleDateFormat(pattern); if (value instanceof String) { try { if (StringUtils.isEmpty(value.toString())) { return null; } final Date date = df.parse((String) value); if (type.equals(Timestamp.class)) { return new Timestamp(date.getTime()); } return date; } catch (final Exception e) { throw new ConversionException("Error converting String to Date", e); } } throw new ConversionException("Could not convert " + value.getClass().getName() + " to " + type.getName()); }
Object function(final Class<?> type, final Object value, final String pattern) { final DateFormat df = new SimpleDateFormat(pattern); if (value instanceof String) { try { if (StringUtils.isEmpty(value.toString())) { return null; } final Date date = df.parse((String) value); if (type.equals(Timestamp.class)) { return new Timestamp(date.getTime()); } return date; } catch (final Exception e) { throw new ConversionException(STR, e); } } throw new ConversionException(STR + value.getClass().getName() + STR + type.getName()); }
/** * Convert a String to a Date with the specified pattern. * @param type String * @param value value of String * @param pattern date pattern to parse with * @return Converted value for property population */
Convert a String to a Date with the specified pattern
convertToDate
{ "repo_name": "yyitsz/myjavastudio", "path": "studyappfuse/core/src/main/java/org/yy/util/DateConverter.java", "license": "apache-2.0", "size": 3236 }
[ "java.sql.Timestamp", "java.text.DateFormat", "java.text.SimpleDateFormat", "java.util.Date", "org.apache.commons.beanutils.ConversionException", "org.apache.commons.lang.StringUtils" ]
import java.sql.Timestamp; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import org.apache.commons.beanutils.ConversionException; import org.apache.commons.lang.StringUtils;
import java.sql.*; import java.text.*; import java.util.*; import org.apache.commons.beanutils.*; import org.apache.commons.lang.*;
[ "java.sql", "java.text", "java.util", "org.apache.commons" ]
java.sql; java.text; java.util; org.apache.commons;
547,885
public static DebuggableScript getDebuggableView(Script script) { if (script instanceof NativeFunction) { return ((NativeFunction)script).getDebuggableView(); } return null; } /** * Controls certain aspects of script semantics. * Should be overwritten to alter default behavior. * <p> * The default implementation calls * {@link ContextFactory#hasFeature(Context cx, int featureIndex)}
static DebuggableScript function(Script script) { if (script instanceof NativeFunction) { return ((NativeFunction)script).getDebuggableView(); } return null; } /** * Controls certain aspects of script semantics. * Should be overwritten to alter default behavior. * <p> * The default implementation calls * {@link ContextFactory#hasFeature(Context cx, int featureIndex)}
/** * Return DebuggableScript instance if any associated with the script. * If callable supports DebuggableScript implementation, the method * returns it. Otherwise null is returned. */
Return DebuggableScript instance if any associated with the script. If callable supports DebuggableScript implementation, the method returns it. Otherwise null is returned
getDebuggableView
{ "repo_name": "dound/google-closure-compiler", "path": "lib/rhino/src/org/mozilla/javascript/Context.java", "license": "apache-2.0", "size": 97868 }
[ "org.mozilla.javascript.debug.DebuggableScript" ]
import org.mozilla.javascript.debug.DebuggableScript;
import org.mozilla.javascript.debug.*;
[ "org.mozilla.javascript" ]
org.mozilla.javascript;
2,445,226
RFuture<Boolean> awaitAsync(long waitTime, TimeUnit unit);
RFuture<Boolean> awaitAsync(long waitTime, TimeUnit unit);
/** * Waits until counter reach zero or up to defined <code>timeout</code>. * * @param waitTime the maximum time to wait * @param unit the time unit * @return <code>true</code> if the count reached zero and <code>false</code> * if timeout reached before the count reached zero */
Waits until counter reach zero or up to defined <code>timeout</code>
awaitAsync
{ "repo_name": "mrniko/redisson", "path": "redisson/src/main/java/org/redisson/api/RCountDownLatchAsync.java", "license": "apache-2.0", "size": 2273 }
[ "java.util.concurrent.TimeUnit" ]
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
2,084,410
private void setDateByMilliseconds(int pos, Long value) throws SQLException { switch(conn.dateClass) { case TEXT: batch(pos, conn.dateFormat.format(new Date(value))); break; case REAL: // long to Julian date batch(pos, new Double((value/86400000.0) + 2440587.5)); break; default: //INTEGER: batch(pos, new Long(value / conn.dateMultiplier)); } }
void function(int pos, Long value) throws SQLException { switch(conn.dateClass) { case TEXT: batch(pos, conn.dateFormat.format(new Date(value))); break; case REAL: batch(pos, new Double((value/86400000.0) + 2440587.5)); break; default: batch(pos, new Long(value / conn.dateMultiplier)); } }
/** * Store the date in the user's preferred format (text, int, or real) */
Store the date in the user's preferred format (text, int, or real)
setDateByMilliseconds
{ "repo_name": "amitgcse/sqlite-jdbc", "path": "src/main/java/org/sqlite/PrepStmt.java", "license": "apache-2.0", "size": 16663 }
[ "java.sql.Date", "java.sql.SQLException" ]
import java.sql.Date; import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
391,712
public static java.util.Set extractUserAssessmentSet(ims.domain.ILightweightDomainFactory domainFactory, ims.assessment.vo.User_AssessmentVoCollection voCollection) { return extractUserAssessmentSet(domainFactory, voCollection, null, new HashMap()); }
static java.util.Set function(ims.domain.ILightweightDomainFactory domainFactory, ims.assessment.vo.User_AssessmentVoCollection voCollection) { return extractUserAssessmentSet(domainFactory, voCollection, null, new HashMap()); }
/** * Create the ims.assessment.configuration.domain.objects.UserAssessment set from the value object collection. * @param domainFactory - used to create existing (persistent) domain objects. * @param voCollection - the collection of value objects */
Create the ims.assessment.configuration.domain.objects.UserAssessment set from the value object collection
extractUserAssessmentSet
{ "repo_name": "open-health-hub/openMAXIMS", "path": "openmaxims_workspace/ValueObjects/src/ims/assessment/vo/domain/User_AssessmentVoAssembler.java", "license": "agpl-3.0", "size": 32408 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
1,893,664
protected int entityIndex(Entity entity) { return Arrays.binarySearch(entities, entity); } // ****** // Object // ******
int function(Entity entity) { return Arrays.binarySearch(entities, entity); }
/** * Check whether the device contains the specified entity * @param entity the entity to search for * @return the index of the entity, or <0 if not found */
Check whether the device contains the specified entity
entityIndex
{ "repo_name": "Syn-Flow/Controller", "path": "src/main/java/net/floodlightcontroller/devicemanager/internal/Device.java", "license": "apache-2.0", "size": 28037 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
2,458,115
public void write(final OutputStream out) throws IOException { if (this.nsTimestamps) { if (this.byteOrder == ByteOrder.BIG_ENDIAN) { out.write(MAGIC_NSEC); } else { out.write(MAGIC_NSEC_SWAPPED); } } else { if (this.byteOrder == ByteOrder.BIG_ENDIAN) { out.write(MAGIC_BIG_ENDIAN); } else { out.write(MAGIC_LITTLE_ENDIAN); } } out.write(this.body); }
void function(final OutputStream out) throws IOException { if (this.nsTimestamps) { if (this.byteOrder == ByteOrder.BIG_ENDIAN) { out.write(MAGIC_NSEC); } else { out.write(MAGIC_NSEC_SWAPPED); } } else { if (this.byteOrder == ByteOrder.BIG_ENDIAN) { out.write(MAGIC_BIG_ENDIAN); } else { out.write(MAGIC_LITTLE_ENDIAN); } } out.write(this.body); }
/** * Will write this header to the output stream. * * @param out */
Will write this header to the output stream
write
{ "repo_name": "aboutsip/pkts", "path": "pkts-core/src/main/java/io/pkts/frame/PcapGlobalHeader.java", "license": "mit", "size": 9612 }
[ "java.io.IOException", "java.io.OutputStream", "java.nio.ByteOrder" ]
import java.io.IOException; import java.io.OutputStream; import java.nio.ByteOrder;
import java.io.*; import java.nio.*;
[ "java.io", "java.nio" ]
java.io; java.nio;
2,293,885
// Since Bundle#getCharSequenceArrayList returns concrete ArrayList type, so this method follows that implementation. @TargetApi(Build.VERSION_CODES.FROYO) @Nullable public static ArrayList<CharSequence> optCharSequenceArrayList(@Nullable Bundle bundle, @Nullable String key, @Nullable ArrayList<CharSequence> fallback) { if (bundle == null) { return fallback; } return bundle.getCharSequenceArrayList(key); }
@TargetApi(Build.VERSION_CODES.FROYO) static ArrayList<CharSequence> function(@Nullable Bundle bundle, @Nullable String key, @Nullable ArrayList<CharSequence> fallback) { if (bundle == null) { return fallback; } return bundle.getCharSequenceArrayList(key); }
/** * Returns a optional {@link CharSequence} {@link ArrayList} value. In other words, returns the value mapped by key if it exists and is a {@link CharSequence} {@link ArrayList}. * The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns null. * @param bundle a bundle. If the bundle is null, this method will return null. * @param key a key for the value. * @param fallback fallback value. * @return a {@link CharSequence} {@link ArrayList} value if exists, null otherwise. * @see android.os.Bundle#getCharSequenceArrayList(String) */
Returns a optional <code>CharSequence</code> <code>ArrayList</code> value. In other words, returns the value mapped by key if it exists and is a <code>CharSequence</code> <code>ArrayList</code>. The bundle argument is allowed to be null. If the bundle is null, this method returns null
optCharSequenceArrayList
{ "repo_name": "nohana/Amalgam", "path": "amalgam/src/main/java/com/amalgam/os/BundleUtils.java", "license": "apache-2.0", "size": 55053 }
[ "android.annotation.TargetApi", "android.os.Build", "android.os.Bundle", "android.support.annotation.Nullable", "java.util.ArrayList" ]
import android.annotation.TargetApi; import android.os.Build; import android.os.Bundle; import android.support.annotation.Nullable; import java.util.ArrayList;
import android.annotation.*; import android.os.*; import android.support.annotation.*; import java.util.*;
[ "android.annotation", "android.os", "android.support", "java.util" ]
android.annotation; android.os; android.support; java.util;
1,168,793
@Test public void nullTest() { PositiveBoundHiveVarchar.PositiveBoundHiveVarcharTag pos = new PositiveBoundHiveVarchar.PositiveBoundHiveVarcharTag(); pos.setNullable("true"); Assert.assertEquals(pos.getNullable(), "true"); pos.setNullable("false"); Assert.assertEquals(pos.getNullable(), "false"); }
void function() { PositiveBoundHiveVarchar.PositiveBoundHiveVarcharTag pos = new PositiveBoundHiveVarchar.PositiveBoundHiveVarcharTag(); pos.setNullable("true"); Assert.assertEquals(pos.getNullable(), "true"); pos.setNullable("false"); Assert.assertEquals(pos.getNullable(), "false"); }
/** * test for setNullable() and getNullable() */
test for setNullable() and getNullable()
nullTest
{ "repo_name": "SamerAdra/DataGenerator", "path": "dg-core/src/test/java/org/finra/datagenerator/engine/scxml/tags/boundary/PositiveBoundHiveVarcharTest.java", "license": "apache-2.0", "size": 4793 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
2,178,398
public JSONObject processQuery(String query) throws IOException { log("API", Level.FINEST, query); try { URL get = new URL(query); Reader reader = new InputStreamReader(get.openStream(), "UTF-8"); StringWriter output = new StringWriter(); int next = reader.read(); while (next != -1) { output.write(next); next = reader.read(); } String result = output.toString(); log("JSON", Level.FINEST, result); return new JSONObject(result); } catch (Exception exception) { log(exception); return null; } }
JSONObject function(String query) throws IOException { log("API", Level.FINEST, query); try { URL get = new URL(query); Reader reader = new InputStreamReader(get.openStream(), "UTF-8"); StringWriter output = new StringWriter(); int next = reader.read(); while (next != -1) { output.write(next); next = reader.read(); } String result = output.toString(); log("JSON", Level.FINEST, result); return new JSONObject(result); } catch (Exception exception) { log(exception); return null; } }
/** * Process the mql query and convert the result to a JSON object. */
Process the mql query and convert the result to a JSON object
processQuery
{ "repo_name": "BOTlibre/BOTlibre", "path": "micro-ai-engine/android/source/org/botlibre/sense/wikidata/Wikidata.java", "license": "epl-1.0", "size": 29781 }
[ "java.io.IOException", "java.io.InputStreamReader", "java.io.Reader", "java.io.StringWriter", "java.util.logging.Level", "org.json.JSONObject" ]
import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; import java.io.StringWriter; import java.util.logging.Level; import org.json.JSONObject;
import java.io.*; import java.util.logging.*; import org.json.*;
[ "java.io", "java.util", "org.json" ]
java.io; java.util; org.json;
2,207,531
@LogMessage(level = WARN) @Message(id = 2, value = "%s annotation not on Class or Method: %s") void classOrMethodAnnotationNotFound(String annotation, AnnotationTarget target);
@LogMessage(level = WARN) @Message(id = 2, value = STR) void classOrMethodAnnotationNotFound(String annotation, AnnotationTarget target);
/** * Logs a warning message indicating the annotation, represented by the {@code annotation} parameter, not on Class * or Method, represented by the {@code target} parameter. * * @param annotation the missing annotation. * @param target the target. */
Logs a warning message indicating the annotation, represented by the annotation parameter, not on Class or Method, represented by the target parameter
classOrMethodAnnotationNotFound
{ "repo_name": "xasx/wildfly", "path": "jaxrs/src/main/java/org/jboss/as/jaxrs/logging/JaxrsLogger.java", "license": "lgpl-2.1", "size": 9445 }
[ "org.jboss.jandex.AnnotationTarget", "org.jboss.logging.annotations.LogMessage", "org.jboss.logging.annotations.Message" ]
import org.jboss.jandex.AnnotationTarget; import org.jboss.logging.annotations.LogMessage; import org.jboss.logging.annotations.Message;
import org.jboss.jandex.*; import org.jboss.logging.annotations.*;
[ "org.jboss.jandex", "org.jboss.logging" ]
org.jboss.jandex; org.jboss.logging;
2,348,468
@Test @SmallTest @MinWebLayerVersion(89) public void testExternalIntentNavigationParamSetOnIntentLaunchViaLinkClick() throws Throwable { // Set up all the prerequisites. InstrumentationActivity activity = mActivityTestRule.launchShellWithUrl(ABOUT_BLANK_URL); IntentInterceptor intentInterceptor = new IntentInterceptor(); activity.setIntentInterceptor(intentInterceptor); Tab tab = mActivityTestRule.getActivity().getTab();
@MinWebLayerVersion(89) void function() throws Throwable { InstrumentationActivity activity = mActivityTestRule.launchShellWithUrl(ABOUT_BLANK_URL); IntentInterceptor intentInterceptor = new IntentInterceptor(); activity.setIntentInterceptor(intentInterceptor); Tab tab = mActivityTestRule.getActivity().getTab();
/** * Tests that Navigation#wasIntentLaunched() is correctly set on a navigation to an intent that * is initiated via a link click. */
Tests that Navigation#wasIntentLaunched() is correctly set on a navigation to an intent that is initiated via a link click
testExternalIntentNavigationParamSetOnIntentLaunchViaLinkClick
{ "repo_name": "chromium/chromium", "path": "weblayer/browser/android/javatests/src/org/chromium/weblayer/test/ExternalNavigationTest.java", "license": "bsd-3-clause", "size": 76069 }
[ "org.chromium.weblayer.Tab", "org.chromium.weblayer.shell.InstrumentationActivity" ]
import org.chromium.weblayer.Tab; import org.chromium.weblayer.shell.InstrumentationActivity;
import org.chromium.weblayer.*; import org.chromium.weblayer.shell.*;
[ "org.chromium.weblayer" ]
org.chromium.weblayer;
1,489,569
public List<Tuple3<FieldsReactionInstance, FieldsIsReagentIn, FieldsCompoundInstance>> getRelationshipTargets(List<String> ids, List<String> fromFields, List<String> relFields, List<String> toFields) throws IOException, JsonClientException { List<Object> args = new ArrayList<Object>(); args.add(ids); args.add(fromFields); args.add(relFields); args.add(toFields); TypeReference<List<List<Tuple3<FieldsReactionInstance, FieldsIsReagentIn, FieldsCompoundInstance>>>> retType = new TypeReference<List<List<Tuple3<FieldsReactionInstance, FieldsIsReagentIn, FieldsCompoundInstance>>>>() {}; List<List<Tuple3<FieldsReactionInstance, FieldsIsReagentIn, FieldsCompoundInstance>>> res = caller.jsonrpcCall("CDMI_EntityAPI.get_relationship_Targets", args, retType, true, false); return res.get(0); }
List<Tuple3<FieldsReactionInstance, FieldsIsReagentIn, FieldsCompoundInstance>> function(List<String> ids, List<String> fromFields, List<String> relFields, List<String> toFields) throws IOException, JsonClientException { List<Object> args = new ArrayList<Object>(); args.add(ids); args.add(fromFields); args.add(relFields); args.add(toFields); TypeReference<List<List<Tuple3<FieldsReactionInstance, FieldsIsReagentIn, FieldsCompoundInstance>>>> retType = new TypeReference<List<List<Tuple3<FieldsReactionInstance, FieldsIsReagentIn, FieldsCompoundInstance>>>>() {}; List<List<Tuple3<FieldsReactionInstance, FieldsIsReagentIn, FieldsCompoundInstance>>> res = caller.jsonrpcCall(STR, args, retType, true, false); return res.get(0); }
/** * <p>Original spec-file function name: get_relationship_Targets</p> * <pre> * </pre> * @param ids instance of list of String * @param fromFields instance of list of String * @param relFields instance of list of String * @param toFields instance of list of String * @return instance of list of tuple of size 3: type {@link us.kbase.cdmientityapi.FieldsReactionInstance FieldsReactionInstance} (original type "fields_ReactionInstance"), type {@link us.kbase.cdmientityapi.FieldsIsReagentIn FieldsIsReagentIn} (original type "fields_IsReagentIn"), type {@link us.kbase.cdmientityapi.FieldsCompoundInstance FieldsCompoundInstance} (original type "fields_CompoundInstance") * @throws IOException if an IO exception occurs * @throws JsonClientException if a JSON RPC exception occurs */
Original spec-file function name: get_relationship_Targets <code> </code>
getRelationshipTargets
{ "repo_name": "kbase/trees", "path": "src/us/kbase/cdmientityapi/CDMIEntityAPIClient.java", "license": "mit", "size": 869221 }
[ "com.fasterxml.jackson.core.type.TypeReference", "java.io.IOException", "java.util.ArrayList", "java.util.List", "us.kbase.common.service.JsonClientException", "us.kbase.common.service.Tuple3" ]
import com.fasterxml.jackson.core.type.TypeReference; import java.io.IOException; import java.util.ArrayList; import java.util.List; import us.kbase.common.service.JsonClientException; import us.kbase.common.service.Tuple3;
import com.fasterxml.jackson.core.type.*; import java.io.*; import java.util.*; import us.kbase.common.service.*;
[ "com.fasterxml.jackson", "java.io", "java.util", "us.kbase.common" ]
com.fasterxml.jackson; java.io; java.util; us.kbase.common;
1,967,687
@Override protected void setStyle(String attrVal, View<? extends CyIdentifiable> elementView) { String[] styleAttrs = attrVal.split(","); // Get default node visibility boolean isVisibleDefault = vizStyle.getDefaultValue(EDGE_VISIBLE); for (String styleAttr : styleAttrs) { styleAttr = styleAttr.trim(); LineType lineType = LINE_TYPE_MAP.get(styleAttr); // set line type if defined if (lineType != null) { elementView.setLockedValue(EDGE_LINE_TYPE, lineType); } } // check if invisible is enabled if( attrVal.contains("invis") ) { if (isVisibleDefault) { elementView.setLockedValue(EDGE_VISIBLE, false); } } else { if (!isVisibleDefault) { elementView.setLockedValue(EDGE_VISIBLE, true); } } }
void function(String attrVal, View<? extends CyIdentifiable> elementView) { String[] styleAttrs = attrVal.split(","); boolean isVisibleDefault = vizStyle.getDefaultValue(EDGE_VISIBLE); for (String styleAttr : styleAttrs) { styleAttr = styleAttr.trim(); LineType lineType = LINE_TYPE_MAP.get(styleAttr); if (lineType != null) { elementView.setLockedValue(EDGE_LINE_TYPE, lineType); } } if( attrVal.contains("invis") ) { if (isVisibleDefault) { elementView.setLockedValue(EDGE_VISIBLE, false); } } else { if (!isVisibleDefault) { elementView.setLockedValue(EDGE_VISIBLE, true); } } }
/** * Converts the GraphViz "style" attribute into VisualProperty bypass values * for a Cytoscape View object * * @param attrVal String that is the value of "style" (eg. "dashed, round") * @param elementView view to which "style" is being applied */
Converts the GraphViz "style" attribute into VisualProperty bypass values for a Cytoscape View object
setStyle
{ "repo_name": "bdtfitts/dot-app", "path": "src/main/java/org/cytoscape/intern/read/reader/EdgeReader.java", "license": "gpl-3.0", "size": 17018 }
[ "org.cytoscape.model.CyIdentifiable", "org.cytoscape.view.model.View", "org.cytoscape.view.presentation.property.values.LineType" ]
import org.cytoscape.model.CyIdentifiable; import org.cytoscape.view.model.View; import org.cytoscape.view.presentation.property.values.LineType;
import org.cytoscape.model.*; import org.cytoscape.view.model.*; import org.cytoscape.view.presentation.property.values.*;
[ "org.cytoscape.model", "org.cytoscape.view" ]
org.cytoscape.model; org.cytoscape.view;
2,061,734
public List<ApplicationTemplate> listApplicationTemplates() throws ManagementWsException { return listApplicationTemplates( null, null ); }
List<ApplicationTemplate> function() throws ManagementWsException { return listApplicationTemplates( null, null ); }
/** * Lists all the application templates. * <p> * Equivalent to <code>listApplicationTemplates( null, null )</code>. * </p> * * @return a non-null list of application templates * @throws ManagementWsException if a problem occurred with the applications management */
Lists all the application templates. Equivalent to <code>listApplicationTemplates( null, null )</code>.
listApplicationTemplates
{ "repo_name": "gibello/roboconf", "path": "miscellaneous/roboconf-dm-rest-client/src/main/java/net/roboconf/dm/rest/client/delegates/ManagementWsDelegate.java", "license": "apache-2.0", "size": 13690 }
[ "java.util.List", "net.roboconf.core.model.beans.ApplicationTemplate", "net.roboconf.dm.rest.client.exceptions.ManagementWsException" ]
import java.util.List; import net.roboconf.core.model.beans.ApplicationTemplate; import net.roboconf.dm.rest.client.exceptions.ManagementWsException;
import java.util.*; import net.roboconf.core.model.beans.*; import net.roboconf.dm.rest.client.exceptions.*;
[ "java.util", "net.roboconf.core", "net.roboconf.dm" ]
java.util; net.roboconf.core; net.roboconf.dm;
1,433,065
public void register(int rc) { if (shouldAddWatch(rc)) { Map<String, Set<Watcher>> watches = getWatches(rc); synchronized(watches) { Set<Watcher> watchers = watches.get(clientPath); if (watchers == null) { watchers = new HashSet<Watcher>(); watches.put(clientPath, watchers); } watchers.add(watcher); } } }
void function(int rc) { if (shouldAddWatch(rc)) { Map<String, Set<Watcher>> watches = getWatches(rc); synchronized(watches) { Set<Watcher> watchers = watches.get(clientPath); if (watchers == null) { watchers = new HashSet<Watcher>(); watches.put(clientPath, watchers); } watchers.add(watcher); } } }
/** * Register the watcher with the set of watches on path. * @param rc the result code of the operation that attempted to * add the watch on the path. */
Register the watcher with the set of watches on path
register
{ "repo_name": "xiaofu/zookeeper-zookeeper-3.3.4-cdh3u3-maven", "path": "src/main/java/org/apache/zookeeper/ZooKeeper.java", "license": "apache-2.0", "size": 61012 }
[ "java.util.HashSet", "java.util.Map", "java.util.Set" ]
import java.util.HashSet; import java.util.Map; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,483,940
public static Condition<Transition> getSignatureOfCondition(Signature signature) { return new SignatureOf<Transition>(signature); }
static Condition<Transition> function(Signature signature) { return new SignatureOf<Transition>(signature); }
/** * Returns a Condition<Transition> which is fulfilled for transtions which have the * sigtnature 'signature' */
Returns a Condition which is fulfilled for transtions which have the sigtnature 'signature'
getSignatureOfCondition
{ "repo_name": "hpiasg/desij", "path": "src/main/java/net/strongdesign/stg/traversal/ConditionFactory.java", "license": "mit", "size": 59144 }
[ "net.strongdesign.stg.Signature", "net.strongdesign.stg.Transition" ]
import net.strongdesign.stg.Signature; import net.strongdesign.stg.Transition;
import net.strongdesign.stg.*;
[ "net.strongdesign.stg" ]
net.strongdesign.stg;
2,047,501
@ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String routeFilterName, Context context);
@ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String routeFilterName, Context context);
/** * Deletes the specified route filter. * * @param resourceGroupName The name of the resource group. * @param routeFilterName The name of the route filter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */
Deletes the specified route filter
delete
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/RouteFiltersClient.java", "license": "mit", "size": 23978 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.util.Context" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context;
import com.azure.core.annotation.*; import com.azure.core.util.*;
[ "com.azure.core" ]
com.azure.core;
2,399,684
public ProtectionIntentResourceInner withProperties(ProtectionIntent properties) { this.properties = properties; return this; }
ProtectionIntentResourceInner function(ProtectionIntent properties) { this.properties = properties; return this; }
/** * Set the properties property: ProtectionIntentResource properties. * * @param properties the properties value to set. * @return the ProtectionIntentResourceInner object itself. */
Set the properties property: ProtectionIntentResource properties
withProperties
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/recoveryservicesbackup/azure-resourcemanager-recoveryservicesbackup/src/main/java/com/azure/resourcemanager/recoveryservicesbackup/fluent/models/ProtectionIntentResourceInner.java", "license": "mit", "size": 2679 }
[ "com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionIntent" ]
import com.azure.resourcemanager.recoveryservicesbackup.models.ProtectionIntent;
import com.azure.resourcemanager.recoveryservicesbackup.models.*;
[ "com.azure.resourcemanager" ]
com.azure.resourcemanager;
2,427,458
public boolean isConnectionAllowed(List<SshConnection> connections, Socket socket) { long numberOfConnectionsFromThisIp = connections.stream() .filter(connection -> isTwoConnectionReferToSameIp(socket, connection)) .count(); return numberOfConnectionsFromThisIp < numberOfConnectionAllowedFromSameIp; }
boolean function(List<SshConnection> connections, Socket socket) { long numberOfConnectionsFromThisIp = connections.stream() .filter(connection -> isTwoConnectionReferToSameIp(socket, connection)) .count(); return numberOfConnectionsFromThisIp < numberOfConnectionAllowedFromSameIp; }
/** * Check whether to allowed the given socket to connect. * If there are too many connections from the same IP, the connection will be rejected * @param connections already established connections * @param socket to check whether allowed to connect * @return true if allowed, false otherwise */
Check whether to allowed the given socket to connect. If there are too many connections from the same IP, the connection will be rejected
isConnectionAllowed
{ "repo_name": "helospark/FakeSsh", "path": "src/main/java/com/helospark/FakeSsh/ConnectionPermissionCheckingService.java", "license": "mit", "size": 1835 }
[ "java.net.Socket", "java.util.List" ]
import java.net.Socket; import java.util.List;
import java.net.*; import java.util.*;
[ "java.net", "java.util" ]
java.net; java.util;
653,795
public void setValue(String value) { Preconditions.checkNotNull(value); Preconditions.checkArgument(!value.isEmpty()); this.value = value; }
void function(String value) { Preconditions.checkNotNull(value); Preconditions.checkArgument(!value.isEmpty()); this.value = value; }
/** * Subclasses should perform additional consistency checks. For example, a * boolean expression node will not allow setting this as boolean expression * trees are immutable. */
Subclasses should perform additional consistency checks. For example, a boolean expression node will not allow setting this as boolean expression trees are immutable
setValue
{ "repo_name": "gravitydev/closure-stylesheets", "path": "src/com/google/common/css/compiler/ast/CssValueNode.java", "license": "apache-2.0", "size": 2653 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
1,042,501
EReference getNamedObject_LeftMig();
EReference getNamedObject_LeftMig();
/** * Returns the meta object for the containment reference '{@link org.eclipse.xtext.parser.epatch.epatchTestLanguage.NamedObject#getLeftMig <em>Left Mig</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference '<em>Left Mig</em>'. * @see org.eclipse.xtext.parser.epatch.epatchTestLanguage.NamedObject#getLeftMig() * @see #getNamedObject() * @generated */
Returns the meta object for the containment reference '<code>org.eclipse.xtext.parser.epatch.epatchTestLanguage.NamedObject#getLeftMig Left Mig</code>'.
getNamedObject_LeftMig
{ "repo_name": "miklossy/xtext-core", "path": "org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/parser/epatch/epatchTestLanguage/EpatchTestLanguagePackage.java", "license": "epl-1.0", "size": 81411 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
199,359
public void addUpdateListener(AnimatorUpdateListener listener) { if (mUpdateListeners == null) { mUpdateListeners = new ArrayList<AnimatorUpdateListener>(); } mUpdateListeners.add(listener); }
void function(AnimatorUpdateListener listener) { if (mUpdateListeners == null) { mUpdateListeners = new ArrayList<AnimatorUpdateListener>(); } mUpdateListeners.add(listener); }
/** * Adds a listener to the set of listeners that are sent update events through the life of * an animation. This method is called on all listeners for every frame of the animation, * after the values for the animation have been calculated. * * @param listener the listener to be added to the current set of listeners for this animation. */
Adds a listener to the set of listeners that are sent update events through the life of an animation. This method is called on all listeners for every frame of the animation, after the values for the animation have been calculated
addUpdateListener
{ "repo_name": "TheRealEyeless/android-simple-loan-calculator", "path": "library/src/com/actionbarsherlock/internal/nineoldandroids/animation/ValueAnimator.java", "license": "gpl-3.0", "size": 53573 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,665,591
public ObjectIterator<Float2ReferenceMap.Entry <V> > fastIterator(); }
ObjectIterator<Float2ReferenceMap.Entry <V> > function(); }
/** Returns a fast iterator over this entry set; the iterator might return always the same entry object, suitably mutated. * * @return a fast iterator over this entry set; the iterator might return always the same {@link java.util.Map.Entry} object, suitably mutated. */
Returns a fast iterator over this entry set; the iterator might return always the same entry object, suitably mutated
fastIterator
{ "repo_name": "karussell/fastutil", "path": "src/it/unimi/dsi/fastutil/floats/Float2ReferenceMap.java", "license": "apache-2.0", "size": 5079 }
[ "it.unimi.dsi.fastutil.objects.ObjectIterator" ]
import it.unimi.dsi.fastutil.objects.ObjectIterator;
import it.unimi.dsi.fastutil.objects.*;
[ "it.unimi.dsi" ]
it.unimi.dsi;
764,568
public Column setConverter(Converter<?, ?> converter) throws IllegalArgumentException { Class<?> modelType = getModelType(); if (converter != null) { if (!converter.getModelType().isAssignableFrom(modelType)) { throw new IllegalArgumentException( "The converter model type " + converter.getModelType() + " is not compatible with the property type " + modelType + " (in " + toString() + ")"); } else if (!getRenderer().getPresentationType() .isAssignableFrom(converter.getPresentationType())) { throw new IllegalArgumentException( "The converter presentation type " + converter.getPresentationType() + " is not compatible with the renderer presentation type " + getRenderer().getPresentationType() + " (in " + toString() + ")"); } } else { Class<?> rendererPresentationType = getRenderer() .getPresentationType(); if (!isFirstConverterAssignment && !rendererPresentationType .isAssignableFrom(modelType)) { throw new IllegalArgumentException( "Cannot remove converter, " + "as renderer's presentation type " + rendererPresentationType.getName() + " and column's " + "model " + modelType.getName() + " type aren't " + "directly compatible with each other (in " + toString() + ")"); } } isFirstConverterAssignment = false; @SuppressWarnings("unchecked") Converter<?, Object> castConverter = (Converter<?, Object>) converter; this.converter = castConverter; return this; }
Column function(Converter<?, ?> converter) throws IllegalArgumentException { Class<?> modelType = getModelType(); if (converter != null) { if (!converter.getModelType().isAssignableFrom(modelType)) { throw new IllegalArgumentException( STR + converter.getModelType() + STR + modelType + STR + toString() + ")"); } else if (!getRenderer().getPresentationType() .isAssignableFrom(converter.getPresentationType())) { throw new IllegalArgumentException( STR + converter.getPresentationType() + STR + getRenderer().getPresentationType() + STR + toString() + ")"); } } else { Class<?> rendererPresentationType = getRenderer() .getPresentationType(); if (!isFirstConverterAssignment && !rendererPresentationType .isAssignableFrom(modelType)) { throw new IllegalArgumentException( STR + STR + rendererPresentationType.getName() + STR + STR + modelType.getName() + STR + STR + toString() + ")"); } } isFirstConverterAssignment = false; @SuppressWarnings(STR) Converter<?, Object> castConverter = (Converter<?, Object>) converter; this.converter = castConverter; return this; }
/** * Sets the converter used to convert from the property value type to * the renderer presentation type. * * @param converter * the converter to use, or {@code null} to not use any * converters * @return the column itself * * @throws IllegalArgumentException * if the types are not compatible */
Sets the converter used to convert from the property value type to the renderer presentation type
setConverter
{ "repo_name": "oalles/vaadin", "path": "server/src/com/vaadin/ui/Grid.java", "license": "apache-2.0", "size": 239353 }
[ "com.vaadin.data.util.converter.Converter" ]
import com.vaadin.data.util.converter.Converter;
import com.vaadin.data.util.converter.*;
[ "com.vaadin.data" ]
com.vaadin.data;
1,297,507
@Test @SmallTest @SdkSuppress(minSdkVersion = Build.VERSION_CODES.LOLLIPOP) public void testShuffleModeShuffleModeNone() throws Exception { synchronized (mWaitLock) { mCallback.reset(); mMediaControllerAdapter.setShuffleAction(PlaybackControlsRow.ShuffleAction.INDEX_OFF); mWaitLock.wait(); assertTrue(mCallback.mOnSetShuffleModeCalled); assertEquals(mCallback.mShuffleMode, PlaybackStateCompat.SHUFFLE_MODE_NONE); } }
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.LOLLIPOP) void function() throws Exception { synchronized (mWaitLock) { mCallback.reset(); mMediaControllerAdapter.setShuffleAction(PlaybackControlsRow.ShuffleAction.INDEX_OFF); mWaitLock.wait(); assertTrue(mCallback.mOnSetShuffleModeCalled); assertEquals(mCallback.mShuffleMode, PlaybackStateCompat.SHUFFLE_MODE_NONE); } }
/** * Check adapter's setShuffleAction operation. * In this test case, the shuffle mode is set to SHUFFLE_MODE_NONE. * * @throws InterruptedException wait() operation may cause InterruptedException. */
Check adapter's setShuffleAction operation. In this test case, the shuffle mode is set to SHUFFLE_MODE_NONE
testShuffleModeShuffleModeNone
{ "repo_name": "aosp-mirror/platform_frameworks_support", "path": "leanback/src/androidTest/java/androidx/leanback/media/MediaControllerAdapterTest.java", "license": "apache-2.0", "size": 36826 }
[ "android.os.Build", "android.support.test.filters.SdkSuppress", "android.support.v4.media.session.PlaybackStateCompat", "androidx.leanback.widget.PlaybackControlsRow", "org.junit.Assert" ]
import android.os.Build; import android.support.test.filters.SdkSuppress; import android.support.v4.media.session.PlaybackStateCompat; import androidx.leanback.widget.PlaybackControlsRow; import org.junit.Assert;
import android.os.*; import android.support.test.filters.*; import android.support.v4.media.session.*; import androidx.leanback.widget.*; import org.junit.*;
[ "android.os", "android.support", "androidx.leanback", "org.junit" ]
android.os; android.support; androidx.leanback; org.junit;
1,278,447
public boolean isGcsPatternSupported(String gcsPattern) { if (RECURSIVE_GCS_PATTERN.matcher(gcsPattern).matches()) { throw new IllegalArgumentException("Unsupported wildcard usage in \"" + gcsPattern + "\": " + " recursive wildcards are not supported."); } return true; } private GcsUtil( Storage storageClient, ExecutorService executorService, @Nullable Integer uploadBufferSizeBytes) { this.storageClient = storageClient; this.uploadBufferSizeBytes = uploadBufferSizeBytes; this.executorService = executorService; }
boolean function(String gcsPattern) { if (RECURSIVE_GCS_PATTERN.matcher(gcsPattern).matches()) { throw new IllegalArgumentException(STRSTR\STR + STR); } return true; } private GcsUtil( Storage storageClient, ExecutorService executorService, @Nullable Integer uploadBufferSizeBytes) { this.storageClient = storageClient; this.uploadBufferSizeBytes = uploadBufferSizeBytes; this.executorService = executorService; }
/** * Returns true if the given GCS pattern is supported otherwise fails with an * exception. */
Returns true if the given GCS pattern is supported otherwise fails with an exception
isGcsPatternSupported
{ "repo_name": "yafengguo/Apache-beam", "path": "sdks/java/core/src/main/java/org/apache/beam/sdk/util/GcsUtil.java", "license": "apache-2.0", "size": 22750 }
[ "com.google.api.services.storage.Storage", "java.util.concurrent.ExecutorService", "javax.annotation.Nullable" ]
import com.google.api.services.storage.Storage; import java.util.concurrent.ExecutorService; import javax.annotation.Nullable;
import com.google.api.services.storage.*; import java.util.concurrent.*; import javax.annotation.*;
[ "com.google.api", "java.util", "javax.annotation" ]
com.google.api; java.util; javax.annotation;
689,997
ScanBuilder newScanBuilder(CaseInsensitiveStringMap options);
ScanBuilder newScanBuilder(CaseInsensitiveStringMap options);
/** * Returns a {@link ScanBuilder} which can be used to build a {@link Scan}. Spark will call this * method to configure each data source scan. * * @param options The options for reading, which is an immutable case-insensitive * string-to-string map. */
Returns a <code>ScanBuilder</code> which can be used to build a <code>Scan</code>. Spark will call this method to configure each data source scan
newScanBuilder
{ "repo_name": "Aegeaner/spark", "path": "sql/core/src/main/java/org/apache/spark/sql/sources/v2/SupportsRead.java", "license": "apache-2.0", "size": 1651 }
[ "org.apache.spark.sql.sources.v2.reader.ScanBuilder", "org.apache.spark.sql.util.CaseInsensitiveStringMap" ]
import org.apache.spark.sql.sources.v2.reader.ScanBuilder; import org.apache.spark.sql.util.CaseInsensitiveStringMap;
import org.apache.spark.sql.sources.v2.reader.*; import org.apache.spark.sql.util.*;
[ "org.apache.spark" ]
org.apache.spark;
2,074,539
protected Point2D transformNormalized(final double lambda, final double phi, Point2D ptDst) throws ProjectionException { return null; }
Point2D function(final double lambda, final double phi, Point2D ptDst) throws ProjectionException { return null; }
/** * Transforms the specified (<var>&lambda;</var>,<var>&phi;</var>) coordinates * (units in radians) and stores the result in {@code ptDst} (linear distance * on a unit sphere). */
Transforms the specified (&lambda;,&phi;) coordinates (units in radians) and stores the result in ptDst (linear distance on a unit sphere)
transformNormalized
{ "repo_name": "iCarto/siga", "path": "libJCRS/src/org/geotools/referencing/operation/projection/IdrEquidistantConic.java", "license": "gpl-3.0", "size": 9953 }
[ "java.awt.geom.Point2D" ]
import java.awt.geom.Point2D;
import java.awt.geom.*;
[ "java.awt" ]
java.awt;
2,475,518
protected boolean isEligibleToExpirationHeaderGeneration( HttpServletRequest request, XHttpServletResponse response) { boolean expirationHeaderHasBeenSet = response.containsHeader(HEADER_EXPIRES) || contains(response.getCacheControlHeader(), "max-age"); if (expirationHeaderHasBeenSet) { if (log.isDebugEnabled()) { log.debug(sm.getString( "expiresFilter.expirationHeaderAlreadyDefined", request.getRequestURI(), Integer.valueOf(response.getStatus()), response.getContentType())); } return false; } for (int skippedStatusCode : this.excludedResponseStatusCodes) { if (response.getStatus() == skippedStatusCode) { if (log.isDebugEnabled()) { log.debug(sm.getString("expiresFilter.skippedStatusCode", request.getRequestURI(), Integer.valueOf(response.getStatus()), response.getContentType())); } return false; } } return true; }
boolean function( HttpServletRequest request, XHttpServletResponse response) { boolean expirationHeaderHasBeenSet = response.containsHeader(HEADER_EXPIRES) contains(response.getCacheControlHeader(), STR); if (expirationHeaderHasBeenSet) { if (log.isDebugEnabled()) { log.debug(sm.getString( STR, request.getRequestURI(), Integer.valueOf(response.getStatus()), response.getContentType())); } return false; } for (int skippedStatusCode : this.excludedResponseStatusCodes) { if (response.getStatus() == skippedStatusCode) { if (log.isDebugEnabled()) { log.debug(sm.getString(STR, request.getRequestURI(), Integer.valueOf(response.getStatus()), response.getContentType())); } return false; } } return true; }
/** * * <p> * <code>protected</code> for extension. * </p> */
<code>protected</code> for extension.
isEligibleToExpirationHeaderGeneration
{ "repo_name": "plumer/codana", "path": "tomcat_files/7.0.61/ExpiresFilter.java", "license": "mit", "size": 56809 }
[ "javax.servlet.http.HttpServletRequest" ]
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.*;
[ "javax.servlet" ]
javax.servlet;
2,678,702
public static int getTopLine(JTextComponent txtCmp) { FontMetrics fm = txtCmp.getFontMetrics(txtCmp.getFont()); int fontHeight = fm.getHeight(); return (Math.abs(txtCmp.getY()) + fm.getAscent()) / fontHeight + 1; }
static int function(JTextComponent txtCmp) { FontMetrics fm = txtCmp.getFontMetrics(txtCmp.getFont()); int fontHeight = fm.getHeight(); return (Math.abs(txtCmp.getY()) + fm.getAscent()) / fontHeight + 1; }
/** * Get first visible line of the text component in a JScrollPane. * * @param txtCmp Text component. * @return The line. */
Get first visible line of the text component in a JScrollPane
getTopLine
{ "repo_name": "MarkyVasconcelos/Towel", "path": "src/com/towel/swing/TextUtils.java", "license": "lgpl-3.0", "size": 9234 }
[ "java.awt.FontMetrics", "javax.swing.text.JTextComponent" ]
import java.awt.FontMetrics; import javax.swing.text.JTextComponent;
import java.awt.*; import javax.swing.text.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
2,129,879
EClass getFeatureCollectionType();
EClass getFeatureCollectionType();
/** * Returns the meta object for class '{@link net.opengis.wfs20.FeatureCollectionType <em>Feature Collection Type</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Feature Collection Type</em>'. * @see net.opengis.wfs20.FeatureCollectionType * @generated */
Returns the meta object for class '<code>net.opengis.wfs20.FeatureCollectionType Feature Collection Type</code>'.
getFeatureCollectionType
{ "repo_name": "geotools/geotools", "path": "modules/ogc/net.opengis.wfs/src/net/opengis/wfs20/Wfs20Package.java", "license": "lgpl-2.1", "size": 404067 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,181,461
public void setProperty(String key, String value) { if (ByteCartRedux.debug) { ByteCartRedux.myPlugin.getLog().info("BookProperties : setting key " + key + " to " + value); } Properties.setProperty(key, value); }
void function(String key, String value) { if (ByteCartRedux.debug) { ByteCartRedux.myPlugin.getLog().info(STR + key + STR + value); } Properties.setProperty(key, value); }
/** * Set a property * * @param key the key * @param value the value */
Set a property
setProperty
{ "repo_name": "phroa/ByteCartRedux", "path": "src/main/java/com/github/catageek/bytecart/file/BookProperties.java", "license": "gpl-3.0", "size": 4763 }
[ "com.github.catageek.bytecart.ByteCartRedux", "java.util.Properties" ]
import com.github.catageek.bytecart.ByteCartRedux; import java.util.Properties;
import com.github.catageek.bytecart.*; import java.util.*;
[ "com.github.catageek", "java.util" ]
com.github.catageek; java.util;
1,771,778
private boolean isSchemaChanged(BatchSchema newSchema, BatchSchema oldSchema) { return (newSchema == null || oldSchema == null) || !newSchema.isEquivalent(oldSchema); }
boolean function(BatchSchema newSchema, BatchSchema oldSchema) { return (newSchema == null oldSchema == null) !newSchema.isEquivalent(oldSchema); }
/** * Check if the schema changed between provided newSchema and oldSchema. It relies on * {@link BatchSchema#isEquivalent(BatchSchema)}. * @param newSchema - New Schema information * @param oldSchema - - New Schema information to compare with * * @return - true - if newSchema is not same as oldSchema * - false - if newSchema is same as oldSchema */
Check if the schema changed between provided newSchema and oldSchema. It relies on <code>BatchSchema#isEquivalent(BatchSchema)</code>
isSchemaChanged
{ "repo_name": "cchang738/drill", "path": "exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/join/LateralJoinBatch.java", "license": "apache-2.0", "size": 54651 }
[ "org.apache.drill.exec.record.BatchSchema" ]
import org.apache.drill.exec.record.BatchSchema;
import org.apache.drill.exec.record.*;
[ "org.apache.drill" ]
org.apache.drill;
836,156
@StopStep(localName="hibernate") public static void stopLifecycle() { if( log.isDebugEnabled() ) { log.debug( "Stopping lifecycle step: hibernate" ); } synchronized( HibernateLifecycle.class ) { if (started) { if ( log.isDebugEnabled() ) log.debug("Stopping HibernateLifecycle"); try { started = false; for( Map.Entry<QName, SessionFactory> entry : sessionFactoryMap.entrySet() ) { close(entry.getValue()); } } finally { sessionFactoryMap.clear(); sessionFactoryToQName.clear(); } } } }
@StopStep(localName=STR) static void function() { if( log.isDebugEnabled() ) { log.debug( STR ); } synchronized( HibernateLifecycle.class ) { if (started) { if ( log.isDebugEnabled() ) log.debug(STR); try { started = false; for( Map.Entry<QName, SessionFactory> entry : sessionFactoryMap.entrySet() ) { close(entry.getValue()); } } finally { sessionFactoryMap.clear(); sessionFactoryToQName.clear(); } } } }
/** * Shutdown the session factory to release all resources. */
Shutdown the session factory to release all resources
stopLifecycle
{ "repo_name": "ctrimble/xchain", "path": "hibernate/src/main/java/org/xchain/framework/hibernate/HibernateLifecycle.java", "license": "apache-2.0", "size": 11041 }
[ "java.util.Map", "javax.xml.namespace.QName", "org.hibernate.SessionFactory", "org.xchain.framework.lifecycle.StopStep" ]
import java.util.Map; import javax.xml.namespace.QName; import org.hibernate.SessionFactory; import org.xchain.framework.lifecycle.StopStep;
import java.util.*; import javax.xml.namespace.*; import org.hibernate.*; import org.xchain.framework.lifecycle.*;
[ "java.util", "javax.xml", "org.hibernate", "org.xchain.framework" ]
java.util; javax.xml; org.hibernate; org.xchain.framework;
1,443,422
@Override public Set<RoleMapping> getMappedIdPRoles(String idPName, String tenantDomain, LocalRole[] localRoles) throws IdentityProviderManagementException { int tenantId = IdentityTenantUtil.getTenantId(tenantDomain); if (StringUtils.isEmpty(idPName)) { String msg = "Invalid argument: Identity Provider Name value is empty"; throw new IdentityProviderManagementException(msg); } IdentityProvider identityProvider = dao.getIdPByName(null, idPName, tenantId, tenantDomain); if (identityProvider == null) { identityProvider = new FileBasedIdPMgtDAO().getIdPByName(idPName, tenantDomain); } if (identityProvider == null) { identityProvider = IdPManagementServiceComponent.getFileBasedIdPs().get( IdentityApplicationConstants.DEFAULT_IDP_CONFIG); } PermissionsAndRoleConfig roleConfiguration = identityProvider.getPermissionAndRoleConfig(); if (roleConfiguration != null) { RoleMapping[] roleMappings = roleConfiguration.getRoleMappings(); if (roleMappings != null && roleMappings.length > 0 && localRoles != null) { Set<RoleMapping> returnSet = new HashSet<RoleMapping>(); for (LocalRole localRole : localRoles) { for (RoleMapping roleMapping : roleMappings) { if (roleMapping.getLocalRole().equals(localRole)) { returnSet.add(roleMapping); break; } } } return returnSet; } } return new HashSet<RoleMapping>(); }
Set<RoleMapping> function(String idPName, String tenantDomain, LocalRole[] localRoles) throws IdentityProviderManagementException { int tenantId = IdentityTenantUtil.getTenantId(tenantDomain); if (StringUtils.isEmpty(idPName)) { String msg = STR; throw new IdentityProviderManagementException(msg); } IdentityProvider identityProvider = dao.getIdPByName(null, idPName, tenantId, tenantDomain); if (identityProvider == null) { identityProvider = new FileBasedIdPMgtDAO().getIdPByName(idPName, tenantDomain); } if (identityProvider == null) { identityProvider = IdPManagementServiceComponent.getFileBasedIdPs().get( IdentityApplicationConstants.DEFAULT_IDP_CONFIG); } PermissionsAndRoleConfig roleConfiguration = identityProvider.getPermissionAndRoleConfig(); if (roleConfiguration != null) { RoleMapping[] roleMappings = roleConfiguration.getRoleMappings(); if (roleMappings != null && roleMappings.length > 0 && localRoles != null) { Set<RoleMapping> returnSet = new HashSet<RoleMapping>(); for (LocalRole localRole : localRoles) { for (RoleMapping roleMapping : roleMappings) { if (roleMapping.getLocalRole().equals(localRole)) { returnSet.add(roleMapping); break; } } } return returnSet; } } return new HashSet<RoleMapping>(); }
/** * Retrieves Identity provider information about a given tenant * * @param idPName Unique name of the IdP to which the given local roles need to be mapped * @param tenantDomain The tenant domain of whose local roles need to be mapped * @param localRoles Local roles which need to be mapped to IdP roles * @throws IdentityProviderManagementException Error when getting role mappings */
Retrieves Identity provider information about a given tenant
getMappedIdPRoles
{ "repo_name": "wso2/carbon-identity-framework", "path": "components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/IdentityProviderManager.java", "license": "apache-2.0", "size": 149641 }
[ "java.util.HashSet", "java.util.Set", "org.apache.commons.lang.StringUtils", "org.wso2.carbon.identity.application.common.model.IdentityProvider", "org.wso2.carbon.identity.application.common.model.LocalRole", "org.wso2.carbon.identity.application.common.model.PermissionsAndRoleConfig", "org.wso2.carbon.identity.application.common.model.RoleMapping", "org.wso2.carbon.identity.application.common.util.IdentityApplicationConstants", "org.wso2.carbon.identity.core.util.IdentityTenantUtil", "org.wso2.carbon.idp.mgt.dao.FileBasedIdPMgtDAO", "org.wso2.carbon.idp.mgt.internal.IdPManagementServiceComponent" ]
import java.util.HashSet; import java.util.Set; import org.apache.commons.lang.StringUtils; import org.wso2.carbon.identity.application.common.model.IdentityProvider; import org.wso2.carbon.identity.application.common.model.LocalRole; import org.wso2.carbon.identity.application.common.model.PermissionsAndRoleConfig; import org.wso2.carbon.identity.application.common.model.RoleMapping; import org.wso2.carbon.identity.application.common.util.IdentityApplicationConstants; import org.wso2.carbon.identity.core.util.IdentityTenantUtil; import org.wso2.carbon.idp.mgt.dao.FileBasedIdPMgtDAO; import org.wso2.carbon.idp.mgt.internal.IdPManagementServiceComponent;
import java.util.*; import org.apache.commons.lang.*; import org.wso2.carbon.identity.application.common.model.*; import org.wso2.carbon.identity.application.common.util.*; import org.wso2.carbon.identity.core.util.*; import org.wso2.carbon.idp.mgt.dao.*; import org.wso2.carbon.idp.mgt.internal.*;
[ "java.util", "org.apache.commons", "org.wso2.carbon" ]
java.util; org.apache.commons; org.wso2.carbon;
1,933,526
ResumeModel selectByPrimaryKey(Integer id);
ResumeModel selectByPrimaryKey(Integer id);
/** * This method was generated by MyBatis Generator. * This method corresponds to the database table resume * * @mbggenerated */
This method was generated by MyBatis Generator. This method corresponds to the database table resume
selectByPrimaryKey
{ "repo_name": "lankeren/taolijie", "path": "src/main/java/com/fh/taolijie/dao/mapper/ResumeModelMapper.java", "license": "gpl-3.0", "size": 1990 }
[ "com.fh.taolijie.domain.ResumeModel" ]
import com.fh.taolijie.domain.ResumeModel;
import com.fh.taolijie.domain.*;
[ "com.fh.taolijie" ]
com.fh.taolijie;
1,134,697
private InputStream getPathFromUri(String path) throws IOException { if (path.startsWith("content:")) { Uri uri = Uri.parse(path); return mApp.getActivity().getContentResolver().openInputStream(uri); } if (path.startsWith("http:") || path.startsWith("https:") || path.startsWith("file:")) { URL url = new URL(path); return url.openStream(); } else { return new FileInputStream(path); } }
InputStream function(String path) throws IOException { if (path.startsWith(STR)) { Uri uri = Uri.parse(path); return mApp.getActivity().getContentResolver().openInputStream(uri); } if (path.startsWith("http:") path.startsWith(STR) path.startsWith("file:")) { URL url = new URL(path); return url.openStream(); } else { return new FileInputStream(path); } }
/** * Get an input stream based on file path or uri content://, http://, file:// * * @param path * @return an input stream * @throws IOException */
Get an input stream based on file path or uri content://, HREF file:
getPathFromUri
{ "repo_name": "hgl888/cordova-android-chromeview", "path": "framework/src/org/apache/cordova/ContactAccessorSdk5.java", "license": "apache-2.0", "size": 105483 }
[ "android.net.Uri", "java.io.FileInputStream", "java.io.IOException", "java.io.InputStream" ]
import android.net.Uri; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream;
import android.net.*; import java.io.*;
[ "android.net", "java.io" ]
android.net; java.io;
2,669,765
protected void log(Level level,String msg) { //System.out.println(msg); getLogger().log(level,msg); }
void function(Level level,String msg) { getLogger().log(level,msg); }
/** * Logs out to the specified log level to the default Logger * @param level The log level * @param msg The message to log out */
Logs out to the specified log level to the default Logger
log
{ "repo_name": "idega/platform2", "path": "src/com/idega/util/dbschema/SQLSchemaCreator.java", "license": "gpl-3.0", "size": 29751 }
[ "java.util.logging.Level" ]
import java.util.logging.Level;
import java.util.logging.*;
[ "java.util" ]
java.util;
109,859
public JComponent getUiComponent();
JComponent function();
/** * Returns the UI component, e.g. the actual JTextField implementing the * editor. * * @return the UI component */
Returns the UI component, e.g. the actual JTextField implementing the editor
getUiComponent
{ "repo_name": "meteoinfo/meteoinfolib", "path": "src/org/meteoinfo/ui/calendar/IDateEditor.java", "license": "lgpl-3.0", "size": 4997 }
[ "javax.swing.JComponent" ]
import javax.swing.JComponent;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
416,873
@Override public void exitIdentifier(@NotNull BindingExpressionParser.IdentifierContext ctx) { }
@Override public void exitIdentifier(@NotNull BindingExpressionParser.IdentifierContext ctx) { }
/** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */
The default implementation does nothing
enterIdentifier
{ "repo_name": "syslover33/ctank", "path": "java/android-sdk-linux_r24.4.1_src/sources/android-23/android/databinding/parser/BindingExpressionBaseListener.java", "license": "gpl-3.0", "size": 14237 }
[ "org.antlr.v4.runtime.misc.NotNull" ]
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.misc.*;
[ "org.antlr.v4" ]
org.antlr.v4;
486,111
MutationResult bucketUpsertDefaultCollection(String id, Object document);
MutationResult bucketUpsertDefaultCollection(String id, Object document);
/** * Bucket upsert default collection mutation result. * * @param id the id * @param document the document * @return the mutation result */
Bucket upsert default collection mutation result
bucketUpsertDefaultCollection
{ "repo_name": "apereo/cas", "path": "support/cas-server-support-couchbase-core/src/main/java/org/apereo/cas/couchbase/core/CouchbaseClientFactory.java", "license": "apache-2.0", "size": 6318 }
[ "com.couchbase.client.java.kv.MutationResult" ]
import com.couchbase.client.java.kv.MutationResult;
import com.couchbase.client.java.kv.*;
[ "com.couchbase.client" ]
com.couchbase.client;
1,627,316
public void testConstants() { assertEquals(DatabaseMetaData.columnNoNulls, ResultSetMetaData.columnNoNulls); assertEquals(DatabaseMetaData.columnNullable, ResultSetMetaData.columnNullable); assertEquals(DatabaseMetaData.columnNullableUnknown, ResultSetMetaData.columnNullableUnknown); }
void function() { assertEquals(DatabaseMetaData.columnNoNulls, ResultSetMetaData.columnNoNulls); assertEquals(DatabaseMetaData.columnNullable, ResultSetMetaData.columnNullable); assertEquals(DatabaseMetaData.columnNullableUnknown, ResultSetMetaData.columnNullableUnknown); }
/** * This is not a test of Derby but JDBC constants for meta data * that this test depends on. * The constants for nullability are the same but let's check to make sure. * */
This is not a test of Derby but JDBC constants for meta data that this test depends on. The constants for nullability are the same but let's check to make sure
testConstants
{ "repo_name": "trejkaz/derby", "path": "java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java", "license": "apache-2.0", "size": 214556 }
[ "java.sql.DatabaseMetaData", "java.sql.ResultSetMetaData" ]
import java.sql.DatabaseMetaData; import java.sql.ResultSetMetaData;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,243,485
private Triple getTriple(boolean subjectIsBlank, boolean objectIsBlank, String labelSubject, String labelPredicate, String labelObject) { return Triple.create( subjectIsBlank ? NodeFactory.createBlankNode(labelSubject) : NodeFactory.createURI(labelSubject), NodeFactory.createURI(labelPredicate), objectIsBlank ? NodeFactory.createBlankNode(labelObject) : NodeFactory.createURI(labelObject)); }
Triple function(boolean subjectIsBlank, boolean objectIsBlank, String labelSubject, String labelPredicate, String labelObject) { return Triple.create( subjectIsBlank ? NodeFactory.createBlankNode(labelSubject) : NodeFactory.createURI(labelSubject), NodeFactory.createURI(labelPredicate), objectIsBlank ? NodeFactory.createBlankNode(labelObject) : NodeFactory.createURI(labelObject)); }
/** * Create and return a triple with configurable properties. * * @param subjectIsBlank Indicates whether the subject should be blank. * @param objectIsBlank Indicates whether the object should be blank. * @param labelSubject The label of the subject. * @param labelPredicate The label of the predicate. * @param labelObject The label of the object. * @return The created triple. */
Create and return a triple with configurable properties
getTriple
{ "repo_name": "AKSW/Squirrel", "path": "squirrel.deduplication/src/test/java/org/dice_research/squirrel/tripleComparator/SimpleTripleComparatorTest.java", "license": "lgpl-3.0", "size": 5861 }
[ "org.apache.jena.graph.NodeFactory", "org.apache.jena.graph.Triple" ]
import org.apache.jena.graph.NodeFactory; import org.apache.jena.graph.Triple;
import org.apache.jena.graph.*;
[ "org.apache.jena" ]
org.apache.jena;
1,322,902
protected void addWarmupID(String id) { if (this.warmupIDs == null) { // lazy creation of the Set this.warmupIDs = new HashSet<String>(); } this.warmupIDs.add(id); }
void function(String id) { if (this.warmupIDs == null) { this.warmupIDs = new HashSet<String>(); } this.warmupIDs.add(id); }
/** * Adds a new ID to the warm up ID set * @param id The ID */
Adds a new ID to the warm up ID set
addWarmupID
{ "repo_name": "akeranen/the-one", "path": "src/report/Report.java", "license": "gpl-3.0", "size": 11730 }
[ "java.util.HashSet" ]
import java.util.HashSet;
import java.util.*;
[ "java.util" ]
java.util;
2,652,259
public boolean removeAll(boolean pretty, boolean strict) throws SmugMugException{ logger.debug("removeAll() called"); SMResponse requestToken = SMResponse.callMethod(this.smugmug,SMResponse.class, "smugmug.friends.removeAll", null, null, pretty, false, strict, false); logger.debug("removeAll() result: "+(requestToken == null ? "null" : requestToken.toString())); //if it does not throw an exception than it worked, so return true return true; }
boolean function(boolean pretty, boolean strict) throws SmugMugException{ logger.debug(STR); SMResponse requestToken = SMResponse.callMethod(this.smugmug,SMResponse.class, STR, null, null, pretty, false, strict, false); logger.debug(STR+(requestToken == null ? "null" : requestToken.toString())); return true; }
/** * Remove a user from a user's list of friends. * * @param nickName (required) The NickName for a specific user. * @param pretty return formatted JSON that is easier to read * @param strict Enable strict error handling. * @return * @throws SmugMugException */
Remove a user from a user's list of friends
removeAll
{ "repo_name": "jkschoen/jsma", "path": "src/main/java/com/github/jkschoen/jsma/FamilyAPI.java", "license": "mit", "size": 3782 }
[ "com.github.jkschoen.jsma.misc.SmugMugException", "com.github.jkschoen.jsma.response.SMResponse" ]
import com.github.jkschoen.jsma.misc.SmugMugException; import com.github.jkschoen.jsma.response.SMResponse;
import com.github.jkschoen.jsma.misc.*; import com.github.jkschoen.jsma.response.*;
[ "com.github.jkschoen" ]
com.github.jkschoen;
94,233
@Test public void isEnabledUntagged() { assertThat(provider.isEnabled(0, null, Level.TRACE)).isFalse(); assertThat(provider.isEnabled(1, null, Level.DEBUG)).isFalse(); assertThat(provider.isEnabled(2, null, Level.INFO)).isFalse(); assertThat(provider.isEnabled(3, null, Level.WARN)).isFalse(); assertThat(provider.isEnabled(4, null, Level.ERROR)).isFalse(); }
void function() { assertThat(provider.isEnabled(0, null, Level.TRACE)).isFalse(); assertThat(provider.isEnabled(1, null, Level.DEBUG)).isFalse(); assertThat(provider.isEnabled(2, null, Level.INFO)).isFalse(); assertThat(provider.isEnabled(3, null, Level.WARN)).isFalse(); assertThat(provider.isEnabled(4, null, Level.ERROR)).isFalse(); }
/** * Verifies that all severity levels for untagged log entries are disabled. */
Verifies that all severity levels for untagged log entries are disabled
isEnabledUntagged
{ "repo_name": "pmwmedia/tinylog", "path": "tinylog-api/src/test/java/org/tinylog/provider/NopLoggingProviderTest.java", "license": "apache-2.0", "size": 3418 }
[ "org.assertj.core.api.Assertions", "org.tinylog.Level" ]
import org.assertj.core.api.Assertions; import org.tinylog.Level;
import org.assertj.core.api.*; import org.tinylog.*;
[ "org.assertj.core", "org.tinylog" ]
org.assertj.core; org.tinylog;
1,484,030
public String getColumnTypeName(int column) throws java.sql.SQLException { Field field = getField(column); int mysqlType = field.getMysqlType(); int jdbcType = field.getSQLType(); switch (mysqlType) { case MysqlDefs.FIELD_TYPE_BIT: return "BIT"; case MysqlDefs.FIELD_TYPE_DECIMAL: case MysqlDefs.FIELD_TYPE_NEW_DECIMAL: return field.isUnsigned() ? "DECIMAL UNSIGNED" : "DECIMAL"; case MysqlDefs.FIELD_TYPE_TINY: return field.isUnsigned() ? "TINYINT UNSIGNED" : "TINYINT"; case MysqlDefs.FIELD_TYPE_SHORT: return field.isUnsigned() ? "SMALLINT UNSIGNED" : "SMALLINT"; case MysqlDefs.FIELD_TYPE_LONG: return field.isUnsigned() ? "INT UNSIGNED" : "INT"; case MysqlDefs.FIELD_TYPE_FLOAT: return field.isUnsigned() ? "FLOAT UNSIGNED" : "FLOAT"; case MysqlDefs.FIELD_TYPE_DOUBLE: return field.isUnsigned() ? "DOUBLE UNSIGNED" : "DOUBLE"; case MysqlDefs.FIELD_TYPE_NULL: return "NULL"; case MysqlDefs.FIELD_TYPE_TIMESTAMP: return "TIMESTAMP"; case MysqlDefs.FIELD_TYPE_LONGLONG: return field.isUnsigned() ? "BIGINT UNSIGNED" : "BIGINT"; case MysqlDefs.FIELD_TYPE_INT24: return field.isUnsigned() ? "MEDIUMINT UNSIGNED" : "MEDIUMINT"; case MysqlDefs.FIELD_TYPE_DATE: return "DATE"; case MysqlDefs.FIELD_TYPE_TIME: return "TIME"; case MysqlDefs.FIELD_TYPE_DATETIME: return "DATETIME"; case MysqlDefs.FIELD_TYPE_TINY_BLOB: return "TINYBLOB"; case MysqlDefs.FIELD_TYPE_MEDIUM_BLOB: return "MEDIUMBLOB"; case MysqlDefs.FIELD_TYPE_LONG_BLOB: return "LONGBLOB"; case MysqlDefs.FIELD_TYPE_BLOB: if (getField(column).isBinary()) { return "BLOB"; } return "TEXT"; case MysqlDefs.FIELD_TYPE_VARCHAR: return "VARCHAR"; case MysqlDefs.FIELD_TYPE_VAR_STRING: if (jdbcType == Types.VARBINARY) { return "VARBINARY"; } return "VARCHAR"; case MysqlDefs.FIELD_TYPE_STRING: if (jdbcType == Types.BINARY) { return "BINARY"; } return "CHAR"; case MysqlDefs.FIELD_TYPE_ENUM: return "ENUM"; case MysqlDefs.FIELD_TYPE_YEAR: return "YEAR"; case MysqlDefs.FIELD_TYPE_SET: return "SET"; case MysqlDefs.FIELD_TYPE_GEOMETRY: return "GEOMETRY"; case MysqlDefs.FIELD_TYPE_JSON: return "JSON"; default: return "UNKNOWN"; } }
String function(int column) throws java.sql.SQLException { Field field = getField(column); int mysqlType = field.getMysqlType(); int jdbcType = field.getSQLType(); switch (mysqlType) { case MysqlDefs.FIELD_TYPE_BIT: return "BIT"; case MysqlDefs.FIELD_TYPE_DECIMAL: case MysqlDefs.FIELD_TYPE_NEW_DECIMAL: return field.isUnsigned() ? STR : STR; case MysqlDefs.FIELD_TYPE_TINY: return field.isUnsigned() ? STR : STR; case MysqlDefs.FIELD_TYPE_SHORT: return field.isUnsigned() ? STR : STR; case MysqlDefs.FIELD_TYPE_LONG: return field.isUnsigned() ? STR : "INT"; case MysqlDefs.FIELD_TYPE_FLOAT: return field.isUnsigned() ? STR : "FLOAT"; case MysqlDefs.FIELD_TYPE_DOUBLE: return field.isUnsigned() ? STR : STR; case MysqlDefs.FIELD_TYPE_NULL: return "NULL"; case MysqlDefs.FIELD_TYPE_TIMESTAMP: return STR; case MysqlDefs.FIELD_TYPE_LONGLONG: return field.isUnsigned() ? STR : STR; case MysqlDefs.FIELD_TYPE_INT24: return field.isUnsigned() ? STR : STR; case MysqlDefs.FIELD_TYPE_DATE: return "DATE"; case MysqlDefs.FIELD_TYPE_TIME: return "TIME"; case MysqlDefs.FIELD_TYPE_DATETIME: return STR; case MysqlDefs.FIELD_TYPE_TINY_BLOB: return STR; case MysqlDefs.FIELD_TYPE_MEDIUM_BLOB: return STR; case MysqlDefs.FIELD_TYPE_LONG_BLOB: return STR; case MysqlDefs.FIELD_TYPE_BLOB: if (getField(column).isBinary()) { return "BLOB"; } return "TEXT"; case MysqlDefs.FIELD_TYPE_VARCHAR: return STR; case MysqlDefs.FIELD_TYPE_VAR_STRING: if (jdbcType == Types.VARBINARY) { return STR; } return STR; case MysqlDefs.FIELD_TYPE_STRING: if (jdbcType == Types.BINARY) { return STR; } return "CHAR"; case MysqlDefs.FIELD_TYPE_ENUM: return "ENUM"; case MysqlDefs.FIELD_TYPE_YEAR: return "YEAR"; case MysqlDefs.FIELD_TYPE_SET: return "SET"; case MysqlDefs.FIELD_TYPE_GEOMETRY: return STR; case MysqlDefs.FIELD_TYPE_JSON: return "JSON"; default: return STR; } }
/** * Whats is the column's data source specific type name? * * @param column * the first column is 1, the second is 2, etc. * * @return the type name * * @throws SQLException * if a database access error occurs */
Whats is the column's data source specific type name
getColumnTypeName
{ "repo_name": "scopej/mysql-connector-j", "path": "src/com/mysql/jdbc/ResultSetMetaData.java", "license": "gpl-2.0", "size": 24375 }
[ "java.sql.SQLException", "java.sql.Types" ]
import java.sql.SQLException; import java.sql.Types;
import java.sql.*;
[ "java.sql" ]
java.sql;
32,625
public synchronized static void addTraceMetricsSource() { try { QueryServicesOptions options = QueryServicesOptions.withDefaults(); if (!initialized && options.isTracingEnabled()) { traceSpanReceiver = new TraceSpanReceiver(); Trace.addReceiver(traceSpanReceiver); TraceWriter traceWriter = new TraceWriter(options.getTableName(), options.getTracingThreadPoolSize(), options.getTracingBatchSize()); traceWriter.start(); } } catch (RuntimeException e) { LOGGER.warn("Tracing will outputs will not be written to any metrics sink! No " + "TraceMetricsSink found on the classpath", e); } catch (IllegalAccessError e) { // This is an issue when we have a class incompatibility error, such as when running // within SquirrelSQL which uses an older incompatible version of commons-collections. // Seeing as this only results in disabling tracing, we swallow this exception and just // continue on without tracing. LOGGER.warn("Class incompatibility while initializing metrics, metrics will be disabled", e); } initialized = true; }
synchronized static void function() { try { QueryServicesOptions options = QueryServicesOptions.withDefaults(); if (!initialized && options.isTracingEnabled()) { traceSpanReceiver = new TraceSpanReceiver(); Trace.addReceiver(traceSpanReceiver); TraceWriter traceWriter = new TraceWriter(options.getTableName(), options.getTracingThreadPoolSize(), options.getTracingBatchSize()); traceWriter.start(); } } catch (RuntimeException e) { LOGGER.warn(STR + STR, e); } catch (IllegalAccessError e) { LOGGER.warn(STR, e); } initialized = true; }
/** * Add the phoenix span receiver so we can log the traces. We have a single trace source for the * whole JVM */
Add the phoenix span receiver so we can log the traces. We have a single trace source for the whole JVM
addTraceMetricsSource
{ "repo_name": "growingio/phoenix", "path": "phoenix-core/src/main/java/org/apache/phoenix/trace/util/Tracing.java", "license": "apache-2.0", "size": 12561 }
[ "org.apache.htrace.Trace", "org.apache.phoenix.query.QueryServicesOptions", "org.apache.phoenix.trace.TraceSpanReceiver", "org.apache.phoenix.trace.TraceWriter" ]
import org.apache.htrace.Trace; import org.apache.phoenix.query.QueryServicesOptions; import org.apache.phoenix.trace.TraceSpanReceiver; import org.apache.phoenix.trace.TraceWriter;
import org.apache.htrace.*; import org.apache.phoenix.query.*; import org.apache.phoenix.trace.*;
[ "org.apache.htrace", "org.apache.phoenix" ]
org.apache.htrace; org.apache.phoenix;
450,154
@Test(priority = 3) public void checkForOfflineModeMessageTest() throws InterruptedException { driver.setNetworkConnection(false, false, false); driver.verifyElementPresentByName(getCreateMyAccountByName()); driver.verifyElementPresentByName(getShowOptionalFieldByName()); driver.verifyElementPresentByName(getSignUpTextByName()); driver.clickElementById(getCreateMyAccountById()); driver.verifyElementPresentByName(getOfflineMessageHeaderByName()); driver.verifyElementPresentByName(getOfflineMessageByName()); driver.setNetworkConnection(true, true, true); driver.clickElementById(getCloseButtonById()); }
@Test(priority = 3) void function() throws InterruptedException { driver.setNetworkConnection(false, false, false); driver.verifyElementPresentByName(getCreateMyAccountByName()); driver.verifyElementPresentByName(getShowOptionalFieldByName()); driver.verifyElementPresentByName(getSignUpTextByName()); driver.clickElementById(getCreateMyAccountById()); driver.verifyElementPresentByName(getOfflineMessageHeaderByName()); driver.verifyElementPresentByName(getOfflineMessageByName()); driver.setNetworkConnection(true, true, true); driver.clickElementById(getCloseButtonById()); }
/** * Check that offline mode message appears if user tries to create account in offline mode * @throws InterruptedException */
Check that offline mode message appears if user tries to create account in offline mode
checkForOfflineModeMessageTest
{ "repo_name": "KirillMakarov/edx-app-android", "path": "AcceptanceTests/src/test/java/org/edx/basetest/SignUpTestSuiteBase.java", "license": "apache-2.0", "size": 1575 }
[ "org.testng.annotations.Test" ]
import org.testng.annotations.Test;
import org.testng.annotations.*;
[ "org.testng.annotations" ]
org.testng.annotations;
2,652,546
private ImmutableList<LanguageDictionary> loadDictionaries() { Map<String, LanguageDictionary> languageNameMap = new HashMap<>(); for (File f : LanguageDictionary.getL10NFiles(app)) { String name = LanguageDictionary.extractLanguageName(f); LanguageDictionary res = languageNameMap.get(name); if (res == null) { res = new LanguageDictionary(name); languageNameMap.put(name, res); } try { // Load the content. JSONObject content = res.readContentFromBinaryFile(f); res.addJSONContent(content); } catch (Exception e) { log.warning( "Error loading content for l10n for file: " + f.getAbsolutePath() + ", exception: " + e.getMessage() + "\n" + Arrays.asList(e.getStackTrace())); } }
ImmutableList<LanguageDictionary> function() { Map<String, LanguageDictionary> languageNameMap = new HashMap<>(); for (File f : LanguageDictionary.getL10NFiles(app)) { String name = LanguageDictionary.extractLanguageName(f); LanguageDictionary res = languageNameMap.get(name); if (res == null) { res = new LanguageDictionary(name); languageNameMap.put(name, res); } try { JSONObject content = res.readContentFromBinaryFile(f); res.addJSONContent(content); } catch (Exception e) { log.warning( STR + f.getAbsolutePath() + STR + e.getMessage() + "\n" + Arrays.asList(e.getStackTrace())); } }
/** * Load all the dictionaries for the application. */
Load all the dictionaries for the application
loadDictionaries
{ "repo_name": "adataylor/ios-driver", "path": "server/src/main/java/org/uiautomation/ios/application/APPIOSApplication.java", "license": "apache-2.0", "size": 22210 }
[ "com.google.common.collect.ImmutableList", "java.io.File", "java.util.Arrays", "java.util.HashMap", "java.util.Map", "org.json.JSONObject" ]
import com.google.common.collect.ImmutableList; import java.io.File; import java.util.Arrays; import java.util.HashMap; import java.util.Map; import org.json.JSONObject;
import com.google.common.collect.*; import java.io.*; import java.util.*; import org.json.*;
[ "com.google.common", "java.io", "java.util", "org.json" ]
com.google.common; java.io; java.util; org.json;
106,604
public final void add(IAuthorizationStrategy strategy) { if (strategy == null) { throw new IllegalArgumentException("Strategy argument cannot be null"); } strategies.add(strategy); }
final void function(IAuthorizationStrategy strategy) { if (strategy == null) { throw new IllegalArgumentException(STR); } strategies.add(strategy); }
/** * Adds a strategy to the chain * * @param strategy * Strategy to add */
Adds a strategy to the chain
add
{ "repo_name": "astubbs/wicket.get-portals2", "path": "wicket/src/main/java/org/apache/wicket/authorization/strategies/CompoundAuthorizationStrategy.java", "license": "apache-2.0", "size": 2650 }
[ "org.apache.wicket.authorization.IAuthorizationStrategy" ]
import org.apache.wicket.authorization.IAuthorizationStrategy;
import org.apache.wicket.authorization.*;
[ "org.apache.wicket" ]
org.apache.wicket;
1,751,155
public void musicItemVersionInvalid(final String musicItemVersionName) { this.addStatusMessage( ProtocolConstants.StatusMessage.Read.MUSIC_ITEM_VERSION_INVALID, "\"" + musicItemVersionName + "\" is not a valid music item version! Please pass " + MUSIC_ITEM_VERSIONS_ALLOWED + "."); }
void function(final String musicItemVersionName) { this.addStatusMessage( ProtocolConstants.StatusMessage.Read.MUSIC_ITEM_VERSION_INVALID, "\"STR\STR + MUSIC_ITEM_VERSIONS_ALLOWED + "."); }
/** * add status message: music item version invalid * * @param musicItemVersionName * music item version passed */
add status message: music item version invalid
musicItemVersionInvalid
{ "repo_name": "Metalcon/musicStorageServer", "path": "src/main/java/de/metalcon/musicStorageServer/protocol/read/ReadResponse.java", "license": "gpl-3.0", "size": 2337 }
[ "de.metalcon.musicStorageServer.protocol.ProtocolConstants" ]
import de.metalcon.musicStorageServer.protocol.ProtocolConstants;
import de.metalcon.*;
[ "de.metalcon" ]
de.metalcon;
2,012,360
public void addSlave(DataProvider slaveDataProvider) { if (slaveDataProvider != null) { if (slaves == null) { slaves = new Vector(); } if (!slaves.contains(slaveDataProvider)) { if (slaveDataProvider.masters == null) { slaveDataProvider.masters = new Vector(); } slaveDataProvider.masters.addElement(this); slaves.addElement(slaveDataProvider); } } }
void function(DataProvider slaveDataProvider) { if (slaveDataProvider != null) { if (slaves == null) { slaves = new Vector(); } if (!slaves.contains(slaveDataProvider)) { if (slaveDataProvider.masters == null) { slaveDataProvider.masters = new Vector(); } slaveDataProvider.masters.addElement(this); slaves.addElement(slaveDataProvider); } } }
/** * Add a slave {@link DataProvider} to this {@link DataProvider}. * * @param slaveDataProvider * @since 1.0.1 */
Add a slave <code>DataProvider</code> to this <code>DataProvider</code>
addSlave
{ "repo_name": "mirzaakhena/kuix", "path": "src/org/kalmeo/kuix/core/model/DataProvider.java", "license": "gpl-3.0", "size": 18661 }
[ "java.util.Vector" ]
import java.util.Vector;
import java.util.*;
[ "java.util" ]
java.util;
2,897,261
public static void registerContributor(final IDebugBarContributor contrib, final Application application) { if (contrib == null) { throw new IllegalArgumentException("contrib can not be null"); } List<IDebugBarContributor> contributors = getContributors(application); contributors.add(contrib); application.setMetaData(CONTRIBS_META_KEY, contributors); }
static void function(final IDebugBarContributor contrib, final Application application) { if (contrib == null) { throw new IllegalArgumentException(STR); } List<IDebugBarContributor> contributors = getContributors(application); contributors.add(contrib); application.setMetaData(CONTRIBS_META_KEY, contributors); }
/** * Register your own custom contributor that will be part of the debug bar. You must have the * context of an application for this thread at the time of calling this method. * * @param application * @param contrib * custom contributor - can not be null */
Register your own custom contributor that will be part of the debug bar. You must have the context of an application for this thread at the time of calling this method
registerContributor
{ "repo_name": "martin-g/wicket-osgi", "path": "wicket-devutils/src/main/java/org/apache/wicket/devutils/debugbar/DebugBar.java", "license": "apache-2.0", "size": 5691 }
[ "java.util.List", "org.apache.wicket.Application" ]
import java.util.List; import org.apache.wicket.Application;
import java.util.*; import org.apache.wicket.*;
[ "java.util", "org.apache.wicket" ]
java.util; org.apache.wicket;
1,335,370
public void removeAPIRevisionDeployment(String apiRevisionId, List<APIRevisionDeployment> apiRevisionDeployments) throws APIManagementException { try (Connection connection = APIMgtDBUtil.getConnection()) { try { connection.setAutoCommit(false); // Remove an entry from AM_DEPLOYMENT_REVISION_MAPPING table PreparedStatement statement = connection .prepareStatement(SQLConstants.APIRevisionSqlConstants.REMOVE_API_REVISION_DEPLOYMENT_MAPPING); for (APIRevisionDeployment apiRevisionDeployment : apiRevisionDeployments) { statement.setString(1, apiRevisionDeployment.getDeployment()); statement.setString(2, apiRevisionId); statement.addBatch(); } statement.executeBatch(); connection.commit(); } catch (SQLException e) { connection.rollback(); handleException("Failed to remove API Revision Deployment Mapping entry for Revision UUID " + apiRevisionId, e); } } catch (SQLException e) { handleException("Failed to remove API Revision Deployment Mapping entry for Revision UUID " + apiRevisionId, e); } }
void function(String apiRevisionId, List<APIRevisionDeployment> apiRevisionDeployments) throws APIManagementException { try (Connection connection = APIMgtDBUtil.getConnection()) { try { connection.setAutoCommit(false); PreparedStatement statement = connection .prepareStatement(SQLConstants.APIRevisionSqlConstants.REMOVE_API_REVISION_DEPLOYMENT_MAPPING); for (APIRevisionDeployment apiRevisionDeployment : apiRevisionDeployments) { statement.setString(1, apiRevisionDeployment.getDeployment()); statement.setString(2, apiRevisionId); statement.addBatch(); } statement.executeBatch(); connection.commit(); } catch (SQLException e) { connection.rollback(); handleException(STR + apiRevisionId, e); } } catch (SQLException e) { handleException(STR + apiRevisionId, e); } }
/** * Remove an API revision Deployment mapping record to the database * * @param apiRevisionId uuid of the revision * @param apiRevisionDeployments content of the revision deployment mapping objects * @throws APIManagementException if an error occurs when adding a new API revision */
Remove an API revision Deployment mapping record to the database
removeAPIRevisionDeployment
{ "repo_name": "Rajith90/carbon-apimgt", "path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java", "license": "apache-2.0", "size": 811404 }
[ "java.sql.Connection", "java.sql.PreparedStatement", "java.sql.SQLException", "java.util.List", "org.wso2.carbon.apimgt.api.APIManagementException", "org.wso2.carbon.apimgt.api.model.APIRevisionDeployment", "org.wso2.carbon.apimgt.impl.dao.constants.SQLConstants", "org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil" ]
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.List; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.model.APIRevisionDeployment; import org.wso2.carbon.apimgt.impl.dao.constants.SQLConstants; import org.wso2.carbon.apimgt.impl.utils.APIMgtDBUtil;
import java.sql.*; import java.util.*; import org.wso2.carbon.apimgt.api.*; import org.wso2.carbon.apimgt.api.model.*; import org.wso2.carbon.apimgt.impl.dao.constants.*; import org.wso2.carbon.apimgt.impl.utils.*;
[ "java.sql", "java.util", "org.wso2.carbon" ]
java.sql; java.util; org.wso2.carbon;
1,773,133
void register(Class<? extends IAttachment> type, IAttachmentManager mgr);
void register(Class<? extends IAttachment> type, IAttachmentManager mgr);
/** * <p> * Associates the supplied IAttachmentManager with the renderer, so * attachments can be allocated with the associated type. * </p> * * @param type * the type of attachments supplied by the manager * * @param mgr * the manager instance to handle allocating attachments */
Associates the supplied IAttachmentManager with the renderer, so attachments can be allocated with the associated type.
register
{ "repo_name": "eclipse/eavp", "path": "org.eclipse.eavp.viz.service.javafx/src/org/eclipse/eavp/viz/service/javafx/viewer/IRenderer.java", "license": "epl-1.0", "size": 2322 }
[ "org.eclipse.eavp.viz.service.javafx.scene.model.IAttachment" ]
import org.eclipse.eavp.viz.service.javafx.scene.model.IAttachment;
import org.eclipse.eavp.viz.service.javafx.scene.model.*;
[ "org.eclipse.eavp" ]
org.eclipse.eavp;
2,285,818