repo stringlengths 7 59 | path stringlengths 17 234 | func_name stringlengths 3 117 | original_string stringlengths 63 281k | language stringclasses 1
value | code stringlengths 63 281k | code_tokens listlengths 20 16.3k | docstring stringlengths 1 34k | docstring_tokens listlengths 1 3.44k | sha stringlengths 40 40 | url stringlengths 106 339 | partition stringclasses 3
values | summary stringlengths 3 248 | output stringlengths 142 281k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
OpenLiberty/open-liberty | dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/webapp/UIComponentClassicTagBase.java | UIComponentClassicTagBase.removeFormerChildren | @SuppressWarnings("unchecked")
private void removeFormerChildren(UIComponent component)
{
List<String> formerChildIds = (List<String>)component.getAttributes().get(FORMER_CHILD_IDS_SET_ATTR);
if (formerChildIds != null)
{
for (String childId : formerChildIds)
{
... | java | @SuppressWarnings("unchecked")
private void removeFormerChildren(UIComponent component)
{
List<String> formerChildIds = (List<String>)component.getAttributes().get(FORMER_CHILD_IDS_SET_ATTR);
if (formerChildIds != null)
{
for (String childId : formerChildIds)
{
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"removeFormerChildren",
"(",
"UIComponent",
"component",
")",
"{",
"List",
"<",
"String",
">",
"formerChildIds",
"=",
"(",
"List",
"<",
"String",
">",
")",
"component",
".",
"getAttributes",
... | Remove any child components of the associated components which do not have corresponding tags as children of this
tag. This only happens when a view is being re-rendered and there are components in the view tree which don't
have corresponding JSP tags. Wrapping JSF tags in JSTL "c:if" statements is one way this can hap... | [
"Remove",
"any",
"child",
"components",
"of",
"the",
"associated",
"components",
"which",
"do",
"not",
"have",
"corresponding",
"tags",
"as",
"children",
"of",
"this",
"tag",
".",
"This",
"only",
"happens",
"when",
"a",
"view",
"is",
"being",
"re",
"-",
"r... | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/webapp/UIComponentClassicTagBase.java#L995-L1028 | train | Removes the former children from the component. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
private void removeFormerChildren(UIComponent component)
{
List<String> formerChildIds = (List<String>)component.getAttributes().get(FORMER_CHILD_IDS_SET_ATTR);
if (formerChildIds != null)
{
... |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/metadata/MetadataManager.java | MetadataManager.loadProfile | public void loadProfile(Object key)
{
if (!isEnablePerThreadChanges())
{
throw new MetadataException("Can not load profile with disabled per thread mode");
}
DescriptorRepository rep = (DescriptorRepository) metadataProfiles.get(key);
if (rep == null)
... | java | public void loadProfile(Object key)
{
if (!isEnablePerThreadChanges())
{
throw new MetadataException("Can not load profile with disabled per thread mode");
}
DescriptorRepository rep = (DescriptorRepository) metadataProfiles.get(key);
if (rep == null)
... | [
"public",
"void",
"loadProfile",
"(",
"Object",
"key",
")",
"{",
"if",
"(",
"!",
"isEnablePerThreadChanges",
"(",
")",
")",
"{",
"throw",
"new",
"MetadataException",
"(",
"\"Can not load profile with disabled per thread mode\"",
")",
";",
"}",
"DescriptorRepository",
... | Load the given metadata profile for the current thread. | [
"Load",
"the",
"given",
"metadata",
"profile",
"for",
"the",
"current",
"thread",
"."
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/MetadataManager.java#L501-L514 | train | Loads a single profile from the metadata repository. | Of course, here is the Java code you requested:
```java
public void loadProfile(Object key)
{
if (!isEnablePerThreadChanges())
{
throw new MetadataException("Can not load profile with disabled per thread mode");
}
DescriptorRepository rep = (DescriptorRepository) m... |
thymeleaf/thymeleaf | src/main/java/org/thymeleaf/messageresolver/StandardMessageResolutionUtils.java | StandardMessageResolutionUtils.isFormatCandidate | private static boolean isFormatCandidate(final String message) {
char c;
int n = message.length();
while (n-- != 0) {
c = message.charAt(n);
if (c == '}' || c == '\'') {
return true;
}
}
return false;
} | java | private static boolean isFormatCandidate(final String message) {
char c;
int n = message.length();
while (n-- != 0) {
c = message.charAt(n);
if (c == '}' || c == '\'') {
return true;
}
}
return false;
} | [
"private",
"static",
"boolean",
"isFormatCandidate",
"(",
"final",
"String",
"message",
")",
"{",
"char",
"c",
";",
"int",
"n",
"=",
"message",
".",
"length",
"(",
")",
";",
"while",
"(",
"n",
"--",
"!=",
"0",
")",
"{",
"c",
"=",
"message",
".",
"c... | /*
This will allow us determine whether a message might actually contain parameter placeholders. | [
"/",
"*",
"This",
"will",
"allow",
"us",
"determine",
"whether",
"a",
"message",
"might",
"actually",
"contain",
"parameter",
"placeholders",
"."
] | 2b0e6d6d7571fbe638904b5fd222fc9e77188879 | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/messageresolver/StandardMessageResolutionUtils.java#L265-L275 | train | is format candidate? | Of course, here is the Java code you requested:
```java
private static boolean isFormatCandidate(final String message) {
char c;
int n = message.length();
while (n-- != 0) {
c = message.charAt(n);
if (c == '}' || c == '\'') {
return true;
}
... |
paymill/paymill-java | src/main/java/com/paymill/services/TransactionService.java | TransactionService.createWithPaymentAndClient | public Transaction createWithPaymentAndClient( String paymentId, String clientId, Integer amount, String currency ) {
return this.createWithPaymentAndClient( paymentId, clientId, amount, currency, null );
} | java | public Transaction createWithPaymentAndClient( String paymentId, String clientId, Integer amount, String currency ) {
return this.createWithPaymentAndClient( paymentId, clientId, amount, currency, null );
} | [
"public",
"Transaction",
"createWithPaymentAndClient",
"(",
"String",
"paymentId",
",",
"String",
"clientId",
",",
"Integer",
"amount",
",",
"String",
"currency",
")",
"{",
"return",
"this",
".",
"createWithPaymentAndClient",
"(",
"paymentId",
",",
"clientId",
",",
... | Executes a {@link Transaction} with {@link Payment} for the given amount in the given currency.
@param paymentId
The Id of a PAYMILL {@link Payment} representing credit card or direct debit.
@param clientId
The Id of a PAYMILL {@link Client} which have to be charged.
@param amount
Amount (in cents) which will be charge... | [
"Executes",
"a",
"{"
] | 17281a0d4376c76f1711af9f09bfc138c90ba65a | https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/TransactionService.java#L274-L276 | train | Create a new transaction with a payment id and client id | Of course, here is the Java code you requested:
```java
public Transaction createWithPaymentAndClient( String paymentId, String clientId, Integer amount, String currency ) {
return this.createWithPaymentAndClient( paymentId, clientId, amount, currency, null );
}
```
Hope this helps! |
buschmais/jqa-maven3-plugin | src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java | MavenModelScannerPlugin.addActivation | private void addActivation(MavenProfileDescriptor mavenProfileDescriptor, Activation activation, Store store) {
if (null == activation) {
return;
}
MavenProfileActivationDescriptor profileActivationDescriptor = store.create(MavenProfileActivationDescriptor.class);
mavenProfil... | java | private void addActivation(MavenProfileDescriptor mavenProfileDescriptor, Activation activation, Store store) {
if (null == activation) {
return;
}
MavenProfileActivationDescriptor profileActivationDescriptor = store.create(MavenProfileActivationDescriptor.class);
mavenProfil... | [
"private",
"void",
"addActivation",
"(",
"MavenProfileDescriptor",
"mavenProfileDescriptor",
",",
"Activation",
"activation",
",",
"Store",
"store",
")",
"{",
"if",
"(",
"null",
"==",
"activation",
")",
"{",
"return",
";",
"}",
"MavenProfileActivationDescriptor",
"p... | Adds activation information for the given profile.
@param mavenProfileDescriptor
The profile descriptor.
@param activation
The activation information.
@param store
The database. | [
"Adds",
"activation",
"information",
"for",
"the",
"given",
"profile",
"."
] | 6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f | https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java#L191-L224 | train | Add Activation to profile descriptor. | Of course, here is the Java code you requested:
```java
private void addActivation(MavenProfileDescriptor mavenProfileDescriptor, Activation activation, Store store) {
if (null == activation) {
return;
}
MavenProfileActivationDescriptor profileActivationDescriptor = store.create(Mav... |
facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/StatisticsCollector.java | StatisticsCollector.populateSaving | public void populateSaving(RaidNodeMetrics metrics) {
if (lastRaidStatistics == null) {
return;
}
long saving = 0;
for (Codec codec : Codec.getCodecs()) {
String code = codec.id;
long s = lastRaidStatistics.get(code).getSaving(conf);
if (s > 0) {
metrics.savingForCode.get... | java | public void populateSaving(RaidNodeMetrics metrics) {
if (lastRaidStatistics == null) {
return;
}
long saving = 0;
for (Codec codec : Codec.getCodecs()) {
String code = codec.id;
long s = lastRaidStatistics.get(code).getSaving(conf);
if (s > 0) {
metrics.savingForCode.get... | [
"public",
"void",
"populateSaving",
"(",
"RaidNodeMetrics",
"metrics",
")",
"{",
"if",
"(",
"lastRaidStatistics",
"==",
"null",
")",
"{",
"return",
";",
"}",
"long",
"saving",
"=",
"0",
";",
"for",
"(",
"Codec",
"codec",
":",
"Codec",
".",
"getCodecs",
"... | Populate RAID savings by code and total.
@return Number of bytes saved due to RAID | [
"Populate",
"RAID",
"savings",
"by",
"code",
"and",
"total",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/StatisticsCollector.java#L223-L239 | train | Populates the saving statistics. | Of course, here is the Java code you requested:
```java
public void populateSaving(RaidNodeMetrics metrics) {
if (lastRaidStatistics == null) {
return;
}
long saving = 0;
for (Codec codec : Codec.getCodecs()) {
String code = codec.id;
long s = lastRaidStatistics.get(code).getSaving(co... |
project-ncl/pnc | build-coordinator/src/main/java/org/jboss/pnc/coordinator/builder/BuildQueue.java | BuildQueue.executeNewReadyTasks | public synchronized void executeNewReadyTasks() {
List<BuildTask> newReadyTasks = extractReadyTasks();
log.debug("starting new ready tasks. New ready tasks: {}", newReadyTasks);
readyTasks.addAll(newReadyTasks);
} | java | public synchronized void executeNewReadyTasks() {
List<BuildTask> newReadyTasks = extractReadyTasks();
log.debug("starting new ready tasks. New ready tasks: {}", newReadyTasks);
readyTasks.addAll(newReadyTasks);
} | [
"public",
"synchronized",
"void",
"executeNewReadyTasks",
"(",
")",
"{",
"List",
"<",
"BuildTask",
">",
"newReadyTasks",
"=",
"extractReadyTasks",
"(",
")",
";",
"log",
".",
"debug",
"(",
"\"starting new ready tasks. New ready tasks: {}\"",
",",
"newReadyTasks",
")",
... | Trigger searching for ready tasks in the waiting queue.
This method should be invoked if one task has finished and there's a possibility that other tasks became ready to be built. | [
"Trigger",
"searching",
"for",
"ready",
"tasks",
"in",
"the",
"waiting",
"queue",
".",
"This",
"method",
"should",
"be",
"invoked",
"if",
"one",
"task",
"has",
"finished",
"and",
"there",
"s",
"a",
"possibility",
"that",
"other",
"tasks",
"became",
"ready",
... | 85743ca59d14cdf750d6daa8bd0a0a8be390a796 | https://github.com/project-ncl/pnc/blob/85743ca59d14cdf750d6daa8bd0a0a8be390a796/build-coordinator/src/main/java/org/jboss/pnc/coordinator/builder/BuildQueue.java#L172-L176 | valid | Execute the new ready tasks. | Of course, here is the Java code you requested:
```java
public synchronized void executeNewReadyTasks() {
List<BuildTask> newReadyTasks = extractReadyTasks();
log.debug("starting new ready tasks. New ready tasks: {}", newReadyTasks);
readyTasks.addAll(newReadyTasks);
}
```
Hope this helps! |
google/closure-compiler | src/com/google/javascript/jscomp/NodeUtil.java | NodeUtil.getRootOfQualifiedName | static Node getRootOfQualifiedName(Node qName) {
for (Node current = qName; true; current = current.getFirstChild()) {
if (current.isName() || current.isThis() || current.isSuper()) {
return current;
}
checkState(current.isGetProp(), "Not a getprop node: ", current);
}
} | java | static Node getRootOfQualifiedName(Node qName) {
for (Node current = qName; true; current = current.getFirstChild()) {
if (current.isName() || current.isThis() || current.isSuper()) {
return current;
}
checkState(current.isGetProp(), "Not a getprop node: ", current);
}
} | [
"static",
"Node",
"getRootOfQualifiedName",
"(",
"Node",
"qName",
")",
"{",
"for",
"(",
"Node",
"current",
"=",
"qName",
";",
"true",
";",
"current",
"=",
"current",
".",
"getFirstChild",
"(",
")",
")",
"{",
"if",
"(",
"current",
".",
"isName",
"(",
")... | Gets the root node of a qualified name. Must be either NAME, THIS or SUPER. | [
"Gets",
"the",
"root",
"node",
"of",
"a",
"qualified",
"name",
".",
"Must",
"be",
"either",
"NAME",
"THIS",
"or",
"SUPER",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/NodeUtil.java#L4106-L4113 | train | Get the root of a qualified name node. | Of course, here is the Java code you requested:
```java
static Node getRootOfQualifiedName(Node qName) {
for (Node current = qName; true; current = current.getFirstChild()) {
if (current.isName() || current.isThis() || current.isSuper()) {
return current;
}
checkState(current.isGetProp(),... |
facebookarchive/hadoop-20 | src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobInProgress.java | CoronaJobInProgress.initTasks | public void initTasks() throws IOException {
// log job info
jobHistory.logSubmitted(jobFile.toString(), this.startTime, this.jobTrackerId);
// log the job priority
JobClient.RawSplit[] splits = null;
splits = JobClient.getAndRemoveCachedSplits(jobId);
if (splits == null) {
FileSystem fs =... | java | public void initTasks() throws IOException {
// log job info
jobHistory.logSubmitted(jobFile.toString(), this.startTime, this.jobTrackerId);
// log the job priority
JobClient.RawSplit[] splits = null;
splits = JobClient.getAndRemoveCachedSplits(jobId);
if (splits == null) {
FileSystem fs =... | [
"public",
"void",
"initTasks",
"(",
")",
"throws",
"IOException",
"{",
"// log job info",
"jobHistory",
".",
"logSubmitted",
"(",
"jobFile",
".",
"toString",
"(",
")",
",",
"this",
".",
"startTime",
",",
"this",
".",
"jobTrackerId",
")",
";",
"// log the job p... | Read input splits and create a map per split. | [
"Read",
"input",
"splits",
"and",
"create",
"a",
"map",
"per",
"split",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/mapred/CoronaJobInProgress.java#L520-L540 | train | Initialize the tasks from the job file. | Of course, here is the Java code you requested:
```java
public void initTasks() throws IOException {
// log job info
jobHistory.logSubmitted(jobFile.toString(), this.startTime, this.jobTrackerId);
// log the job priority
JobClient.RawSplit[] splits = null;
splits = JobClient.getAndRemoveCachedSplit... |
fuinorg/utils4swing | src/main/java/org/fuin/utils4swing/common/Utils4Swing.java | Utils4Swing.showGlassPane | public static GlassPaneState showGlassPane(final Component source) {
final Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager()
.getFocusOwner();
final RootPaneContainer rootPaneContainer = findRootPaneContainer(source);
final Component glassPane = roo... | java | public static GlassPaneState showGlassPane(final Component source) {
final Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager()
.getFocusOwner();
final RootPaneContainer rootPaneContainer = findRootPaneContainer(source);
final Component glassPane = roo... | [
"public",
"static",
"GlassPaneState",
"showGlassPane",
"(",
"final",
"Component",
"source",
")",
"{",
"final",
"Component",
"focusOwner",
"=",
"KeyboardFocusManager",
".",
"getCurrentKeyboardFocusManager",
"(",
")",
".",
"getFocusOwner",
"(",
")",
";",
"final",
"Roo... | Makes the glass pane visible and focused and stores the saves the current
state.
@param source
Component to use when looking for the root pane container.
@return State of the UI before the glasspane was visible. | [
"Makes",
"the",
"glass",
"pane",
"visible",
"and",
"focused",
"and",
"stores",
"the",
"saves",
"the",
"current",
"state",
"."
] | 560fb69eac182e3473de9679c3c15433e524ef6b | https://github.com/fuinorg/utils4swing/blob/560fb69eac182e3473de9679c3c15433e524ef6b/src/main/java/org/fuin/utils4swing/common/Utils4Swing.java#L207-L220 | train | Show the glass pane. | Of course, here is the Java code you requested:
```java
public static GlassPaneState showGlassPane(final Component source) {
final Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager()
.getFocusOwner();
final RootPaneContainer rootPaneContainer = findRootPaneCo... |
logic-ng/LogicNG | src/main/java/org/logicng/formulas/FormulaFactory.java | FormulaFactory.clear | public void clear() {
this.posLiterals = new HashMap<>();
this.negLiterals = new HashMap<>();
this.generatedVariables = new HashSet<>();
this.nots = new HashMap<>();
this.implications = new HashMap<>();
this.equivalences = new HashMap<>();
this.ands2 = new HashMap<>();
this.ands3 = new H... | java | public void clear() {
this.posLiterals = new HashMap<>();
this.negLiterals = new HashMap<>();
this.generatedVariables = new HashSet<>();
this.nots = new HashMap<>();
this.implications = new HashMap<>();
this.equivalences = new HashMap<>();
this.ands2 = new HashMap<>();
this.ands3 = new H... | [
"public",
"void",
"clear",
"(",
")",
"{",
"this",
".",
"posLiterals",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"this",
".",
"negLiterals",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"this",
".",
"generatedVariables",
"=",
"new",
"HashSet",
"<>",
... | Removes all formulas from the factory cache. | [
"Removes",
"all",
"formulas",
"from",
"the",
"factory",
"cache",
"."
] | bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/FormulaFactory.java#L174-L193 | train | Clear the contents of this object. | Of course, here is the Java code you requested:
```java
public void clear() {
this.posLiterals = new HashMap<>();
this.negLiterals = new HashMap<>();
this.generatedVariables = new HashSet<>();
this.nots = new HashMap<>();
this.implications = new HashMap<>();
this.equivalences = new HashMap<>();... |
bit3/jsass | src/main/java/io/bit3/jsass/context/ImportStack.java | ImportStack.register | public int register(Import importSource) {
int id = registry.size() + 1;
registry.put(id, importSource);
return id;
} | java | public int register(Import importSource) {
int id = registry.size() + 1;
registry.put(id, importSource);
return id;
} | [
"public",
"int",
"register",
"(",
"Import",
"importSource",
")",
"{",
"int",
"id",
"=",
"registry",
".",
"size",
"(",
")",
"+",
"1",
";",
"registry",
".",
"put",
"(",
"id",
",",
"importSource",
")",
";",
"return",
"id",
";",
"}"
] | Register a new import, return the registration ID. | [
"Register",
"a",
"new",
"import",
"return",
"the",
"registration",
"ID",
"."
] | fba91d5cb1eb507c7cfde5a261e04b1d328cb1ef | https://github.com/bit3/jsass/blob/fba91d5cb1eb507c7cfde5a261e04b1d328cb1ef/src/main/java/io/bit3/jsass/context/ImportStack.java#L28-L32 | train | Register an import source. | Of course, here is the Java code you requested:
```java
public int register(Import importSource) {
int id = registry.size() + 1;
registry.put(id, importSource);
return id;
}
```
Hope this helps! |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/JSSEProviderFactory.java | JSSEProviderFactory.getDefaultSSLServerSocketFactory | public static String getDefaultSSLServerSocketFactory() {
if (defaultSSLServerSocketFactory == null) {
defaultSSLServerSocketFactory = AccessController.doPrivileged(new PrivilegedAction<String>() {
@Override
public String run() {
return Security.ge... | java | public static String getDefaultSSLServerSocketFactory() {
if (defaultSSLServerSocketFactory == null) {
defaultSSLServerSocketFactory = AccessController.doPrivileged(new PrivilegedAction<String>() {
@Override
public String run() {
return Security.ge... | [
"public",
"static",
"String",
"getDefaultSSLServerSocketFactory",
"(",
")",
"{",
"if",
"(",
"defaultSSLServerSocketFactory",
"==",
"null",
")",
"{",
"defaultSSLServerSocketFactory",
"=",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"Stri... | Get the default SSLServerSocketFactory class from Security.
@return String | [
"Get",
"the",
"default",
"SSLServerSocketFactory",
"class",
"from",
"Security",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/JSSEProviderFactory.java#L221-L232 | train | Get the default SSL Server Socket Factory. | Of course, here is the Java code you requested:
```java
public static String getDefaultSSLServerSocketFactory() {
if (defaultSSLServerSocketFactory == null) {
defaultSSLServerSocketFactory = AccessController.doPrivileged(new PrivilegedAction<String>() {
@Override
pub... |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/Unmarshaller.java | Unmarshaller.unmarshalKeyAndParentKey | private void unmarshalKeyAndParentKey() throws Throwable {
KeyMetadata keyMetadata = entityMetadata.getKeyMetadata();
if (keyMetadata != null) {
MethodHandle writeMethod = keyMetadata.getWriteMethod();
Key entityKey = (Key) nativeEntity.getKey();
writeMethod.invoke(entity, new DefaultDatastore... | java | private void unmarshalKeyAndParentKey() throws Throwable {
KeyMetadata keyMetadata = entityMetadata.getKeyMetadata();
if (keyMetadata != null) {
MethodHandle writeMethod = keyMetadata.getWriteMethod();
Key entityKey = (Key) nativeEntity.getKey();
writeMethod.invoke(entity, new DefaultDatastore... | [
"private",
"void",
"unmarshalKeyAndParentKey",
"(",
")",
"throws",
"Throwable",
"{",
"KeyMetadata",
"keyMetadata",
"=",
"entityMetadata",
".",
"getKeyMetadata",
"(",
")",
";",
"if",
"(",
"keyMetadata",
"!=",
"null",
")",
"{",
"MethodHandle",
"writeMethod",
"=",
... | Unamrshals the entity's key and parent key.
@throws Throwable
propagated | [
"Unamrshals",
"the",
"entity",
"s",
"key",
"and",
"parent",
"key",
"."
] | 96d4c6dce3a5009624f7112a398406914dd19165 | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/Unmarshaller.java#L182-L198 | train | Unmarshals the key and parent key. | Of course, here is the Java code you requested:
```java
private void unmarshalKeyAndParentKey() throws Throwable {
KeyMetadata keyMetadata = entityMetadata.getKeyMetadata();
if (keyMetadata != null) {
MethodHandle writeMethod = keyMetadata.getWriteMethod();
Key entityKey = (Key) nativeEntity.getKey... |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/MCWrapper.java | MCWrapper.markRRSLocalTransactionWrapperInUse | protected void markRRSLocalTransactionWrapperInUse() throws ResourceException {
final boolean isTracingEnabled = TraceComponent.isAnyTracingEnabled();
if (isTracingEnabled && tc.isEntryEnabled()) {
Tr.entry(this, tc, "markRRSLocalTransactionWrapperInUse");
}
if (state == S... | java | protected void markRRSLocalTransactionWrapperInUse() throws ResourceException {
final boolean isTracingEnabled = TraceComponent.isAnyTracingEnabled();
if (isTracingEnabled && tc.isEntryEnabled()) {
Tr.entry(this, tc, "markRRSLocalTransactionWrapperInUse");
}
if (state == S... | [
"protected",
"void",
"markRRSLocalTransactionWrapperInUse",
"(",
")",
"throws",
"ResourceException",
"{",
"final",
"boolean",
"isTracingEnabled",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"isTracingEnabled",
"&&",
"tc",
".",
"isEntry... | Called upon first use of the RRSLocalTransactionWrapper, as
determined by the wrapper itself. This method is used to
execute (and check) the appropriate state transitions. | [
"Called",
"upon",
"first",
"use",
"of",
"the",
"RRSLocalTransactionWrapper",
"as",
"determined",
"by",
"the",
"wrapper",
"itself",
".",
"This",
"method",
"is",
"used",
"to",
"execute",
"(",
"and",
"check",
")",
"the",
"appropriate",
"state",
"transitions",
"."... | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/MCWrapper.java#L1145-L1187 | train | Mark the RRSLocalTransactionWrapperInUse method. | Of course, here is the Java code you requested:
```java
protected void markRRSLocalTransactionWrapperInUse() throws ResourceException {
final boolean isTracingEnabled = TraceComponent.isAnyTracingEnabled();
if (isTracingEnabled && tc.isEntryEnabled()) {
Tr.entry(this, tc, "markRRSLocalTra... |
VoltDB/voltdb | src/frontend/org/voltdb/planner/ParsedColInfo.java | ParsedColInfo.asSchemaColumn | public SchemaColumn asSchemaColumn() {
String columnAlias = (m_alias == null) ? m_columnName : m_alias;
return new SchemaColumn(m_tableName, m_tableAlias,
m_columnName, columnAlias,
m_expression, m_differentiator);
} | java | public SchemaColumn asSchemaColumn() {
String columnAlias = (m_alias == null) ? m_columnName : m_alias;
return new SchemaColumn(m_tableName, m_tableAlias,
m_columnName, columnAlias,
m_expression, m_differentiator);
} | [
"public",
"SchemaColumn",
"asSchemaColumn",
"(",
")",
"{",
"String",
"columnAlias",
"=",
"(",
"m_alias",
"==",
"null",
")",
"?",
"m_columnName",
":",
"m_alias",
";",
"return",
"new",
"SchemaColumn",
"(",
"m_tableName",
",",
"m_tableAlias",
",",
"m_columnName",
... | Return this as an instance of SchemaColumn | [
"Return",
"this",
"as",
"an",
"instance",
"of",
"SchemaColumn"
] | 8afc1031e475835344b5497ea9e7203bc95475ac | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/planner/ParsedColInfo.java#L187-L192 | train | Returns the schema column as a SchemaColumn object. | Of course, here is the Java code you requested:
```java
public SchemaColumn asSchemaColumn() {
String columnAlias = (m_alias == null) ? m_columnName : m_alias;
return new SchemaColumn(m_tableName, m_tableAlias,
m_columnName, columnAlias,
m_expression, m_differentiator);
... |
landawn/AbacusUtil | src/com/landawn/abacus/util/HBaseExecutor.java | HBaseExecutor.toRowKeyString | static String toRowKeyString(byte[] bytes, int offset, int len) {
return Bytes.toString(bytes, offset, len);
} | java | static String toRowKeyString(byte[] bytes, int offset, int len) {
return Bytes.toString(bytes, offset, len);
} | [
"static",
"String",
"toRowKeyString",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"offset",
",",
"int",
"len",
")",
"{",
"return",
"Bytes",
".",
"toString",
"(",
"bytes",
",",
"offset",
",",
"len",
")",
";",
"}"
] | } | [
"}"
] | 544b7720175d15e9329f83dd22a8cc5fa4515e12 | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/HBaseExecutor.java#L1207-L1209 | train | Returns a string representation of the bytes in the row key format. | Of course, here is the Java code you requested:
```java
static String toRowKeyString(byte[] bytes, int offset, int len) {
return Bytes.toString(bytes, offset, len);
}
```
Hope this helps! |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/util/BrokerHelper.java | BrokerHelper.getCountQuery | public Query getCountQuery(Query aQuery)
{
if(aQuery instanceof QueryBySQL)
{
return getQueryBySqlCount((QueryBySQL) aQuery);
}
else if(aQuery instanceof ReportQueryByCriteria)
{
return getReportQueryByCriteriaCount((ReportQueryByCriteria) aQue... | java | public Query getCountQuery(Query aQuery)
{
if(aQuery instanceof QueryBySQL)
{
return getQueryBySqlCount((QueryBySQL) aQuery);
}
else if(aQuery instanceof ReportQueryByCriteria)
{
return getReportQueryByCriteriaCount((ReportQueryByCriteria) aQue... | [
"public",
"Query",
"getCountQuery",
"(",
"Query",
"aQuery",
")",
"{",
"if",
"(",
"aQuery",
"instanceof",
"QueryBySQL",
")",
"{",
"return",
"getQueryBySqlCount",
"(",
"(",
"QueryBySQL",
")",
"aQuery",
")",
";",
"}",
"else",
"if",
"(",
"aQuery",
"instanceof",
... | Build a Count-Query based on aQuery
@param aQuery
@return The count query | [
"Build",
"a",
"Count",
"-",
"Query",
"based",
"on",
"aQuery"
] | 9a544372f67ce965f662cdc71609dd03683c8f04 | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/util/BrokerHelper.java#L499-L513 | train | Gets the count query from another Query object. | Of course, here is the Java code you requested:
```java
public Query getCountQuery(Query aQuery)
{
if(aQuery instanceof QueryBySQL)
{
return getQueryBySqlCount((QueryBySQL) aQuery);
}
else if(aQuery instanceof ReportQueryByCriteria)
{
return g... |
f2prateek/dart | henson/src/main/java/dart/henson/Bundler.java | Bundler.put | public Bundler put(String key, CharSequence value) {
delegate.putCharSequence(key, value);
return this;
} | java | public Bundler put(String key, CharSequence value) {
delegate.putCharSequence(key, value);
return this;
} | [
"public",
"Bundler",
"put",
"(",
"String",
"key",
",",
"CharSequence",
"value",
")",
"{",
"delegate",
".",
"putCharSequence",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts a CharSequence value into the mapping of the underlying Bundle, replacing any existing
value for the given key. Either key or value may be null.
@param key a String, or null
@param value a CharSequence, or null
@return this bundler instance to chain method calls | [
"Inserts",
"a",
"CharSequence",
"value",
"into",
"the",
"mapping",
"of",
"the",
"underlying",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | 7163b1b148e5141817975ae7dad99d58a8589aeb | https://github.com/f2prateek/dart/blob/7163b1b148e5141817975ae7dad99d58a8589aeb/henson/src/main/java/dart/henson/Bundler.java#L283-L286 | train | Puts a CharSequence value into the mapping of the underlying Bundle replacing any existing value for the given key. Either key or value may be null. | Of course, here is the Java code you requested:
```java
public Bundler put(String key, CharSequence value) {
delegate.putCharSequence(key, value);
return this;
}
```
Hope this helps! |
aws/aws-sdk-java | aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/transform/SetLoadBasedAutoScalingRequestMarshaller.java | SetLoadBasedAutoScalingRequestMarshaller.marshall | public void marshall(SetLoadBasedAutoScalingRequest setLoadBasedAutoScalingRequest, ProtocolMarshaller protocolMarshaller) {
if (setLoadBasedAutoScalingRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshalle... | java | public void marshall(SetLoadBasedAutoScalingRequest setLoadBasedAutoScalingRequest, ProtocolMarshaller protocolMarshaller) {
if (setLoadBasedAutoScalingRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshalle... | [
"public",
"void",
"marshall",
"(",
"SetLoadBasedAutoScalingRequest",
"setLoadBasedAutoScalingRequest",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"setLoadBasedAutoScalingRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/transform/SetLoadBasedAutoScalingRequestMarshaller.java#L48-L62 | train | marshalls the given request to the JSON object. | Of course, here is the Java code you requested:
```java
public void marshall(SetLoadBasedAutoScalingRequest setLoadBasedAutoScalingRequest, ProtocolMarshaller protocolMarshaller) {
if (setLoadBasedAutoScalingRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)"... |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/UtilIO.java | UtilIO.path | public static String path( String path ) {
String pathToBase = getPathToBase();
if( pathToBase == null )
return path;
return new File(pathToBase,path).getAbsolutePath();
} | java | public static String path( String path ) {
String pathToBase = getPathToBase();
if( pathToBase == null )
return path;
return new File(pathToBase,path).getAbsolutePath();
} | [
"public",
"static",
"String",
"path",
"(",
"String",
"path",
")",
"{",
"String",
"pathToBase",
"=",
"getPathToBase",
"(",
")",
";",
"if",
"(",
"pathToBase",
"==",
"null",
")",
"return",
"path",
";",
"return",
"new",
"File",
"(",
"pathToBase",
",",
"path"... | Searches for the root BoofCV directory and returns an absolute path from it.
@param path File path relative to root directory
@return Absolute path to file | [
"Searches",
"for",
"the",
"root",
"BoofCV",
"directory",
"and",
"returns",
"an",
"absolute",
"path",
"from",
"it",
"."
] | f01c0243da0ec086285ee722183804d5923bc3ac | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/UtilIO.java#L194-L199 | train | Returns the absolute path of the given path. | Of course, here is the Java code you requested:
```java
public static String path( String path ) {
String pathToBase = getPathToBase();
if( pathToBase == null )
return path;
return new File(pathToBase,path).getAbsolutePath();
}
```
Hope this helps! |
Waikato/moa | moa/src/main/java/moa/gui/visualization/PointPanel.java | PointPanel.paintComponent | @Override
protected void paintComponent(Graphics g) {
if (type == TYPE_PLAIN) {
point.updateWeight(RunVisualizer.getCurrentTimestamp(), decayRate);
if (point.weight() < decayThreshold) {
getParent().remove(this);
return;
}
}
Color color = getCo... | java | @Override
protected void paintComponent(Graphics g) {
if (type == TYPE_PLAIN) {
point.updateWeight(RunVisualizer.getCurrentTimestamp(), decayRate);
if (point.weight() < decayThreshold) {
getParent().remove(this);
return;
}
}
Color color = getCo... | [
"@",
"Override",
"protected",
"void",
"paintComponent",
"(",
"Graphics",
"g",
")",
"{",
"if",
"(",
"type",
"==",
"TYPE_PLAIN",
")",
"{",
"point",
".",
"updateWeight",
"(",
"RunVisualizer",
".",
"getCurrentTimestamp",
"(",
")",
",",
"decayRate",
")",
";",
"... | </editor-fold>//GEN-END:initComponents | [
"<",
"/",
"editor",
"-",
"fold",
">",
"//",
"GEN",
"-",
"END",
":",
"initComponents"
] | 395982e5100bfe75a3a4d26115462ce2cc74cbb0 | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/gui/visualization/PointPanel.java#L138-L180 | train | Override paintComponent to paint the image. | Of course, here is the Java code you requested:
```java
@Override
protected void paintComponent(Graphics g) {
if (type == TYPE_PLAIN) {
point.updateWeight(RunVisualizer.getCurrentTimestamp(), decayRate);
if (point.weight() < decayThreshold) {
getParent().remove(this);
... |
cdapio/tephra | tephra-hbase-compat-1.1/src/main/java/co/cask/tephra/hbase11/coprocessor/TransactionProcessor.java | TransactionProcessor.projectFamilyDeletes | private Get projectFamilyDeletes(Get get) {
for (Map.Entry<byte[], NavigableSet<byte[]>> entry : get.getFamilyMap().entrySet()) {
NavigableSet<byte[]> columns = entry.getValue();
// wildcard scans will automatically include the delete marker, so only need to add it when we have
// explicit columns... | java | private Get projectFamilyDeletes(Get get) {
for (Map.Entry<byte[], NavigableSet<byte[]>> entry : get.getFamilyMap().entrySet()) {
NavigableSet<byte[]> columns = entry.getValue();
// wildcard scans will automatically include the delete marker, so only need to add it when we have
// explicit columns... | [
"private",
"Get",
"projectFamilyDeletes",
"(",
"Get",
"get",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"byte",
"[",
"]",
",",
"NavigableSet",
"<",
"byte",
"[",
"]",
">",
">",
"entry",
":",
"get",
".",
"getFamilyMap",
"(",
")",
".",
"entrySet",
... | Ensures that family delete markers are present in the columns requested for any get operation.
@param get The original get request
@return The modified get request with the family delete qualifiers represented | [
"Ensures",
"that",
"family",
"delete",
"markers",
"are",
"present",
"in",
"the",
"columns",
"requested",
"for",
"any",
"get",
"operation",
"."
] | 082c56c15c6ece15002631ff6f89206a00d8915c | https://github.com/cdapio/tephra/blob/082c56c15c6ece15002631ff6f89206a00d8915c/tephra-hbase-compat-1.1/src/main/java/co/cask/tephra/hbase11/coprocessor/TransactionProcessor.java#L243-L253 | train | Project family deletes into the Get object. | Of course, here is the Java code you requested:
```java
private Get projectFamilyDeletes(Get get) {
for (Map.Entry<byte[], NavigableSet<byte[]>> entry : get.getFamilyMap().entrySet()) {
NavigableSet<byte[]> columns = entry.getValue();
// wildcard scans will automatically include the delete marker, so o... |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/attribute/map/ZoomToFeatures.java | ZoomToFeatures.copy | public final ZoomToFeatures copy() {
ZoomToFeatures obj = new ZoomToFeatures();
obj.zoomType = this.zoomType;
obj.minScale = this.minScale;
obj.minMargin = this.minMargin;
return obj;
} | java | public final ZoomToFeatures copy() {
ZoomToFeatures obj = new ZoomToFeatures();
obj.zoomType = this.zoomType;
obj.minScale = this.minScale;
obj.minMargin = this.minMargin;
return obj;
} | [
"public",
"final",
"ZoomToFeatures",
"copy",
"(",
")",
"{",
"ZoomToFeatures",
"obj",
"=",
"new",
"ZoomToFeatures",
"(",
")",
";",
"obj",
".",
"zoomType",
"=",
"this",
".",
"zoomType",
";",
"obj",
".",
"minScale",
"=",
"this",
".",
"minScale",
";",
"obj",... | Make a copy. | [
"Make",
"a",
"copy",
"."
] | 25a452cb39f592bd8a53b20db1037703898e1e22 | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/attribute/map/ZoomToFeatures.java#L45-L51 | train | Create a copy of this object. | Of course, here is the Java code you requested:
```java
public final ZoomToFeatures copy() {
ZoomToFeatures obj = new ZoomToFeatures();
obj.zoomType = this.zoomType;
obj.minScale = this.minScale;
obj.minMargin = this.minMargin;
return obj;
}
```
Hope this helps! |
OpenNTF/JavascriptAggregator | jaggr-core/src/main/java/com/ibm/jaggr/core/util/ZipUtil.java | ZipUtil.extractDirectory | private static void extractDirectory(ZipEntry entry, File dir) throws IOException {
final String sourceMethod = "extractFile"; //$NON-NLS-1$
final boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, sourceMethod, new Object[]{entry, dir});
}
dir.mkd... | java | private static void extractDirectory(ZipEntry entry, File dir) throws IOException {
final String sourceMethod = "extractFile"; //$NON-NLS-1$
final boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, sourceMethod, new Object[]{entry, dir});
}
dir.mkd... | [
"private",
"static",
"void",
"extractDirectory",
"(",
"ZipEntry",
"entry",
",",
"File",
"dir",
")",
"throws",
"IOException",
"{",
"final",
"String",
"sourceMethod",
"=",
"\"extractFile\"",
";",
"//$NON-NLS-1$\r",
"final",
"boolean",
"isTraceLogging",
"=",
"log",
"... | Extracts the directory entry to the location specified by {@code dir}
@param entry
the {@link ZipEntry} object for the directory being extracted
@param dir
the {@link File} object for the target directory
@throws IOException | [
"Extracts",
"the",
"directory",
"entry",
"to",
"the",
"location",
"specified",
"by",
"{",
"@code",
"dir",
"}"
] | 9f47a96d778251638b1df9a368462176216d5b29 | https://github.com/OpenNTF/JavascriptAggregator/blob/9f47a96d778251638b1df9a368462176216d5b29/jaggr-core/src/main/java/com/ibm/jaggr/core/util/ZipUtil.java#L158-L173 | train | Extract the contents of a zip entry into a directory. | Of course, here is the Java code you requested:
```java
private static void extractDirectory(ZipEntry entry, File dir) throws IOException {
final String sourceMethod = "extractFile"; //$NON-NLS-1$
final boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(sourceClass, s... |
apache/parquet-mr | parquet-hive/parquet-hive-storage-handler/src/main/java/org/apache/hadoop/hive/ql/io/parquet/read/ParquetRecordReaderWrapper.java | ParquetRecordReaderWrapper.getSplit | protected ParquetInputSplit getSplit(
final InputSplit oldSplit,
final JobConf conf
) throws IOException {
if (oldSplit instanceof FileSplit) {
FileSplit fileSplit = (FileSplit) oldSplit;
final long splitStart = fileSplit.getStart();
final long splitLength = fileSplit.getLength()... | java | protected ParquetInputSplit getSplit(
final InputSplit oldSplit,
final JobConf conf
) throws IOException {
if (oldSplit instanceof FileSplit) {
FileSplit fileSplit = (FileSplit) oldSplit;
final long splitStart = fileSplit.getStart();
final long splitLength = fileSplit.getLength()... | [
"protected",
"ParquetInputSplit",
"getSplit",
"(",
"final",
"InputSplit",
"oldSplit",
",",
"final",
"JobConf",
"conf",
")",
"throws",
"IOException",
"{",
"if",
"(",
"oldSplit",
"instanceof",
"FileSplit",
")",
"{",
"FileSplit",
"fileSplit",
"=",
"(",
"FileSplit",
... | gets a ParquetInputSplit corresponding to a split given by Hive
@param oldSplit The split given by Hive
@param conf The JobConf of the Hive job
@return a ParquetInputSplit corresponding to the oldSplit
@throws IOException if the config cannot be enhanced or if the footer cannot be read from the file | [
"gets",
"a",
"ParquetInputSplit",
"corresponding",
"to",
"a",
"split",
"given",
"by",
"Hive"
] | 62dcc68acaf64012bf731e103be780956f1f446d | https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-hive/parquet-hive-storage-handler/src/main/java/org/apache/hadoop/hive/ql/io/parquet/read/ParquetRecordReaderWrapper.java#L197-L227 | test | Get a split from a file. | Of course, here is the Java code you requested:
```java
protected ParquetInputSplit getSplit(
final InputSplit oldSplit,
final JobConf conf
) throws IOException {
if (oldSplit instanceof FileSplit) {
FileSplit fileSplit = (FileSplit) oldSplit;
final long splitStart = fileSplit.getStar... |
liferay/com-liferay-commerce | commerce-api/src/main/java/com/liferay/commerce/service/persistence/CPDAvailabilityEstimateUtil.java | CPDAvailabilityEstimateUtil.findByUuid_Last | public static CPDAvailabilityEstimate findByUuid_Last(String uuid,
OrderByComparator<CPDAvailabilityEstimate> orderByComparator)
throws com.liferay.commerce.exception.NoSuchCPDAvailabilityEstimateException {
return getPersistence().findByUuid_Last(uuid, orderByComparator);
} | java | public static CPDAvailabilityEstimate findByUuid_Last(String uuid,
OrderByComparator<CPDAvailabilityEstimate> orderByComparator)
throws com.liferay.commerce.exception.NoSuchCPDAvailabilityEstimateException {
return getPersistence().findByUuid_Last(uuid, orderByComparator);
} | [
"public",
"static",
"CPDAvailabilityEstimate",
"findByUuid_Last",
"(",
"String",
"uuid",
",",
"OrderByComparator",
"<",
"CPDAvailabilityEstimate",
">",
"orderByComparator",
")",
"throws",
"com",
".",
"liferay",
".",
"commerce",
".",
"exception",
".",
"NoSuchCPDAvailabil... | Returns the last cpd availability estimate in the ordered set where uuid = ?.
@param uuid the uuid
@param orderByComparator the comparator to order the set by (optionally <code>null</code>)
@return the last matching cpd availability estimate
@throws NoSuchCPDAvailabilityEstimateException if a matching cpd availabi... | [
"Returns",
"the",
"last",
"cpd",
"availability",
"estimate",
"in",
"the",
"ordered",
"set",
"where",
"uuid",
"=",
"?",
";",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-api/src/main/java/com/liferay/commerce/service/persistence/CPDAvailabilityEstimateUtil.java#L221-L225 | train | Returns the last cpd availability estimate matching the UUID and ordered set of all the commerce availability estimates. | Of course, here is the Java code you requested:
```java
public static CPDAvailabilityEstimate findByUuid_Last(String uuid,
OrderByComparator<CPDAvailabilityEstimate> orderByComparator)
throws com.liferay.commerce.exception.NoSuchCPDAvailabilityEstimateException {
return getPersistence().findByUuid_Last(uuid, ord... |
Azure/azure-storage-android | microsoft-azure-storage/src/com/microsoft/azure/storage/OperationContext.java | OperationContext.getLastResult | public synchronized RequestResult getLastResult() {
if (this.requestResults == null || this.requestResults.size() == 0) {
return null;
}
else {
return this.requestResults.get(this.requestResults.size() - 1);
}
} | java | public synchronized RequestResult getLastResult() {
if (this.requestResults == null || this.requestResults.size() == 0) {
return null;
}
else {
return this.requestResults.get(this.requestResults.size() - 1);
}
} | [
"public",
"synchronized",
"RequestResult",
"getLastResult",
"(",
")",
"{",
"if",
"(",
"this",
".",
"requestResults",
"==",
"null",
"||",
"this",
".",
"requestResults",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
... | Gets the last request result encountered for the operation.
@return A {@link RequestResult} object which represents the last request result. | [
"Gets",
"the",
"last",
"request",
"result",
"encountered",
"for",
"the",
"operation",
"."
] | 2c643c37c6b8c9081058add284c601a2393afc93 | https://github.com/Azure/azure-storage-android/blob/2c643c37c6b8c9081058add284c601a2393afc93/microsoft-azure-storage/src/com/microsoft/azure/storage/OperationContext.java#L203-L210 | valid | Gets the last request result. | Of course, here is the Java code you requested:
```java
public synchronized RequestResult getLastResult() {
if (this.requestResults == null || this.requestResults.size() == 0) {
return null;
}
else {
return this.requestResults.get(this.requestResults.size() - 1);
... |
DreaminginCodeZH/MaterialProgressBar | library/src/main/java/me/zhanghai/android/materialprogressbar/internal/ObjectAnimatorCompat.java | ObjectAnimatorCompat.ofFloat | @NonNull
public static <T> ObjectAnimator ofFloat(@Nullable T target,
@NonNull Property<T, Float> xProperty,
@NonNull Property<T, Float> yProperty,
@NonNull Path path) {
if ... | java | @NonNull
public static <T> ObjectAnimator ofFloat(@Nullable T target,
@NonNull Property<T, Float> xProperty,
@NonNull Property<T, Float> yProperty,
@NonNull Path path) {
if ... | [
"@",
"NonNull",
"public",
"static",
"<",
"T",
">",
"ObjectAnimator",
"ofFloat",
"(",
"@",
"Nullable",
"T",
"target",
",",
"@",
"NonNull",
"Property",
"<",
"T",
",",
"Float",
">",
"xProperty",
",",
"@",
"NonNull",
"Property",
"<",
"T",
",",
"Float",
">"... | Constructs and returns an ObjectAnimator that animates coordinates along a {@code Path} using
two properties. A {@code Path} animation moves in two dimensions, animating coordinates
{@code (x, y)} together to follow the line. In this variation, the coordinates are floats
that are set to separate properties, {@code xPro... | [
"Constructs",
"and",
"returns",
"an",
"ObjectAnimator",
"that",
"animates",
"coordinates",
"along",
"a",
"{",
"@code",
"Path",
"}",
"using",
"two",
"properties",
".",
"A",
"{",
"@code",
"Path",
"}",
"animation",
"moves",
"in",
"two",
"dimensions",
"animating",... | 7450ac880c8c9edf5d836cc0470fca01592d093e | https://github.com/DreaminginCodeZH/MaterialProgressBar/blob/7450ac880c8c9edf5d836cc0470fca01592d093e/library/src/main/java/me/zhanghai/android/materialprogressbar/internal/ObjectAnimatorCompat.java#L108-L118 | train | Create an ObjectAnimator for a float property. | Of course, here is the Java code you requested:
```java
@NonNull
public static <T> ObjectAnimator ofFloat(@Nullable T target,
@NonNull Property<T, Float> xProperty,
@NonNull Property<T, Float> yProperty,
... |
TakahikoKawasaki/nv-websocket-client | src/main/java/com/neovisionaries/ws/client/WebSocket.java | WebSocket.openOutputStream | private WebSocketOutputStream openOutputStream(Socket socket) throws WebSocketException
{
try
{
// Get the output stream of the socket through which
// this client sends data to the server.
return new WebSocketOutputStream(
new BufferedOutputStream... | java | private WebSocketOutputStream openOutputStream(Socket socket) throws WebSocketException
{
try
{
// Get the output stream of the socket through which
// this client sends data to the server.
return new WebSocketOutputStream(
new BufferedOutputStream... | [
"private",
"WebSocketOutputStream",
"openOutputStream",
"(",
"Socket",
"socket",
")",
"throws",
"WebSocketException",
"{",
"try",
"{",
"// Get the output stream of the socket through which",
"// this client sends data to the server.",
"return",
"new",
"WebSocketOutputStream",
"(",
... | Open the output stream of the WebSocket connection.
The stream is used by the writing thread. | [
"Open",
"the",
"output",
"stream",
"of",
"the",
"WebSocket",
"connection",
".",
"The",
"stream",
"is",
"used",
"by",
"the",
"writing",
"thread",
"."
] | efaec21181d740ad3808313acf679313179e0825 | https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/WebSocket.java#L3317-L3333 | train | Open the output stream of the socket. | Of course, here is the Java code you requested:
```java
private WebSocketOutputStream openOutputStream(Socket socket) throws WebSocketException
{
try
{
// Get the output stream of the socket through which
// this client sends data to the server.
return new WebSoc... |
woo-j/OkapiBarcode | src/main/java/uk/org/okapibarcode/gui/MoreData.java | MoreData.fromFileButtonActionPerformed | private void fromFileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fromFileButtonActionPerformed
// Allow user to select a file, and read input data from that file
JFileChooser fileChooser = new JFileChooser();
if (fileChooser.showOpenDialog(this) == JFileChooser.APPRO... | java | private void fromFileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fromFileButtonActionPerformed
// Allow user to select a file, and read input data from that file
JFileChooser fileChooser = new JFileChooser();
if (fileChooser.showOpenDialog(this) == JFileChooser.APPRO... | [
"private",
"void",
"fromFileButtonActionPerformed",
"(",
"java",
".",
"awt",
".",
"event",
".",
"ActionEvent",
"evt",
")",
"{",
"//GEN-FIRST:event_fromFileButtonActionPerformed",
"// Allow user to select a file, and read input data from that file",
"JFileChooser",
"fileChooser",
... | GEN-LAST:event_resetButtonActionPerformed | [
"GEN",
"-",
"LAST",
":",
"event_resetButtonActionPerformed"
] | d1cb4f4ab64557cd3db64d9a473528a52ce58081 | https://github.com/woo-j/OkapiBarcode/blob/d1cb4f4ab64557cd3db64d9a473528a52ce58081/src/main/java/uk/org/okapibarcode/gui/MoreData.java#L139-L150 | train | The fromFileButtonActionPerformed method. | Of course, here is the Java code you requested:
```java
private void fromFileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fromFileButtonActionPerformed
// Allow user to select a file, and read input data from that file
JFileChooser fileChooser = new JFileChooser();
i... |
aws/aws-sdk-java | aws-java-sdk-core/src/main/java/com/amazonaws/auth/profile/ProfilesConfigFileWriter.java | ProfilesConfigFileWriter.modifyOrInsertProfiles | public static void modifyOrInsertProfiles(File destination, Profile... profiles) {
final Map<String, Profile> modifications = new LinkedHashMap<String, Profile>();
for (Profile profile : profiles) {
modifications.put(profile.getProfileName(), profile);
}
modifyProfiles(desti... | java | public static void modifyOrInsertProfiles(File destination, Profile... profiles) {
final Map<String, Profile> modifications = new LinkedHashMap<String, Profile>();
for (Profile profile : profiles) {
modifications.put(profile.getProfileName(), profile);
}
modifyProfiles(desti... | [
"public",
"static",
"void",
"modifyOrInsertProfiles",
"(",
"File",
"destination",
",",
"Profile",
"...",
"profiles",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Profile",
">",
"modifications",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"Profile",
">",... | Modify or insert new profiles into an existing credentials file by
in-place modification. Only the properties of the affected profiles will
be modified; all the unaffected profiles and comment lines will remain
the same. This method does not support renaming a profile.
@param destination
The destination file to modify... | [
"Modify",
"or",
"insert",
"new",
"profiles",
"into",
"an",
"existing",
"credentials",
"file",
"by",
"in",
"-",
"place",
"modification",
".",
"Only",
"the",
"properties",
"of",
"the",
"affected",
"profiles",
"will",
"be",
"modified",
";",
"all",
"the",
"unaff... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-core/src/main/java/com/amazonaws/auth/profile/ProfilesConfigFileWriter.java#L105-L112 | train | Modify or insert profiles into the destination file. | Of course, here is the Java code you requested:
```java
public static void modifyOrInsertProfiles(File destination, Profile... profiles) {
final Map<String, Profile> modifications = new LinkedHashMap<String, Profile>();
for (Profile profile : profiles) {
modifications.put(profile.getProfile... |
aws/aws-sdk-java | aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/ChannelSpecification.java | ChannelSpecification.withSupportedCompressionTypes | public ChannelSpecification withSupportedCompressionTypes(CompressionType... supportedCompressionTypes) {
java.util.ArrayList<String> supportedCompressionTypesCopy = new java.util.ArrayList<String>(supportedCompressionTypes.length);
for (CompressionType value : supportedCompressionTypes) {
s... | java | public ChannelSpecification withSupportedCompressionTypes(CompressionType... supportedCompressionTypes) {
java.util.ArrayList<String> supportedCompressionTypesCopy = new java.util.ArrayList<String>(supportedCompressionTypes.length);
for (CompressionType value : supportedCompressionTypes) {
s... | [
"public",
"ChannelSpecification",
"withSupportedCompressionTypes",
"(",
"CompressionType",
"...",
"supportedCompressionTypes",
")",
"{",
"java",
".",
"util",
".",
"ArrayList",
"<",
"String",
">",
"supportedCompressionTypesCopy",
"=",
"new",
"java",
".",
"util",
".",
"... | <p>
The allowed compression types, if data compression is used.
</p>
@param supportedCompressionTypes
The allowed compression types, if data compression is used.
@return Returns a reference to this object so that method calls can be chained together.
@see CompressionType | [
"<p",
">",
"The",
"allowed",
"compression",
"types",
"if",
"data",
"compression",
"is",
"used",
".",
"<",
"/",
"p",
">"
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/ChannelSpecification.java#L363-L374 | train | Sets the supported compression types. | Of course, here is the Java code you requested:
```java
public ChannelSpecification withSupportedCompressionTypes(CompressionType... supportedCompressionTypes) {
java.util.ArrayList<String> supportedCompressionTypesCopy = new java.util.ArrayList<String>(supportedCompressionTypes.length);
for (Compressi... |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ntp/ntpserver.java | ntpserver.unset | public static base_responses unset(nitro_service client, ntpserver resources[], String[] args) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
ntpserver unsetresources[] = new ntpserver[resources.length];
for (int i=0;i<resources.length;i++){
unsetresourc... | java | public static base_responses unset(nitro_service client, ntpserver resources[], String[] args) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
ntpserver unsetresources[] = new ntpserver[resources.length];
for (int i=0;i<resources.length;i++){
unsetresourc... | [
"public",
"static",
"base_responses",
"unset",
"(",
"nitro_service",
"client",
",",
"ntpserver",
"resources",
"[",
"]",
",",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"base_responses",
"result",
"=",
"null",
";",
"if",
"(",
"resources",
"!... | Use this API to unset the properties of ntpserver resources.
Properties that need to be unset are specified in args array. | [
"Use",
"this",
"API",
"to",
"unset",
"the",
"properties",
"of",
"ntpserver",
"resources",
".",
"Properties",
"that",
"need",
"to",
"be",
"unset",
"are",
"specified",
"in",
"args",
"array",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ntp/ntpserver.java#L396-L408 | train | Use this API to unset the properties of ntpserver resources. Properties that need to be unset are specified in args array. | Of course, here is the Java code you requested:
```java
public static base_responses unset(nitro_service client, ntpserver resources[], String[] args) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
ntpserver unsetresources[] = new ntpserver[resources.length];
... |
stormpath/stormpath-shiro | extensions/servlet/src/main/java/com/stormpath/shiro/servlet/env/StormpathShiroIniEnvironment.java | StormpathShiroIniEnvironment.createFilterChainResolver | @Override
protected FilterChainResolver createFilterChainResolver() {
FilterChainResolver originalFilterChainResolver = super.createFilterChainResolver();
if (originalFilterChainResolver == null) {
return null;
}
return getFilterChainResolverFactory(originalFilterChain... | java | @Override
protected FilterChainResolver createFilterChainResolver() {
FilterChainResolver originalFilterChainResolver = super.createFilterChainResolver();
if (originalFilterChainResolver == null) {
return null;
}
return getFilterChainResolverFactory(originalFilterChain... | [
"@",
"Override",
"protected",
"FilterChainResolver",
"createFilterChainResolver",
"(",
")",
"{",
"FilterChainResolver",
"originalFilterChainResolver",
"=",
"super",
".",
"createFilterChainResolver",
"(",
")",
";",
"if",
"(",
"originalFilterChainResolver",
"==",
"null",
")... | Wraps the original FilterChainResolver in a priority based instance, which will detect Stormpath API based logins
(form, auth headers, etc).
@return | [
"Wraps",
"the",
"original",
"FilterChainResolver",
"in",
"a",
"priority",
"based",
"instance",
"which",
"will",
"detect",
"Stormpath",
"API",
"based",
"logins",
"(",
"form",
"auth",
"headers",
"etc",
")",
"."
] | 7a3c4fd3bd0ed9bb4546932495c79e6ad6fa1a92 | https://github.com/stormpath/stormpath-shiro/blob/7a3c4fd3bd0ed9bb4546932495c79e6ad6fa1a92/extensions/servlet/src/main/java/com/stormpath/shiro/servlet/env/StormpathShiroIniEnvironment.java#L165-L175 | train | Override to create a new instance of the correct FilterChainResolver. | Of course, here is the Java code you requested:
```java
@Override
protected FilterChainResolver createFilterChainResolver() {
FilterChainResolver originalFilterChainResolver = super.createFilterChainResolver();
if (originalFilterChainResolver == null) {
return null;
}
... |
alkacon/opencms-core | src/org/opencms/ui/login/CmsLoginHelper.java | CmsLoginHelper.getPreDefOuFqn | private static String getPreDefOuFqn(CmsObject cms, HttpServletRequest request, boolean logout) {
if (logout && (request.getAttribute(PARAM_PREDEF_OUFQN) == null)) {
String oufqn = cms.getRequestContext().getOuFqn();
if (!oufqn.startsWith(CmsOrganizationalUnit.SEPARATOR)) {
... | java | private static String getPreDefOuFqn(CmsObject cms, HttpServletRequest request, boolean logout) {
if (logout && (request.getAttribute(PARAM_PREDEF_OUFQN) == null)) {
String oufqn = cms.getRequestContext().getOuFqn();
if (!oufqn.startsWith(CmsOrganizationalUnit.SEPARATOR)) {
... | [
"private",
"static",
"String",
"getPreDefOuFqn",
"(",
"CmsObject",
"cms",
",",
"HttpServletRequest",
"request",
",",
"boolean",
"logout",
")",
"{",
"if",
"(",
"logout",
"&&",
"(",
"request",
".",
"getAttribute",
"(",
"PARAM_PREDEF_OUFQN",
")",
"==",
"null",
")... | Returns the pre defined ou fqn.<p>
@param cms the cms context
@param request the request
@param logout in case of a logout
@return the ou fqn | [
"Returns",
"the",
"pre",
"defined",
"ou",
"fqn",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/login/CmsLoginHelper.java#L704-L714 | train | Gets the preferred OU FQN of the user. | Of course, here is the Java code you requested:
```java
private static String getPreDefOuFqn(CmsObject cms, HttpServletRequest request, boolean logout) {
if (logout && (request.getAttribute(PARAM_PREDEF_OUFQN) == null)) {
String oufqn = cms.getRequestContext().getOuFqn();
if (!oufqn.st... |
wanglinsong/thx-webservice | src/main/java/com/tascape/qa/th/ws/comm/WebServiceCommunication.java | WebServiceCommunication.post | public String post(String endpoint, String params) throws IOException {
return this.post(endpoint, params, "");
} | java | public String post(String endpoint, String params) throws IOException {
return this.post(endpoint, params, "");
} | [
"public",
"String",
"post",
"(",
"String",
"endpoint",
",",
"String",
"params",
")",
"throws",
"IOException",
"{",
"return",
"this",
".",
"post",
"(",
"endpoint",
",",
"params",
",",
"\"\"",
")",
";",
"}"
] | Issues HTTP POST request, returns response body as string.
@param endpoint endpoint of request url
@param params request line parameters
@return response body
@throws IOException in case of any IO related issue | [
"Issues",
"HTTP",
"POST",
"request",
"returns",
"response",
"body",
"as",
"string",
"."
] | 29bc084b09ad35b012eb7c6b5c9ee55337ddee28 | https://github.com/wanglinsong/thx-webservice/blob/29bc084b09ad35b012eb7c6b5c9ee55337ddee28/src/main/java/com/tascape/qa/th/ws/comm/WebServiceCommunication.java#L922-L924 | train | Perform a HTTP POST request. | Of course, here is the Java code you requested:
```java
public String post(String endpoint, String params) throws IOException {
return this.post(endpoint, params, "");
}
```
Hope this helps! |
classgraph/classgraph | src/main/java/io/github/classgraph/GraphvizDotfileGenerator.java | GraphvizDotfileGenerator.generateGraphVizDotFileFromInterClassDependencies | static String generateGraphVizDotFileFromInterClassDependencies(final ClassInfoList classInfoList,
final float sizeX, final float sizeY, final boolean includeExternalClasses) {
final StringBuilder buf = new StringBuilder(1024 * 1024);
buf.append("digraph {\n");
buf.append("size=\"")... | java | static String generateGraphVizDotFileFromInterClassDependencies(final ClassInfoList classInfoList,
final float sizeX, final float sizeY, final boolean includeExternalClasses) {
final StringBuilder buf = new StringBuilder(1024 * 1024);
buf.append("digraph {\n");
buf.append("size=\"")... | [
"static",
"String",
"generateGraphVizDotFileFromInterClassDependencies",
"(",
"final",
"ClassInfoList",
"classInfoList",
",",
"final",
"float",
"sizeX",
",",
"final",
"float",
"sizeY",
",",
"final",
"boolean",
"includeExternalClasses",
")",
"{",
"final",
"StringBuilder",
... | Generate a .dot file which can be fed into GraphViz for layout and visualization of the class graph. The
returned graph shows inter-class dependencies only. The sizeX and sizeY parameters are the image output size
to use (in inches) when GraphViz is asked to render the .dot file. You must have called
{@link ClassGraph#... | [
"Generate",
"a",
".",
"dot",
"file",
"which",
"can",
"be",
"fed",
"into",
"GraphViz",
"for",
"layout",
"and",
"visualization",
"of",
"the",
"class",
"graph",
".",
"The",
"returned",
"graph",
"shows",
"inter",
"-",
"class",
"dependencies",
"only",
".",
"The... | c8c8b2ca1eb76339f69193fdac33d735c864215c | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/GraphvizDotfileGenerator.java#L659-L723 | train | Generate Graph Viz Dot File from InterClassDependencies. | Of course, here is the Java code you requested:
```java
static String generateGraphVizDotFileFromInterClassDependencies(final ClassInfoList classInfoList,
final float sizeX, final float sizeY, final boolean includeExternalClasses) {
final StringBuilder buf = new StringBuilder(1024 * 1024);
... |
jnr/jnr-x86asm | src/main/java/jnr/x86asm/Asm.java | Asm.byte_ptr_abs | public static final Mem byte_ptr_abs(long target, Register index, int shift, long disp, SEGMENT segmentPrefix) {
return _ptr_build_abs(target, index, shift, disp, segmentPrefix, SIZE_BYTE);
} | java | public static final Mem byte_ptr_abs(long target, Register index, int shift, long disp, SEGMENT segmentPrefix) {
return _ptr_build_abs(target, index, shift, disp, segmentPrefix, SIZE_BYTE);
} | [
"public",
"static",
"final",
"Mem",
"byte_ptr_abs",
"(",
"long",
"target",
",",
"Register",
"index",
",",
"int",
"shift",
",",
"long",
"disp",
",",
"SEGMENT",
"segmentPrefix",
")",
"{",
"return",
"_ptr_build_abs",
"(",
"target",
",",
"index",
",",
"shift",
... | Create byte pointer operand. | [
"Create",
"byte",
"pointer",
"operand",
"."
] | fdcf68fb3dae49e607a49e33399e3dad1ada5536 | https://github.com/jnr/jnr-x86asm/blob/fdcf68fb3dae49e607a49e33399e3dad1ada5536/src/main/java/jnr/x86asm/Asm.java#L450-L452 | train | Create a byte - addressable pointer. | Of course, here is the Java code you requested:
```java
public static final Mem byte_ptr_abs(long target, Register index, int shift, long disp, SEGMENT segmentPrefix) {
return _ptr_build_abs(target, index, shift, disp, segmentPrefix, SIZE_BYTE);
}
```
Hope this helps! |
wildfly/wildfly-maven-plugin | core/src/main/java/org/wildfly/plugin/core/ServerHelper.java | ServerHelper.getContainerDescription | public static ContainerDescription getContainerDescription(final ModelControllerClient client) throws IOException, OperationExecutionException {
return DefaultContainerDescription.lookup(Assert.checkNotNullParam("client", client));
} | java | public static ContainerDescription getContainerDescription(final ModelControllerClient client) throws IOException, OperationExecutionException {
return DefaultContainerDescription.lookup(Assert.checkNotNullParam("client", client));
} | [
"public",
"static",
"ContainerDescription",
"getContainerDescription",
"(",
"final",
"ModelControllerClient",
"client",
")",
"throws",
"IOException",
",",
"OperationExecutionException",
"{",
"return",
"DefaultContainerDescription",
".",
"lookup",
"(",
"Assert",
".",
"checkN... | Returns the description of the running container.
@param client the client used to query the server
@return the description of the running container
@throws IOException if an error occurs communicating with the server
@throws OperationExecutionException if the operation used to query the container fa... | [
"Returns",
"the",
"description",
"of",
"the",
"running",
"container",
"."
] | c0e2d7ee28e511092561801959eae253b2b56def | https://github.com/wildfly/wildfly-maven-plugin/blob/c0e2d7ee28e511092561801959eae253b2b56def/core/src/main/java/org/wildfly/plugin/core/ServerHelper.java#L97-L99 | train | Get the container description. | Of course, here is the Java code you requested:
```java
public static ContainerDescription getContainerDescription(final ModelControllerClient client) throws IOException, OperationExecutionException {
return DefaultContainerDescription.lookup(Assert.checkNotNullParam("client", client));
}
```
Hope this he... |
esigate/esigate | esigate-core/src/main/java/org/esigate/util/UriUtils.java | UriUtils.createURI | public static URI createURI(String uri) {
uri = encodeIllegalCharacters(uri);
URI result = URI.create(uri);
if (result.getHost() != null && StringUtils.isEmpty(result.getPath())) {
result =
URI.create(createURI(result.getScheme(), result.getHost(), result.getPort(... | java | public static URI createURI(String uri) {
uri = encodeIllegalCharacters(uri);
URI result = URI.create(uri);
if (result.getHost() != null && StringUtils.isEmpty(result.getPath())) {
result =
URI.create(createURI(result.getScheme(), result.getHost(), result.getPort(... | [
"public",
"static",
"URI",
"createURI",
"(",
"String",
"uri",
")",
"{",
"uri",
"=",
"encodeIllegalCharacters",
"(",
"uri",
")",
";",
"URI",
"result",
"=",
"URI",
".",
"create",
"(",
"uri",
")",
";",
"if",
"(",
"result",
".",
"getHost",
"(",
")",
"!="... | Creates an {@link URI} after escaping some special characters in order to tolerate some incorrect URI types. If
the uri contains a server name but no path, the path is set to "/" as a browser would do.
@param uri
the URI as a {@link String}
@return the URI as a {@link URI} object | [
"Creates",
"an",
"{",
"@link",
"URI",
"}",
"after",
"escaping",
"some",
"special",
"characters",
"in",
"order",
"to",
"tolerate",
"some",
"incorrect",
"URI",
"types",
".",
"If",
"the",
"uri",
"contains",
"a",
"server",
"name",
"but",
"no",
"path",
"the",
... | 50421fb224f16e1ec42715425109a72b3b55527b | https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-core/src/main/java/org/esigate/util/UriUtils.java#L206-L215 | train | Create a URI from a String. | Of course, here is the Java code you requested:
```java
public static URI createURI(String uri) {
uri = encodeIllegalCharacters(uri);
URI result = URI.create(uri);
if (result.getHost() != null && StringUtils.isEmpty(result.getPath())) {
result =
URI.create(create... |
mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java | SQLiteDatabase.queryWithFactory | public Cursor queryWithFactory(CursorFactory cursorFactory,
boolean distinct, String table, String[] columns,
String selection, String[] selectionArgs, String groupBy,
String having, String orderBy, String limit, CancellationSignal cancellationSignal) {
acquireReference();
... | java | public Cursor queryWithFactory(CursorFactory cursorFactory,
boolean distinct, String table, String[] columns,
String selection, String[] selectionArgs, String groupBy,
String having, String orderBy, String limit, CancellationSignal cancellationSignal) {
acquireReference();
... | [
"public",
"Cursor",
"queryWithFactory",
"(",
"CursorFactory",
"cursorFactory",
",",
"boolean",
"distinct",
",",
"String",
"table",
",",
"String",
"[",
"]",
"columns",
",",
"String",
"selection",
",",
"String",
"[",
"]",
"selectionArgs",
",",
"String",
"groupBy",... | Query the given URL, returning a {@link Cursor} over the result set.
@param cursorFactory the cursor factory to use, or null for the default factory
@param distinct true if you want each row to be unique, false otherwise.
@param table The table name to compile the query against.
@param columns A list of which columns ... | [
"Query",
"the",
"given",
"URL",
"returning",
"a",
"{",
"@link",
"Cursor",
"}",
"over",
"the",
"result",
"set",
"."
] | c49c83f7f727552f793dff15cefa532ade030842 | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteDatabase.java#L1158-L1172 | train | Query with factory. | Of course, here is the Java code you requested:
```java
public Cursor queryWithFactory(CursorFactory cursorFactory,
boolean distinct, String table, String[] columns,
String selection, String[] selectionArgs, String groupBy,
String having, String orderBy, String limit, CancellationSi... |
wisdom-framework/wisdom | core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/AbstractWisdomWatcherMojo.java | AbstractWisdomWatcherMojo.getResources | public Collection<File> getResources(List<String> extensions) {
List<File> files = new ArrayList<>();
files.addAll(WatcherUtils.getAllFilesFromDirectory(getInternalAssetsDirectory(), extensions));
files.addAll(WatcherUtils.getAllFilesFromDirectory(getExternalAssetsDirectory(), extensions));
... | java | public Collection<File> getResources(List<String> extensions) {
List<File> files = new ArrayList<>();
files.addAll(WatcherUtils.getAllFilesFromDirectory(getInternalAssetsDirectory(), extensions));
files.addAll(WatcherUtils.getAllFilesFromDirectory(getExternalAssetsDirectory(), extensions));
... | [
"public",
"Collection",
"<",
"File",
">",
"getResources",
"(",
"List",
"<",
"String",
">",
"extensions",
")",
"{",
"List",
"<",
"File",
">",
"files",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"files",
".",
"addAll",
"(",
"WatcherUtils",
".",
"getAl... | Finds all resources from internal and external assets directories having one of the specified extensions.
@param extensions the extensions
@return the set of file, potentially empty if no files match. | [
"Finds",
"all",
"resources",
"from",
"internal",
"and",
"external",
"assets",
"directories",
"having",
"one",
"of",
"the",
"specified",
"extensions",
"."
] | a35b6431200fec56b178c0ff60837ed73fd7874d | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/wisdom-maven-plugin/src/main/java/org/wisdom/maven/mojos/AbstractWisdomWatcherMojo.java#L73-L78 | train | Get all resources from the internal and external assets directory. | Of course, here is the Java code you requested:
```java
public Collection<File> getResources(List<String> extensions) {
List<File> files = new ArrayList<>();
files.addAll(WatcherUtils.getAllFilesFromDirectory(getInternalAssetsDirectory(), extensions));
files.addAll(WatcherUtils.getAllFilesFromD... |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel2.java | SparseCpuLevel2.scoomv | public void scoomv(char transA, int M, DataBuffer values, DataBuffer rowInd, DataBuffer colInd, int nnz, INDArray x, INDArray y){
mkl_cspblas_scoogemv(
Character.toString(transA),
(IntPointer) Nd4j.createBuffer(new int[]{M}).addressPointer(),
(FloatPointer) values... | java | public void scoomv(char transA, int M, DataBuffer values, DataBuffer rowInd, DataBuffer colInd, int nnz, INDArray x, INDArray y){
mkl_cspblas_scoogemv(
Character.toString(transA),
(IntPointer) Nd4j.createBuffer(new int[]{M}).addressPointer(),
(FloatPointer) values... | [
"public",
"void",
"scoomv",
"(",
"char",
"transA",
",",
"int",
"M",
",",
"DataBuffer",
"values",
",",
"DataBuffer",
"rowInd",
",",
"DataBuffer",
"colInd",
",",
"int",
"nnz",
",",
"INDArray",
"x",
",",
"INDArray",
"y",
")",
"{",
"mkl_cspblas_scoogemv",
"(",... | Mapping with Sparse Blas calls | [
"Mapping",
"with",
"Sparse",
"Blas",
"calls"
] | effce52f2afd7eeb53c5bcca699fcd90bd06822f | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel2.java#L37-L47 | train | scoomv for CSPBLAS | Of course, here is the Java code you requested:
```java
public void scoomv(char transA, int M, DataBuffer values, DataBuffer rowInd, DataBuffer colInd, int nnz, INDArray x, INDArray y){
mkl_cspblas_scoogemv(
Character.toString(transA),
(IntPointer) Nd4j.createBuffer(new int[]{M}... |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/internal/Utils.java | Utils.assertNotNull | @NonNull
public static <T> T assertNotNull(T object, String item) {
if (object == null) {
throw new NullPointerException(item + " == null");
}
return object;
} | java | @NonNull
public static <T> T assertNotNull(T object, String item) {
if (object == null) {
throw new NullPointerException(item + " == null");
}
return object;
} | [
"@",
"NonNull",
"public",
"static",
"<",
"T",
">",
"T",
"assertNotNull",
"(",
"T",
"object",
",",
"String",
"item",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"item",
"+",
"\" == null\"",
")",
";... | Throws a {@link NullPointerException} if the given object is null. | [
"Throws",
"a",
"{"
] | 93c7d5bb09b593440a2347a6089db3e9f74012da | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/internal/Utils.java#L227-L233 | train | Check that a given object is not null. | Of course, here is the Java code you requested:
```java
@NonNull
public static <T> T assertNotNull(T object, String item) {
if (object == null) {
throw new NullPointerException(item + " == null");
}
return object;
}
```
Hope this helps! |
lucmoreau/ProvToolbox | prov-xml/src/main/java/org/openprovenance/prov/xml/Entity.java | Entity.getLocation | public List<org.openprovenance.prov.model.Location> getLocation() {
if (location == null) {
location=AttributeList.populateKnownAttributes(this,all, org.openprovenance.prov.model.Location.class);
}
return this.location;
} | java | public List<org.openprovenance.prov.model.Location> getLocation() {
if (location == null) {
location=AttributeList.populateKnownAttributes(this,all, org.openprovenance.prov.model.Location.class);
}
return this.location;
} | [
"public",
"List",
"<",
"org",
".",
"openprovenance",
".",
"prov",
".",
"model",
".",
"Location",
">",
"getLocation",
"(",
")",
"{",
"if",
"(",
"location",
"==",
"null",
")",
"{",
"location",
"=",
"AttributeList",
".",
"populateKnownAttributes",
"(",
"this"... | Gets the value of the location property.
<p>
This accessor method returns a reference to the live list,
not a snapshot. Therefore any modification you make to the
returned list will be present inside the JAXB object.
This is why there is not a <CODE>set</CODE> method for the location property.
<p>
For example, to add... | [
"Gets",
"the",
"value",
"of",
"the",
"location",
"property",
"."
] | f865952868ffb69432937b08728c86bebbe4678a | https://github.com/lucmoreau/ProvToolbox/blob/f865952868ffb69432937b08728c86bebbe4678a/prov-xml/src/main/java/org/openprovenance/prov/xml/Entity.java#L161-L166 | train | Gets the value of the location property. | Of course, here is the Java code you requested:
```java
public List<org.openprovenance.prov.model.Location> getLocation() {
if (location == null) {
location=AttributeList.populateKnownAttributes(this,all, org.openprovenance.prov.model.Location.class);
}
return this.location;
}
... |
google/closure-compiler | src/com/google/javascript/rhino/Node.java | Node.removeChild | public final void removeChild(Node child) {
checkState(child.parent == this, "%s is not the parent of %s", this, child);
checkNotNull(child.previous);
Node last = first.previous;
Node prevSibling = child.previous;
Node nextSibling = child.next;
if (first == child) {
first = nextSibling;
... | java | public final void removeChild(Node child) {
checkState(child.parent == this, "%s is not the parent of %s", this, child);
checkNotNull(child.previous);
Node last = first.previous;
Node prevSibling = child.previous;
Node nextSibling = child.next;
if (first == child) {
first = nextSibling;
... | [
"public",
"final",
"void",
"removeChild",
"(",
"Node",
"child",
")",
"{",
"checkState",
"(",
"child",
".",
"parent",
"==",
"this",
",",
"\"%s is not the parent of %s\"",
",",
"this",
",",
"child",
")",
";",
"checkNotNull",
"(",
"child",
".",
"previous",
")",... | Detach a child from its parent and siblings. | [
"Detach",
"a",
"child",
"from",
"its",
"parent",
"and",
"siblings",
"."
] | d81e36740f6a9e8ac31a825ee8758182e1dc5aae | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/Node.java#L952-L976 | train | Removes the child from this node. | Of course, here is the Java code you requested:
```java
public final void removeChild(Node child) {
checkState(child.parent == this, "%s is not the parent of %s", this, child);
checkNotNull(child.previous);
Node last = first.previous;
Node prevSibling = child.previous;
Node nextSibling = child.nex... |
geomajas/geomajas-project-client-gwt2 | common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/controller/AbstractController.java | AbstractController.onMapTouchCancel | @Override
public void onMapTouchCancel(TouchEvent<?> event) {
onUp(event);
event.stopPropagation();
event.preventDefault();
} | java | @Override
public void onMapTouchCancel(TouchEvent<?> event) {
onUp(event);
event.stopPropagation();
event.preventDefault();
} | [
"@",
"Override",
"public",
"void",
"onMapTouchCancel",
"(",
"TouchEvent",
"<",
"?",
">",
"event",
")",
"{",
"onUp",
"(",
"event",
")",
";",
"event",
".",
"stopPropagation",
"(",
")",
";",
"event",
".",
"preventDefault",
"(",
")",
";",
"}"
] | Forward as mouse up and stop the event.
@since 2.4.0 | [
"Forward",
"as",
"mouse",
"up",
"and",
"stop",
"the",
"event",
"."
] | bd8d7904e861fa80522eed7b83c4ea99844180c7 | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/controller/AbstractController.java#L184-L189 | train | Override this method to handle touch cancel events. | Of course, here is the Java code you requested:
```java
@Override
public void onMapTouchCancel(TouchEvent<?> event) {
onUp(event);
event.stopPropagation();
event.preventDefault();
}
```
Hope this helps! |
wildfly/wildfly-core | deployment-repository/src/main/java/org/jboss/as/repository/ContentRepositoryImpl.java | ContentRepositoryImpl.cleanObsoleteContent | @Override
public Map<String, Set<String>> cleanObsoleteContent() {
if(!readWrite) {
return Collections.emptyMap();
}
Map<String, Set<String>> cleanedContents = new HashMap<>(2);
cleanedContents.put(MARKED_CONTENT, new HashSet<>());
cleanedContents.put(DELETED_CONT... | java | @Override
public Map<String, Set<String>> cleanObsoleteContent() {
if(!readWrite) {
return Collections.emptyMap();
}
Map<String, Set<String>> cleanedContents = new HashMap<>(2);
cleanedContents.put(MARKED_CONTENT, new HashSet<>());
cleanedContents.put(DELETED_CONT... | [
"@",
"Override",
"public",
"Map",
"<",
"String",
",",
"Set",
"<",
"String",
">",
">",
"cleanObsoleteContent",
"(",
")",
"{",
"if",
"(",
"!",
"readWrite",
")",
"{",
"return",
"Collections",
".",
"emptyMap",
"(",
")",
";",
"}",
"Map",
"<",
"String",
",... | Clean obsolete contents from the content repository. It will first mark contents as obsolete then after some time
if these contents are still obsolete they will be removed.
@return a map containing the list of marked contents and the list of deleted contents. | [
"Clean",
"obsolete",
"contents",
"from",
"the",
"content",
"repository",
".",
"It",
"will",
"first",
"mark",
"contents",
"as",
"obsolete",
"then",
"after",
"some",
"time",
"if",
"these",
"contents",
"are",
"still",
"obsolete",
"they",
"will",
"be",
"removed",
... | cfaf0479dcbb2d320a44c5374b93b944ec39fade | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/deployment-repository/src/main/java/org/jboss/as/repository/ContentRepositoryImpl.java#L338-L363 | train | Clean obsolete content. | Of course, here is the Java code you requested:
```java
@Override
public Map<String, Set<String>> cleanObsoleteContent() {
if(!readWrite) {
return Collections.emptyMap();
}
Map<String, Set<String>> cleanedContents = new HashMap<>(2);
cleanedContents.put(MARKED_CONTENT, n... |
zaproxy/zaproxy | src/org/parosproxy/paros/core/scanner/AbstractPlugin.java | AbstractPlugin.setEnabled | @Override
public void setEnabled(boolean enabled) {
if (this.enabled != enabled) {
this.enabled = enabled;
setProperty("enabled", Boolean.toString(enabled));
if (enabled && getAlertThreshold() == AlertThreshold.OFF) {
setAlertThreshold(AlertThreshold... | java | @Override
public void setEnabled(boolean enabled) {
if (this.enabled != enabled) {
this.enabled = enabled;
setProperty("enabled", Boolean.toString(enabled));
if (enabled && getAlertThreshold() == AlertThreshold.OFF) {
setAlertThreshold(AlertThreshold... | [
"@",
"Override",
"public",
"void",
"setEnabled",
"(",
"boolean",
"enabled",
")",
"{",
"if",
"(",
"this",
".",
"enabled",
"!=",
"enabled",
")",
"{",
"this",
".",
"enabled",
"=",
"enabled",
";",
"setProperty",
"(",
"\"enabled\"",
",",
"Boolean",
".",
"toSt... | Enable this test | [
"Enable",
"this",
"test"
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/core/scanner/AbstractPlugin.java#L529-L538 | train | Sets the enabled state of the related calendar entry. | Of course, here is the Java code you requested:
```java
@Override
public void setEnabled(boolean enabled) {
if (this.enabled != enabled) {
this.enabled = enabled;
setProperty("enabled", Boolean.toString(enabled));
if (enabled && getAlertThreshold() == AlertThreshold... |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java | FSDataset.getActiveThreads | private ArrayList<Thread> getActiveThreads(int namespaceId, Block block) {
lock.writeLock().lock();
try {
//check ongoing create threads
final ActiveFile activefile = volumeMap.getOngoingCreates(namespaceId, block);
if (activefile != null && !activefile.threads.isEmpty()) {
//remove de... | java | private ArrayList<Thread> getActiveThreads(int namespaceId, Block block) {
lock.writeLock().lock();
try {
//check ongoing create threads
final ActiveFile activefile = volumeMap.getOngoingCreates(namespaceId, block);
if (activefile != null && !activefile.threads.isEmpty()) {
//remove de... | [
"private",
"ArrayList",
"<",
"Thread",
">",
"getActiveThreads",
"(",
"int",
"namespaceId",
",",
"Block",
"block",
")",
"{",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"//check ongoing create threads",
"final",
"ActiveFile",
"... | Return a list of active writer threads for the given block.
@return null if there are no such threads or the file is
not being created | [
"Return",
"a",
"list",
"of",
"active",
"writer",
"threads",
"for",
"the",
"given",
"block",
"."
] | 2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4 | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/datanode/FSDataset.java#L1919-L1942 | train | Get active threads. | Of course, here is the Java code you requested:
```java
private ArrayList<Thread> getActiveThreads(int namespaceId, Block block) {
lock.writeLock().lock();
try {
//check ongoing create threads
final ActiveFile activefile = volumeMap.getOngoingCreates(namespaceId, block);
if (activefile != nul... |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/PippoSettings.java | PippoSettings.overrideSetting | public void overrideSetting(String name, long value) {
overrides.put(name, Long.toString(value));
} | java | public void overrideSetting(String name, long value) {
overrides.put(name, Long.toString(value));
} | [
"public",
"void",
"overrideSetting",
"(",
"String",
"name",
",",
"long",
"value",
")",
"{",
"overrides",
".",
"put",
"(",
"name",
",",
"Long",
".",
"toString",
"(",
"value",
")",
")",
";",
"}"
] | Override the setting at runtime with the specified value.
This change does not persist.
@param name
@param value | [
"Override",
"the",
"setting",
"at",
"runtime",
"with",
"the",
"specified",
"value",
".",
"This",
"change",
"does",
"not",
"persist",
"."
] | cb5ccb453bffcc3cf386adc660674812d10b9726 | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/PippoSettings.java#L1056-L1058 | train | Override a class setting. | Of course, here is the Java code you requested:
```java
public void overrideSetting(String name, long value) {
overrides.put(name, Long.toString(value));
}
```
Hope this helps! |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java | ReadabilityStatistics.smogIndex | public static double smogIndex(String strText) {
strText = cleanText(strText);
return PHPMethods.round(1.043 * Math.sqrt((wordsWithThreeSyllables(strText) * (30.0 / sentenceCount(strText))) + 3.1291), 1);
} | java | public static double smogIndex(String strText) {
strText = cleanText(strText);
return PHPMethods.round(1.043 * Math.sqrt((wordsWithThreeSyllables(strText) * (30.0 / sentenceCount(strText))) + 3.1291), 1);
} | [
"public",
"static",
"double",
"smogIndex",
"(",
"String",
"strText",
")",
"{",
"strText",
"=",
"cleanText",
"(",
"strText",
")",
";",
"return",
"PHPMethods",
".",
"round",
"(",
"1.043",
"*",
"Math",
".",
"sqrt",
"(",
"(",
"wordsWithThreeSyllables",
"(",
"s... | Returns the SMOG Index of text entered rounded to one digit.
@param strText Text to be checked
@return | [
"Returns",
"the",
"SMOG",
"Index",
"of",
"text",
"entered",
"rounded",
"to",
"one",
"digit",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/common/text/analyzers/ReadabilityStatistics.java#L102-L105 | train | Gets the SMOG index of text. | Of course, here is the Java code you requested:
```java
public static double smogIndex(String strText) {
strText = cleanText(strText);
return PHPMethods.round(1.043 * Math.sqrt((wordsWithThreeSyllables(strText) * (30.0 / sentenceCount(strText))) + 3.1291), 1);
}
```
Hope this helps! |
jboss-integration/fuse-bxms-integ | switchyard/switchyard-component-rules/src/main/java/org/switchyard/component/rules/exchange/RulesExchangeHandler.java | RulesExchangeHandler.isDispose | private boolean isDispose(Exchange exchange, Message message) {
return isBoolean(exchange, message, RulesConstants.DISPOSE_PROPERTY);
} | java | private boolean isDispose(Exchange exchange, Message message) {
return isBoolean(exchange, message, RulesConstants.DISPOSE_PROPERTY);
} | [
"private",
"boolean",
"isDispose",
"(",
"Exchange",
"exchange",
",",
"Message",
"message",
")",
"{",
"return",
"isBoolean",
"(",
"exchange",
",",
"message",
",",
"RulesConstants",
".",
"DISPOSE_PROPERTY",
")",
";",
"}"
] | /*
private boolean isContinue(Exchange exchange, Message message) {
return isBoolean(exchange, message, RulesConstants.CONTINUE_PROPERTY);
} | [
"/",
"*",
"private",
"boolean",
"isContinue",
"(",
"Exchange",
"exchange",
"Message",
"message",
")",
"{",
"return",
"isBoolean",
"(",
"exchange",
"message",
"RulesConstants",
".",
"CONTINUE_PROPERTY",
")",
";",
"}"
] | ca5c012bf867ea15d1250f0991af3cd7e708aaaf | https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-rules/src/main/java/org/switchyard/component/rules/exchange/RulesExchangeHandler.java#L287-L289 | train | Checks if the message is disposing. | Of course, here is the Java code you requested:
```java
private boolean isDispose(Exchange exchange, Message message) {
return isBoolean(exchange, message, RulesConstants.DISPOSE_PROPERTY);
}
```
Hope this helps! |
stevespringett/CPE-Parser | src/main/java/us/springett/parsers/cpe/util/Convert.java | Convert.wellFormedToCpeUri | public static String wellFormedToCpeUri(Part value) {
if (value == null) {
return Part.ANY.getAbbreviation();
}
return value.getAbbreviation();
} | java | public static String wellFormedToCpeUri(Part value) {
if (value == null) {
return Part.ANY.getAbbreviation();
}
return value.getAbbreviation();
} | [
"public",
"static",
"String",
"wellFormedToCpeUri",
"(",
"Part",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"Part",
".",
"ANY",
".",
"getAbbreviation",
"(",
")",
";",
"}",
"return",
"value",
".",
"getAbbreviation",
"(",
")",... | URL encodes the value for CPE 2.2. If the value is NULL or ANY ('*') then
an empty string is returned. If the value is a hyphen ('-') the hyphen is
returned un-encoded; otherwise URL encoding is applied.
@param value the value to encode
@return the encoded value | [
"URL",
"encodes",
"the",
"value",
"for",
"CPE",
"2",
".",
"2",
".",
"If",
"the",
"value",
"is",
"NULL",
"or",
"ANY",
"(",
"*",
")",
"then",
"an",
"empty",
"string",
"is",
"returned",
".",
"If",
"the",
"value",
"is",
"a",
"hyphen",
"(",
"-",
")",
... | e6324ca020dc0790097d3d62bb98aabf60e56843 | https://github.com/stevespringett/CPE-Parser/blob/e6324ca020dc0790097d3d62bb98aabf60e56843/src/main/java/us/springett/parsers/cpe/util/Convert.java#L113-L118 | train | wellFormedToCpeUri This method returns the abbreviation of the given part. | Of course, here is the Java code you requested:
```java
public static String wellFormedToCpeUri(Part value) {
if (value == null) {
return Part.ANY.getAbbreviation();
}
return value.getAbbreviation();
}
```
Hope this helps! |
ReactiveX/RxJava | src/main/java/io/reactivex/Maybe.java | Maybe.retry | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Maybe<T> retry(long count) {
return retry(count, Functions.alwaysTrue());
} | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Maybe<T> retry(long count) {
return retry(count, Functions.alwaysTrue());
} | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Maybe",
"<",
"T",
">",
"retry",
"(",
"long",
"count",
")",
"{",
"return",
"retry",
"(",
"count",
",",
"Functions",
".",
"alwaysTrue",
"(",
")",... | Returns a Maybe that mirrors the source Maybe, resubscribing to it if it calls {@code onError}
up to a specified number of retries.
<p>
<img width="640" height="315" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/retry.png" alt="">
<p>
If the source Maybe calls {@link MaybeObserver#onError}, this... | [
"Returns",
"a",
"Maybe",
"that",
"mirrors",
"the",
"source",
"Maybe",
"resubscribing",
"to",
"it",
"if",
"it",
"calls",
"{",
"@code",
"onError",
"}",
"up",
"to",
"a",
"specified",
"number",
"of",
"retries",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Maybe.java#L4038-L4042 | test | Retry a sequence of tokens. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Maybe<T> retry(long count) {
return retry(count, Functions.alwaysTrue());
}
```
Hope this helps! |
davidmoten/rxjava-extras | src/main/java/com/github/davidmoten/rx/Transformers.java | Transformers.ignoreElementsThen | public static <R, T> Transformer<T, R> ignoreElementsThen(final Observable<R> next) {
return new Transformer<T, R>() {
@SuppressWarnings("unchecked")
@Override
public Observable<R> call(Observable<T> source) {
return ((Observable<R>) (Observable<?>) source.ig... | java | public static <R, T> Transformer<T, R> ignoreElementsThen(final Observable<R> next) {
return new Transformer<T, R>() {
@SuppressWarnings("unchecked")
@Override
public Observable<R> call(Observable<T> source) {
return ((Observable<R>) (Observable<?>) source.ig... | [
"public",
"static",
"<",
"R",
",",
"T",
">",
"Transformer",
"<",
"T",
",",
"R",
">",
"ignoreElementsThen",
"(",
"final",
"Observable",
"<",
"R",
">",
"next",
")",
"{",
"return",
"new",
"Transformer",
"<",
"T",
",",
"R",
">",
"(",
")",
"{",
"@",
"... | <p>
Returns an observable that subscribes to {@code this} and wait for
completion but doesn't emit any items and once completes emits the
{@code next} observable.
<p>
<img src=
"https://github.com/davidmoten/rxjava-extras/blob/master/src/docs/ignoreElementsThen.png?raw=true"
alt="marble diagram">
@param <R>
input obs... | [
"<p",
">",
"Returns",
"an",
"observable",
"that",
"subscribes",
"to",
"{",
"@code",
"this",
"}",
"and",
"wait",
"for",
"completion",
"but",
"doesn",
"t",
"emit",
"any",
"items",
"and",
"once",
"completes",
"emits",
"the",
"{",
"@code",
"next",
"}",
"obse... | a91d2ba7d454843250e0b0fce36084f9fb02a551 | https://github.com/davidmoten/rxjava-extras/blob/a91d2ba7d454843250e0b0fce36084f9fb02a551/src/main/java/com/github/davidmoten/rx/Transformers.java#L674-L683 | train | Returns a Transformer that ignores all elements from the source observable and adds the next observable to the next observable. | Of course, here is the Java code you requested:
```java
public static <R, T> Transformer<T, R> ignoreElementsThen(final Observable<R> next) {
return new Transformer<T, R>() {
@SuppressWarnings("unchecked")
@Override
public Observable<R> call(Observable<T> source) {
... |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsspparams.java | nsspparams.unset | public static base_response unset(nitro_service client, nsspparams resource, String[] args) throws Exception{
nsspparams unsetresource = new nsspparams();
return unsetresource.unset_resource(client,args);
} | java | public static base_response unset(nitro_service client, nsspparams resource, String[] args) throws Exception{
nsspparams unsetresource = new nsspparams();
return unsetresource.unset_resource(client,args);
} | [
"public",
"static",
"base_response",
"unset",
"(",
"nitro_service",
"client",
",",
"nsspparams",
"resource",
",",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"nsspparams",
"unsetresource",
"=",
"new",
"nsspparams",
"(",
")",
";",
"return",
"un... | Use this API to unset the properties of nsspparams resource.
Properties that need to be unset are specified in args array. | [
"Use",
"this",
"API",
"to",
"unset",
"the",
"properties",
"of",
"nsspparams",
"resource",
".",
"Properties",
"that",
"need",
"to",
"be",
"unset",
"are",
"specified",
"in",
"args",
"array",
"."
] | 2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4 | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/ns/nsspparams.java#L146-L149 | train | Use this API to unset the properties of nsspparams resource. Properties that need to be unset are specified in args array. | Of course, here is the Java code you requested:
```java
public static base_response unset(nitro_service client, nsspparams resource, String[] args) throws Exception{
nsspparams unsetresource = new nsspparams();
return unsetresource.unset_resource(client,args);
}
```
Hope this helps! |
pinterest/secor | src/main/java/com/pinterest/secor/util/ReflectionUtil.java | ReflectionUtil.createMessageTransformer | public static MessageTransformer createMessageTransformer(
String className, SecorConfig config) throws Exception {
Class<?> clazz = Class.forName(className);
if (!MessageTransformer.class.isAssignableFrom(clazz)) {
throw new IllegalArgumentException(String.format(
... | java | public static MessageTransformer createMessageTransformer(
String className, SecorConfig config) throws Exception {
Class<?> clazz = Class.forName(className);
if (!MessageTransformer.class.isAssignableFrom(clazz)) {
throw new IllegalArgumentException(String.format(
... | [
"public",
"static",
"MessageTransformer",
"createMessageTransformer",
"(",
"String",
"className",
",",
"SecorConfig",
"config",
")",
"throws",
"Exception",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"Class",
".",
"forName",
"(",
"className",
")",
";",
"if",
"(... | Create a MessageTransformer from it's fully qualified class name. The
class passed in by name must be assignable to MessageTransformers and have
1-parameter constructor accepting a SecorConfig. Allows the MessageTransformers
to be pluggable by providing the class name of a desired MessageTransformers in
config.
See th... | [
"Create",
"a",
"MessageTransformer",
"from",
"it",
"s",
"fully",
"qualified",
"class",
"name",
".",
"The",
"class",
"passed",
"in",
"by",
"name",
"must",
"be",
"assignable",
"to",
"MessageTransformers",
"and",
"have",
"1",
"-",
"parameter",
"constructor",
"acc... | 4099ff061db392f11044e57dedf46c1617895278 | https://github.com/pinterest/secor/blob/4099ff061db392f11044e57dedf46c1617895278/src/main/java/com/pinterest/secor/util/ReflectionUtil.java#L190-L200 | train | Create a MessageTransformer object from a class name. | Of course, here is the Java code you requested:
```java
public static MessageTransformer createMessageTransformer(
String className, SecorConfig config) throws Exception {
Class<?> clazz = Class.forName(className);
if (!MessageTransformer.class.isAssignableFrom(clazz)) {
throw n... |
isisaddons-legacy/isis-module-devutils | dom/src/main/java/org/isisaddons/module/devutils/dom/DeveloperUtilitiesServiceProgrammatic.java | DeveloperUtilitiesServiceProgrammatic.downloadLayout | public Clob downloadLayout(final Object domainObject) {
final ObjectAdapter adapterFor = adapterManager.adapterFor(domainObject);
final ObjectSpecification objectSpec = adapterFor.getSpecification();
final LayoutJsonExporter exporter = new LayoutJsonExporter();
final String json = expo... | java | public Clob downloadLayout(final Object domainObject) {
final ObjectAdapter adapterFor = adapterManager.adapterFor(domainObject);
final ObjectSpecification objectSpec = adapterFor.getSpecification();
final LayoutJsonExporter exporter = new LayoutJsonExporter();
final String json = expo... | [
"public",
"Clob",
"downloadLayout",
"(",
"final",
"Object",
"domainObject",
")",
"{",
"final",
"ObjectAdapter",
"adapterFor",
"=",
"adapterManager",
".",
"adapterFor",
"(",
"domainObject",
")",
";",
"final",
"ObjectSpecification",
"objectSpec",
"=",
"adapterFor",
".... | ////////////////////////////////////// | [
"//////////////////////////////////////"
] | 58f7f5653467974148dd1ce22cc2df144a74d394 | https://github.com/isisaddons-legacy/isis-module-devutils/blob/58f7f5653467974148dd1ce22cc2df144a74d394/dom/src/main/java/org/isisaddons/module/devutils/dom/DeveloperUtilitiesServiceProgrammatic.java#L163-L172 | train | Download the layout from the domain object. | Of course, here is the Java code you requested:
```java
public Clob downloadLayout(final Object domainObject) {
final ObjectAdapter adapterFor = adapterManager.adapterFor(domainObject);
final ObjectSpecification objectSpec = adapterFor.getSpecification();
final LayoutJsonExporter exporter = n... |
clanie/clanie-core | src/main/java/dk/clanie/collections/CollectionFilters.java | CollectionFilters.removeMatcing | public static <E> void removeMatcing(Collection<E> collection, Matcher<? super E> matcher) {
Iterator<E> iter = collection.iterator();
while (iter.hasNext()) {
E item = iter.next();
if (matcher.matches(item)) iter.remove();
}
} | java | public static <E> void removeMatcing(Collection<E> collection, Matcher<? super E> matcher) {
Iterator<E> iter = collection.iterator();
while (iter.hasNext()) {
E item = iter.next();
if (matcher.matches(item)) iter.remove();
}
} | [
"public",
"static",
"<",
"E",
">",
"void",
"removeMatcing",
"(",
"Collection",
"<",
"E",
">",
"collection",
",",
"Matcher",
"<",
"?",
"super",
"E",
">",
"matcher",
")",
"{",
"Iterator",
"<",
"E",
">",
"iter",
"=",
"collection",
".",
"iterator",
"(",
... | Removes matching elements from the supplied Collection.
@param <E>
@param collection
@param matcher | [
"Removes",
"matching",
"elements",
"from",
"the",
"supplied",
"Collection",
"."
] | ac8a655b93127f0e281b741c4d53f429be2816ad | https://github.com/clanie/clanie-core/blob/ac8a655b93127f0e281b741c4d53f429be2816ad/src/main/java/dk/clanie/collections/CollectionFilters.java#L41-L47 | train | Removes all elements that match the given matcher from the given collection. | Of course, here is the Java code you requested:
```java
public static <E> void removeMatcing(Collection<E> collection, Matcher<? super E> matcher) {
Iterator<E> iter = collection.iterator();
while (iter.hasNext()) {
E item = iter.next();
if (matcher.matches(item)) iter.remove();
}
}
```
Hope this helps! |
qiniu/java-sdk | src/main/java/com/qiniu/processing/OperationManager.java | OperationManager.prefop | public <T> T prefop(String persistentId, Class<T> retClass) throws QiniuException {
StringMap params = new StringMap().put("id", persistentId);
byte[] data = StringUtils.utf8Bytes(params.formString());
String url = String.format("%s/status/get/prefop", configuration.apiHost());
Response ... | java | public <T> T prefop(String persistentId, Class<T> retClass) throws QiniuException {
StringMap params = new StringMap().put("id", persistentId);
byte[] data = StringUtils.utf8Bytes(params.formString());
String url = String.format("%s/status/get/prefop", configuration.apiHost());
Response ... | [
"public",
"<",
"T",
">",
"T",
"prefop",
"(",
"String",
"persistentId",
",",
"Class",
"<",
"T",
">",
"retClass",
")",
"throws",
"QiniuException",
"{",
"StringMap",
"params",
"=",
"new",
"StringMap",
"(",
")",
".",
"put",
"(",
"\"id\"",
",",
"persistentId"... | 根据persistentId查询任务状态
返回结果的 class | [
"根据persistentId查询任务状态",
"返回结果的",
"class"
] | 6c05f3fb718403a496c725b048e9241f80171499 | https://github.com/qiniu/java-sdk/blob/6c05f3fb718403a496c725b048e9241f80171499/src/main/java/com/qiniu/processing/OperationManager.java#L170-L181 | train | prefop a single record from a persistent id | Of course, here is the Java code you requested:
```java
public <T> T prefop(String persistentId, Class<T> retClass) throws QiniuException {
StringMap params = new StringMap().put("id", persistentId);
byte[] data = StringUtils.utf8Bytes(params.formString());
String url = String.format("%s/status... |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/locale/LocaleFormatter.java | LocaleFormatter.getFormatted | @Nonnull
public static String getFormatted (@Nonnull final BigDecimal aValue, @Nonnull final Locale aDisplayLocale)
{
ValueEnforcer.notNull (aValue, "Value");
ValueEnforcer.notNull (aDisplayLocale, "DisplayLocale");
return NumberFormat.getInstance (aDisplayLocale).format (aValue);
} | java | @Nonnull
public static String getFormatted (@Nonnull final BigDecimal aValue, @Nonnull final Locale aDisplayLocale)
{
ValueEnforcer.notNull (aValue, "Value");
ValueEnforcer.notNull (aDisplayLocale, "DisplayLocale");
return NumberFormat.getInstance (aDisplayLocale).format (aValue);
} | [
"@",
"Nonnull",
"public",
"static",
"String",
"getFormatted",
"(",
"@",
"Nonnull",
"final",
"BigDecimal",
"aValue",
",",
"@",
"Nonnull",
"final",
"Locale",
"aDisplayLocale",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aValue",
",",
"\"Value\"",
")",
";",
... | Format the passed value according to the rules specified by the given
locale. All calls to {@link BigDecimal#toString()} that are displayed to
the user should instead use this method. By default a maximum of 3 fraction
digits are shown.
@param aValue
The value to be formatted. May not be <code>null</code>.
@param aDis... | [
"Format",
"the",
"passed",
"value",
"according",
"to",
"the",
"rules",
"specified",
"by",
"the",
"given",
"locale",
".",
"All",
"calls",
"to",
"{",
"@link",
"BigDecimal#toString",
"()",
"}",
"that",
"are",
"displayed",
"to",
"the",
"user",
"should",
"instead... | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/locale/LocaleFormatter.java#L134-L141 | train | Get the formatted value of the passed BigDecimal. | Of course, here is the Java code you requested:
```java
@Nonnull
public static String getFormatted (@Nonnull final BigDecimal aValue, @Nonnull final Locale aDisplayLocale)
{
ValueEnforcer.notNull (aValue, "Value");
ValueEnforcer.notNull (aDisplayLocale, "DisplayLocale");
return NumberFormat.getInstanc... |
JM-Lab/utils-elasticsearch | src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchBulk.java | JMElasticsearchBulk.buildDeleteBulkRequestBuilder | public BulkRequestBuilder buildDeleteBulkRequestBuilder(
List<DeleteRequestBuilder> deleteRequestBuilderList) {
BulkRequestBuilder bulkRequestBuilder = jmESClient.prepareBulk();
for (DeleteRequestBuilder deleteRequestBuilder : deleteRequestBuilderList)
bulkRequestBuilder.add(dele... | java | public BulkRequestBuilder buildDeleteBulkRequestBuilder(
List<DeleteRequestBuilder> deleteRequestBuilderList) {
BulkRequestBuilder bulkRequestBuilder = jmESClient.prepareBulk();
for (DeleteRequestBuilder deleteRequestBuilder : deleteRequestBuilderList)
bulkRequestBuilder.add(dele... | [
"public",
"BulkRequestBuilder",
"buildDeleteBulkRequestBuilder",
"(",
"List",
"<",
"DeleteRequestBuilder",
">",
"deleteRequestBuilderList",
")",
"{",
"BulkRequestBuilder",
"bulkRequestBuilder",
"=",
"jmESClient",
".",
"prepareBulk",
"(",
")",
";",
"for",
"(",
"DeleteReque... | Build delete bulk request builder bulk request builder.
@param deleteRequestBuilderList the delete request builder list
@return the bulk request builder | [
"Build",
"delete",
"bulk",
"request",
"builder",
"bulk",
"request",
"builder",
"."
] | 6ccec90e1e51d65d2af5efbb6d7b9f9bad90e638 | https://github.com/JM-Lab/utils-elasticsearch/blob/6ccec90e1e51d65d2af5efbb6d7b9f9bad90e638/src/main/java/kr/jm/utils/elasticsearch/JMElasticsearchBulk.java#L396-L402 | train | Build bulk request builder bulk request builder. | Of course, here is the Java code you requested:
```java
public BulkRequestBuilder buildDeleteBulkRequestBuilder(
List<DeleteRequestBuilder> deleteRequestBuilderList) {
BulkRequestBuilder bulkRequestBuilder = jmESClient.prepareBulk();
for (DeleteRequestBuilder deleteRequestBuilder : deleteRe... |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/storage/translation/handlers/FOXMLContentHandler.java | FOXMLContentHandler.endElement | @Override
public void endElement(String uri, String localName, String qName)
throws SAXException {
//==================
// INLINE XML...
//==================
if (m_inXMLMetadata) {
//=====================
// AUDIT DATASTREAM...
//======... | java | @Override
public void endElement(String uri, String localName, String qName)
throws SAXException {
//==================
// INLINE XML...
//==================
if (m_inXMLMetadata) {
//=====================
// AUDIT DATASTREAM...
//======... | [
"@",
"Override",
"public",
"void",
"endElement",
"(",
"String",
"uri",
",",
"String",
"localName",
",",
"String",
"qName",
")",
"throws",
"SAXException",
"{",
"//==================",
"// INLINE XML...",
"//==================",
"if",
"(",
"m_inXMLMetadata",
")",
"{",... | {@inheritDoc} | [
"{"
] | 37df51b9b857fd12c6ab8269820d406c3c4ad774 | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/storage/translation/handlers/FOXMLContentHandler.java#L499-L631 | train | Override the end of an XML element. | Of course, here is the Java code you requested:
```java
@Override
public void endElement(String uri, String localName, String qName)
throws SAXException {
//==================
// INLINE XML...
//==================
if (m_inXMLMetadata) {
//====================... |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/KeyManagementServiceClient.java | KeyManagementServiceClient.getPublicKey | public final PublicKey getPublicKey(String name) {
GetPublicKeyRequest request = GetPublicKeyRequest.newBuilder().setName(name).build();
return getPublicKey(request);
} | java | public final PublicKey getPublicKey(String name) {
GetPublicKeyRequest request = GetPublicKeyRequest.newBuilder().setName(name).build();
return getPublicKey(request);
} | [
"public",
"final",
"PublicKey",
"getPublicKey",
"(",
"String",
"name",
")",
"{",
"GetPublicKeyRequest",
"request",
"=",
"GetPublicKeyRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"name",
")",
".",
"build",
"(",
")",
";",
"return",
"getPublicKey",... | Returns the public key for the given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion].
The [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] must be
[ASYMMETRIC_SIGN][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ASYMMETRIC_SIGN] or
[ASYMMETRIC_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.A... | [
"Returns",
"the",
"public",
"key",
"for",
"the",
"given",
"[",
"CryptoKeyVersion",
"]",
"[",
"google",
".",
"cloud",
".",
"kms",
".",
"v1",
".",
"CryptoKeyVersion",
"]",
".",
"The",
"[",
"CryptoKey",
".",
"purpose",
"]",
"[",
"google",
".",
"cloud",
".... | d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-kms/src/main/java/com/google/cloud/kms/v1/KeyManagementServiceClient.java#L2178-L2182 | train | Gets a public key by name. | Of course, here is the Java code you requested:
```java
public final PublicKey getPublicKey(String name) {
GetPublicKeyRequest request = GetPublicKeyRequest.newBuilder().setName(name).build();
return getPublicKey(request);
}
```
Hope this helps! |
nakamura5akihito/six-util | src/main/java/jp/go/aist/six/util/core/xml/spring327/CastorMarshaller.java | CastorMarshaller.unmarshalDomNode | @Override
protected final Object unmarshalDomNode(Node node) throws XmlMappingException {
try {
return createUnmarshaller().unmarshal(node);
}
catch (XMLException ex) {
throw convertCastorException(ex, false);
}
} | java | @Override
protected final Object unmarshalDomNode(Node node) throws XmlMappingException {
try {
return createUnmarshaller().unmarshal(node);
}
catch (XMLException ex) {
throw convertCastorException(ex, false);
}
} | [
"@",
"Override",
"protected",
"final",
"Object",
"unmarshalDomNode",
"(",
"Node",
"node",
")",
"throws",
"XmlMappingException",
"{",
"try",
"{",
"return",
"createUnmarshaller",
"(",
")",
".",
"unmarshal",
"(",
"node",
")",
";",
"}",
"catch",
"(",
"XMLException... | Unmarshalling | [
"Unmarshalling"
] | a6db388a345e220cea2b1fa6324d15c80c6278b6 | https://github.com/nakamura5akihito/six-util/blob/a6db388a345e220cea2b1fa6324d15c80c6278b6/src/main/java/jp/go/aist/six/util/core/xml/spring327/CastorMarshaller.java#L584-L592 | train | Unmarshals a DOM node. | Of course, here is the Java code you requested:
```java
@Override
protected final Object unmarshalDomNode(Node node) throws XmlMappingException {
try {
return createUnmarshaller().unmarshal(node);
}
catch (XMLException ex) {
throw convertCastorException(ex, false);
}
}
```
Hope this helps! |
krummas/DrizzleJDBC | src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java | DrizzlePreparedStatement.setObject | public void setObject(final int parameterIndex, final Object x, final int targetSqlType, final int scaleOrLength) throws SQLException {
if (x == null) {
setNull(parameterIndex, targetSqlType);
return;
}
switch (targetSqlType) {
case Types.ARRAY:
ca... | java | public void setObject(final int parameterIndex, final Object x, final int targetSqlType, final int scaleOrLength) throws SQLException {
if (x == null) {
setNull(parameterIndex, targetSqlType);
return;
}
switch (targetSqlType) {
case Types.ARRAY:
ca... | [
"public",
"void",
"setObject",
"(",
"final",
"int",
"parameterIndex",
",",
"final",
"Object",
"x",
",",
"final",
"int",
"targetSqlType",
",",
"final",
"int",
"scaleOrLength",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"x",
"==",
"null",
")",
"{",
"setN... | <p>Sets the value of the designated parameter with the given object. The second argument must be an object type;
for integral values, the <code>java.lang</code> equivalent objects should be used.
<p/>
If the second argument is an <code>InputStream</code> then the stream must contain the number of bytes specified
by sca... | [
"<p",
">",
"Sets",
"the",
"value",
"of",
"the",
"designated",
"parameter",
"with",
"the",
"given",
"object",
".",
"The",
"second",
"argument",
"must",
"be",
"an",
"object",
"type",
";",
"for",
"integral",
"values",
"the",
"<code",
">",
"java",
".",
"lang... | 716f31fd71f3cc289edf69844d8117deb86d98d6 | https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java#L701-L728 | train | Sets the designated parameter to the given value using the specified SQL type. | Of course, here is the Java code you requested:
```java
public void setObject(final int parameterIndex, final Object x, final int targetSqlType, final int scaleOrLength) throws SQLException {
if (x == null) {
setNull(parameterIndex, targetSqlType);
return;
}
switch (targ... |
moparisthebest/beehive | beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeHelpers.java | TreeHelpers.findSelected | public static TreeElement findSelected(TreeElement root)
{
assert (root != null) : "parameter 'root' must not be null";
if (root instanceof ITreeRootElement) {
return ((ITreeRootElement) root).getSelectedNode();
}
return recursiveFindSelected(root);
} | java | public static TreeElement findSelected(TreeElement root)
{
assert (root != null) : "parameter 'root' must not be null";
if (root instanceof ITreeRootElement) {
return ((ITreeRootElement) root).getSelectedNode();
}
return recursiveFindSelected(root);
} | [
"public",
"static",
"TreeElement",
"findSelected",
"(",
"TreeElement",
"root",
")",
"{",
"assert",
"(",
"root",
"!=",
"null",
")",
":",
"\"parameter 'root' must not be null\"",
";",
"if",
"(",
"root",
"instanceof",
"ITreeRootElement",
")",
"{",
"return",
"(",
"(... | This will return the currently selected node from a tree.
<p>Implementation Note: The method that changes the selected node based on the request,
{@link #processTreeRequest(String, TreeElement, HttpServletRequest, HttpServletResponse)},
gets called during the processing of the {@link Tree} tag within a JSP. If the
<co... | [
"This",
"will",
"return",
"the",
"currently",
"selected",
"node",
"from",
"a",
"tree",
"."
] | 4246a0cc40ce3c05f1a02c2da2653ac622703d77 | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-tags/src/main/java/org/apache/beehive/netui/tags/tree/TreeHelpers.java#L119-L126 | train | Find the selected node in the tree. | Of course, here is the Java code you requested:
```java
public static TreeElement findSelected(TreeElement root)
{
assert (root != null) : "parameter 'root' must not be null";
if (root instanceof ITreeRootElement) {
return ((ITreeRootElement) root).getSelectedNode();
}
r... |
facebook/fresco | imagepipeline/src/main/java/com/facebook/imagepipeline/request/BasePostprocessor.java | BasePostprocessor.process | @Override
public CloseableReference<Bitmap> process(
Bitmap sourceBitmap,
PlatformBitmapFactory bitmapFactory) {
final Bitmap.Config sourceBitmapConfig = sourceBitmap.getConfig();
CloseableReference<Bitmap> destBitmapRef =
bitmapFactory.createBitmapInternal(
sourceBitmap.getWid... | java | @Override
public CloseableReference<Bitmap> process(
Bitmap sourceBitmap,
PlatformBitmapFactory bitmapFactory) {
final Bitmap.Config sourceBitmapConfig = sourceBitmap.getConfig();
CloseableReference<Bitmap> destBitmapRef =
bitmapFactory.createBitmapInternal(
sourceBitmap.getWid... | [
"@",
"Override",
"public",
"CloseableReference",
"<",
"Bitmap",
">",
"process",
"(",
"Bitmap",
"sourceBitmap",
",",
"PlatformBitmapFactory",
"bitmapFactory",
")",
"{",
"final",
"Bitmap",
".",
"Config",
"sourceBitmapConfig",
"=",
"sourceBitmap",
".",
"getConfig",
"("... | Clients should override this method only if the post-processed bitmap has to be of a different
size than the source bitmap. If the post-processed bitmap is of the same size, clients should
override one of the other two methods.
<p> The source bitmap must not be modified as it may be shared by the other clients. The
im... | [
"Clients",
"should",
"override",
"this",
"method",
"only",
"if",
"the",
"post",
"-",
"processed",
"bitmap",
"has",
"to",
"be",
"of",
"a",
"different",
"size",
"than",
"the",
"source",
"bitmap",
".",
"If",
"the",
"post",
"-",
"processed",
"bitmap",
"is",
... | 0b85879d51c5036d5e46e627a6651afefc0b971a | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline/src/main/java/com/facebook/imagepipeline/request/BasePostprocessor.java#L50-L66 | train | Process a single image. | Of course, here is the Java code you requested:
```java
@Override
public CloseableReference<Bitmap> process(
Bitmap sourceBitmap,
PlatformBitmapFactory bitmapFactory) {
final Bitmap.Config sourceBitmapConfig = sourceBitmap.getConfig();
CloseableReference<Bitmap> destBitmapRef =
bitmapFact... |
JOML-CI/JOML | src/org/joml/Matrix4x3d.java | Matrix4x3d.set | public Matrix4x3d set(Matrix3dc mat) {
m00 = mat.m00();
m01 = mat.m01();
m02 = mat.m02();
m10 = mat.m10();
m11 = mat.m11();
m12 = mat.m12();
m20 = mat.m20();
m21 = mat.m21();
m22 = mat.m22();
m30 = 0.0;
m31 = 0.0;
m32 = 0.0;... | java | public Matrix4x3d set(Matrix3dc mat) {
m00 = mat.m00();
m01 = mat.m01();
m02 = mat.m02();
m10 = mat.m10();
m11 = mat.m11();
m12 = mat.m12();
m20 = mat.m20();
m21 = mat.m21();
m22 = mat.m22();
m30 = 0.0;
m31 = 0.0;
m32 = 0.0;... | [
"public",
"Matrix4x3d",
"set",
"(",
"Matrix3dc",
"mat",
")",
"{",
"m00",
"=",
"mat",
".",
"m00",
"(",
")",
";",
"m01",
"=",
"mat",
".",
"m01",
"(",
")",
";",
"m02",
"=",
"mat",
".",
"m02",
"(",
")",
";",
"m10",
"=",
"mat",
".",
"m10",
"(",
... | Set the left 3x3 submatrix of this {@link Matrix4x3d} to the given {@link Matrix3dc}
and the rest to identity.
@see #Matrix4x3d(Matrix3dc)
@param mat
the {@link Matrix3dc}
@return this | [
"Set",
"the",
"left",
"3x3",
"submatrix",
"of",
"this",
"{",
"@link",
"Matrix4x3d",
"}",
"to",
"the",
"given",
"{",
"@link",
"Matrix3dc",
"}",
"and",
"the",
"rest",
"to",
"identity",
"."
] | ce2652fc236b42bda3875c591f8e6645048a678f | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4x3d.java#L752-L767 | train | Sets the matrix to be the same as the matrix passed in. | Of course, here is the Java code you requested:
```java
public Matrix4x3d set(Matrix3dc mat) {
m00 = mat.m00();
m01 = mat.m01();
m02 = mat.m02();
m10 = mat.m10();
m11 = mat.m11();
m12 = mat.m12();
m20 = mat.m20();
m21 = mat.m21();
m22 = mat.m22();... |
fge/grappa | src/main/java/com/github/fge/grappa/misc/RangeMatcherBuilder.java | RangeMatcherBuilder.min | public Rule min(final int nrCycles)
{
Preconditions.checkArgument(nrCycles >= 0,
"illegal repetition number specified (" + nrCycles
+ "), must be 0 or greater");
return range(Range.atLeast(nrCycles));
} | java | public Rule min(final int nrCycles)
{
Preconditions.checkArgument(nrCycles >= 0,
"illegal repetition number specified (" + nrCycles
+ "), must be 0 or greater");
return range(Range.atLeast(nrCycles));
} | [
"public",
"Rule",
"min",
"(",
"final",
"int",
"nrCycles",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"nrCycles",
">=",
"0",
",",
"\"illegal repetition number specified (\"",
"+",
"nrCycles",
"+",
"\"), must be 0 or greater\"",
")",
";",
"return",
"range",... | Return a rule with a minimum number of cycles to run
@param nrCycles the number of cycles
@return a rule
@throws IllegalArgumentException {@code nrCycles} is less than 0
@see Range#atLeast(Comparable) | [
"Return",
"a",
"rule",
"with",
"a",
"minimum",
"number",
"of",
"cycles",
"to",
"run"
] | 7ade86b8371aec4e2b9a6815a85cf88a12eba6e4 | https://github.com/fge/grappa/blob/7ade86b8371aec4e2b9a6815a85cf88a12eba6e4/src/main/java/com/github/fge/grappa/misc/RangeMatcherBuilder.java#L61-L67 | valid | Gets the minimum rule. | Of course, here is the Java code you requested:
```java
public Rule min(final int nrCycles)
{
Preconditions.checkArgument(nrCycles >= 0,
"illegal repetition number specified (" + nrCycles
+ "), must be 0 or greater");
return range(Range.atLeast(nrCycles));
}
```
Hop... |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TimeZoneFormat.java | TimeZoneFormat.formatExemplarLocation | private String formatExemplarLocation(TimeZone tz) {
String location = getTimeZoneNames().getExemplarLocationName(ZoneMeta.getCanonicalCLDRID(tz));
if (location == null) {
// Use "unknown" location
location = getTimeZoneNames().getExemplarLocationName(UNKNOWN_ZONE_ID);
... | java | private String formatExemplarLocation(TimeZone tz) {
String location = getTimeZoneNames().getExemplarLocationName(ZoneMeta.getCanonicalCLDRID(tz));
if (location == null) {
// Use "unknown" location
location = getTimeZoneNames().getExemplarLocationName(UNKNOWN_ZONE_ID);
... | [
"private",
"String",
"formatExemplarLocation",
"(",
"TimeZone",
"tz",
")",
"{",
"String",
"location",
"=",
"getTimeZoneNames",
"(",
")",
".",
"getExemplarLocationName",
"(",
"ZoneMeta",
".",
"getCanonicalCLDRID",
"(",
"tz",
")",
")",
";",
"if",
"(",
"location",
... | Private method returning the time zone's exemplar location string.
This method will never return null.
@param tz the time zone
@return the time zone's exemplar location name. | [
"Private",
"method",
"returning",
"the",
"time",
"zone",
"s",
"exemplar",
"location",
"string",
".",
"This",
"method",
"will",
"never",
"return",
"null",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TimeZoneFormat.java#L1732-L1743 | train | Format the EXEMPLAR location. | Of course, here is the Java code you requested:
```java
private String formatExemplarLocation(TimeZone tz) {
String location = getTimeZoneNames().getExemplarLocationName(ZoneMeta.getCanonicalCLDRID(tz));
if (location == null) {
// Use "unknown" location
location = getTimeZoneNam... |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsTopicImpl.java | JmsTopicImpl.setTopicName | @Override
public void setTopicName(String tName) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setTopicName", tName);
setDestDiscrim(tName);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
... | java | @Override
public void setTopicName(String tName) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setTopicName", tName);
setDestDiscrim(tName);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
... | [
"@",
"Override",
"public",
"void",
"setTopicName",
"(",
"String",
"tName",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
... | Set the topicName.
@param tName The name of the topic
@throws JMSException If setDestDiscrim throws one.
@see JmsDestinationImpl#setDestDiscrim | [
"Set",
"the",
"topicName",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsTopicImpl.java#L90-L97 | train | Set the topic name for the topic. | Of course, here is the Java code you requested:
```java
@Override
public void setTopicName(String tName) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setTopicName", tName);
setDestDiscrim(tName);
if (TraceComponent... |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/util/CollectionUtils.java | CollectionUtils.findOne | public static <T> T findOne(Iterable<T> iterable, Filter<T> filter) {
Assert.notNull(filter, "Filter is required");
return StreamSupport.stream(nullSafeIterable(iterable).spliterator(), false)
.filter(filter::accept)
.findFirst().orElse(null);
} | java | public static <T> T findOne(Iterable<T> iterable, Filter<T> filter) {
Assert.notNull(filter, "Filter is required");
return StreamSupport.stream(nullSafeIterable(iterable).spliterator(), false)
.filter(filter::accept)
.findFirst().orElse(null);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"findOne",
"(",
"Iterable",
"<",
"T",
">",
"iterable",
",",
"Filter",
"<",
"T",
">",
"filter",
")",
"{",
"Assert",
".",
"notNull",
"(",
"filter",
",",
"\"Filter is required\"",
")",
";",
"return",
"StreamSupport",
... | Searches the {@link Iterable} for the first element accepted by the {@link Filter}.
@param <T> Class type of the elements in the {@link Iterable}.
@param iterable {@link Iterable} collection of elements to search.
@param filter {@link Filter} used to find the first element from the {@link Iterable} accepted
by the {@l... | [
"Searches",
"the",
"{",
"@link",
"Iterable",
"}",
"for",
"the",
"first",
"element",
"accepted",
"by",
"the",
"{",
"@link",
"Filter",
"}",
"."
] | f2163c149fbbef05015e688132064ebcac7c49ab | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/util/CollectionUtils.java#L415-L422 | train | Find one element from iterable | Of course, here is the Java code you requested:
```java
public static <T> T findOne(Iterable<T> iterable, Filter<T> filter) {
Assert.notNull(filter, "Filter is required");
return StreamSupport.stream(nullSafeIterable(iterable).spliterator(), false)
.filter(filter::accept)
.findFirst().orElse(null... |
finmath/finmath-lib | src/main/java/net/finmath/time/ScheduleGenerator.java | ScheduleGenerator.createScheduleFromConventions | public static Schedule createScheduleFromConventions(
LocalDate referenceDate,
int spotOffsetDays,
String startOffsetString,
String maturityString,
String frequency,
String daycountConvention,
String shortPeriodConvention,
String dateRollConvention,
BusinessdayCalendar businessdayCalendar,
... | java | public static Schedule createScheduleFromConventions(
LocalDate referenceDate,
int spotOffsetDays,
String startOffsetString,
String maturityString,
String frequency,
String daycountConvention,
String shortPeriodConvention,
String dateRollConvention,
BusinessdayCalendar businessdayCalendar,
... | [
"public",
"static",
"Schedule",
"createScheduleFromConventions",
"(",
"LocalDate",
"referenceDate",
",",
"int",
"spotOffsetDays",
",",
"String",
"startOffsetString",
",",
"String",
"maturityString",
",",
"String",
"frequency",
",",
"String",
"daycountConvention",
",",
"... | Simple schedule generation where startDate and maturityDate are calculated based on referenceDate, spotOffsetDays, startOffsetString and maturityString.
The schedule generation considers short periods. Date rolling is ignored.
@param referenceDate The date which is used in the schedule to internally convert dates to ... | [
"Simple",
"schedule",
"generation",
"where",
"startDate",
"and",
"maturityDate",
"are",
"calculated",
"based",
"on",
"referenceDate",
"spotOffsetDays",
"startOffsetString",
"and",
"maturityString",
"."
] | a3c067d52dd33feb97d851df6cab130e4116759f | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/time/ScheduleGenerator.java#L613-L629 | train | Creates a Schedule object from the specified conventions. | Of course, here is the Java code you requested:
```java
public static Schedule createScheduleFromConventions(
LocalDate referenceDate,
int spotOffsetDays,
String startOffsetString,
String maturityString,
String frequency,
String daycountConvention,
String shortPeriodConvention,
String dateRollC... |
nextreports/nextreports-engine | src/ro/nextreports/engine/querybuilder/sql/SelectQuery.java | SelectQuery.appendList | private void appendList(Output out, Collection collection, String separator, boolean areColumns) {
Iterator it = collection.iterator();
boolean hasNext = it.hasNext();
//boolean areColumns = (columns == collection);
while (hasNext) {
Outputable sqlToken = (Outputable) it.nex... | java | private void appendList(Output out, Collection collection, String separator, boolean areColumns) {
Iterator it = collection.iterator();
boolean hasNext = it.hasNext();
//boolean areColumns = (columns == collection);
while (hasNext) {
Outputable sqlToken = (Outputable) it.nex... | [
"private",
"void",
"appendList",
"(",
"Output",
"out",
",",
"Collection",
"collection",
",",
"String",
"separator",
",",
"boolean",
"areColumns",
")",
"{",
"Iterator",
"it",
"=",
"collection",
".",
"iterator",
"(",
")",
";",
"boolean",
"hasNext",
"=",
"it",
... | Iterate through a Collection and append all entries (using .toString()) to
a StringBuffer. | [
"Iterate",
"through",
"a",
"Collection",
"and",
"append",
"all",
"entries",
"(",
"using",
".",
"toString",
"()",
")",
"to",
"a",
"StringBuffer",
"."
] | a847575a9298b5fce63b88961190c5b83ddccc44 | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/querybuilder/sql/SelectQuery.java#L671-L695 | train | Append list. | Of course, here is the Java code you requested:
```java
private void appendList(Output out, Collection collection, String separator, boolean areColumns) {
Iterator it = collection.iterator();
boolean hasNext = it.hasNext();
//boolean areColumns = (columns == collection);
while (hasNext... |
epam/parso | src/main/java/com/epam/parso/impl/SasFileParser.java | SasFileParser.trimBytesArray | private byte[] trimBytesArray(byte[] source, int offset, int length) {
int lengthFromBegin;
for (lengthFromBegin = offset + length; lengthFromBegin > offset; lengthFromBegin--) {
if (source[lengthFromBegin - 1] != ' ' && source[lengthFromBegin - 1] != '\0'
&& source[lengt... | java | private byte[] trimBytesArray(byte[] source, int offset, int length) {
int lengthFromBegin;
for (lengthFromBegin = offset + length; lengthFromBegin > offset; lengthFromBegin--) {
if (source[lengthFromBegin - 1] != ' ' && source[lengthFromBegin - 1] != '\0'
&& source[lengt... | [
"private",
"byte",
"[",
"]",
"trimBytesArray",
"(",
"byte",
"[",
"]",
"source",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"int",
"lengthFromBegin",
";",
"for",
"(",
"lengthFromBegin",
"=",
"offset",
"+",
"length",
";",
"lengthFromBegin",
">",
... | The function to remove excess symbols from the end of a bytes array. Excess symbols are line end characters,
tabulation characters, and spaces, which do not contain useful information.
@param source an array of bytes containing required data.
@param offset the offset in source of required data.
@param length the lengt... | [
"The",
"function",
"to",
"remove",
"excess",
"symbols",
"from",
"the",
"end",
"of",
"a",
"bytes",
"array",
".",
"Excess",
"symbols",
"are",
"line",
"end",
"characters",
"tabulation",
"characters",
"and",
"spaces",
"which",
"do",
"not",
"contain",
"useful",
"... | fb132cf943ba099a35b2f5a1490c0a59641e09dc | https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/impl/SasFileParser.java#L951-L965 | train | trim bytes array. | Of course, here is the Java code you requested:
```java
private byte[] trimBytesArray(byte[] source, int offset, int length) {
int lengthFromBegin;
for (lengthFromBegin = offset + length; lengthFromBegin > offset; lengthFromBegin--) {
if (source[lengthFromBegin - 1] != ' ' && source[lengthF... |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/ApplicationMetadata.java | ApplicationMetadata.getQuery | public String getQuery(String name)
{
QueryWrapper wrapper = namedNativeQueries != null && name != null ? namedNativeQueries.get(name) : null;
return wrapper != null ? wrapper.getQuery() : null;
} | java | public String getQuery(String name)
{
QueryWrapper wrapper = namedNativeQueries != null && name != null ? namedNativeQueries.get(name) : null;
return wrapper != null ? wrapper.getQuery() : null;
} | [
"public",
"String",
"getQuery",
"(",
"String",
"name",
")",
"{",
"QueryWrapper",
"wrapper",
"=",
"namedNativeQueries",
"!=",
"null",
"&&",
"name",
"!=",
"null",
"?",
"namedNativeQueries",
".",
"get",
"(",
"name",
")",
":",
"null",
";",
"return",
"wrapper",
... | Returns query interface.
@param name
query name.
@return query. | [
"Returns",
"query",
"interface",
"."
] | 268958ab1ec09d14ec4d9184f0c8ded7a9158908 | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/ApplicationMetadata.java#L268-L272 | train | Gets the query for a named resource. | Of course, here is the Java code you requested:
```java
public String getQuery(String name)
{
QueryWrapper wrapper = namedNativeQueries != null && name != null ? namedNativeQueries.get(name) : null;
return wrapper != null ? wrapper.getQuery() : null;
}
```
Hope this helps! |
forge/javaee-descriptors | impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/ejbjar30/AssemblyDescriptorTypeImpl.java | AssemblyDescriptorTypeImpl.getOrCreateExcludeList | public ExcludeListType<AssemblyDescriptorType<T>> getOrCreateExcludeList()
{
Node node = childNode.getOrCreate("exclude-list");
ExcludeListType<AssemblyDescriptorType<T>> excludeList = new ExcludeListTypeImpl<AssemblyDescriptorType<T>>(this, "exclude-list", childNode, node);
return excludeList;
... | java | public ExcludeListType<AssemblyDescriptorType<T>> getOrCreateExcludeList()
{
Node node = childNode.getOrCreate("exclude-list");
ExcludeListType<AssemblyDescriptorType<T>> excludeList = new ExcludeListTypeImpl<AssemblyDescriptorType<T>>(this, "exclude-list", childNode, node);
return excludeList;
... | [
"public",
"ExcludeListType",
"<",
"AssemblyDescriptorType",
"<",
"T",
">",
">",
"getOrCreateExcludeList",
"(",
")",
"{",
"Node",
"node",
"=",
"childNode",
".",
"getOrCreate",
"(",
"\"exclude-list\"",
")",
";",
"ExcludeListType",
"<",
"AssemblyDescriptorType",
"<",
... | If not already created, a new <code>exclude-list</code> element with the given value will be created.
Otherwise, the existing <code>exclude-list</code> element will be returned.
@return a new or existing instance of <code>ExcludeListType<AssemblyDescriptorType<T>></code> | [
"If",
"not",
"already",
"created",
"a",
"new",
"<code",
">",
"exclude",
"-",
"list<",
"/",
"code",
">",
"element",
"with",
"the",
"given",
"value",
"will",
"be",
"created",
".",
"Otherwise",
"the",
"existing",
"<code",
">",
"exclude",
"-",
"list<",
"/",
... | cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed | https://github.com/forge/javaee-descriptors/blob/cb914330a1a0b04bfc1d0f199bd9cde3bbf0b3ed/impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/ejbjar30/AssemblyDescriptorTypeImpl.java#L344-L349 | train | Get the ExcludeListType object from the database. | Of course, here is the Java code you requested:
```java
public ExcludeListType<AssemblyDescriptorType<T>> getOrCreateExcludeList()
{
Node node = childNode.getOrCreate("exclude-list");
ExcludeListType<AssemblyDescriptorType<T>> excludeList = new ExcludeListTypeImpl<AssemblyDescriptorType<T>>(this, "exclu... |
WASdev/ci.common | src/main/java/net/wasdev/wlp/common/plugins/util/InstallFeatureUtil.java | InstallFeatureUtil.extractVersion | private static String extractVersion(String fileName) {
int startIndex = INSTALL_MAP_PREFIX.length() + 1; // skip the underscore after the prefix
int endIndex = fileName.lastIndexOf(INSTALL_MAP_SUFFIX);
if (startIndex < endIndex) {
return fileName.substring(startIndex, endIndex);
... | java | private static String extractVersion(String fileName) {
int startIndex = INSTALL_MAP_PREFIX.length() + 1; // skip the underscore after the prefix
int endIndex = fileName.lastIndexOf(INSTALL_MAP_SUFFIX);
if (startIndex < endIndex) {
return fileName.substring(startIndex, endIndex);
... | [
"private",
"static",
"String",
"extractVersion",
"(",
"String",
"fileName",
")",
"{",
"int",
"startIndex",
"=",
"INSTALL_MAP_PREFIX",
".",
"length",
"(",
")",
"+",
"1",
";",
"// skip the underscore after the prefix",
"int",
"endIndex",
"=",
"fileName",
".",
"lastI... | Returns the extracted version from fileName
@param fileName
@return the version extracted from fileName | [
"Returns",
"the",
"extracted",
"version",
"from",
"fileName"
] | 24fc917383e9ff60ea6a42972c86577fe0f4591e | https://github.com/WASdev/ci.common/blob/24fc917383e9ff60ea6a42972c86577fe0f4591e/src/main/java/net/wasdev/wlp/common/plugins/util/InstallFeatureUtil.java#L902-L910 | test | Extract the version from a file name. | Of course, here is the Java code you requested:
```java
private static String extractVersion(String fileName) {
int startIndex = INSTALL_MAP_PREFIX.length() + 1; // skip the underscore after the prefix
int endIndex = fileName.lastIndexOf(INSTALL_MAP_SUFFIX);
if (startIndex < endIndex) {
... |
cloudfoundry/cf-java-client | cloudfoundry-util/src/main/java/org/cloudfoundry/util/tuple/TupleUtils.java | TupleUtils.consumer | public static <T1, T2, T3, T4> Consumer<Tuple4<T1, T2, T3, T4>> consumer(Consumer4<T1, T2, T3, T4> consumer) {
return tuple -> consumer.accept(tuple.getT1(), tuple.getT2(), tuple.getT3(), tuple.getT4());
} | java | public static <T1, T2, T3, T4> Consumer<Tuple4<T1, T2, T3, T4>> consumer(Consumer4<T1, T2, T3, T4> consumer) {
return tuple -> consumer.accept(tuple.getT1(), tuple.getT2(), tuple.getT3(), tuple.getT4());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
">",
"Consumer",
"<",
"Tuple4",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
">",
">",
"consumer",
"(",
"Consumer4",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"T4",
">",
"consumer",
"... | Returns a {@link Consumer} of {@link Tuple4} that wraps a consumer of the component values of the tuple
@param consumer the component value consumer
@param <T1> the type of the first value
@param <T2> the type of the second value
@param <T3> the type of the third value
@param <T4> the type of the fourt... | [
"Returns",
"a",
"{",
"@link",
"Consumer",
"}",
"of",
"{",
"@link",
"Tuple4",
"}",
"that",
"wraps",
"a",
"consumer",
"of",
"the",
"component",
"values",
"of",
"the",
"tuple"
] | caa1cb889cfe8717614c071703d833a1540784df | https://github.com/cloudfoundry/cf-java-client/blob/caa1cb889cfe8717614c071703d833a1540784df/cloudfoundry-util/src/main/java/org/cloudfoundry/util/tuple/TupleUtils.java#L71-L73 | train | Create an consumer from a consumer. | Of course, here is the Java code you requested:
```java
public static <T1, T2, T3, T4> Consumer<Tuple4<T1, T2, T3, T4>> consumer(Consumer4<T1, T2, T3, T4> consumer) {
return tuple -> consumer.accept(tuple.getT1(), tuple.getT2(), tuple.getT3(), tuple.getT4());
}
```
Hope this helps! |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/executioner/OpExecutionerUtil.java | OpExecutionerUtil.get1DTensorStats | public static Tensor1DStats get1DTensorStats(INDArray array, int... dimension) {
long tensorLength = array.size(dimension[0]);
//As per tensorssAlongDimension:
long numTensors = array.tensorssAlongDimension(dimension);
//First tensor always starts with the first element in the NDArray,... | java | public static Tensor1DStats get1DTensorStats(INDArray array, int... dimension) {
long tensorLength = array.size(dimension[0]);
//As per tensorssAlongDimension:
long numTensors = array.tensorssAlongDimension(dimension);
//First tensor always starts with the first element in the NDArray,... | [
"public",
"static",
"Tensor1DStats",
"get1DTensorStats",
"(",
"INDArray",
"array",
",",
"int",
"...",
"dimension",
")",
"{",
"long",
"tensorLength",
"=",
"array",
".",
"size",
"(",
"dimension",
"[",
"0",
"]",
")",
";",
"//As per tensorssAlongDimension:",
"long",... | Tensor1DStats, used to efficiently iterate through tensors on a matrix (2d NDArray) for element-wise ops
For example, the offset of each 1d tensor can be calculated using only a single tensorAlongDimension method call,
hence is potentially faster than approaches requiring multiple tensorAlongDimension calls.<br>
Note t... | [
"Tensor1DStats",
"used",
"to",
"efficiently",
"iterate",
"through",
"tensors",
"on",
"a",
"matrix",
"(",
"2d",
"NDArray",
")",
"for",
"element",
"-",
"wise",
"ops",
"For",
"example",
"the",
"offset",
"of",
"each",
"1d",
"tensor",
"can",
"be",
"calculated",
... | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/ops/executioner/OpExecutionerUtil.java#L326-L348 | test | Get the 1D tensor statistics for the given dimension | Of course, here is the Java code you requested:
```java
public static Tensor1DStats get1DTensorStats(INDArray array, int... dimension) {
long tensorLength = array.size(dimension[0]);
//As per tensorssAlongDimension:
long numTensors = array.tensorssAlongDimension(dimension);
//First te... |
onepf/OPFUtils | opfutils/src/main/java/org/onepf/opfutils/OPFChecks.java | OPFChecks.checkPermission | public static void checkPermission(@NonNull final Context context,
@NonNull final String permission,
@NonNull final String exceptionMessage) {
if (!hasPermission(context, permission)) {
throw new SecurityException(exceptio... | java | public static void checkPermission(@NonNull final Context context,
@NonNull final String permission,
@NonNull final String exceptionMessage) {
if (!hasPermission(context, permission)) {
throw new SecurityException(exceptio... | [
"public",
"static",
"void",
"checkPermission",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"NonNull",
"final",
"String",
"permission",
",",
"@",
"NonNull",
"final",
"String",
"exceptionMessage",
")",
"{",
"if",
"(",
"!",
"hasPermission",
"(",... | Checks if supplied permission is requested in AndroidManifest.xml file.
<p/>
Throws {@link SecurityException} if it's not.
@param context The instance of {@link android.content.Context}.
@param permission The checked permission.
@param exceptionMessage The exception message. | [
"Checks",
"if",
"supplied",
"permission",
"is",
"requested",
"in",
"AndroidManifest",
".",
"xml",
"file",
".",
"<p",
"/",
">",
"Throws",
"{",
"@link",
"SecurityException",
"}",
"if",
"it",
"s",
"not",
"."
] | e30c2c64077c5d577c0cd7d3cead809d31f7dab1 | https://github.com/onepf/OPFUtils/blob/e30c2c64077c5d577c0cd7d3cead809d31f7dab1/opfutils/src/main/java/org/onepf/opfutils/OPFChecks.java#L135-L141 | train | Check if a user has the specified permission. | Of course, here is the Java code you requested:
```java
public static void checkPermission(@NonNull final Context context,
@NonNull final String permission,
@NonNull final String exceptionMessage) {
if (!hasPermission(context, permis... |
apache/flink | flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java | AbstractYarnClusterDescriptor.validateClusterSpecification | private void validateClusterSpecification(ClusterSpecification clusterSpecification) throws FlinkException {
try {
final long taskManagerMemorySize = clusterSpecification.getTaskManagerMemoryMB();
// We do the validation by calling the calculation methods here
// Internally these methods will check whether t... | java | private void validateClusterSpecification(ClusterSpecification clusterSpecification) throws FlinkException {
try {
final long taskManagerMemorySize = clusterSpecification.getTaskManagerMemoryMB();
// We do the validation by calling the calculation methods here
// Internally these methods will check whether t... | [
"private",
"void",
"validateClusterSpecification",
"(",
"ClusterSpecification",
"clusterSpecification",
")",
"throws",
"FlinkException",
"{",
"try",
"{",
"final",
"long",
"taskManagerMemorySize",
"=",
"clusterSpecification",
".",
"getTaskManagerMemoryMB",
"(",
")",
";",
"... | Method to validate cluster specification before deploy it, it will throw
an {@link FlinkException} if the {@link ClusterSpecification} is invalid.
@param clusterSpecification cluster specification to check against the configuration of the
AbstractYarnClusterDescriptor
@throws FlinkException if the cluster cannot be st... | [
"Method",
"to",
"validate",
"cluster",
"specification",
"before",
"deploy",
"it",
"it",
"will",
"throw",
"an",
"{",
"@link",
"FlinkException",
"}",
"if",
"the",
"{",
"@link",
"ClusterSpecification",
"}",
"is",
"invalid",
"."
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-yarn/src/main/java/org/apache/flink/yarn/AbstractYarnClusterDescriptor.java#L412-L424 | train | Validate the cluster specification. | Of course, here is the Java code you requested:
```java
private void validateClusterSpecification(ClusterSpecification clusterSpecification) throws FlinkException {
try {
final long taskManagerMemorySize = clusterSpecification.getTaskManagerMemoryMB();
// We do the validation by calling the calculation methods... |
Appendium/objectlabkit | utils/src/main/java/net/objectlab/kit/util/Util.java | Util.buildStackTraceString | public static String buildStackTraceString(final Throwable ex) {
final StringBuilder context = new StringBuilder(ex.toString());
final StringWriter sw = new StringWriter();
ex.printStackTrace(new PrintWriter(sw, true));
context.append('\n');
context.append(sw.toString());
... | java | public static String buildStackTraceString(final Throwable ex) {
final StringBuilder context = new StringBuilder(ex.toString());
final StringWriter sw = new StringWriter();
ex.printStackTrace(new PrintWriter(sw, true));
context.append('\n');
context.append(sw.toString());
... | [
"public",
"static",
"String",
"buildStackTraceString",
"(",
"final",
"Throwable",
"ex",
")",
"{",
"final",
"StringBuilder",
"context",
"=",
"new",
"StringBuilder",
"(",
"ex",
".",
"toString",
"(",
")",
")",
";",
"final",
"StringWriter",
"sw",
"=",
"new",
"St... | finds out the stack trace up to where the exception was thrown.
@return String that contains the stack trace | [
"finds",
"out",
"the",
"stack",
"trace",
"up",
"to",
"where",
"the",
"exception",
"was",
"thrown",
"."
] | cd649bce7a32e4e926520e62cb765f3b1d451594 | https://github.com/Appendium/objectlabkit/blob/cd649bce7a32e4e926520e62cb765f3b1d451594/utils/src/main/java/net/objectlab/kit/util/Util.java#L110-L118 | train | Build a stack trace string. | Of course, here is the Java code you requested:
```java
public static String buildStackTraceString(final Throwable ex) {
final StringBuilder context = new StringBuilder(ex.toString());
final StringWriter sw = new StringWriter();
ex.printStackTrace(new PrintWriter(sw, true));
context... |
HanSolo/tilesfx | src/main/java/eu/hansolo/tilesfx/skins/SmoothAreaChartTileSkin.java | SmoothAreaChartTileSkin.initGraphics | @Override protected void initGraphics() {
super.initGraphics();
chartEventListener = e -> handleData();
chartDataListener = c -> {
while (c.next()) {
if (c.wasAdded()) {
c.getAddedSubList().forEach(addedItem -> addedItem.addChartD... | java | @Override protected void initGraphics() {
super.initGraphics();
chartEventListener = e -> handleData();
chartDataListener = c -> {
while (c.next()) {
if (c.wasAdded()) {
c.getAddedSubList().forEach(addedItem -> addedItem.addChartD... | [
"@",
"Override",
"protected",
"void",
"initGraphics",
"(",
")",
"{",
"super",
".",
"initGraphics",
"(",
")",
";",
"chartEventListener",
"=",
"e",
"->",
"handleData",
"(",
")",
";",
"chartDataListener",
"=",
"c",
"->",
"{",
"while",
"(",
"c",
".",
"next",... | ******************** Initialization ************************************ | [
"********************",
"Initialization",
"************************************"
] | 36eb07b1119017beb851dad95256439224d1fcf4 | https://github.com/HanSolo/tilesfx/blob/36eb07b1119017beb851dad95256439224d1fcf4/src/main/java/eu/hansolo/tilesfx/skins/SmoothAreaChartTileSkin.java#L100-L178 | train | Initialize the graphics. | Of course, here is the Java code you requested:
```java
@Override protected void initGraphics() {
super.initGraphics();
chartEventListener = e -> handleData();
chartDataListener = c -> {
while (c.next()) {
if (c.wasAdded()) {
c.g... |
srikalyc/Sql4D | Sql4Ddriver/src/main/java/com/yahoo/sql4d/sql4ddriver/sql/MysqlAccessor.java | MysqlAccessor.execute | public boolean execute(Map<String, String> params, String query) {
final AtomicBoolean result = new AtomicBoolean(false);
Tuple2<DataSource, Connection> conn = null;
try {
conn = getConnection();
NamedParameterJdbcTemplate jdbcTemplate = new NamedParameterJdbcTemplate(con... | java | public boolean execute(Map<String, String> params, String query) {
final AtomicBoolean result = new AtomicBoolean(false);
Tuple2<DataSource, Connection> conn = null;
try {
conn = getConnection();
NamedParameterJdbcTemplate jdbcTemplate = new NamedParameterJdbcTemplate(con... | [
"public",
"boolean",
"execute",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"params",
",",
"String",
"query",
")",
"{",
"final",
"AtomicBoolean",
"result",
"=",
"new",
"AtomicBoolean",
"(",
"false",
")",
";",
"Tuple2",
"<",
"DataSource",
",",
"Connectio... | Suitable for CRUD operations where no result set is expected.
@param params
@param query
@return | [
"Suitable",
"for",
"CRUD",
"operations",
"where",
"no",
"result",
"set",
"is",
"expected",
"."
] | 2c052fe60ead5a16277c798a3440de7d4f6f24f6 | https://github.com/srikalyc/Sql4D/blob/2c052fe60ead5a16277c798a3440de7d4f6f24f6/Sql4Ddriver/src/main/java/com/yahoo/sql4d/sql4ddriver/sql/MysqlAccessor.java#L164-L188 | train | Execute a SQL query with parameters. | Of course, here is the Java code you requested:
```java
public boolean execute(Map<String, String> params, String query) {
final AtomicBoolean result = new AtomicBoolean(false);
Tuple2<DataSource, Connection> conn = null;
try {
conn = getConnection();
NamedParameterJdbcT... |
aws/aws-sdk-java | aws-java-sdk-events/src/main/java/com/amazonaws/services/cloudwatchevents/model/transform/PutRuleRequestMarshaller.java | PutRuleRequestMarshaller.marshall | public void marshall(PutRuleRequest putRuleRequest, ProtocolMarshaller protocolMarshaller) {
if (putRuleRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(putRuleRequest.getName(), NAME_BINDIN... | java | public void marshall(PutRuleRequest putRuleRequest, ProtocolMarshaller protocolMarshaller) {
if (putRuleRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(putRuleRequest.getName(), NAME_BINDIN... | [
"public",
"void",
"marshall",
"(",
"PutRuleRequest",
"putRuleRequest",
",",
"ProtocolMarshaller",
"protocolMarshaller",
")",
"{",
"if",
"(",
"putRuleRequest",
"==",
"null",
")",
"{",
"throw",
"new",
"SdkClientException",
"(",
"\"Invalid argument passed to marshall(...)\""... | Marshall the given parameter object. | [
"Marshall",
"the",
"given",
"parameter",
"object",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-events/src/main/java/com/amazonaws/services/cloudwatchevents/model/transform/PutRuleRequestMarshaller.java#L55-L72 | train | marshalls the given PutRuleRequest to the given protocolMarshaller. | Of course, here is the Java code you requested:
```java
public void marshall(PutRuleRequest putRuleRequest, ProtocolMarshaller protocolMarshaller) {
if (putRuleRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocol... |
jamesagnew/hapi-fhir | hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/utils/DefinitionNavigator.java | DefinitionNavigator.hasTypeChildren | public boolean hasTypeChildren(TypeRefComponent type) throws DefinitionException {
if (typeChildren == null || typeOfChildren != type) {
loadTypedChildren(type);
}
return !typeChildren.isEmpty();
} | java | public boolean hasTypeChildren(TypeRefComponent type) throws DefinitionException {
if (typeChildren == null || typeOfChildren != type) {
loadTypedChildren(type);
}
return !typeChildren.isEmpty();
} | [
"public",
"boolean",
"hasTypeChildren",
"(",
"TypeRefComponent",
"type",
")",
"throws",
"DefinitionException",
"{",
"if",
"(",
"typeChildren",
"==",
"null",
"||",
"typeOfChildren",
"!=",
"type",
")",
"{",
"loadTypedChildren",
"(",
"type",
")",
";",
"}",
"return"... | if you have a typed element, the tree might end at that point.
And you may or may not want to walk into the tree of that type
It depends what you are doing. So this is a choice. You can
ask for the children, and then, if you get no children, you
can see if there are children defined for the type, and then
get them
you... | [
"if",
"you",
"have",
"a",
"typed",
"element",
"the",
"tree",
"might",
"end",
"at",
"that",
"point",
".",
"And",
"you",
"may",
"or",
"may",
"not",
"want",
"to",
"walk",
"into",
"the",
"tree",
"of",
"that",
"type",
"It",
"depends",
"what",
"you",
"are"... | 150a84d52fe691b7f48fcb28247c4bddb7aec352 | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-r4/src/main/java/org/hl7/fhir/r4/utils/DefinitionNavigator.java#L139-L144 | train | Checks if the type has any children. | Of course, here is the Java code you requested:
```java
public boolean hasTypeChildren(TypeRefComponent type) throws DefinitionException {
if (typeChildren == null || typeOfChildren != type) {
loadTypedChildren(type);
}
return !typeChildren.isEmpty();
}
```
Hope this helps! |
eclipse/xtext-extras | org.eclipse.xtext.xbase.ide/src-gen/org/eclipse/xtext/xbase/ide/contentassist/antlr/internal/InternalXbaseParser.java | InternalXbaseParser.ruleXCollectionLiteral | public final void ruleXCollectionLiteral() throws RecognitionException {
int stackSize = keepStackSize();
try {
// InternalXbase.g:721:2: ( ( ( rule__XCollectionLiteral__Alternatives ) ) )
// InternalXbase.g:722:2: ( ( rule__XCollectionLiteral__Alternatives ) )
... | java | public final void ruleXCollectionLiteral() throws RecognitionException {
int stackSize = keepStackSize();
try {
// InternalXbase.g:721:2: ( ( ( rule__XCollectionLiteral__Alternatives ) ) )
// InternalXbase.g:722:2: ( ( rule__XCollectionLiteral__Alternatives ) )
... | [
"public",
"final",
"void",
"ruleXCollectionLiteral",
"(",
")",
"throws",
"RecognitionException",
"{",
"int",
"stackSize",
"=",
"keepStackSize",
"(",
")",
";",
"try",
"{",
"// InternalXbase.g:721:2: ( ( ( rule__XCollectionLiteral__Alternatives ) ) )",
"// InternalXbase.g:722:2: ... | InternalXbase.g:717:1: ruleXCollectionLiteral : ( ( rule__XCollectionLiteral__Alternatives ) ) ; | [
"InternalXbase",
".",
"g",
":",
"717",
":",
"1",
":",
"ruleXCollectionLiteral",
":",
"(",
"(",
"rule__XCollectionLiteral__Alternatives",
")",
")",
";"
] | 451359541295323a29f5855e633f770cec02069a | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase.ide/src-gen/org/eclipse/xtext/xbase/ide/contentassist/antlr/internal/InternalXbaseParser.java#L2365-L2410 | train | start synpred7_InternalXbase_Context | Of course, here is the Java code you requested:
```java
public final void ruleXCollectionLiteral() throws RecognitionException {
int stackSize = keepStackSize();
try {
// InternalXbase.g:721:2: ( ( ( rule__XCollectionLiteral__Alternatives ) ) )
// InternalXbase.g:72... |
Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/util/StringUtil.java | StringUtil.join | public static String join(String... values) {
if (values == null || values.length == 0) {
return null;
}
StringBuilder sb = new StringBuilder();
for (String value : values) {
sb.append(',').append(value);
}
return sb.substring(1);
} | java | public static String join(String... values) {
if (values == null || values.length == 0) {
return null;
}
StringBuilder sb = new StringBuilder();
for (String value : values) {
sb.append(',').append(value);
}
return sb.substring(1);
} | [
"public",
"static",
"String",
"join",
"(",
"String",
"...",
"values",
")",
"{",
"if",
"(",
"values",
"==",
"null",
"||",
"values",
".",
"length",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
... | Join all values separating them with a comma. | [
"Join",
"all",
"values",
"separating",
"them",
"with",
"a",
"comma",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/util/StringUtil.java#L27-L36 | train | Join the specified values into a single string. | Of course, here is the Java code you requested:
```java
public static String join(String... values) {
if (values == null || values.length == 0) {
return null;
}
StringBuilder sb = new StringBuilder();
for (String value : values) {
sb.append(',').append(value);
... |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java | FloatingPointLoops.sawOpcode | @Override
public void sawOpcode(int seen) {
if (!forLoops.isEmpty()) {
Iterator<FloatForLoop> ffl = forLoops.iterator();
while (ffl.hasNext()) {
if (!ffl.next().sawOpcode(seen)) {
ffl.remove();
}
}
}
if ... | java | @Override
public void sawOpcode(int seen) {
if (!forLoops.isEmpty()) {
Iterator<FloatForLoop> ffl = forLoops.iterator();
while (ffl.hasNext()) {
if (!ffl.next().sawOpcode(seen)) {
ffl.remove();
}
}
}
if ... | [
"@",
"Override",
"public",
"void",
"sawOpcode",
"(",
"int",
"seen",
")",
"{",
"if",
"(",
"!",
"forLoops",
".",
"isEmpty",
"(",
")",
")",
"{",
"Iterator",
"<",
"FloatForLoop",
">",
"ffl",
"=",
"forLoops",
".",
"iterator",
"(",
")",
";",
"while",
"(",
... | implements the visitor to find for loops using floating point indexes
@param seen
the opcode of the currently parsed instruction | [
"implements",
"the",
"visitor",
"to",
"find",
"for",
"loops",
"using",
"floating",
"point",
"indexes"
] | 3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8 | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/FloatingPointLoops.java#L78-L92 | train | overrides the visitor to look for a record of a record of a record of a record. | Of course, here is the Java code you requested:
```java
@Override
public void sawOpcode(int seen) {
if (!forLoops.isEmpty()) {
Iterator<FloatForLoop> ffl = forLoops.iterator();
while (ffl.hasNext()) {
if (!ffl.next().sawOpcode(seen)) {
ffl.remove(... |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/Timing.java | Timing.report | public long report(String str, PrintStream stream) {
long elapsed = this.report();
stream.println(str + " Time elapsed: " + (elapsed) + " ms");
return elapsed;
} | java | public long report(String str, PrintStream stream) {
long elapsed = this.report();
stream.println(str + " Time elapsed: " + (elapsed) + " ms");
return elapsed;
} | [
"public",
"long",
"report",
"(",
"String",
"str",
",",
"PrintStream",
"stream",
")",
"{",
"long",
"elapsed",
"=",
"this",
".",
"report",
"(",
")",
";",
"stream",
".",
"println",
"(",
"str",
"+",
"\" Time elapsed: \"",
"+",
"(",
"elapsed",
")",
"+",
"\"... | Print elapsed time (without stopping timer).
@param str Additional prefix string to be printed
@param stream PrintStream on which to write output
@return Number of milliseconds elapsed | [
"Print",
"elapsed",
"time",
"(",
"without",
"stopping",
"timer",
")",
"."
] | b3d44bab9ec07ace0d13612c448a6b7298c1f681 | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/Timing.java#L66-L70 | train | This method prints out the elapsed time of the creation of a
object. | Of course, here is the Java code you requested:
```java
public long report(String str, PrintStream stream) {
long elapsed = this.report();
stream.println(str + " Time elapsed: " + (elapsed) + " ms");
return elapsed;
}
```
Hope this helps! |
meertensinstituut/mtas | src/main/java/mtas/solr/handler/component/MtasSolrSearchComponent.java | MtasSolrSearchComponent.registerStatus | private void registerStatus(MtasSolrStatus solrStatus) throws IOException {
if (requestHandler != null) {
Map<String, ShardStatus> shards = solrStatus.getShards();
if (shards != null) {
Status status = solrStatus.status();
status.numberDocumentsTotal = Long.valueOf(0);
status.numberSegmentsTotal = 0... | java | private void registerStatus(MtasSolrStatus solrStatus) throws IOException {
if (requestHandler != null) {
Map<String, ShardStatus> shards = solrStatus.getShards();
if (shards != null) {
Status status = solrStatus.status();
status.numberDocumentsTotal = Long.valueOf(0);
status.numberSegmentsTotal = 0... | [
"private",
"void",
"registerStatus",
"(",
"MtasSolrStatus",
"solrStatus",
")",
"throws",
"IOException",
"{",
"if",
"(",
"requestHandler",
"!=",
"null",
")",
"{",
"Map",
"<",
"String",
",",
"ShardStatus",
">",
"shards",
"=",
"solrStatus",
".",
"getShards",
"(",... | Register status.
@param solrStatus
the solr status
@throws IOException
Signals that an I/O exception has occurred. | [
"Register",
"status",
"."
] | f02ae730848616bd88b553efa7f9eddc32818e64 | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/solr/handler/component/MtasSolrSearchComponent.java#L905-L930 | train | Register status. | Of course, here is the Java code you requested:
```java
private void registerStatus(MtasSolrStatus solrStatus) throws IOException {
if (requestHandler != null) {
Map<String, ShardStatus> shards = solrStatus.getShards();
if (shards != null) {
Status status = solrStatus.status();
status.numberDocumentsTo... |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/alert/AlertParam.java | AlertParam.parse | @Override
protected void parse() {
maximumInstances = getInt(PARAM_MAXIMUM_INSTANCES, DEFAULT_MAXIMUM_INSTANCES);
mergeRelatedIssues = getBoolean(PARAM_MERGE_RELATED_ISSUES, true);
overridesFilename = getString(PARAM_OVERRIDES_FILENAME, "");
} | java | @Override
protected void parse() {
maximumInstances = getInt(PARAM_MAXIMUM_INSTANCES, DEFAULT_MAXIMUM_INSTANCES);
mergeRelatedIssues = getBoolean(PARAM_MERGE_RELATED_ISSUES, true);
overridesFilename = getString(PARAM_OVERRIDES_FILENAME, "");
} | [
"@",
"Override",
"protected",
"void",
"parse",
"(",
")",
"{",
"maximumInstances",
"=",
"getInt",
"(",
"PARAM_MAXIMUM_INSTANCES",
",",
"DEFAULT_MAXIMUM_INSTANCES",
")",
";",
"mergeRelatedIssues",
"=",
"getBoolean",
"(",
"PARAM_MERGE_RELATED_ISSUES",
",",
"true",
")",
... | Parses the alert options.
@see #getMaximumInstances() | [
"Parses",
"the",
"alert",
"options",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/alert/AlertParam.java#L61-L66 | train | Parse the configuration parameters. | Of course, here is the Java code you requested:
```java
@Override
protected void parse() {
maximumInstances = getInt(PARAM_MAXIMUM_INSTANCES, DEFAULT_MAXIMUM_INSTANCES);
mergeRelatedIssues = getBoolean(PARAM_MERGE_RELATED_ISSUES, true);
overridesFilename = getString(PARAM_OVERRIDES_FILENAME... |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/privatejgoodies/forms/layout/CellConstraints.java | CellConstraints.rc | public CellConstraints rc(int row, int col, String encodedAlignments) {
return rchw(row, col, 1, 1, encodedAlignments);
} | java | public CellConstraints rc(int row, int col, String encodedAlignments) {
return rchw(row, col, 1, 1, encodedAlignments);
} | [
"public",
"CellConstraints",
"rc",
"(",
"int",
"row",
",",
"int",
"col",
",",
"String",
"encodedAlignments",
")",
"{",
"return",
"rchw",
"(",
"row",
",",
"col",
",",
"1",
",",
"1",
",",
"encodedAlignments",
")",
";",
"}"
] | Sets row and column origins; sets height and width to 1; decodes vertical and horizontal
alignments from the given string.<p>
<strong>Examples:</strong><pre>
cc.rc(3, 1, "bottom, left");
cc.rc(3, 1, "b, l");
cc.rc(3, 1, "fill, center");
cc.rc(3, 1, "f, c");
</pre>
@param row the new row index
@param col the new colum... | [
"Sets",
"row",
"and",
"column",
"origins",
";",
"sets",
"height",
"and",
"width",
"to",
"1",
";",
"decodes",
"vertical",
"and",
"horizontal",
"alignments",
"from",
"the",
"given",
"string",
".",
"<p",
">"
] | c7df05a5fe382e1e08a6237e9391d8dc5fd48692 | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/privatejgoodies/forms/layout/CellConstraints.java#L574-L576 | train | Get the cell constraints for the specified row and column. | Of course, here is the Java code you requested:
```java
public CellConstraints rc(int row, int col, String encodedAlignments) {
return rchw(row, col, 1, 1, encodedAlignments);
}
```
Hope this helps! |
play1-maven-plugin/play1-maven-plugin | play-selenium-junit4/src/main/java/com/google/code/play/selenium/parser/JSoupSeleneseParser.java | JSoupSeleneseParser.getCommand | private List<String> getCommand( Element trNode )
{
List<String> result = new ArrayList<String>();
Elements trChildNodes = trNode.getElementsByTag( "TD" );
for ( Element trChild : trChildNodes )
{
result.add( getTableDataValue( trChild ) );
}
if ( result.s... | java | private List<String> getCommand( Element trNode )
{
List<String> result = new ArrayList<String>();
Elements trChildNodes = trNode.getElementsByTag( "TD" );
for ( Element trChild : trChildNodes )
{
result.add( getTableDataValue( trChild ) );
}
if ( result.s... | [
"private",
"List",
"<",
"String",
">",
"getCommand",
"(",
"Element",
"trNode",
")",
"{",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"Elements",
"trChildNodes",
"=",
"trNode",
".",
"getElementsByTag",
... | processing table row | [
"processing",
"table",
"row"
] | d5b2c29f4eb911e605a41529bf0aa0f83ec0aded | https://github.com/play1-maven-plugin/play1-maven-plugin/blob/d5b2c29f4eb911e605a41529bf0aa0f83ec0aded/play-selenium-junit4/src/main/java/com/google/code/play/selenium/parser/JSoupSeleneseParser.java#L56-L69 | train | Get the command for a table entry. | Of course, here is the Java code you requested:
```java
private List<String> getCommand( Element trNode )
{
List<String> result = new ArrayList<String>();
Elements trChildNodes = trNode.getElementsByTag( "TD" );
for ( Element trChild : trChildNodes )
{
result.add( getTab... |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/IssuesApi.java | IssuesApi.getIssues | public Pager<Issue> getIssues(IssueFilter filter, int itemsPerPage) throws GitLabApiException {
GitLabApiForm formData = filter.getQueryParams();
return (new Pager<Issue>(this, Issue.class, itemsPerPage, formData.asMap(), "issues"));
} | java | public Pager<Issue> getIssues(IssueFilter filter, int itemsPerPage) throws GitLabApiException {
GitLabApiForm formData = filter.getQueryParams();
return (new Pager<Issue>(this, Issue.class, itemsPerPage, formData.asMap(), "issues"));
} | [
"public",
"Pager",
"<",
"Issue",
">",
"getIssues",
"(",
"IssueFilter",
"filter",
",",
"int",
"itemsPerPage",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"filter",
".",
"getQueryParams",
"(",
")",
";",
"return",
"(",
"new",
"Page... | Get all issues the authenticated user has access to.
By default it returns only issues created by the current user.
<pre><code>GitLab Endpoint: GET /issues</code></pre>
@param filter {@link IssueFilter} a IssueFilter instance with the filter settings.
@param itemsPerPage the number of Project instances that will be f... | [
"Get",
"all",
"issues",
"the",
"authenticated",
"user",
"has",
"access",
"to",
".",
"By",
"default",
"it",
"returns",
"only",
"issues",
"created",
"by",
"the",
"current",
"user",
"."
] | ab045070abac0a8f4ccbf17b5ed9bfdef5723eed | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/IssuesApi.java#L264-L267 | train | Get a Pager of all issues owned by the authenticated user. | Of course, here is the Java code you requested:
```java
public Pager<Issue> getIssues(IssueFilter filter, int itemsPerPage) throws GitLabApiException {
GitLabApiForm formData = filter.getQueryParams();
return (new Pager<Issue>(this, Issue.class, itemsPerPage, formData.asMap(), "issues"));
}
```
H... |
impossibl/stencil | engine/src/main/java/com/impossibl/stencil/engine/internal/StencilInterpreter.java | StencilInterpreter.exec | private Object exec(StatementContext statement) {
if (statement == null)
return null;
return statement.accept(visitor);
} | java | private Object exec(StatementContext statement) {
if (statement == null)
return null;
return statement.accept(visitor);
} | [
"private",
"Object",
"exec",
"(",
"StatementContext",
"statement",
")",
"{",
"if",
"(",
"statement",
"==",
"null",
")",
"return",
"null",
";",
"return",
"statement",
".",
"accept",
"(",
"visitor",
")",
";",
"}"
] | Execute a statement block until the first
return statement is reached.
@param block StatementBlock to evaluate
@return Result of expression evaluate | [
"Execute",
"a",
"statement",
"block",
"until",
"the",
"first",
"return",
"statement",
"is",
"reached",
"."
] | 4aac1be605542b4248be95bf8916be4e2f755d1c | https://github.com/impossibl/stencil/blob/4aac1be605542b4248be95bf8916be4e2f755d1c/engine/src/main/java/com/impossibl/stencil/engine/internal/StencilInterpreter.java#L2845-L2849 | train | Execute a CID statement. | Of course, here is the Java code you requested:
```java
private Object exec(StatementContext statement) {
if (statement == null)
return null;
return statement.accept(visitor);
}
```
Hope this helps! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.