repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/chart/raphael/ShapeCollection.java | ShapeCollection.remove | public void remove( Widget w )
{
int index = indexOf( w );
if( index == -1 )
{
throw new NoSuchElementException();
}
remove( index );
} | java | public void remove( Widget w )
{
int index = indexOf( w );
if( index == -1 )
{
throw new NoSuchElementException();
}
remove( index );
} | [
"public",
"void",
"remove",
"(",
"Widget",
"w",
")",
"{",
"int",
"index",
"=",
"indexOf",
"(",
"w",
")",
";",
"if",
"(",
"index",
"==",
"-",
"1",
")",
"{",
"throw",
"new",
"NoSuchElementException",
"(",
")",
";",
"}",
"remove",
"(",
"index",
")",
... | Removes the specified widget.
@param w
the widget to be removed
@throws NoSuchElementException
if the widget is not present | [
"Removes",
"the",
"specified",
"widget",
"."
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/chart/raphael/ShapeCollection.java#L218-L227 | train |
ltearno/hexa.tools | hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/properties/PropertyValues.java | PropertyValues.getSetterPropertyType | Class<?> getSetterPropertyType( Clazz<?> clazz, String name )
{
ClassInfoCache cache = retrieveCache( clazz );
Class<?> res = cache.getSetterType( name );
if( res != null )
return res;
String setterName = "set" + capitalizeFirstLetter( name );
Method setter = clazz.getMethod( setterName );
if( setter !... | java | Class<?> getSetterPropertyType( Clazz<?> clazz, String name )
{
ClassInfoCache cache = retrieveCache( clazz );
Class<?> res = cache.getSetterType( name );
if( res != null )
return res;
String setterName = "set" + capitalizeFirstLetter( name );
Method setter = clazz.getMethod( setterName );
if( setter !... | [
"Class",
"<",
"?",
">",
"getSetterPropertyType",
"(",
"Clazz",
"<",
"?",
">",
"clazz",
",",
"String",
"name",
")",
"{",
"ClassInfoCache",
"cache",
"=",
"retrieveCache",
"(",
"clazz",
")",
";",
"Class",
"<",
"?",
">",
"res",
"=",
"cache",
".",
"getSette... | Returns the class of the setter property. It can be this of the setter or
of the field | [
"Returns",
"the",
"class",
"of",
"the",
"setter",
"property",
".",
"It",
"can",
"be",
"this",
"of",
"the",
"setter",
"or",
"of",
"the",
"field"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/properties/PropertyValues.java#L151-L175 | train |
ltearno/hexa.tools | hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/properties/PropertyValues.java | PropertyValues.hasObjectDynamicProperty | boolean hasObjectDynamicProperty( Object object, String propertyName )
{
DynamicPropertyBag bag = propertyBagAccess.getObjectDynamicPropertyBag( object );
return bag != null && bag.contains( propertyName );
} | java | boolean hasObjectDynamicProperty( Object object, String propertyName )
{
DynamicPropertyBag bag = propertyBagAccess.getObjectDynamicPropertyBag( object );
return bag != null && bag.contains( propertyName );
} | [
"boolean",
"hasObjectDynamicProperty",
"(",
"Object",
"object",
",",
"String",
"propertyName",
")",
"{",
"DynamicPropertyBag",
"bag",
"=",
"propertyBagAccess",
".",
"getObjectDynamicPropertyBag",
"(",
"object",
")",
";",
"return",
"bag",
"!=",
"null",
"&&",
"bag",
... | Whether a dynamic property value has already been set on this object | [
"Whether",
"a",
"dynamic",
"property",
"value",
"has",
"already",
"been",
"set",
"on",
"this",
"object"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/properties/PropertyValues.java#L229-L233 | train |
ltearno/hexa.tools | hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/tools/SmartRegistration.java | SmartRegistration.register | public void register( Object source, String path )
{
unregister();
dataBinding = Binder.bind( source, path ).mode( Mode.OneWay ).to( adapter ).activate();
} | java | public void register( Object source, String path )
{
unregister();
dataBinding = Binder.bind( source, path ).mode( Mode.OneWay ).to( adapter ).activate();
} | [
"public",
"void",
"register",
"(",
"Object",
"source",
",",
"String",
"path",
")",
"{",
"unregister",
"(",
")",
";",
"dataBinding",
"=",
"Binder",
".",
"bind",
"(",
"source",
",",
"path",
")",
".",
"mode",
"(",
"Mode",
".",
"OneWay",
")",
".",
"to",
... | Registers the databinding source. If any previous source
was binded, its bindings are freed.
@param source The object which is the source of the binding
@param path The path of the data | [
"Registers",
"the",
"databinding",
"source",
".",
"If",
"any",
"previous",
"source",
"was",
"binded",
"its",
"bindings",
"are",
"freed",
"."
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/tools/SmartRegistration.java#L43-L48 | train |
ltearno/hexa.tools | hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/Binder.java | Binder.bind | public static BindingCreation bind( Object source, String propertyPath )
{
return createBinder( new CompositePropertyAdapter( source, propertyPath ) );
} | java | public static BindingCreation bind( Object source, String propertyPath )
{
return createBinder( new CompositePropertyAdapter( source, propertyPath ) );
} | [
"public",
"static",
"BindingCreation",
"bind",
"(",
"Object",
"source",
",",
"String",
"propertyPath",
")",
"{",
"return",
"createBinder",
"(",
"new",
"CompositePropertyAdapter",
"(",
"source",
",",
"propertyPath",
")",
")",
";",
"}"
] | First step, accepts a data binding source definition and creates a binder
The source value is searched as specified in the @param propertyPath, in
the context of the @param source object.
For example : <i>...To( customer, "company.address.city" )</i> can be
used to access data at different depths. If all intermediary... | [
"First",
"step",
"accepts",
"a",
"data",
"binding",
"source",
"definition",
"and",
"creates",
"a",
"binder"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/Binder.java#L56-L59 | train |
ltearno/hexa.tools | hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/Binder.java | Binder.map | public static DataBinding map( Object source, Object destination )
{
return bindObject( source ).mapTo( destination );
} | java | public static DataBinding map( Object source, Object destination )
{
return bindObject( source ).mapTo( destination );
} | [
"public",
"static",
"DataBinding",
"map",
"(",
"Object",
"source",
",",
"Object",
"destination",
")",
"{",
"return",
"bindObject",
"(",
"source",
")",
".",
"mapTo",
"(",
"destination",
")",
";",
"}"
] | Maps two objects together. All matching fields will then be two-way
data-bound. | [
"Maps",
"two",
"objects",
"together",
".",
"All",
"matching",
"fields",
"will",
"then",
"be",
"two",
"-",
"way",
"data",
"-",
"bound",
"."
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/Binder.java#L94-L97 | train |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-rest-client/src/main/java/org/hawkular/bus/restclient/RestClient.java | RestClient.postTopicMessage | public HttpResponse postTopicMessage(String topicName, String jsonPayload, Map<String, String> headers)
throws RestClientException {
return postMessage(Type.TOPIC, topicName, jsonPayload, headers);
} | java | public HttpResponse postTopicMessage(String topicName, String jsonPayload, Map<String, String> headers)
throws RestClientException {
return postMessage(Type.TOPIC, topicName, jsonPayload, headers);
} | [
"public",
"HttpResponse",
"postTopicMessage",
"(",
"String",
"topicName",
",",
"String",
"jsonPayload",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"throws",
"RestClientException",
"{",
"return",
"postMessage",
"(",
"Type",
".",
"TOPIC",
",",
... | Sends a message to the REST endpoint in order to put a message on the given topic.
@param topicName name of the topic
@param jsonPayload the actual message (as a JSON string) to put on the bus
@param headers any headers to send with the message (can be null or empty)
@return the response
@throws RestClientException if... | [
"Sends",
"a",
"message",
"to",
"the",
"REST",
"endpoint",
"in",
"order",
"to",
"put",
"a",
"message",
"on",
"the",
"given",
"topic",
"."
] | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-rest-client/src/main/java/org/hawkular/bus/restclient/RestClient.java#L129-L132 | train |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-rest-client/src/main/java/org/hawkular/bus/restclient/RestClient.java | RestClient.postQueueMessage | public HttpResponse postQueueMessage(String queueName, String jsonPayload, Map<String, String> headers)
throws RestClientException {
return postMessage(Type.QUEUE, queueName, jsonPayload, headers);
} | java | public HttpResponse postQueueMessage(String queueName, String jsonPayload, Map<String, String> headers)
throws RestClientException {
return postMessage(Type.QUEUE, queueName, jsonPayload, headers);
} | [
"public",
"HttpResponse",
"postQueueMessage",
"(",
"String",
"queueName",
",",
"String",
"jsonPayload",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"throws",
"RestClientException",
"{",
"return",
"postMessage",
"(",
"Type",
".",
"QUEUE",
",",
... | Sends a message to the REST endpoint in order to put a message on the given queue.
@param queueName name of the queue
@param jsonPayload the actual message (as a JSON string) to put on the bus
@param headers any headers to send with the message (can be null or empty)
@return the response
@throws RestClientException if... | [
"Sends",
"a",
"message",
"to",
"the",
"REST",
"endpoint",
"in",
"order",
"to",
"put",
"a",
"message",
"on",
"the",
"given",
"queue",
"."
] | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-rest-client/src/main/java/org/hawkular/bus/restclient/RestClient.java#L143-L146 | train |
ltearno/hexa.tools | hexa.demo.gwt/src/main/java/fr/lteconsulting/hexa/demo/client/databinding/DataBindingDemo.java | DataBindingDemo.run | public void run( AcceptsOneWidget container )
{
/** Add our widgets in the container */
container.setWidget( UiBuilder.addIn( new VerticalPanel(),
personListWidget,
personneForm,
categoryForm,
nextButton ) );
/*
* Bind things together
*/
// selectedPerson to person form
Bind( pers... | java | public void run( AcceptsOneWidget container )
{
/** Add our widgets in the container */
container.setWidget( UiBuilder.addIn( new VerticalPanel(),
personListWidget,
personneForm,
categoryForm,
nextButton ) );
/*
* Bind things together
*/
// selectedPerson to person form
Bind( pers... | [
"public",
"void",
"run",
"(",
"AcceptsOneWidget",
"container",
")",
"{",
"/** Add our widgets in the container */",
"container",
".",
"setWidget",
"(",
"UiBuilder",
".",
"addIn",
"(",
"new",
"VerticalPanel",
"(",
")",
",",
"personListWidget",
",",
"personneForm",
",... | Runs the demo | [
"Runs",
"the",
"demo"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.demo.gwt/src/main/java/fr/lteconsulting/hexa/demo/client/databinding/DataBindingDemo.java#L74-L110 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/treetable/TreeTableEditorManager.java | TreeTableEditorManager._RemoveValidator | private void _RemoveValidator( Row item, int column )
{
// already clean ?
if( m_currentEditedItem == null && m_currentEditedColumn < 0 )
return;
// touch the table
if( m_callback != null )
m_callback.onTouchCellContent( item, column );
if( m_currentEditor != null )
m_currentEditor.removeFromParen... | java | private void _RemoveValidator( Row item, int column )
{
// already clean ?
if( m_currentEditedItem == null && m_currentEditedColumn < 0 )
return;
// touch the table
if( m_callback != null )
m_callback.onTouchCellContent( item, column );
if( m_currentEditor != null )
m_currentEditor.removeFromParen... | [
"private",
"void",
"_RemoveValidator",
"(",
"Row",
"item",
",",
"int",
"column",
")",
"{",
"// already clean ?",
"if",
"(",
"m_currentEditedItem",
"==",
"null",
"&&",
"m_currentEditedColumn",
"<",
"0",
")",
"return",
";",
"// touch the table",
"if",
"(",
"m_call... | just replace the validator widget by a text in the table | [
"just",
"replace",
"the",
"validator",
"widget",
"by",
"a",
"text",
"in",
"the",
"table"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/treetable/TreeTableEditorManager.java#L108-L124 | train |
ltearno/hexa.tools | hexa.css-maven-plugin/src/main/java/fr/lteconsulting/hexacssmaven/CssMapper.java | CssMapper.processFile | public static void processFile( String input, String mappingPath, String outputFile, boolean doPrune, Log log ) throws IOException
{
Set<String> usedClassNames = new HashSet<>();
input = replaceClassNames( input, mappingPath, usedClassNames, log );
log.debug( usedClassNames.size() + " used css classes in the m... | java | public static void processFile( String input, String mappingPath, String outputFile, boolean doPrune, Log log ) throws IOException
{
Set<String> usedClassNames = new HashSet<>();
input = replaceClassNames( input, mappingPath, usedClassNames, log );
log.debug( usedClassNames.size() + " used css classes in the m... | [
"public",
"static",
"void",
"processFile",
"(",
"String",
"input",
",",
"String",
"mappingPath",
",",
"String",
"outputFile",
",",
"boolean",
"doPrune",
",",
"Log",
"log",
")",
"throws",
"IOException",
"{",
"Set",
"<",
"String",
">",
"usedClassNames",
"=",
"... | Process an input file
@throws IOException In case there is a problem
@param input
The input file content
@param mappingPath
The file containing mapping information (lines in the form of
newName=oldName)
@param outputFile
Path to the output file
@param doPrune
<code>true</code> if pruning unused CSS rules is needed
@p... | [
"Process",
"an",
"input",
"file"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.css-maven-plugin/src/main/java/fr/lteconsulting/hexacssmaven/CssMapper.java#L43-L58 | train |
magott/spring-social-yammer | spring-social-yammer/src/main/java/org/springframework/social/yammer/api/impl/GroupTemplate.java | GroupTemplate.updateGroup | public void updateGroup(long groupId, String name, boolean isPrivate) {
LinkedMultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>();
params.set("name",name);
params.set("private", String.valueOf(isPrivate));
restTemplate.put(buildUri("groups/"+groupId), params);
} | java | public void updateGroup(long groupId, String name, boolean isPrivate) {
LinkedMultiValueMap<String, String> params = new LinkedMultiValueMap<String, String>();
params.set("name",name);
params.set("private", String.valueOf(isPrivate));
restTemplate.put(buildUri("groups/"+groupId), params);
} | [
"public",
"void",
"updateGroup",
"(",
"long",
"groupId",
",",
"String",
"name",
",",
"boolean",
"isPrivate",
")",
"{",
"LinkedMultiValueMap",
"<",
"String",
",",
"String",
">",
"params",
"=",
"new",
"LinkedMultiValueMap",
"<",
"String",
",",
"String",
">",
"... | Method returns 401 from Yammer, so it isn't visible in GroupOperations yet
@param groupId
@param name
@param isPrivate | [
"Method",
"returns",
"401",
"from",
"Yammer",
"so",
"it",
"isn",
"t",
"visible",
"in",
"GroupOperations",
"yet"
] | a39dab7c33e40bfaa26c15b6336823edf57452c3 | https://github.com/magott/spring-social-yammer/blob/a39dab7c33e40bfaa26c15b6336823edf57452c3/spring-social-yammer/src/main/java/org/springframework/social/yammer/api/impl/GroupTemplate.java#L71-L76 | train |
hawkular/hawkular-commons | hawkular-rest-status/src/main/java/org/hawkular/commons/rest/status/ManifestUtil.java | ManifestUtil.getVersionAttributes | static Map<String, String> getVersionAttributes(URL url) throws IOException {
Map<String, String> ret = new LinkedHashMap<>();
try (InputStream inputStream = url.openStream()) {
Manifest manifest = new Manifest(inputStream);
Attributes attributes = manifest.getMainAttributes();
... | java | static Map<String, String> getVersionAttributes(URL url) throws IOException {
Map<String, String> ret = new LinkedHashMap<>();
try (InputStream inputStream = url.openStream()) {
Manifest manifest = new Manifest(inputStream);
Attributes attributes = manifest.getMainAttributes();
... | [
"static",
"Map",
"<",
"String",
",",
"String",
">",
"getVersionAttributes",
"(",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"ret",
"=",
"new",
"LinkedHashMap",
"<>",
"(",
")",
";",
"try",
"(",
"InputStream"... | For the sake of unit testing
@param url the URL to load the MANIFEST.MF file from
@return a {@link Map} of attributes
@throws IOException on problems with reading {@code /META-INF/MANIFEST.MF} file from the given {@code url} | [
"For",
"the",
"sake",
"of",
"unit",
"testing"
] | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-rest-status/src/main/java/org/hawkular/commons/rest/status/ManifestUtil.java#L68-L79 | train |
lsjwzh/MaskEverywhere | library/src/main/java/com/lsjwzh/loadingeverywhere/LoadingLayout.java | LoadingLayout.createOverlayView | @Override
protected View createOverlayView() {
LinearLayout ll = new LinearLayout(getContext());
ll.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,FrameLayout.LayoutParams.MATCH_PARENT));
ll.setGravity(Gravity.CENTER);
View progressBar = createProg... | java | @Override
protected View createOverlayView() {
LinearLayout ll = new LinearLayout(getContext());
ll.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,FrameLayout.LayoutParams.MATCH_PARENT));
ll.setGravity(Gravity.CENTER);
View progressBar = createProg... | [
"@",
"Override",
"protected",
"View",
"createOverlayView",
"(",
")",
"{",
"LinearLayout",
"ll",
"=",
"new",
"LinearLayout",
"(",
"getContext",
"(",
")",
")",
";",
"ll",
".",
"setLayoutParams",
"(",
"new",
"FrameLayout",
".",
"LayoutParams",
"(",
"FrameLayout",... | create loading mask
@return | [
"create",
"loading",
"mask"
] | b30831f470c7066ae71ad0aa322e6535c009ba2a | https://github.com/lsjwzh/MaskEverywhere/blob/b30831f470c7066ae71ad0aa322e6535c009ba2a/library/src/main/java/com/lsjwzh/loadingeverywhere/LoadingLayout.java#L100-L108 | train |
hawkular/hawkular-commons | hawkular-nest/hawkular-nest-wf-extension/src/main/java/org/hawkular/nest/extension/NestService.java | NestService.getNestName | protected String getNestName() {
if (nestName == null || nestName.equals(NestSubsystemExtension.NEST_NAME_AUTOGENERATE)) {
return this.envServiceValue.getValue().getNodeName();
} else {
return nestName;
}
} | java | protected String getNestName() {
if (nestName == null || nestName.equals(NestSubsystemExtension.NEST_NAME_AUTOGENERATE)) {
return this.envServiceValue.getValue().getNodeName();
} else {
return nestName;
}
} | [
"protected",
"String",
"getNestName",
"(",
")",
"{",
"if",
"(",
"nestName",
"==",
"null",
"||",
"nestName",
".",
"equals",
"(",
"NestSubsystemExtension",
".",
"NEST_NAME_AUTOGENERATE",
")",
")",
"{",
"return",
"this",
".",
"envServiceValue",
".",
"getValue",
"... | Do not call this until the nest has been initialized - it needs a dependent service.
@return the name this nest is to be identified as | [
"Do",
"not",
"call",
"this",
"until",
"the",
"nest",
"has",
"been",
"initialized",
"-",
"it",
"needs",
"a",
"dependent",
"service",
"."
] | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-nest/hawkular-nest-wf-extension/src/main/java/org/hawkular/nest/extension/NestService.java#L147-L153 | train |
randomsync/robotframework-mqttlibrary-java | src/main/java/net/randomsync/robotframework/mqtt/MQTTLibrary.java | MQTTLibrary.connectToMQTTBroker | @RobotKeyword("Connect to MQTT Broker")
@ArgumentNames({ "broker", "clientId" })
public void connectToMQTTBroker(String broker, String clientId)
throws MqttException {
client = new MqttClient(broker, clientId);
System.out.println("*INFO:" + System.currentTimeMillis()
... | java | @RobotKeyword("Connect to MQTT Broker")
@ArgumentNames({ "broker", "clientId" })
public void connectToMQTTBroker(String broker, String clientId)
throws MqttException {
client = new MqttClient(broker, clientId);
System.out.println("*INFO:" + System.currentTimeMillis()
... | [
"@",
"RobotKeyword",
"(",
"\"Connect to MQTT Broker\"",
")",
"@",
"ArgumentNames",
"(",
"{",
"\"broker\"",
",",
"\"clientId\"",
"}",
")",
"public",
"void",
"connectToMQTTBroker",
"(",
"String",
"broker",
",",
"String",
"clientId",
")",
"throws",
"MqttException",
"... | Connect to an MQTT broker.
@param broker
Uri of the broker to connect to
@param clientId
Client Id
@throws MqttException
if there is an issue connecting to the broker | [
"Connect",
"to",
"an",
"MQTT",
"broker",
"."
] | b10e346ea159d86e60a73062297c4a0d57149c89 | https://github.com/randomsync/robotframework-mqttlibrary-java/blob/b10e346ea159d86e60a73062297c4a0d57149c89/src/main/java/net/randomsync/robotframework/mqtt/MQTTLibrary.java#L53-L63 | train |
randomsync/robotframework-mqttlibrary-java | src/main/java/net/randomsync/robotframework/mqtt/MQTTLibrary.java | MQTTLibrary.publishToMQTTSynchronously | @RobotKeywordOverload
@ArgumentNames({ "topic", "message" })
public void publishToMQTTSynchronously(String topic, Object message)
throws MqttException {
publishToMQTTSynchronously(topic, message, 0, false);
} | java | @RobotKeywordOverload
@ArgumentNames({ "topic", "message" })
public void publishToMQTTSynchronously(String topic, Object message)
throws MqttException {
publishToMQTTSynchronously(topic, message, 0, false);
} | [
"@",
"RobotKeywordOverload",
"@",
"ArgumentNames",
"(",
"{",
"\"topic\"",
",",
"\"message\"",
"}",
")",
"public",
"void",
"publishToMQTTSynchronously",
"(",
"String",
"topic",
",",
"Object",
"message",
")",
"throws",
"MqttException",
"{",
"publishToMQTTSynchronously",... | Publish a message to a topic
@param topic
topic to which the message will be published
@param message
message payload to publish
@throws MqttException
if there is an issue publishing to the broker | [
"Publish",
"a",
"message",
"to",
"a",
"topic"
] | b10e346ea159d86e60a73062297c4a0d57149c89 | https://github.com/randomsync/robotframework-mqttlibrary-java/blob/b10e346ea159d86e60a73062297c4a0d57149c89/src/main/java/net/randomsync/robotframework/mqtt/MQTTLibrary.java#L75-L80 | train |
randomsync/robotframework-mqttlibrary-java | src/main/java/net/randomsync/robotframework/mqtt/MQTTLibrary.java | MQTTLibrary.publishToMQTTSynchronously | @RobotKeyword("Publish to MQTT Synchronously")
@ArgumentNames({ "topic", "message", "qos=0", "retained=false" })
public void publishToMQTTSynchronously(String topic, Object message,
int qos, boolean retained) throws MqttException {
MqttMessage msg;
if (message instanceof String) {
... | java | @RobotKeyword("Publish to MQTT Synchronously")
@ArgumentNames({ "topic", "message", "qos=0", "retained=false" })
public void publishToMQTTSynchronously(String topic, Object message,
int qos, boolean retained) throws MqttException {
MqttMessage msg;
if (message instanceof String) {
... | [
"@",
"RobotKeyword",
"(",
"\"Publish to MQTT Synchronously\"",
")",
"@",
"ArgumentNames",
"(",
"{",
"\"topic\"",
",",
"\"message\"",
",",
"\"qos=0\"",
",",
"\"retained=false\"",
"}",
")",
"public",
"void",
"publishToMQTTSynchronously",
"(",
"String",
"topic",
",",
"... | Publish a message to a topic with specified qos and retained flag
@param topic
topic to which the message will be published
@param message
message payload to publish
@param qos
qos of the message
@param retained
retained flag
@throws MqttException
if there is an issue publishing to the broker | [
"Publish",
"a",
"message",
"to",
"a",
"topic",
"with",
"specified",
"qos",
"and",
"retained",
"flag"
] | b10e346ea159d86e60a73062297c4a0d57149c89 | https://github.com/randomsync/robotframework-mqttlibrary-java/blob/b10e346ea159d86e60a73062297c4a0d57149c89/src/main/java/net/randomsync/robotframework/mqtt/MQTTLibrary.java#L96-L113 | train |
randomsync/robotframework-mqttlibrary-java | src/main/java/net/randomsync/robotframework/mqtt/MQTTLibrary.java | MQTTLibrary.disconnectFromMQTTBroker | @RobotKeyword("Disconnect from MQTT Broker")
public void disconnectFromMQTTBroker() {
if (client != null) {
try {
client.disconnect();
} catch (MqttException e) {
throw new RuntimeException(e.getLocalizedMessage());
}
}
} | java | @RobotKeyword("Disconnect from MQTT Broker")
public void disconnectFromMQTTBroker() {
if (client != null) {
try {
client.disconnect();
} catch (MqttException e) {
throw new RuntimeException(e.getLocalizedMessage());
}
}
} | [
"@",
"RobotKeyword",
"(",
"\"Disconnect from MQTT Broker\"",
")",
"public",
"void",
"disconnectFromMQTTBroker",
"(",
")",
"{",
"if",
"(",
"client",
"!=",
"null",
")",
"{",
"try",
"{",
"client",
".",
"disconnect",
"(",
")",
";",
"}",
"catch",
"(",
"MqttExcept... | Disconnect from MQTT Broker | [
"Disconnect",
"from",
"MQTT",
"Broker"
] | b10e346ea159d86e60a73062297c4a0d57149c89 | https://github.com/randomsync/robotframework-mqttlibrary-java/blob/b10e346ea159d86e60a73062297c4a0d57149c89/src/main/java/net/randomsync/robotframework/mqtt/MQTTLibrary.java#L118-L127 | train |
randomsync/robotframework-mqttlibrary-java | src/main/java/net/randomsync/robotframework/mqtt/MQTTLibrary.java | MQTTLibrary.subscribeToMQTTAndValidate | @RobotKeyword("Subscribe to MQTT Broker and validate that it received a specific message")
@ArgumentNames({ "broker", "clientId", "topic", "expectedPayload",
"timeout" })
public void subscribeToMQTTAndValidate(String broker, String clientId,
String topic, String expectedPayload, long tim... | java | @RobotKeyword("Subscribe to MQTT Broker and validate that it received a specific message")
@ArgumentNames({ "broker", "clientId", "topic", "expectedPayload",
"timeout" })
public void subscribeToMQTTAndValidate(String broker, String clientId,
String topic, String expectedPayload, long tim... | [
"@",
"RobotKeyword",
"(",
"\"Subscribe to MQTT Broker and validate that it received a specific message\"",
")",
"@",
"ArgumentNames",
"(",
"{",
"\"broker\"",
",",
"\"clientId\"",
",",
"\"topic\"",
",",
"\"expectedPayload\"",
",",
"\"timeout\"",
"}",
")",
"public",
"void",
... | Subscribe to an MQTT broker and validate that a message with specified
payload is received
@param broker
Uri of broker to subscribe to
@param clientId
Client Id
@param topic
topic to subscribe to
@param expectedPayload
payload to validate
@param timeout
timeout for the payload to be received | [
"Subscribe",
"to",
"an",
"MQTT",
"broker",
"and",
"validate",
"that",
"a",
"message",
"with",
"specified",
"payload",
"is",
"received"
] | b10e346ea159d86e60a73062297c4a0d57149c89 | https://github.com/randomsync/robotframework-mqttlibrary-java/blob/b10e346ea159d86e60a73062297c4a0d57149c89/src/main/java/net/randomsync/robotframework/mqtt/MQTTLibrary.java#L144-L219 | train |
ltearno/hexa.tools | hexa.rpc/src/main/java/fr/lteconsulting/hexa/client/comm/RequestDesc.java | RequestDesc._getUniqueKey | private String _getUniqueKey()
{
StringBuilder b = new StringBuilder();
b.append( service );
b.append( "#" );
b.append( method );
if( params != null )
{
b.append( "#" );
b.append( params.toString() );
}
return b.toString();
} | java | private String _getUniqueKey()
{
StringBuilder b = new StringBuilder();
b.append( service );
b.append( "#" );
b.append( method );
if( params != null )
{
b.append( "#" );
b.append( params.toString() );
}
return b.toString();
} | [
"private",
"String",
"_getUniqueKey",
"(",
")",
"{",
"StringBuilder",
"b",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"b",
".",
"append",
"(",
"service",
")",
";",
"b",
".",
"append",
"(",
"\"#\"",
")",
";",
"b",
".",
"append",
"(",
"method",
")",
... | calculate the unique key of that request | [
"calculate",
"the",
"unique",
"key",
"of",
"that",
"request"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.rpc/src/main/java/fr/lteconsulting/hexa/client/comm/RequestDesc.java#L59-L72 | train |
hawkular/hawkular-commons | hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/bus/BusEndpointProcessors.java | BusEndpointProcessors.initialize | public void initialize(@Observes @Initialized(ApplicationScoped.class) Object ignore) {
log.debugf("Initializing [%s]", this.getClass().getName());
try {
feedSessionListenerProducer = new BiFunction<String, Session, WsSessionListener>() {
@Override
public WsSe... | java | public void initialize(@Observes @Initialized(ApplicationScoped.class) Object ignore) {
log.debugf("Initializing [%s]", this.getClass().getName());
try {
feedSessionListenerProducer = new BiFunction<String, Session, WsSessionListener>() {
@Override
public WsSe... | [
"public",
"void",
"initialize",
"(",
"@",
"Observes",
"@",
"Initialized",
"(",
"ApplicationScoped",
".",
"class",
")",
"Object",
"ignore",
")",
"{",
"log",
".",
"debugf",
"(",
"\"Initializing [%s]\"",
",",
"this",
".",
"getClass",
"(",
")",
".",
"getName",
... | This creates the bi-function listener-producers that will create listeners which will
create JMS bus listeners for each websocket session that gets created in the future.
@param ignore unused | [
"This",
"creates",
"the",
"bi",
"-",
"function",
"listener",
"-",
"producers",
"that",
"will",
"create",
"listeners",
"which",
"will",
"create",
"JMS",
"bus",
"listeners",
"for",
"each",
"websocket",
"session",
"that",
"gets",
"created",
"in",
"the",
"future",... | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/bus/BusEndpointProcessors.java#L256-L286 | train |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/collection/TrieMap.java | TrieMap.modifyData | void modifyData(final TrieNode<V> node, final V value) {
node.value = value;
++modCount;
++size;
} | java | void modifyData(final TrieNode<V> node, final V value) {
node.value = value;
++modCount;
++size;
} | [
"void",
"modifyData",
"(",
"final",
"TrieNode",
"<",
"V",
">",
"node",
",",
"final",
"V",
"value",
")",
"{",
"node",
".",
"value",
"=",
"value",
";",
"++",
"modCount",
";",
"++",
"size",
";",
"}"
] | Sets the given value as the new value on the given node, increases size
and modCount. | [
"Sets",
"the",
"given",
"value",
"as",
"the",
"new",
"value",
"on",
"the",
"given",
"node",
"increases",
"size",
"and",
"modCount",
"."
] | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/collection/TrieMap.java#L200-L204 | train |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/collection/TrieMap.java | TrieMap.addNode | private void addNode(final TrieNode<V> node, final CharSequence key,
final int beginIndex, final TrieNode<V> newNode) {
final int lastKeyIndex = key.length() - 1;
TrieNode<V> currentNode = node;
int i = beginIndex;
for (; i < lastKeyIndex; i++) {
fin... | java | private void addNode(final TrieNode<V> node, final CharSequence key,
final int beginIndex, final TrieNode<V> newNode) {
final int lastKeyIndex = key.length() - 1;
TrieNode<V> currentNode = node;
int i = beginIndex;
for (; i < lastKeyIndex; i++) {
fin... | [
"private",
"void",
"addNode",
"(",
"final",
"TrieNode",
"<",
"V",
">",
"node",
",",
"final",
"CharSequence",
"key",
",",
"final",
"int",
"beginIndex",
",",
"final",
"TrieNode",
"<",
"V",
">",
"newNode",
")",
"{",
"final",
"int",
"lastKeyIndex",
"=",
"key... | Adds the given new node to the node with the given key beginning at
beginIndex. | [
"Adds",
"the",
"given",
"new",
"node",
"to",
"the",
"node",
"with",
"the",
"given",
"key",
"beginning",
"at",
"beginIndex",
"."
] | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/collection/TrieMap.java#L210-L223 | train |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/collection/TrieMap.java | TrieMap.removeMapping | V removeMapping(final Object o) {
if (!(o instanceof Map.Entry)) {
throw new IllegalArgumentException();
}
@SuppressWarnings("unchecked") final Entry<? extends CharSequence, V> e = (Map.Entry<? extends CharSequence, V>) o;
final CharSequence key = keyCheck(e.getKey());
... | java | V removeMapping(final Object o) {
if (!(o instanceof Map.Entry)) {
throw new IllegalArgumentException();
}
@SuppressWarnings("unchecked") final Entry<? extends CharSequence, V> e = (Map.Entry<? extends CharSequence, V>) o;
final CharSequence key = keyCheck(e.getKey());
... | [
"V",
"removeMapping",
"(",
"final",
"Object",
"o",
")",
"{",
"if",
"(",
"!",
"(",
"o",
"instanceof",
"Map",
".",
"Entry",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
... | Special version of remove for EntrySet. | [
"Special",
"version",
"of",
"remove",
"for",
"EntrySet",
"."
] | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/collection/TrieMap.java#L325-L368 | train |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/collection/TrieMap.java | TrieMap.compact | private void compact(final CharSequence key) {
final int keyLength = key.length();
TrieNode<V> currentNode = getRoot();
TrieNode<V> lastInUseNode = currentNode;
int lastInUseIndex = 0;
for (int i = 0; i < keyLength && currentNode != null; i++) {
if (currentNode.inUse... | java | private void compact(final CharSequence key) {
final int keyLength = key.length();
TrieNode<V> currentNode = getRoot();
TrieNode<V> lastInUseNode = currentNode;
int lastInUseIndex = 0;
for (int i = 0; i < keyLength && currentNode != null; i++) {
if (currentNode.inUse... | [
"private",
"void",
"compact",
"(",
"final",
"CharSequence",
"key",
")",
"{",
"final",
"int",
"keyLength",
"=",
"key",
".",
"length",
"(",
")",
";",
"TrieNode",
"<",
"V",
">",
"currentNode",
"=",
"getRoot",
"(",
")",
";",
"TrieNode",
"<",
"V",
">",
"l... | Compact the trie by removing unused nodes on the path that is specified
by the given key. | [
"Compact",
"the",
"trie",
"by",
"removing",
"unused",
"nodes",
"on",
"the",
"path",
"that",
"is",
"specified",
"by",
"the",
"given",
"key",
"."
] | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/collection/TrieMap.java#L386-L406 | train |
ltearno/hexa.tools | hexa.binding/processor/src/main/java/fr/lteconsulting/hexa/databinding/annotation/processor/TypeSimplifier.java | TypeSimplifier.getTypeQualifiedName | public static String getTypeQualifiedName(TypeMirror type) throws CodeGenerationIncompleteException
{
if(type.toString().equals("<any>")) {
throw new CodeGenerationIncompleteException("Type reported as <any> is likely a not-yet " +
"generated parameterized type.");
}
switch( type.getKind() )
{
case ... | java | public static String getTypeQualifiedName(TypeMirror type) throws CodeGenerationIncompleteException
{
if(type.toString().equals("<any>")) {
throw new CodeGenerationIncompleteException("Type reported as <any> is likely a not-yet " +
"generated parameterized type.");
}
switch( type.getKind() )
{
case ... | [
"public",
"static",
"String",
"getTypeQualifiedName",
"(",
"TypeMirror",
"type",
")",
"throws",
"CodeGenerationIncompleteException",
"{",
"if",
"(",
"type",
".",
"toString",
"(",
")",
".",
"equals",
"(",
"\"<any>\"",
")",
")",
"{",
"throw",
"new",
"CodeGeneratio... | Returns the qualified name of a TypeMirror. | [
"Returns",
"the",
"qualified",
"name",
"of",
"a",
"TypeMirror",
"."
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.binding/processor/src/main/java/fr/lteconsulting/hexa/databinding/annotation/processor/TypeSimplifier.java#L247-L295 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/calendar/CalendarPeriod.java | CalendarPeriod.IsInside | public boolean IsInside( String pDate )
{
if( periods == null )
{
if( days == null ) // security added to avoid null exception
return false;
if( days.getDay( CalendarFunctions.date_get_day( pDate ) ).get() > 0 )
return true;
return false;
}
for( int i = 0; i < periods.size(); i++ )
{
P... | java | public boolean IsInside( String pDate )
{
if( periods == null )
{
if( days == null ) // security added to avoid null exception
return false;
if( days.getDay( CalendarFunctions.date_get_day( pDate ) ).get() > 0 )
return true;
return false;
}
for( int i = 0; i < periods.size(); i++ )
{
P... | [
"public",
"boolean",
"IsInside",
"(",
"String",
"pDate",
")",
"{",
"if",
"(",
"periods",
"==",
"null",
")",
"{",
"if",
"(",
"days",
"==",
"null",
")",
"// security added to avoid null exception",
"return",
"false",
";",
"if",
"(",
"days",
".",
"getDay",
"(... | false if not | [
"false",
"if",
"not"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/calendar/CalendarPeriod.java#L185-L208 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/calendar/CalendarPeriod.java | CalendarPeriod.IsContained | public boolean IsContained( String pFrom, String pTo )
{
if( periods == null )
{
// echo "IsContained() TO BE IMPLEMENTED FLLKJ :: {{ } ''<br/>";
throw new RuntimeException( "Error Periods is Null" );
}
for( int i = 0; i < periods.size(); i++ )
{
Period period = periods.get( i );
if( period.getF... | java | public boolean IsContained( String pFrom, String pTo )
{
if( periods == null )
{
// echo "IsContained() TO BE IMPLEMENTED FLLKJ :: {{ } ''<br/>";
throw new RuntimeException( "Error Periods is Null" );
}
for( int i = 0; i < periods.size(); i++ )
{
Period period = periods.get( i );
if( period.getF... | [
"public",
"boolean",
"IsContained",
"(",
"String",
"pFrom",
",",
"String",
"pTo",
")",
"{",
"if",
"(",
"periods",
"==",
"null",
")",
"{",
"// echo \"IsContained() TO BE IMPLEMENTED FLLKJ :: {{ } ''<br/>\";",
"throw",
"new",
"RuntimeException",
"(",
"\"Error Periods is N... | list of periods, false if not | [
"list",
"of",
"periods",
"false",
"if",
"not"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/calendar/CalendarPeriod.java#L212-L231 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/calendar/CalendarPeriod.java | CalendarPeriod.Resolve | public void Resolve( String pFrom, String pTo )
{
if( periods != null )
{
// call on an already resolved CalendarPeriod
// echo
// "LJLJKZHL KJH ELF B.EB EKJGF EFJBH EKLFJHL JGH <{{ : ' } <br/>";
throw new RuntimeException( "Error call on an already resolved CalendarPeriod" );
}
// echo "Resolving... | java | public void Resolve( String pFrom, String pTo )
{
if( periods != null )
{
// call on an already resolved CalendarPeriod
// echo
// "LJLJKZHL KJH ELF B.EB EKJGF EFJBH EKLFJHL JGH <{{ : ' } <br/>";
throw new RuntimeException( "Error call on an already resolved CalendarPeriod" );
}
// echo "Resolving... | [
"public",
"void",
"Resolve",
"(",
"String",
"pFrom",
",",
"String",
"pTo",
")",
"{",
"if",
"(",
"periods",
"!=",
"null",
")",
"{",
"// call on an already resolved CalendarPeriod",
"// echo",
"// \"LJLJKZHL KJH ELF B.EB EKJGF EFJBH EKLFJHL JGH <{{ : ' } <br/>\";",
"throw",
... | from and to parameters | [
"from",
"and",
"to",
"parameters"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/calendar/CalendarPeriod.java#L438-L539 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/calendar/CalendarPeriod.java | CalendarPeriod._Intersect | private List<Period> _Intersect( List<Period> periods1, List<Period> periods2 )
{
List<Period> result = new ArrayList<Period>();
int count1 = periods1.size();
int count2 = periods2.size();
int i = 0;
int j = 0;
while( i < count1 && j < count2 )
{
// one of the periods begins after the end of the ot... | java | private List<Period> _Intersect( List<Period> periods1, List<Period> periods2 )
{
List<Period> result = new ArrayList<Period>();
int count1 = periods1.size();
int count2 = periods2.size();
int i = 0;
int j = 0;
while( i < count1 && j < count2 )
{
// one of the periods begins after the end of the ot... | [
"private",
"List",
"<",
"Period",
">",
"_Intersect",
"(",
"List",
"<",
"Period",
">",
"periods1",
",",
"List",
"<",
"Period",
">",
"periods2",
")",
"{",
"List",
"<",
"Period",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"Period",
">",
"(",
")",
";",... | intersect two period arrays | [
"intersect",
"two",
"period",
"arrays"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/calendar/CalendarPeriod.java#L572-L611 | train |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/comparator/BaseComparator.java | BaseComparator.compareNullObjects | protected Integer compareNullObjects(Object object1, Object object2) {
if ((object1 == null) && (object2 == null)) {
return 0;
}
if (object1 == null) {
return 1;
}
if (object2 == null) {
return -1;
}
return null;
... | java | protected Integer compareNullObjects(Object object1, Object object2) {
if ((object1 == null) && (object2 == null)) {
return 0;
}
if (object1 == null) {
return 1;
}
if (object2 == null) {
return -1;
}
return null;
... | [
"protected",
"Integer",
"compareNullObjects",
"(",
"Object",
"object1",
",",
"Object",
"object2",
")",
"{",
"if",
"(",
"(",
"object1",
"==",
"null",
")",
"&&",
"(",
"object2",
"==",
"null",
")",
")",
"{",
"return",
"0",
";",
"}",
"if",
"(",
"object1",
... | Checks for null objects and returns the proper result depedning on which
object is null
@param object1
@param object2
@return <ol> <li>0 = field null or both objects null</li> <li>1 = object1
is null</li> <li>-1 = object2 is null</li> <li>null = both objects are
not null</li> </ol> | [
"Checks",
"for",
"null",
"objects",
"and",
"returns",
"the",
"proper",
"result",
"depedning",
"on",
"which",
"object",
"is",
"null"
] | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/comparator/BaseComparator.java#L38-L49 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/chart/raphael/PathBuilder.java | PathBuilder.append | public PathBuilder append( String cmd, double... coords )
{
s.append( cmd ).append( " " );
for( double a : coords )
{
s.append( a ).append( " " );
}
return this;
} | java | public PathBuilder append( String cmd, double... coords )
{
s.append( cmd ).append( " " );
for( double a : coords )
{
s.append( a ).append( " " );
}
return this;
} | [
"public",
"PathBuilder",
"append",
"(",
"String",
"cmd",
",",
"double",
"...",
"coords",
")",
"{",
"s",
".",
"append",
"(",
"cmd",
")",
".",
"append",
"(",
"\" \"",
")",
";",
"for",
"(",
"double",
"a",
":",
"coords",
")",
"{",
"s",
".",
"append",
... | append an SVG Path command to this instance | [
"append",
"an",
"SVG",
"Path",
"command",
"to",
"this",
"instance"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/chart/raphael/PathBuilder.java#L20-L28 | train |
Blazebit/blaze-utils | blaze-ee-utils/src/main/java/com/blazebit/cdi/exception/CatchHandlerInterceptor.java | CatchHandlerInterceptor.handle | @AroundInvoke
public Object handle(InvocationContext ic) throws Exception {
Method m = ic.getMethod();
Object targetObject = ic.getTarget();
Class<?> targetClass = targetObject == null ? m.getDeclaringClass()
: targetObject.getClass();
CatchHandler exceptionHandlerAnn... | java | @AroundInvoke
public Object handle(InvocationContext ic) throws Exception {
Method m = ic.getMethod();
Object targetObject = ic.getTarget();
Class<?> targetClass = targetObject == null ? m.getDeclaringClass()
: targetObject.getClass();
CatchHandler exceptionHandlerAnn... | [
"@",
"AroundInvoke",
"public",
"Object",
"handle",
"(",
"InvocationContext",
"ic",
")",
"throws",
"Exception",
"{",
"Method",
"m",
"=",
"ic",
".",
"getMethod",
"(",
")",
";",
"Object",
"targetObject",
"=",
"ic",
".",
"getTarget",
"(",
")",
";",
"Class",
... | Handles the exception.
@param ic The InvocationContext.
@return The result of the intercepted method.
@throws Exception if an error occurs the handling | [
"Handles",
"the",
"exception",
"."
] | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-ee-utils/src/main/java/com/blazebit/cdi/exception/CatchHandlerInterceptor.java#L47-L137 | train |
Blazebit/blaze-utils | blaze-ee-utils/src/main/java/com/blazebit/cdi/exception/CatchHandlerInterceptor.java | CatchHandlerInterceptor.invokeCleanups | private boolean invokeCleanups(Class<?> clazz, Object target,
Class<?> cleanupClazz, Throwable exception) throws Exception {
boolean invoked = false;
if (!cleanupClazz.equals(Object.class)) {
// Christian Beikov 29.07.2013: Traverse whole hierarchy
... | java | private boolean invokeCleanups(Class<?> clazz, Object target,
Class<?> cleanupClazz, Throwable exception) throws Exception {
boolean invoked = false;
if (!cleanupClazz.equals(Object.class)) {
// Christian Beikov 29.07.2013: Traverse whole hierarchy
... | [
"private",
"boolean",
"invokeCleanups",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Object",
"target",
",",
"Class",
"<",
"?",
">",
"cleanupClazz",
",",
"Throwable",
"exception",
")",
"throws",
"Exception",
"{",
"boolean",
"invoked",
"=",
"false",
";",
"if... | Invokes the cleanup methods of the exception handler or exception
handling.
@param clazz the class of the bean to get the methods from
@param target the target on which the method is invoked
@param cleanupName the name of the cleanup method
@return true if the cleanup method were found and invoked
@throws E... | [
"Invokes",
"the",
"cleanup",
"methods",
"of",
"the",
"exception",
"handler",
"or",
"exception",
"handling",
"."
] | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-ee-utils/src/main/java/com/blazebit/cdi/exception/CatchHandlerInterceptor.java#L171-L208 | train |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/ConnectionContextFactory.java | ConnectionContextFactory.createProducerConnectionContext | public ProducerConnectionContext createProducerConnectionContext(Endpoint endpoint) throws JMSException {
ProducerConnectionContext context = new ProducerConnectionContext();
createOrReuseConnection(context, true);
createSession(context);
createDestination(context, endpoint);
cre... | java | public ProducerConnectionContext createProducerConnectionContext(Endpoint endpoint) throws JMSException {
ProducerConnectionContext context = new ProducerConnectionContext();
createOrReuseConnection(context, true);
createSession(context);
createDestination(context, endpoint);
cre... | [
"public",
"ProducerConnectionContext",
"createProducerConnectionContext",
"(",
"Endpoint",
"endpoint",
")",
"throws",
"JMSException",
"{",
"ProducerConnectionContext",
"context",
"=",
"new",
"ProducerConnectionContext",
"(",
")",
";",
"createOrReuseConnection",
"(",
"context"... | Creates a new producer connection context, reusing any existing connection that might have already been created.
The destination of the connection's session will be that of the given endpoint.
@param endpoint where the producer will send messages
@return the new producer connection context fully populated
@throws JMSE... | [
"Creates",
"a",
"new",
"producer",
"connection",
"context",
"reusing",
"any",
"existing",
"connection",
"that",
"might",
"have",
"already",
"been",
"created",
".",
"The",
"destination",
"of",
"the",
"connection",
"s",
"session",
"will",
"be",
"that",
"of",
"th... | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/ConnectionContextFactory.java#L92-L99 | train |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/ConnectionContextFactory.java | ConnectionContextFactory.cacheConnection | protected void cacheConnection(Connection connection, boolean closeExistingConnection) {
if (this.connection != null && closeExistingConnection) {
try {
// make sure it is closed to free up any resources it was using
this.connection.close();
} catch (JMSEx... | java | protected void cacheConnection(Connection connection, boolean closeExistingConnection) {
if (this.connection != null && closeExistingConnection) {
try {
// make sure it is closed to free up any resources it was using
this.connection.close();
} catch (JMSEx... | [
"protected",
"void",
"cacheConnection",
"(",
"Connection",
"connection",
",",
"boolean",
"closeExistingConnection",
")",
"{",
"if",
"(",
"this",
".",
"connection",
"!=",
"null",
"&&",
"closeExistingConnection",
")",
"{",
"try",
"{",
"// make sure it is closed to free ... | To store a connection in this processor object, call this setter.
If there was already a cached connection, it will be closed.
NOTE: Calling {@link #createConnection(ConnectionContext)} does
<b>not</b> set this processor's connection - that method only creates the
connection and puts that connection in the context. It... | [
"To",
"store",
"a",
"connection",
"in",
"this",
"processor",
"object",
"call",
"this",
"setter",
".",
"If",
"there",
"was",
"already",
"a",
"cached",
"connection",
"it",
"will",
"be",
"closed",
"."
] | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/ConnectionContextFactory.java#L192-L203 | train |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/ConnectionContextFactory.java | ConnectionContextFactory.createConnection | protected void createConnection(ConnectionContext context) throws JMSException {
if (context == null) {
throw new IllegalStateException("The context is null");
}
ConnectionFactory factory = getConnectionFactory();
Connection conn = factory.createConnection();
context.... | java | protected void createConnection(ConnectionContext context) throws JMSException {
if (context == null) {
throw new IllegalStateException("The context is null");
}
ConnectionFactory factory = getConnectionFactory();
Connection conn = factory.createConnection();
context.... | [
"protected",
"void",
"createConnection",
"(",
"ConnectionContext",
"context",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"The context is null\"",
")",
";",
"}",
"ConnectionFactory... | Creates a connection using this object's connection factory and stores
that connection in the given context object.
NOTE: this does <b>not</b> set the connection in this processor object.
If the caller wants the created connection cached in this processor
object, {@link #cacheConnection} must be passed the connection
... | [
"Creates",
"a",
"connection",
"using",
"this",
"object",
"s",
"connection",
"factory",
"and",
"stores",
"that",
"connection",
"in",
"the",
"given",
"context",
"object",
"."
] | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/ConnectionContextFactory.java#L274-L281 | train |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/ConnectionContextFactory.java | ConnectionContextFactory.createSession | protected void createSession(ConnectionContext context) throws JMSException {
if (context == null) {
throw new IllegalStateException("The context is null");
}
Connection conn = context.getConnection();
if (conn == null) {
throw new IllegalStateException("The conte... | java | protected void createSession(ConnectionContext context) throws JMSException {
if (context == null) {
throw new IllegalStateException("The context is null");
}
Connection conn = context.getConnection();
if (conn == null) {
throw new IllegalStateException("The conte... | [
"protected",
"void",
"createSession",
"(",
"ConnectionContext",
"context",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"The context is null\"",
")",
";",
"}",
"Connection",
"conn... | Creates a default session using the context's connection. This implementation creates a non-transacted,
auto-acknowledged session. Subclasses are free to override this behavior.
@param context the context where the new session is stored
@throws JMSException any error
@throws IllegalStateException if the context is nul... | [
"Creates",
"a",
"default",
"session",
"using",
"the",
"context",
"s",
"connection",
".",
"This",
"implementation",
"creates",
"a",
"non",
"-",
"transacted",
"auto",
"-",
"acknowledged",
"session",
".",
"Subclasses",
"are",
"free",
"to",
"override",
"this",
"be... | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/ConnectionContextFactory.java#L291-L301 | train |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/ConnectionContextFactory.java | ConnectionContextFactory.createDestination | protected void createDestination(ConnectionContext context, Endpoint endpoint) throws JMSException {
if (endpoint == null) {
throw new IllegalStateException("Endpoint is null");
}
if (context == null) {
throw new IllegalStateException("The context is null");
}
... | java | protected void createDestination(ConnectionContext context, Endpoint endpoint) throws JMSException {
if (endpoint == null) {
throw new IllegalStateException("Endpoint is null");
}
if (context == null) {
throw new IllegalStateException("The context is null");
}
... | [
"protected",
"void",
"createDestination",
"(",
"ConnectionContext",
"context",
",",
"Endpoint",
"endpoint",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"endpoint",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Endpoint is null\"",
")",
... | Creates a destination using the context's session. The destination correlates to the given named queue or topic.
@param context the context where the new destination is stored
@param endpoint identifies the queue or topic
@throws JMSException any error
@throws IllegalStateException if the context is null or the contex... | [
"Creates",
"a",
"destination",
"using",
"the",
"context",
"s",
"session",
".",
"The",
"destination",
"correlates",
"to",
"the",
"given",
"named",
"queue",
"or",
"topic",
"."
] | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/ConnectionContextFactory.java#L311-L337 | train |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/ConnectionContextFactory.java | ConnectionContextFactory.createProducer | protected void createProducer(ProducerConnectionContext context) throws JMSException {
if (context == null) {
throw new IllegalStateException("The context is null");
}
Session session = context.getSession();
if (session == null) {
throw new IllegalStateException("... | java | protected void createProducer(ProducerConnectionContext context) throws JMSException {
if (context == null) {
throw new IllegalStateException("The context is null");
}
Session session = context.getSession();
if (session == null) {
throw new IllegalStateException("... | [
"protected",
"void",
"createProducer",
"(",
"ProducerConnectionContext",
"context",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"The context is null\"",
")",
";",
"}",
"Session",
... | Creates a message producer using the context's session and destination.
@param context the context where the new producer is stored
@throws JMSException any error
@throws IllegalStateException if the context is null or the context's session is null
or the context's destination is null | [
"Creates",
"a",
"message",
"producer",
"using",
"the",
"context",
"s",
"session",
"and",
"destination",
"."
] | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/ConnectionContextFactory.java#L356-L370 | train |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/ConnectionContextFactory.java | ConnectionContextFactory.createConsumer | protected void createConsumer(ConsumerConnectionContext context, String messageSelector) throws JMSException {
if (context == null) {
throw new IllegalStateException("The context is null");
}
Session session = context.getSession();
if (session == null) {
throw new... | java | protected void createConsumer(ConsumerConnectionContext context, String messageSelector) throws JMSException {
if (context == null) {
throw new IllegalStateException("The context is null");
}
Session session = context.getSession();
if (session == null) {
throw new... | [
"protected",
"void",
"createConsumer",
"(",
"ConsumerConnectionContext",
"context",
",",
"String",
"messageSelector",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"The context is null... | Creates a message consumer using the context's session and destination.
@param context the context where the new consumer is stored
@param messageSelector the message selector expression that the consumer will use to filter messages
@throws JMSException any error
@throws IllegalStateException if the context is null or... | [
"Creates",
"a",
"message",
"consumer",
"using",
"the",
"context",
"s",
"session",
"and",
"destination",
"."
] | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/ConnectionContextFactory.java#L381-L395 | train |
gtri/typesafeconfig-extensions | factory/src/main/java/edu/gatech/gtri/typesafeconfigextensions/factory/ConfigFactory.java | ConfigFactory.defaultBindings | public static Bindings defaultBindings() {
return noHashMapBindings()
.set(
ClassLoader.class,
Thread.currentThread().getContextClassLoader()
)
.set(
ConfigParseOptions.class,
ConfigParseOptions.defaults()
... | java | public static Bindings defaultBindings() {
return noHashMapBindings()
.set(
ClassLoader.class,
Thread.currentThread().getContextClassLoader()
)
.set(
ConfigParseOptions.class,
ConfigParseOptions.defaults()
... | [
"public",
"static",
"Bindings",
"defaultBindings",
"(",
")",
"{",
"return",
"noHashMapBindings",
"(",
")",
".",
"set",
"(",
"ClassLoader",
".",
"class",
",",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
")",
".",
"set",
... | Some default bindings that most config factories will need.
<ul>
<li>
{@link ClassLoader} →
{@link Thread#currentThread()}.{@link Thread#getContextClassLoader()
getContextClassLoader()}
</li>
<li>
{@link com.typesafe.config.ConfigParseOptions} →
{@link com.typesafe.config.ConfigParseOptions#defaults()}
</li>... | [
"Some",
"default",
"bindings",
"that",
"most",
"config",
"factories",
"will",
"need",
"."
] | 4ef126605f45c60041542a23b9f331b0575e9bd1 | https://github.com/gtri/typesafeconfig-extensions/blob/4ef126605f45c60041542a23b9f331b0575e9bd1/factory/src/main/java/edu/gatech/gtri/typesafeconfigextensions/factory/ConfigFactory.java#L584-L603 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/calendar/CalendarPeriodAssociative.java | CalendarPeriodAssociative.Init | public void Init( CalendarPeriod period, T value )
{
for( int i = 0; i < period.getPeriods().size(); i++ )
{
Period p = period.getPeriods().get( i );
periods.add( new PeriodAssociative<T>( p.getFrom(), p.getTo(), value ) );
}
} | java | public void Init( CalendarPeriod period, T value )
{
for( int i = 0; i < period.getPeriods().size(); i++ )
{
Period p = period.getPeriods().get( i );
periods.add( new PeriodAssociative<T>( p.getFrom(), p.getTo(), value ) );
}
} | [
"public",
"void",
"Init",
"(",
"CalendarPeriod",
"period",
",",
"T",
"value",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"period",
".",
"getPeriods",
"(",
")",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"Period",
"p",
"=",... | init from a CalendarPeriod with a value | [
"init",
"from",
"a",
"CalendarPeriod",
"with",
"a",
"value"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/calendar/CalendarPeriodAssociative.java#L41-L48 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/calendar/CalendarPeriodAssociative.java | CalendarPeriodAssociative.Add | public Boolean Add( CalendarPeriodAssociative<T> period, AddFunction<T> addFunction )
{
// combine les deux tableaux dans ordre croissant
List<PeriodAssociative<T>> combined = _Combine( periods, period.getPeriods() );
// merge overlapping periods
List<PeriodAssociative<T>> result = _Merge( combined, addFuncti... | java | public Boolean Add( CalendarPeriodAssociative<T> period, AddFunction<T> addFunction )
{
// combine les deux tableaux dans ordre croissant
List<PeriodAssociative<T>> combined = _Combine( periods, period.getPeriods() );
// merge overlapping periods
List<PeriodAssociative<T>> result = _Merge( combined, addFuncti... | [
"public",
"Boolean",
"Add",
"(",
"CalendarPeriodAssociative",
"<",
"T",
">",
"period",
",",
"AddFunction",
"<",
"T",
">",
"addFunction",
")",
"{",
"// combine les deux tableaux dans ordre croissant",
"List",
"<",
"PeriodAssociative",
"<",
"T",
">>",
"combined",
"=",... | adding two associative periods | [
"adding",
"two",
"associative",
"periods"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/calendar/CalendarPeriodAssociative.java#L75-L89 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/calendar/CalendarPeriodAssociative.java | CalendarPeriodAssociative.GetCalendarPeriod | public CalendarPeriod GetCalendarPeriod()
{
CalendarPeriod res = new CalendarPeriod();
List<Period> periods = new ArrayList<Period>();
for( int i = 0; i < this.periods.size(); i++ )
{
PeriodAssociative<T> p = this.periods.get( i );
periods.add( new Period( p.getFrom(), p.getTo() ) );
}
// use merge t... | java | public CalendarPeriod GetCalendarPeriod()
{
CalendarPeriod res = new CalendarPeriod();
List<Period> periods = new ArrayList<Period>();
for( int i = 0; i < this.periods.size(); i++ )
{
PeriodAssociative<T> p = this.periods.get( i );
periods.add( new Period( p.getFrom(), p.getTo() ) );
}
// use merge t... | [
"public",
"CalendarPeriod",
"GetCalendarPeriod",
"(",
")",
"{",
"CalendarPeriod",
"res",
"=",
"new",
"CalendarPeriod",
"(",
")",
";",
"List",
"<",
"Period",
">",
"periods",
"=",
"new",
"ArrayList",
"<",
"Period",
">",
"(",
")",
";",
"for",
"(",
"int",
"i... | returns the same but with no values, and with the periods merged | [
"returns",
"the",
"same",
"but",
"with",
"no",
"values",
"and",
"with",
"the",
"periods",
"merged"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/calendar/CalendarPeriodAssociative.java#L92-L105 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/calendar/ParsingExpression.java | ParsingExpression._readDate | private boolean _readDate()
{
int endIndex = pos + 10;
if( endIndex <= len )
{
_date = text.substring( pos, endIndex );
pos += 10;
return true;
}
pos = len;
return false;
} | java | private boolean _readDate()
{
int endIndex = pos + 10;
if( endIndex <= len )
{
_date = text.substring( pos, endIndex );
pos += 10;
return true;
}
pos = len;
return false;
} | [
"private",
"boolean",
"_readDate",
"(",
")",
"{",
"int",
"endIndex",
"=",
"pos",
"+",
"10",
";",
"if",
"(",
"endIndex",
"<=",
"len",
")",
"{",
"_date",
"=",
"text",
".",
"substring",
"(",
"pos",
",",
"endIndex",
")",
";",
"pos",
"+=",
"10",
";",
... | parse a date in the format yyyy-mm-dd
@return boolean | [
"parse",
"a",
"date",
"in",
"the",
"format",
"yyyy",
"-",
"mm",
"-",
"dd"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/calendar/ParsingExpression.java#L139-L150 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/chart/XYMoneyStep.java | XYMoneyStep.emphasizePoint | public void emphasizePoint( int index )
{
if( dots == null || dots.length < (index - 1) )
return; // impossible !
// if no change, nothing to do
if( emphasizedPoint == index )
return;
// de-emphasize the current emphasized point
if( emphasizedPoint >= 0 )
{
dots[emphasizedPoint].attr( "r", dotNo... | java | public void emphasizePoint( int index )
{
if( dots == null || dots.length < (index - 1) )
return; // impossible !
// if no change, nothing to do
if( emphasizedPoint == index )
return;
// de-emphasize the current emphasized point
if( emphasizedPoint >= 0 )
{
dots[emphasizedPoint].attr( "r", dotNo... | [
"public",
"void",
"emphasizePoint",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"dots",
"==",
"null",
"||",
"dots",
".",
"length",
"<",
"(",
"index",
"-",
"1",
")",
")",
"return",
";",
"// impossible !",
"// if no change, nothing to do",
"if",
"(",
"emphasiz... | index < 0 means that we emphasize no point at all | [
"index",
"<",
"0",
"means",
"that",
"we",
"emphasize",
"no",
"point",
"at",
"all"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/chart/XYMoneyStep.java#L75-L98 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/treetable/Row.java | Row.moveLastChild | public void moveLastChild( Row newParent )
{
if( this == newParent )
return;
// remove from its current position
Row parentItem = m_parent;
if( parentItem == null )
parentItem = this.treeTable.m_rootItem;
parentItem.getChilds().remove( this );
// DOM.removeChild( m_body, m_tr );
if( newParent == ... | java | public void moveLastChild( Row newParent )
{
if( this == newParent )
return;
// remove from its current position
Row parentItem = m_parent;
if( parentItem == null )
parentItem = this.treeTable.m_rootItem;
parentItem.getChilds().remove( this );
// DOM.removeChild( m_body, m_tr );
if( newParent == ... | [
"public",
"void",
"moveLastChild",
"(",
"Row",
"newParent",
")",
"{",
"if",
"(",
"this",
"==",
"newParent",
")",
"return",
";",
"// remove from its current position",
"Row",
"parentItem",
"=",
"m_parent",
";",
"if",
"(",
"parentItem",
"==",
"null",
")",
"paren... | move to be the last item of parent | [
"move",
"to",
"be",
"the",
"last",
"item",
"of",
"parent"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/treetable/Row.java#L124-L161 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/treetable/Row.java | Row.moveBefore | public void moveBefore( Row item )
{
if( this == item )
return;
Element lastTrToMove = getLastLeafTR();
Element firstChildRow = DOM.getNextSibling( m_tr );
// remove from its current position
Row parentItem = m_parent;
if( parentItem == null )
parentItem = this.treeTable.m_rootItem;
parentItem.ge... | java | public void moveBefore( Row item )
{
if( this == item )
return;
Element lastTrToMove = getLastLeafTR();
Element firstChildRow = DOM.getNextSibling( m_tr );
// remove from its current position
Row parentItem = m_parent;
if( parentItem == null )
parentItem = this.treeTable.m_rootItem;
parentItem.ge... | [
"public",
"void",
"moveBefore",
"(",
"Row",
"item",
")",
"{",
"if",
"(",
"this",
"==",
"item",
")",
"return",
";",
"Element",
"lastTrToMove",
"=",
"getLastLeafTR",
"(",
")",
";",
"Element",
"firstChildRow",
"=",
"DOM",
".",
"getNextSibling",
"(",
"m_tr",
... | move to position just before "item" | [
"move",
"to",
"position",
"just",
"before",
"item"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/treetable/Row.java#L196-L259 | train |
ltearno/hexa.tools | hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/properties/PropertyChanges.java | PropertyChanges.removeHandler | void removeHandler( Object handlerRegistration )
{
// Through object's interface implementation
if( handlerRegistration instanceof DirectHandlerInfo )
{
DirectHandlerInfo info = (DirectHandlerInfo) handlerRegistration;
info.source.removePropertyChangedHandler( info.registrationObject );
return;
}
... | java | void removeHandler( Object handlerRegistration )
{
// Through object's interface implementation
if( handlerRegistration instanceof DirectHandlerInfo )
{
DirectHandlerInfo info = (DirectHandlerInfo) handlerRegistration;
info.source.removePropertyChangedHandler( info.registrationObject );
return;
}
... | [
"void",
"removeHandler",
"(",
"Object",
"handlerRegistration",
")",
"{",
"// Through object's interface implementation",
"if",
"(",
"handlerRegistration",
"instanceof",
"DirectHandlerInfo",
")",
"{",
"DirectHandlerInfo",
"info",
"=",
"(",
"DirectHandlerInfo",
")",
"handlerR... | Unregisters a handler, freeing associated resources
@param handlerRegistration The object received after a call to {@link PropertyChanges} | [
"Unregisters",
"a",
"handler",
"freeing",
"associated",
"resources"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/properties/PropertyChanges.java#L77-L113 | train |
hawkular/hawkular-commons | hawkular-cors-jaxrs-filter/src/main/java/org/hawkular/jaxrs/filter/cors/CorsFilters.java | CorsFilters.filterRequest | public static void filterRequest(ContainerRequestContext requestContext, Predicate<String> predicate) {
//NOT a CORS request
String requestOrigin = requestContext.getHeaderString(Headers.ORIGIN);
if (requestOrigin == null) {
return;
}
if (!predicate.test(requestOrigi... | java | public static void filterRequest(ContainerRequestContext requestContext, Predicate<String> predicate) {
//NOT a CORS request
String requestOrigin = requestContext.getHeaderString(Headers.ORIGIN);
if (requestOrigin == null) {
return;
}
if (!predicate.test(requestOrigi... | [
"public",
"static",
"void",
"filterRequest",
"(",
"ContainerRequestContext",
"requestContext",
",",
"Predicate",
"<",
"String",
">",
"predicate",
")",
"{",
"//NOT a CORS request",
"String",
"requestOrigin",
"=",
"requestContext",
".",
"getHeaderString",
"(",
"Headers",
... | Apply CORS filter on request
@param requestContext request context
@param predicate must return {@code true} if the input origin is allowed, else {@code false}. | [
"Apply",
"CORS",
"filter",
"on",
"request"
] | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-cors-jaxrs-filter/src/main/java/org/hawkular/jaxrs/filter/cors/CorsFilters.java#L41-L57 | train |
hawkular/hawkular-commons | hawkular-cors-jaxrs-filter/src/main/java/org/hawkular/jaxrs/filter/cors/CorsFilters.java | CorsFilters.filterResponse | public static void filterResponse(ContainerRequestContext requestContext,
ContainerResponseContext responseContext,
String extraAccesControlAllowHeaders) {
String requestOrigin = requestContext.getHeaderString(Headers.ORIGIN);
... | java | public static void filterResponse(ContainerRequestContext requestContext,
ContainerResponseContext responseContext,
String extraAccesControlAllowHeaders) {
String requestOrigin = requestContext.getHeaderString(Headers.ORIGIN);
... | [
"public",
"static",
"void",
"filterResponse",
"(",
"ContainerRequestContext",
"requestContext",
",",
"ContainerResponseContext",
"responseContext",
",",
"String",
"extraAccesControlAllowHeaders",
")",
"{",
"String",
"requestOrigin",
"=",
"requestContext",
".",
"getHeaderStrin... | Apply CORS headers on response
@param requestContext request context
@param responseContext response context
@param extraAccesControlAllowHeaders eventual extra allowed headers (nullable) | [
"Apply",
"CORS",
"headers",
"on",
"response"
] | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-cors-jaxrs-filter/src/main/java/org/hawkular/jaxrs/filter/cors/CorsFilters.java#L65-L90 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/other/HtmlTableTemplate.java | HtmlTableTemplate.getCell | public static TableCellElement getCell( Element root, int column, int row )
{
TableSectionElement tbody = getTBodyElement( root );
TableRowElement tr = tbody.getChild( row ).cast();
TableCellElement td = tr.getChild( column ).cast();
return td;
} | java | public static TableCellElement getCell( Element root, int column, int row )
{
TableSectionElement tbody = getTBodyElement( root );
TableRowElement tr = tbody.getChild( row ).cast();
TableCellElement td = tr.getChild( column ).cast();
return td;
} | [
"public",
"static",
"TableCellElement",
"getCell",
"(",
"Element",
"root",
",",
"int",
"column",
",",
"int",
"row",
")",
"{",
"TableSectionElement",
"tbody",
"=",
"getTBodyElement",
"(",
"root",
")",
";",
"TableRowElement",
"tr",
"=",
"tbody",
".",
"getChild",... | Get the TD element
@param root
@param column
@param row
@return | [
"Get",
"the",
"TD",
"element"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/other/HtmlTableTemplate.java#L74-L82 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/other/HtmlTableTemplate.java | HtmlTableTemplate.getParentCellForElement | public static Pair<Integer, Integer> getParentCellForElement( Element root, Element element )
{
Element tbody = getTBodyElement( root );
// Is the element in our table ? and what's the path from the table to it ?
ArrayList<Element> path = TemplateUtils.isDescendant( tbody, element );
if( path == null )
r... | java | public static Pair<Integer, Integer> getParentCellForElement( Element root, Element element )
{
Element tbody = getTBodyElement( root );
// Is the element in our table ? and what's the path from the table to it ?
ArrayList<Element> path = TemplateUtils.isDescendant( tbody, element );
if( path == null )
r... | [
"public",
"static",
"Pair",
"<",
"Integer",
",",
"Integer",
">",
"getParentCellForElement",
"(",
"Element",
"root",
",",
"Element",
"element",
")",
"{",
"Element",
"tbody",
"=",
"getTBodyElement",
"(",
"root",
")",
";",
"// Is the element in our table ? and what's t... | Returns the coordinate of the cell containing the element, given that root is the root of a HtmlTableTemplate
@param root
@param element
@return | [
"Returns",
"the",
"coordinate",
"of",
"the",
"cell",
"containing",
"the",
"element",
"given",
"that",
"root",
"is",
"the",
"root",
"of",
"a",
"HtmlTableTemplate"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/other/HtmlTableTemplate.java#L90-L104 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/dragdrop/DragUtils.java | DragUtils.setDragData | public static void setDragData( Object source, Object data )
{
DragUtils.source = source;
DragUtils.data = data;
} | java | public static void setDragData( Object source, Object data )
{
DragUtils.source = source;
DragUtils.data = data;
} | [
"public",
"static",
"void",
"setDragData",
"(",
"Object",
"source",
",",
"Object",
"data",
")",
"{",
"DragUtils",
".",
"source",
"=",
"source",
";",
"DragUtils",
".",
"data",
"=",
"data",
";",
"}"
] | Sets the drag and drop data and its source
@param source
@param data | [
"Sets",
"the",
"drag",
"and",
"drop",
"data",
"and",
"its",
"source"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/dragdrop/DragUtils.java#L30-L34 | train |
gtri/typesafeconfig-extensions | for-webapps/src/main/java/edu/gatech/gtri/typesafeconfigextensions/forwebapps/WebappConfigs.java | WebappConfigs.webappConfigFactory | public static ConfigFactory
webappConfigFactory(ServletContext servletContext) {
checkNotNull(servletContext);
return webappConfigFactory()
.bind(ServletContextPath.class)
.toInstance(ServletContextPath.fromServletContext(servletContext));
} | java | public static ConfigFactory
webappConfigFactory(ServletContext servletContext) {
checkNotNull(servletContext);
return webappConfigFactory()
.bind(ServletContextPath.class)
.toInstance(ServletContextPath.fromServletContext(servletContext));
} | [
"public",
"static",
"ConfigFactory",
"webappConfigFactory",
"(",
"ServletContext",
"servletContext",
")",
"{",
"checkNotNull",
"(",
"servletContext",
")",
";",
"return",
"webappConfigFactory",
"(",
")",
".",
"bind",
"(",
"ServletContextPath",
".",
"class",
")",
".",... | A sensible default configuration factory for a web application.
<p>Config sources, in order from highest to lowest precedence:</p>
<ul>
<li>System properties</li>
<li>File:
{@code JNDI(webapp.config.directory)/[servlet context path]}</li>
<li>File:
{@code ${webapp.config.directory}/[servlet context path]}</li>
<li>Fil... | [
"A",
"sensible",
"default",
"configuration",
"factory",
"for",
"a",
"web",
"application",
"."
] | 4ef126605f45c60041542a23b9f331b0575e9bd1 | https://github.com/gtri/typesafeconfig-extensions/blob/4ef126605f45c60041542a23b9f331b0575e9bd1/for-webapps/src/main/java/edu/gatech/gtri/typesafeconfigextensions/forwebapps/WebappConfigs.java#L56-L64 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/containers/CenterPanel.java | CenterPanel.setWidget | @Override
public void setWidget( Widget w )
{
// Validate
if( w == widget )
return;
// Detach new child.
if( w != null )
w.removeFromParent();
// Remove old child.
if( widget != null )
remove( widget );
// Logical attach.
widget = w;
if( w != null )
{
// Physical attach.
DOM.app... | java | @Override
public void setWidget( Widget w )
{
// Validate
if( w == widget )
return;
// Detach new child.
if( w != null )
w.removeFromParent();
// Remove old child.
if( widget != null )
remove( widget );
// Logical attach.
widget = w;
if( w != null )
{
// Physical attach.
DOM.app... | [
"@",
"Override",
"public",
"void",
"setWidget",
"(",
"Widget",
"w",
")",
"{",
"// Validate",
"if",
"(",
"w",
"==",
"widget",
")",
"return",
";",
"// Detach new child.",
"if",
"(",
"w",
"!=",
"null",
")",
"w",
".",
"removeFromParent",
"(",
")",
";",
"//... | Sets this panel's widget. Any existing child widget will be removed.
@param w
the panel's new widget, or <code>null</code> to clear the
panel | [
"Sets",
"this",
"panel",
"s",
"widget",
".",
"Any",
"existing",
"child",
"widget",
"will",
"be",
"removed",
"."
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/containers/CenterPanel.java#L148-L173 | train |
ixa-ehu/ixa-pipe-parse | src/main/java/eus/ixa/ixa/pipe/parse/Annotate.java | Annotate.getSentenceFromTokens | private String getSentenceFromTokens(final String[] tokens) {
final StringBuilder sb = new StringBuilder();
for (final String token : tokens) {
sb.append(token).append(" ");
}
final String sentence = sb.toString();
return sentence;
} | java | private String getSentenceFromTokens(final String[] tokens) {
final StringBuilder sb = new StringBuilder();
for (final String token : tokens) {
sb.append(token).append(" ");
}
final String sentence = sb.toString();
return sentence;
} | [
"private",
"String",
"getSentenceFromTokens",
"(",
"final",
"String",
"[",
"]",
"tokens",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"final",
"String",
"token",
":",
"tokens",
")",
"{",
"sb",
".",
"a... | It takes an array of tokens and outputs a string with tokens joined by a
whitespace.
@param array
of tokens
@return string representing one sentence for each array | [
"It",
"takes",
"an",
"array",
"of",
"tokens",
"and",
"outputs",
"a",
"string",
"with",
"tokens",
"joined",
"by",
"a",
"whitespace",
"."
] | ce90ff17ff8846e7a055bcce8b516d976272f856 | https://github.com/ixa-ehu/ixa-pipe-parse/blob/ce90ff17ff8846e7a055bcce8b516d976272f856/src/main/java/eus/ixa/ixa/pipe/parse/Annotate.java#L93-L100 | train |
ixa-ehu/ixa-pipe-parse | src/main/java/eus/ixa/ixa/pipe/parse/Annotate.java | Annotate.addHeadWordsToTreebank | private String addHeadWordsToTreebank(final List<String> inputTrees) {
final StringBuffer parsedDoc = new StringBuffer();
for (final String parseSent : inputTrees) {
final Parse parsedSentence = Parse.parseParse(parseSent);
this.headFinder.printHeads(parsedSentence);
parsedSentence.show(parsed... | java | private String addHeadWordsToTreebank(final List<String> inputTrees) {
final StringBuffer parsedDoc = new StringBuffer();
for (final String parseSent : inputTrees) {
final Parse parsedSentence = Parse.parseParse(parseSent);
this.headFinder.printHeads(parsedSentence);
parsedSentence.show(parsed... | [
"private",
"String",
"addHeadWordsToTreebank",
"(",
"final",
"List",
"<",
"String",
">",
"inputTrees",
")",
"{",
"final",
"StringBuffer",
"parsedDoc",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
"final",
"String",
"parseSent",
":",
"inputTrees",
")"... | Takes as input a list of parse strings, one for line, and annotates the
headwords
@param inputTrees
@return a list of parse trees with headwords annotated | [
"Takes",
"as",
"input",
"a",
"list",
"of",
"parse",
"strings",
"one",
"for",
"line",
"and",
"annotates",
"the",
"headwords"
] | ce90ff17ff8846e7a055bcce8b516d976272f856 | https://github.com/ixa-ehu/ixa-pipe-parse/blob/ce90ff17ff8846e7a055bcce8b516d976272f856/src/main/java/eus/ixa/ixa/pipe/parse/Annotate.java#L237-L246 | train |
ltearno/hexa.tools | hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/DataBinding.java | DataBinding.terminate | public void terminate()
{
log( "term" );
fActivated = false;
converter = null;
source.removePropertyChangedHandler( sourceHandler );
source = null;
sourceHandler = null;
destination.removePropertyChangedHandler( destinationHandler );
destination = null;
destinationHandler = null;
} | java | public void terminate()
{
log( "term" );
fActivated = false;
converter = null;
source.removePropertyChangedHandler( sourceHandler );
source = null;
sourceHandler = null;
destination.removePropertyChangedHandler( destinationHandler );
destination = null;
destinationHandler = null;
} | [
"public",
"void",
"terminate",
"(",
")",
"{",
"log",
"(",
"\"term\"",
")",
";",
"fActivated",
"=",
"false",
";",
"converter",
"=",
"null",
";",
"source",
".",
"removePropertyChangedHandler",
"(",
"sourceHandler",
")",
";",
"source",
"=",
"null",
";",
"sour... | Terminates the Data Binding activation and cleans up all related
resources. You should call this method when you want to free the binding,
in order to lower memory usage. | [
"Terminates",
"the",
"Data",
"Binding",
"activation",
"and",
"cleans",
"up",
"all",
"related",
"resources",
".",
"You",
"should",
"call",
"this",
"method",
"when",
"you",
"want",
"to",
"free",
"the",
"binding",
"in",
"order",
"to",
"lower",
"memory",
"usage"... | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/DataBinding.java#L96-L111 | train |
recruit-mp/android-RMP-Appirater | library/src/main/java/jp/co/recruit_mp/android/rmp_appirater/RmpAppirater.java | RmpAppirater.tryToShowPrompt | public static void tryToShowPrompt(Context context, OnCompleteListener onCompleteListener) {
tryToShowPrompt(context, null, null, onCompleteListener);
} | java | public static void tryToShowPrompt(Context context, OnCompleteListener onCompleteListener) {
tryToShowPrompt(context, null, null, onCompleteListener);
} | [
"public",
"static",
"void",
"tryToShowPrompt",
"(",
"Context",
"context",
",",
"OnCompleteListener",
"onCompleteListener",
")",
"{",
"tryToShowPrompt",
"(",
"context",
",",
"null",
",",
"null",
",",
"onCompleteListener",
")",
";",
"}"
] | Show rating dialog.
The dialog will be showed if the user hasn't declined to rate or hasn't rated current version.
@param context Context
@param onCompleteListener Listener which be called after process of review dialog finished. | [
"Show",
"rating",
"dialog",
".",
"The",
"dialog",
"will",
"be",
"showed",
"if",
"the",
"user",
"hasn",
"t",
"declined",
"to",
"rate",
"or",
"hasn",
"t",
"rated",
"current",
"version",
"."
] | 14fcdf110dfb97120303f39aab1de9393e84b90a | https://github.com/recruit-mp/android-RMP-Appirater/blob/14fcdf110dfb97120303f39aab1de9393e84b90a/library/src/main/java/jp/co/recruit_mp/android/rmp_appirater/RmpAppirater.java#L192-L194 | train |
recruit-mp/android-RMP-Appirater | library/src/main/java/jp/co/recruit_mp/android/rmp_appirater/RmpAppirater.java | RmpAppirater.resetIfAppVersionChanged | public static void resetIfAppVersionChanged(Context context) {
SharedPreferences prefs = getSharedPreferences(context);
int appVersionCode = Integer.MIN_VALUE;
final int previousAppVersionCode = prefs.getInt(PREF_KEY_APP_VERSION_CODE, Integer.MIN_VALUE);
try {
appVersionCode... | java | public static void resetIfAppVersionChanged(Context context) {
SharedPreferences prefs = getSharedPreferences(context);
int appVersionCode = Integer.MIN_VALUE;
final int previousAppVersionCode = prefs.getInt(PREF_KEY_APP_VERSION_CODE, Integer.MIN_VALUE);
try {
appVersionCode... | [
"public",
"static",
"void",
"resetIfAppVersionChanged",
"(",
"Context",
"context",
")",
"{",
"SharedPreferences",
"prefs",
"=",
"getSharedPreferences",
"(",
"context",
")",
";",
"int",
"appVersionCode",
"=",
"Integer",
".",
"MIN_VALUE",
";",
"final",
"int",
"previ... | Reset saved conditions if app version changed.
@param context Context | [
"Reset",
"saved",
"conditions",
"if",
"app",
"version",
"changed",
"."
] | 14fcdf110dfb97120303f39aab1de9393e84b90a | https://github.com/recruit-mp/android-RMP-Appirater/blob/14fcdf110dfb97120303f39aab1de9393e84b90a/library/src/main/java/jp/co/recruit_mp/android/rmp_appirater/RmpAppirater.java#L275-L297 | train |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java | ReflectionUtils.getObjectClassOfPrimitve | public static Class<?> getObjectClassOfPrimitve(Class<?> primitive) {
Class<?> objectClass = PRIMITIVE_TO_WRAPPER.get(primitive);
if (objectClass != null) {
return objectClass;
}
return primitive;
} | java | public static Class<?> getObjectClassOfPrimitve(Class<?> primitive) {
Class<?> objectClass = PRIMITIVE_TO_WRAPPER.get(primitive);
if (objectClass != null) {
return objectClass;
}
return primitive;
} | [
"public",
"static",
"Class",
"<",
"?",
">",
"getObjectClassOfPrimitve",
"(",
"Class",
"<",
"?",
">",
"primitive",
")",
"{",
"Class",
"<",
"?",
">",
"objectClass",
"=",
"PRIMITIVE_TO_WRAPPER",
".",
"get",
"(",
"primitive",
")",
";",
"if",
"(",
"objectClass"... | Returns the wrapper class of the given primitive class or the given class.
@param primitive The primitive class
@return The wrapper class or the given class | [
"Returns",
"the",
"wrapper",
"class",
"of",
"the",
"given",
"primitive",
"class",
"or",
"the",
"given",
"class",
"."
] | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java#L100-L107 | train |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java | ReflectionUtils.getTypeVariablePosition | public static int getTypeVariablePosition(GenericDeclaration genericDeclartion, TypeVariable<?> typeVariable) {
int position = -1;
TypeVariable<?>[] typeVariableDeclarationParameters = genericDeclartion
.getTypeParameters();
// Try to find the position of the type variable in th... | java | public static int getTypeVariablePosition(GenericDeclaration genericDeclartion, TypeVariable<?> typeVariable) {
int position = -1;
TypeVariable<?>[] typeVariableDeclarationParameters = genericDeclartion
.getTypeParameters();
// Try to find the position of the type variable in th... | [
"public",
"static",
"int",
"getTypeVariablePosition",
"(",
"GenericDeclaration",
"genericDeclartion",
",",
"TypeVariable",
"<",
"?",
">",
"typeVariable",
")",
"{",
"int",
"position",
"=",
"-",
"1",
";",
"TypeVariable",
"<",
"?",
">",
"[",
"]",
"typeVariableDecla... | Tries to find the position of the given type variable in the type
parameters of the given class. This method iterates through the type
parameters of the given class and tries to find the given type variable
within the type parameters. When the type variable is found, the position
is returned, otherwise -1.
@param gene... | [
"Tries",
"to",
"find",
"the",
"position",
"of",
"the",
"given",
"type",
"variable",
"in",
"the",
"type",
"parameters",
"of",
"the",
"given",
"class",
".",
"This",
"method",
"iterates",
"through",
"the",
"type",
"parameters",
"of",
"the",
"given",
"class",
... | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java#L494-L508 | train |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java | ReflectionUtils.getMatchingFields | public static Field[] getMatchingFields(Class<?> clazz, final int modifiers) {
final Set<Field> fields = new TreeSet<Field>(
FIELD_NAME_AND_DECLARING_CLASS_COMPARATOR);
traverseHierarchy(clazz, new TraverseTask<Field>() {
@Override
public Field run(Class<?> clazz... | java | public static Field[] getMatchingFields(Class<?> clazz, final int modifiers) {
final Set<Field> fields = new TreeSet<Field>(
FIELD_NAME_AND_DECLARING_CLASS_COMPARATOR);
traverseHierarchy(clazz, new TraverseTask<Field>() {
@Override
public Field run(Class<?> clazz... | [
"public",
"static",
"Field",
"[",
"]",
"getMatchingFields",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"int",
"modifiers",
")",
"{",
"final",
"Set",
"<",
"Field",
">",
"fields",
"=",
"new",
"TreeSet",
"<",
"Field",
">",
"(",
"FIELD_NAME_AND_DECL... | Returns the field objects that are declared in the given class or any of
it's super types that have any of the given modifiers. The type hierarchy
is traversed upwards and all declared fields that match the given
modifiers are added to the result array. The elements in the array are
sorted by their names and declaring ... | [
"Returns",
"the",
"field",
"objects",
"that",
"are",
"declared",
"in",
"the",
"given",
"class",
"or",
"any",
"of",
"it",
"s",
"super",
"types",
"that",
"have",
"any",
"of",
"the",
"given",
"modifiers",
".",
"The",
"type",
"hierarchy",
"is",
"traversed",
... | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java#L564-L582 | train |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java | ReflectionUtils.getField | public static Field getField(Class<?> clazz, String fieldName) {
final String internedName = fieldName.intern();
return traverseHierarchy(clazz, new TraverseTask<Field>() {
@Override
public Field run(Class<?> clazz) {
Field[] fields = clazz.getDeclaredFields();
... | java | public static Field getField(Class<?> clazz, String fieldName) {
final String internedName = fieldName.intern();
return traverseHierarchy(clazz, new TraverseTask<Field>() {
@Override
public Field run(Class<?> clazz) {
Field[] fields = clazz.getDeclaredFields();
... | [
"public",
"static",
"Field",
"getField",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"fieldName",
")",
"{",
"final",
"String",
"internedName",
"=",
"fieldName",
".",
"intern",
"(",
")",
";",
"return",
"traverseHierarchy",
"(",
"clazz",
",",
"new",... | Returns the field object found for the given field name in the given
class. This method traverses through the super classes of the given class
and tries to find the field as declared field within these classes. When
the object class is reached the traversing stops. If the field can not be
found, null is returned.
@par... | [
"Returns",
"the",
"field",
"object",
"found",
"for",
"the",
"given",
"field",
"name",
"in",
"the",
"given",
"class",
".",
"This",
"method",
"traverses",
"through",
"the",
"super",
"classes",
"of",
"the",
"given",
"class",
"and",
"tries",
"to",
"find",
"the... | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java#L631-L646 | train |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java | ReflectionUtils.getMethod | public static Method getMethod(Class<?> clazz, final String methodName, final Class<?>... parameterTypes) {
final String internedName = methodName.intern();
return traverseHierarchy(clazz, new TraverseTask<Method>() {
@Override
public Method run(Class<?> clazz) {
... | java | public static Method getMethod(Class<?> clazz, final String methodName, final Class<?>... parameterTypes) {
final String internedName = methodName.intern();
return traverseHierarchy(clazz, new TraverseTask<Method>() {
@Override
public Method run(Class<?> clazz) {
... | [
"public",
"static",
"Method",
"getMethod",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"String",
"methodName",
",",
"final",
"Class",
"<",
"?",
">",
"...",
"parameterTypes",
")",
"{",
"final",
"String",
"internedName",
"=",
"methodName",
".",
"inte... | Returns the method object found for the given method name in the given
class. This method traverses through the super classes of the given class
and tries to find the method as declared method within these classes.
When the object class is reached the traversing stops. If the method can
not be found, null is returned.
... | [
"Returns",
"the",
"method",
"object",
"found",
"for",
"the",
"given",
"method",
"name",
"in",
"the",
"given",
"class",
".",
"This",
"method",
"traverses",
"through",
"the",
"super",
"classes",
"of",
"the",
"given",
"class",
"and",
"tries",
"to",
"find",
"t... | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java#L845-L867 | train |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java | ReflectionUtils.getMethods | public static List<Method> getMethods(Class<?> clazz, final Class<? extends Annotation> annotation) {
final List<Method> methods = new ArrayList<Method>();
traverseHierarchy(clazz, new TraverseTask<Method>() {
@Override
public Method run(Class<?> clazz) {
Method[... | java | public static List<Method> getMethods(Class<?> clazz, final Class<? extends Annotation> annotation) {
final List<Method> methods = new ArrayList<Method>();
traverseHierarchy(clazz, new TraverseTask<Method>() {
@Override
public Method run(Class<?> clazz) {
Method[... | [
"public",
"static",
"List",
"<",
"Method",
">",
"getMethods",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation",
")",
"{",
"final",
"List",
"<",
"Method",
">",
"methods",
"=",
"new",
"Arra... | Returns the method objects for methods which are annotated with the
given annotation of the given class. This method traverses through
the super classes of the given class and tries to find methods as
declared methods within these classes which are annotated with an
annotation of the given annotation type.
When the obj... | [
"Returns",
"the",
"method",
"objects",
"for",
"methods",
"which",
"are",
"annotated",
"with",
"the",
"given",
"annotation",
"of",
"the",
"given",
"class",
".",
"This",
"method",
"traverses",
"through",
"the",
"super",
"classes",
"of",
"the",
"given",
"class",
... | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/reflection/ReflectionUtils.java#L975-L994 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/other/TemplateUtils.java | TemplateUtils.verifyPath | public static ArrayList<Element> verifyPath( Element root, ArrayList<Element> path )
{
if( root == path.get( 0 ) )
return path;
return null;
} | java | public static ArrayList<Element> verifyPath( Element root, ArrayList<Element> path )
{
if( root == path.get( 0 ) )
return path;
return null;
} | [
"public",
"static",
"ArrayList",
"<",
"Element",
">",
"verifyPath",
"(",
"Element",
"root",
",",
"ArrayList",
"<",
"Element",
">",
"path",
")",
"{",
"if",
"(",
"root",
"==",
"path",
".",
"get",
"(",
"0",
")",
")",
"return",
"path",
";",
"return",
"nu... | asserts that a path's root is the waited element | [
"asserts",
"that",
"a",
"path",
"s",
"root",
"is",
"the",
"waited",
"element"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/other/TemplateUtils.java#L10-L15 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/datatable/TableCollectionManager.java | TableCollectionManager.getRecordForRow | public T getRecordForRow( Row row )
{
Integer recordId = rowToRecordIds.get( row );
if( recordId == null )
return null;
return getRecordForId( recordId );
} | java | public T getRecordForRow( Row row )
{
Integer recordId = rowToRecordIds.get( row );
if( recordId == null )
return null;
return getRecordForId( recordId );
} | [
"public",
"T",
"getRecordForRow",
"(",
"Row",
"row",
")",
"{",
"Integer",
"recordId",
"=",
"rowToRecordIds",
".",
"get",
"(",
"row",
")",
";",
"if",
"(",
"recordId",
"==",
"null",
")",
"return",
"null",
";",
"return",
"getRecordForId",
"(",
"recordId",
"... | Gets the record associated with a specific Row
@param row The row
@return The associated record, or null. | [
"Gets",
"the",
"record",
"associated",
"with",
"a",
"specific",
"Row"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/datatable/TableCollectionManager.java#L297-L304 | train |
ltearno/hexa.tools | hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/properties/Properties.java | Properties.getSetterPropertyType | public static Class<?> getSetterPropertyType( Clazz<?> clazz, String name )
{
return propertyValues.getSetterPropertyType(clazz, name);
} | java | public static Class<?> getSetterPropertyType( Clazz<?> clazz, String name )
{
return propertyValues.getSetterPropertyType(clazz, name);
} | [
"public",
"static",
"Class",
"<",
"?",
">",
"getSetterPropertyType",
"(",
"Clazz",
"<",
"?",
">",
"clazz",
",",
"String",
"name",
")",
"{",
"return",
"propertyValues",
".",
"getSetterPropertyType",
"(",
"clazz",
",",
"name",
")",
";",
"}"
] | Returns the class of the setter property. It can be the class of the first
argument in the setter or the class of the field if no setter is found.
If a virtual property is used, it returns null or the class of the current
property's value | [
"Returns",
"the",
"class",
"of",
"the",
"setter",
"property",
".",
"It",
"can",
"be",
"the",
"class",
"of",
"the",
"first",
"argument",
"in",
"the",
"setter",
"or",
"the",
"class",
"of",
"the",
"field",
"if",
"no",
"setter",
"is",
"found",
".",
"If",
... | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.binding/src/main/java/fr/lteconsulting/hexa/databinding/properties/Properties.java#L141-L144 | train |
magott/spring-social-yammer | spring-social-yammer/src/main/java/org/springframework/social/yammer/api/impl/YammerErrorHandler.java | YammerErrorHandler.extractErrorDetailsFromResponse | private Map<String, Object> extractErrorDetailsFromResponse(ClientHttpResponse response) throws IOException {
ObjectMapper mapper = new ObjectMapper(new JsonFactory());
try {
return mapper.<Map<String, Object>> readValue(response.getBody(), new TypeReference<Map<String, Object>>() {
});
} catch (JsonParseEx... | java | private Map<String, Object> extractErrorDetailsFromResponse(ClientHttpResponse response) throws IOException {
ObjectMapper mapper = new ObjectMapper(new JsonFactory());
try {
return mapper.<Map<String, Object>> readValue(response.getBody(), new TypeReference<Map<String, Object>>() {
});
} catch (JsonParseEx... | [
"private",
"Map",
"<",
"String",
",",
"Object",
">",
"extractErrorDetailsFromResponse",
"(",
"ClientHttpResponse",
"response",
")",
"throws",
"IOException",
"{",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
"new",
"JsonFactory",
"(",
")",
")",
";",
... | Error details are returned in the message body as JSON. Extract these in
a map
@param response
from yammer
@return json body as a map
@throws IOException
if ItemStream is closed | [
"Error",
"details",
"are",
"returned",
"in",
"the",
"message",
"body",
"as",
"JSON",
".",
"Extract",
"these",
"in",
"a",
"map"
] | a39dab7c33e40bfaa26c15b6336823edf57452c3 | https://github.com/magott/spring-social-yammer/blob/a39dab7c33e40bfaa26c15b6336823edf57452c3/spring-social-yammer/src/main/java/org/springframework/social/yammer/api/impl/YammerErrorHandler.java#L93-L101 | train |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/security/BCrypt.java | BCrypt.key | private void key(final byte key[]) {
int i;
final int koffp[] = {0};
final int lr[] = {0, 0};
final int plen = P.length, slen = S.length;
for (i = 0; i < plen; i++) {
P[i] = P[i] ^ streamtoword(key, koffp);
}
for (i = 0; i < plen; i += 2) {
... | java | private void key(final byte key[]) {
int i;
final int koffp[] = {0};
final int lr[] = {0, 0};
final int plen = P.length, slen = S.length;
for (i = 0; i < plen; i++) {
P[i] = P[i] ^ streamtoword(key, koffp);
}
for (i = 0; i < plen; i += 2) {
... | [
"private",
"void",
"key",
"(",
"final",
"byte",
"key",
"[",
"]",
")",
"{",
"int",
"i",
";",
"final",
"int",
"koffp",
"[",
"]",
"=",
"{",
"0",
"}",
";",
"final",
"int",
"lr",
"[",
"]",
"=",
"{",
"0",
",",
"0",
"}",
";",
"final",
"int",
"plen... | Key the Blowfish cipher
@param key an array containing the key | [
"Key",
"the",
"Blowfish",
"cipher"
] | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/security/BCrypt.java#L491-L512 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/sql/SQLite.java | SQLite.createLocalId | public final static int createLocalId()
{
Storage storage = Storage.getLocalStorageIfSupported();
if( storage == null )
return 0;
int increment = 0;
String incrementString = storage.getItem( LOCAL_CURRENT_ID_INCREMENT );
try
{
increment = Integer.parseInt( incrementString );
}
catch( Exception e... | java | public final static int createLocalId()
{
Storage storage = Storage.getLocalStorageIfSupported();
if( storage == null )
return 0;
int increment = 0;
String incrementString = storage.getItem( LOCAL_CURRENT_ID_INCREMENT );
try
{
increment = Integer.parseInt( incrementString );
}
catch( Exception e... | [
"public",
"final",
"static",
"int",
"createLocalId",
"(",
")",
"{",
"Storage",
"storage",
"=",
"Storage",
".",
"getLocalStorageIfSupported",
"(",
")",
";",
"if",
"(",
"storage",
"==",
"null",
")",
"return",
"0",
";",
"int",
"increment",
"=",
"0",
";",
"S... | Create a negative ID. | [
"Create",
"a",
"negative",
"ID",
"."
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/sql/SQLite.java#L107-L128 | train |
ltearno/hexa.tools | hexa.binding.gwt/src/main/java/fr/lteconsulting/hexa/classinfo/gwt/ClassInfoGwt.java | ClassInfoGwt.RegisterClazz | public <T> void RegisterClazz( Clazz<T> clazz )
{
_ensureMap();
if( clazzz.containsKey( clazz.getReflectedClass() ) )
return;
clazzz.put( clazz.getReflectedClass(), clazz );
} | java | public <T> void RegisterClazz( Clazz<T> clazz )
{
_ensureMap();
if( clazzz.containsKey( clazz.getReflectedClass() ) )
return;
clazzz.put( clazz.getReflectedClass(), clazz );
} | [
"public",
"<",
"T",
">",
"void",
"RegisterClazz",
"(",
"Clazz",
"<",
"T",
">",
"clazz",
")",
"{",
"_ensureMap",
"(",
")",
";",
"if",
"(",
"clazzz",
".",
"containsKey",
"(",
"clazz",
".",
"getReflectedClass",
"(",
")",
")",
")",
"return",
";",
"clazzz... | Register a runtime type information provider | [
"Register",
"a",
"runtime",
"type",
"information",
"provider"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.binding.gwt/src/main/java/fr/lteconsulting/hexa/classinfo/gwt/ClassInfoGwt.java#L39-L47 | train |
ltearno/hexa.tools | hexa.rpc/src/main/java/fr/lteconsulting/hexa/client/comm/RPCBatchRequestSender.java | RPCBatchRequestSender.init | public void init( String baseUrl, XRPCBatchRequestSender callback )
{
this.url = baseUrl + "&locale=" + LocaleInfo.getCurrentLocale().getLocaleName();
this.callback = callback;
} | java | public void init( String baseUrl, XRPCBatchRequestSender callback )
{
this.url = baseUrl + "&locale=" + LocaleInfo.getCurrentLocale().getLocaleName();
this.callback = callback;
} | [
"public",
"void",
"init",
"(",
"String",
"baseUrl",
",",
"XRPCBatchRequestSender",
"callback",
")",
"{",
"this",
".",
"url",
"=",
"baseUrl",
"+",
"\"&locale=\"",
"+",
"LocaleInfo",
".",
"getCurrentLocale",
"(",
")",
".",
"getLocaleName",
"(",
")",
";",
"this... | initialize with url, and other needed information | [
"initialize",
"with",
"url",
"and",
"other",
"needed",
"information"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.rpc/src/main/java/fr/lteconsulting/hexa/client/comm/RPCBatchRequestSender.java#L56-L60 | train |
ltearno/hexa.tools | hexa.rpc/src/main/java/fr/lteconsulting/hexa/client/comm/RPCBatchRequestSender.java | RPCBatchRequestSender.checkCallService | private void checkCallService( RequestCallInfo info )
{
String service = info.request.service;
String interfaceChecksum = info.request.interfaceChecksum;
String key = getServiceKey( info );
if( usedServices.containsKey( key ) )
return;
ServiceInfo serviceInfo = new ServiceInfo( service, interfaceChecks... | java | private void checkCallService( RequestCallInfo info )
{
String service = info.request.service;
String interfaceChecksum = info.request.interfaceChecksum;
String key = getServiceKey( info );
if( usedServices.containsKey( key ) )
return;
ServiceInfo serviceInfo = new ServiceInfo( service, interfaceChecks... | [
"private",
"void",
"checkCallService",
"(",
"RequestCallInfo",
"info",
")",
"{",
"String",
"service",
"=",
"info",
".",
"request",
".",
"service",
";",
"String",
"interfaceChecksum",
"=",
"info",
".",
"request",
".",
"interfaceChecksum",
";",
"String",
"key",
... | necessary to be sure that call's service is referenced | [
"necessary",
"to",
"be",
"sure",
"that",
"call",
"s",
"service",
"is",
"referenced"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.rpc/src/main/java/fr/lteconsulting/hexa/client/comm/RPCBatchRequestSender.java#L112-L125 | train |
ltearno/hexa.tools | hexa.rpc/src/main/java/fr/lteconsulting/hexa/client/comm/RPCBatchRequestSender.java | RPCBatchRequestSender.send | public boolean send()
{
assert sentRequests == null;
sentRequests = new ArrayList<RequestCallInfo>();
// add prepended requests,
addPrependedRequests( sentRequests );
// add requests to send
while( !requestsToSend.isEmpty() )
sentRequests.add( requestsToSend.remove( 0 ) );
// add appended requests
... | java | public boolean send()
{
assert sentRequests == null;
sentRequests = new ArrayList<RequestCallInfo>();
// add prepended requests,
addPrependedRequests( sentRequests );
// add requests to send
while( !requestsToSend.isEmpty() )
sentRequests.add( requestsToSend.remove( 0 ) );
// add appended requests
... | [
"public",
"boolean",
"send",
"(",
")",
"{",
"assert",
"sentRequests",
"==",
"null",
";",
"sentRequests",
"=",
"new",
"ArrayList",
"<",
"RequestCallInfo",
">",
"(",
")",
";",
"// add prepended requests,",
"addPrependedRequests",
"(",
"sentRequests",
")",
";",
"//... | when response arrives, it will be given back to each request callback | [
"when",
"response",
"arrives",
"it",
"will",
"be",
"given",
"back",
"to",
"each",
"request",
"callback"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.rpc/src/main/java/fr/lteconsulting/hexa/client/comm/RPCBatchRequestSender.java#L134-L169 | train |
ltearno/hexa.tools | hexa.rpc/src/main/java/fr/lteconsulting/hexa/client/comm/RPCBatchRequestSender.java | RPCBatchRequestSender.buildMultipart | private RequestBuilder buildMultipart( String name, String value )
{
String boundary = "AJAX------" + Math.random() + "" + new Date().getTime();
RequestBuilder builderPost = new RequestBuilder( RequestBuilder.POST, url );
builderPost.setHeader( "Content-Type", "multipart/form-data; charset=utf-8; boundary=" + b... | java | private RequestBuilder buildMultipart( String name, String value )
{
String boundary = "AJAX------" + Math.random() + "" + new Date().getTime();
RequestBuilder builderPost = new RequestBuilder( RequestBuilder.POST, url );
builderPost.setHeader( "Content-Type", "multipart/form-data; charset=utf-8; boundary=" + b... | [
"private",
"RequestBuilder",
"buildMultipart",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"String",
"boundary",
"=",
"\"AJAX------\"",
"+",
"Math",
".",
"random",
"(",
")",
"+",
"\"\"",
"+",
"new",
"Date",
"(",
")",
".",
"getTime",
"(",
")"... | prepare a multipart form http request | [
"prepare",
"a",
"multipart",
"form",
"http",
"request"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.rpc/src/main/java/fr/lteconsulting/hexa/client/comm/RPCBatchRequestSender.java#L240-L260 | train |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/formcreator/FormCreator.java | FormCreator.field | public FormCreator field( Widget widget )
{
return field( widget, totalWidth - currentlyUsedWidth - (fFirstItem ? 0 : spacing) );
} | java | public FormCreator field( Widget widget )
{
return field( widget, totalWidth - currentlyUsedWidth - (fFirstItem ? 0 : spacing) );
} | [
"public",
"FormCreator",
"field",
"(",
"Widget",
"widget",
")",
"{",
"return",
"field",
"(",
"widget",
",",
"totalWidth",
"-",
"currentlyUsedWidth",
"-",
"(",
"fFirstItem",
"?",
"0",
":",
"spacing",
")",
")",
";",
"}"
] | automatically fills the line to the end | [
"automatically",
"fills",
"the",
"line",
"to",
"the",
"end"
] | 604c804901b1bb13fe10b3823cc4a639f8993363 | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/ui/formcreator/FormCreator.java#L72-L75 | train |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/ConnectionContext.java | ConnectionContext.copy | public void copy(ConnectionContext source) {
this.connection = source.connection;
this.session = source.session;
this.destination = source.destination;
} | java | public void copy(ConnectionContext source) {
this.connection = source.connection;
this.session = source.session;
this.destination = source.destination;
} | [
"public",
"void",
"copy",
"(",
"ConnectionContext",
"source",
")",
"{",
"this",
".",
"connection",
"=",
"source",
".",
"connection",
";",
"this",
".",
"session",
"=",
"source",
".",
"session",
";",
"this",
".",
"destination",
"=",
"source",
".",
"destinati... | Sets this context object with the same data found in the source context.
@param source the source context whose data is to be copied | [
"Sets",
"this",
"context",
"object",
"with",
"the",
"same",
"data",
"found",
"in",
"the",
"source",
"context",
"."
] | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/ConnectionContext.java#L65-L69 | train |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/annotation/AnnotationUtils.java | AnnotationUtils.getAllAnnotations | public static Set<Annotation> getAllAnnotations(Method m) {
Set<Annotation> annotationSet = new LinkedHashSet<Annotation>();
Annotation[] annotations = m.getAnnotations();
List<Class<?>> annotationTypes = new ArrayList<Class<?>>();
// Iterate through all annotations of the current class... | java | public static Set<Annotation> getAllAnnotations(Method m) {
Set<Annotation> annotationSet = new LinkedHashSet<Annotation>();
Annotation[] annotations = m.getAnnotations();
List<Class<?>> annotationTypes = new ArrayList<Class<?>>();
// Iterate through all annotations of the current class... | [
"public",
"static",
"Set",
"<",
"Annotation",
">",
"getAllAnnotations",
"(",
"Method",
"m",
")",
"{",
"Set",
"<",
"Annotation",
">",
"annotationSet",
"=",
"new",
"LinkedHashSet",
"<",
"Annotation",
">",
"(",
")",
";",
"Annotation",
"[",
"]",
"annotations",
... | Returns all annotations of a class, also the annotations of the super
classes, implemented interfaces and the annotations that are present in
stereotype annotations. The stereotype annotation will not be included in
the annotation set.
@param m the class from which to get the annotations
@return all annotations that a... | [
"Returns",
"all",
"annotations",
"of",
"a",
"class",
"also",
"the",
"annotations",
"of",
"the",
"super",
"classes",
"implemented",
"interfaces",
"and",
"the",
"annotations",
"that",
"are",
"present",
"in",
"stereotype",
"annotations",
".",
"The",
"stereotype",
"... | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/annotation/AnnotationUtils.java#L98-L130 | train |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/annotation/AnnotationUtils.java | AnnotationUtils.findAnnotation | public static <T extends Annotation> T findAnnotation(Method m, Class<T> annotationClazz) {
T annotation = m.getAnnotation(annotationClazz);
if (annotation != null) {
return annotation;
}
if (stereotypeAnnotationClass != null) {
List<Class<?>> annotations = new A... | java | public static <T extends Annotation> T findAnnotation(Method m, Class<T> annotationClazz) {
T annotation = m.getAnnotation(annotationClazz);
if (annotation != null) {
return annotation;
}
if (stereotypeAnnotationClass != null) {
List<Class<?>> annotations = new A... | [
"public",
"static",
"<",
"T",
"extends",
"Annotation",
">",
"T",
"findAnnotation",
"(",
"Method",
"m",
",",
"Class",
"<",
"T",
">",
"annotationClazz",
")",
"{",
"T",
"annotation",
"=",
"m",
".",
"getAnnotation",
"(",
"annotationClazz",
")",
";",
"if",
"(... | Returns the annotation object for the specified annotation class of the
method if it can be found, otherwise null. The annotation is searched in
the method which and if a stereotype annotation is found, the annotations
present on an annotation are also examined. If the annotation can not be
found, null is returned.
@p... | [
"Returns",
"the",
"annotation",
"object",
"for",
"the",
"specified",
"annotation",
"class",
"of",
"the",
"method",
"if",
"it",
"can",
"be",
"found",
"otherwise",
"null",
".",
"The",
"annotation",
"is",
"searched",
"in",
"the",
"method",
"which",
"and",
"if",... | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/annotation/AnnotationUtils.java#L165-L180 | train |
Blazebit/blaze-utils | blaze-common-utils/src/main/java/com/blazebit/annotation/AnnotationUtils.java | AnnotationUtils.findAnnotation | public static <T extends Annotation> T findAnnotation(Class<?> clazz, Class<T> annotationClazz) {
T annotation = clazz.getAnnotation(annotationClazz);
if (annotation != null) {
return annotation;
}
Set<Class<?>> superTypes = ReflectionUtils.getSuperTypes(clazz);
for ... | java | public static <T extends Annotation> T findAnnotation(Class<?> clazz, Class<T> annotationClazz) {
T annotation = clazz.getAnnotation(annotationClazz);
if (annotation != null) {
return annotation;
}
Set<Class<?>> superTypes = ReflectionUtils.getSuperTypes(clazz);
for ... | [
"public",
"static",
"<",
"T",
"extends",
"Annotation",
">",
"T",
"findAnnotation",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Class",
"<",
"T",
">",
"annotationClazz",
")",
"{",
"T",
"annotation",
"=",
"clazz",
".",
"getAnnotation",
"(",
"annotationClazz"... | Returns the annotation object for the specified annotation class of the
given class object. All super types of the given class are examined to
find the annotation. If a stereotype annotation is found, the annotations
present on an annotation are also examined.
@param <T> The annotation type
@param clazz ... | [
"Returns",
"the",
"annotation",
"object",
"for",
"the",
"specified",
"annotation",
"class",
"of",
"the",
"given",
"class",
"object",
".",
"All",
"super",
"types",
"of",
"the",
"given",
"class",
"are",
"examined",
"to",
"find",
"the",
"annotation",
".",
"If",... | 3e35a694a8f71d515aad066196acd523994d6aaa | https://github.com/Blazebit/blaze-utils/blob/3e35a694a8f71d515aad066196acd523994d6aaa/blaze-common-utils/src/main/java/com/blazebit/annotation/AnnotationUtils.java#L193-L219 | train |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/MessageProcessor.java | MessageProcessor.listen | public <T extends BasicMessage> void listen(ConsumerConnectionContext context,
AbstractBasicMessageListener<T> listener) throws JMSException {
if (context == null) {
throw new NullPointerException("context must not be null");
}
if (listener == null) {
throw ne... | java | public <T extends BasicMessage> void listen(ConsumerConnectionContext context,
AbstractBasicMessageListener<T> listener) throws JMSException {
if (context == null) {
throw new NullPointerException("context must not be null");
}
if (listener == null) {
throw ne... | [
"public",
"<",
"T",
"extends",
"BasicMessage",
">",
"void",
"listen",
"(",
"ConsumerConnectionContext",
"context",
",",
"AbstractBasicMessageListener",
"<",
"T",
">",
"listener",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
... | Listens for messages.
@param context information that determines where to listen
@param listener the listener that processes the incoming messages
@throws JMSException any error
@see org.hawkular.bus.common.ConnectionContextFactory#createConsumerConnectionContext(Endpoint) | [
"Listens",
"for",
"messages",
"."
] | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/MessageProcessor.java#L62-L78 | train |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/MessageProcessor.java | MessageProcessor.send | public MessageId send(ProducerConnectionContext context, BasicMessage basicMessage, Map<String, String> headers)
throws JMSException {
if (context == null) {
throw new IllegalArgumentException("context must not be null");
}
if (basicMessage == null) {
throw ne... | java | public MessageId send(ProducerConnectionContext context, BasicMessage basicMessage, Map<String, String> headers)
throws JMSException {
if (context == null) {
throw new IllegalArgumentException("context must not be null");
}
if (basicMessage == null) {
throw ne... | [
"public",
"MessageId",
"send",
"(",
"ProducerConnectionContext",
"context",
",",
"BasicMessage",
"basicMessage",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"throw"... | Send the given message to its destinations across the message bus. Once sent, the message will get assigned a
generated message ID. That message ID will also be returned by this method.
Since this is fire-and-forget - no response is expected of the remote endpoint.
@param context information that determines where the... | [
"Send",
"the",
"given",
"message",
"to",
"its",
"destinations",
"across",
"the",
"message",
"bus",
".",
"Once",
"sent",
"the",
"message",
"will",
"get",
"assigned",
"a",
"generated",
"message",
"ID",
".",
"That",
"message",
"ID",
"will",
"also",
"be",
"ret... | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/MessageProcessor.java#L101-L137 | train |
hawkular/hawkular-commons | hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/MessageProcessor.java | MessageProcessor.sendAndListen | public <T extends BasicMessage> RPCConnectionContext sendAndListen(ProducerConnectionContext context,
BasicMessage basicMessage, BasicMessageListener<T> responseListener, Map<String, String> headers)
throws JMSException {
if (context == null) {
throw new IllegalArgum... | java | public <T extends BasicMessage> RPCConnectionContext sendAndListen(ProducerConnectionContext context,
BasicMessage basicMessage, BasicMessageListener<T> responseListener, Map<String, String> headers)
throws JMSException {
if (context == null) {
throw new IllegalArgum... | [
"public",
"<",
"T",
"extends",
"BasicMessage",
">",
"RPCConnectionContext",
"sendAndListen",
"(",
"ProducerConnectionContext",
"context",
",",
"BasicMessage",
"basicMessage",
",",
"BasicMessageListener",
"<",
"T",
">",
"responseListener",
",",
"Map",
"<",
"String",
",... | Send the given message to its destinations across the message bus and any response sent back will be passed to
the given listener. Use this for request-response messages where you expect to get a non-void response back.
The response listener should close its associated consumer since typically there is only a single r... | [
"Send",
"the",
"given",
"message",
"to",
"its",
"destinations",
"across",
"the",
"message",
"bus",
"and",
"any",
"response",
"sent",
"back",
"will",
"be",
"passed",
"to",
"the",
"given",
"listener",
".",
"Use",
"this",
"for",
"request",
"-",
"response",
"m... | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-bus/hawkular-bus-common/src/main/java/org/hawkular/bus/common/MessageProcessor.java#L278-L339 | train |
hawkular/hawkular-commons | hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/WebSocketHelper.java | WebSocketHelper.sendBasicMessageAsync | public void sendBasicMessageAsync(Session session, BasicMessage msg) {
String text = ApiDeserializer.toHawkularFormat(msg);
sendTextAsync(session, text);
} | java | public void sendBasicMessageAsync(Session session, BasicMessage msg) {
String text = ApiDeserializer.toHawkularFormat(msg);
sendTextAsync(session, text);
} | [
"public",
"void",
"sendBasicMessageAsync",
"(",
"Session",
"session",
",",
"BasicMessage",
"msg",
")",
"{",
"String",
"text",
"=",
"ApiDeserializer",
".",
"toHawkularFormat",
"(",
"msg",
")",
";",
"sendTextAsync",
"(",
"session",
",",
"text",
")",
";",
"}"
] | Converts the given message to JSON and sends that JSON text to clients asynchronously.
@param session the client session where the JSON message will be sent
@param msg the message to be converted to JSON and sent | [
"Converts",
"the",
"given",
"message",
"to",
"JSON",
"and",
"sends",
"that",
"JSON",
"text",
"to",
"clients",
"asynchronously",
"."
] | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/WebSocketHelper.java#L80-L83 | train |
hawkular/hawkular-commons | hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/WebSocketHelper.java | WebSocketHelper.sendBinaryAsync | public void sendBinaryAsync(Session session, InputStream inputStream, ExecutorService threadPool) {
if (session == null) {
return;
}
if (inputStream == null) {
throw new IllegalArgumentException("inputStream must not be null");
}
log.debugf("Attempting t... | java | public void sendBinaryAsync(Session session, InputStream inputStream, ExecutorService threadPool) {
if (session == null) {
return;
}
if (inputStream == null) {
throw new IllegalArgumentException("inputStream must not be null");
}
log.debugf("Attempting t... | [
"public",
"void",
"sendBinaryAsync",
"(",
"Session",
"session",
",",
"InputStream",
"inputStream",
",",
"ExecutorService",
"threadPool",
")",
"{",
"if",
"(",
"session",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"inputStream",
"==",
"null",
")",
... | Sends binary data to a client asynchronously.
@param session the client session where the message will be sent
@param inputStream the binary data to send
@param threadPool where the job will be submitted so it can execute asynchronously | [
"Sends",
"binary",
"data",
"to",
"a",
"client",
"asynchronously",
"."
] | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/WebSocketHelper.java#L113-L134 | train |
hawkular/hawkular-commons | hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/WebSocketHelper.java | WebSocketHelper.sendBinarySync | public void sendBinarySync(Session session, InputStream inputStream) throws IOException {
if (session == null) {
return;
}
if (inputStream == null) {
throw new IllegalArgumentException("inputStream must not be null");
}
log.debugf("Attempting to send bin... | java | public void sendBinarySync(Session session, InputStream inputStream) throws IOException {
if (session == null) {
return;
}
if (inputStream == null) {
throw new IllegalArgumentException("inputStream must not be null");
}
log.debugf("Attempting to send bin... | [
"public",
"void",
"sendBinarySync",
"(",
"Session",
"session",
",",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"if",
"(",
"session",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"inputStream",
"==",
"null",
")",
"{",
"throw"... | Sends binary data to a client synchronously.
@param session the client where the message will be sent
@param inputStream the binary data to send
@throws IOException if a problem occurred during delivery of the data to a session. | [
"Sends",
"binary",
"data",
"to",
"a",
"client",
"synchronously",
"."
] | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/WebSocketHelper.java#L143-L160 | train |
hawkular/hawkular-commons | hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/UIClientWebSocket.java | UIClientWebSocket.uiClientSessionOpen | @OnOpen
public void uiClientSessionOpen(Session session) {
log.infoWsSessionOpened(session.getId(), endpoint);
wsEndpoints.getUiClientSessions().addSession(session.getId(), session);
WelcomeResponse welcomeResponse = new WelcomeResponse();
// FIXME we should not send the true session... | java | @OnOpen
public void uiClientSessionOpen(Session session) {
log.infoWsSessionOpened(session.getId(), endpoint);
wsEndpoints.getUiClientSessions().addSession(session.getId(), session);
WelcomeResponse welcomeResponse = new WelcomeResponse();
// FIXME we should not send the true session... | [
"@",
"OnOpen",
"public",
"void",
"uiClientSessionOpen",
"(",
"Session",
"session",
")",
"{",
"log",
".",
"infoWsSessionOpened",
"(",
"session",
".",
"getId",
"(",
")",
",",
"endpoint",
")",
";",
"wsEndpoints",
".",
"getUiClientSessions",
"(",
")",
".",
"addS... | When a UI client connects, this method is called. This will immediately send a welcome
message to the UI client.
@param session the new UI client's session | [
"When",
"a",
"UI",
"client",
"connects",
"this",
"method",
"is",
"called",
".",
"This",
"will",
"immediately",
"send",
"a",
"welcome",
"message",
"to",
"the",
"UI",
"client",
"."
] | e4a832862b3446d7f4d629bb05790f2df578e035 | https://github.com/hawkular/hawkular-commons/blob/e4a832862b3446d7f4d629bb05790f2df578e035/hawkular-command-gateway/hawkular-command-gateway-war/src/main/java/org/hawkular/cmdgw/command/ws/server/UIClientWebSocket.java#L53-L66 | train |
bsblabs/embed-for-vaadin | com.bsb.common.vaadin.embed/src/main/java/com/bsb/common/vaadin/embed/AbstractEmbedVaadinTomcat.java | AbstractEmbedVaadinTomcat.doStart | private void doStart() throws LifecycleException {
tomcat.getServer().addLifecycleListener(new TomcatLifecycleListener());
logger.info("Deploying application to [" + getConfig().getDeployUrl() + "]");
tomcat.start();
// Let's set the port that was used to actually start the application ... | java | private void doStart() throws LifecycleException {
tomcat.getServer().addLifecycleListener(new TomcatLifecycleListener());
logger.info("Deploying application to [" + getConfig().getDeployUrl() + "]");
tomcat.start();
// Let's set the port that was used to actually start the application ... | [
"private",
"void",
"doStart",
"(",
")",
"throws",
"LifecycleException",
"{",
"tomcat",
".",
"getServer",
"(",
")",
".",
"addLifecycleListener",
"(",
"new",
"TomcatLifecycleListener",
"(",
")",
")",
";",
"logger",
".",
"info",
"(",
"\"Deploying application to [\"",... | Fires the embedded tomcat that is assumed to be fully configured.
@throws LifecycleException if tomcat failed to start | [
"Fires",
"the",
"embedded",
"tomcat",
"that",
"is",
"assumed",
"to",
"be",
"fully",
"configured",
"."
] | f902e70def56ab54d287d2600f9c6eef9e66c225 | https://github.com/bsblabs/embed-for-vaadin/blob/f902e70def56ab54d287d2600f9c6eef9e66c225/com.bsb.common.vaadin.embed/src/main/java/com/bsb/common/vaadin/embed/AbstractEmbedVaadinTomcat.java#L173-L190 | train |
bsblabs/embed-for-vaadin | com.bsb.common.vaadin.embed/src/main/java/com/bsb/common/vaadin/embed/AbstractEmbedVaadinTomcat.java | AbstractEmbedVaadinTomcat.doStop | private void doStop() throws LifecycleException {
logger.info("Stopping tomcat.");
long startTime = System.currentTimeMillis();
tomcat.stop();
long duration = System.currentTimeMillis() - startTime;
logger.info("Tomcat shutdown finished in " + duration + " ms.");
} | java | private void doStop() throws LifecycleException {
logger.info("Stopping tomcat.");
long startTime = System.currentTimeMillis();
tomcat.stop();
long duration = System.currentTimeMillis() - startTime;
logger.info("Tomcat shutdown finished in " + duration + " ms.");
} | [
"private",
"void",
"doStop",
"(",
")",
"throws",
"LifecycleException",
"{",
"logger",
".",
"info",
"(",
"\"Stopping tomcat.\"",
")",
";",
"long",
"startTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"tomcat",
".",
"stop",
"(",
")",
";",
"lo... | Stops the embedded tomcat.
@throws LifecycleException if tomcat failed to stop | [
"Stops",
"the",
"embedded",
"tomcat",
"."
] | f902e70def56ab54d287d2600f9c6eef9e66c225 | https://github.com/bsblabs/embed-for-vaadin/blob/f902e70def56ab54d287d2600f9c6eef9e66c225/com.bsb.common.vaadin.embed/src/main/java/com/bsb/common/vaadin/embed/AbstractEmbedVaadinTomcat.java#L197-L203 | train |
CubeEngine/LogScribe | core/src/main/java/org/cubeengine/logscribe/Log.java | Log.addDelegate | public LogTarget addDelegate(Log log)
{
LogProxyTarget logProxyTarget = new LogProxyTarget(log);
this.addTarget(logProxyTarget);
return logProxyTarget;
} | java | public LogTarget addDelegate(Log log)
{
LogProxyTarget logProxyTarget = new LogProxyTarget(log);
this.addTarget(logProxyTarget);
return logProxyTarget;
} | [
"public",
"LogTarget",
"addDelegate",
"(",
"Log",
"log",
")",
"{",
"LogProxyTarget",
"logProxyTarget",
"=",
"new",
"LogProxyTarget",
"(",
"log",
")",
";",
"this",
".",
"addTarget",
"(",
"logProxyTarget",
")",
";",
"return",
"logProxyTarget",
";",
"}"
] | Adds a ProxyTarget for an other Logger
@param log the logger to delegate to
@return the created LogTarget | [
"Adds",
"a",
"ProxyTarget",
"for",
"an",
"other",
"Logger"
] | c3a449b82677d1d70c3efe77b68fdaaaf7525295 | https://github.com/CubeEngine/LogScribe/blob/c3a449b82677d1d70c3efe77b68fdaaaf7525295/core/src/main/java/org/cubeengine/logscribe/Log.java#L103-L108 | train |
jbundle/webapp | base/src/main/java/org/jbundle/util/webapp/base/ResourceHttpServiceTracker.java | ResourceHttpServiceTracker.addingService | public Object addingService(ServiceReference reference)
{
HttpService httpService = (HttpService) context.getService(reference);
String alias = this.getAlias();
String name = this.getProperty(RESOURCE_NAME);
if (name == null)
name = alias;
try {
httpS... | java | public Object addingService(ServiceReference reference)
{
HttpService httpService = (HttpService) context.getService(reference);
String alias = this.getAlias();
String name = this.getProperty(RESOURCE_NAME);
if (name == null)
name = alias;
try {
httpS... | [
"public",
"Object",
"addingService",
"(",
"ServiceReference",
"reference",
")",
"{",
"HttpService",
"httpService",
"=",
"(",
"HttpService",
")",
"context",
".",
"getService",
"(",
"reference",
")",
";",
"String",
"alias",
"=",
"this",
".",
"getAlias",
"(",
")"... | Http Service is up, add my resource. | [
"Http",
"Service",
"is",
"up",
"add",
"my",
"resource",
"."
] | af2cf32bd92254073052f1f9b4bcd47c2f76ba7d | https://github.com/jbundle/webapp/blob/af2cf32bd92254073052f1f9b4bcd47c2f76ba7d/base/src/main/java/org/jbundle/util/webapp/base/ResourceHttpServiceTracker.java#L31-L46 | train |
fuinorg/utils4j | src/main/java/org/fuin/utils4j/filter/RegExprFilter.java | RegExprFilter.setTypeName | public final void setTypeName(final String typeName) {
if (typeName == null) {
type = LOOKING_AT;
} else if (typeName.equalsIgnoreCase(TYPES[0])) {
type = MATCHES;
} else if (typeName.equalsIgnoreCase(TYPES[1])) {
type = LOOKING_AT;
} else if (t... | java | public final void setTypeName(final String typeName) {
if (typeName == null) {
type = LOOKING_AT;
} else if (typeName.equalsIgnoreCase(TYPES[0])) {
type = MATCHES;
} else if (typeName.equalsIgnoreCase(TYPES[1])) {
type = LOOKING_AT;
} else if (t... | [
"public",
"final",
"void",
"setTypeName",
"(",
"final",
"String",
"typeName",
")",
"{",
"if",
"(",
"typeName",
"==",
"null",
")",
"{",
"type",
"=",
"LOOKING_AT",
";",
"}",
"else",
"if",
"(",
"typeName",
".",
"equalsIgnoreCase",
"(",
"TYPES",
"[",
"0",
... | Sets the type name of the matching.
@param typeName
Type name ("matches", "lookingAt" or "find") or NULL (="lookingAt") | [
"Sets",
"the",
"type",
"name",
"of",
"the",
"matching",
"."
] | 71cf88e0a8d8ed67bbac513bf3cab165cd7e3280 | https://github.com/fuinorg/utils4j/blob/71cf88e0a8d8ed67bbac513bf3cab165cd7e3280/src/main/java/org/fuin/utils4j/filter/RegExprFilter.java#L131-L141 | train |
dbracewell/mango | src/main/java/com/davidbracewell/reflection/Reflect.java | Reflect.onObject | public static Reflect onObject(Object object) {
if (object == null) {
return new Reflect(null, null);
}
return new Reflect(object, object.getClass());
} | java | public static Reflect onObject(Object object) {
if (object == null) {
return new Reflect(null, null);
}
return new Reflect(object, object.getClass());
} | [
"public",
"static",
"Reflect",
"onObject",
"(",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"return",
"new",
"Reflect",
"(",
"null",
",",
"null",
")",
";",
"}",
"return",
"new",
"Reflect",
"(",
"object",
",",
"object",
... | Creates an instance of Reflect associated with an object
@param object The object for reflection
@return The Reflect object | [
"Creates",
"an",
"instance",
"of",
"Reflect",
"associated",
"with",
"an",
"object"
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/reflection/Reflect.java#L66-L71 | train |
dbracewell/mango | src/main/java/com/davidbracewell/reflection/Reflect.java | Reflect.onClass | public static Reflect onClass(String clazz) throws Exception {
return new Reflect(null, ReflectionUtils.getClassForName(clazz));
} | java | public static Reflect onClass(String clazz) throws Exception {
return new Reflect(null, ReflectionUtils.getClassForName(clazz));
} | [
"public",
"static",
"Reflect",
"onClass",
"(",
"String",
"clazz",
")",
"throws",
"Exception",
"{",
"return",
"new",
"Reflect",
"(",
"null",
",",
"ReflectionUtils",
".",
"getClassForName",
"(",
"clazz",
")",
")",
";",
"}"
] | Creates an instance of Reflect associated with a class
@param clazz The class for reflection as string
@return The Reflect object
@throws Exception the exception | [
"Creates",
"an",
"instance",
"of",
"Reflect",
"associated",
"with",
"a",
"class"
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/reflection/Reflect.java#L90-L92 | train |
dbracewell/mango | src/main/java/com/davidbracewell/reflection/Reflect.java | Reflect.containsField | public boolean containsField(String name) {
if (StringUtils.isNullOrBlank(name)) {
return false;
}
return ClassDescriptorCache.getInstance()
.getClassDescriptor(clazz)
.getFields(accessAll)
.str... | java | public boolean containsField(String name) {
if (StringUtils.isNullOrBlank(name)) {
return false;
}
return ClassDescriptorCache.getInstance()
.getClassDescriptor(clazz)
.getFields(accessAll)
.str... | [
"public",
"boolean",
"containsField",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNullOrBlank",
"(",
"name",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"ClassDescriptorCache",
".",
"getInstance",
"(",
")",
".",
"getClassDesc... | Determines if a field with the given name is associated with the class
@param name The field name
@return True if there is a field with the given name | [
"Determines",
"if",
"a",
"field",
"with",
"the",
"given",
"name",
"is",
"associated",
"with",
"the",
"class"
] | 2cec08826f1fccd658694dd03abce10fc97618ec | https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/reflection/Reflect.java#L181-L190 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.