method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
sequence | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
sequence | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
public void accept( Edge<LinkageToken,ResidueToken> edge )
{
Linkage linkage = edge.getValue().getLinkage();
Vertex<LinkageToken,ResidueToken> ptok = edge.getParent();
Vertex<LinkageToken,ResidueToken> ctok = edge.getChild();
Residue parent = ptok.getValue().getResidue();
Residue child = ctok.getValue().getResidue();
if ( ! sugar.contains( parent ) )
{
sugar.addResidue( parent );
// optimisation only: pre-allocate exact number of edges for vertex
sugar.getGraph().lastVertex().ensureCapacity( ptok.countAttachedEdges() );
}
sugar.addResidue( parent, linkage, child );
// optimisation only: pre-allocate exact number of edges for vertex
sugar.getGraph().lastVertex().ensureCapacity( ctok.countAttachedEdges() );
super.accept( edge );
}
/**
* Although the traversal of {@link Edge}s is the primary means of
* adding residues/linkages to the {@link Sugar}, we still have
* to check {@link Vertex}es to make sure their {@link Residue}s
* also get added to the Sugar, since they may not have an {@link Edge} | void function( Edge<LinkageToken,ResidueToken> edge ) { Linkage linkage = edge.getValue().getLinkage(); Vertex<LinkageToken,ResidueToken> ptok = edge.getParent(); Vertex<LinkageToken,ResidueToken> ctok = edge.getChild(); Residue parent = ptok.getValue().getResidue(); Residue child = ctok.getValue().getResidue(); if ( ! sugar.contains( parent ) ) { sugar.addResidue( parent ); sugar.getGraph().lastVertex().ensureCapacity( ptok.countAttachedEdges() ); } sugar.addResidue( parent, linkage, child ); sugar.getGraph().lastVertex().ensureCapacity( ctok.countAttachedEdges() ); super.accept( edge ); } /** * Although the traversal of {@link Edge}s is the primary means of * adding residues/linkages to the {@link Sugar}, we still have * to check {@link Vertex}es to make sure their {@link Residue}s * also get added to the Sugar, since they may not have an {@link Edge} | /**
* As we visit each edge in the AST, obtain the appropriate
* parent {@link Residue}, child {@link Residue}, and
* {@link Linkage} from the given edge, and add these into
* the nascent {@link Sugar}.
*/ | As we visit each edge in the AST, obtain the appropriate parent <code>Residue</code>, child <code>Residue</code>, and <code>Linkage</code> from the given edge, and add these into the nascent <code>Sugar</code> | accept | {
"repo_name": "glycoinfo/eurocarbdb",
"path": "core-api/src/org/eurocarbdb/sugar/seq/grammar/AstTranslatorVisitor.java",
"license": "gpl-3.0",
"size": 3901
} | [
"org.eurocarbdb.sugar.Linkage",
"org.eurocarbdb.sugar.Residue",
"org.eurocarbdb.sugar.Sugar",
"org.eurocarbdb.util.graph.Edge",
"org.eurocarbdb.util.graph.Vertex"
] | import org.eurocarbdb.sugar.Linkage; import org.eurocarbdb.sugar.Residue; import org.eurocarbdb.sugar.Sugar; import org.eurocarbdb.util.graph.Edge; import org.eurocarbdb.util.graph.Vertex; | import org.eurocarbdb.sugar.*; import org.eurocarbdb.util.graph.*; | [
"org.eurocarbdb.sugar",
"org.eurocarbdb.util"
] | org.eurocarbdb.sugar; org.eurocarbdb.util; | 383,899 |
private void appendWord(String appendedText, TextPaint textPaint) {
int textWidth = (int) Math.ceil(textPaint.measureText(appendedText));
if (currentLineWidth + textWidth >= pageWidth) {
checkForPageEnd();
appendLineToPage(textLineHeight);
}
appendTextToLine(appendedText, textPaint, textWidth);
} | void function(String appendedText, TextPaint textPaint) { int textWidth = (int) Math.ceil(textPaint.measureText(appendedText)); if (currentLineWidth + textWidth >= pageWidth) { checkForPageEnd(); appendLineToPage(textLineHeight); } appendTextToLine(appendedText, textPaint, textWidth); } | /**
* METHOD DESCRIPTION TBI
*
* @param appendedText
* PARAM DESCRIPTION TBI
* @param textPaint
* PARAM DESCRIPTION TBI
*/ | METHOD DESCRIPTION TBI | appendWord | {
"repo_name": "ClayJohnson/Bookshelf",
"path": "Bookshelf_InitialPage/src/com/example/bookshelf_initialpage/SplitFragment.java",
"license": "apache-2.0",
"size": 5083
} | [
"android.text.TextPaint"
] | import android.text.TextPaint; | import android.text.*; | [
"android.text"
] | android.text; | 1,593,075 |
@Override
public boolean hasUpdateAccess(final PFUserDO user, final TeamCalDO obj, final TeamCalDO oldObj)
{
return hasInsertAccess(user, obj) == true;
} | boolean function(final PFUserDO user, final TeamCalDO obj, final TeamCalDO oldObj) { return hasInsertAccess(user, obj) == true; } | /**
* Owners and administrators are able to update calendars.
* @see org.projectforge.user.UserRightAccessCheck#hasUpdateAccess(org.projectforge.user.PFUserDO, java.lang.Object, java.lang.Object)
*/ | Owners and administrators are able to update calendars | hasUpdateAccess | {
"repo_name": "micromata/projectforge-webapp",
"path": "src/main/java/org/projectforge/plugins/teamcal/admin/TeamCalRight.java",
"license": "gpl-3.0",
"size": 8132
} | [
"org.projectforge.user.PFUserDO"
] | import org.projectforge.user.PFUserDO; | import org.projectforge.user.*; | [
"org.projectforge.user"
] | org.projectforge.user; | 1,923,054 |
public void setRemote(Protocol protocol) {
} | void function(Protocol protocol) { } | /**
* Called with the remote protocol when a handshake has been completed. After
* this has been called and while a connection is maintained,
* {@link #isConnected()} should return true and #getRemote() should return this
* protocol. Does nothing by default.
*/ | Called with the remote protocol when a handshake has been completed. After this has been called and while a connection is maintained, <code>#isConnected()</code> should return true and #getRemote() should return this protocol. Does nothing by default | setRemote | {
"repo_name": "apache/avro",
"path": "lang/java/ipc/src/main/java/org/apache/avro/ipc/Transceiver.java",
"license": "apache-2.0",
"size": 3910
} | [
"org.apache.avro.Protocol"
] | import org.apache.avro.Protocol; | import org.apache.avro.*; | [
"org.apache.avro"
] | org.apache.avro; | 2,779,373 |
Mapper getMap(); | Mapper getMap(); | /**
* The current map block. Never nil.
*/ | The current map block. Never nil | getMap | {
"repo_name": "couchbase/couchbase-lite-java-core",
"path": "src/main/java/com/couchbase/lite/store/ViewStoreDelegate.java",
"license": "apache-2.0",
"size": 1347
} | [
"com.couchbase.lite.Mapper"
] | import com.couchbase.lite.Mapper; | import com.couchbase.lite.*; | [
"com.couchbase.lite"
] | com.couchbase.lite; | 2,781,189 |
public List<Location> findAllVisible(Integer start, Integer max); | List<Location> function(Integer start, Integer max); | /**
* Methode zum Laden einer Listen von Location Objekten, es muss dabei ein
* Startwert angegeben werden und die Anzahl der zu ladenden Objekte. Diese
* Methode liefert nur die Objekte bei denen die Attribute visible=true und
* inLocationList=true gesetzt sind.
*
* @param start
* @param max
* @return
*/ | Methode zum Laden einer Listen von Location Objekten, es muss dabei ein Startwert angegeben werden und die Anzahl der zu ladenden Objekte. Diese Methode liefert nur die Objekte bei denen die Attribute visible=true und inLocationList=true gesetzt sind | findAllVisible | {
"repo_name": "tiv-source/tiv-page",
"path": "dao/src/main/java/de/tivsource/page/dao/location/LocationDaoLocal.java",
"license": "gpl-2.0",
"size": 2881
} | [
"de.tivsource.page.entity.location.Location",
"java.util.List"
] | import de.tivsource.page.entity.location.Location; import java.util.List; | import de.tivsource.page.entity.location.*; import java.util.*; | [
"de.tivsource.page",
"java.util"
] | de.tivsource.page; java.util; | 766,028 |
public void onShareButtonClicked(View view) {
String url = String.format("https://dharmaseed.org/teacher/%d/talk/%d/", talk.getTeacherId(), talk.getId());
Log.d(LOG_TAG,"Sharing link to " + url);
Intent share = new Intent(android.content.Intent.ACTION_SEND);
share.setType("text/plain");
share.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
// Add data to the intent, the receiving app will decide
// what to do with it.
share.putExtra(Intent.EXTRA_SUBJECT, talk.getTitle());
share.putExtra(Intent.EXTRA_TEXT, url);
startActivity(Intent.createChooser(share, "Share talk"));
} | void function(View view) { String url = String.format(STRSharing link to STRtext/plainSTRShare talk")); } | /**
* Share a link to the dharmaseed website for this talk
*/ | Share a link to the dharmaseed website for this talk | onShareButtonClicked | {
"repo_name": "bb4242/dharmaseed-android",
"path": "app/src/main/java/org/dharmaseed/android/PlayTalkActivity.java",
"license": "gpl-3.0",
"size": 19937
} | [
"android.view.View"
] | import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 2,180,298 |
EReference getMCommonConnection_ClientPort(); | EReference getMCommonConnection_ClientPort(); | /**
* Returns the meta object for the reference '{@link es.uah.aut.srg.micobs.mclev.mclevmcad.MCommonConnection#getClientPort <em>ClientPort</em>}'.
* @return the meta object for the reference '<em>ClientPort</em>'.
* @see es.uah.aut.srg.micobs.mclev.mclevmcad.MCommonConnection#getClientPort()
* @see #getMCommonConnection()
* @generated
*/ | Returns the meta object for the reference '<code>es.uah.aut.srg.micobs.mclev.mclevmcad.MCommonConnection#getClientPort ClientPort</code>' | getMCommonConnection_ClientPort | {
"repo_name": "parraman/micobs",
"path": "mclev/es.uah.aut.srg.micobs.mclev/src/es/uah/aut/srg/micobs/mclev/mclevmcad/mclevmcadPackage.java",
"license": "epl-1.0",
"size": 59510
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 116,647 |
public synchronized MutableGaugeLong newGauge(MetricsInfo info, long iVal) {
checkMetricName(info.name());
MutableGaugeLong ret = new MutableGaugeLong(info, iVal);
metricsMap.put(info.name(), ret);
return ret;
} | synchronized MutableGaugeLong function(MetricsInfo info, long iVal) { checkMetricName(info.name()); MutableGaugeLong ret = new MutableGaugeLong(info, iVal); metricsMap.put(info.name(), ret); return ret; } | /**
* Create a mutable long integer gauge
* @param info metadata of the metric
* @param iVal initial value
* @return a new gauge object
*/ | Create a mutable long integer gauge | newGauge | {
"repo_name": "Microsoft-CISL/hadoop-prototype",
"path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/lib/MetricsRegistry.java",
"license": "apache-2.0",
"size": 12784
} | [
"org.apache.hadoop.metrics2.MetricsInfo"
] | import org.apache.hadoop.metrics2.MetricsInfo; | import org.apache.hadoop.metrics2.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,851,032 |
@Override
public void initialize( SimulationState simState )
{
_LOG.trace( "Entering initialize( simState )" );
// Call the superclass implementation
super.initialize( simState );
// Get the properties
Properties props = simState.getProps();
// Get the min personality
String minPersonalityStr = props.getProperty( _MIN_PERSONALITY_KEY );
Validate.notEmpty( minPersonalityStr,
"Minimum personality value (key="
+ _MIN_PERSONALITY_KEY
+ ") may not be empty" );
_minPersonality = Float.parseFloat( minPersonalityStr );
_LOG.info( "Using _minPersonality=[" + _minPersonality + "]" );
// Get the max personality
String maxPersonalityStr = props.getProperty( _MAX_PERSONALITY_KEY );
Validate.notEmpty( maxPersonalityStr,
"Maximum personality value (key="
+ _MAX_PERSONALITY_KEY
+ ") may not be empty" );
_maxPersonality = Float.parseFloat( maxPersonalityStr );
_LOG.info( "Using _maxPersonality=[" + _maxPersonality + "]" );
// Get the max personality individual count
String maxPersonalityIndCountStr = props.getProperty(
_MAX_PERSONALITY_IND_COUNT_KEY );
Validate.notEmpty( maxPersonalityStr,
"Maximum personality individual count value (key="
+ _MAX_PERSONALITY_IND_COUNT_KEY
+ ") may not be empty" );
_maxPersonalityIndCount = Integer.parseInt( maxPersonalityIndCountStr );
_LOG.info( "Using _maxPersonalityIndCount=[" + _maxPersonalityIndCount + "]" );
_LOG.trace( "Leaving initialize( simState )" );
} | void function( SimulationState simState ) { _LOG.trace( STR ); super.initialize( simState ); Properties props = simState.getProps(); String minPersonalityStr = props.getProperty( _MIN_PERSONALITY_KEY ); Validate.notEmpty( minPersonalityStr, STR + _MIN_PERSONALITY_KEY + STR ); _minPersonality = Float.parseFloat( minPersonalityStr ); _LOG.info( STR + _minPersonality + "]" ); String maxPersonalityStr = props.getProperty( _MAX_PERSONALITY_KEY ); Validate.notEmpty( maxPersonalityStr, STR + _MAX_PERSONALITY_KEY + STR ); _maxPersonality = Float.parseFloat( maxPersonalityStr ); _LOG.info( STR + _maxPersonality + "]" ); String maxPersonalityIndCountStr = props.getProperty( _MAX_PERSONALITY_IND_COUNT_KEY ); Validate.notEmpty( maxPersonalityStr, STR + _MAX_PERSONALITY_IND_COUNT_KEY + STR ); _maxPersonalityIndCount = Integer.parseInt( maxPersonalityIndCountStr ); _LOG.info( STR + _maxPersonalityIndCount + "]" ); _LOG.trace( STR ); } | /**
* Initializes the builder
*
* @param simState The simulation's state
* @see edu.snu.leader.hidden.builder.AbstractIndividualBuilder#initialize(edu.snu.leader.hidden.SimulationState)
*/ | Initializes the builder | initialize | {
"repo_name": "snucsne/bio-inspired-leadership",
"path": "src/edu/snu/leader/hidden/builder/ForcedPersonalityDistributionIndividualBuilder.java",
"license": "gpl-3.0",
"size": 5355
} | [
"edu.snu.leader.hidden.SimulationState",
"java.util.Properties",
"org.apache.commons.lang.Validate"
] | import edu.snu.leader.hidden.SimulationState; import java.util.Properties; import org.apache.commons.lang.Validate; | import edu.snu.leader.hidden.*; import java.util.*; import org.apache.commons.lang.*; | [
"edu.snu.leader",
"java.util",
"org.apache.commons"
] | edu.snu.leader; java.util; org.apache.commons; | 2,836,148 |
private List<AiTile> calculateEndPoints(int[][] matrice, AiZone gameZone)
throws StopRequestException {
checkInterruption();
List<AiTile> endPoints = new ArrayList<AiTile>();
for (int i = 0; i < gameZone.getHeight(); i++) {
checkInterruption();
for (int j = 0; j < gameZone.getWidth(); j++) {
checkInterruption();
if (matrice[i][j] == CASE_SUR || matrice[i][j] == CASE_BONUS) {
endPoints.add(gameZone.getTile(i, j));
}
}
}
return endPoints;
}
| List<AiTile> function(int[][] matrice, AiZone gameZone) throws StopRequestException { checkInterruption(); List<AiTile> endPoints = new ArrayList<AiTile>(); for (int i = 0; i < gameZone.getHeight(); i++) { checkInterruption(); for (int j = 0; j < gameZone.getWidth(); j++) { checkInterruption(); if (matrice[i][j] == CASE_SUR matrice[i][j] == CASE_BONUS) { endPoints.add(gameZone.getTile(i, j)); } } } return endPoints; } | /**
* Methode calculant la liste des cases ou le hero peut aller. On prend
* aussi en compte les cases qui sont dans la portee des bombes et les deux
* sous-parties de la zone. Notre hero peut se deplacer en traversant ces
* cases.
*
* @param matrice
* La Matrice de Zone
* @param gameZone
* la zone du jeu
* @return la liste des points finaux.
* @throws StopRequestException
* Description manquante !
*/ | Methode calculant la liste des cases ou le hero peut aller. On prend aussi en compte les cases qui sont dans la portee des bombes et les deux sous-parties de la zone. Notre hero peut se deplacer en traversant ces cases | calculateEndPoints | {
"repo_name": "vlabatut/totalboumboum",
"path": "resources/ai/org/totalboumboum/ai/v200910/ais/mancuhanpinarer/v5c/MancuhanPinarer.java",
"license": "gpl-2.0",
"size": 41428
} | [
"java.util.ArrayList",
"java.util.List",
"org.totalboumboum.ai.v200910.adapter.communication.StopRequestException",
"org.totalboumboum.ai.v200910.adapter.data.AiTile",
"org.totalboumboum.ai.v200910.adapter.data.AiZone"
] | import java.util.ArrayList; import java.util.List; import org.totalboumboum.ai.v200910.adapter.communication.StopRequestException; import org.totalboumboum.ai.v200910.adapter.data.AiTile; import org.totalboumboum.ai.v200910.adapter.data.AiZone; | import java.util.*; import org.totalboumboum.ai.v200910.adapter.communication.*; import org.totalboumboum.ai.v200910.adapter.data.*; | [
"java.util",
"org.totalboumboum.ai"
] | java.util; org.totalboumboum.ai; | 778,724 |
private boolean acceptsOnOffType(Item item) {
return item.getAcceptedCommandTypes().contains(OnOffType.class);
}
private class HomematicBindingConfigHelper {
public String address;
public String channel;
public String parameter;
@SuppressWarnings("unused")
public String converter;
public String variable;
public String program;
public String action;
public String forceUpdate; | boolean function(Item item) { return item.getAcceptedCommandTypes().contains(OnOffType.class); } private class HomematicBindingConfigHelper { public String address; public String channel; public String parameter; @SuppressWarnings(STR) public String converter; public String variable; public String program; public String action; public String forceUpdate; | /**
* Returns true, if the item accepts the OnOffType.
*/ | Returns true, if the item accepts the OnOffType | acceptsOnOffType | {
"repo_name": "gregfinley/openhab",
"path": "bundles/binding/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/bus/BindingConfigParser.java",
"license": "epl-1.0",
"size": 6451
} | [
"org.openhab.core.items.Item",
"org.openhab.core.library.types.OnOffType"
] | import org.openhab.core.items.Item; import org.openhab.core.library.types.OnOffType; | import org.openhab.core.items.*; import org.openhab.core.library.types.*; | [
"org.openhab.core"
] | org.openhab.core; | 1,843,325 |
public void moveFile(String file) {
File f = new File(this.tempFile);
if (!file.startsWith("/")) {
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
file = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + file;
} else {
file = "/data/data/" + handler.cordova.getActivity().getPackageName() + "/cache/" + file;
}
}
String logMsg = "renaming " + this.tempFile + " to " + file;
Log.d(LOG_TAG, logMsg);
if (!f.renameTo(new File(file))) Log.e(LOG_TAG, "FAILED " + logMsg);
} | void function(String file) { File f = new File(this.tempFile); if (!file.startsWith("/")) { if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { file = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + file; } else { file = STR + handler.cordova.getActivity().getPackageName() + STR + file; } } String logMsg = STR + this.tempFile + STR + file; Log.d(LOG_TAG, logMsg); if (!f.renameTo(new File(file))) Log.e(LOG_TAG, STR + logMsg); } | /**
* Save temporary recorded file to specified name
*
* @param file
*/ | Save temporary recorded file to specified name | moveFile | {
"repo_name": "circular-code/ImageStream",
"path": "www/plugins/cordova-plugin-media/src/android/AudioPlayer.java",
"license": "mit",
"size": 21332
} | [
"android.os.Environment",
"android.util.Log",
"java.io.File"
] | import android.os.Environment; import android.util.Log; import java.io.File; | import android.os.*; import android.util.*; import java.io.*; | [
"android.os",
"android.util",
"java.io"
] | android.os; android.util; java.io; | 1,693,082 |
public Builder addPorts(String ports) {
if (this.ports == null) {
this.ports = new LinkedList<>();
}
this.ports.add(ports);
return this;
} | Builder function(String ports) { if (this.ports == null) { this.ports = new LinkedList<>(); } this.ports.add(ports); return this; } | /**
* An optional list of ports to which this rule applies. This field is only applicable for UDP
* or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule
* applies to connections through any port.
*
* <p>Example inputs include: ["22"], ["80","443"], and ["12345-12349"].
*/ | An optional list of ports to which this rule applies. This field is only applicable for UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. Example inputs include: ["22"], ["80","443"], and ["12345-12349"] | addPorts | {
"repo_name": "vam-google/google-cloud-java",
"path": "google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/Denied.java",
"license": "apache-2.0",
"size": 7033
} | [
"java.util.LinkedList"
] | import java.util.LinkedList; | import java.util.*; | [
"java.util"
] | java.util; | 2,712,900 |
protected final JPanel makeJPanel(final LayoutManager lm, final Font panelFont)
{
final JPanel p = ((lm == null) ? new JPanel() : new JPanel(lm));
if (! SwingMainDisplay.isOSColorHighContrast())
{
p.setBackground(null); // inherit from parent
p.setForeground(null);
}
if (panelFont != null)
p.setFont(panelFont);
return p;
}
/**
* Convenience method to make all {@link JLabel}s and {@link JButton}s
* in a container use its font and background color.
* @param c Container such as a {@link JPanel} | final JPanel function(final LayoutManager lm, final Font panelFont) { final JPanel p = ((lm == null) ? new JPanel() : new JPanel(lm)); if (! SwingMainDisplay.isOSColorHighContrast()) { p.setBackground(null); p.setForeground(null); } if (panelFont != null) p.setFont(panelFont); return p; } /** * Convenience method to make all {@link JLabel}s and {@link JButton}s * in a container use its font and background color. * @param c Container such as a {@link JPanel} | /**
* Make a new JPanel with our colors and font, and the specified layout manager.
* Foreground and background color are set to {@code null} to inherit from parent.
* @param lm Layout manager to use, or {@code null} for default
* @param panelFont Font to optionally set
* @return new JPanel, with specified layout manager from calling <tt>new {@link JPanel#JPanel(LayoutManager)}</tt>
* @see #makeJPanel(Font)
*/ | Make a new JPanel with our colors and font, and the specified layout manager. Foreground and background color are set to null to inherit from parent | makeJPanel | {
"repo_name": "jdmonin/JSettlers2",
"path": "src/main/java/soc/client/SOCDialog.java",
"license": "gpl-3.0",
"size": 12830
} | [
"java.awt.Container",
"java.awt.Font",
"java.awt.LayoutManager",
"javax.swing.JButton",
"javax.swing.JLabel",
"javax.swing.JPanel"
] | import java.awt.Container; import java.awt.Font; import java.awt.LayoutManager; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; | import java.awt.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 7,958 |
private void syncStaticSettings(WebSettings settings) {
settings.setDefaultFontSize(16);
settings.setDefaultFixedFontSize(13);
// WebView inside Browser doesn't want initial focus to be set.
settings.setNeedInitialFocus(false);
// Browser supports multiple windows
settings.setSupportMultipleWindows(true);
// enable smooth transition for better performance during panning or
// zooming
settings.setEnableSmoothTransition(true);
// disable content url access
//settings.setAllowContentAccess(false);
settings.setAllowContentAccess(true);
// HTML5 API flags
settings.setAppCacheEnabled(true);
settings.setDatabaseEnabled(true);
settings.setDomStorageEnabled(true);
// HTML5 configuration parametersettings.
settings.setAppCacheMaxSize(getWebStorageSizeManager().getAppCacheMaxSize());
settings.setAppCachePath(getAppCachePath());
settings.setDatabasePath(mContext.getDir("databases", 0).getPath());
settings.setGeolocationDatabasePath(mContext.getDir("geolocation", 0).getPath());
// origin policy for file access
settings.setAllowUniversalAccessFromFileURLs(false);
settings.setAllowFileAccessFromFileURLs(false);
} | void function(WebSettings settings) { settings.setDefaultFontSize(16); settings.setDefaultFixedFontSize(13); settings.setNeedInitialFocus(false); settings.setSupportMultipleWindows(true); settings.setEnableSmoothTransition(true); settings.setAllowContentAccess(true); settings.setAppCacheEnabled(true); settings.setDatabaseEnabled(true); settings.setDomStorageEnabled(true); settings.setAppCacheMaxSize(getWebStorageSizeManager().getAppCacheMaxSize()); settings.setAppCachePath(getAppCachePath()); settings.setDatabasePath(mContext.getDir(STR, 0).getPath()); settings.setGeolocationDatabasePath(mContext.getDir(STR, 0).getPath()); settings.setAllowUniversalAccessFromFileURLs(false); settings.setAllowFileAccessFromFileURLs(false); } | /**
* Syncs all the settings that have no UI
* These cannot change, so we only need to set them once per WebSettings
*/ | Syncs all the settings that have no UI These cannot change, so we only need to set them once per WebSettings | syncStaticSettings | {
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "packages/apps/Browser/src/com/android/browser/BrowserSettings.java",
"license": "gpl-3.0",
"size": 31426
} | [
"android.webkit.WebSettings"
] | import android.webkit.WebSettings; | import android.webkit.*; | [
"android.webkit"
] | android.webkit; | 2,425,593 |
public void setBackgroundNonSelectionColor(Color newColor) {
backgroundNonSelectionColor = newColor;
} | void function(Color newColor) { backgroundNonSelectionColor = newColor; } | /**
* Sets the background color to be used for non selected nodes.
*/ | Sets the background color to be used for non selected nodes | setBackgroundNonSelectionColor | {
"repo_name": "shun634501730/java_source_cn",
"path": "src_en/javax/swing/tree/DefaultTreeCellRenderer.java",
"license": "apache-2.0",
"size": 22329
} | [
"java.awt.Color"
] | import java.awt.Color; | import java.awt.*; | [
"java.awt"
] | java.awt; | 161,072 |
for (ActionRequest actionRequest : actionRequests) {
if (actionRequest instanceof IndexRequest) {
add((IndexRequest) actionRequest);
} else if (actionRequest instanceof DeleteRequest) {
add((DeleteRequest) actionRequest);
} else if (actionRequest instanceof UpdateRequest) {
add((UpdateRequest) actionRequest);
} else {
throw new IllegalArgumentException(
"RequestIndexer only supports Index, Delete and Update requests");
}
}
} | for (ActionRequest actionRequest : actionRequests) { if (actionRequest instanceof IndexRequest) { add((IndexRequest) actionRequest); } else if (actionRequest instanceof DeleteRequest) { add((DeleteRequest) actionRequest); } else if (actionRequest instanceof UpdateRequest) { add((UpdateRequest) actionRequest); } else { throw new IllegalArgumentException( STR); } } } | /**
* Add multiple {@link ActionRequest} to the indexer to prepare for sending requests to
* Elasticsearch.
*
* @param actionRequests The multiple {@link ActionRequest} to add.
* @deprecated use the {@link DeleteRequest}, {@link IndexRequest} or {@link UpdateRequest}
*/ | Add multiple <code>ActionRequest</code> to the indexer to prepare for sending requests to Elasticsearch | add | {
"repo_name": "rmetzger/flink",
"path": "flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/streaming/connectors/elasticsearch/RequestIndexer.java",
"license": "apache-2.0",
"size": 3072
} | [
"org.elasticsearch.action.ActionRequest",
"org.elasticsearch.action.delete.DeleteRequest",
"org.elasticsearch.action.index.IndexRequest",
"org.elasticsearch.action.update.UpdateRequest"
] | import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.delete.DeleteRequest; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.update.UpdateRequest; | import org.elasticsearch.action.*; import org.elasticsearch.action.delete.*; import org.elasticsearch.action.index.*; import org.elasticsearch.action.update.*; | [
"org.elasticsearch.action"
] | org.elasticsearch.action; | 1,951,388 |
protected void doUpdate(SipServletRequest req)
throws ServletException, IOException
{
} | void function(SipServletRequest req) throws ServletException, IOException { } | /**
* Invoked by the server (via the service method) to handle incoming
* UPDATE requests.
*
* <p>The default implementation is empty and must be overridden by
* subclasses to do something useful.
*
* @param req represents the incoming SIP REGISTER request
* @throws ServletException if an exception occurs that interferes
* with the servlet's normal operation
* @throws IOException if an input or output exception occurs
*/ | Invoked by the server (via the service method) to handle incoming UPDATE requests. The default implementation is empty and must be overridden by subclasses to do something useful | doUpdate | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.websphere.javaee.servlet.sip.1.1/src/javax/servlet/sip/SipServlet.java",
"license": "epl-1.0",
"size": 31675
} | [
"java.io.IOException",
"javax.servlet.ServletException"
] | import java.io.IOException; import javax.servlet.ServletException; | import java.io.*; import javax.servlet.*; | [
"java.io",
"javax.servlet"
] | java.io; javax.servlet; | 2,751,419 |
public Set<String> getQueryParams() {
return this.queryParams;
} | Set<String> function() { return this.queryParams; } | /**
* Parameter keys that are sent via the query string
*/ | Parameter keys that are sent via the query string | getQueryParams | {
"repo_name": "cscorley/solr-only-mirror",
"path": "solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java",
"license": "apache-2.0",
"size": 3167
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,757,607 |
@SuppressWarnings("deprecation")
private void updateRegion() {
Insets i = autoScroll.getAutoscrollInsets();
Dimension size = component.getSize();
if (size.width != outer.width || size.height != outer.height)
outer.reshape(0, 0, size.width, size.height);
if (inner.x != i.left || inner.y != i.top)
inner.setLocation(i.left, i.top);
int newWidth = size.width - (i.left + i.right);
int newHeight = size.height - (i.top + i.bottom);
if (newWidth != inner.width || newHeight != inner.height)
inner.setSize(newWidth, newHeight);
}
/**
* cause autoscroll to occur
*
* @param newLocn the {@code Point} | @SuppressWarnings(STR) void function() { Insets i = autoScroll.getAutoscrollInsets(); Dimension size = component.getSize(); if (size.width != outer.width size.height != outer.height) outer.reshape(0, 0, size.width, size.height); if (inner.x != i.left inner.y != i.top) inner.setLocation(i.left, i.top); int newWidth = size.width - (i.left + i.right); int newHeight = size.height - (i.top + i.bottom); if (newWidth != inner.width newHeight != inner.height) inner.setSize(newWidth, newHeight); } /** * cause autoscroll to occur * * @param newLocn the {@code Point} | /**
* update the geometry of the autoscroll region
*/ | update the geometry of the autoscroll region | updateRegion | {
"repo_name": "mirkosertic/Bytecoder",
"path": "classlib/java.desktop/src/main/resources/META-INF/modules/java.desktop/classes/java/awt/dnd/DropTarget.java",
"license": "apache-2.0",
"size": 27733
} | [
"java.awt.Dimension",
"java.awt.Insets",
"java.awt.Point"
] | import java.awt.Dimension; import java.awt.Insets; import java.awt.Point; | import java.awt.*; | [
"java.awt"
] | java.awt; | 949,909 |
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof SymbolAxis)) {
return false;
}
SymbolAxis that = (SymbolAxis) obj;
if (!this.symbols.equals(that.symbols)) {
return false;
}
if (this.gridBandsVisible != that.gridBandsVisible) {
return false;
}
if (!PaintUtilities.equal(this.gridBandPaint, that.gridBandPaint)) {
return false;
}
if (!PaintUtilities.equal(this.gridBandAlternatePaint,
that.gridBandAlternatePaint)) {
return false;
}
return super.equals(obj);
}
| boolean function(Object obj) { if (obj == this) { return true; } if (!(obj instanceof SymbolAxis)) { return false; } SymbolAxis that = (SymbolAxis) obj; if (!this.symbols.equals(that.symbols)) { return false; } if (this.gridBandsVisible != that.gridBandsVisible) { return false; } if (!PaintUtilities.equal(this.gridBandPaint, that.gridBandPaint)) { return false; } if (!PaintUtilities.equal(this.gridBandAlternatePaint, that.gridBandAlternatePaint)) { return false; } return super.equals(obj); } | /**
* Tests this axis for equality with an arbitrary object.
*
* @param obj the object (<code>null</code> permitted).
*
* @return A boolean.
*/ | Tests this axis for equality with an arbitrary object | equals | {
"repo_name": "SpoonLabs/astor",
"path": "examples/chart_11/source/org/jfree/chart/axis/SymbolAxis.java",
"license": "gpl-2.0",
"size": 31192
} | [
"org.jfree.chart.util.PaintUtilities"
] | import org.jfree.chart.util.PaintUtilities; | import org.jfree.chart.util.*; | [
"org.jfree.chart"
] | org.jfree.chart; | 147,090 |
public Chunk provideChunk(int x, int z)
{
Chunk chunk = (Chunk)this.id2ChunkMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(x, z));
return chunk == null ? (!this.worldObj.isFindingSpawnPoint() && !this.chunkLoadOverride ? this.dummyChunk : this.loadChunk(x, z)) : chunk;
} | Chunk function(int x, int z) { Chunk chunk = (Chunk)this.id2ChunkMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(x, z)); return chunk == null ? (!this.worldObj.isFindingSpawnPoint() && !this.chunkLoadOverride ? this.dummyChunk : this.loadChunk(x, z)) : chunk; } | /**
* Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the
* specified chunk from the map seed and chunk seed
*/ | Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the specified chunk from the map seed and chunk seed | provideChunk | {
"repo_name": "trixmot/mod1",
"path": "build/tmp/recompileMc/sources/net/minecraft/world/gen/ChunkProviderServer.java",
"license": "lgpl-2.1",
"size": 15286
} | [
"net.minecraft.world.ChunkCoordIntPair",
"net.minecraft.world.chunk.Chunk"
] | import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.chunk.Chunk; | import net.minecraft.world.*; import net.minecraft.world.chunk.*; | [
"net.minecraft.world"
] | net.minecraft.world; | 1,797,589 |
return (macEntries == null)
? null
: Collections.unmodifiableCollection(macEntries.values());
} | return (macEntries == null) ? null : Collections.unmodifiableCollection(macEntries.values()); } | /**
* Return an unmodifiable collection that contains all the MAC address
* table entries configured in this instance.
*
* @return An unmodifiable collection of {@link MacEntry} instances
* or {@code null}.
*/ | Return an unmodifiable collection that contains all the MAC address table entries configured in this instance | getMacEntries | {
"repo_name": "opendaylight/vtn",
"path": "manager/it/core/src/test/java/org/opendaylight/vtn/manager/it/core/MacEntryWaiter.java",
"license": "epl-1.0",
"size": 13764
} | [
"java.util.Collections"
] | import java.util.Collections; | import java.util.*; | [
"java.util"
] | java.util; | 715,426 |
@Override
public long position(byte[] pattern, long start) throws SQLException {
if (isDebugEnabled()) {
debugCode("position("+quoteBytes(pattern)+", "+start+");");
}
if (Constants.BLOB_SEARCH) {
try {
checkClosed();
if (pattern == null) {
return -1;
}
if (pattern.length == 0) {
return 1;
}
// TODO performance: blob pattern search is slow
BufferedInputStream in = new BufferedInputStream(value.getInputStream());
IOUtils.skipFully(in, start - 1);
int pos = 0;
int patternPos = 0;
while (true) {
int x = in.read();
if (x < 0) {
break;
}
if (x == (pattern[patternPos] & 0xff)) {
if (patternPos == 0) {
in.mark(pattern.length);
}
if (patternPos == pattern.length) {
return pos - patternPos;
}
patternPos++;
} else {
if (patternPos > 0) {
in.reset();
pos -= patternPos;
}
}
pos++;
}
return -1;
} catch (Exception e) {
throw logAndConvert(e);
}
}
throw unsupported("LOB search");
} | long function(byte[] pattern, long start) throws SQLException { if (isDebugEnabled()) { debugCode(STR+quoteBytes(pattern)+STR+start+");"); } if (Constants.BLOB_SEARCH) { try { checkClosed(); if (pattern == null) { return -1; } if (pattern.length == 0) { return 1; } BufferedInputStream in = new BufferedInputStream(value.getInputStream()); IOUtils.skipFully(in, start - 1); int pos = 0; int patternPos = 0; while (true) { int x = in.read(); if (x < 0) { break; } if (x == (pattern[patternPos] & 0xff)) { if (patternPos == 0) { in.mark(pattern.length); } if (patternPos == pattern.length) { return pos - patternPos; } patternPos++; } else { if (patternPos > 0) { in.reset(); pos -= patternPos; } } pos++; } return -1; } catch (Exception e) { throw logAndConvert(e); } } throw unsupported(STR); } | /**
* [Not supported] Searches a pattern and return the position.
*
* @param pattern the pattern to search
* @param start the index, the first byte is at position 1
* @return the position (first byte is at position 1), or -1 for not found
*/ | [Not supported] Searches a pattern and return the position | position | {
"repo_name": "vdr007/ThriftyPaxos",
"path": "src/applications/h2/src/main/org/h2/jdbc/JdbcBlob.java",
"license": "apache-2.0",
"size": 10482
} | [
"java.io.BufferedInputStream",
"java.sql.SQLException",
"org.h2.engine.Constants",
"org.h2.util.IOUtils"
] | import java.io.BufferedInputStream; import java.sql.SQLException; import org.h2.engine.Constants; import org.h2.util.IOUtils; | import java.io.*; import java.sql.*; import org.h2.engine.*; import org.h2.util.*; | [
"java.io",
"java.sql",
"org.h2.engine",
"org.h2.util"
] | java.io; java.sql; org.h2.engine; org.h2.util; | 328,418 |
public JCExpression convertToIntForHashAttribute(JCExpression value) {
SyntheticName tempName = naming.temp("hash");
JCExpression type = make().Type(syms().longType);
JCBinary combine = make().Binary(JCTree.Tag.BITXOR, makeUnquotedIdent(tempName.asName()),
make().Binary(JCTree.Tag.USR, makeUnquotedIdent(tempName.asName()), makeInteger(32)));
return make().TypeCast(syms().intType, makeLetExpr(tempName, null, type, value, combine));
} | JCExpression function(JCExpression value) { SyntheticName tempName = naming.temp("hash"); JCExpression type = make().Type(syms().longType); JCBinary combine = make().Binary(JCTree.Tag.BITXOR, makeUnquotedIdent(tempName.asName()), make().Binary(JCTree.Tag.USR, makeUnquotedIdent(tempName.asName()), makeInteger(32))); return make().TypeCast(syms().intType, makeLetExpr(tempName, null, type, value, combine)); } | /**
* Turn this long value into an int value by applying (int)(e ^ (e >>> 32))
*/ | Turn this long value into an int value by applying (int)(e ^ (e >>> 32)) | convertToIntForHashAttribute | {
"repo_name": "ceylon/ceylon",
"path": "compiler-java/src/org/eclipse/ceylon/compiler/java/codegen/AbstractTransformer.java",
"license": "apache-2.0",
"size": 290110
} | [
"org.eclipse.ceylon.compiler.java.codegen.Naming",
"org.eclipse.ceylon.langtools.tools.javac.tree.JCTree",
"org.eclipse.ceylon.model.typechecker.model.Type"
] | import org.eclipse.ceylon.compiler.java.codegen.Naming; import org.eclipse.ceylon.langtools.tools.javac.tree.JCTree; import org.eclipse.ceylon.model.typechecker.model.Type; | import org.eclipse.ceylon.compiler.java.codegen.*; import org.eclipse.ceylon.langtools.tools.javac.tree.*; import org.eclipse.ceylon.model.typechecker.model.*; | [
"org.eclipse.ceylon"
] | org.eclipse.ceylon; | 1,372,770 |
@Before
public void setUp()
{
this.faxJobMonitor=new FaxJobMonitorImpl();
this.faxClientSpi=TestUtil.createFaxClientSpi(EmptyFaxClientSpi.class.getName(),null);
Logger logger=this.faxClientSpi.getLogger();
Map<String,String> configuration=LibraryConfigurationLoader.getSystemConfiguration();
Map<String,String> map=new HashMap<String,String>(configuration);
map.putAll(configuration);
map.put("org.fax4j.monitor.polling.interval","50");
this.faxJobMonitor.initialize(map,logger);
} | void function() { this.faxJobMonitor=new FaxJobMonitorImpl(); this.faxClientSpi=TestUtil.createFaxClientSpi(EmptyFaxClientSpi.class.getName(),null); Logger logger=this.faxClientSpi.getLogger(); Map<String,String> configuration=LibraryConfigurationLoader.getSystemConfiguration(); Map<String,String> map=new HashMap<String,String>(configuration); map.putAll(configuration); map.put(STR,"50"); this.faxJobMonitor.initialize(map,logger); } | /**
* Sets up the SPI instance.
*/ | Sets up the SPI instance | setUp | {
"repo_name": "ZhernakovMikhail/fax4j",
"path": "src/test/java/org/fax4j/spi/FaxJobMonitorImplTest.java",
"license": "apache-2.0",
"size": 4398
} | [
"java.util.HashMap",
"java.util.Map",
"org.fax4j.common.Logger",
"org.fax4j.test.TestUtil",
"org.fax4j.util.LibraryConfigurationLoader"
] | import java.util.HashMap; import java.util.Map; import org.fax4j.common.Logger; import org.fax4j.test.TestUtil; import org.fax4j.util.LibraryConfigurationLoader; | import java.util.*; import org.fax4j.common.*; import org.fax4j.test.*; import org.fax4j.util.*; | [
"java.util",
"org.fax4j.common",
"org.fax4j.test",
"org.fax4j.util"
] | java.util; org.fax4j.common; org.fax4j.test; org.fax4j.util; | 2,178,331 |
private void deleteSpillFiles() {
for (UnsafeSorterSpillWriter spill : spillWriters) {
File file = spill.getFile();
if (file != null && file.exists()) {
if (!file.delete()) {
logger.error("Was unable to delete spill file {}", file.getAbsolutePath());
}
}
}
} | void function() { for (UnsafeSorterSpillWriter spill : spillWriters) { File file = spill.getFile(); if (file != null && file.exists()) { if (!file.delete()) { logger.error(STR, file.getAbsolutePath()); } } } } | /**
* Deletes any spill files created by this sorter.
*/ | Deletes any spill files created by this sorter | deleteSpillFiles | {
"repo_name": "SnappyDataInc/spark",
"path": "core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java",
"license": "apache-2.0",
"size": 23997
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 2,725,621 |
protected void addCookieRequestHeader(HttpState state, HttpConnection conn)
throws IOException, HttpException {
LOG.trace("enter HttpMethodBase.addCookieRequestHeader(HttpState, "
+ "HttpConnection)");
Header[] cookieheaders = getRequestHeaderGroup().getHeaders("Cookie");
for (int i = 0; i < cookieheaders.length; i++) {
Header cookieheader = cookieheaders[i];
if (cookieheader.isAutogenerated()) {
getRequestHeaderGroup().removeHeader(cookieheader);
}
}
CookieSpec matcher = getCookieSpec(state);
String host = this.params.getVirtualHost();
if (host == null) {
host = conn.getHost();
}
Cookie[] cookies = matcher.match(host, conn.getPort(),
getPath(), conn.isSecure(), state.getCookies());
if ((cookies != null) && (cookies.length > 0)) {
if (getParams().isParameterTrue(HttpMethodParams.SINGLE_COOKIE_HEADER)) {
// In strict mode put all cookies on the same header
putAllCookiesInASingleHeader(host, matcher, cookies);
} else {
// In non-strict mode put each cookie on a separate header
for (int i = 0; i < cookies.length; i++) {
String s = matcher.formatCookie(cookies[i]);
getRequestHeaderGroup().addHeader(new Header(HttpHeader.COOKIE, s, true));
}
}
if (matcher instanceof CookieVersionSupport) {
CookieVersionSupport versupport = (CookieVersionSupport) matcher;
int ver = versupport.getVersion();
boolean needVersionHeader = false;
for (int i = 0; i < cookies.length; i++) {
if (ver != cookies[i].getVersion()) {
needVersionHeader = true;
}
}
if (needVersionHeader) {
// Advertise cookie version support
getRequestHeaderGroup().addHeader(versupport.getVersionHeader());
}
}
}
}
/**
* Put all the cookies in a single header line.
*
* Merge the cookies already present in the request
* with the cookies coming from the state.
*
* @param host the host used with this cookies
* @param matcher the {@link CookieSpec matcher} used in this context
* @param cookies associated with the {@link HttpState state} | void function(HttpState state, HttpConnection conn) throws IOException, HttpException { LOG.trace(STR + STR); Header[] cookieheaders = getRequestHeaderGroup().getHeaders(STR); for (int i = 0; i < cookieheaders.length; i++) { Header cookieheader = cookieheaders[i]; if (cookieheader.isAutogenerated()) { getRequestHeaderGroup().removeHeader(cookieheader); } } CookieSpec matcher = getCookieSpec(state); String host = this.params.getVirtualHost(); if (host == null) { host = conn.getHost(); } Cookie[] cookies = matcher.match(host, conn.getPort(), getPath(), conn.isSecure(), state.getCookies()); if ((cookies != null) && (cookies.length > 0)) { if (getParams().isParameterTrue(HttpMethodParams.SINGLE_COOKIE_HEADER)) { putAllCookiesInASingleHeader(host, matcher, cookies); } else { for (int i = 0; i < cookies.length; i++) { String s = matcher.formatCookie(cookies[i]); getRequestHeaderGroup().addHeader(new Header(HttpHeader.COOKIE, s, true)); } } if (matcher instanceof CookieVersionSupport) { CookieVersionSupport versupport = (CookieVersionSupport) matcher; int ver = versupport.getVersion(); boolean needVersionHeader = false; for (int i = 0; i < cookies.length; i++) { if (ver != cookies[i].getVersion()) { needVersionHeader = true; } } if (needVersionHeader) { getRequestHeaderGroup().addHeader(versupport.getVersionHeader()); } } } } /** * Put all the cookies in a single header line. * * Merge the cookies already present in the request * with the cookies coming from the state. * * @param host the host used with this cookies * @param matcher the {@link CookieSpec matcher} used in this context * @param cookies associated with the {@link HttpState state} | /**
* Generates <tt>Cookie</tt> request headers for those {@link Cookie cookie}s
* that match the given host, port and path.
*
* @param state the {@link HttpState state} information associated with this method
* @param conn the {@link HttpConnection connection} used to execute
* this HTTP method
*
* @throws IOException if an I/O (transport) error occurs. Some transport exceptions
* can be recovered from.
* @throws HttpException if a protocol exception occurs. Usually protocol exceptions
* cannot be recovered from.
*/ | Generates Cookie request headers for those <code>Cookie cookie</code>s that match the given host, port and path | addCookieRequestHeader | {
"repo_name": "j4nnis/bproxy",
"path": "src/org/apache/commons/httpclient/HttpMethodBase.java",
"license": "apache-2.0",
"size": 98546
} | [
"java.io.IOException",
"org.apache.commons.httpclient.cookie.CookieSpec",
"org.apache.commons.httpclient.cookie.CookieVersionSupport",
"org.apache.commons.httpclient.params.HttpMethodParams",
"org.parosproxy.paros.network.HttpHeader"
] | import java.io.IOException; import org.apache.commons.httpclient.cookie.CookieSpec; import org.apache.commons.httpclient.cookie.CookieVersionSupport; import org.apache.commons.httpclient.params.HttpMethodParams; import org.parosproxy.paros.network.HttpHeader; | import java.io.*; import org.apache.commons.httpclient.cookie.*; import org.apache.commons.httpclient.params.*; import org.parosproxy.paros.network.*; | [
"java.io",
"org.apache.commons",
"org.parosproxy.paros"
] | java.io; org.apache.commons; org.parosproxy.paros; | 650,895 |
private List<Class<?>> findWekaClasses() throws IOException,
ClassNotFoundException {
String wekaJarPath = weka.filters.Filter.class.getProtectionDomain()
.getCodeSource().getLocation().toString();
wekaJarPath = URLDecoder.decode(wekaJarPath, "UTF-8").replace("file:", "");
JarFile wekaJar = new JarFile(wekaJarPath);
Enumeration<JarEntry> contents = wekaJar.entries();
List<Class<?>> wekaClasses = new ArrayList<Class<?>>(50);
int badModifiers = Modifier.ABSTRACT | Modifier.INTERFACE
| Modifier.PRIVATE | Modifier.PROTECTED;
while (contents.hasMoreElements()) {
JarEntry entry = contents.nextElement();
String name = entry.getName();
if (validClassFile(name)) {
String className = name.substring(0, name.length() - 6).replaceAll("/",
".");
Class<?> wekaClass = Class.forName(className);
if (((wekaClass.getModifiers() & badModifiers) == 0)
&& weka.filters.Filter.class.isAssignableFrom(wekaClass)
&& hasDefaultConstructor(wekaClass))
wekaClasses.add(wekaClass);
}
}
wekaJar.close();
return wekaClasses;
}
| List<Class<?>> function() throws IOException, ClassNotFoundException { String wekaJarPath = weka.filters.Filter.class.getProtectionDomain() .getCodeSource().getLocation().toString(); wekaJarPath = URLDecoder.decode(wekaJarPath, "UTF-8").replace("file:", STR/STR."); Class<?> wekaClass = Class.forName(className); if (((wekaClass.getModifiers() & badModifiers) == 0) && weka.filters.Filter.class.isAssignableFrom(wekaClass) && hasDefaultConstructor(wekaClass)) wekaClasses.add(wekaClass); } } wekaJar.close(); return wekaClasses; } | /**
* Find the available Weka filters in the jar file
*
* @return list wit the available Weka filters
* @throws IOException
* @throws ClassNotFoundException
*/ | Find the available Weka filters in the jar file | findWekaClasses | {
"repo_name": "DraXus/adams",
"path": "adams-manuel/src/main/java/adams/flow/template/MyTransformer.java",
"license": "gpl-3.0",
"size": 12749
} | [
"java.io.IOException",
"java.net.URLDecoder",
"java.util.List"
] | import java.io.IOException; import java.net.URLDecoder; import java.util.List; | import java.io.*; import java.net.*; import java.util.*; | [
"java.io",
"java.net",
"java.util"
] | java.io; java.net; java.util; | 2,742,956 |
@Override
public final int delete(final JsonObject queryString) {
LOG.trace("Start RestResource#delete()");
int responseCode = UncResultCode.UNC_CLIENT_ERROR.getValue();
if (resource != null && queryString != null) {
LOG.debug("Input value for queryString : " + queryString);
try {
validateJson(VtnServiceConsts.DELETE, queryString, resource);
responseCode = UncCommonEnum.UncResultCode.UNC_SERVER_ERROR
.getValue();
responseCode = resource.delete(queryString);
// if response is not success, then set the info for error
if (responseCode != UncResultCode.UNC_SUCCESS.getValue()) {
info = resource.getInfo();
} else {
openStackConnection = resource.getOpenStackConnection();
}
} catch (final VtnServiceException exception) {
exceptionHandler.handle(
Thread.currentThread().getStackTrace()[1]
.getClassName()
+ VtnServiceConsts.HYPHEN
+ Thread.currentThread().getStackTrace()[1]
.getMethodName(),
UncJavaAPIErrorCode.DELETE_ERROR.getErrorCode(),
UncJavaAPIErrorCode.DELETE_ERROR.getErrorMessage(),
exception);
} catch (final RuntimeException exception) {
exceptionHandler.handle(
Thread.currentThread().getStackTrace()[1]
.getClassName()
+ VtnServiceConsts.HYPHEN
+ Thread.currentThread().getStackTrace()[1]
.getMethodName(),
UncJavaAPIErrorCode.INTERNAL_ERROR.getErrorCode(),
UncJavaAPIErrorCode.INTERNAL_ERROR.getErrorMessage(),
exception);
}
}
responseCode = convertResponseCode(responseCode);
LOG.trace("Complete RestResource#delete()");
return responseCode;
} | final int function(final JsonObject queryString) { LOG.trace(STR); int responseCode = UncResultCode.UNC_CLIENT_ERROR.getValue(); if (resource != null && queryString != null) { LOG.debug(STR + queryString); try { validateJson(VtnServiceConsts.DELETE, queryString, resource); responseCode = UncCommonEnum.UncResultCode.UNC_SERVER_ERROR .getValue(); responseCode = resource.delete(queryString); if (responseCode != UncResultCode.UNC_SUCCESS.getValue()) { info = resource.getInfo(); } else { openStackConnection = resource.getOpenStackConnection(); } } catch (final VtnServiceException exception) { exceptionHandler.handle( Thread.currentThread().getStackTrace()[1] .getClassName() + VtnServiceConsts.HYPHEN + Thread.currentThread().getStackTrace()[1] .getMethodName(), UncJavaAPIErrorCode.DELETE_ERROR.getErrorCode(), UncJavaAPIErrorCode.DELETE_ERROR.getErrorMessage(), exception); } catch (final RuntimeException exception) { exceptionHandler.handle( Thread.currentThread().getStackTrace()[1] .getClassName() + VtnServiceConsts.HYPHEN + Thread.currentThread().getStackTrace()[1] .getMethodName(), UncJavaAPIErrorCode.INTERNAL_ERROR.getErrorCode(), UncJavaAPIErrorCode.INTERNAL_ERROR.getErrorMessage(), exception); } } responseCode = convertResponseCode(responseCode); LOG.trace(STR); return responseCode; } | /**
* Deletes resource and prepares the response information
*
*/ | Deletes resource and prepares the response information | delete | {
"repo_name": "opendaylight/vtn",
"path": "coordinator/java/vtn-javaapi/src/org/opendaylight/vtn/javaapi/RestResource.java",
"license": "epl-1.0",
"size": 24550
} | [
"com.google.gson.JsonObject",
"org.opendaylight.vtn.javaapi.constants.VtnServiceConsts",
"org.opendaylight.vtn.javaapi.exception.VtnServiceException",
"org.opendaylight.vtn.javaapi.ipc.enums.UncCommonEnum",
"org.opendaylight.vtn.javaapi.ipc.enums.UncJavaAPIErrorCode"
] | import com.google.gson.JsonObject; import org.opendaylight.vtn.javaapi.constants.VtnServiceConsts; import org.opendaylight.vtn.javaapi.exception.VtnServiceException; import org.opendaylight.vtn.javaapi.ipc.enums.UncCommonEnum; import org.opendaylight.vtn.javaapi.ipc.enums.UncJavaAPIErrorCode; | import com.google.gson.*; import org.opendaylight.vtn.javaapi.constants.*; import org.opendaylight.vtn.javaapi.exception.*; import org.opendaylight.vtn.javaapi.ipc.enums.*; | [
"com.google.gson",
"org.opendaylight.vtn"
] | com.google.gson; org.opendaylight.vtn; | 240,797 |
void serviceChanged(ServiceState serviceState); | void serviceChanged(ServiceState serviceState); | /**
* Fired when the service has changed, passes
* the new models so that the component can update.
*/ | Fired when the service has changed, passes the new models so that the component can update | serviceChanged | {
"repo_name": "syd711/mephisto_iii",
"path": "src/main/java/de/calette/mephisto3/ui/ServiceChangeListener.java",
"license": "mit",
"size": 384
} | [
"de.calette.mephisto3.control.ServiceState"
] | import de.calette.mephisto3.control.ServiceState; | import de.calette.mephisto3.control.*; | [
"de.calette.mephisto3"
] | de.calette.mephisto3; | 2,431,613 |
protected ExtensionSpider getExtensionSpider() {
return this.extension;
} | ExtensionSpider function() { return this.extension; } | /**
* Gets the extension.
*
* @return the extension
*/ | Gets the extension | getExtensionSpider | {
"repo_name": "gsavastano/zaproxy",
"path": "src/org/zaproxy/zap/spider/Spider.java",
"license": "apache-2.0",
"size": 24336
} | [
"org.zaproxy.zap.extension.spider.ExtensionSpider"
] | import org.zaproxy.zap.extension.spider.ExtensionSpider; | import org.zaproxy.zap.extension.spider.*; | [
"org.zaproxy.zap"
] | org.zaproxy.zap; | 1,072,845 |
public String getEncoding() {
return this._constructionElement.getAttributeNS(null, Constants._ATT_ENCODING);
} | String function() { return this._constructionElement.getAttributeNS(null, Constants._ATT_ENCODING); } | /**
* Returns the <code>Encoding</code> attribute
*
* @return the <code>Encoding</code> attribute
*/ | Returns the <code>Encoding</code> attribute | getEncoding | {
"repo_name": "andreagenso/java2scala",
"path": "test/J2s/java/openjdk-6-src-b27/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/signature/ObjectContainer.java",
"license": "apache-2.0",
"size": 4483
} | [
"com.sun.org.apache.xml.internal.security.utils.Constants"
] | import com.sun.org.apache.xml.internal.security.utils.Constants; | import com.sun.org.apache.xml.internal.security.utils.*; | [
"com.sun.org"
] | com.sun.org; | 1,730,872 |
private VersionNumber generateUniqueVersion(Set<VersionNumber> seenVersions, VersionNumber version) {
while (seenVersions.contains(version)) {
version = version.nextDraft();
}
return version;
} | VersionNumber function(Set<VersionNumber> seenVersions, VersionNumber version) { while (seenVersions.contains(version)) { version = version.nextDraft(); } return version; } | /**
* Increases the minor version until a unique version has been found.
* @param seenVersions
* @param version
* @return
*/ | Increases the minor version until a unique version has been found | generateUniqueVersion | {
"repo_name": "gentics/mesh",
"path": "mdm/orientdb-wrapper/src/main/java/com/gentics/mesh/changelog/highlevel/change/FixNodeVersionOrder.java",
"license": "apache-2.0",
"size": 9026
} | [
"com.gentics.mesh.util.VersionNumber",
"java.util.Set"
] | import com.gentics.mesh.util.VersionNumber; import java.util.Set; | import com.gentics.mesh.util.*; import java.util.*; | [
"com.gentics.mesh",
"java.util"
] | com.gentics.mesh; java.util; | 1,976,756 |
public static <RowType> RowBasedColumnSelectorFactory<RowType> create(
final RowAdapter<RowType> adapter,
final Supplier<RowType> supplier,
final RowSignature signature,
final boolean throwParseExceptions
)
{
return new RowBasedColumnSelectorFactory<>(supplier, adapter, signature, throwParseExceptions);
} | static <RowType> RowBasedColumnSelectorFactory<RowType> function( final RowAdapter<RowType> adapter, final Supplier<RowType> supplier, final RowSignature signature, final boolean throwParseExceptions ) { return new RowBasedColumnSelectorFactory<>(supplier, adapter, signature, throwParseExceptions); } | /**
* Create an instance based on any object, along with a {@link RowAdapter} for that object.
*
* @param adapter adapter for these row objects
* @param supplier supplier of row objects
* @param signature will be used for reporting available columns and their capabilities. Note that the this
* factory will still allow creation of selectors on any named field in the rows, even if
* it doesn't appear in "rowSignature". (It only needs to be accessible via
* {@link RowAdapter#columnFunction}.) As a result, you can achieve an untyped mode by
* passing in {@link RowSignature#empty()}.
* @param throwParseExceptions whether numeric selectors should throw parse exceptions or use a default/null value
* when their inputs are not actually numeric
*/ | Create an instance based on any object, along with a <code>RowAdapter</code> for that object | create | {
"repo_name": "gianm/druid",
"path": "processing/src/main/java/org/apache/druid/segment/RowBasedColumnSelectorFactory.java",
"license": "apache-2.0",
"size": 15374
} | [
"java.util.function.Supplier",
"org.apache.druid.segment.column.RowSignature"
] | import java.util.function.Supplier; import org.apache.druid.segment.column.RowSignature; | import java.util.function.*; import org.apache.druid.segment.column.*; | [
"java.util",
"org.apache.druid"
] | java.util; org.apache.druid; | 1,721,352 |
@Nonnull Context setPathMap(@Nonnull Map<String, String> pathMap); | @Nonnull Context setPathMap(@Nonnull Map<String, String> pathMap); | /**
* Set path map. This method is part of public API but shouldn't be use it by application code.
*
* @param pathMap Path map.
* @return This context.
*/ | Set path map. This method is part of public API but shouldn't be use it by application code | setPathMap | {
"repo_name": "jooby-project/jooby",
"path": "jooby/src/main/java/io/jooby/Context.java",
"license": "apache-2.0",
"size": 41138
} | [
"java.util.Map",
"javax.annotation.Nonnull"
] | import java.util.Map; import javax.annotation.Nonnull; | import java.util.*; import javax.annotation.*; | [
"java.util",
"javax.annotation"
] | java.util; javax.annotation; | 2,850,217 |
@Test
public void testStubsOverwriteAndRelayExpectationsMA() {
Schemer.begin();
Schemer.willReturn(1).when(joe).ping(Schemer.aNonNullOf(Dalton.class),
Schemer.anyOf(String.class),
Schemer.anyOf(String.class));
Schemer.willReturn(2).when(jack).ping();
Schemer.willReturn(0).when(joe).ping(Schemer.with(jack), Schemer.with("dollars"),
Schemer.anyOf(String.class));
assertEquals(0, joe.ping(jack, "dollars", "100"));
assertEquals(1, joe.ping(jack, "euros", "10"));
assertEquals(1, joe.ping(averell, "dollars", "0"));
assertEquals(2, jack.ping());
Schemer.end();
} | void function() { Schemer.begin(); Schemer.willReturn(1).when(joe).ping(Schemer.aNonNullOf(Dalton.class), Schemer.anyOf(String.class), Schemer.anyOf(String.class)); Schemer.willReturn(2).when(jack).ping(); Schemer.willReturn(0).when(joe).ping(Schemer.with(jack), Schemer.with(STR), Schemer.anyOf(String.class)); assertEquals(0, joe.ping(jack, STR, "100")); assertEquals(1, joe.ping(jack, "euros", "10")); assertEquals(1, joe.ping(averell, STR, "0")); assertEquals(2, jack.ping()); Schemer.end(); } | /**
* Verifies that stubs prevail on expectations and relays to expectations if
* no stub was found.
*/ | Verifies that stubs prevail on expectations and relays to expectations if no stub was found | testStubsOverwriteAndRelayExpectationsMA | {
"repo_name": "vmware/lmock",
"path": "tests/com/vmware/lmock/test/StubTest.java",
"license": "apache-2.0",
"size": 8451
} | [
"com.vmware.lmock.masquerade.Schemer",
"org.junit.Assert"
] | import com.vmware.lmock.masquerade.Schemer; import org.junit.Assert; | import com.vmware.lmock.masquerade.*; import org.junit.*; | [
"com.vmware.lmock",
"org.junit"
] | com.vmware.lmock; org.junit; | 265,252 |
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
txtModelo = new javax.swing.JTextField();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
cmbCombustivel = new javax.swing.JComboBox<EnumCombustivel>();
jLabel6 = new javax.swing.JLabel();
cmbTipo = new javax.swing.JComboBox<EnumTipoVeiculo>();
jLabel7 = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
txtObservacoes = new javax.swing.JTextArea();
txtAnoFab = new javax.swing.JFormattedTextField();
txtPlaca = new javax.swing.JFormattedTextField();
txtChassi = new javax.swing.JFormattedTextField();
cmbMarca = new javax.swing.JComboBox<EnumMarcaVeiculo>();
btnSalvar = new javax.swing.JButton();
btnVoltar = new javax.swing.JButton();
btnDeletar = new javax.swing.JButton();
setClosable(true);
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(209, 209, 209)), "Informações Básicas", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 12), new java.awt.Color(1, 1, 1))); // NOI18N
jLabel1.setFont(new java.awt.Font("Trebuchet MS", 1, 14)); // NOI18N
jLabel1.setText("Modelo:");
jLabel2.setFont(new java.awt.Font("Trebuchet MS", 1, 14)); // NOI18N
jLabel2.setText("Ano Fab.:");
jLabel3.setFont(new java.awt.Font("Trebuchet MS", 1, 14)); // NOI18N
jLabel3.setText("Placa:");
jLabel4.setFont(new java.awt.Font("Trebuchet MS", 1, 14)); // NOI18N
jLabel4.setText("Marca:");
jLabel5.setFont(new java.awt.Font("Trebuchet MS", 1, 14)); // NOI18N
jLabel5.setText("Combustível:");
jLabel6.setFont(new java.awt.Font("Trebuchet MS", 1, 14)); // NOI18N
jLabel6.setText("Tipo:");
jLabel7.setFont(new java.awt.Font("Trebuchet MS", 1, 14)); // NOI18N
jLabel7.setText("Chassi:");
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(195, 195, 195)), "Observações:"));
txtObservacoes.setColumns(20);
txtObservacoes.setRows(5);
jScrollPane1.setViewportView(txtObservacoes);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1)
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
);
try {
txtAnoFab.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("####")));
} catch (java.text.ParseException ex) {
ex.printStackTrace();
}
try {
txtPlaca.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("UUU-####")));
} catch (java.text.ParseException ex) {
ex.printStackTrace();
}
try {
txtChassi.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("#UU###UU##U######")));
} catch (java.text.ParseException ex) {
ex.printStackTrace();
}
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel3)
.addGap(25, 25, 25)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel6)
.addGap(29, 29, 29)))
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(txtModelo, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cmbCombustivel, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(cmbTipo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(txtPlaca, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel2)
.addGap(0, 0, Short.MAX_VALUE)))
.addGap(5, 5, 5)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(txtChassi, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(txtAnoFab, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(13, 13, 13)
.addComponent(jLabel4)
.addGap(8, 8, 8)
.addComponent(cmbMarca, 0, 116, Short.MAX_VALUE)))))))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(txtModelo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel5)
.addComponent(cmbCombustivel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(jLabel2)
.addComponent(jLabel4)
.addComponent(txtAnoFab, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtPlaca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(cmbMarca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(cmbTipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel7)
.addComponent(txtChassi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
); | jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); txtModelo = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); cmbCombustivel = new javax.swing.JComboBox<EnumCombustivel>(); jLabel6 = new javax.swing.JLabel(); cmbTipo = new javax.swing.JComboBox<EnumTipoVeiculo>(); jLabel7 = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); txtObservacoes = new javax.swing.JTextArea(); txtAnoFab = new javax.swing.JFormattedTextField(); txtPlaca = new javax.swing.JFormattedTextField(); txtChassi = new javax.swing.JFormattedTextField(); cmbMarca = new javax.swing.JComboBox<EnumMarcaVeiculo>(); btnSalvar = new javax.swing.JButton(); btnVoltar = new javax.swing.JButton(); btnDeletar = new javax.swing.JButton(); setClosable(true); jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(209, 209, 209)), STR, javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font(STR, 0, 12), new java.awt.Color(1, 1, 1))); jLabel1.setFont(new java.awt.Font(STR, 1, 14)); jLabel1.setText(STR); jLabel2.setFont(new java.awt.Font(STR, 1, 14)); jLabel2.setText(STR); jLabel3.setFont(new java.awt.Font(STR, 1, 14)); jLabel3.setText(STR); jLabel4.setFont(new java.awt.Font(STR, 1, 14)); jLabel4.setText(STR); jLabel5.setFont(new java.awt.Font(STR, 1, 14)); jLabel5.setText(STR); jLabel6.setFont(new java.awt.Font(STR, 1, 14)); jLabel6.setText("Tipo:"); jLabel7.setFont(new java.awt.Font(STR, 1, 14)); jLabel7.setText(STR); jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(195, 195, 195)), STR)); txtObservacoes.setColumns(20); txtObservacoes.setRows(5); jScrollPane1.setViewportView(txtObservacoes); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE) ); try { txtAnoFab.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("####"))); } catch (java.text.ParseException ex) { ex.printStackTrace(); } try { txtPlaca.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter(STR))); } catch (java.text.ParseException ex) { ex.printStackTrace(); } try { txtChassi.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter(STR))); } catch (java.text.ParseException ex) { ex.printStackTrace(); } javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel3) .addGap(25, 25, 25))) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel6) .addGap(29, 29, 29))) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(txtModelo, javax.swing.GroupLayout.PREFERRED_SIZE, 226, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(cmbCombustivel, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(cmbTipo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(txtPlaca, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jLabel2) .addGap(0, 0, Short.MAX_VALUE))) .addGap(5, 5, 5) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel7) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtChassi, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(txtAnoFab, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(13, 13, 13) .addComponent(jLabel4) .addGap(8, 8, 8) .addComponent(cmbMarca, 0, 116, Short.MAX_VALUE))))))) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(txtModelo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel5) .addComponent(cmbCombustivel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel3) .addComponent(jLabel2) .addComponent(jLabel4) .addComponent(txtAnoFab, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(txtPlaca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(cmbMarca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel6) .addComponent(cmbTipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel7) .addComponent(txtChassi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); | /**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/ | This method is called from within the constructor to initialize the form. regenerated by the Form Editor | initComponents | {
"repo_name": "marcoalvesalmeida/marketmanagement",
"path": "CódigoFonte/Apresentação/src/telas/TelaEditarVeiculo.java",
"license": "gpl-3.0",
"size": 17560
} | [
"br.edu.ifnmg.marketmanagement.aplicacao.EnumCombustivel",
"br.edu.ifnmg.marketmanagement.aplicacao.EnumMarcaVeiculo",
"br.edu.ifnmg.marketmanagement.aplicacao.EnumTipoVeiculo"
] | import br.edu.ifnmg.marketmanagement.aplicacao.EnumCombustivel; import br.edu.ifnmg.marketmanagement.aplicacao.EnumMarcaVeiculo; import br.edu.ifnmg.marketmanagement.aplicacao.EnumTipoVeiculo; | import br.edu.ifnmg.marketmanagement.aplicacao.*; | [
"br.edu.ifnmg"
] | br.edu.ifnmg; | 1,392,650 |
private Locale determineUsersSystemLocale() {
Locale userloc = null;
final Locale systloc = Constant.getSystemsLocale();
// first, try full match
for (String ls : LocaleUtils.getAvailableLocales()) {
String[] langArray = ls.split("_");
if (langArray.length == 1) {
if (systloc.getLanguage().equals(langArray[0])) {
userloc = systloc;
break;
}
}
if (langArray.length == 2) {
if (systloc.getLanguage().equals(langArray[0])
&& systloc.getCountry().equals(langArray[1])) {
userloc = systloc;
break;
}
}
if (langArray.length == 3) {
if (systloc.getLanguage().equals(langArray[0])
&& systloc.getCountry().equals(langArray[1])
&& systloc.getVariant().equals(langArray[2])) {
userloc = systloc;
break;
}
}
}
if (userloc == null) {
// second, try partial language match
for (String ls : LocaleUtils.getAvailableLocales()) {
String[] langArray = ls.split("_");
if (systloc.getLanguage().equals(langArray[0])) {
userloc = createLocale(langArray);
break;
}
}
}
return userloc;
}
| Locale function() { Locale userloc = null; final Locale systloc = Constant.getSystemsLocale(); for (String ls : LocaleUtils.getAvailableLocales()) { String[] langArray = ls.split("_"); if (langArray.length == 1) { if (systloc.getLanguage().equals(langArray[0])) { userloc = systloc; break; } } if (langArray.length == 2) { if (systloc.getLanguage().equals(langArray[0]) && systloc.getCountry().equals(langArray[1])) { userloc = systloc; break; } } if (langArray.length == 3) { if (systloc.getLanguage().equals(langArray[0]) && systloc.getCountry().equals(langArray[1]) && systloc.getVariant().equals(langArray[2])) { userloc = systloc; break; } } } if (userloc == null) { for (String ls : LocaleUtils.getAvailableLocales()) { String[] langArray = ls.split("_"); if (systloc.getLanguage().equals(langArray[0])) { userloc = createLocale(langArray); break; } } } return userloc; } | /**
* Determines the {@link Locale} of the current user's system. It will match
* the {@link Constant#getSystemsLocale()} with the available locales from
* ZAPs translation files. It may return null, if the users system locale is
* not in the list of available translations of ZAP.
*
* @return
*/ | Determines the <code>Locale</code> of the current user's system. It will match the <code>Constant#getSystemsLocale()</code> with the available locales from ZAPs translation files. It may return null, if the users system locale is not in the list of available translations of ZAP | determineUsersSystemLocale | {
"repo_name": "profjrr/zaproxy",
"path": "src/org/zaproxy/zap/ZAP.java",
"license": "apache-2.0",
"size": 32544
} | [
"java.util.Locale",
"org.parosproxy.paros.Constant",
"org.zaproxy.zap.utils.LocaleUtils"
] | import java.util.Locale; import org.parosproxy.paros.Constant; import org.zaproxy.zap.utils.LocaleUtils; | import java.util.*; import org.parosproxy.paros.*; import org.zaproxy.zap.utils.*; | [
"java.util",
"org.parosproxy.paros",
"org.zaproxy.zap"
] | java.util; org.parosproxy.paros; org.zaproxy.zap; | 909,792 |
public OCFile getCurrentFile() {
return mFile;
} | OCFile function() { return mFile; } | /**
* Use this to query the {@link OCFile} that is currently
* being displayed by this fragment
*
* @return The currently viewed OCFile
*/ | Use this to query the <code>OCFile</code> that is currently being displayed by this fragment | getCurrentFile | {
"repo_name": "Flole998/android",
"path": "src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java",
"license": "gpl-2.0",
"size": 56544
} | [
"com.owncloud.android.datamodel.OCFile"
] | import com.owncloud.android.datamodel.OCFile; | import com.owncloud.android.datamodel.*; | [
"com.owncloud.android"
] | com.owncloud.android; | 576,162 |
public SingleOutputStreamOperator<T> maxBy(int positionToMaxBy, boolean first) {
return aggregate(new ComparableAggregator<>(positionToMaxBy, input.getType(), AggregationFunction.AggregationType.MAXBY, first, input.getExecutionConfig()));
} | SingleOutputStreamOperator<T> function(int positionToMaxBy, boolean first) { return aggregate(new ComparableAggregator<>(positionToMaxBy, input.getType(), AggregationFunction.AggregationType.MAXBY, first, input.getExecutionConfig())); } | /**
* Applies an aggregation that gives the maximum element of every window of
* the data stream by the given position. If more elements have the same
* maximum value the operator returns either the first or last one depending
* on the parameter setting.
*
* @param positionToMaxBy The position to maximize by
* @param first If true, then the operator return the first element with the maximum value, otherwise returns the last
* @return The transformed DataStream.
*/ | Applies an aggregation that gives the maximum element of every window of the data stream by the given position. If more elements have the same maximum value the operator returns either the first or last one depending on the parameter setting | maxBy | {
"repo_name": "hequn8128/flink",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/AllWindowedStream.java",
"license": "apache-2.0",
"size": 68420
} | [
"org.apache.flink.streaming.api.functions.aggregation.AggregationFunction",
"org.apache.flink.streaming.api.functions.aggregation.ComparableAggregator"
] | import org.apache.flink.streaming.api.functions.aggregation.AggregationFunction; import org.apache.flink.streaming.api.functions.aggregation.ComparableAggregator; | import org.apache.flink.streaming.api.functions.aggregation.*; | [
"org.apache.flink"
] | org.apache.flink; | 1,469,563 |
private void writeDateFormatSheet(WritableSheet s) throws WriteException
{
WritableCellFormat wrappedText = new WritableCellFormat
(WritableWorkbook.ARIAL_10_PT);
wrappedText.setWrap(true);
s.setColumnView(0, 20);
s.setColumnView(2, 20);
s.setColumnView(3, 20);
s.setColumnView(4, 20);
s.getSettings().setFitWidth(2);
s.getSettings().setFitHeight(2);
Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
c.set(1975, 4, 31, 15, 21, 45);
c.set(Calendar.MILLISECOND, 660);
Date date = c.getTime();
c.set(1900, 0, 1, 0, 0, 0);
c.set(Calendar.MILLISECOND, 0);
Date date2 = c.getTime();
c.set(1970, 0, 1, 0, 0, 0);
Date date3 = c.getTime();
c.set(1918, 10, 11, 11, 0, 0);
Date date4 = c.getTime();
c.set(1900, 0, 2, 0, 0, 0);
Date date5 = c.getTime();
c.set(1901, 0, 1, 0, 0, 0);
Date date6 = c.getTime();
c.set(1900, 4, 31, 0, 0, 0);
Date date7 = c.getTime();
c.set(1900, 1, 1, 0, 0, 0);
Date date8 = c.getTime();
c.set(1900, 0, 31, 0, 0, 0);
Date date9 = c.getTime();
c.set(1900, 2, 1, 0, 0, 0);
Date date10 = c.getTime();
c.set(1900, 1, 27, 0, 0, 0);
Date date11 = c.getTime();
c.set(1900, 1, 28, 0, 0, 0);
Date date12 = c.getTime();
c.set(1980, 5, 31, 12, 0, 0);
Date date13 = c.getTime();
c.set(1066, 9, 14, 0, 0, 0);
Date date14 = c.getTime();
// Built in date formats
SimpleDateFormat sdf = new SimpleDateFormat("dd MMM yyyy HH:mm:ss.SSS");
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
Label l = new Label(0,0,"All dates are " + sdf.format(date),
wrappedText);
s.addCell(l);
l = new Label(0,1,"Built in formats",
wrappedText);
s.addCell(l);
l = new Label(2, 1, "Custom formats");
s.addCell(l);
WritableCellFormat cf1 = new WritableCellFormat(DateFormats.FORMAT1);
DateTime dt = new DateTime(0,2,date, cf1, DateTime.GMT);
s.addCell(dt);
cf1 = new WritableCellFormat(DateFormats.FORMAT2);
dt = new DateTime(0,3,date, cf1,DateTime.GMT);
s.addCell(dt);
cf1 = new WritableCellFormat(DateFormats.FORMAT3);
dt = new DateTime(0,4,date, cf1);
s.addCell(dt);
cf1 = new WritableCellFormat(DateFormats.FORMAT4);
dt = new DateTime(0,5,date, cf1);
s.addCell(dt);
cf1 = new WritableCellFormat(DateFormats.FORMAT5);
dt = new DateTime(0,6,date, cf1);
s.addCell(dt);
cf1 = new WritableCellFormat(DateFormats.FORMAT6);
dt = new DateTime(0,7,date, cf1);
s.addCell(dt);
cf1 = new WritableCellFormat(DateFormats.FORMAT7);
dt = new DateTime(0,8,date, cf1, DateTime.GMT);
s.addCell(dt);
cf1 = new WritableCellFormat(DateFormats.FORMAT8);
dt = new DateTime(0,9,date, cf1, DateTime.GMT);
s.addCell(dt);
cf1 = new WritableCellFormat(DateFormats.FORMAT9);
dt = new DateTime(0,10,date, cf1, DateTime.GMT);
s.addCell(dt);
cf1 = new WritableCellFormat(DateFormats.FORMAT10);
dt = new DateTime(0,11,date, cf1, DateTime.GMT);
s.addCell(dt);
cf1 = new WritableCellFormat(DateFormats.FORMAT11);
dt = new DateTime(0,12,date, cf1, DateTime.GMT);
s.addCell(dt);
cf1 = new WritableCellFormat(DateFormats.FORMAT12);
dt = new DateTime(0,13,date, cf1, DateTime.GMT);
s.addCell(dt);
// Custom formats
DateFormat df = new DateFormat("dd MM yyyy");
cf1 = new WritableCellFormat(df);
l = new Label(2, 2, "dd MM yyyy");
s.addCell(l);
dt = new DateTime(3, 2, date, cf1, DateTime.GMT);
s.addCell(dt);
df = new DateFormat("dd MMM yyyy");
cf1 = new WritableCellFormat(df);
l = new Label(2, 3, "dd MMM yyyy");
s.addCell(l);
dt = new DateTime(3, 3, date, cf1, DateTime.GMT);
s.addCell(dt);
df = new DateFormat("hh:mm");
cf1 = new WritableCellFormat(df);
l = new Label(2, 4, "hh:mm");
s.addCell(l);
dt = new DateTime(3, 4, date, cf1, DateTime.GMT);
s.addCell(dt);
df = new DateFormat("hh:mm:ss");
cf1 = new WritableCellFormat(df);
l = new Label(2, 5, "hh:mm:ss");
s.addCell(l);
dt = new DateTime(3, 5, date, cf1, DateTime.GMT);
s.addCell(dt);
df = new DateFormat("H:mm:ss a");
cf1 = new WritableCellFormat(df);
l = new Label(2, 5, "H:mm:ss a");
s.addCell(l);
dt = new DateTime(3, 5, date, cf1, DateTime.GMT);
s.addCell(dt);
dt = new DateTime(4, 5, date13, cf1, DateTime.GMT);
s.addCell(dt);
df = new DateFormat("mm:ss.SSS");
cf1 = new WritableCellFormat(df);
l = new Label(2, 6, "mm:ss.SSS");
s.addCell(l);
dt = new DateTime(3, 6, date, cf1, DateTime.GMT);
s.addCell(dt);
df = new DateFormat("hh:mm:ss a");
cf1 = new WritableCellFormat(df);
l = new Label(2, 7, "hh:mm:ss a");
s.addCell(l);
dt = new DateTime(4, 7, date13, cf1, DateTime.GMT);
s.addCell(dt);
// Check out the zero date ie. 1 Jan 1900
l = new Label(0,16,"Zero date " + sdf.format(date2),
wrappedText);
s.addCell(l);
cf1 = new WritableCellFormat(DateFormats.FORMAT9);
dt = new DateTime(0,17,date2, cf1, DateTime.GMT);
s.addCell(dt);
// Check out the zero date + 1 ie. 2 Jan 1900
l = new Label(3,16,"Zero date + 1 " + sdf.format(date5),
wrappedText);
s.addCell(l);
cf1 = new WritableCellFormat(DateFormats.FORMAT9);
dt = new DateTime(3,17,date5, cf1, DateTime.GMT);
s.addCell(dt);
// Check out the 1 Jan 1901
l = new Label(3,19, sdf.format(date6),
wrappedText);
s.addCell(l);
cf1 = new WritableCellFormat(DateFormats.FORMAT9);
dt = new DateTime(3,20,date6, cf1, DateTime.GMT);
s.addCell(dt);
// Check out the 31 May 1900
l = new Label(3,22, sdf.format(date7),
wrappedText);
s.addCell(l);
cf1 = new WritableCellFormat(DateFormats.FORMAT9);
dt = new DateTime(3,23, date7, cf1, DateTime.GMT);
s.addCell(dt);
// Check out 1 Feb 1900
l = new Label(3,25, sdf.format(date8),
wrappedText);
s.addCell(l);
cf1 = new WritableCellFormat(DateFormats.FORMAT9);
dt = new DateTime(3,26, date8, cf1, DateTime.GMT);
s.addCell(dt);
// Check out 31 Jan 1900
l = new Label(3,28, sdf.format(date9),
wrappedText);
s.addCell(l);
cf1 = new WritableCellFormat(DateFormats.FORMAT9);
dt = new DateTime(3,29, date9, cf1, DateTime.GMT);
s.addCell(dt);
// Check out 31 Jan 1900
l = new Label(3,28, sdf.format(date9),
wrappedText);
s.addCell(l);
cf1 = new WritableCellFormat(DateFormats.FORMAT9);
dt = new DateTime(3,29, date9, cf1, DateTime.GMT);
s.addCell(dt);
// Check out 1 Mar 1900
l = new Label(3,31, sdf.format(date10),
wrappedText);
s.addCell(l);
cf1 = new WritableCellFormat(DateFormats.FORMAT9);
dt = new DateTime(3,32, date10, cf1, DateTime.GMT);
s.addCell(dt);
// Check out 27 Feb 1900
l = new Label(3,34, sdf.format(date11),
wrappedText);
s.addCell(l);
cf1 = new WritableCellFormat(DateFormats.FORMAT9);
dt = new DateTime(3,35, date11, cf1, DateTime.GMT);
s.addCell(dt);
// Check out 28 Feb 1900
l = new Label(3,37, sdf.format(date12),
wrappedText);
s.addCell(l);
cf1 = new WritableCellFormat(DateFormats.FORMAT9);
dt = new DateTime(3,38, date12, cf1, DateTime.GMT);
s.addCell(dt);
// Check out the zero date ie. 1 Jan 1970
l = new Label(0,19,"Zero UTC date " + sdf.format(date3),
wrappedText);
s.addCell(l);
cf1 = new WritableCellFormat(DateFormats.FORMAT9);
dt = new DateTime(0,20,date3, cf1, DateTime.GMT);
s.addCell(dt);
// Check out the WWI armistice day ie. 11 am, Nov 11, 1918
l = new Label(0,22,"Armistice date " + sdf.format(date4),
wrappedText);
s.addCell(l);
cf1 = new WritableCellFormat(DateFormats.FORMAT9);
dt = new DateTime(0,23,date4, cf1, DateTime.GMT);
s.addCell(dt);
// Check out the Battle of Hastings date Oct 14th, 1066
l = new Label(0,25, "Battle of Hastings " + sdf.format(date14),
wrappedText);
s.addCell(l);
cf1 = new WritableCellFormat(DateFormats.FORMAT2);
dt = new DateTime(0, 26, date14, cf1, DateTime.GMT);
s.addCell(dt);
} | void function(WritableSheet s) throws WriteException { WritableCellFormat wrappedText = new WritableCellFormat (WritableWorkbook.ARIAL_10_PT); wrappedText.setWrap(true); s.setColumnView(0, 20); s.setColumnView(2, 20); s.setColumnView(3, 20); s.setColumnView(4, 20); s.getSettings().setFitWidth(2); s.getSettings().setFitHeight(2); Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT")); c.set(1975, 4, 31, 15, 21, 45); c.set(Calendar.MILLISECOND, 660); Date date = c.getTime(); c.set(1900, 0, 1, 0, 0, 0); c.set(Calendar.MILLISECOND, 0); Date date2 = c.getTime(); c.set(1970, 0, 1, 0, 0, 0); Date date3 = c.getTime(); c.set(1918, 10, 11, 11, 0, 0); Date date4 = c.getTime(); c.set(1900, 0, 2, 0, 0, 0); Date date5 = c.getTime(); c.set(1901, 0, 1, 0, 0, 0); Date date6 = c.getTime(); c.set(1900, 4, 31, 0, 0, 0); Date date7 = c.getTime(); c.set(1900, 1, 1, 0, 0, 0); Date date8 = c.getTime(); c.set(1900, 0, 31, 0, 0, 0); Date date9 = c.getTime(); c.set(1900, 2, 1, 0, 0, 0); Date date10 = c.getTime(); c.set(1900, 1, 27, 0, 0, 0); Date date11 = c.getTime(); c.set(1900, 1, 28, 0, 0, 0); Date date12 = c.getTime(); c.set(1980, 5, 31, 12, 0, 0); Date date13 = c.getTime(); c.set(1066, 9, 14, 0, 0, 0); Date date14 = c.getTime(); SimpleDateFormat sdf = new SimpleDateFormat(STR); sdf.setTimeZone(TimeZone.getTimeZone("GMT")); Label l = new Label(0,0,STR + sdf.format(date), wrappedText); s.addCell(l); l = new Label(0,1,STR, wrappedText); s.addCell(l); l = new Label(2, 1, STR); s.addCell(l); WritableCellFormat cf1 = new WritableCellFormat(DateFormats.FORMAT1); DateTime dt = new DateTime(0,2,date, cf1, DateTime.GMT); s.addCell(dt); cf1 = new WritableCellFormat(DateFormats.FORMAT2); dt = new DateTime(0,3,date, cf1,DateTime.GMT); s.addCell(dt); cf1 = new WritableCellFormat(DateFormats.FORMAT3); dt = new DateTime(0,4,date, cf1); s.addCell(dt); cf1 = new WritableCellFormat(DateFormats.FORMAT4); dt = new DateTime(0,5,date, cf1); s.addCell(dt); cf1 = new WritableCellFormat(DateFormats.FORMAT5); dt = new DateTime(0,6,date, cf1); s.addCell(dt); cf1 = new WritableCellFormat(DateFormats.FORMAT6); dt = new DateTime(0,7,date, cf1); s.addCell(dt); cf1 = new WritableCellFormat(DateFormats.FORMAT7); dt = new DateTime(0,8,date, cf1, DateTime.GMT); s.addCell(dt); cf1 = new WritableCellFormat(DateFormats.FORMAT8); dt = new DateTime(0,9,date, cf1, DateTime.GMT); s.addCell(dt); cf1 = new WritableCellFormat(DateFormats.FORMAT9); dt = new DateTime(0,10,date, cf1, DateTime.GMT); s.addCell(dt); cf1 = new WritableCellFormat(DateFormats.FORMAT10); dt = new DateTime(0,11,date, cf1, DateTime.GMT); s.addCell(dt); cf1 = new WritableCellFormat(DateFormats.FORMAT11); dt = new DateTime(0,12,date, cf1, DateTime.GMT); s.addCell(dt); cf1 = new WritableCellFormat(DateFormats.FORMAT12); dt = new DateTime(0,13,date, cf1, DateTime.GMT); s.addCell(dt); DateFormat df = new DateFormat(STR); cf1 = new WritableCellFormat(df); l = new Label(2, 2, STR); s.addCell(l); dt = new DateTime(3, 2, date, cf1, DateTime.GMT); s.addCell(dt); df = new DateFormat(STR); cf1 = new WritableCellFormat(df); l = new Label(2, 3, STR); s.addCell(l); dt = new DateTime(3, 3, date, cf1, DateTime.GMT); s.addCell(dt); df = new DateFormat("hh:mm"); cf1 = new WritableCellFormat(df); l = new Label(2, 4, "hh:mm"); s.addCell(l); dt = new DateTime(3, 4, date, cf1, DateTime.GMT); s.addCell(dt); df = new DateFormat(STR); cf1 = new WritableCellFormat(df); l = new Label(2, 5, STR); s.addCell(l); dt = new DateTime(3, 5, date, cf1, DateTime.GMT); s.addCell(dt); df = new DateFormat(STR); cf1 = new WritableCellFormat(df); l = new Label(2, 5, STR); s.addCell(l); dt = new DateTime(3, 5, date, cf1, DateTime.GMT); s.addCell(dt); dt = new DateTime(4, 5, date13, cf1, DateTime.GMT); s.addCell(dt); df = new DateFormat(STR); cf1 = new WritableCellFormat(df); l = new Label(2, 6, STR); s.addCell(l); dt = new DateTime(3, 6, date, cf1, DateTime.GMT); s.addCell(dt); df = new DateFormat(STR); cf1 = new WritableCellFormat(df); l = new Label(2, 7, STR); s.addCell(l); dt = new DateTime(4, 7, date13, cf1, DateTime.GMT); s.addCell(dt); l = new Label(0,16,STR + sdf.format(date2), wrappedText); s.addCell(l); cf1 = new WritableCellFormat(DateFormats.FORMAT9); dt = new DateTime(0,17,date2, cf1, DateTime.GMT); s.addCell(dt); l = new Label(3,16,STR + sdf.format(date5), wrappedText); s.addCell(l); cf1 = new WritableCellFormat(DateFormats.FORMAT9); dt = new DateTime(3,17,date5, cf1, DateTime.GMT); s.addCell(dt); l = new Label(3,19, sdf.format(date6), wrappedText); s.addCell(l); cf1 = new WritableCellFormat(DateFormats.FORMAT9); dt = new DateTime(3,20,date6, cf1, DateTime.GMT); s.addCell(dt); l = new Label(3,22, sdf.format(date7), wrappedText); s.addCell(l); cf1 = new WritableCellFormat(DateFormats.FORMAT9); dt = new DateTime(3,23, date7, cf1, DateTime.GMT); s.addCell(dt); l = new Label(3,25, sdf.format(date8), wrappedText); s.addCell(l); cf1 = new WritableCellFormat(DateFormats.FORMAT9); dt = new DateTime(3,26, date8, cf1, DateTime.GMT); s.addCell(dt); l = new Label(3,28, sdf.format(date9), wrappedText); s.addCell(l); cf1 = new WritableCellFormat(DateFormats.FORMAT9); dt = new DateTime(3,29, date9, cf1, DateTime.GMT); s.addCell(dt); l = new Label(3,28, sdf.format(date9), wrappedText); s.addCell(l); cf1 = new WritableCellFormat(DateFormats.FORMAT9); dt = new DateTime(3,29, date9, cf1, DateTime.GMT); s.addCell(dt); l = new Label(3,31, sdf.format(date10), wrappedText); s.addCell(l); cf1 = new WritableCellFormat(DateFormats.FORMAT9); dt = new DateTime(3,32, date10, cf1, DateTime.GMT); s.addCell(dt); l = new Label(3,34, sdf.format(date11), wrappedText); s.addCell(l); cf1 = new WritableCellFormat(DateFormats.FORMAT9); dt = new DateTime(3,35, date11, cf1, DateTime.GMT); s.addCell(dt); l = new Label(3,37, sdf.format(date12), wrappedText); s.addCell(l); cf1 = new WritableCellFormat(DateFormats.FORMAT9); dt = new DateTime(3,38, date12, cf1, DateTime.GMT); s.addCell(dt); l = new Label(0,19,STR + sdf.format(date3), wrappedText); s.addCell(l); cf1 = new WritableCellFormat(DateFormats.FORMAT9); dt = new DateTime(0,20,date3, cf1, DateTime.GMT); s.addCell(dt); l = new Label(0,22,STR + sdf.format(date4), wrappedText); s.addCell(l); cf1 = new WritableCellFormat(DateFormats.FORMAT9); dt = new DateTime(0,23,date4, cf1, DateTime.GMT); s.addCell(dt); l = new Label(0,25, STR + sdf.format(date14), wrappedText); s.addCell(l); cf1 = new WritableCellFormat(DateFormats.FORMAT2); dt = new DateTime(0, 26, date14, cf1, DateTime.GMT); s.addCell(dt); } | /**
* Adds cells to the specified sheet which test the various date formats
*
* @param s
*/ | Adds cells to the specified sheet which test the various date formats | writeDateFormatSheet | {
"repo_name": "loginus/jexcelapi",
"path": "src/jxl/demo/Write.java",
"license": "gpl-2.0",
"size": 55445
} | [
"java.text.SimpleDateFormat",
"java.util.Calendar",
"java.util.Date",
"java.util.TimeZone"
] | import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; | import java.text.*; import java.util.*; | [
"java.text",
"java.util"
] | java.text; java.util; | 1,053,064 |
private static void createTaskListForNode(Map<String, List<List<Distributable>>> outputMap,
int noOfTasksPerNode, String key) {
List<List<Distributable>> nodeTaskList =
new ArrayList<List<Distributable>>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
for (int i = 0; i < noOfTasksPerNode; i++) {
List<Distributable> eachTask =
new ArrayList<Distributable>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE);
nodeTaskList.add(eachTask);
}
outputMap.put(key, nodeTaskList);
} | static void function(Map<String, List<List<Distributable>>> outputMap, int noOfTasksPerNode, String key) { List<List<Distributable>> nodeTaskList = new ArrayList<List<Distributable>>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE); for (int i = 0; i < noOfTasksPerNode; i++) { List<Distributable> eachTask = new ArrayList<Distributable>(CarbonCommonConstants.DEFAULT_COLLECTION_SIZE); nodeTaskList.add(eachTask); } outputMap.put(key, nodeTaskList); } | /**
* This will create the empty list for each task of a node.
*
* @param outputMap
* @param noOfTasksPerNode
* @param key
*/ | This will create the empty list for each task of a node | createTaskListForNode | {
"repo_name": "bill1208/incubator-carbondata",
"path": "integration/spark/src/main/java/org/apache/carbondata/spark/load/CarbonLoaderUtil.java",
"license": "apache-2.0",
"size": 41671
} | [
"java.util.ArrayList",
"java.util.List",
"java.util.Map",
"org.apache.carbondata.core.carbon.datastore.block.Distributable",
"org.apache.carbondata.core.constants.CarbonCommonConstants"
] | import java.util.ArrayList; import java.util.List; import java.util.Map; import org.apache.carbondata.core.carbon.datastore.block.Distributable; import org.apache.carbondata.core.constants.CarbonCommonConstants; | import java.util.*; import org.apache.carbondata.core.carbon.datastore.block.*; import org.apache.carbondata.core.constants.*; | [
"java.util",
"org.apache.carbondata"
] | java.util; org.apache.carbondata; | 871,204 |
void read(final DataInputStream in) throws IOException {
// This code is tested over in TestHFileReaderV1 where we read an old hfile w/ this new code.
int pblen = ProtobufUtil.lengthOfPBMagic();
byte [] pbuf = new byte[pblen];
if (in.markSupported()) in.mark(pblen);
int read = in.read(pbuf);
if (read != pblen) throw new IOException("read=" + read + ", wanted=" + pblen);
if (ProtobufUtil.isPBMagicPrefix(pbuf)) {
parsePB(HFileProtos.FileInfoProto.parseDelimitedFrom(in));
} else {
if (in.markSupported()) {
in.reset();
parseWritable(in);
} else {
// We cannot use BufferedInputStream, it consumes more than we read from the underlying IS
ByteArrayInputStream bais = new ByteArrayInputStream(pbuf);
SequenceInputStream sis = new SequenceInputStream(bais, in); // Concatenate input streams
// TODO: Am I leaking anything here wrapping the passed in stream? We are not calling close on the wrapped
// streams but they should be let go after we leave this context? I see that we keep a reference to the
// passed in inputstream but since we no longer have a reference to this after we leave, we should be ok.
parseWritable(new DataInputStream(sis));
}
}
} | void read(final DataInputStream in) throws IOException { int pblen = ProtobufUtil.lengthOfPBMagic(); byte [] pbuf = new byte[pblen]; if (in.markSupported()) in.mark(pblen); int read = in.read(pbuf); if (read != pblen) throw new IOException("read=" + read + STR + pblen); if (ProtobufUtil.isPBMagicPrefix(pbuf)) { parsePB(HFileProtos.FileInfoProto.parseDelimitedFrom(in)); } else { if (in.markSupported()) { in.reset(); parseWritable(in); } else { ByteArrayInputStream bais = new ByteArrayInputStream(pbuf); SequenceInputStream sis = new SequenceInputStream(bais, in); parseWritable(new DataInputStream(sis)); } } } | /**
* Populate this instance with what we find on the passed in <code>in</code> stream.
* Can deserialize protobuf of old Writables format.
* @param in
* @throws IOException
* @see #write(DataOutputStream)
*/ | Populate this instance with what we find on the passed in <code>in</code> stream. Can deserialize protobuf of old Writables format | read | {
"repo_name": "ibmsoe/hbase",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java",
"license": "apache-2.0",
"size": 32325
} | [
"java.io.ByteArrayInputStream",
"java.io.DataInputStream",
"java.io.IOException",
"java.io.SequenceInputStream",
"org.apache.hadoop.hbase.protobuf.ProtobufUtil",
"org.apache.hadoop.hbase.protobuf.generated.HFileProtos"
] | import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.IOException; import java.io.SequenceInputStream; import org.apache.hadoop.hbase.protobuf.ProtobufUtil; import org.apache.hadoop.hbase.protobuf.generated.HFileProtos; | import java.io.*; import org.apache.hadoop.hbase.protobuf.*; import org.apache.hadoop.hbase.protobuf.generated.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 967,386 |
public void testReusableTokenStream() throws Exception {
Analyzer a = new PersianAnalyzer(TEST_VERSION_CURRENT);
assertAnalyzesToReuse(a, "خورده مي شده بوده باشد", new String[] { "خورده" });
assertAnalyzesToReuse(a, "برگها", new String[] { "برگ" });
}
| void function() throws Exception { Analyzer a = new PersianAnalyzer(TEST_VERSION_CURRENT); assertAnalyzesToReuse(a, STR, new String[] { "خورده" }); assertAnalyzesToReuse(a, STR, new String[] { "برگ" }); } | /**
* Basic test ensuring that tokenStream works correctly.
*/ | Basic test ensuring that tokenStream works correctly | testReusableTokenStream | {
"repo_name": "terrancesnyder/solr-analytics",
"path": "lucene/analysis/common/src/test/org/apache/lucene/analysis/fa/TestPersianAnalyzer.java",
"license": "apache-2.0",
"size": 11740
} | [
"org.apache.lucene.analysis.Analyzer"
] | import org.apache.lucene.analysis.Analyzer; | import org.apache.lucene.analysis.*; | [
"org.apache.lucene"
] | org.apache.lucene; | 496,811 |
public static Predicate<File> isDirectory() {
return FilePredicate.IS_DIRECTORY;
} | static Predicate<File> function() { return FilePredicate.IS_DIRECTORY; } | /**
* Returns a predicate that returns the result of {@link File#isDirectory} on input files.
*
* @since 15.0
*/ | Returns a predicate that returns the result of <code>File#isDirectory</code> on input files | isDirectory | {
"repo_name": "paulmartel/voltdb",
"path": "third_party/java/src/com/google_voltpatches/common/io/Files.java",
"license": "agpl-3.0",
"size": 28996
} | [
"com.google_voltpatches.common.base.Predicate",
"java.io.File"
] | import com.google_voltpatches.common.base.Predicate; import java.io.File; | import com.google_voltpatches.common.base.*; import java.io.*; | [
"com.google_voltpatches.common",
"java.io"
] | com.google_voltpatches.common; java.io; | 2,218,822 |
public static <T> T readLines(File file, Charset charset,
LineProcessor<T> callback) throws IOException {
return asCharSource(file, charset).readLines(callback);
}
| static <T> T function(File file, Charset charset, LineProcessor<T> callback) throws IOException { return asCharSource(file, charset).readLines(callback); } | /**
* Streams lines from a {@link File}, stopping when our callback returns
* false, or we have read all of the lines.
*
* @param file the file to read from
* @param charset the charset used to decode the input stream; see {@link
* Charsets} for helpful predefined constants
* @param callback the {@link LineProcessor} to use to handle the lines
* @return the output of processing the lines
* @throws IOException if an I/O error occurs
*/ | Streams lines from a <code>File</code>, stopping when our callback returns false, or we have read all of the lines | readLines | {
"repo_name": "mariusj/org.openntf.domino",
"path": "domino/externals/guava/src/main/java/com/google/common/io/Files.java",
"license": "apache-2.0",
"size": 29456
} | [
"java.io.File",
"java.io.IOException",
"java.nio.charset.Charset"
] | import java.io.File; import java.io.IOException; import java.nio.charset.Charset; | import java.io.*; import java.nio.charset.*; | [
"java.io",
"java.nio"
] | java.io; java.nio; | 2,666,775 |
public static String constructVlanDeviceName(VdsNetworkInterface underlyingNic, Network network) {
return underlyingNic.getName() + "." + network.getVlanId();
} | static String function(VdsNetworkInterface underlyingNic, Network network) { return underlyingNic.getName() + "." + network.getVlanId(); } | /**
* Constructs the vlan device name in the format of "{nic name}.{vlan-id}"
*
* @param underlyingNic
* the device on top the vlan device is created
* @param network
* the network which holds the vlan-id
* @return a name representing the vlan device
*/ | Constructs the vlan device name in the format of "{nic name}.{vlan-id}" | constructVlanDeviceName | {
"repo_name": "OpenUniversity/ovirt-engine",
"path": "backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/NetworkUtils.java",
"license": "apache-2.0",
"size": 11330
} | [
"org.ovirt.engine.core.common.businessentities.network.Network",
"org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface"
] | import org.ovirt.engine.core.common.businessentities.network.Network; import org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface; | import org.ovirt.engine.core.common.businessentities.network.*; | [
"org.ovirt.engine"
] | org.ovirt.engine; | 891,323 |
public Variant getVariant() {
Variant result = new Variant();
updateMetadata(getName(), result, true, getMetadataService());
return result;
} | Variant function() { Variant result = new Variant(); updateMetadata(getName(), result, true, getMetadataService()); return result; } | /**
* Returns a variant corresponding to the extensions of this entity.
*
* @return A variant corresponding to the extensions of this entity.
*/ | Returns a variant corresponding to the extensions of this entity | getVariant | {
"repo_name": "theanuradha/debrief",
"path": "org.mwc.asset.comms/docs/restlet_src/org.restlet/org/restlet/engine/local/Entity.java",
"license": "epl-1.0",
"size": 12850
} | [
"org.restlet.representation.Variant"
] | import org.restlet.representation.Variant; | import org.restlet.representation.*; | [
"org.restlet.representation"
] | org.restlet.representation; | 1,476,309 |
public TextBounds setText (CharSequence str, float x, float y) {
clear();
return addText(str, x, y, 0, str.length());
}
| TextBounds function (CharSequence str, float x, float y) { clear(); return addText(str, x, y, 0, str.length()); } | /** Clears any cached glyphs and adds glyphs for the specified text.
* @see #addText(CharSequence, float, float, int, int) */ | Clears any cached glyphs and adds glyphs for the specified text | setText | {
"repo_name": "ryoenji/libgdx",
"path": "gdx/src/com/badlogic/gdx/graphics/g2d/BitmapFontCache.java",
"license": "apache-2.0",
"size": 22749
} | [
"com.badlogic.gdx.graphics.g2d.BitmapFont"
] | import com.badlogic.gdx.graphics.g2d.BitmapFont; | import com.badlogic.gdx.graphics.g2d.*; | [
"com.badlogic.gdx"
] | com.badlogic.gdx; | 901,619 |
public static Document unmarshalHelper(byte[] xmlData, EntityResolver resolver, boolean validate) throws Exception {
return CmsXmlUtils.unmarshalHelper(new InputSource(new ByteArrayInputStream(xmlData)), resolver, validate);
} | static Document function(byte[] xmlData, EntityResolver resolver, boolean validate) throws Exception { return CmsXmlUtils.unmarshalHelper(new InputSource(new ByteArrayInputStream(xmlData)), resolver, validate); } | /**
* Helper to unmarshal (read) xml contents from a byte array into a document.<p>
*
* Using this method ensures that the OpenCms XML entity resolver is used.<p>
*
* @param xmlData the XML data in a byte array
* @param resolver the XML entity resolver to use
* @param validate if the reader should try to validate the xml code
*
* @return the base object initialized with the unmarshalled XML document
*
* @throws Exception if something goes wrong
*
* @see CmsXmlUtils#unmarshalHelper(InputSource, EntityResolver)
*/ | Helper to unmarshal (read) xml contents from a byte array into a document. Using this method ensures that the OpenCms XML entity resolver is used | unmarshalHelper | {
"repo_name": "mediaworx/opencms-core",
"path": "src-components/org/opencms/util/ant/CmsXmlUtils.java",
"license": "lgpl-2.1",
"size": 21421
} | [
"java.io.ByteArrayInputStream",
"org.dom4j.Document",
"org.xml.sax.EntityResolver",
"org.xml.sax.InputSource"
] | import java.io.ByteArrayInputStream; import org.dom4j.Document; import org.xml.sax.EntityResolver; import org.xml.sax.InputSource; | import java.io.*; import org.dom4j.*; import org.xml.sax.*; | [
"java.io",
"org.dom4j",
"org.xml.sax"
] | java.io; org.dom4j; org.xml.sax; | 607,463 |
public Builder putAllExtraParam(Map<String, Object> map) {
if (this.extraParams == null) {
this.extraParams = new HashMap<>();
}
this.extraParams.putAll(map);
return this;
} | Builder function(Map<String, Object> map) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.putAll(map); return this; } | /**
* Add all map key/value pairs to `extraParams` map. A map is initialized for the first
* `put/putAll` call, and subsequent calls add additional key/value pairs to the original
* map. See {@link CardUpdateParams.SpendingControls.SpendingLimit#extraParams} for the
* field documentation.
*/ | Add all map key/value pairs to `extraParams` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. See <code>CardUpdateParams.SpendingControls.SpendingLimit#extraParams</code> for the field documentation | putAllExtraParam | {
"repo_name": "stripe/stripe-java",
"path": "src/main/java/com/stripe/param/issuing/CardUpdateParams.java",
"license": "mit",
"size": 125778
} | [
"java.util.HashMap",
"java.util.Map"
] | import java.util.HashMap; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 147,894 |
@CheckResult @NonNull
public static Observable<String> searchQueryChanges(@NonNull SearchBar view) {
checkNotNull(view, "view == null");
return new SearchBarSearchQueryChangesOnSubscribe(view);
} | @CheckResult static Observable<String> function(@NonNull SearchBar view) { checkNotNull(view, STR); return new SearchBarSearchQueryChangesOnSubscribe(view); } | /**
* Create an observable of String values for search query changes on {@code view}.
* <p>
* <em>Warning:</em> The created observable keeps a strong reference to {@code view}. Unsubscribe
* to free this reference.
* <p>
*/ | Create an observable of String values for search query changes on view. Warning: The created observable keeps a strong reference to view. Unsubscribe to free this reference. | searchQueryChanges | {
"repo_name": "Edward608/RxBinding",
"path": "rxbinding-leanback-v17/src/main/java/com/jakewharton/rxbinding2/support/v17/leanback/widget/RxSearchBar.java",
"license": "apache-2.0",
"size": 2139
} | [
"android.support.annotation.CheckResult",
"android.support.annotation.NonNull",
"android.support.v17.leanback.widget.SearchBar",
"com.jakewharton.rxbinding2.internal.Preconditions",
"io.reactivex.Observable"
] | import android.support.annotation.CheckResult; import android.support.annotation.NonNull; import android.support.v17.leanback.widget.SearchBar; import com.jakewharton.rxbinding2.internal.Preconditions; import io.reactivex.Observable; | import android.support.annotation.*; import android.support.v17.leanback.widget.*; import com.jakewharton.rxbinding2.internal.*; import io.reactivex.*; | [
"android.support",
"com.jakewharton.rxbinding2",
"io.reactivex"
] | android.support; com.jakewharton.rxbinding2; io.reactivex; | 1,446,150 |
@Override
public final int read(byte[] buffer) throws IOException {
return in.read(buffer, 0, buffer.length);
} | final int function(byte[] buffer) throws IOException { return in.read(buffer, 0, buffer.length); } | /**
* Reads bytes from the source stream into the byte array <code>buffer</code>.
* The number of bytes actually read is returned.
*
* @param buffer
* the buffer to read bytes into
* @return the number of bytes actually read or -1 if end of stream.
*
* @throws IOException
* If a problem occurs reading from this DataInputStream.
*
*/ | Reads bytes from the source stream into the byte array <code>buffer</code>. The number of bytes actually read is returned | read | {
"repo_name": "ty1er/incubator-asterixdb",
"path": "asterixdb/asterix-hivecompat/src/main/java/org/apache/asterix/hivecompat/io/NonSyncDataInputBuffer.java",
"license": "apache-2.0",
"size": 14867
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 203,321 |
@ServiceMethod(returns = ReturnType.SINGLE)
SyncPoller<PollResult<Void>, Void> beginInstallUpdates(String deviceName, String resourceGroupName); | @ServiceMethod(returns = ReturnType.SINGLE) SyncPoller<PollResult<Void>, Void> beginInstallUpdates(String deviceName, String resourceGroupName); | /**
* Installs the updates on the Data Box Edge/Data Box Gateway device.
*
* @param deviceName The device name.
* @param resourceGroupName The resource group name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
*/ | Installs the updates on the Data Box Edge/Data Box Gateway device | beginInstallUpdates | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/databoxedge/azure-resourcemanager-databoxedge/src/main/java/com/azure/resourcemanager/databoxedge/fluent/DevicesClient.java",
"license": "mit",
"size": 31816
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.management.polling.PollResult",
"com.azure.core.util.polling.SyncPoller"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.polling.SyncPoller; | import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.polling.*; | [
"com.azure.core"
] | com.azure.core; | 1,022,536 |
public static void assertPredicateMatches(Predicate predicate, Exchange exchange) {
assertPredicate(predicate, exchange, true);
} | static void function(Predicate predicate, Exchange exchange) { assertPredicate(predicate, exchange, true); } | /**
* Asserts that the predicate returns the expected value on the exchange
*/ | Asserts that the predicate returns the expected value on the exchange | assertPredicateMatches | {
"repo_name": "onders86/camel",
"path": "components/camel-testng/src/main/java/org/apache/camel/testng/TestSupport.java",
"license": "apache-2.0",
"size": 18934
} | [
"org.apache.camel.Exchange",
"org.apache.camel.Predicate"
] | import org.apache.camel.Exchange; import org.apache.camel.Predicate; | import org.apache.camel.*; | [
"org.apache.camel"
] | org.apache.camel; | 462,776 |
public List<Token> getTokens() {
return tokens;
} | List<Token> function() { return tokens; } | /**
* Returns the (mutable) list of tokens generated by the Lexer.
*/ | Returns the (mutable) list of tokens generated by the Lexer | getTokens | {
"repo_name": "hhclam/bazel",
"path": "src/main/java/com/google/devtools/build/lib/syntax/Lexer.java",
"license": "apache-2.0",
"size": 26221
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,052,993 |
public void performHttpRequestReceivePush(
String host, int port, String path,
FuturePromise<Session> sessionPromise, Phaser phaser)
throws Exception {
http2Client.connect(sslContextFactory, new InetSocketAddress(host, port),
new ServerSessionListener.Adapter(), sessionPromise);
Session session = sessionPromise.get(5, TimeUnit.SECONDS);
HttpFields requestFields = new HttpFields();
requestFields.put("User-Agent", http2Client
.getClass()
.getName() + "/" + Jetty.VERSION);
MetaData.Request metaData =
new MetaData.Request("GET", new HttpURI("https://" + host + ":" + port + path),
HttpVersion.HTTP_2, requestFields);
HeadersFrame headersFrame = new HeadersFrame(metaData, null, true);
session.newStream(headersFrame, new Promise.Adapter<>(), new StreamListener(phaser));
phaser.awaitAdvanceInterruptibly(phaser.arrive(), 5, TimeUnit.SECONDS);
} | void function( String host, int port, String path, FuturePromise<Session> sessionPromise, Phaser phaser) throws Exception { http2Client.connect(sslContextFactory, new InetSocketAddress(host, port), new ServerSessionListener.Adapter(), sessionPromise); Session session = sessionPromise.get(5, TimeUnit.SECONDS); HttpFields requestFields = new HttpFields(); requestFields.put(STR, http2Client .getClass() .getName() + "/" + Jetty.VERSION); MetaData.Request metaData = new MetaData.Request("GET", new HttpURI("https: HttpVersion.HTTP_2, requestFields); HeadersFrame headersFrame = new HeadersFrame(metaData, null, true); session.newStream(headersFrame, new Promise.Adapter<>(), new StreamListener(phaser)); phaser.awaitAdvanceInterruptibly(phaser.arrive(), 5, TimeUnit.SECONDS); } | /**
* Perform an http request and wait for a possibly incoming push promise.
*
* @param host the hostname
* @param port the port
* @param path the request path
* @param sessionPromise the session promise object
* @param phaser the phaser
* @throws Exception may occur when client is started or stopped
*/ | Perform an http request and wait for a possibly incoming push promise | performHttpRequestReceivePush | {
"repo_name": "janweinschenker/servlet4-demo",
"path": "client-jetty/src/main/java/de/holisticon/servlet4demo/jettyclient/jetty/JettyClientDemo.java",
"license": "apache-2.0",
"size": 5576
} | [
"java.net.InetSocketAddress",
"java.util.concurrent.Phaser",
"java.util.concurrent.TimeUnit",
"org.eclipse.jetty.http.HttpFields",
"org.eclipse.jetty.http.HttpURI",
"org.eclipse.jetty.http.HttpVersion",
"org.eclipse.jetty.http.MetaData",
"org.eclipse.jetty.http2.api.Session",
"org.eclipse.jetty.http2.api.server.ServerSessionListener",
"org.eclipse.jetty.http2.frames.HeadersFrame",
"org.eclipse.jetty.util.FuturePromise",
"org.eclipse.jetty.util.Jetty",
"org.eclipse.jetty.util.Promise"
] | import java.net.InetSocketAddress; import java.util.concurrent.Phaser; import java.util.concurrent.TimeUnit; import org.eclipse.jetty.http.HttpFields; import org.eclipse.jetty.http.HttpURI; import org.eclipse.jetty.http.HttpVersion; import org.eclipse.jetty.http.MetaData; import org.eclipse.jetty.http2.api.Session; import org.eclipse.jetty.http2.api.server.ServerSessionListener; import org.eclipse.jetty.http2.frames.HeadersFrame; import org.eclipse.jetty.util.FuturePromise; import org.eclipse.jetty.util.Jetty; import org.eclipse.jetty.util.Promise; | import java.net.*; import java.util.concurrent.*; import org.eclipse.jetty.http.*; import org.eclipse.jetty.http2.api.*; import org.eclipse.jetty.http2.api.server.*; import org.eclipse.jetty.http2.frames.*; import org.eclipse.jetty.util.*; | [
"java.net",
"java.util",
"org.eclipse.jetty"
] | java.net; java.util; org.eclipse.jetty; | 2,829,956 |
@SuppressWarnings("deprecation")
private boolean maybeSideTracked(Block block) {
if (Material.LOG.equals(block.getType()) && block.getData() == 3) {
return true;
} else {
return false;
}
} | @SuppressWarnings(STR) boolean function(Block block) { if (Material.LOG.equals(block.getType()) && block.getData() == 3) { return true; } else { return false; } } | /**
* Addresses cocoa on sides of trees; can be on any side, but not top, not bottom
*
* @param block The block to test type on
* @return True if maybe could possible contain cocoa
*/ | Addresses cocoa on sides of trees; can be on any side, but not top, not bottom | maybeSideTracked | {
"repo_name": "DevotedMC/CropControl",
"path": "src/main/java/com/programmerdan/minecraft/cropcontrol/handler/CropControlEventHandler.java",
"license": "bsd-3-clause",
"size": 65905
} | [
"org.bukkit.Material",
"org.bukkit.block.Block"
] | import org.bukkit.Material; import org.bukkit.block.Block; | import org.bukkit.*; import org.bukkit.block.*; | [
"org.bukkit",
"org.bukkit.block"
] | org.bukkit; org.bukkit.block; | 2,424,250 |
public BigInteger getEonAndYear() {
// both are defined
if (year != DatatypeConstants.FIELD_UNDEFINED
&& eon != null) {
return eon.add(BigInteger.valueOf((long) year));
}
// only year is defined
if (year != DatatypeConstants.FIELD_UNDEFINED
&& eon == null) {
return BigInteger.valueOf((long) year);
}
// neither are defined
// or only eon is defined which is not valid without a year
return null;
} | BigInteger function() { if (year != DatatypeConstants.FIELD_UNDEFINED && eon != null) { return eon.add(BigInteger.valueOf((long) year)); } if (year != DatatypeConstants.FIELD_UNDEFINED && eon == null) { return BigInteger.valueOf((long) year); } return null; } | /**
* <p>Return XML Schema 1.0 dateTime datatype field for
* <code>year</code>.</p>
*
* <p>Value constraints for this value are summarized in
* <a href="#datetimefield-year">year field of date/time field mapping table</a>.</p>
*
* @return sum of <code>eon</code> and <code>BigInteger.valueOf(year)</code>
* when both fields are defined. When only <code>year</code> is defined,
* return it. When both <code>eon</code> and <code>year</code> are not
* defined, return <code>null</code>.
*
* @see #getEon()
* @see #getYear()
*/ | Return XML Schema 1.0 dateTime datatype field for <code>year</code>. Value constraints for this value are summarized in year field of date/time field mapping table | getEonAndYear | {
"repo_name": "shun634501730/java_source_cn",
"path": "src_en/com/sun/org/apache/xerces/internal/jaxp/datatype/XMLGregorianCalendarImpl.java",
"license": "apache-2.0",
"size": 115945
} | [
"java.math.BigInteger",
"javax.xml.datatype.DatatypeConstants"
] | import java.math.BigInteger; import javax.xml.datatype.DatatypeConstants; | import java.math.*; import javax.xml.datatype.*; | [
"java.math",
"javax.xml"
] | java.math; javax.xml; | 548,699 |
public Set<T> enabledMembersForIndex(int index, int bitMask) {
Class<T> ct = indexByIndex.get(index);
if(ct==null) throw new RuntimeException("No enum collection type for [" + index + "]");
return enabledMembersForName(ct.getName(), bitMask);
}
| Set<T> function(int index, int bitMask) { Class<T> ct = indexByIndex.get(index); if(ct==null) throw new RuntimeException(STR + index + "]"); return enabledMembersForName(ct.getName(), bitMask); } | /**
* Returns a set of enabled enum collector members for the enum collector type identified by the passed index
* @param index The index of the enum collection type
* @param bitMask The bitmask
* @return a set of enabled enum collector members
*/ | Returns a set of enabled enum collector members for the enum collector type identified by the passed index | enabledMembersForIndex | {
"repo_name": "nickman/shorthand",
"path": "agent/src/main/java/com/heliosapm/shorthand/collectors/EnumCollectors.java",
"license": "apache-2.0",
"size": 13098
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 2,732,334 |
public static DataSource createJDBCSource(String url, String table) throws SQLException {
return new DataSource(url, table);
}
| static DataSource function(String url, String table) throws SQLException { return new DataSource(url, table); } | /**
* Creates a JDBC data source.
*
* @param url
* @param table
* @return
* @throws SQLException
*/ | Creates a JDBC data source | createJDBCSource | {
"repo_name": "arx-deidentifier/arx",
"path": "src/main/org/deidentifier/arx/DataSource.java",
"license": "apache-2.0",
"size": 10980
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 2,424,169 |
public List<Tuple3<FieldsSample, FieldsSampleContactPerson, FieldsPerson>> getRelationshipSampleContactPerson(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<FieldsSample, FieldsSampleContactPerson, FieldsPerson>>>> retType = new TypeReference<List<List<Tuple3<FieldsSample, FieldsSampleContactPerson, FieldsPerson>>>>() {};
List<List<Tuple3<FieldsSample, FieldsSampleContactPerson, FieldsPerson>>> res = caller.jsonrpcCall("CDMI_EntityAPI.get_relationship_SampleContactPerson", args, retType, true, false);
return res.get(0);
} | List<Tuple3<FieldsSample, FieldsSampleContactPerson, FieldsPerson>> 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<FieldsSample, FieldsSampleContactPerson, FieldsPerson>>>> retType = new TypeReference<List<List<Tuple3<FieldsSample, FieldsSampleContactPerson, FieldsPerson>>>>() {}; List<List<Tuple3<FieldsSample, FieldsSampleContactPerson, FieldsPerson>>> res = caller.jsonrpcCall(STR, args, retType, true, false); return res.get(0); } | /**
* <p>Original spec-file function name: get_relationship_SampleContactPerson</p>
* <pre>
* The people that performed the expression experiment(sample).
* It has the following fields:
* =over 4
* =back
* </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.FieldsSample FieldsSample} (original type "fields_Sample"), type {@link us.kbase.cdmientityapi.FieldsSampleContactPerson FieldsSampleContactPerson} (original type "fields_SampleContactPerson"), type {@link us.kbase.cdmientityapi.FieldsPerson FieldsPerson} (original type "fields_Person")
* @throws IOException if an IO exception occurs
* @throws JsonClientException if a JSON RPC exception occurs
*/ | Original spec-file function name: get_relationship_SampleContactPerson <code> The people that performed the expression experiment(sample). It has the following fields: =over 4 =back </code> | getRelationshipSampleContactPerson | {
"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,760 |
protected final boolean startsLine(DetailAST ast) {
return getLineStart(ast) == expandedTabsColumnNo(ast);
} | final boolean function(DetailAST ast) { return getLineStart(ast) == expandedTabsColumnNo(ast); } | /**
* Determines if the given expression is at the start of a line.
*
* @param ast the expression to check
*
* @return true if it is, false otherwise
*/ | Determines if the given expression is at the start of a line | startsLine | {
"repo_name": "universsky/checkstyle",
"path": "src/main/java/com/puppycrawl/tools/checkstyle/checks/indentation/AbstractExpressionHandler.java",
"license": "lgpl-2.1",
"size": 20639
} | [
"com.puppycrawl.tools.checkstyle.api.DetailAST"
] | import com.puppycrawl.tools.checkstyle.api.DetailAST; | import com.puppycrawl.tools.checkstyle.api.*; | [
"com.puppycrawl.tools"
] | com.puppycrawl.tools; | 326,919 |
public boolean parse(boolean complete) throws XNIException, IOException {
//
// reset and configure pipeline and set InputSource.
if (fInputSource != null) {
try {
fValidationManager.reset();
fVersionDetector.reset(this);
reset();
short version = fVersionDetector.determineDocVersion(fInputSource);
// XML 1.0
if (version == Constants.XML_VERSION_1_0) {
configurePipeline();
resetXML10();
}
// XML 1.1
else if (version == Constants.XML_VERSION_1_1) {
initXML11Components();
configureXML11Pipeline();
resetXML11();
}
// Unrecoverable error reported during version detection
else {
return false;
}
// mark configuration as fixed
fConfigUpdated = false;
// resets and sets the pipeline.
fVersionDetector.startDocumentParsing((XMLEntityHandler) fCurrentScanner, version);
fInputSource = null;
}
catch (XNIException ex) {
if (PRINT_EXCEPTION_STACK_TRACE)
ex.printStackTrace();
throw ex;
}
catch (IOException ex) {
if (PRINT_EXCEPTION_STACK_TRACE)
ex.printStackTrace();
throw ex;
}
catch (RuntimeException ex) {
if (PRINT_EXCEPTION_STACK_TRACE)
ex.printStackTrace();
throw ex;
}
catch (Exception ex) {
if (PRINT_EXCEPTION_STACK_TRACE)
ex.printStackTrace();
throw new XNIException(ex);
}
}
try {
return fCurrentScanner.scanDocument(complete);
}
catch (XNIException ex) {
if (PRINT_EXCEPTION_STACK_TRACE)
ex.printStackTrace();
throw ex;
}
catch (IOException ex) {
if (PRINT_EXCEPTION_STACK_TRACE)
ex.printStackTrace();
throw ex;
}
catch (RuntimeException ex) {
if (PRINT_EXCEPTION_STACK_TRACE)
ex.printStackTrace();
throw ex;
}
catch (Exception ex) {
if (PRINT_EXCEPTION_STACK_TRACE)
ex.printStackTrace();
throw new XNIException(ex);
}
} // parse(boolean):boolean | boolean function(boolean complete) throws XNIException, IOException { if (fInputSource != null) { try { fValidationManager.reset(); fVersionDetector.reset(this); reset(); short version = fVersionDetector.determineDocVersion(fInputSource); if (version == Constants.XML_VERSION_1_0) { configurePipeline(); resetXML10(); } else if (version == Constants.XML_VERSION_1_1) { initXML11Components(); configureXML11Pipeline(); resetXML11(); } else { return false; } fConfigUpdated = false; fVersionDetector.startDocumentParsing((XMLEntityHandler) fCurrentScanner, version); fInputSource = null; } catch (XNIException ex) { if (PRINT_EXCEPTION_STACK_TRACE) ex.printStackTrace(); throw ex; } catch (IOException ex) { if (PRINT_EXCEPTION_STACK_TRACE) ex.printStackTrace(); throw ex; } catch (RuntimeException ex) { if (PRINT_EXCEPTION_STACK_TRACE) ex.printStackTrace(); throw ex; } catch (Exception ex) { if (PRINT_EXCEPTION_STACK_TRACE) ex.printStackTrace(); throw new XNIException(ex); } } try { return fCurrentScanner.scanDocument(complete); } catch (XNIException ex) { if (PRINT_EXCEPTION_STACK_TRACE) ex.printStackTrace(); throw ex; } catch (IOException ex) { if (PRINT_EXCEPTION_STACK_TRACE) ex.printStackTrace(); throw ex; } catch (RuntimeException ex) { if (PRINT_EXCEPTION_STACK_TRACE) ex.printStackTrace(); throw ex; } catch (Exception ex) { if (PRINT_EXCEPTION_STACK_TRACE) ex.printStackTrace(); throw new XNIException(ex); } } | /**
* Parses the document in a pull parsing fashion.
*
* @param complete True if the pull parser should parse the
* remaining document completely.
*
* @return True if there is more document to parse.
*
* @exception XNIException Any XNI exception, possibly wrapping
* another exception.
* @exception IOException An IO exception from the parser, possibly
* from a byte stream or character stream
* supplied by the parser.
*
* @see #setInputSource
*/ | Parses the document in a pull parsing fashion | parse | {
"repo_name": "haikuowuya/android_system_code",
"path": "src/com/sun/org/apache/xerces/internal/impl/xs/opti/SchemaParsingConfig.java",
"license": "apache-2.0",
"size": 37701
} | [
"com.sun.org.apache.xerces.internal.impl.Constants",
"com.sun.org.apache.xerces.internal.impl.XMLEntityHandler",
"com.sun.org.apache.xerces.internal.xni.XNIException",
"java.io.IOException"
] | import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.impl.XMLEntityHandler; import com.sun.org.apache.xerces.internal.xni.XNIException; import java.io.IOException; | import com.sun.org.apache.xerces.internal.impl.*; import com.sun.org.apache.xerces.internal.xni.*; import java.io.*; | [
"com.sun.org",
"java.io"
] | com.sun.org; java.io; | 1,856,057 |
public static MailConfig loadConfig() {
try {
MailConfig mailConfig = (MailConfig) LocalPersistence.readObjectFromFile(OfficeApplication.getContext(), PREFERENCE_FILE);
if (mailConfig == null) return null;
String curentSimNumber = NetworkUtils.getCurrentSimCardNumber();
String savedSimNumber = mailConfig.getSimNumber();
if (curentSimNumber == null || savedSimNumber == null || !curentSimNumber.contentEquals(savedSimNumber)) return null;
return mailConfig;
} catch (Exception e) {
Logger.logApplicationException(e, MailConfigPreferences.class.getSimpleName() + ".loadConfig(): Failed.");
}
return null;
} | static MailConfig function() { try { MailConfig mailConfig = (MailConfig) LocalPersistence.readObjectFromFile(OfficeApplication.getContext(), PREFERENCE_FILE); if (mailConfig == null) return null; String curentSimNumber = NetworkUtils.getCurrentSimCardNumber(); String savedSimNumber = mailConfig.getSimNumber(); if (curentSimNumber == null savedSimNumber == null !curentSimNumber.contentEquals(savedSimNumber)) return null; return mailConfig; } catch (Exception e) { Logger.logApplicationException(e, MailConfigPreferences.class.getSimpleName() + STR); } return null; } | /**
* Retrieves saved Mails configuration.
*
* @return Saved Mails configuration.
*/ | Retrieves saved Mails configuration | loadConfig | {
"repo_name": "sujianping/Office-365-SDK-for-Android",
"path": "samples/mail-calendar-contacts-app/demo-app/src/main/java/com/example/office/mail/storage/MailConfigPreferences.java",
"license": "apache-2.0",
"size": 3634
} | [
"com.example.office.OfficeApplication",
"com.example.office.logger.Logger",
"com.example.office.mail.data.MailConfig",
"com.example.office.storage.LocalPersistence",
"com.example.office.utils.NetworkUtils"
] | import com.example.office.OfficeApplication; import com.example.office.logger.Logger; import com.example.office.mail.data.MailConfig; import com.example.office.storage.LocalPersistence; import com.example.office.utils.NetworkUtils; | import com.example.office.*; import com.example.office.logger.*; import com.example.office.mail.data.*; import com.example.office.storage.*; import com.example.office.utils.*; | [
"com.example.office"
] | com.example.office; | 1,702,426 |
private void writeDetailPageInfos(List<CmsDetailPageInfo> infos, CmsUUID newId) {
int i = 0;
for (CmsDetailPageInfo info : infos) {
if (info.isInherited()) {
continue;
}
CmsUUID id = info.getId();
if (id == null) {
id = newId;
}
writeValue(info.getType(), id, i);
i += 1;
}
} | void function(List<CmsDetailPageInfo> infos, CmsUUID newId) { int i = 0; for (CmsDetailPageInfo info : infos) { if (info.isInherited()) { continue; } CmsUUID id = info.getId(); if (id == null) { id = newId; } writeValue(info.getType(), id, i); i += 1; } } | /**
* Writes the detail page information to the XML content.<p>
*
* @param infos the list of detail page information bean
* @param newId the id to use for new pages
*/ | Writes the detail page information to the XML content | writeDetailPageInfos | {
"repo_name": "gallardo/opencms-core",
"path": "src/org/opencms/ade/detailpage/CmsDetailPageConfigurationWriter.java",
"license": "lgpl-2.1",
"size": 6714
} | [
"java.util.List",
"org.opencms.util.CmsUUID"
] | import java.util.List; import org.opencms.util.CmsUUID; | import java.util.*; import org.opencms.util.*; | [
"java.util",
"org.opencms.util"
] | java.util; org.opencms.util; | 801,532 |
private void showLocked(Bundle options) {
if (DEBUG) Log.d(TAG, "showLocked");
// ensure we stay awake until we are finished displaying the keyguard
mShowKeyguardWakeLock.acquire();
Message msg = mHandler.obtainMessage(SHOW, options);
mHandler.sendMessage(msg);
} | void function(Bundle options) { if (DEBUG) Log.d(TAG, STR); mShowKeyguardWakeLock.acquire(); Message msg = mHandler.obtainMessage(SHOW, options); mHandler.sendMessage(msg); } | /**
* Send message to keyguard telling it to show itself
* @see #handleShow()
*/ | Send message to keyguard telling it to show itself | showLocked | {
"repo_name": "haikuowuya/android_system_code",
"path": "src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java",
"license": "apache-2.0",
"size": 54599
} | [
"android.os.Bundle",
"android.os.Message",
"android.util.Log"
] | import android.os.Bundle; import android.os.Message; import android.util.Log; | import android.os.*; import android.util.*; | [
"android.os",
"android.util"
] | android.os; android.util; | 2,332,496 |
if (CONFIG == null) {
try {
CONFIG = new Configuration(Configuration.VERSION_2_3_25);
CONFIG.setDirectoryForTemplateLoading(templateDirectory());
CONFIG.setDefaultEncoding("UTF-8");
} catch (IOException exception) {
LOGGER.error("FATAL - could not load Freemarker configuration:", exception);
}
}
} | if (CONFIG == null) { try { CONFIG = new Configuration(Configuration.VERSION_2_3_25); CONFIG.setDirectoryForTemplateLoading(templateDirectory()); CONFIG.setDefaultEncoding("UTF-8"); } catch (IOException exception) { LOGGER.error(STR, exception); } } } | /**
* Inits the.
*/ | Inits the | init | {
"repo_name": "willmorejg/net.ljcomputing.mail",
"path": "src/main/java/net/ljcomputing/mail/template/FreemarkerConfiguration.java",
"license": "apache-2.0",
"size": 2218
} | [
"freemarker.template.Configuration",
"java.io.IOException"
] | import freemarker.template.Configuration; import java.io.IOException; | import freemarker.template.*; import java.io.*; | [
"freemarker.template",
"java.io"
] | freemarker.template; java.io; | 1,602,447 |
@Test
public void testLastUsedUpdate() throws Exception {
DelegatingConnection<?> conn = (DelegatingConnection<?>) ds.getConnection();
PreparedStatement ps = conn.prepareStatement("");
CallableStatement cs = conn.prepareCall("");
Statement st = conn.prepareStatement("");
checkLastUsedStatement(ps, conn);
checkLastUsedPreparedStatement(ps, conn);
checkLastUsedStatement(cs, conn);
checkLastUsedPreparedStatement(cs, conn);
checkLastUsedStatement(st, conn);
} | void function() throws Exception { DelegatingConnection<?> conn = (DelegatingConnection<?>) ds.getConnection(); PreparedStatement ps = conn.prepareStatement(STRSTR"); checkLastUsedStatement(ps, conn); checkLastUsedPreparedStatement(ps, conn); checkLastUsedStatement(cs, conn); checkLastUsedPreparedStatement(cs, conn); checkLastUsedStatement(st, conn); } | /**
* DBCP-343 - verify additional operations reset lastUsed on
* the parent connection
*/ | DBCP-343 - verify additional operations reset lastUsed on the parent connection | testLastUsedUpdate | {
"repo_name": "kmiku7/apache-commons-dbcp-annotated",
"path": "src/test/java/org/apache/commons/dbcp2/TestAbandonedBasicDataSource.java",
"license": "apache-2.0",
"size": 11596
} | [
"java.sql.PreparedStatement"
] | import java.sql.PreparedStatement; | import java.sql.*; | [
"java.sql"
] | java.sql; | 1,673,258 |
T loadModel(int modelInternalId) throws AdeException; | T loadModel(int modelInternalId) throws AdeException; | /**
* Load model from datastore. Loads the database entry with the given id, and
* then loads the model file specified in this entry.
*
* @param modelInternalId
* Specifies the model internal id to load
* @throws AdeException
* if there is no model with the given ID exists in the datastore,
* or if file is not found
*/ | Load model from datastore. Loads the database entry with the given id, and then loads the model file specified in this entry | loadModel | {
"repo_name": "openmainframeproject/ade",
"path": "ade-core/src/main/java/org/openmainframe/ade/dataStore/IDataStoreModels.java",
"license": "gpl-3.0",
"size": 6488
} | [
"org.openmainframe.ade.exceptions.AdeException"
] | import org.openmainframe.ade.exceptions.AdeException; | import org.openmainframe.ade.exceptions.*; | [
"org.openmainframe.ade"
] | org.openmainframe.ade; | 847,414 |
public void setHeldBlockState(@Nullable IBlockState state)
{
this.dataManager.set(CARRIED_BLOCK, Optional.fromNullable(state));
} | void function(@Nullable IBlockState state) { this.dataManager.set(CARRIED_BLOCK, Optional.fromNullable(state)); } | /**
* Sets this enderman's held block state
*/ | Sets this enderman's held block state | setHeldBlockState | {
"repo_name": "SuperUnitato/UnLonely",
"path": "build/tmp/recompileMc/sources/net/minecraft/entity/monster/EntityEnderman.java",
"license": "lgpl-2.1",
"size": 23888
} | [
"com.google.common.base.Optional",
"javax.annotation.Nullable",
"net.minecraft.block.state.IBlockState"
] | import com.google.common.base.Optional; import javax.annotation.Nullable; import net.minecraft.block.state.IBlockState; | import com.google.common.base.*; import javax.annotation.*; import net.minecraft.block.state.*; | [
"com.google.common",
"javax.annotation",
"net.minecraft.block"
] | com.google.common; javax.annotation; net.minecraft.block; | 1,364,126 |
public static String sendToSlaveServer( TransMeta transMeta, TransExecutionConfiguration executionConfiguration,
Repository repository, IMetaStore metaStore ) throws KettleException {
String carteObjectId;
SlaveServer slaveServer = executionConfiguration.getRemoteServer();
if ( slaveServer == null ) {
throw new KettleException( "No slave server specified" );
}
if ( Const.isEmpty( transMeta.getName() ) ) {
throw new KettleException(
"The transformation needs a name to uniquely identify it by on the remote server." );
}
try {
// Inject certain internal variables to make it more intuitive.
//
Map<String, String> vars = new HashMap<String, String>();
for ( String var : Const.INTERNAL_TRANS_VARIABLES ) {
vars.put( var, transMeta.getVariable( var ) );
}
for ( String var : Const.INTERNAL_JOB_VARIABLES ) {
vars.put( var, transMeta.getVariable( var ) );
}
executionConfiguration.getVariables().putAll( vars );
slaveServer.injectVariables( executionConfiguration.getVariables() );
slaveServer.getLogChannel().setLogLevel( executionConfiguration.getLogLevel() );
if ( executionConfiguration.isPassingExport() ) {
// First export the job...
//
FileObject tempFile =
KettleVFS.createTempFile( "transExport", ".zip", System.getProperty( "java.io.tmpdir" ), transMeta );
TopLevelResource topLevelResource =
ResourceUtil.serializeResourceExportInterface(
tempFile.getName().toString(), transMeta, transMeta, repository, metaStore, executionConfiguration
.getXML(), CONFIGURATION_IN_EXPORT_FILENAME );
// Send the zip file over to the slave server...
//
String result =
slaveServer.sendExport(
topLevelResource.getArchiveName(), AddExportServlet.TYPE_TRANS, topLevelResource
.getBaseResourceName() );
WebResult webResult = WebResult.fromXMLString( result );
if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) {
throw new KettleException(
"There was an error passing the exported transformation to the remote server: "
+ Const.CR + webResult.getMessage() );
}
carteObjectId = webResult.getId();
} else {
// Now send it off to the remote server...
//
String xml = new TransConfiguration( transMeta, executionConfiguration ).getXML();
String reply = slaveServer.sendXML( xml, RegisterTransServlet.CONTEXT_PATH + "/?xml=Y" );
WebResult webResult = WebResult.fromXMLString( reply );
if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) {
throw new KettleException( "There was an error posting the transformation on the remote server: "
+ Const.CR + webResult.getMessage() );
}
carteObjectId = webResult.getId();
}
// Prepare the transformation
//
String reply =
slaveServer.execService( PrepareExecutionTransServlet.CONTEXT_PATH
+ "/?name=" + URLEncoder.encode( transMeta.getName(), "UTF-8" ) + "&xml=Y&id=" + carteObjectId );
WebResult webResult = WebResult.fromXMLString( reply );
if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) {
throw new KettleException(
"There was an error preparing the transformation for excution on the remote server: "
+ Const.CR + webResult.getMessage() );
}
// Start the transformation
//
reply =
slaveServer.execService( StartExecutionTransServlet.CONTEXT_PATH
+ "/?name=" + URLEncoder.encode( transMeta.getName(), "UTF-8" ) + "&xml=Y&id=" + carteObjectId );
webResult = WebResult.fromXMLString( reply );
if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) {
throw new KettleException( "There was an error starting the transformation on the remote server: "
+ Const.CR + webResult.getMessage() );
}
return carteObjectId;
} catch ( KettleException ke ) {
throw ke;
} catch ( Exception e ) {
throw new KettleException( e );
}
} | static String function( TransMeta transMeta, TransExecutionConfiguration executionConfiguration, Repository repository, IMetaStore metaStore ) throws KettleException { String carteObjectId; SlaveServer slaveServer = executionConfiguration.getRemoteServer(); if ( slaveServer == null ) { throw new KettleException( STR ); } if ( Const.isEmpty( transMeta.getName() ) ) { throw new KettleException( STR ); } try { for ( String var : Const.INTERNAL_TRANS_VARIABLES ) { vars.put( var, transMeta.getVariable( var ) ); } for ( String var : Const.INTERNAL_JOB_VARIABLES ) { vars.put( var, transMeta.getVariable( var ) ); } executionConfiguration.getVariables().putAll( vars ); slaveServer.injectVariables( executionConfiguration.getVariables() ); slaveServer.getLogChannel().setLogLevel( executionConfiguration.getLogLevel() ); if ( executionConfiguration.isPassingExport() ) { KettleVFS.createTempFile( STR, ".zip", System.getProperty( STR ), transMeta ); TopLevelResource topLevelResource = ResourceUtil.serializeResourceExportInterface( tempFile.getName().toString(), transMeta, transMeta, repository, metaStore, executionConfiguration .getXML(), CONFIGURATION_IN_EXPORT_FILENAME ); slaveServer.sendExport( topLevelResource.getArchiveName(), AddExportServlet.TYPE_TRANS, topLevelResource .getBaseResourceName() ); WebResult webResult = WebResult.fromXMLString( result ); if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) { throw new KettleException( STR + Const.CR + webResult.getMessage() ); } carteObjectId = webResult.getId(); } else { String reply = slaveServer.sendXML( xml, RegisterTransServlet.CONTEXT_PATH + STR ); WebResult webResult = WebResult.fromXMLString( reply ); if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) { throw new KettleException( STR + Const.CR + webResult.getMessage() ); } carteObjectId = webResult.getId(); } slaveServer.execService( PrepareExecutionTransServlet.CONTEXT_PATH + STR + URLEncoder.encode( transMeta.getName(), "UTF-8" ) + STR + carteObjectId ); WebResult webResult = WebResult.fromXMLString( reply ); if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) { throw new KettleException( STR + Const.CR + webResult.getMessage() ); } slaveServer.execService( StartExecutionTransServlet.CONTEXT_PATH + STR + URLEncoder.encode( transMeta.getName(), "UTF-8" ) + STR + carteObjectId ); webResult = WebResult.fromXMLString( reply ); if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) { throw new KettleException( STR + Const.CR + webResult.getMessage() ); } return carteObjectId; } catch ( KettleException ke ) { throw ke; } catch ( Exception e ) { throw new KettleException( e ); } } | /**
* Send the transformation for execution to a Carte slave server.
*
* @param transMeta
* the transformation meta-data
* @param executionConfiguration
* the transformation execution configuration
* @param repository
* the repository
* @return The Carte object ID on the server.
* @throws KettleException
* if any errors occur during the dispatch to the slave server
*/ | Send the transformation for execution to a Carte slave server | sendToSlaveServer | {
"repo_name": "gretchiemoran/pentaho-kettle",
"path": "engine/src/org/pentaho/di/trans/Trans.java",
"license": "apache-2.0",
"size": 194677
} | [
"java.net.URLEncoder",
"org.pentaho.di.cluster.SlaveServer",
"org.pentaho.di.core.Const",
"org.pentaho.di.core.exception.KettleException",
"org.pentaho.di.core.vfs.KettleVFS",
"org.pentaho.di.repository.Repository",
"org.pentaho.di.resource.ResourceUtil",
"org.pentaho.di.resource.TopLevelResource",
"org.pentaho.di.www.AddExportServlet",
"org.pentaho.di.www.PrepareExecutionTransServlet",
"org.pentaho.di.www.RegisterTransServlet",
"org.pentaho.di.www.StartExecutionTransServlet",
"org.pentaho.di.www.WebResult",
"org.pentaho.metastore.api.IMetaStore"
] | import java.net.URLEncoder; import org.pentaho.di.cluster.SlaveServer; import org.pentaho.di.core.Const; import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.core.vfs.KettleVFS; import org.pentaho.di.repository.Repository; import org.pentaho.di.resource.ResourceUtil; import org.pentaho.di.resource.TopLevelResource; import org.pentaho.di.www.AddExportServlet; import org.pentaho.di.www.PrepareExecutionTransServlet; import org.pentaho.di.www.RegisterTransServlet; import org.pentaho.di.www.StartExecutionTransServlet; import org.pentaho.di.www.WebResult; import org.pentaho.metastore.api.IMetaStore; | import java.net.*; import org.pentaho.di.cluster.*; import org.pentaho.di.core.*; import org.pentaho.di.core.exception.*; import org.pentaho.di.core.vfs.*; import org.pentaho.di.repository.*; import org.pentaho.di.resource.*; import org.pentaho.di.www.*; import org.pentaho.metastore.api.*; | [
"java.net",
"org.pentaho.di",
"org.pentaho.metastore"
] | java.net; org.pentaho.di; org.pentaho.metastore; | 602,834 |
public java.util.Map getParams() {
return params;
} | java.util.Map function() { return params; } | /**
* Returns a map with the name and values of the parameters needed to build
* the transformer to which this <code>TransformerSpec</code> refers to.
*
* @return Map
*/ | Returns a map with the name and values of the parameters needed to build the transformer to which this <code>TransformerSpec</code> refers to | getParams | {
"repo_name": "forises/Yeast-T-src",
"path": "src/org/ystsrv/transformer/TransformerSpec.java",
"license": "gpl-3.0",
"size": 3421
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,640,594 |
public VirtualNetworkUsageName name() {
return this.name;
} | VirtualNetworkUsageName function() { return this.name; } | /**
* Get the name containing common and localized value for usage.
*
* @return the name value
*/ | Get the name containing common and localized value for usage | name | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkUsageInner.java",
"license": "mit",
"size": 2208
} | [
"com.microsoft.azure.management.network.v2018_04_01.VirtualNetworkUsageName"
] | import com.microsoft.azure.management.network.v2018_04_01.VirtualNetworkUsageName; | import com.microsoft.azure.management.network.v2018_04_01.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 785,147 |
public void endElement(String namespaceURI, String localName, String qName)
throws SAXException {
if (namespaceURI.equals("")) {
super.endElement(this.uriDefault,localName,qName);
} else {
super.endElement(namespaceURI,localName,qName);
}
}
| void function(String namespaceURI, String localName, String qName) throws SAXException { if (namespaceURI.equals("")) { super.endElement(this.uriDefault,localName,qName); } else { super.endElement(namespaceURI,localName,qName); } } | /**
* All incoming empty URIs will be remapped to the default.
*
* @param namespaceURI
* URI to check and potentially replace
* @param localName
* @param qName
* @exception SAXException
*/ | All incoming empty URIs will be remapped to the default | endElement | {
"repo_name": "hudson3-plugins/commons-jelly",
"path": "src/java/org/apache/commons/jelly/parser/DefaultNamespaceFilter.java",
"license": "apache-2.0",
"size": 3319
} | [
"org.xml.sax.SAXException"
] | import org.xml.sax.SAXException; | import org.xml.sax.*; | [
"org.xml.sax"
] | org.xml.sax; | 531,238 |
public LandmarkRecord setS2Cell(ULong value) {
set(2, value);
return this;
} | LandmarkRecord function(ULong value) { set(2, value); return this; } | /**
* Setter for <code>cafemapdb.landmark.s2_cell</code>.
*/ | Setter for <code>cafemapdb.landmark.s2_cell</code> | setS2Cell | {
"repo_name": "curioswitch/curiostack",
"path": "database/cafemapdb/bindings/gen-src/main/java/org/curioswitch/database/cafemapdb/tables/records/LandmarkRecord.java",
"license": "mit",
"size": 8812
} | [
"org.jooq.types.ULong"
] | import org.jooq.types.ULong; | import org.jooq.types.*; | [
"org.jooq.types"
] | org.jooq.types; | 37,136 |
Action setCurrentAction(Action nextAction); | Action setCurrentAction(Action nextAction); | /**
* Set the current action, so that the components controller can access it
*
* @param nextAction
* @return the previous action
*/ | Set the current action, so that the components controller can access it | setCurrentAction | {
"repo_name": "forcedotcom/aura",
"path": "aura/src/main/java/org/auraframework/system/AuraContext.java",
"license": "apache-2.0",
"size": 27715
} | [
"org.auraframework.instance.Action"
] | import org.auraframework.instance.Action; | import org.auraframework.instance.*; | [
"org.auraframework.instance"
] | org.auraframework.instance; | 354,030 |
@SuppressWarnings("UnusedDeclaration")
public String getColType(Aggregate rel, RelMetadataQuery mq, int column) {
final String name =
rel.getRowType().getFieldList().get(column).getName() + "-agg";
THREAD_LIST.get().add(name);
return name;
}
}
public static class ColTypeImpl extends PartialColTypeImpl {
public static final RelMetadataProvider SOURCE =
ReflectiveRelMetadataProvider.reflectiveSource(ColType.METHOD, new ColTypeImpl()); | @SuppressWarnings(STR) String function(Aggregate rel, RelMetadataQuery mq, int column) { final String name = rel.getRowType().getFieldList().get(column).getName() + "-agg"; THREAD_LIST.get().add(name); return name; } } public static class ColTypeImpl extends PartialColTypeImpl { public static final RelMetadataProvider SOURCE = ReflectiveRelMetadataProvider.reflectiveSource(ColType.METHOD, new ColTypeImpl()); | /** Implementation of {@link ColType#getColType(int)} for
* {@link org.apache.calcite.rel.logical.LogicalAggregate}, called via
* reflection. */ | Implementation of <code>ColType#getColType(int)</code> for <code>org.apache.calcite.rel.logical.LogicalAggregate</code>, called via | getColType | {
"repo_name": "xhoong/incubator-calcite",
"path": "core/src/test/java/org/apache/calcite/test/RelMetadataTest.java",
"license": "apache-2.0",
"size": 121043
} | [
"org.apache.calcite.rel.core.Aggregate",
"org.apache.calcite.rel.metadata.ReflectiveRelMetadataProvider",
"org.apache.calcite.rel.metadata.RelMetadataProvider",
"org.apache.calcite.rel.metadata.RelMetadataQuery"
] | import org.apache.calcite.rel.core.Aggregate; import org.apache.calcite.rel.metadata.ReflectiveRelMetadataProvider; import org.apache.calcite.rel.metadata.RelMetadataProvider; import org.apache.calcite.rel.metadata.RelMetadataQuery; | import org.apache.calcite.rel.core.*; import org.apache.calcite.rel.metadata.*; | [
"org.apache.calcite"
] | org.apache.calcite; | 2,693,127 |
public static void centerOnScreen(Window wnd) {
Rectangle screenBounds = SwingUtil.getScreenSize(wnd);
wnd.setBounds((int) (screenBounds.getWidth() - wnd.getWidth()) / 2,
(int) (screenBounds.getHeight() - wnd.getHeight()) / 2, wnd.getWidth(), wnd.getHeight());
} | static void function(Window wnd) { Rectangle screenBounds = SwingUtil.getScreenSize(wnd); wnd.setBounds((int) (screenBounds.getWidth() - wnd.getWidth()) / 2, (int) (screenBounds.getHeight() - wnd.getHeight()) / 2, wnd.getWidth(), wnd.getHeight()); } | /**
* Move the Window to center of screen.
*
* @param wnd
* the Window.
*/ | Move the Window to center of screen | centerOnScreen | {
"repo_name": "qikh/swingbootstrap",
"path": "swingbootstrap-core/src/main/java/swingbootstrap/util/SwingUtil.java",
"license": "apache-2.0",
"size": 4783
} | [
"java.awt.Rectangle",
"java.awt.Window"
] | import java.awt.Rectangle; import java.awt.Window; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,004,261 |
public List<String> getQueryParameters(String key) {
if (isOpaque()) {
throw new UnsupportedOperationException(NOT_HIERARCHICAL);
}
if (key == null) {
throw new NullPointerException("key");
}
String query = getEncodedQuery();
if (query == null) {
return Collections.emptyList();
}
String encodedKey;
try {
encodedKey = URLEncoder.encode(key, DEFAULT_ENCODING);
} catch (UnsupportedEncodingException e) {
throw new AssertionError(e);
}
ArrayList<String> values = new ArrayList<String>();
int start = 0;
do {
int nextAmpersand = query.indexOf('&', start);
int end = nextAmpersand != -1 ? nextAmpersand : query.length();
int separator = query.indexOf('=', start);
if (separator > end || separator == -1) {
separator = end;
}
if (separator - start == encodedKey.length()
&& query.regionMatches(start, encodedKey, 0, encodedKey.length())) {
if (separator == end) {
values.add("");
} else {
values.add(decode(query.substring(separator + 1, end)));
}
}
// Move start to end of name.
if (nextAmpersand != -1) {
start = nextAmpersand + 1;
} else {
break;
}
} while (true);
return Collections.unmodifiableList(values);
} | List<String> function(String key) { if (isOpaque()) { throw new UnsupportedOperationException(NOT_HIERARCHICAL); } if (key == null) { throw new NullPointerException("key"); } String query = getEncodedQuery(); if (query == null) { return Collections.emptyList(); } String encodedKey; try { encodedKey = URLEncoder.encode(key, DEFAULT_ENCODING); } catch (UnsupportedEncodingException e) { throw new AssertionError(e); } ArrayList<String> values = new ArrayList<String>(); int start = 0; do { int nextAmpersand = query.indexOf('&', start); int end = nextAmpersand != -1 ? nextAmpersand : query.length(); int separator = query.indexOf('=', start); if (separator > end separator == -1) { separator = end; } if (separator - start == encodedKey.length() && query.regionMatches(start, encodedKey, 0, encodedKey.length())) { if (separator == end) { values.add(""); } else { values.add(decode(query.substring(separator + 1, end))); } } if (nextAmpersand != -1) { start = nextAmpersand + 1; } else { break; } } while (true); return Collections.unmodifiableList(values); } | /**
* Searches the query string for parameter values with the given key.
*
* @param key which will be encoded
* @return a list of decoded values
* @throws UnsupportedOperationException if this isn't a hierarchical URI
* @throws NullPointerException if key is null
*/ | Searches the query string for parameter values with the given key | getQueryParameters | {
"repo_name": "davidwhitman/Tir",
"path": "app/src/main/kotlin/com/thunderclouddev/tirforgoodreads/uri/Uri.java",
"license": "gpl-3.0",
"size": 71419
} | [
"java.io.UnsupportedEncodingException",
"java.net.URLEncoder",
"java.util.ArrayList",
"java.util.Collections",
"java.util.List"
] | import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.ArrayList; import java.util.Collections; import java.util.List; | import java.io.*; import java.net.*; import java.util.*; | [
"java.io",
"java.net",
"java.util"
] | java.io; java.net; java.util; | 744,611 |
public static String getNamenodeServiceAddr(final Configuration conf,
String nsId, String nnId) {
if (nsId == null) {
nsId = getOnlyNameServiceIdOrNull(conf);
}
String serviceAddrKey = DFSUtilClient.concatSuffixes(
DFSConfigKeys.DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, nsId, nnId);
String addrKey = DFSUtilClient.concatSuffixes(
DFSConfigKeys.DFS_NAMENODE_RPC_ADDRESS_KEY, nsId, nnId);
String serviceRpcAddr = conf.get(serviceAddrKey);
if (serviceRpcAddr == null) {
serviceRpcAddr = conf.get(addrKey);
}
return serviceRpcAddr;
} | static String function(final Configuration conf, String nsId, String nnId) { if (nsId == null) { nsId = getOnlyNameServiceIdOrNull(conf); } String serviceAddrKey = DFSUtilClient.concatSuffixes( DFSConfigKeys.DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, nsId, nnId); String addrKey = DFSUtilClient.concatSuffixes( DFSConfigKeys.DFS_NAMENODE_RPC_ADDRESS_KEY, nsId, nnId); String serviceRpcAddr = conf.get(serviceAddrKey); if (serviceRpcAddr == null) { serviceRpcAddr = conf.get(addrKey); } return serviceRpcAddr; } | /**
* Map a logical namenode ID to its service address. Use the given
* nameservice if specified, or the configured one if none is given.
*
* @param conf Configuration
* @param nsId which nameservice nnId is a part of, optional
* @param nnId the namenode ID to get the service addr for
* @return the service addr, null if it could not be determined
*/ | Map a logical namenode ID to its service address. Use the given nameservice if specified, or the configured one if none is given | getNamenodeServiceAddr | {
"repo_name": "simbadzina/hadoop-fcfs",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java",
"license": "apache-2.0",
"size": 56642
} | [
"org.apache.hadoop.conf.Configuration"
] | import org.apache.hadoop.conf.Configuration; | import org.apache.hadoop.conf.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 1,496,583 |
@Test
public void testSeparateEditsDirLocking() throws IOException {
Configuration conf = new HdfsConfiguration();
File nameDir = new File(MiniDFSCluster.getBaseDirectory(), "name");
File editsDir = new File(MiniDFSCluster.getBaseDirectory(),
"testSeparateEditsDirLocking");
conf.set(DFSConfigKeys.DFS_NAMENODE_NAME_DIR_KEY,
nameDir.getAbsolutePath());
conf.set(DFSConfigKeys.DFS_NAMENODE_EDITS_DIR_KEY,
editsDir.getAbsolutePath());
MiniDFSCluster cluster = null;
// Start a NN, and verify that lock() fails in all of the configured
// directories
StorageDirectory savedSd = null;
try {
cluster = new MiniDFSCluster.Builder(conf).manageNameDfsDirs(false)
.numDataNodes(0).build();
NNStorage storage = cluster.getNameNode().getFSImage().getStorage();
for (StorageDirectory sd : storage.dirIterable(NameNodeDirType.EDITS)) {
assertEquals(editsDir.getAbsoluteFile(), sd.getRoot());
assertLockFails(sd);
savedSd = sd;
}
} finally {
cleanup(cluster);
cluster = null;
}
assertNotNull(savedSd);
// Lock one of the saved directories, then start the NN, and make sure it
// fails to start
assertClusterStartFailsWhenDirLocked(conf, savedSd);
} | void function() throws IOException { Configuration conf = new HdfsConfiguration(); File nameDir = new File(MiniDFSCluster.getBaseDirectory(), "name"); File editsDir = new File(MiniDFSCluster.getBaseDirectory(), STR); conf.set(DFSConfigKeys.DFS_NAMENODE_NAME_DIR_KEY, nameDir.getAbsolutePath()); conf.set(DFSConfigKeys.DFS_NAMENODE_EDITS_DIR_KEY, editsDir.getAbsolutePath()); MiniDFSCluster cluster = null; StorageDirectory savedSd = null; try { cluster = new MiniDFSCluster.Builder(conf).manageNameDfsDirs(false) .numDataNodes(0).build(); NNStorage storage = cluster.getNameNode().getFSImage().getStorage(); for (StorageDirectory sd : storage.dirIterable(NameNodeDirType.EDITS)) { assertEquals(editsDir.getAbsoluteFile(), sd.getRoot()); assertLockFails(sd); savedSd = sd; } } finally { cleanup(cluster); cluster = null; } assertNotNull(savedSd); assertClusterStartFailsWhenDirLocked(conf, savedSd); } | /**
* Test that, if the edits dir is separate from the name dir, it is
* properly locked.
**/ | Test that, if the edits dir is separate from the name dir, it is properly locked | testSeparateEditsDirLocking | {
"repo_name": "legend-hua/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java",
"license": "apache-2.0",
"size": 88282
} | [
"java.io.File",
"java.io.IOException",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.hdfs.DFSConfigKeys",
"org.apache.hadoop.hdfs.HdfsConfiguration",
"org.apache.hadoop.hdfs.MiniDFSCluster",
"org.apache.hadoop.hdfs.server.common.Storage",
"org.apache.hadoop.hdfs.server.namenode.NNStorage",
"org.junit.Assert"
] | import java.io.File; import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hdfs.DFSConfigKeys; import org.apache.hadoop.hdfs.HdfsConfiguration; import org.apache.hadoop.hdfs.MiniDFSCluster; import org.apache.hadoop.hdfs.server.common.Storage; import org.apache.hadoop.hdfs.server.namenode.NNStorage; import org.junit.Assert; | import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.hdfs.*; import org.apache.hadoop.hdfs.server.common.*; import org.apache.hadoop.hdfs.server.namenode.*; import org.junit.*; | [
"java.io",
"org.apache.hadoop",
"org.junit"
] | java.io; org.apache.hadoop; org.junit; | 2,192,680 |
void save(String token, String secret) throws IOException;
| void save(String token, String secret) throws IOException; | /**
* Stores a new access token
* @param token the token's value (must not be null)
* @param secret the token's secret (must not be null)
* @throws IOException if the values could not stored
*/ | Stores a new access token | save | {
"repo_name": "Klortho/citeproc-java",
"path": "citeproc-java/src/main/java/de/undercouch/citeproc/helper/oauth/AuthenticationStore.java",
"license": "apache-2.0",
"size": 1442
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,442,135 |
public void startExecuting()
{
double var1 = this.leapTarget.posX - this.leaper.posX;
double var3 = this.leapTarget.posZ - this.leaper.posZ;
float var5 = MathHelper.sqrt_double(var1 * var1 + var3 * var3);
this.leaper.motionX += var1 / (double)var5 * 0.5D * 0.800000011920929D + this.leaper.motionX * 0.20000000298023224D;
this.leaper.motionZ += var3 / (double)var5 * 0.5D * 0.800000011920929D + this.leaper.motionZ * 0.20000000298023224D;
this.leaper.motionY = (double)this.leapMotionY;
} | void function() { double var1 = this.leapTarget.posX - this.leaper.posX; double var3 = this.leapTarget.posZ - this.leaper.posZ; float var5 = MathHelper.sqrt_double(var1 * var1 + var3 * var3); this.leaper.motionX += var1 / (double)var5 * 0.5D * 0.800000011920929D + this.leaper.motionX * 0.20000000298023224D; this.leaper.motionZ += var3 / (double)var5 * 0.5D * 0.800000011920929D + this.leaper.motionZ * 0.20000000298023224D; this.leaper.motionY = (double)this.leapMotionY; } | /**
* Execute a one shot task or start executing a continuous task
*/ | Execute a one shot task or start executing a continuous task | startExecuting | {
"repo_name": "Myrninvollo/Server",
"path": "src/net/minecraft/entity/ai/EntityAILeapAtTarget.java",
"license": "gpl-2.0",
"size": 2023
} | [
"net.minecraft.util.MathHelper"
] | import net.minecraft.util.MathHelper; | import net.minecraft.util.*; | [
"net.minecraft.util"
] | net.minecraft.util; | 708,204 |
void environmentPrepared(ConfigurableEnvironment environment); | void environmentPrepared(ConfigurableEnvironment environment); | /**
* Called once the environment has been prepared, but before the
* {@link ApplicationContext} has been created.
* @param environment the environment
*/ | Called once the environment has been prepared, but before the <code>ApplicationContext</code> has been created | environmentPrepared | {
"repo_name": "izeye/spring-boot",
"path": "spring-boot/src/main/java/org/springframework/boot/SpringApplicationRunListener.java",
"license": "apache-2.0",
"size": 2528
} | [
"org.springframework.core.env.ConfigurableEnvironment"
] | import org.springframework.core.env.ConfigurableEnvironment; | import org.springframework.core.env.*; | [
"org.springframework.core"
] | org.springframework.core; | 1,053,134 |
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
if (this.defaultPollInterval.isNegative()) {
throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
}
return this;
} | Configurable function(Duration defaultPollInterval) { this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, STR); if (this.defaultPollInterval.isNegative()) { throw logger.logExceptionAsError(new IllegalArgumentException(STR)); } return this; } | /**
* Sets the default poll interval, used when service does not provide "Retry-After" header.
*
* @param defaultPollInterval the default poll interval.
* @return the configurable object itself.
*/ | Sets the default poll interval, used when service does not provide "Retry-After" header | withDefaultPollInterval | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/recoveryservices/azure-resourcemanager-recoveryservices/src/main/java/com/azure/resourcemanager/recoveryservices/RecoveryServicesManager.java",
"license": "mit",
"size": 12696
} | [
"java.time.Duration",
"java.util.Objects"
] | import java.time.Duration; import java.util.Objects; | import java.time.*; import java.util.*; | [
"java.time",
"java.util"
] | java.time; java.util; | 1,120,922 |
azure
.cosmosDBAccounts()
.manager()
.serviceClient()
.getMongoDBResources()
.getMongoDBCollectionWithResponse("rgName", "ddb1", "databaseName", "collectionName", Context.NONE);
} | azure .cosmosDBAccounts() .manager() .serviceClient() .getMongoDBResources() .getMongoDBCollectionWithResponse(STR, "ddb1", STR, STR, Context.NONE); } | /**
* Sample code: CosmosDBMongoDBCollectionGet.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/ | Sample code: CosmosDBMongoDBCollectionGet | cosmosDBMongoDBCollectionGet | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/MongoDBResourcesGetMongoDBCollectionSamples.java",
"license": "mit",
"size": 1055
} | [
"com.azure.core.util.Context"
] | import com.azure.core.util.Context; | import com.azure.core.util.*; | [
"com.azure.core"
] | com.azure.core; | 2,153,930 |
private static String asPath(PyObject path) {
if (path instanceof PyString) {
return path.toString();
}
throw Py.TypeError(String.format("coercing to Unicode: need string, %s type found",
path.getType().fastGetName()));
} | static String function(PyObject path) { if (path instanceof PyString) { return path.toString(); } throw Py.TypeError(String.format(STR, path.getType().fastGetName())); } | /**
* Return a path as a String from a PyObject
*
* @param path a PyObject, raising a TypeError if an invalid path type
* @return a String path
*/ | Return a path as a String from a PyObject | asPath | {
"repo_name": "tunneln/CarnotKE",
"path": "jyhton/src/org/python/modules/posix/PosixModule.java",
"license": "apache-2.0",
"size": 54499
} | [
"org.python.core.Py",
"org.python.core.PyObject",
"org.python.core.PyString"
] | import org.python.core.Py; import org.python.core.PyObject; import org.python.core.PyString; | import org.python.core.*; | [
"org.python.core"
] | org.python.core; | 2,018,675 |
@Override
public long getLong() {
int remaining = this.curItem.remaining();
if (remaining >= Bytes.SIZEOF_LONG) {
return this.curItem.getLong();
}
long l = 0;
for (int i = 0; i < Bytes.SIZEOF_LONG; i++) {
l <<= 8;
l ^= get() & 0xFF;
}
return l;
} | long function() { int remaining = this.curItem.remaining(); if (remaining >= Bytes.SIZEOF_LONG) { return this.curItem.getLong(); } long l = 0; for (int i = 0; i < Bytes.SIZEOF_LONG; i++) { l <<= 8; l ^= get() & 0xFF; } return l; } | /**
* Returns the long value at the current position. Also advances the position by the size of long
*
* @return the long value at the current position
*/ | Returns the long value at the current position. Also advances the position by the size of long | getLong | {
"repo_name": "ultratendency/hbase",
"path": "hbase-common/src/main/java/org/apache/hadoop/hbase/nio/MultiByteBuff.java",
"license": "apache-2.0",
"size": 33659
} | [
"org.apache.hadoop.hbase.util.Bytes"
] | import org.apache.hadoop.hbase.util.Bytes; | import org.apache.hadoop.hbase.util.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 2,587,892 |
private void showErrorDialog(String message) {
AlertDialogFragment dialog;
Bundle args;
//set dialog args
args = new Bundle(4);
args.putString(AlertDialogFragment.DIALOG_TITLE, getResources().getString(R.string.database_import_title));
args.putString(AlertDialogFragment.DIALOG_MESSAGE, message);
args.putString(AlertDialogFragment.DIALOG_POSITIVE_TEXT, getResources().getString(android.R.string.yes));
args.putInt(AlertDialogFragment.DIALOG_ICON, android.R.drawable.ic_dialog_alert);
dialog = new AlertDialogFragment();
dialog.setArguments(args);
dialog.setAlertDialogFragmentListener(this);
dialog.show(getFragmentManager(), null);
} | void function(String message) { AlertDialogFragment dialog; Bundle args; args = new Bundle(4); args.putString(AlertDialogFragment.DIALOG_TITLE, getResources().getString(R.string.database_import_title)); args.putString(AlertDialogFragment.DIALOG_MESSAGE, message); args.putString(AlertDialogFragment.DIALOG_POSITIVE_TEXT, getResources().getString(android.R.string.yes)); args.putInt(AlertDialogFragment.DIALOG_ICON, android.R.drawable.ic_dialog_alert); dialog = new AlertDialogFragment(); dialog.setArguments(args); dialog.setAlertDialogFragmentListener(this); dialog.show(getFragmentManager(), null); } | /**
* Shows an AlertDialog with the given message
* @param message
*/ | Shows an AlertDialog with the given message | showErrorDialog | {
"repo_name": "stovocor/whohasmystuff",
"path": "src/main/java/de/freewarepoint/whohasmystuff/ListLentObjects.java",
"license": "gpl-3.0",
"size": 9508
} | [
"android.os.Bundle"
] | import android.os.Bundle; | import android.os.*; | [
"android.os"
] | android.os; | 1,169,820 |
@SuppressWarnings("unused")
private void printPermanences(Connections c) {
double[][] perms = c.getPermanences();
for(int i = 0;i < perms.length;i++) {
System.out.println(Arrays.toString(perms[i]));
}
}
/**
* Compares the stored python spatial pooler permanences against those
* generated by the java {@link SpatialPooler} | @SuppressWarnings(STR) void function(Connections c) { double[][] perms = c.getPermanences(); for(int i = 0;i < perms.length;i++) { System.out.println(Arrays.toString(perms[i])); } } /** * Compares the stored python spatial pooler permanences against those * generated by the java {@link SpatialPooler} | /**
* Prints the each columns synapse permanences
* @param c
*/ | Prints the each columns synapse permanences | printPermanences | {
"repo_name": "sambitgaan/htm.java",
"path": "src/test/java/org/numenta/nupic/algorithms/SpatialPoolerCompatibilityTest.java",
"license": "agpl-3.0",
"size": 24534
} | [
"java.util.Arrays",
"org.numenta.nupic.model.Connections"
] | import java.util.Arrays; import org.numenta.nupic.model.Connections; | import java.util.*; import org.numenta.nupic.model.*; | [
"java.util",
"org.numenta.nupic"
] | java.util; org.numenta.nupic; | 310,582 |
@JRubyMethod(name = "get_decimal128_bytes")
public RubyString getDecimal128Bytes() {
return getBytes(new RubyFixnum(getRuntime(), 16));
} | @JRubyMethod(name = STR) RubyString function() { return getBytes(new RubyFixnum(getRuntime(), 16)); } | /**
* Get the 16 bytes representing the decimal128 from the buffer.
*
* @author Emily Stolfo
* @since 2016.03.24
* @version 4.1.0
*/ | Get the 16 bytes representing the decimal128 from the buffer | getDecimal128Bytes | {
"repo_name": "estolfo/bson-ruby",
"path": "src/main/org/bson/ByteBuf.java",
"license": "apache-2.0",
"size": 14467
} | [
"org.jruby.RubyFixnum",
"org.jruby.RubyString",
"org.jruby.anno.JRubyMethod"
] | import org.jruby.RubyFixnum; import org.jruby.RubyString; import org.jruby.anno.JRubyMethod; | import org.jruby.*; import org.jruby.anno.*; | [
"org.jruby",
"org.jruby.anno"
] | org.jruby; org.jruby.anno; | 35,607 |
default AdvancedZendeskEndpointConsumerBuilder exchangePattern(
ExchangePattern exchangePattern) {
setProperty("exchangePattern", exchangePattern);
return this;
} | default AdvancedZendeskEndpointConsumerBuilder exchangePattern( ExchangePattern exchangePattern) { setProperty(STR, exchangePattern); return this; } | /**
* Sets the exchange pattern when the consumer creates an exchange.
*
* The option is a: <code>org.apache.camel.ExchangePattern</code> type.
*
* Group: consumer (advanced)
*/ | Sets the exchange pattern when the consumer creates an exchange. The option is a: <code>org.apache.camel.ExchangePattern</code> type. Group: consumer (advanced) | exchangePattern | {
"repo_name": "Fabryprog/camel",
"path": "core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/ZendeskEndpointBuilderFactory.java",
"license": "apache-2.0",
"size": 22205
} | [
"org.apache.camel.ExchangePattern"
] | import org.apache.camel.ExchangePattern; | import org.apache.camel.*; | [
"org.apache.camel"
] | org.apache.camel; | 1,234,351 |
public static void injectBlock(int id, String mod, String name, Block block) {
injectBlock(id, new ResourceLocation(mod, name), block);
} | static void function(int id, String mod, String name, Block block) { injectBlock(id, new ResourceLocation(mod, name), block); } | /**
* Registers a block in the block registry.
* <p>
* Is like registerBlock but does not perform any blockstate initialisation.
*
* @param id The ID of the block.
* @param mod The domain used for this mod. eg. "minecraft:stone" has the domain "minecraft"
* @param name The name to register the block as
* @param block The block to add
*/ | Registers a block in the block registry. Is like registerBlock but does not perform any blockstate initialisation | injectBlock | {
"repo_name": "BlazeLoader/BlazeLoader",
"path": "src/main/com/blazeloader/api/block/ApiBlock.java",
"license": "bsd-2-clause",
"size": 12935
} | [
"net.minecraft.block.Block",
"net.minecraft.util.ResourceLocation"
] | import net.minecraft.block.Block; import net.minecraft.util.ResourceLocation; | import net.minecraft.block.*; import net.minecraft.util.*; | [
"net.minecraft.block",
"net.minecraft.util"
] | net.minecraft.block; net.minecraft.util; | 1,498,902 |
public void mousePressed( MouseEvent me){
int x = me.getX();
int y = me.getY();
Enumeration<Finger> cursorList = Simulation.cursorList.elements();
while (cursorList.hasMoreElements()){
Finger cursor = cursorList.nextElement();
Point point = cursor.getPosition();
if (point.distance(x, y) < SMT.touch_radius){
int selCur = -1;
if (selectedCursor != null)
selCur = selectedCursor.sessionID;
if ((me.isShiftDown() || me.getButton() == PConstants.RIGHT)
&& selCur != cursor.sessionID){
stickyCursors.removeElement(cursor.sessionID);
if (jointCursors.contains(cursor.sessionID))
jointCursors.removeElement(cursor.sessionID);
sim.removeCursor(cursor);
selectedCursor = null;
return;
}
else if (me.isControlDown() || me.getButton() == PConstants.CENTER){
if (jointCursors.contains(cursor.sessionID))
jointCursors.removeElement(cursor.sessionID);
else
jointCursors.addElement(cursor.sessionID);
return;
}
else {
selectedCursor = cursor;
sim.updateCursor(selectedCursor, x, y);
sim.cursorMessage(selectedCursor);
return;
}
}
}
if (me.isControlDown() || me.getButton() == PConstants.CENTER){
return;
}
if (sim.contains(new Point(x, y))){
selectedCursor = sim.addCursor(x, y);
sim.cursorMessage(selectedCursor);
if (me.isShiftDown() || me.getButton() == PConstants.RIGHT){
stickyCursors.addElement(selectedCursor.sessionID);
}
return;
}
selectedCursor = null;
} | void function( MouseEvent me){ int x = me.getX(); int y = me.getY(); Enumeration<Finger> cursorList = Simulation.cursorList.elements(); while (cursorList.hasMoreElements()){ Finger cursor = cursorList.nextElement(); Point point = cursor.getPosition(); if (point.distance(x, y) < SMT.touch_radius){ int selCur = -1; if (selectedCursor != null) selCur = selectedCursor.sessionID; if ((me.isShiftDown() me.getButton() == PConstants.RIGHT) && selCur != cursor.sessionID){ stickyCursors.removeElement(cursor.sessionID); if (jointCursors.contains(cursor.sessionID)) jointCursors.removeElement(cursor.sessionID); sim.removeCursor(cursor); selectedCursor = null; return; } else if (me.isControlDown() me.getButton() == PConstants.CENTER){ if (jointCursors.contains(cursor.sessionID)) jointCursors.removeElement(cursor.sessionID); else jointCursors.addElement(cursor.sessionID); return; } else { selectedCursor = cursor; sim.updateCursor(selectedCursor, x, y); sim.cursorMessage(selectedCursor); return; } } } if (me.isControlDown() me.getButton() == PConstants.CENTER){ return; } if (sim.contains(new Point(x, y))){ selectedCursor = sim.addCursor(x, y); sim.cursorMessage(selectedCursor); if (me.isShiftDown() me.getButton() == PConstants.RIGHT){ stickyCursors.addElement(selectedCursor.sessionID); } return; } selectedCursor = null; } | /**
* Adds a cursor to the table state
*
* @param me MouseEvent - The mouse pressed event
*/ | Adds a cursor to the table state | mousePressed | {
"repo_name": "vialab/SMT",
"path": "src/vialab/SMT/MouseToTUIO.java",
"license": "gpl-3.0",
"size": 8079
} | [
"java.awt.Point",
"java.util.Enumeration"
] | import java.awt.Point; import java.util.Enumeration; | import java.awt.*; import java.util.*; | [
"java.awt",
"java.util"
] | java.awt; java.util; | 1,762,578 |
public void emitWithGravity (View emitter, int gravity, int particlesPerSecond) {
// Setup emitter
configureEmitter(emitter, gravity);
startEmitting(particlesPerSecond);
} | void function (View emitter, int gravity, int particlesPerSecond) { configureEmitter(emitter, gravity); startEmitting(particlesPerSecond); } | /**
* Starts emitting particles from a specific view. If at some point the number goes over the amount of particles availabe on create
* no new particles will be created
*
* @param emitter View from which center the particles will be emited
* @param gravity Which position among the view the emission takes place
* @param particlesPerSecond Number of particles per second that will be emited (evenly distributed)
*/ | Starts emitting particles from a specific view. If at some point the number goes over the amount of particles availabe on create no new particles will be created | emitWithGravity | {
"repo_name": "plattysoft/Leonids",
"path": "LeonidsLib/src/main/java/com/plattysoft/leonids/ParticleSystem.java",
"license": "apache-2.0",
"size": 27405
} | [
"android.view.View"
] | import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 2,519,487 |
public static boolean hasColorInNbt(ItemStack stack) {
return NbtDataUtil.hasColorFromNBT(stack);
} | static boolean function(ItemStack stack) { return NbtDataUtil.hasColorFromNBT(stack); } | /**
* N.B This differs from {@link #hasColor(ItemStack)} because leather armor
* has a color even without a set color. This returns {@code true} only if
* there is a color set on the display tag.
*/ | N.B This differs from <code>#hasColor(ItemStack)</code> because leather armor has a color even without a set color. This returns true only if there is a color set on the display tag | hasColorInNbt | {
"repo_name": "kashike/SpongeCommon",
"path": "src/main/java/org/spongepowered/common/util/ColorUtil.java",
"license": "mit",
"size": 4527
} | [
"net.minecraft.item.ItemStack",
"org.spongepowered.common.data.util.NbtDataUtil"
] | import net.minecraft.item.ItemStack; import org.spongepowered.common.data.util.NbtDataUtil; | import net.minecraft.item.*; import org.spongepowered.common.data.util.*; | [
"net.minecraft.item",
"org.spongepowered.common"
] | net.minecraft.item; org.spongepowered.common; | 2,017,988 |
private boolean isInLoggingScope(final LogGroup logGroup, final LogLevel logLevel) {
if (LogGroup.getCurrentLogGroup().isInGroup(logGroup)
&& logLevel.getLevel() <= Integer.parseInt(Environment.get(Parameter.LOG_LEVEL))) {
return true;
}
return false;
} | boolean function(final LogGroup logGroup, final LogLevel logLevel) { if (LogGroup.getCurrentLogGroup().isInGroup(logGroup) && logLevel.getLevel() <= Integer.parseInt(Environment.get(Parameter.LOG_LEVEL))) { return true; } return false; } | /**
* Check if level of logging is correct.
* @param logGroup logging group
* @param logLevel level of logging
* @return true if in scope, otherwise false
*/ | Check if level of logging is correct | isInLoggingScope | {
"repo_name": "mrautio/xqqunit",
"path": "src/main/org/xqqunit/logging/LogPrintStream.java",
"license": "bsd-2-clause",
"size": 2726
} | [
"org.xqqunit.system.Environment",
"org.xqqunit.system.Parameter"
] | import org.xqqunit.system.Environment; import org.xqqunit.system.Parameter; | import org.xqqunit.system.*; | [
"org.xqqunit.system"
] | org.xqqunit.system; | 1,265,164 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.