id int32 0 165k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
150,900 | mytechia/mytechia_commons | mytechia-commons-modelaction/src/main/java/com/mytechia/commons/framework/modelaction/action/async/AsyncActionPool.java | AsyncActionPool.createThreads | private void createThreads(int threadCount)
{
for(int i=0; i<threadCount; i++) {
AsyncActionWorkerThread worker = new AsyncActionWorkerThread("Async-Action-Worker-"+i);
this.threadPool.add(worker);
worker.start();
}
... | java | private void createThreads(int threadCount)
{
for(int i=0; i<threadCount; i++) {
AsyncActionWorkerThread worker = new AsyncActionWorkerThread("Async-Action-Worker-"+i);
this.threadPool.add(worker);
worker.start();
}
... | [
"private",
"void",
"createThreads",
"(",
"int",
"threadCount",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"threadCount",
";",
"i",
"++",
")",
"{",
"AsyncActionWorkerThread",
"worker",
"=",
"new",
"AsyncActionWorkerThread",
"(",
"\"Async-Actio... | Creates the worker threads and starts their execution
@param threadCount the number of worker threads to create | [
"Creates",
"the",
"worker",
"threads",
"and",
"starts",
"their",
"execution"
] | 02251879085f271a1fb51663a1c8eddc8be78ae7 | https://github.com/mytechia/mytechia_commons/blob/02251879085f271a1fb51663a1c8eddc8be78ae7/mytechia-commons-modelaction/src/main/java/com/mytechia/commons/framework/modelaction/action/async/AsyncActionPool.java#L76-L87 |
150,901 | mytechia/mytechia_commons | mytechia-commons-modelaction/src/main/java/com/mytechia/commons/framework/modelaction/action/async/AsyncActionPool.java | AsyncActionPool.addAction | public void addAction(ModelAction action, ModelActionListener listener)
{
synchronized(actionQueue) {
this.actionQueue.add(new ModelActionEntry(action, listener));
}
wakeUp();
} | java | public void addAction(ModelAction action, ModelActionListener listener)
{
synchronized(actionQueue) {
this.actionQueue.add(new ModelActionEntry(action, listener));
}
wakeUp();
} | [
"public",
"void",
"addAction",
"(",
"ModelAction",
"action",
",",
"ModelActionListener",
"listener",
")",
"{",
"synchronized",
"(",
"actionQueue",
")",
"{",
"this",
".",
"actionQueue",
".",
"add",
"(",
"new",
"ModelActionEntry",
"(",
"action",
",",
"listener",
... | Adds an action to the processing queue
@param action the action to execute
@param listener an optional listener object to be notified of the action end state | [
"Adds",
"an",
"action",
"to",
"the",
"processing",
"queue"
] | 02251879085f271a1fb51663a1c8eddc8be78ae7 | https://github.com/mytechia/mytechia_commons/blob/02251879085f271a1fb51663a1c8eddc8be78ae7/mytechia-commons-modelaction/src/main/java/com/mytechia/commons/framework/modelaction/action/async/AsyncActionPool.java#L95-L104 |
150,902 | mytechia/mytechia_commons | mytechia-commons-modelaction/src/main/java/com/mytechia/commons/framework/modelaction/action/async/AsyncActionPool.java | AsyncActionPool.pollAction | private ModelActionEntry pollAction()
{
ModelActionEntry action = null;
while(!stop) {
synchronized(actionQueue) {
action = this.actionQueue.poll();
}
if (action != null) {
break;
}
... | java | private ModelActionEntry pollAction()
{
ModelActionEntry action = null;
while(!stop) {
synchronized(actionQueue) {
action = this.actionQueue.poll();
}
if (action != null) {
break;
}
... | [
"private",
"ModelActionEntry",
"pollAction",
"(",
")",
"{",
"ModelActionEntry",
"action",
"=",
"null",
";",
"while",
"(",
"!",
"stop",
")",
"{",
"synchronized",
"(",
"actionQueue",
")",
"{",
"action",
"=",
"this",
".",
"actionQueue",
".",
"poll",
"(",
")",... | Retrieves an action from the queue
It is a blocking method, it blocks until an action is available in the
queue or the processing pool is stopped | [
"Retrieves",
"an",
"action",
"from",
"the",
"queue",
"It",
"is",
"a",
"blocking",
"method",
"it",
"blocks",
"until",
"an",
"action",
"is",
"available",
"in",
"the",
"queue",
"or",
"the",
"processing",
"pool",
"is",
"stopped"
] | 02251879085f271a1fb51663a1c8eddc8be78ae7 | https://github.com/mytechia/mytechia_commons/blob/02251879085f271a1fb51663a1c8eddc8be78ae7/mytechia-commons-modelaction/src/main/java/com/mytechia/commons/framework/modelaction/action/async/AsyncActionPool.java#L111-L138 |
150,903 | jtrfp/javamod | src/main/java/de/quippy/jmac/tools/CircleBuffer.java | CircleBuffer.CreateBuffer | public void CreateBuffer(int nBytes, int nMaxDirectWriteBytes) {
m_nMaxDirectWriteBytes = nMaxDirectWriteBytes;
m_nTotal = nBytes + 1 + nMaxDirectWriteBytes;
m_pBuffer = new byte[m_nTotal];
byteBuffer = new ByteBuffer();
m_nHead = 0;
m_nTail = 0;
m_nEndCap = m_nTo... | java | public void CreateBuffer(int nBytes, int nMaxDirectWriteBytes) {
m_nMaxDirectWriteBytes = nMaxDirectWriteBytes;
m_nTotal = nBytes + 1 + nMaxDirectWriteBytes;
m_pBuffer = new byte[m_nTotal];
byteBuffer = new ByteBuffer();
m_nHead = 0;
m_nTail = 0;
m_nEndCap = m_nTo... | [
"public",
"void",
"CreateBuffer",
"(",
"int",
"nBytes",
",",
"int",
"nMaxDirectWriteBytes",
")",
"{",
"m_nMaxDirectWriteBytes",
"=",
"nMaxDirectWriteBytes",
";",
"m_nTotal",
"=",
"nBytes",
"+",
"1",
"+",
"nMaxDirectWriteBytes",
";",
"m_pBuffer",
"=",
"new",
"byte"... | create the buffer | [
"create",
"the",
"buffer"
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/jmac/tools/CircleBuffer.java#L39-L47 |
150,904 | livetribe/livetribe-slp | osgi/bundle/src/main/java/org/livetribe/slp/osgi/UserAgentManagedServiceFactory.java | UserAgentManagedServiceFactory.updated | public void updated(String pid, Dictionary dictionary) throws ConfigurationException
{
LOGGER.entering(CLASS_NAME, "updated", new Object[]{pid, dictionary});
deleted(pid);
UserAgent userAgent = SLP.newUserAgent(dictionary == null ? null : DictionarySettings.from(dictionary));
if (... | java | public void updated(String pid, Dictionary dictionary) throws ConfigurationException
{
LOGGER.entering(CLASS_NAME, "updated", new Object[]{pid, dictionary});
deleted(pid);
UserAgent userAgent = SLP.newUserAgent(dictionary == null ? null : DictionarySettings.from(dictionary));
if (... | [
"public",
"void",
"updated",
"(",
"String",
"pid",
",",
"Dictionary",
"dictionary",
")",
"throws",
"ConfigurationException",
"{",
"LOGGER",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"updated\"",
",",
"new",
"Object",
"[",
"]",
"{",
"pid",
",",
"dictionary",
... | Update the SLP user agent's configuration, unregistering from the
OSGi service registry and stopping it if it had already started. The
new SLP user agent will be started with the new configuration and
registered in the OSGi service registry using the configuration
parameters as service properties.
@param pid T... | [
"Update",
"the",
"SLP",
"user",
"agent",
"s",
"configuration",
"unregistering",
"from",
"the",
"OSGi",
"service",
"registry",
"and",
"stopping",
"it",
"if",
"it",
"had",
"already",
"started",
".",
"The",
"new",
"SLP",
"user",
"agent",
"will",
"be",
"started"... | 6cc13dbe81feab133fe3dd291ca081cbc6e1f591 | https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/osgi/bundle/src/main/java/org/livetribe/slp/osgi/UserAgentManagedServiceFactory.java#L95-L113 |
150,905 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/BannedDependencies.java | BannedDependencies.checkDependencies | private Set<Artifact> checkDependencies( Set<Artifact> dependencies, List<String> thePatterns )
throws EnforcerRuleException
{
Set<Artifact> foundMatches = null;
if ( thePatterns != null && thePatterns.size() > 0 )
{
for ( String pattern : thePatterns )
{
... | java | private Set<Artifact> checkDependencies( Set<Artifact> dependencies, List<String> thePatterns )
throws EnforcerRuleException
{
Set<Artifact> foundMatches = null;
if ( thePatterns != null && thePatterns.size() > 0 )
{
for ( String pattern : thePatterns )
{
... | [
"private",
"Set",
"<",
"Artifact",
">",
"checkDependencies",
"(",
"Set",
"<",
"Artifact",
">",
"dependencies",
",",
"List",
"<",
"String",
">",
"thePatterns",
")",
"throws",
"EnforcerRuleException",
"{",
"Set",
"<",
"Artifact",
">",
"foundMatches",
"=",
"null"... | Checks the set of dependencies against the list of patterns.
@param thePatterns the patterns
@param dependencies the dependencies
@return a set containing artifacts matching one of the patterns or <code>null</code>
@throws EnforcerRuleException the enforcer rule exception | [
"Checks",
"the",
"set",
"of",
"dependencies",
"against",
"the",
"list",
"of",
"patterns",
"."
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/BannedDependencies.java#L99-L128 |
150,906 | livetribe/livetribe-slp | core/src/main/java/org/livetribe/slp/settings/Editors.java | Editors.register | public static void register(Class<?> typeClass, Class<? extends PropertyEditor> editorClass)
{
synchronized (editors)
{
editors.put(typeClass, editorClass);
}
} | java | public static void register(Class<?> typeClass, Class<? extends PropertyEditor> editorClass)
{
synchronized (editors)
{
editors.put(typeClass, editorClass);
}
} | [
"public",
"static",
"void",
"register",
"(",
"Class",
"<",
"?",
">",
"typeClass",
",",
"Class",
"<",
"?",
"extends",
"PropertyEditor",
">",
"editorClass",
")",
"{",
"synchronized",
"(",
"editors",
")",
"{",
"editors",
".",
"put",
"(",
"typeClass",
",",
"... | Registers the given editor class to be used to edit values of the given type class.
@param typeClass the class of objects to be edited
@param editorClass the editor class | [
"Registers",
"the",
"given",
"editor",
"class",
"to",
"be",
"used",
"to",
"edit",
"values",
"of",
"the",
"given",
"type",
"class",
"."
] | 6cc13dbe81feab133fe3dd291ca081cbc6e1f591 | https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/core/src/main/java/org/livetribe/slp/settings/Editors.java#L42-L48 |
150,907 | GerdHolz/TOVAL | src/de/invation/code/toval/graphic/ui/VerticalLabelUI.java | VerticalLabelUI.getBaseline | @Override
public int getBaseline(JComponent c, int width, int height) {
super.getBaseline(c, width, height);
return -1;
} | java | @Override
public int getBaseline(JComponent c, int width, int height) {
super.getBaseline(c, width, height);
return -1;
} | [
"@",
"Override",
"public",
"int",
"getBaseline",
"(",
"JComponent",
"c",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"super",
".",
"getBaseline",
"(",
"c",
",",
"width",
",",
"height",
")",
";",
"return",
"-",
"1",
";",
"}"
] | Overridden to always return -1, since a vertical label does not have a
meaningful baseline.
@see ComponentUI#getBaseline(JComponent, int, int) | [
"Overridden",
"to",
"always",
"return",
"-",
"1",
"since",
"a",
"vertical",
"label",
"does",
"not",
"have",
"a",
"meaningful",
"baseline",
"."
] | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/graphic/ui/VerticalLabelUI.java#L66-L70 |
150,908 | GerdHolz/TOVAL | src/de/invation/code/toval/graphic/ui/VerticalLabelUI.java | VerticalLabelUI.getBaselineResizeBehavior | @Override
public Component.BaselineResizeBehavior getBaselineResizeBehavior(
JComponent c) {
super.getBaselineResizeBehavior(c);
return Component.BaselineResizeBehavior.OTHER;
} | java | @Override
public Component.BaselineResizeBehavior getBaselineResizeBehavior(
JComponent c) {
super.getBaselineResizeBehavior(c);
return Component.BaselineResizeBehavior.OTHER;
} | [
"@",
"Override",
"public",
"Component",
".",
"BaselineResizeBehavior",
"getBaselineResizeBehavior",
"(",
"JComponent",
"c",
")",
"{",
"super",
".",
"getBaselineResizeBehavior",
"(",
"c",
")",
";",
"return",
"Component",
".",
"BaselineResizeBehavior",
".",
"OTHER",
"... | Overridden to always return Component.BaselineResizeBehavior.OTHER,
since a vertical label does not have a meaningful baseline
@see ComponentUI#getBaselineResizeBehavior(javax.swing.JComponent) | [
"Overridden",
"to",
"always",
"return",
"Component",
".",
"BaselineResizeBehavior",
".",
"OTHER",
"since",
"a",
"vertical",
"label",
"does",
"not",
"have",
"a",
"meaningful",
"baseline"
] | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/graphic/ui/VerticalLabelUI.java#L78-L83 |
150,909 | GerdHolz/TOVAL | src/de/invation/code/toval/graphic/ui/VerticalLabelUI.java | VerticalLabelUI.paint | @Override
public void paint(Graphics g, JComponent c) {
Graphics2D g2 = (Graphics2D) g.create();
if (clockwiseRotation) {
g2.rotate(Math.PI / 2, c.getSize().width / 2, c.getSize().width / 2);
} else {
g2.rotate(-Math.PI / 2, c.getSize().height / 2, c.getSize().height / 2);
}... | java | @Override
public void paint(Graphics g, JComponent c) {
Graphics2D g2 = (Graphics2D) g.create();
if (clockwiseRotation) {
g2.rotate(Math.PI / 2, c.getSize().width / 2, c.getSize().width / 2);
} else {
g2.rotate(-Math.PI / 2, c.getSize().height / 2, c.getSize().height / 2);
}... | [
"@",
"Override",
"public",
"void",
"paint",
"(",
"Graphics",
"g",
",",
"JComponent",
"c",
")",
"{",
"Graphics2D",
"g2",
"=",
"(",
"Graphics2D",
")",
"g",
".",
"create",
"(",
")",
";",
"if",
"(",
"clockwiseRotation",
")",
"{",
"g2",
".",
"rotate",
"("... | Transforms the Graphics for vertical rendering and invokes the
super method. | [
"Transforms",
"the",
"Graphics",
"for",
"vertical",
"rendering",
"and",
"invokes",
"the",
"super",
"method",
"."
] | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/graphic/ui/VerticalLabelUI.java#L113-L122 |
150,910 | jtrfp/javamod | src/main/java/de/quippy/mp3/decoder/BitReserve.java | BitReserve.hgetbits | public int hgetbits(int N)
{
totbit += N;
int val = 0;
int pos = buf_byte_idx;
if (pos+N < BUFSIZE)
{
while (N-- > 0)
{
val <<= 1;
val |= ((buf[pos++]!=0) ? 1 : 0);
}
}
else
{
while (N-- > 0)
{
val <<= 1;
val |= ((buf[pos]!=0) ? 1 : 0);
pos = (pos+1) & BU... | java | public int hgetbits(int N)
{
totbit += N;
int val = 0;
int pos = buf_byte_idx;
if (pos+N < BUFSIZE)
{
while (N-- > 0)
{
val <<= 1;
val |= ((buf[pos++]!=0) ? 1 : 0);
}
}
else
{
while (N-- > 0)
{
val <<= 1;
val |= ((buf[pos]!=0) ? 1 : 0);
pos = (pos+1) & BU... | [
"public",
"int",
"hgetbits",
"(",
"int",
"N",
")",
"{",
"totbit",
"+=",
"N",
";",
"int",
"val",
"=",
"0",
";",
"int",
"pos",
"=",
"buf_byte_idx",
";",
"if",
"(",
"pos",
"+",
"N",
"<",
"BUFSIZE",
")",
"{",
"while",
"(",
"N",
"--",
">",
"0",
")... | Read a number bits from the bit stream.
@param N the number of | [
"Read",
"a",
"number",
"bits",
"from",
"the",
"bit",
"stream",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/mp3/decoder/BitReserve.java#L83-L109 |
150,911 | jtrfp/javamod | src/main/java/de/quippy/mp3/decoder/BitReserve.java | BitReserve.hputbuf | public void hputbuf(int val)
{
int ofs = offset;
buf[ofs++] = val & 0x80;
buf[ofs++] = val & 0x40;
buf[ofs++] = val & 0x20;
buf[ofs++] = val & 0x10;
buf[ofs++] = val & 0x08;
buf[ofs++] = val & 0x04;
buf[ofs++] = val & 0x02;
buf[ofs++] = val & 0x01;
if (ofs==BUFSIZE)... | java | public void hputbuf(int val)
{
int ofs = offset;
buf[ofs++] = val & 0x80;
buf[ofs++] = val & 0x40;
buf[ofs++] = val & 0x20;
buf[ofs++] = val & 0x10;
buf[ofs++] = val & 0x08;
buf[ofs++] = val & 0x04;
buf[ofs++] = val & 0x02;
buf[ofs++] = val & 0x01;
if (ofs==BUFSIZE)... | [
"public",
"void",
"hputbuf",
"(",
"int",
"val",
")",
"{",
"int",
"ofs",
"=",
"offset",
";",
"buf",
"[",
"ofs",
"++",
"]",
"=",
"val",
"&",
"0x80",
";",
"buf",
"[",
"ofs",
"++",
"]",
"=",
"val",
"&",
"0x40",
";",
"buf",
"[",
"ofs",
"++",
"]",
... | Write 8 bits into the bit stream. | [
"Write",
"8",
"bits",
"into",
"the",
"bit",
"stream",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/mp3/decoder/BitReserve.java#L182-L199 |
150,912 | jtrfp/javamod | src/main/java/de/quippy/mp3/decoder/BitReserve.java | BitReserve.rewindNbytes | public void rewindNbytes(int N)
{
int bits = (N << 3);
totbit -= bits;
buf_byte_idx -= bits;
if (buf_byte_idx<0)
buf_byte_idx += BUFSIZE;
} | java | public void rewindNbytes(int N)
{
int bits = (N << 3);
totbit -= bits;
buf_byte_idx -= bits;
if (buf_byte_idx<0)
buf_byte_idx += BUFSIZE;
} | [
"public",
"void",
"rewindNbytes",
"(",
"int",
"N",
")",
"{",
"int",
"bits",
"=",
"(",
"N",
"<<",
"3",
")",
";",
"totbit",
"-=",
"bits",
";",
"buf_byte_idx",
"-=",
"bits",
";",
"if",
"(",
"buf_byte_idx",
"<",
"0",
")",
"buf_byte_idx",
"+=",
"BUFSIZE",... | Rewind N bytes in Stream. | [
"Rewind",
"N",
"bytes",
"in",
"Stream",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/mp3/decoder/BitReserve.java#L215-L222 |
150,913 | Bernardo-MG/velocity-config-tool | src/main/java/com/bernardomg/velocity/tool/ConfigTool.java | ConfigTool.configure | @Override
protected final void configure(final ValueParser values) {
final Object velocityContext; // Value from the parser
final ToolContext ctxt; // Casted context
final Object decorationObj; // Value of the decoration key
checkNotNull(values, "Received a null pointer as v... | java | @Override
protected final void configure(final ValueParser values) {
final Object velocityContext; // Value from the parser
final ToolContext ctxt; // Casted context
final Object decorationObj; // Value of the decoration key
checkNotNull(values, "Received a null pointer as v... | [
"@",
"Override",
"protected",
"final",
"void",
"configure",
"(",
"final",
"ValueParser",
"values",
")",
"{",
"final",
"Object",
"velocityContext",
";",
"// Value from the parser",
"final",
"ToolContext",
"ctxt",
";",
"// Casted context",
"final",
"Object",
"decoration... | Sets up the tool with the skin configuration and file id. | [
"Sets",
"up",
"the",
"tool",
"with",
"the",
"skin",
"configuration",
"and",
"file",
"id",
"."
] | 2147d9ee745573a434cd37f1c5d0c22985e80953 | https://github.com/Bernardo-MG/velocity-config-tool/blob/2147d9ee745573a434cd37f1c5d0c22985e80953/src/main/java/com/bernardomg/velocity/tool/ConfigTool.java#L307-L327 |
150,914 | actorapp/droidkit-actors | actors/src/main/java/com/droidkit/actors/ActorSystem.java | ActorSystem.addDispatcher | public void addDispatcher(String dispatcherId, AbsActorDispatcher dispatcher) {
synchronized (dispatchers) {
if (dispatchers.containsKey(dispatcherId)) {
return;
}
dispatchers.put(dispatcherId, dispatcher);
}
} | java | public void addDispatcher(String dispatcherId, AbsActorDispatcher dispatcher) {
synchronized (dispatchers) {
if (dispatchers.containsKey(dispatcherId)) {
return;
}
dispatchers.put(dispatcherId, dispatcher);
}
} | [
"public",
"void",
"addDispatcher",
"(",
"String",
"dispatcherId",
",",
"AbsActorDispatcher",
"dispatcher",
")",
"{",
"synchronized",
"(",
"dispatchers",
")",
"{",
"if",
"(",
"dispatchers",
".",
"containsKey",
"(",
"dispatcherId",
")",
")",
"{",
"return",
";",
... | Registering custom dispatcher
@param dispatcherId dispatcher id
@param dispatcher dispatcher object | [
"Registering",
"custom",
"dispatcher"
] | fdb72fcfdd1c5e54a970f203a33a71fa54344217 | https://github.com/actorapp/droidkit-actors/blob/fdb72fcfdd1c5e54a970f203a33a71fa54344217/actors/src/main/java/com/droidkit/actors/ActorSystem.java#L83-L90 |
150,915 | actorapp/droidkit-actors | actors/src/main/java/com/droidkit/actors/ActorSystem.java | ActorSystem.actorOf | public <T extends Actor> ActorRef actorOf(Class<T> actor, String path) {
return actorOf(Props.create(actor), path);
} | java | public <T extends Actor> ActorRef actorOf(Class<T> actor, String path) {
return actorOf(Props.create(actor), path);
} | [
"public",
"<",
"T",
"extends",
"Actor",
">",
"ActorRef",
"actorOf",
"(",
"Class",
"<",
"T",
">",
"actor",
",",
"String",
"path",
")",
"{",
"return",
"actorOf",
"(",
"Props",
".",
"create",
"(",
"actor",
")",
",",
"path",
")",
";",
"}"
] | Creating or getting existing actor from actor class
@param actor Actor Class
@param path Actor Path
@param <T> Actor Class
@return ActorRef | [
"Creating",
"or",
"getting",
"existing",
"actor",
"from",
"actor",
"class"
] | fdb72fcfdd1c5e54a970f203a33a71fa54344217 | https://github.com/actorapp/droidkit-actors/blob/fdb72fcfdd1c5e54a970f203a33a71fa54344217/actors/src/main/java/com/droidkit/actors/ActorSystem.java#L104-L106 |
150,916 | actorapp/droidkit-actors | actors/src/main/java/com/droidkit/actors/ActorSystem.java | ActorSystem.actorOf | public ActorRef actorOf(Props props, String path) {
String dispatcherId = props.getDispatcher() == null ? DEFAULT_DISPATCHER : props.getDispatcher();
AbsActorDispatcher mailboxesDispatcher;
synchronized (dispatchers) {
if (!dispatchers.containsKey(dispatcherId)) {
th... | java | public ActorRef actorOf(Props props, String path) {
String dispatcherId = props.getDispatcher() == null ? DEFAULT_DISPATCHER : props.getDispatcher();
AbsActorDispatcher mailboxesDispatcher;
synchronized (dispatchers) {
if (!dispatchers.containsKey(dispatcherId)) {
th... | [
"public",
"ActorRef",
"actorOf",
"(",
"Props",
"props",
",",
"String",
"path",
")",
"{",
"String",
"dispatcherId",
"=",
"props",
".",
"getDispatcher",
"(",
")",
"==",
"null",
"?",
"DEFAULT_DISPATCHER",
":",
"props",
".",
"getDispatcher",
"(",
")",
";",
"Ab... | Creating or getting existing actor from actor props
@param props Actor Props
@param path Actor Path
@return ActorRef | [
"Creating",
"or",
"getting",
"existing",
"actor",
"from",
"actor",
"props"
] | fdb72fcfdd1c5e54a970f203a33a71fa54344217 | https://github.com/actorapp/droidkit-actors/blob/fdb72fcfdd1c5e54a970f203a33a71fa54344217/actors/src/main/java/com/droidkit/actors/ActorSystem.java#L115-L127 |
150,917 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/plugins/ExtensionPoints.java | ExtensionPoints.add | @SuppressWarnings("unchecked")
public static <T extends Plugin> void add(ExtensionPoint<T> point) {
ArrayList<Plugin> plugins = new ArrayList<>();
synchronized (points) {
points.add(point);
for (Iterator<Plugin> it = waitingPlugins.iterator(); it.hasNext(); ) {
Plugin pi = it.next();
if (point... | java | @SuppressWarnings("unchecked")
public static <T extends Plugin> void add(ExtensionPoint<T> point) {
ArrayList<Plugin> plugins = new ArrayList<>();
synchronized (points) {
points.add(point);
for (Iterator<Plugin> it = waitingPlugins.iterator(); it.hasNext(); ) {
Plugin pi = it.next();
if (point... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
"extends",
"Plugin",
">",
"void",
"add",
"(",
"ExtensionPoint",
"<",
"T",
">",
"point",
")",
"{",
"ArrayList",
"<",
"Plugin",
">",
"plugins",
"=",
"new",
"ArrayList",
"<>",
... | Add an extension point. | [
"Add",
"an",
"extension",
"point",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/plugins/ExtensionPoints.java#L31-L48 |
150,918 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/plugins/ExtensionPoints.java | ExtensionPoints.add | @SuppressWarnings("unchecked")
public static void add(String epClassName, Plugin pi) {
ExtensionPoint<Plugin> ep = null;
synchronized (points) {
for (ExtensionPoint<?> point : points)
if (point.getClass().getName().equals(epClassName)) {
ep = (ExtensionPoint<Plugin>)point;
break;
}
... | java | @SuppressWarnings("unchecked")
public static void add(String epClassName, Plugin pi) {
ExtensionPoint<Plugin> ep = null;
synchronized (points) {
for (ExtensionPoint<?> point : points)
if (point.getClass().getName().equals(epClassName)) {
ep = (ExtensionPoint<Plugin>)point;
break;
}
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"void",
"add",
"(",
"String",
"epClassName",
",",
"Plugin",
"pi",
")",
"{",
"ExtensionPoint",
"<",
"Plugin",
">",
"ep",
"=",
"null",
";",
"synchronized",
"(",
"points",
")",
"{",
"for"... | Add a plug-in for the given extension point class name. | [
"Add",
"a",
"plug",
"-",
"in",
"for",
"the",
"given",
"extension",
"point",
"class",
"name",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/plugins/ExtensionPoints.java#L58-L75 |
150,919 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/plugins/ExtensionPoints.java | ExtensionPoints.allPluginsLoaded | public static void allPluginsLoaded() {
StringBuilder s = new StringBuilder(1024);
s.append("Extension points:");
synchronized (points) {
for (ExtensionPoint<?> ep : points)
ep.allPluginsLoaded();
for (ExtensionPoint<?> ep : points) {
s.append("\r\n- ");
ep.printInfo(s);
}
points... | java | public static void allPluginsLoaded() {
StringBuilder s = new StringBuilder(1024);
s.append("Extension points:");
synchronized (points) {
for (ExtensionPoint<?> ep : points)
ep.allPluginsLoaded();
for (ExtensionPoint<?> ep : points) {
s.append("\r\n- ");
ep.printInfo(s);
}
points... | [
"public",
"static",
"void",
"allPluginsLoaded",
"(",
")",
"{",
"StringBuilder",
"s",
"=",
"new",
"StringBuilder",
"(",
"1024",
")",
";",
"s",
".",
"append",
"(",
"\"Extension points:\"",
")",
";",
"synchronized",
"(",
"points",
")",
"{",
"for",
"(",
"Exten... | Call the method allPluginsLoaded on every extension point. | [
"Call",
"the",
"method",
"allPluginsLoaded",
"on",
"every",
"extension",
"point",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/plugins/ExtensionPoints.java#L107-L131 |
150,920 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/plugins/ExtensionPoints.java | ExtensionPoints.logRemainingPlugins | public static void logRemainingPlugins() {
Logger logger = LCCore.getApplication().getDefaultLogger();
if (!logger.warn())
return;
synchronized (points) {
for (Plugin pi : waitingPlugins)
logger.warn("Plugin ignored because extension point is not loaded: " + pi.getClass().getName());
}
} | java | public static void logRemainingPlugins() {
Logger logger = LCCore.getApplication().getDefaultLogger();
if (!logger.warn())
return;
synchronized (points) {
for (Plugin pi : waitingPlugins)
logger.warn("Plugin ignored because extension point is not loaded: " + pi.getClass().getName());
}
} | [
"public",
"static",
"void",
"logRemainingPlugins",
"(",
")",
"{",
"Logger",
"logger",
"=",
"LCCore",
".",
"getApplication",
"(",
")",
".",
"getDefaultLogger",
"(",
")",
";",
"if",
"(",
"!",
"logger",
".",
"warn",
"(",
")",
")",
"return",
";",
"synchroniz... | Print to the error console the plugins that are available without their corresponding extension point. | [
"Print",
"to",
"the",
"error",
"console",
"the",
"plugins",
"that",
"are",
"available",
"without",
"their",
"corresponding",
"extension",
"point",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/plugins/ExtensionPoints.java#L141-L149 |
150,921 | jpaoletti/java-presentation-manager | modules/jpm-core/src/main/java/jpaoletti/jpm/core/Highlights.java | Highlights.getHighlights | public List<Highlight> getHighlights(Entity entity, Field field, Object instance) {
if (field == null) {
return getHighlights(entity, instance);
}
final List<Highlight> result = new ArrayList<Highlight>();
for (Highlight highlight : highlights) {
if (!highlight.ge... | java | public List<Highlight> getHighlights(Entity entity, Field field, Object instance) {
if (field == null) {
return getHighlights(entity, instance);
}
final List<Highlight> result = new ArrayList<Highlight>();
for (Highlight highlight : highlights) {
if (!highlight.ge... | [
"public",
"List",
"<",
"Highlight",
">",
"getHighlights",
"(",
"Entity",
"entity",
",",
"Field",
"field",
",",
"Object",
"instance",
")",
"{",
"if",
"(",
"field",
"==",
"null",
")",
"{",
"return",
"getHighlights",
"(",
"entity",
",",
"instance",
")",
";"... | Return all the highlights that matches the given instance in the given
field of the given entity
@param entity The entity
@param field The field
@param instance The instance
@return The highlight | [
"Return",
"all",
"the",
"highlights",
"that",
"matches",
"the",
"given",
"instance",
"in",
"the",
"given",
"field",
"of",
"the",
"given",
"entity"
] | d5aab55638383695db244744b4bfe27c5200e04f | https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/core/Highlights.java#L58-L71 |
150,922 | jpaoletti/java-presentation-manager | modules/jpm-core/src/main/java/jpaoletti/jpm/core/Highlights.java | Highlights.getHighlight | public Highlight getHighlight(Entity entity, Object instance) {
for (Highlight highlight : highlights) {
if (highlight.getScope().equals(INSTANCE)) {
for (Field field : entity.getOrderedFields()) {
if (match(instance, field, highlight)) {
r... | java | public Highlight getHighlight(Entity entity, Object instance) {
for (Highlight highlight : highlights) {
if (highlight.getScope().equals(INSTANCE)) {
for (Field field : entity.getOrderedFields()) {
if (match(instance, field, highlight)) {
r... | [
"public",
"Highlight",
"getHighlight",
"(",
"Entity",
"entity",
",",
"Object",
"instance",
")",
"{",
"for",
"(",
"Highlight",
"highlight",
":",
"highlights",
")",
"{",
"if",
"(",
"highlight",
".",
"getScope",
"(",
")",
".",
"equals",
"(",
"INSTANCE",
")",
... | Return the first highlight that match in any value of this instance with
some of the highlights values.
@param entity The entity
@param instance The instance
@return The Highlinght | [
"Return",
"the",
"first",
"highlight",
"that",
"match",
"in",
"any",
"value",
"of",
"this",
"instance",
"with",
"some",
"of",
"the",
"highlights",
"values",
"."
] | d5aab55638383695db244744b4bfe27c5200e04f | https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/core/Highlights.java#L81-L92 |
150,923 | jpaoletti/java-presentation-manager | modules/jpm-core/src/main/java/jpaoletti/jpm/core/Highlights.java | Highlights.match | protected boolean match(Object instance, Field field, Highlight highlight) {
try {
Object o = getPm().get(instance, field.getProperty());
if (o != null && o.toString().equals(highlight.getValue()) && highlight.getField().equals(field.getId())) {
return true;
}... | java | protected boolean match(Object instance, Field field, Highlight highlight) {
try {
Object o = getPm().get(instance, field.getProperty());
if (o != null && o.toString().equals(highlight.getValue()) && highlight.getField().equals(field.getId())) {
return true;
}... | [
"protected",
"boolean",
"match",
"(",
"Object",
"instance",
",",
"Field",
"field",
",",
"Highlight",
"highlight",
")",
"{",
"try",
"{",
"Object",
"o",
"=",
"getPm",
"(",
")",
".",
"get",
"(",
"instance",
",",
"field",
".",
"getProperty",
"(",
")",
")",... | Indicate if the field of the given instance matches with the given
highlight
@param instance The instance
@param field The field
@param highlight The highlight
@return true if match | [
"Indicate",
"if",
"the",
"field",
"of",
"the",
"given",
"instance",
"matches",
"with",
"the",
"given",
"highlight"
] | d5aab55638383695db244744b4bfe27c5200e04f | https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/core/Highlights.java#L125-L134 |
150,924 | livetribe/livetribe-slp | osgi/bundle/src/main/java/org/livetribe/slp/osgi/ByServicePropertiesServiceTracker.java | ByServicePropertiesServiceTracker.generateServiceInfo | private ServiceInfo generateServiceInfo(ServiceReference reference)
{
Map<String, String> map = Utils.toMap(reference);
Set<String> keys = map.keySet();
String slpUrl = Utils.subst((String)reference.getProperty(SLP_URL), map);
ServiceURL serviceURL;
if (keys.contains(SLP_UR... | java | private ServiceInfo generateServiceInfo(ServiceReference reference)
{
Map<String, String> map = Utils.toMap(reference);
Set<String> keys = map.keySet();
String slpUrl = Utils.subst((String)reference.getProperty(SLP_URL), map);
ServiceURL serviceURL;
if (keys.contains(SLP_UR... | [
"private",
"ServiceInfo",
"generateServiceInfo",
"(",
"ServiceReference",
"reference",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"=",
"Utils",
".",
"toMap",
"(",
"reference",
")",
";",
"Set",
"<",
"String",
">",
"keys",
"=",
"map",
".",
... | Generate SLP service information by scraping relevant information from
the OSGi service reference's properties.
@param reference the OSGi service reference used to generate the SLP service information
@return the generated SLP service information | [
"Generate",
"SLP",
"service",
"information",
"by",
"scraping",
"relevant",
"information",
"from",
"the",
"OSGi",
"service",
"reference",
"s",
"properties",
"."
] | 6cc13dbe81feab133fe3dd291ca081cbc6e1f591 | https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/osgi/bundle/src/main/java/org/livetribe/slp/osgi/ByServicePropertiesServiceTracker.java#L225-L288 |
150,925 | actorapp/droidkit-actors | actors/src/main/java/com/droidkit/actors/Actor.java | Actor.combine | public AskFuture combine(AskCallback<Object[]> callback, AskFuture... futures) {
AskFuture future = combine(futures);
future.addListener(callback);
return future;
} | java | public AskFuture combine(AskCallback<Object[]> callback, AskFuture... futures) {
AskFuture future = combine(futures);
future.addListener(callback);
return future;
} | [
"public",
"AskFuture",
"combine",
"(",
"AskCallback",
"<",
"Object",
"[",
"]",
">",
"callback",
",",
"AskFuture",
"...",
"futures",
")",
"{",
"AskFuture",
"future",
"=",
"combine",
"(",
"futures",
")",
";",
"future",
".",
"addListener",
"(",
"callback",
")... | Combine multiple asks to single one
@param callback asks callback
@param futures futures from ask
@return future | [
"Combine",
"multiple",
"asks",
"to",
"single",
"one"
] | fdb72fcfdd1c5e54a970f203a33a71fa54344217 | https://github.com/actorapp/droidkit-actors/blob/fdb72fcfdd1c5e54a970f203a33a71fa54344217/actors/src/main/java/com/droidkit/actors/Actor.java#L205-L209 |
150,926 | actorapp/droidkit-actors | actors/src/main/java/com/droidkit/actors/Actor.java | Actor.ask | public <T> void ask(Future<T> future, FutureCallback<T> callback) {
typedAsk.ask(future, callback);
} | java | public <T> void ask(Future<T> future, FutureCallback<T> callback) {
typedAsk.ask(future, callback);
} | [
"public",
"<",
"T",
">",
"void",
"ask",
"(",
"Future",
"<",
"T",
">",
"future",
",",
"FutureCallback",
"<",
"T",
">",
"callback",
")",
"{",
"typedAsk",
".",
"ask",
"(",
"future",
",",
"callback",
")",
";",
"}"
] | Ask TypedActor future method for result
@param future Future of ask
@param callback callback for ask
@param <T> type of result | [
"Ask",
"TypedActor",
"future",
"method",
"for",
"result"
] | fdb72fcfdd1c5e54a970f203a33a71fa54344217 | https://github.com/actorapp/droidkit-actors/blob/fdb72fcfdd1c5e54a970f203a33a71fa54344217/actors/src/main/java/com/droidkit/actors/Actor.java#L306-L308 |
150,927 | actorapp/droidkit-actors | actors/src/main/java/com/droidkit/actors/Actor.java | Actor.proxy | public <T> T proxy(final T src, Class<T> tClass) {
return callbackExtension.proxy(src, tClass);
} | java | public <T> T proxy(final T src, Class<T> tClass) {
return callbackExtension.proxy(src, tClass);
} | [
"public",
"<",
"T",
">",
"T",
"proxy",
"(",
"final",
"T",
"src",
",",
"Class",
"<",
"T",
">",
"tClass",
")",
"{",
"return",
"callbackExtension",
".",
"proxy",
"(",
"src",
",",
"tClass",
")",
";",
"}"
] | Proxy callback interface for invoking methods as actor messages
@param src sourceCallback
@param tClass callback class
@param <T> type of callback
@return proxy callback | [
"Proxy",
"callback",
"interface",
"for",
"invoking",
"methods",
"as",
"actor",
"messages"
] | fdb72fcfdd1c5e54a970f203a33a71fa54344217 | https://github.com/actorapp/droidkit-actors/blob/fdb72fcfdd1c5e54a970f203a33a71fa54344217/actors/src/main/java/com/droidkit/actors/Actor.java#L318-L320 |
150,928 | actorapp/droidkit-actors | actors/src/main/java/com/droidkit/actors/ActorRef.java | ActorRef.sendOnce | public void sendOnce(Object message, long delay, ActorRef sender) {
dispatcher.sendMessageOnce(endpoint, message, ActorTime.currentTime() + delay, sender);
} | java | public void sendOnce(Object message, long delay, ActorRef sender) {
dispatcher.sendMessageOnce(endpoint, message, ActorTime.currentTime() + delay, sender);
} | [
"public",
"void",
"sendOnce",
"(",
"Object",
"message",
",",
"long",
"delay",
",",
"ActorRef",
"sender",
")",
"{",
"dispatcher",
".",
"sendMessageOnce",
"(",
"endpoint",
",",
"message",
",",
"ActorTime",
".",
"currentTime",
"(",
")",
"+",
"delay",
",",
"se... | Send message once
@param message message
@param delay delay
@param sender sender | [
"Send",
"message",
"once"
] | fdb72fcfdd1c5e54a970f203a33a71fa54344217 | https://github.com/actorapp/droidkit-actors/blob/fdb72fcfdd1c5e54a970f203a33a71fa54344217/actors/src/main/java/com/droidkit/actors/ActorRef.java#L125-L127 |
150,929 | OSSIndex/heuristic-version | src/main/java/net/ossindex/version/VersionFactory.java | VersionFactory.getVersion | public IVersion getVersion(String vstring) throws InvalidRangeException
{
IVersionRange range = getRange(vstring);
if (range == null) {
return null;
}
return range.getMinimum();
} | java | public IVersion getVersion(String vstring) throws InvalidRangeException
{
IVersionRange range = getRange(vstring);
if (range == null) {
return null;
}
return range.getMinimum();
} | [
"public",
"IVersion",
"getVersion",
"(",
"String",
"vstring",
")",
"throws",
"InvalidRangeException",
"{",
"IVersionRange",
"range",
"=",
"getRange",
"(",
"vstring",
")",
";",
"if",
"(",
"range",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
... | Get a version implementation. Return the best match for the provided string.
@param vstring A string version to be parsed
@return A version implementation | [
"Get",
"a",
"version",
"implementation",
".",
"Return",
"the",
"best",
"match",
"for",
"the",
"provided",
"string",
"."
] | 9fe33a49d74acec54ddb91de9a3c3cd2f98fba40 | https://github.com/OSSIndex/heuristic-version/blob/9fe33a49d74acec54ddb91de9a3c3cd2f98fba40/src/main/java/net/ossindex/version/VersionFactory.java#L106-L113 |
150,930 | OSSIndex/heuristic-version | src/main/java/net/ossindex/version/VersionFactory.java | VersionFactory.getRange | public IVersionRange getRange(String vstring) throws InvalidRangeException
{
if (vstring == null || vstring.isEmpty()) {
if (strict) {
throw new InvalidRangeException("Cannot have an empty version");
} else {
IVersion version = new NamedVersion("");
return new VersionSet(versio... | java | public IVersionRange getRange(String vstring) throws InvalidRangeException
{
if (vstring == null || vstring.isEmpty()) {
if (strict) {
throw new InvalidRangeException("Cannot have an empty version");
} else {
IVersion version = new NamedVersion("");
return new VersionSet(versio... | [
"public",
"IVersionRange",
"getRange",
"(",
"String",
"vstring",
")",
"throws",
"InvalidRangeException",
"{",
"if",
"(",
"vstring",
"==",
"null",
"||",
"vstring",
".",
"isEmpty",
"(",
")",
")",
"{",
"if",
"(",
"strict",
")",
"{",
"throw",
"new",
"InvalidRa... | Get a version range | [
"Get",
"a",
"version",
"range"
] | 9fe33a49d74acec54ddb91de9a3c3cd2f98fba40 | https://github.com/OSSIndex/heuristic-version/blob/9fe33a49d74acec54ddb91de9a3c3cd2f98fba40/src/main/java/net/ossindex/version/VersionFactory.java#L132-L194 |
150,931 | OSSIndex/heuristic-version | src/main/java/net/ossindex/version/VersionFactory.java | VersionFactory.merge | public IVersionRange merge(IVersionRange... ranges) {
if (ranges.length < 2) {
return ranges[0];
}
// Check the type of the first range
if (!(ranges[0] instanceof VersionRange)) {
if (!(ranges[0] instanceof OrRange)) {
throw new UnsupportedOperationException("Incorrect type for rang... | java | public IVersionRange merge(IVersionRange... ranges) {
if (ranges.length < 2) {
return ranges[0];
}
// Check the type of the first range
if (!(ranges[0] instanceof VersionRange)) {
if (!(ranges[0] instanceof OrRange)) {
throw new UnsupportedOperationException("Incorrect type for rang... | [
"public",
"IVersionRange",
"merge",
"(",
"IVersionRange",
"...",
"ranges",
")",
"{",
"if",
"(",
"ranges",
".",
"length",
"<",
"2",
")",
"{",
"return",
"ranges",
"[",
"0",
"]",
";",
"}",
"// Check the type of the first range",
"if",
"(",
"!",
"(",
"ranges",... | Given two "or" ranges or "simple" ranges, merge them together. We are
assuming that the ranges are provided in order for now.
For example:
>1.0.0 merged with (<2.0.0 | >3.0.0) will become (>1.0.0 <2.0.0 | >3.0.0) | [
"Given",
"two",
"or",
"ranges",
"or",
"simple",
"ranges",
"merge",
"them",
"together",
".",
"We",
"are",
"assuming",
"that",
"the",
"ranges",
"are",
"provided",
"in",
"order",
"for",
"now",
"."
] | 9fe33a49d74acec54ddb91de9a3c3cd2f98fba40 | https://github.com/OSSIndex/heuristic-version/blob/9fe33a49d74acec54ddb91de9a3c3cd2f98fba40/src/main/java/net/ossindex/version/VersionFactory.java#L242-L324 |
150,932 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/WaitingDataQueueSynchronizationPoint.java | WaitingDataQueueSynchronizationPoint.newDataReady | public void newDataReady(DataType data) {
ArrayList<Runnable> list;
synchronized (this) {
if (end) throw new IllegalStateException("method endOfData already called, method newDataReady is not allowed anymore");
waitingData.addLast(data);
list = listeners;
listeners = null;
}
if (list != null... | java | public void newDataReady(DataType data) {
ArrayList<Runnable> list;
synchronized (this) {
if (end) throw new IllegalStateException("method endOfData already called, method newDataReady is not allowed anymore");
waitingData.addLast(data);
list = listeners;
listeners = null;
}
if (list != null... | [
"public",
"void",
"newDataReady",
"(",
"DataType",
"data",
")",
"{",
"ArrayList",
"<",
"Runnable",
">",
"list",
";",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"end",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"method endOfData already called, m... | Queue a new data, which may unblock a thread waiting for it. | [
"Queue",
"a",
"new",
"data",
"which",
"may",
"unblock",
"a",
"thread",
"waiting",
"for",
"it",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/WaitingDataQueueSynchronizationPoint.java#L61-L76 |
150,933 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/WaitingDataQueueSynchronizationPoint.java | WaitingDataQueueSynchronizationPoint.endOfData | public void endOfData() {
ArrayList<Runnable> list = null;
synchronized (this) {
end = true;
if (waitingData.isEmpty()) {
list = listeners;
listeners = null;
}
}
if (list != null) {
for (Runnable listener : list) listener.run();
}
// notify after listeners
synchronized (th... | java | public void endOfData() {
ArrayList<Runnable> list = null;
synchronized (this) {
end = true;
if (waitingData.isEmpty()) {
list = listeners;
listeners = null;
}
}
if (list != null) {
for (Runnable listener : list) listener.run();
}
// notify after listeners
synchronized (th... | [
"public",
"void",
"endOfData",
"(",
")",
"{",
"ArrayList",
"<",
"Runnable",
">",
"list",
"=",
"null",
";",
"synchronized",
"(",
"this",
")",
"{",
"end",
"=",
"true",
";",
"if",
"(",
"waitingData",
".",
"isEmpty",
"(",
")",
")",
"{",
"list",
"=",
"l... | Signal that no more data will be queued, so any waiting thread can be unblocked. | [
"Signal",
"that",
"no",
"more",
"data",
"will",
"be",
"queued",
"so",
"any",
"waiting",
"thread",
"can",
"be",
"unblocked",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/synch/WaitingDataQueueSynchronizationPoint.java#L79-L95 |
150,934 | livetribe/livetribe-slp | core/src/main/java/org/livetribe/slp/settings/Key.java | Key.from | public static <S> Key<S> from(String key, Class<? extends S> valueClass)
{
return new Key<S>(key, valueClass);
} | java | public static <S> Key<S> from(String key, Class<? extends S> valueClass)
{
return new Key<S>(key, valueClass);
} | [
"public",
"static",
"<",
"S",
">",
"Key",
"<",
"S",
">",
"from",
"(",
"String",
"key",
",",
"Class",
"<",
"?",
"extends",
"S",
">",
"valueClass",
")",
"{",
"return",
"new",
"Key",
"<",
"S",
">",
"(",
"key",
",",
"valueClass",
")",
";",
"}"
] | Creates a new Key with the given key string and value class.
@param key the key string representing this Key
@param valueClass the class of the value associated with this Key
@return a new Key with the given key string and value class | [
"Creates",
"a",
"new",
"Key",
"with",
"the",
"given",
"key",
"string",
"and",
"value",
"class",
"."
] | 6cc13dbe81feab133fe3dd291ca081cbc6e1f591 | https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/core/src/main/java/org/livetribe/slp/settings/Key.java#L39-L42 |
150,935 | livetribe/livetribe-slp | core/src/main/java/org/livetribe/slp/settings/Key.java | Key.convert | public T convert(Object value)
{
T result = null;
if (value != null)
{
if (getValueClass().isInstance(value))
result = getValueClass().cast(value);
else
result = convertFromString(value.toString());
}
return result;
... | java | public T convert(Object value)
{
T result = null;
if (value != null)
{
if (getValueClass().isInstance(value))
result = getValueClass().cast(value);
else
result = convertFromString(value.toString());
}
return result;
... | [
"public",
"T",
"convert",
"(",
"Object",
"value",
")",
"{",
"T",
"result",
"=",
"null",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"if",
"(",
"getValueClass",
"(",
")",
".",
"isInstance",
"(",
"value",
")",
")",
"result",
"=",
"getValueClass",
... | Converts the given value object into an object of the value class specified by this Key.
@param value the value to convert
@return an object of the value class specified by this Key
@see #convertFromString(String) | [
"Converts",
"the",
"given",
"value",
"object",
"into",
"an",
"object",
"of",
"the",
"value",
"class",
"specified",
"by",
"this",
"Key",
"."
] | 6cc13dbe81feab133fe3dd291ca081cbc6e1f591 | https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/core/src/main/java/org/livetribe/slp/settings/Key.java#L82-L93 |
150,936 | actorapp/droidkit-actors | actors/src/main/java/com/droidkit/actors/mailbox/AbsActorDispatcher.java | AbsActorDispatcher.initDispatcher | protected void initDispatcher(AbstractDispatcher<Envelope, MailboxesQueue> dispatcher) {
if (this.dispatcher != null) {
throw new RuntimeException("Double dispatcher init");
}
this.dispatcher = dispatcher;
} | java | protected void initDispatcher(AbstractDispatcher<Envelope, MailboxesQueue> dispatcher) {
if (this.dispatcher != null) {
throw new RuntimeException("Double dispatcher init");
}
this.dispatcher = dispatcher;
} | [
"protected",
"void",
"initDispatcher",
"(",
"AbstractDispatcher",
"<",
"Envelope",
",",
"MailboxesQueue",
">",
"dispatcher",
")",
"{",
"if",
"(",
"this",
".",
"dispatcher",
"!=",
"null",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Double dispatcher init\... | Must be called in super constructor
@param dispatcher thread dispatcher | [
"Must",
"be",
"called",
"in",
"super",
"constructor"
] | fdb72fcfdd1c5e54a970f203a33a71fa54344217 | https://github.com/actorapp/droidkit-actors/blob/fdb72fcfdd1c5e54a970f203a33a71fa54344217/actors/src/main/java/com/droidkit/actors/mailbox/AbsActorDispatcher.java#L39-L44 |
150,937 | hawkular/hawkular-inventory | hawkular-inventory-api/src/main/java/org/hawkular/inventory/api/PathFragment.java | PathFragment.from | public static PathFragment[] from(Filter... filters) {
PathFragment[] ret = new PathFragment[filters.length];
Arrays.setAll(ret, (i) -> new PathFragment(filters[i]));
return ret;
} | java | public static PathFragment[] from(Filter... filters) {
PathFragment[] ret = new PathFragment[filters.length];
Arrays.setAll(ret, (i) -> new PathFragment(filters[i]));
return ret;
} | [
"public",
"static",
"PathFragment",
"[",
"]",
"from",
"(",
"Filter",
"...",
"filters",
")",
"{",
"PathFragment",
"[",
"]",
"ret",
"=",
"new",
"PathFragment",
"[",
"filters",
".",
"length",
"]",
";",
"Arrays",
".",
"setAll",
"(",
"ret",
",",
"(",
"i",
... | Constructs path fragments corresponding to the provided filters.
@param filters the filters to create path fragments from
@return the path fragments | [
"Constructs",
"path",
"fragments",
"corresponding",
"to",
"the",
"provided",
"filters",
"."
] | f56dc10323dca21777feb5b609a9e9cc70ffaf62 | https://github.com/hawkular/hawkular-inventory/blob/f56dc10323dca21777feb5b609a9e9cc70ffaf62/hawkular-inventory-api/src/main/java/org/hawkular/inventory/api/PathFragment.java#L38-L42 |
150,938 | livetribe/livetribe-slp | core/src/main/java/org/livetribe/slp/spi/msg/IdentifierExtension.java | IdentifierExtension.findFirst | public static IdentifierExtension findFirst(Collection<? extends Extension> extensions)
{
for (Extension extension : extensions)
{
if (IDENTIFIER_EXTENSION_ID == extension.getId()) return (IdentifierExtension)extension;
}
return null;
} | java | public static IdentifierExtension findFirst(Collection<? extends Extension> extensions)
{
for (Extension extension : extensions)
{
if (IDENTIFIER_EXTENSION_ID == extension.getId()) return (IdentifierExtension)extension;
}
return null;
} | [
"public",
"static",
"IdentifierExtension",
"findFirst",
"(",
"Collection",
"<",
"?",
"extends",
"Extension",
">",
"extensions",
")",
"{",
"for",
"(",
"Extension",
"extension",
":",
"extensions",
")",
"{",
"if",
"(",
"IDENTIFIER_EXTENSION_ID",
"==",
"extension",
... | Returns the first IdentifierExtension found in the given collection of extensions,
or null if no IdentifierExtensions exist in the given collection. | [
"Returns",
"the",
"first",
"IdentifierExtension",
"found",
"in",
"the",
"given",
"collection",
"of",
"extensions",
"or",
"null",
"if",
"no",
"IdentifierExtensions",
"exist",
"in",
"the",
"given",
"collection",
"."
] | 6cc13dbe81feab133fe3dd291ca081cbc6e1f591 | https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/core/src/main/java/org/livetribe/slp/spi/msg/IdentifierExtension.java#L182-L189 |
150,939 | livetribe/livetribe-slp | core/src/main/java/org/livetribe/slp/spi/msg/IdentifierExtension.java | IdentifierExtension.findAll | public static Collection<IdentifierExtension> findAll(Collection<? extends Extension> extensions)
{
List<IdentifierExtension> result = new ArrayList<IdentifierExtension>();
for (Extension extension : extensions)
{
if (IDENTIFIER_EXTENSION_ID == extension.getId()) result.add((Iden... | java | public static Collection<IdentifierExtension> findAll(Collection<? extends Extension> extensions)
{
List<IdentifierExtension> result = new ArrayList<IdentifierExtension>();
for (Extension extension : extensions)
{
if (IDENTIFIER_EXTENSION_ID == extension.getId()) result.add((Iden... | [
"public",
"static",
"Collection",
"<",
"IdentifierExtension",
">",
"findAll",
"(",
"Collection",
"<",
"?",
"extends",
"Extension",
">",
"extensions",
")",
"{",
"List",
"<",
"IdentifierExtension",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"IdentifierExtension",
... | Returns all IdentifierExtensions found in the given collection of extensions. | [
"Returns",
"all",
"IdentifierExtensions",
"found",
"in",
"the",
"given",
"collection",
"of",
"extensions",
"."
] | 6cc13dbe81feab133fe3dd291ca081cbc6e1f591 | https://github.com/livetribe/livetribe-slp/blob/6cc13dbe81feab133fe3dd291ca081cbc6e1f591/core/src/main/java/org/livetribe/slp/spi/msg/IdentifierExtension.java#L194-L202 |
150,940 | jtrfp/javamod | src/main/java/de/quippy/mp3/decoder/JavaLayerUtils.java | JavaLayerUtils.deserialize | static public Object deserialize(InputStream in, Class<?> cls)
throws IOException
{
if (cls==null)
throw new NullPointerException("cls");
Object obj = deserialize(in);
if (!cls.isInstance(obj))
{
throw new InvalidObjectException("type of deserialized instance not of required class.");
}
retur... | java | static public Object deserialize(InputStream in, Class<?> cls)
throws IOException
{
if (cls==null)
throw new NullPointerException("cls");
Object obj = deserialize(in);
if (!cls.isInstance(obj))
{
throw new InvalidObjectException("type of deserialized instance not of required class.");
}
retur... | [
"static",
"public",
"Object",
"deserialize",
"(",
"InputStream",
"in",
",",
"Class",
"<",
"?",
">",
"cls",
")",
"throws",
"IOException",
"{",
"if",
"(",
"cls",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"cls\"",
")",
";",
"Object",
... | Deserializes the object contained in the given input stream.
@param in The input stream to deserialize an object from.
@param cls The expected class of the deserialized object. | [
"Deserializes",
"the",
"object",
"contained",
"in",
"the",
"given",
"input",
"stream",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/mp3/decoder/JavaLayerUtils.java#L47-L60 |
150,941 | jtrfp/javamod | src/main/java/de/quippy/mp3/decoder/JavaLayerUtils.java | JavaLayerUtils.getResourceAsStream | static synchronized public InputStream getResourceAsStream(String name)
{
InputStream is = null;
if (hook!=null)
{
is = hook.getResourceAsStream(name);
}
else
{
Class<JavaLayerUtils> cls = JavaLayerUtils.class;
is = cls.getResourceAsStream(name);
}
return is;
} | java | static synchronized public InputStream getResourceAsStream(String name)
{
InputStream is = null;
if (hook!=null)
{
is = hook.getResourceAsStream(name);
}
else
{
Class<JavaLayerUtils> cls = JavaLayerUtils.class;
is = cls.getResourceAsStream(name);
}
return is;
} | [
"static",
"synchronized",
"public",
"InputStream",
"getResourceAsStream",
"(",
"String",
"name",
")",
"{",
"InputStream",
"is",
"=",
"null",
";",
"if",
"(",
"hook",
"!=",
"null",
")",
"{",
"is",
"=",
"hook",
".",
"getResourceAsStream",
"(",
"name",
")",
";... | Retrieves an InputStream for a named resource.
@param name The name of the resource. This must be a simple
name, and not a qualified package name.
@return The InputStream for the named resource, or null if
the resource has not been found. If a hook has been
provided, its getResourceAsStream() method is called
to ret... | [
"Retrieves",
"an",
"InputStream",
"for",
"a",
"named",
"resource",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/mp3/decoder/JavaLayerUtils.java#L191-L206 |
150,942 | jtgeiger/iptools | src/main/java/com/sibilantsolutions/iptools/net/ReceiveQueue.java | ReceiveQueue.shutdownAndAwaitTermination | private void shutdownAndAwaitTermination( ExecutorService pool, int queueSize )
{
log.info( "Shutting down executor service; queue size={}.", queueSize );
pool.shutdown(); // Disable new tasks from being submitted
log.info( "Waiting for executor service to finish all queued tasks." );
... | java | private void shutdownAndAwaitTermination( ExecutorService pool, int queueSize )
{
log.info( "Shutting down executor service; queue size={}.", queueSize );
pool.shutdown(); // Disable new tasks from being submitted
log.info( "Waiting for executor service to finish all queued tasks." );
... | [
"private",
"void",
"shutdownAndAwaitTermination",
"(",
"ExecutorService",
"pool",
",",
"int",
"queueSize",
")",
"{",
"log",
".",
"info",
"(",
"\"Shutting down executor service; queue size={}.\"",
",",
"queueSize",
")",
";",
"pool",
".",
"shutdown",
"(",
")",
";",
... | Adapted from example in javadoc of ExecutorService. | [
"Adapted",
"from",
"example",
"in",
"javadoc",
"of",
"ExecutorService",
"."
] | 45059bdae220c273e40765438ff811691a34f976 | https://github.com/jtgeiger/iptools/blob/45059bdae220c273e40765438ff811691a34f976/src/main/java/com/sibilantsolutions/iptools/net/ReceiveQueue.java#L119-L167 |
150,943 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/io/IOAsInputStream.java | IOAsInputStream.get | public static InputStream get(IO.Readable io, boolean closeAsync) {
if (io instanceof IOFromInputStream)
return ((IOFromInputStream)io).getInputStream();
if (io instanceof IO.Readable.Buffered)
return new BufferedToInputStream((IO.Readable.Buffered)io, closeAsync);
return new IOAsInputStream(io);
} | java | public static InputStream get(IO.Readable io, boolean closeAsync) {
if (io instanceof IOFromInputStream)
return ((IOFromInputStream)io).getInputStream();
if (io instanceof IO.Readable.Buffered)
return new BufferedToInputStream((IO.Readable.Buffered)io, closeAsync);
return new IOAsInputStream(io);
} | [
"public",
"static",
"InputStream",
"get",
"(",
"IO",
".",
"Readable",
"io",
",",
"boolean",
"closeAsync",
")",
"{",
"if",
"(",
"io",
"instanceof",
"IOFromInputStream",
")",
"return",
"(",
"(",
"IOFromInputStream",
")",
"io",
")",
".",
"getInputStream",
"(",
... | Get an instance for the given IO. | [
"Get",
"an",
"instance",
"for",
"the",
"given",
"IO",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/io/IOAsInputStream.java#L17-L23 |
150,944 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/io/buffering/BufferedReverseIOReading.java | BufferedReverseIOReading.readReverse | public int readReverse() throws IOException {
int b;
do {
canRead.block(0);
synchronized (this) {
if (error != null) throw error;
if (io == null) throw new IOException("IO closed");
// check if we reached the beginning of the file
if (bufferPosInFile == 0 && posInBuffer == minInBuffer)... | java | public int readReverse() throws IOException {
int b;
do {
canRead.block(0);
synchronized (this) {
if (error != null) throw error;
if (io == null) throw new IOException("IO closed");
// check if we reached the beginning of the file
if (bufferPosInFile == 0 && posInBuffer == minInBuffer)... | [
"public",
"int",
"readReverse",
"(",
")",
"throws",
"IOException",
"{",
"int",
"b",
";",
"do",
"{",
"canRead",
".",
"block",
"(",
"0",
")",
";",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"error",
"!=",
"null",
")",
"throw",
"error",
";",
"i... | Read a byte backward. | [
"Read",
"a",
"byte",
"backward",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/io/buffering/BufferedReverseIOReading.java#L114-L138 |
150,945 | icode/ameba-utils | src/main/java/ameba/captcha/audio/Sample.java | Sample.getSampleCount | public long getSampleCount() {
long total = (_audioInputStream.getFrameLength()
* getFormat().getFrameSize() * 8)
/ getFormat().getSampleSizeInBits();
return total / getFormat().getChannels();
} | java | public long getSampleCount() {
long total = (_audioInputStream.getFrameLength()
* getFormat().getFrameSize() * 8)
/ getFormat().getSampleSizeInBits();
return total / getFormat().getChannels();
} | [
"public",
"long",
"getSampleCount",
"(",
")",
"{",
"long",
"total",
"=",
"(",
"_audioInputStream",
".",
"getFrameLength",
"(",
")",
"*",
"getFormat",
"(",
")",
".",
"getFrameSize",
"(",
")",
"*",
"8",
")",
"/",
"getFormat",
"(",
")",
".",
"getSampleSizeI... | Return the number of samples of all channels
@return The number of samples for all channels | [
"Return",
"the",
"number",
"of",
"samples",
"of",
"all",
"channels"
] | 1aad5317a22e546c83dfe2dc0c80a1dc1fa0ea35 | https://github.com/icode/ameba-utils/blob/1aad5317a22e546c83dfe2dc0c80a1dc1fa0ea35/src/main/java/ameba/captcha/audio/Sample.java#L123-L128 |
150,946 | icode/ameba-utils | src/main/java/ameba/captcha/audio/Sample.java | Sample.getChannelSamples | public void getChannelSamples(int channel, double[] interleavedSamples,
double[] channelSamples) {
int nbChannels = getFormat().getChannels();
for (int i = 0; i < channelSamples.length; i++) {
channelSamples[i] = interleavedSamples[nbChannels * i + channel];... | java | public void getChannelSamples(int channel, double[] interleavedSamples,
double[] channelSamples) {
int nbChannels = getFormat().getChannels();
for (int i = 0; i < channelSamples.length; i++) {
channelSamples[i] = interleavedSamples[nbChannels * i + channel];... | [
"public",
"void",
"getChannelSamples",
"(",
"int",
"channel",
",",
"double",
"[",
"]",
"interleavedSamples",
",",
"double",
"[",
"]",
"channelSamples",
")",
"{",
"int",
"nbChannels",
"=",
"getFormat",
"(",
")",
".",
"getChannels",
"(",
")",
";",
"for",
"("... | Extract samples of a particular channel from interleavedSamples and copy
them into channelSamples
@param channel channel
@param channelSamples channelSamples
@param interleavedSamples interleavedSamples
@param channelSamples channelSamples | [
"Extract",
"samples",
"of",
"a",
"particular",
"channel",
"from",
"interleavedSamples",
"and",
"copy",
"them",
"into",
"channelSamples"
] | 1aad5317a22e546c83dfe2dc0c80a1dc1fa0ea35 | https://github.com/icode/ameba-utils/blob/1aad5317a22e546c83dfe2dc0c80a1dc1fa0ea35/src/main/java/ameba/captcha/audio/Sample.java#L188-L194 |
150,947 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java | RequirePluginVersions.removeUncheckedPlugins | public Collection<Plugin> removeUncheckedPlugins( Collection<String> uncheckedPlugins, Collection<Plugin> plugins )
throws MojoExecutionException
{
if ( uncheckedPlugins != null && !uncheckedPlugins.isEmpty() )
{
for ( String pluginKey : uncheckedPlugins )
{
... | java | public Collection<Plugin> removeUncheckedPlugins( Collection<String> uncheckedPlugins, Collection<Plugin> plugins )
throws MojoExecutionException
{
if ( uncheckedPlugins != null && !uncheckedPlugins.isEmpty() )
{
for ( String pluginKey : uncheckedPlugins )
{
... | [
"public",
"Collection",
"<",
"Plugin",
">",
"removeUncheckedPlugins",
"(",
"Collection",
"<",
"String",
">",
"uncheckedPlugins",
",",
"Collection",
"<",
"Plugin",
">",
"plugins",
")",
"throws",
"MojoExecutionException",
"{",
"if",
"(",
"uncheckedPlugins",
"!=",
"n... | Remove the plugins that the user doesn't want to check.
@param uncheckedPlugins
@param plugins
@throws MojoExecutionException
@return | [
"Remove",
"the",
"plugins",
"that",
"the",
"user",
"doesn",
"t",
"want",
"to",
"check",
"."
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L382-L394 |
150,948 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java | RequirePluginVersions.combineUncheckedPlugins | public Collection<String> combineUncheckedPlugins( Collection<String> uncheckedPlugins, String uncheckedPluginsList )
{
//if the comma list is empty, then there's nothing to do here.
if ( StringUtils.isNotEmpty( uncheckedPluginsList ) )
{
//make sure there is a collection to add ... | java | public Collection<String> combineUncheckedPlugins( Collection<String> uncheckedPlugins, String uncheckedPluginsList )
{
//if the comma list is empty, then there's nothing to do here.
if ( StringUtils.isNotEmpty( uncheckedPluginsList ) )
{
//make sure there is a collection to add ... | [
"public",
"Collection",
"<",
"String",
">",
"combineUncheckedPlugins",
"(",
"Collection",
"<",
"String",
">",
"uncheckedPlugins",
",",
"String",
"uncheckedPluginsList",
")",
"{",
"//if the comma list is empty, then there's nothing to do here.",
"if",
"(",
"StringUtils",
"."... | Combines the old Collection with the new comma separated list.
@param uncheckedPlugins
@param uncheckedPluginsList
@return | [
"Combines",
"the",
"old",
"Collection",
"with",
"the",
"new",
"comma",
"separated",
"list",
"."
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L402-L420 |
150,949 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java | RequirePluginVersions.addAdditionalPlugins | public Set<Plugin> addAdditionalPlugins( Set<Plugin> existing, List<String> additional )
throws MojoExecutionException
{
if ( additional != null )
{
for ( String pluginString : additional )
{
Plugin plugin = parsePluginString( pluginString, "Additional... | java | public Set<Plugin> addAdditionalPlugins( Set<Plugin> existing, List<String> additional )
throws MojoExecutionException
{
if ( additional != null )
{
for ( String pluginString : additional )
{
Plugin plugin = parsePluginString( pluginString, "Additional... | [
"public",
"Set",
"<",
"Plugin",
">",
"addAdditionalPlugins",
"(",
"Set",
"<",
"Plugin",
">",
"existing",
",",
"List",
"<",
"String",
">",
"additional",
")",
"throws",
"MojoExecutionException",
"{",
"if",
"(",
"additional",
"!=",
"null",
")",
"{",
"for",
"(... | Add the additional plugins if they don't exist yet.
@param existing the existing
@param additional the additional
@return the sets the
@throws MojoExecutionException the mojo execution exception | [
"Add",
"the",
"additional",
"plugins",
"if",
"they",
"don",
"t",
"exist",
"yet",
"."
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L430-L451 |
150,950 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java | RequirePluginVersions.parsePluginString | protected Plugin parsePluginString( String pluginString, String field )
throws MojoExecutionException
{
if ( pluginString != null )
{
String[] pluginStrings = pluginString.split( ":" );
if ( pluginStrings.length == 2 )
{
Plugin plugin = new... | java | protected Plugin parsePluginString( String pluginString, String field )
throws MojoExecutionException
{
if ( pluginString != null )
{
String[] pluginStrings = pluginString.split( ":" );
if ( pluginStrings.length == 2 )
{
Plugin plugin = new... | [
"protected",
"Plugin",
"parsePluginString",
"(",
"String",
"pluginString",
",",
"String",
"field",
")",
"throws",
"MojoExecutionException",
"{",
"if",
"(",
"pluginString",
"!=",
"null",
")",
"{",
"String",
"[",
"]",
"pluginStrings",
"=",
"pluginString",
".",
"sp... | Helper method to parse and inject a Plugin.
@param pluginString
@param field
@throws MojoExecutionException
@return the plugin | [
"Helper",
"method",
"to",
"parse",
"and",
"inject",
"a",
"Plugin",
"."
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L461-L485 |
150,951 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java | RequirePluginVersions.getProfilePlugins | public Set<Plugin> getProfilePlugins( MavenProject project )
{
Set<Plugin> result = new HashSet<Plugin>();
@SuppressWarnings( "unchecked" )
List<Profile> profiles = project.getActiveProfiles();
if ( profiles != null && !profiles.isEmpty() )
{
for ( Profile p : pro... | java | public Set<Plugin> getProfilePlugins( MavenProject project )
{
Set<Plugin> result = new HashSet<Plugin>();
@SuppressWarnings( "unchecked" )
List<Profile> profiles = project.getActiveProfiles();
if ( profiles != null && !profiles.isEmpty() )
{
for ( Profile p : pro... | [
"public",
"Set",
"<",
"Plugin",
">",
"getProfilePlugins",
"(",
"MavenProject",
"project",
")",
"{",
"Set",
"<",
"Plugin",
">",
"result",
"=",
"new",
"HashSet",
"<",
"Plugin",
">",
"(",
")",
";",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"List",
... | Finds the plugins that are listed in active profiles.
@param project the project
@return the profile plugins | [
"Finds",
"the",
"plugins",
"that",
"are",
"listed",
"in",
"active",
"profiles",
"."
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L493-L515 |
150,952 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java | RequirePluginVersions.findCurrentPlugin | protected Plugin findCurrentPlugin( Plugin plugin, MavenProject project )
{
Plugin found = null;
try
{
Model model = project.getModel();
@SuppressWarnings( "unchecked" )
Map<String, Plugin> plugins = model.getBuild().getPluginsAsMap();
found = ... | java | protected Plugin findCurrentPlugin( Plugin plugin, MavenProject project )
{
Plugin found = null;
try
{
Model model = project.getModel();
@SuppressWarnings( "unchecked" )
Map<String, Plugin> plugins = model.getBuild().getPluginsAsMap();
found = ... | [
"protected",
"Plugin",
"findCurrentPlugin",
"(",
"Plugin",
"plugin",
",",
"MavenProject",
"project",
")",
"{",
"Plugin",
"found",
"=",
"null",
";",
"try",
"{",
"Model",
"model",
"=",
"project",
".",
"getModel",
"(",
")",
";",
"@",
"SuppressWarnings",
"(",
... | Given a plugin, this will retrieve the matching plugin artifact from the model.
@param plugin plugin to lookup
@param project project to search
@return matching plugin, <code>null</code> if not found. | [
"Given",
"a",
"plugin",
"this",
"will",
"retrieve",
"the",
"matching",
"plugin",
"artifact",
"from",
"the",
"model",
"."
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L524-L545 |
150,953 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java | RequirePluginVersions.resolvePlugin | protected Plugin resolvePlugin( Plugin plugin, MavenProject project )
{
@SuppressWarnings( "unchecked" )
List<ArtifactRepository> pluginRepositories = project.getPluginArtifactRepositories();
Artifact artifact =
factory.createPluginArtifact( plugin.getGroupId(), plugin.getArtifa... | java | protected Plugin resolvePlugin( Plugin plugin, MavenProject project )
{
@SuppressWarnings( "unchecked" )
List<ArtifactRepository> pluginRepositories = project.getPluginArtifactRepositories();
Artifact artifact =
factory.createPluginArtifact( plugin.getGroupId(), plugin.getArtifa... | [
"protected",
"Plugin",
"resolvePlugin",
"(",
"Plugin",
"plugin",
",",
"MavenProject",
"project",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"List",
"<",
"ArtifactRepository",
">",
"pluginRepositories",
"=",
"project",
".",
"getPluginArtifactReposito... | Resolve plugin.
@param plugin the plugin
@param project the project
@return the plugin | [
"Resolve",
"plugin",
"."
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L554-L576 |
150,954 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java | RequirePluginVersions.getBoundPlugins | protected Set<Plugin> getBoundPlugins( LifecycleExecutor life, MavenProject project, String thePhases )
throws PluginNotFoundException, LifecycleExecutionException, IllegalAccessException
{
Set<Plugin> allPlugins = new HashSet<Plugin>();
// lookup the bindings for all the passed in phases
... | java | protected Set<Plugin> getBoundPlugins( LifecycleExecutor life, MavenProject project, String thePhases )
throws PluginNotFoundException, LifecycleExecutionException, IllegalAccessException
{
Set<Plugin> allPlugins = new HashSet<Plugin>();
// lookup the bindings for all the passed in phases
... | [
"protected",
"Set",
"<",
"Plugin",
">",
"getBoundPlugins",
"(",
"LifecycleExecutor",
"life",
",",
"MavenProject",
"project",
",",
"String",
"thePhases",
")",
"throws",
"PluginNotFoundException",
",",
"LifecycleExecutionException",
",",
"IllegalAccessException",
"{",
"Se... | Gets the plugins that are bound to the defined phases. This does not find plugins bound in the pom to a phase
later than the plugin is executing.
@param life the life
@param project the project
@param thePhases the the phases
@return the bound plugins
@throws PluginNotFoundException the plugin not found exception
@thr... | [
"Gets",
"the",
"plugins",
"that",
"are",
"bound",
"to",
"the",
"defined",
"phases",
".",
"This",
"does",
"not",
"find",
"plugins",
"bound",
"in",
"the",
"pom",
"to",
"a",
"phase",
"later",
"than",
"the",
"plugin",
"is",
"executing",
"."
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L590-L617 |
150,955 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java | RequirePluginVersions.hasValidVersionSpecified | protected boolean hasValidVersionSpecified( EnforcerRuleHelper helper, Plugin source, List<PluginWrapper> pluginWrappers )
{
boolean found = false;
boolean status = false;
for ( PluginWrapper plugin : pluginWrappers )
{
// find the matching plugin entry
if ( s... | java | protected boolean hasValidVersionSpecified( EnforcerRuleHelper helper, Plugin source, List<PluginWrapper> pluginWrappers )
{
boolean found = false;
boolean status = false;
for ( PluginWrapper plugin : pluginWrappers )
{
// find the matching plugin entry
if ( s... | [
"protected",
"boolean",
"hasValidVersionSpecified",
"(",
"EnforcerRuleHelper",
"helper",
",",
"Plugin",
"source",
",",
"List",
"<",
"PluginWrapper",
">",
"pluginWrappers",
")",
"{",
"boolean",
"found",
"=",
"false",
";",
"boolean",
"status",
"=",
"false",
";",
"... | Checks for valid version specified.
@param helper the helper
@param source the source
@param pluginWrappers the plugins
@return true, if successful | [
"Checks",
"for",
"valid",
"version",
"specified",
"."
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L631-L689 |
150,956 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java | RequirePluginVersions.isSnapshot | protected boolean isSnapshot( String baseVersion )
{
if ( banTimestamps )
{
return Artifact.VERSION_FILE_PATTERN.matcher( baseVersion ).matches()
|| baseVersion.endsWith( Artifact.SNAPSHOT_VERSION );
}
else
{
return baseVersion.endsWith... | java | protected boolean isSnapshot( String baseVersion )
{
if ( banTimestamps )
{
return Artifact.VERSION_FILE_PATTERN.matcher( baseVersion ).matches()
|| baseVersion.endsWith( Artifact.SNAPSHOT_VERSION );
}
else
{
return baseVersion.endsWith... | [
"protected",
"boolean",
"isSnapshot",
"(",
"String",
"baseVersion",
")",
"{",
"if",
"(",
"banTimestamps",
")",
"{",
"return",
"Artifact",
".",
"VERSION_FILE_PATTERN",
".",
"matcher",
"(",
"baseVersion",
")",
".",
"matches",
"(",
")",
"||",
"baseVersion",
".",
... | Checks if is snapshot.
@param baseVersion the base version
@return true, if is snapshot | [
"Checks",
"if",
"is",
"snapshot",
"."
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L697-L708 |
150,957 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java | RequirePluginVersions.getAllPlugins | @SuppressWarnings( "unchecked" )
private Set<Plugin> getAllPlugins( MavenProject project, Lifecycle lifecycle )
throws PluginNotFoundException, LifecycleExecutionException
{
log.debug( "RequirePluginVersions.getAllPlugins:" );
Set<Plugin> plugins = new HashSet<Plugin>();
// fir... | java | @SuppressWarnings( "unchecked" )
private Set<Plugin> getAllPlugins( MavenProject project, Lifecycle lifecycle )
throws PluginNotFoundException, LifecycleExecutionException
{
log.debug( "RequirePluginVersions.getAllPlugins:" );
Set<Plugin> plugins = new HashSet<Plugin>();
// fir... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"Set",
"<",
"Plugin",
">",
"getAllPlugins",
"(",
"MavenProject",
"project",
",",
"Lifecycle",
"lifecycle",
")",
"throws",
"PluginNotFoundException",
",",
"LifecycleExecutionException",
"{",
"log",
".",
"... | Gets the all plugins.
@param project the project
@param lifecycle the lifecycle
@return the all plugins
@throws PluginNotFoundException the plugin not found exception
@throws LifecycleExecutionException the lifecycle execution exception | [
"Gets",
"the",
"all",
"plugins",
"."
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L722-L772 |
150,958 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java | RequirePluginVersions.getPhaseToLifecycleMap | public Map<String, Lifecycle> getPhaseToLifecycleMap()
throws LifecycleExecutionException
{
if ( phaseToLifecycleMap == null )
{
phaseToLifecycleMap = new HashMap<String, Lifecycle>();
for ( Lifecycle lifecycle : lifecycles )
{
@SuppressWa... | java | public Map<String, Lifecycle> getPhaseToLifecycleMap()
throws LifecycleExecutionException
{
if ( phaseToLifecycleMap == null )
{
phaseToLifecycleMap = new HashMap<String, Lifecycle>();
for ( Lifecycle lifecycle : lifecycles )
{
@SuppressWa... | [
"public",
"Map",
"<",
"String",
",",
"Lifecycle",
">",
"getPhaseToLifecycleMap",
"(",
")",
"throws",
"LifecycleExecutionException",
"{",
"if",
"(",
"phaseToLifecycleMap",
"==",
"null",
")",
"{",
"phaseToLifecycleMap",
"=",
"new",
"HashMap",
"<",
"String",
",",
"... | Gets the phase to lifecycle map.
@return the phase to lifecycle map
@throws LifecycleExecutionException the lifecycle execution exception | [
"Gets",
"the",
"phase",
"to",
"lifecycle",
"map",
"."
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L784-L812 |
150,959 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java | RequirePluginVersions.getLifecycleForPhase | private Lifecycle getLifecycleForPhase( String phase )
throws BuildFailureException, LifecycleExecutionException
{
Lifecycle lifecycle = (Lifecycle) getPhaseToLifecycleMap().get( phase );
if ( lifecycle == null )
{
throw new BuildFailureException( "Unable to find lifecyc... | java | private Lifecycle getLifecycleForPhase( String phase )
throws BuildFailureException, LifecycleExecutionException
{
Lifecycle lifecycle = (Lifecycle) getPhaseToLifecycleMap().get( phase );
if ( lifecycle == null )
{
throw new BuildFailureException( "Unable to find lifecyc... | [
"private",
"Lifecycle",
"getLifecycleForPhase",
"(",
"String",
"phase",
")",
"throws",
"BuildFailureException",
",",
"LifecycleExecutionException",
"{",
"Lifecycle",
"lifecycle",
"=",
"(",
"Lifecycle",
")",
"getPhaseToLifecycleMap",
"(",
")",
".",
"get",
"(",
"phase",... | Gets the lifecycle for phase.
@param phase the phase
@return the lifecycle for phase
@throws BuildFailureException the build failure exception
@throws LifecycleExecutionException the lifecycle execution exception | [
"Gets",
"the",
"lifecycle",
"for",
"phase",
"."
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L822-L832 |
150,960 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java | RequirePluginVersions.findMappingsForLifecycle | private Map findMappingsForLifecycle( MavenProject project, Lifecycle lifecycle )
throws LifecycleExecutionException, PluginNotFoundException
{
String packaging = project.getPackaging();
Map mappings = null;
LifecycleMapping m =
(LifecycleMapping) findExtension( project,... | java | private Map findMappingsForLifecycle( MavenProject project, Lifecycle lifecycle )
throws LifecycleExecutionException, PluginNotFoundException
{
String packaging = project.getPackaging();
Map mappings = null;
LifecycleMapping m =
(LifecycleMapping) findExtension( project,... | [
"private",
"Map",
"findMappingsForLifecycle",
"(",
"MavenProject",
"project",
",",
"Lifecycle",
"lifecycle",
")",
"throws",
"LifecycleExecutionException",
",",
"PluginNotFoundException",
"{",
"String",
"packaging",
"=",
"project",
".",
"getPackaging",
"(",
")",
";",
"... | Find mappings for lifecycle.
@param project the project
@param lifecycle the lifecycle
@return the map
@throws LifecycleExecutionException the lifecycle execution exception
@throws PluginNotFoundException the plugin not found exception | [
"Find",
"mappings",
"for",
"lifecycle",
"."
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L843-L890 |
150,961 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java | RequirePluginVersions.findOptionalMojosForLifecycle | @SuppressWarnings( "unchecked" )
private List<String> findOptionalMojosForLifecycle( MavenProject project, Lifecycle lifecycle )
throws LifecycleExecutionException, PluginNotFoundException
{
String packaging = project.getPackaging();
List<String> optionalMojos = null;
LifecycleM... | java | @SuppressWarnings( "unchecked" )
private List<String> findOptionalMojosForLifecycle( MavenProject project, Lifecycle lifecycle )
throws LifecycleExecutionException, PluginNotFoundException
{
String packaging = project.getPackaging();
List<String> optionalMojos = null;
LifecycleM... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"List",
"<",
"String",
">",
"findOptionalMojosForLifecycle",
"(",
"MavenProject",
"project",
",",
"Lifecycle",
"lifecycle",
")",
"throws",
"LifecycleExecutionException",
",",
"PluginNotFoundException",
"{",
... | Find optional mojos for lifecycle.
@param project the project
@param lifecycle the lifecycle
@return the list
@throws LifecycleExecutionException the lifecycle execution exception
@throws PluginNotFoundException the plugin not found exception | [
"Find",
"optional",
"mojos",
"for",
"lifecycle",
"."
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L901-L937 |
150,962 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java | RequirePluginVersions.findExtension | private Object findExtension( MavenProject project, String role, String roleHint, Settings settings,
ArtifactRepository localRepository )
throws LifecycleExecutionException, PluginNotFoundException
{
Object pluginComponent = null;
@SuppressWarnings( "unchec... | java | private Object findExtension( MavenProject project, String role, String roleHint, Settings settings,
ArtifactRepository localRepository )
throws LifecycleExecutionException, PluginNotFoundException
{
Object pluginComponent = null;
@SuppressWarnings( "unchec... | [
"private",
"Object",
"findExtension",
"(",
"MavenProject",
"project",
",",
"String",
"role",
",",
"String",
"roleHint",
",",
"Settings",
"settings",
",",
"ArtifactRepository",
"localRepository",
")",
"throws",
"LifecycleExecutionException",
",",
"PluginNotFoundException",... | Find extension.
@param project the project
@param role the role
@param roleHint the role hint
@param settings the settings
@param localRepository the local repository
@return the object
@throws LifecycleExecutionException the lifecycle execution exception
@throws PluginNotFoundException the plugin not found exception | [
"Find",
"extension",
"."
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L951-L990 |
150,963 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java | RequirePluginVersions.verifyPlugin | private PluginDescriptor verifyPlugin( Plugin plugin, MavenProject project, Settings settings,
ArtifactRepository localRepository )
throws LifecycleExecutionException, PluginNotFoundException
{
PluginDescriptor pluginDescriptor;
try
{
... | java | private PluginDescriptor verifyPlugin( Plugin plugin, MavenProject project, Settings settings,
ArtifactRepository localRepository )
throws LifecycleExecutionException, PluginNotFoundException
{
PluginDescriptor pluginDescriptor;
try
{
... | [
"private",
"PluginDescriptor",
"verifyPlugin",
"(",
"Plugin",
"plugin",
",",
"MavenProject",
"project",
",",
"Settings",
"settings",
",",
"ArtifactRepository",
"localRepository",
")",
"throws",
"LifecycleExecutionException",
",",
"PluginNotFoundException",
"{",
"PluginDescr... | Verify plugin.
@param plugin the plugin
@param project the project
@param settings the settings
@param localRepository the local repository
@return the plugin descriptor
@throws LifecycleExecutionException the lifecycle execution exception
@throws PluginNotFoundException the plugin not found exception | [
"Verify",
"plugin",
"."
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L1003-L1042 |
150,964 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java | RequirePluginVersions.getAllPluginEntries | protected List<PluginWrapper> getAllPluginEntries( MavenProject project )
throws ArtifactResolutionException, ArtifactNotFoundException, IOException, XmlPullParserException
{
List<PluginWrapper> plugins = new ArrayList<PluginWrapper>();
// get all the pom models
String pomNa... | java | protected List<PluginWrapper> getAllPluginEntries( MavenProject project )
throws ArtifactResolutionException, ArtifactNotFoundException, IOException, XmlPullParserException
{
List<PluginWrapper> plugins = new ArrayList<PluginWrapper>();
// get all the pom models
String pomNa... | [
"protected",
"List",
"<",
"PluginWrapper",
">",
"getAllPluginEntries",
"(",
"MavenProject",
"project",
")",
"throws",
"ArtifactResolutionException",
",",
"ArtifactNotFoundException",
",",
"IOException",
",",
"XmlPullParserException",
"{",
"List",
"<",
"PluginWrapper",
">"... | Gets all plugin entries in build.plugins, build.pluginManagement.plugins, profile.build.plugins, reporting and
profile.reporting in this project and all parents
@param project the project
@return the all plugin entries wrapped in a PluginWrapper Object
@throws ArtifactResolutionException the artifact resolution except... | [
"Gets",
"all",
"plugin",
"entries",
"in",
"build",
".",
"plugins",
"build",
".",
"pluginManagement",
".",
"plugins",
"profile",
".",
"build",
".",
"plugins",
"reporting",
"and",
"profile",
".",
"reporting",
"in",
"this",
"project",
"and",
"all",
"parents"
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java#L1055-L1152 |
150,965 | vdmeer/skb-java-base | src/main/java/de/vandermeer/skb/base/info/AbstractDirectoryInfo.java | AbstractDirectoryInfo.init | protected void init(String directory, InfoLocationOptions option){
if(this.valOption()==null){
this.errors.addError("constructor(init) - no validation option set");
return;
}
try{
if(directory!=null){
switch(option){
case FILESYSTEM_ONLY:
if(this.tryFS(directory)==false){
if(this.t... | java | protected void init(String directory, InfoLocationOptions option){
if(this.valOption()==null){
this.errors.addError("constructor(init) - no validation option set");
return;
}
try{
if(directory!=null){
switch(option){
case FILESYSTEM_ONLY:
if(this.tryFS(directory)==false){
if(this.t... | [
"protected",
"void",
"init",
"(",
"String",
"directory",
",",
"InfoLocationOptions",
"option",
")",
"{",
"if",
"(",
"this",
".",
"valOption",
"(",
")",
"==",
"null",
")",
"{",
"this",
".",
"errors",
".",
"addError",
"(",
"\"constructor(init) - no validation op... | Initialize the directory info object with any parameters presented by the constructors.
@param directory a directory name
@param option an option on how to locate the directory | [
"Initialize",
"the",
"directory",
"info",
"object",
"with",
"any",
"parameters",
"presented",
"by",
"the",
"constructors",
"."
] | 6d845bcc482aa9344d016e80c0c3455aeae13a13 | https://github.com/vdmeer/skb-java-base/blob/6d845bcc482aa9344d016e80c0c3455aeae13a13/src/main/java/de/vandermeer/skb/base/info/AbstractDirectoryInfo.java#L112-L159 |
150,966 | vdmeer/skb-java-base | src/main/java/de/vandermeer/skb/base/info/AbstractDirectoryInfo.java | AbstractDirectoryInfo.tryFS | protected final boolean tryFS(String directory){
String path = directory;
File file = new File(path);
if(this.testDirectory(file)==true){
//found in file system
try{
this.url = file.toURI().toURL();
this.file = file;
this.fullDirectoryName = FilenameUtils.getPath(file.getAbsolutePath());
thi... | java | protected final boolean tryFS(String directory){
String path = directory;
File file = new File(path);
if(this.testDirectory(file)==true){
//found in file system
try{
this.url = file.toURI().toURL();
this.file = file;
this.fullDirectoryName = FilenameUtils.getPath(file.getAbsolutePath());
thi... | [
"protected",
"final",
"boolean",
"tryFS",
"(",
"String",
"directory",
")",
"{",
"String",
"path",
"=",
"directory",
";",
"File",
"file",
"=",
"new",
"File",
"(",
"path",
")",
";",
"if",
"(",
"this",
".",
"testDirectory",
"(",
"file",
")",
"==",
"true",... | Try to locate a directory in the file system.
@param directory the directory to locate
@return true if the directory was found, false otherwise | [
"Try",
"to",
"locate",
"a",
"directory",
"in",
"the",
"file",
"system",
"."
] | 6d845bcc482aa9344d016e80c0c3455aeae13a13 | https://github.com/vdmeer/skb-java-base/blob/6d845bcc482aa9344d016e80c0c3455aeae13a13/src/main/java/de/vandermeer/skb/base/info/AbstractDirectoryInfo.java#L166-L183 |
150,967 | vdmeer/skb-java-base | src/main/java/de/vandermeer/skb/base/info/AbstractDirectoryInfo.java | AbstractDirectoryInfo.tryCP | protected final boolean tryCP(String directory){
String[] cp = StringUtils.split(System.getProperty("java.class.path"), File.pathSeparatorChar);
for(String s : cp){
if(!StringUtils.endsWith(s, ".jar") && !StringUtils.startsWith(s, "/")){
String path = s + File.separator + directory;
File file = new File... | java | protected final boolean tryCP(String directory){
String[] cp = StringUtils.split(System.getProperty("java.class.path"), File.pathSeparatorChar);
for(String s : cp){
if(!StringUtils.endsWith(s, ".jar") && !StringUtils.startsWith(s, "/")){
String path = s + File.separator + directory;
File file = new File... | [
"protected",
"final",
"boolean",
"tryCP",
"(",
"String",
"directory",
")",
"{",
"String",
"[",
"]",
"cp",
"=",
"StringUtils",
".",
"split",
"(",
"System",
".",
"getProperty",
"(",
"\"java.class.path\"",
")",
",",
"File",
".",
"pathSeparatorChar",
")",
";",
... | Try to locate a directory using any directory given in the class path as set-root.
@param directory the directory to locate
@return true if the directory was found, false otherwise | [
"Try",
"to",
"locate",
"a",
"directory",
"using",
"any",
"directory",
"given",
"in",
"the",
"class",
"path",
"as",
"set",
"-",
"root",
"."
] | 6d845bcc482aa9344d016e80c0c3455aeae13a13 | https://github.com/vdmeer/skb-java-base/blob/6d845bcc482aa9344d016e80c0c3455aeae13a13/src/main/java/de/vandermeer/skb/base/info/AbstractDirectoryInfo.java#L190-L213 |
150,968 | jpaoletti/java-presentation-manager | modules/jpm-core/src/main/java/jpaoletti/jpm/core/Operations.java | Operations.getOperation | public Operation getOperation(String id) {
for (Iterator<Operation> it = operations.iterator(); it.hasNext();) {
Operation oper = it.next();
if (oper.getId().compareTo(id) == 0) {
return oper;
}
}
return null;
} | java | public Operation getOperation(String id) {
for (Iterator<Operation> it = operations.iterator(); it.hasNext();) {
Operation oper = it.next();
if (oper.getId().compareTo(id) == 0) {
return oper;
}
}
return null;
} | [
"public",
"Operation",
"getOperation",
"(",
"String",
"id",
")",
"{",
"for",
"(",
"Iterator",
"<",
"Operation",
">",
"it",
"=",
"operations",
".",
"iterator",
"(",
")",
";",
"it",
".",
"hasNext",
"(",
")",
";",
")",
"{",
"Operation",
"oper",
"=",
"it... | Returns the operation of the given id or a new default operation. If no
operation was found, null is returned.
@param id The id
@return The operation | [
"Returns",
"the",
"operation",
"of",
"the",
"given",
"id",
"or",
"a",
"new",
"default",
"operation",
".",
"If",
"no",
"operation",
"was",
"found",
"null",
"is",
"returned",
"."
] | d5aab55638383695db244744b4bfe27c5200e04f | https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/core/Operations.java#L28-L36 |
150,969 | jpaoletti/java-presentation-manager | modules/jpm-core/src/main/java/jpaoletti/jpm/core/Operations.java | Operations.getOperationsFor | public Operations getOperationsFor(final PMContext ctx, Object instance, Operation operation) throws PMException {
final Operations result = new Operations();
final List<Operation> r = new ArrayList<Operation>();
if (operation != null) {
for (Operation op : getOperations()) {
... | java | public Operations getOperationsFor(final PMContext ctx, Object instance, Operation operation) throws PMException {
final Operations result = new Operations();
final List<Operation> r = new ArrayList<Operation>();
if (operation != null) {
for (Operation op : getOperations()) {
... | [
"public",
"Operations",
"getOperationsFor",
"(",
"final",
"PMContext",
"ctx",
",",
"Object",
"instance",
",",
"Operation",
"operation",
")",
"throws",
"PMException",
"{",
"final",
"Operations",
"result",
"=",
"new",
"Operations",
"(",
")",
";",
"final",
"List",
... | Returns the Operations for a given operation. That is the operations that
are different to the given one, enabled and visible in it.
@param operation The operation
@return The operations | [
"Returns",
"the",
"Operations",
"for",
"a",
"given",
"operation",
".",
"That",
"is",
"the",
"operations",
"that",
"are",
"different",
"to",
"the",
"given",
"one",
"enabled",
"and",
"visible",
"in",
"it",
"."
] | d5aab55638383695db244744b4bfe27c5200e04f | https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/core/Operations.java#L45-L61 |
150,970 | jpaoletti/java-presentation-manager | modules/jpm-core/src/main/java/jpaoletti/jpm/core/Operations.java | Operations.getOperationsForScope | public Operations getOperationsForScope(OperationScope... scopes) {
final Operations result = new Operations();
final List<Operation> r = new ArrayList<Operation>();
if (getOperations() != null) {
for (Operation op : getOperations()) {
if (op.getScope() != null) ... | java | public Operations getOperationsForScope(OperationScope... scopes) {
final Operations result = new Operations();
final List<Operation> r = new ArrayList<Operation>();
if (getOperations() != null) {
for (Operation op : getOperations()) {
if (op.getScope() != null) ... | [
"public",
"Operations",
"getOperationsForScope",
"(",
"OperationScope",
"...",
"scopes",
")",
"{",
"final",
"Operations",
"result",
"=",
"new",
"Operations",
"(",
")",
";",
"final",
"List",
"<",
"Operation",
">",
"r",
"=",
"new",
"ArrayList",
"<",
"Operation",... | Returns an Operations object for the given scope
@param scopes The scopes
@return The Operations | [
"Returns",
"an",
"Operations",
"object",
"for",
"the",
"given",
"scope"
] | d5aab55638383695db244744b4bfe27c5200e04f | https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/core/Operations.java#L77-L96 |
150,971 | ksclarke/solr-iso639-filter | src/main/java/info/freelibrary/solr/ISO639ConversionFilter.java | ISO639ConversionFilter.incrementToken | @Override
public boolean incrementToken() throws IOException {
if (!input.incrementToken()) {
return false;
}
final String t = myTermAttribute.toString();
if (t != null && t.length() != 0) {
try {
myTermAttribute.setEmpty().append(ISO639Conve... | java | @Override
public boolean incrementToken() throws IOException {
if (!input.incrementToken()) {
return false;
}
final String t = myTermAttribute.toString();
if (t != null && t.length() != 0) {
try {
myTermAttribute.setEmpty().append(ISO639Conve... | [
"@",
"Override",
"public",
"boolean",
"incrementToken",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"input",
".",
"incrementToken",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"final",
"String",
"t",
"=",
"myTermAttribute",
".",
"toString"... | Increments and processes tokens in the ISO-639 code stream.
@return True if a value is still available for processing in the token stream; otherwise, false | [
"Increments",
"and",
"processes",
"tokens",
"in",
"the",
"ISO",
"-",
"639",
"code",
"stream",
"."
] | edcb3d898cfc153b5d089949b4b6609e7e7f082d | https://github.com/ksclarke/solr-iso639-filter/blob/edcb3d898cfc153b5d089949b4b6609e7e7f082d/src/main/java/info/freelibrary/solr/ISO639ConversionFilter.java#L59-L78 |
150,972 | GerdHolz/TOVAL | src/de/invation/code/toval/misc/SetUtils.java | SetUtils.getPowerSet | public static <T> PowerSet<T> getPowerSet(Set<T> hashSet) {
Validate.notNull(hashSet);
if (hashSet.isEmpty())
throw new IllegalArgumentException("set size 0");
HashList<T> hashList = new HashList<>(hashSet);
PowerSet<T> result = new PowerSet<>(hashList.size());
for (int i = 0; i < Math.pow(2, hashLis... | java | public static <T> PowerSet<T> getPowerSet(Set<T> hashSet) {
Validate.notNull(hashSet);
if (hashSet.isEmpty())
throw new IllegalArgumentException("set size 0");
HashList<T> hashList = new HashList<>(hashSet);
PowerSet<T> result = new PowerSet<>(hashList.size());
for (int i = 0; i < Math.pow(2, hashLis... | [
"public",
"static",
"<",
"T",
">",
"PowerSet",
"<",
"T",
">",
"getPowerSet",
"(",
"Set",
"<",
"T",
">",
"hashSet",
")",
"{",
"Validate",
".",
"notNull",
"(",
"hashSet",
")",
";",
"if",
"(",
"hashSet",
".",
"isEmpty",
"(",
")",
")",
"throw",
"new",
... | Generates a new Powerset out of the given set.
@param <T>
Type of set elements
@param hashSet
Underlying set of elements
@return Powerset of <code>set</code> | [
"Generates",
"a",
"new",
"Powerset",
"out",
"of",
"the",
"given",
"set",
"."
] | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/misc/SetUtils.java#L101-L118 |
150,973 | GerdHolz/TOVAL | src/de/invation/code/toval/misc/SetUtils.java | SetUtils.union | public static <T> Set<T> union(Collection<Set<T>> sets) {
Set<T> result = new HashSet<>();
if (sets.isEmpty()) {
return result;
}
Iterator<Set<T>> iter = sets.iterator();
result.addAll(iter.next());
if (sets.size() == 1) {
return result;
}
while (iter.hasNext()) {
result.addAll(i... | java | public static <T> Set<T> union(Collection<Set<T>> sets) {
Set<T> result = new HashSet<>();
if (sets.isEmpty()) {
return result;
}
Iterator<Set<T>> iter = sets.iterator();
result.addAll(iter.next());
if (sets.size() == 1) {
return result;
}
while (iter.hasNext()) {
result.addAll(i... | [
"public",
"static",
"<",
"T",
">",
"Set",
"<",
"T",
">",
"union",
"(",
"Collection",
"<",
"Set",
"<",
"T",
">",
">",
"sets",
")",
"{",
"Set",
"<",
"T",
">",
"result",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"if",
"(",
"sets",
".",
"isEmpt... | Determines the union of a collection of sets.
@param <T>
@param sets
Basic collection of sets.
@return The set of distinct elements of all given sets. | [
"Determines",
"the",
"union",
"of",
"a",
"collection",
"of",
"sets",
"."
] | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/misc/SetUtils.java#L207-L223 |
150,974 | GerdHolz/TOVAL | src/de/invation/code/toval/misc/SetUtils.java | SetUtils.existPairwiseIntersections | public static boolean existPairwiseIntersections(Collection<Set<String>> sets) {
// Determine all possible pairs of sets
List<List<Set<String>>> setPairs = ListUtils.getKElementaryLists(new ArrayList<Set<String>>(sets), 2);
for (Iterator<List<Set<String>>> iter = setPairs.iterator(); iter.hasNext();) {
Set... | java | public static boolean existPairwiseIntersections(Collection<Set<String>> sets) {
// Determine all possible pairs of sets
List<List<Set<String>>> setPairs = ListUtils.getKElementaryLists(new ArrayList<Set<String>>(sets), 2);
for (Iterator<List<Set<String>>> iter = setPairs.iterator(); iter.hasNext();) {
Set... | [
"public",
"static",
"boolean",
"existPairwiseIntersections",
"(",
"Collection",
"<",
"Set",
"<",
"String",
">",
">",
"sets",
")",
"{",
"// Determine all possible pairs of sets\r",
"List",
"<",
"List",
"<",
"Set",
"<",
"String",
">>>",
"setPairs",
"=",
"ListUtils",... | Checks if any two of the given sets intersect.
@param sets
Basic collection of sets.
@return <code>true</code> if there is an intersection between at least
two sets;<br>
<code>false</code> otherswise. | [
"Checks",
"if",
"any",
"two",
"of",
"the",
"given",
"sets",
"intersect",
"."
] | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/misc/SetUtils.java#L277-L287 |
150,975 | PureSolTechnologies/graphs | trees/src/main/java/com/puresoltechnologies/graphs/trees/RedBlackTree.java | RedBlackTree.put | private RedBlackTreeNode<Key, Value> put(RedBlackTreeNode<Key, Value> h, Key key, Value value) {
if (h == null)
return new RedBlackTreeNode<>(key, value, RED, 1);
int cmp = key.compareTo(h.getKey());
if (cmp < 0)
h.setLeft(put(h.getLeft(), key, value));
else if (cmp > 0)
h.setRight(put(h.getRight(),... | java | private RedBlackTreeNode<Key, Value> put(RedBlackTreeNode<Key, Value> h, Key key, Value value) {
if (h == null)
return new RedBlackTreeNode<>(key, value, RED, 1);
int cmp = key.compareTo(h.getKey());
if (cmp < 0)
h.setLeft(put(h.getLeft(), key, value));
else if (cmp > 0)
h.setRight(put(h.getRight(),... | [
"private",
"RedBlackTreeNode",
"<",
"Key",
",",
"Value",
">",
"put",
"(",
"RedBlackTreeNode",
"<",
"Key",
",",
"Value",
">",
"h",
",",
"Key",
"key",
",",
"Value",
"value",
")",
"{",
"if",
"(",
"h",
"==",
"null",
")",
"return",
"new",
"RedBlackTreeNode"... | insert the key-value pair in the subtree rooted at h | [
"insert",
"the",
"key",
"-",
"value",
"pair",
"in",
"the",
"subtree",
"rooted",
"at",
"h"
] | 35dbbd11ccaacbbc6321dcdcd4d31e9a1090d6f1 | https://github.com/PureSolTechnologies/graphs/blob/35dbbd11ccaacbbc6321dcdcd4d31e9a1090d6f1/trees/src/main/java/com/puresoltechnologies/graphs/trees/RedBlackTree.java#L80-L102 |
150,976 | PureSolTechnologies/graphs | trees/src/main/java/com/puresoltechnologies/graphs/trees/RedBlackTree.java | RedBlackTree.deleteMax | public void deleteMax() {
if (isEmpty())
throw new NoSuchElementException("BST underflow");
// if both children of root are black, set root to red
if (!isRed(root.getLeft()) && !isRed(root.getRight()))
root.setColor(RED);
root = deleteMax(root);
if (!isEmpty()) {
root.setParent(null);
root.se... | java | public void deleteMax() {
if (isEmpty())
throw new NoSuchElementException("BST underflow");
// if both children of root are black, set root to red
if (!isRed(root.getLeft()) && !isRed(root.getRight()))
root.setColor(RED);
root = deleteMax(root);
if (!isEmpty()) {
root.setParent(null);
root.se... | [
"public",
"void",
"deleteMax",
"(",
")",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"throw",
"new",
"NoSuchElementException",
"(",
"\"BST underflow\"",
")",
";",
"// if both children of root are black, set root to red",
"if",
"(",
"!",
"isRed",
"(",
"root",
".",
... | Removes the largest key and associated value from the symbol table.
@throws NoSuchElementException
if the symbol table is empty | [
"Removes",
"the",
"largest",
"key",
"and",
"associated",
"value",
"from",
"the",
"symbol",
"table",
"."
] | 35dbbd11ccaacbbc6321dcdcd4d31e9a1090d6f1 | https://github.com/PureSolTechnologies/graphs/blob/35dbbd11ccaacbbc6321dcdcd4d31e9a1090d6f1/trees/src/main/java/com/puresoltechnologies/graphs/trees/RedBlackTree.java#L148-L162 |
150,977 | PureSolTechnologies/graphs | trees/src/main/java/com/puresoltechnologies/graphs/trees/RedBlackTree.java | RedBlackTree.delete | private RedBlackTreeNode<Key, Value> delete(RedBlackTreeNode<Key, Value> h, Key key) {
// assert get(h, key) != null;
if (key.compareTo(h.getKey()) < 0) {
if (!isRed(h.getLeft()) && !isRed(h.getLeft().getLeft()))
h = moveRedLeft(h);
h.setLeft(delete(h.getLeft(), key));
} else {
if (isRed(h.getLeft(... | java | private RedBlackTreeNode<Key, Value> delete(RedBlackTreeNode<Key, Value> h, Key key) {
// assert get(h, key) != null;
if (key.compareTo(h.getKey()) < 0) {
if (!isRed(h.getLeft()) && !isRed(h.getLeft().getLeft()))
h = moveRedLeft(h);
h.setLeft(delete(h.getLeft(), key));
} else {
if (isRed(h.getLeft(... | [
"private",
"RedBlackTreeNode",
"<",
"Key",
",",
"Value",
">",
"delete",
"(",
"RedBlackTreeNode",
"<",
"Key",
",",
"Value",
">",
"h",
",",
"Key",
"key",
")",
"{",
"// assert get(h, key) != null;",
"if",
"(",
"key",
".",
"compareTo",
"(",
"h",
".",
"getKey",... | delete the key-value pair with the given key rooted at h | [
"delete",
"the",
"key",
"-",
"value",
"pair",
"with",
"the",
"given",
"key",
"rooted",
"at",
"h"
] | 35dbbd11ccaacbbc6321dcdcd4d31e9a1090d6f1 | https://github.com/PureSolTechnologies/graphs/blob/35dbbd11ccaacbbc6321dcdcd4d31e9a1090d6f1/trees/src/main/java/com/puresoltechnologies/graphs/trees/RedBlackTree.java#L208-L233 |
150,978 | PureSolTechnologies/graphs | trees/src/main/java/com/puresoltechnologies/graphs/trees/RedBlackTree.java | RedBlackTree.max | private RedBlackTreeNode<Key, Value> max(RedBlackTreeNode<Key, Value> x) {
// assert x != null;
if (x.getRight() == null)
return x;
else
return max(x.getRight());
} | java | private RedBlackTreeNode<Key, Value> max(RedBlackTreeNode<Key, Value> x) {
// assert x != null;
if (x.getRight() == null)
return x;
else
return max(x.getRight());
} | [
"private",
"RedBlackTreeNode",
"<",
"Key",
",",
"Value",
">",
"max",
"(",
"RedBlackTreeNode",
"<",
"Key",
",",
"Value",
">",
"x",
")",
"{",
"// assert x != null;",
"if",
"(",
"x",
".",
"getRight",
"(",
")",
"==",
"null",
")",
"return",
"x",
";",
"else"... | the largest key in the subtree rooted at x; null if no such key | [
"the",
"largest",
"key",
"in",
"the",
"subtree",
"rooted",
"at",
"x",
";",
"null",
"if",
"no",
"such",
"key"
] | 35dbbd11ccaacbbc6321dcdcd4d31e9a1090d6f1 | https://github.com/PureSolTechnologies/graphs/blob/35dbbd11ccaacbbc6321dcdcd4d31e9a1090d6f1/trees/src/main/java/com/puresoltechnologies/graphs/trees/RedBlackTree.java#L378-L384 |
150,979 | PureSolTechnologies/graphs | trees/src/main/java/com/puresoltechnologies/graphs/trees/RedBlackTree.java | RedBlackTree.select | public Key select(int k) {
if (k < 0 || k >= size(root))
throw new IllegalArgumentException();
RedBlackTreeNode<Key, Value> x = select(root, k);
return x.getKey();
} | java | public Key select(int k) {
if (k < 0 || k >= size(root))
throw new IllegalArgumentException();
RedBlackTreeNode<Key, Value> x = select(root, k);
return x.getKey();
} | [
"public",
"Key",
"select",
"(",
"int",
"k",
")",
"{",
"if",
"(",
"k",
"<",
"0",
"||",
"k",
">=",
"size",
"(",
"root",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"RedBlackTreeNode",
"<",
"Key",
",",
"Value",
">",
"x",
"=",
... | Return the kth smallest key in the symbol table.
@param k
the order statistic
@return the kth smallest key in the symbol table
@throws IllegalArgumentException
unless <code>k</code> is between 0 and
<em>N</em> − 1 | [
"Return",
"the",
"kth",
"smallest",
"key",
"in",
"the",
"symbol",
"table",
"."
] | 35dbbd11ccaacbbc6321dcdcd4d31e9a1090d6f1 | https://github.com/PureSolTechnologies/graphs/blob/35dbbd11ccaacbbc6321dcdcd4d31e9a1090d6f1/trees/src/main/java/com/puresoltechnologies/graphs/trees/RedBlackTree.java#L526-L531 |
150,980 | PureSolTechnologies/graphs | trees/src/main/java/com/puresoltechnologies/graphs/trees/RedBlackTree.java | RedBlackTree.select | private RedBlackTreeNode<Key, Value> select(RedBlackTreeNode<Key, Value> x, int k) {
// assert x != null;
// assert k >= 0 && k < size(x);
int t = size(x.getLeft());
if (t > k)
return select(x.getLeft(), k);
else if (t < k)
return select(x.getRight(), k - t - 1);
else
return x;
} | java | private RedBlackTreeNode<Key, Value> select(RedBlackTreeNode<Key, Value> x, int k) {
// assert x != null;
// assert k >= 0 && k < size(x);
int t = size(x.getLeft());
if (t > k)
return select(x.getLeft(), k);
else if (t < k)
return select(x.getRight(), k - t - 1);
else
return x;
} | [
"private",
"RedBlackTreeNode",
"<",
"Key",
",",
"Value",
">",
"select",
"(",
"RedBlackTreeNode",
"<",
"Key",
",",
"Value",
">",
"x",
",",
"int",
"k",
")",
"{",
"// assert x != null;",
"// assert k >= 0 && k < size(x);",
"int",
"t",
"=",
"size",
"(",
"x",
"."... | the key of rank k in the subtree rooted at x | [
"the",
"key",
"of",
"rank",
"k",
"in",
"the",
"subtree",
"rooted",
"at",
"x"
] | 35dbbd11ccaacbbc6321dcdcd4d31e9a1090d6f1 | https://github.com/PureSolTechnologies/graphs/blob/35dbbd11ccaacbbc6321dcdcd4d31e9a1090d6f1/trees/src/main/java/com/puresoltechnologies/graphs/trees/RedBlackTree.java#L534-L544 |
150,981 | PureSolTechnologies/graphs | trees/src/main/java/com/puresoltechnologies/graphs/trees/RedBlackTree.java | RedBlackTree.rank | private int rank(Key key, RedBlackTreeNode<Key, Value> x) {
if (x == null)
return 0;
int cmp = key.compareTo(x.getKey());
if (cmp < 0)
return rank(key, x.getLeft());
else if (cmp > 0)
return 1 + size(x.getLeft()) + rank(key, x.getRight());
else
return size(x.getLeft());
} | java | private int rank(Key key, RedBlackTreeNode<Key, Value> x) {
if (x == null)
return 0;
int cmp = key.compareTo(x.getKey());
if (cmp < 0)
return rank(key, x.getLeft());
else if (cmp > 0)
return 1 + size(x.getLeft()) + rank(key, x.getRight());
else
return size(x.getLeft());
} | [
"private",
"int",
"rank",
"(",
"Key",
"key",
",",
"RedBlackTreeNode",
"<",
"Key",
",",
"Value",
">",
"x",
")",
"{",
"if",
"(",
"x",
"==",
"null",
")",
"return",
"0",
";",
"int",
"cmp",
"=",
"key",
".",
"compareTo",
"(",
"x",
".",
"getKey",
"(",
... | number of keys less than key in the subtree rooted at x | [
"number",
"of",
"keys",
"less",
"than",
"key",
"in",
"the",
"subtree",
"rooted",
"at",
"x"
] | 35dbbd11ccaacbbc6321dcdcd4d31e9a1090d6f1 | https://github.com/PureSolTechnologies/graphs/blob/35dbbd11ccaacbbc6321dcdcd4d31e9a1090d6f1/trees/src/main/java/com/puresoltechnologies/graphs/trees/RedBlackTree.java#L560-L570 |
150,982 | PureSolTechnologies/graphs | trees/src/main/java/com/puresoltechnologies/graphs/trees/RedBlackTree.java | RedBlackTree.keys | private void keys(RedBlackTreeNode<Key, Value> x, Queue<Key> queue, Key lo, Key hi) {
if (x == null)
return;
int cmplo = lo.compareTo(x.getKey());
int cmphi = hi.compareTo(x.getKey());
if (cmplo < 0)
keys(x.getLeft(), queue, lo, hi);
if (cmplo <= 0 && cmphi >= 0)
queue.offer(x.getKey());
if (cmphi ... | java | private void keys(RedBlackTreeNode<Key, Value> x, Queue<Key> queue, Key lo, Key hi) {
if (x == null)
return;
int cmplo = lo.compareTo(x.getKey());
int cmphi = hi.compareTo(x.getKey());
if (cmplo < 0)
keys(x.getLeft(), queue, lo, hi);
if (cmplo <= 0 && cmphi >= 0)
queue.offer(x.getKey());
if (cmphi ... | [
"private",
"void",
"keys",
"(",
"RedBlackTreeNode",
"<",
"Key",
",",
"Value",
">",
"x",
",",
"Queue",
"<",
"Key",
">",
"queue",
",",
"Key",
"lo",
",",
"Key",
"hi",
")",
"{",
"if",
"(",
"x",
"==",
"null",
")",
"return",
";",
"int",
"cmplo",
"=",
... | to the queue | [
"to",
"the",
"queue"
] | 35dbbd11ccaacbbc6321dcdcd4d31e9a1090d6f1 | https://github.com/PureSolTechnologies/graphs/blob/35dbbd11ccaacbbc6321dcdcd4d31e9a1090d6f1/trees/src/main/java/com/puresoltechnologies/graphs/trees/RedBlackTree.java#L609-L620 |
150,983 | PureSolTechnologies/graphs | trees/src/main/java/com/puresoltechnologies/graphs/trees/RedBlackTree.java | RedBlackTree.size | public int size(Key low, Key high) {
if (low.compareTo(high) > 0)
return 0;
if (contains(high))
return rank(high) - rank(low) + 1;
else
return rank(high) - rank(low);
} | java | public int size(Key low, Key high) {
if (low.compareTo(high) > 0)
return 0;
if (contains(high))
return rank(high) - rank(low) + 1;
else
return rank(high) - rank(low);
} | [
"public",
"int",
"size",
"(",
"Key",
"low",
",",
"Key",
"high",
")",
"{",
"if",
"(",
"low",
".",
"compareTo",
"(",
"high",
")",
">",
"0",
")",
"return",
"0",
";",
"if",
"(",
"contains",
"(",
"high",
")",
")",
"return",
"rank",
"(",
"high",
")",... | Returns the number of keys in the symbol table in the given range.
@param low
is the lower border.
@param high
is the upper border.
@return the number of keys in the symbol table between <code>low</code>
(inclusive) and <code>high</code> (exclusive) | [
"Returns",
"the",
"number",
"of",
"keys",
"in",
"the",
"symbol",
"table",
"in",
"the",
"given",
"range",
"."
] | 35dbbd11ccaacbbc6321dcdcd4d31e9a1090d6f1 | https://github.com/PureSolTechnologies/graphs/blob/35dbbd11ccaacbbc6321dcdcd4d31e9a1090d6f1/trees/src/main/java/com/puresoltechnologies/graphs/trees/RedBlackTree.java#L632-L639 |
150,984 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/util/CompositeNamedObject.java | CompositeNamedObject.add | public void add(ILocalizableString name, Object object) {
objects.add(new Pair<>(name, object));
} | java | public void add(ILocalizableString name, Object object) {
objects.add(new Pair<>(name, object));
} | [
"public",
"void",
"add",
"(",
"ILocalizableString",
"name",
",",
"Object",
"object",
")",
"{",
"objects",
".",
"add",
"(",
"new",
"Pair",
"<>",
"(",
"name",
",",
"object",
")",
")",
";",
"}"
] | Add an object. | [
"Add",
"an",
"object",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/util/CompositeNamedObject.java#L13-L15 |
150,985 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/progress/MultiTaskProgress.java | MultiTaskProgress.doneOnSubTasksDone | public void doneOnSubTasksDone() {
if (jp != null) return;
synchronized (tasks) {
jp = new JoinPoint<>();
for (SubTask task : tasks) jp.addToJoinDoNotCancel(task.getProgress().getSynch());
}
jp.listenInline(new Runnable() {
@Override
public void run() {
if (jp.hasError()) error(jp.getEr... | java | public void doneOnSubTasksDone() {
if (jp != null) return;
synchronized (tasks) {
jp = new JoinPoint<>();
for (SubTask task : tasks) jp.addToJoinDoNotCancel(task.getProgress().getSynch());
}
jp.listenInline(new Runnable() {
@Override
public void run() {
if (jp.hasError()) error(jp.getEr... | [
"public",
"void",
"doneOnSubTasksDone",
"(",
")",
"{",
"if",
"(",
"jp",
"!=",
"null",
")",
"return",
";",
"synchronized",
"(",
"tasks",
")",
"{",
"jp",
"=",
"new",
"JoinPoint",
"<>",
"(",
")",
";",
"for",
"(",
"SubTask",
"task",
":",
"tasks",
")",
... | Automatically call the done or error method of this WorkProgress once all current sub-tasks are done. | [
"Automatically",
"call",
"the",
"done",
"or",
"error",
"method",
"of",
"this",
"WorkProgress",
"once",
"all",
"current",
"sub",
"-",
"tasks",
"are",
"done",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/progress/MultiTaskProgress.java#L60-L74 |
150,986 | rwl/CSparseJ | src/main/java/edu/emory/mathcs/csparsej/tdouble/Dcs_tdfs.java | Dcs_tdfs.cs_tdfs | public static int cs_tdfs(int j, int k, int[] head, int head_offset, int[] next, int next_offset, int[] post,
int post_offset, int[] stack, int stack_offset) {
int i, p, top = 0;
if (head == null || next == null || post == null || stack == null)
return (-1); /* check inputs *... | java | public static int cs_tdfs(int j, int k, int[] head, int head_offset, int[] next, int next_offset, int[] post,
int post_offset, int[] stack, int stack_offset) {
int i, p, top = 0;
if (head == null || next == null || post == null || stack == null)
return (-1); /* check inputs *... | [
"public",
"static",
"int",
"cs_tdfs",
"(",
"int",
"j",
",",
"int",
"k",
",",
"int",
"[",
"]",
"head",
",",
"int",
"head_offset",
",",
"int",
"[",
"]",
"next",
",",
"int",
"next_offset",
",",
"int",
"[",
"]",
"post",
",",
"int",
"post_offset",
",",
... | Depth-first search and postorder of a tree rooted at node j
@param j
postorder of a tree rooted at node j
@param k
number of nodes ordered so far
@param head
head[i] is first child of node i; -1 on output
@param head_offset
the index of the first element in array head
@param next
next[i] is next sibling of i or -1 if ... | [
"Depth",
"-",
"first",
"search",
"and",
"postorder",
"of",
"a",
"tree",
"rooted",
"at",
"node",
"j"
] | 6a6f66bccce1558156a961494358952603b0ac84 | https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tdouble/Dcs_tdfs.java#L60-L79 |
150,987 | GerdHolz/TOVAL | src/de/invation/code/toval/os/OSUtils.java | OSUtils.getExecutionPath | public static File getExecutionPath() throws OSException {
try {
return new File(OSUtils.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
} catch (URISyntaxException ex) {
throw new OSException(ex);
}
} | java | public static File getExecutionPath() throws OSException {
try {
return new File(OSUtils.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
} catch (URISyntaxException ex) {
throw new OSException(ex);
}
} | [
"public",
"static",
"File",
"getExecutionPath",
"(",
")",
"throws",
"OSException",
"{",
"try",
"{",
"return",
"new",
"File",
"(",
"OSUtils",
".",
"class",
".",
"getProtectionDomain",
"(",
")",
".",
"getCodeSource",
"(",
")",
".",
"getLocation",
"(",
")",
"... | Returns the execution path to the direcory of the current Java
application.
@return Execution path as {@link File}.
@throws OSException If the execution path can't be determined. | [
"Returns",
"the",
"execution",
"path",
"to",
"the",
"direcory",
"of",
"the",
"current",
"Java",
"application",
"."
] | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/os/OSUtils.java#L65-L71 |
150,988 | GerdHolz/TOVAL | src/de/invation/code/toval/os/OSUtils.java | OSUtils.runCommand | public void runCommand(String[] command, GenericHandler<BufferedReader> inputHandler, GenericHandler<BufferedReader> errorHandler) throws OSException {
Validate.notNull(command);
try {
Process p = Runtime.getRuntime().exec(command);
BufferedReader in = new BufferedReader(new Inp... | java | public void runCommand(String[] command, GenericHandler<BufferedReader> inputHandler, GenericHandler<BufferedReader> errorHandler) throws OSException {
Validate.notNull(command);
try {
Process p = Runtime.getRuntime().exec(command);
BufferedReader in = new BufferedReader(new Inp... | [
"public",
"void",
"runCommand",
"(",
"String",
"[",
"]",
"command",
",",
"GenericHandler",
"<",
"BufferedReader",
">",
"inputHandler",
",",
"GenericHandler",
"<",
"BufferedReader",
">",
"errorHandler",
")",
"throws",
"OSException",
"{",
"Validate",
".",
"notNull",... | Runs a command on the operating system.
@param command String array of command parts. The parts are concatenated
with spaces between the parts. The single command parts should not
contain whitespaces.
@param inputHandler {@link GenericHandler} to handle the process input
stream {@link BufferedReader}.
@param errorHand... | [
"Runs",
"a",
"command",
"on",
"the",
"operating",
"system",
"."
] | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/os/OSUtils.java#L170-L191 |
150,989 | GerdHolz/TOVAL | src/de/invation/code/toval/os/OSUtils.java | OSUtils.sanitizeFileExtension | protected static String sanitizeFileExtension(String fileTypeExtension) throws OSException {
// Remove whitespaces
String newFileTypeExtension = fileTypeExtension.replaceAll("\\s+", "");
// to lower case
newFileTypeExtension = newFileTypeExtension.toLowerCase();
/*
* C... | java | protected static String sanitizeFileExtension(String fileTypeExtension) throws OSException {
// Remove whitespaces
String newFileTypeExtension = fileTypeExtension.replaceAll("\\s+", "");
// to lower case
newFileTypeExtension = newFileTypeExtension.toLowerCase();
/*
* C... | [
"protected",
"static",
"String",
"sanitizeFileExtension",
"(",
"String",
"fileTypeExtension",
")",
"throws",
"OSException",
"{",
"// Remove whitespaces",
"String",
"newFileTypeExtension",
"=",
"fileTypeExtension",
".",
"replaceAll",
"(",
"\"\\\\s+\"",
",",
"\"\"",
")",
... | Sanitizes file extension such that it can be used in the Windows
Registry.
@param fileTypeExtension Extension to sanitize
@return Sanitized file extension
@throws OSException If the file extension is malformed | [
"Sanitizes",
"file",
"extension",
"such",
"that",
"it",
"can",
"be",
"used",
"in",
"the",
"Windows",
"Registry",
"."
] | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/os/OSUtils.java#L201-L219 |
150,990 | hawkular/hawkular-inventory | hawkular-inventory-api/src/main/java/org/hawkular/inventory/api/Configuration.java | Configuration.getProperty | public String getProperty(Property property, String defaultValue) {
String value = null;
List<String> systemProps = property.getSystemPropertyNames();
if (systemProps != null) {
for (String sp : systemProps) {
value = System.getProperty(sp);
if (valu... | java | public String getProperty(Property property, String defaultValue) {
String value = null;
List<String> systemProps = property.getSystemPropertyNames();
if (systemProps != null) {
for (String sp : systemProps) {
value = System.getProperty(sp);
if (valu... | [
"public",
"String",
"getProperty",
"(",
"Property",
"property",
",",
"String",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"null",
";",
"List",
"<",
"String",
">",
"systemProps",
"=",
"property",
".",
"getSystemPropertyNames",
"(",
")",
";",
"if",
"(",... | Returns the value of the property.
<p>If there is a system property with the name from {@link Property#getSystemPropertyNames()} ()}, then its value
is returned, otherwise if the property defines an environment variable and that env variable exists, then its
value is returned otherwise the value of a property with a n... | [
"Returns",
"the",
"value",
"of",
"the",
"property",
"."
] | f56dc10323dca21777feb5b609a9e9cc70ffaf62 | https://github.com/hawkular/hawkular-inventory/blob/f56dc10323dca21777feb5b609a9e9cc70ffaf62/hawkular-inventory-api/src/main/java/org/hawkular/inventory/api/Configuration.java#L73-L105 |
150,991 | hawkular/hawkular-inventory | hawkular-inventory-api/src/main/java/org/hawkular/inventory/api/Configuration.java | Configuration.prefixedWith | public Configuration prefixedWith(String... prefixes) {
if (prefixes == null || prefixes.length == 0) {
return this;
}
Map<String, String> filteredConfig = implementationConfiguration.entrySet().stream()
.filter(e -> Arrays.stream(prefixes).anyMatch(p -> e.getKey()
... | java | public Configuration prefixedWith(String... prefixes) {
if (prefixes == null || prefixes.length == 0) {
return this;
}
Map<String, String> filteredConfig = implementationConfiguration.entrySet().stream()
.filter(e -> Arrays.stream(prefixes).anyMatch(p -> e.getKey()
... | [
"public",
"Configuration",
"prefixedWith",
"(",
"String",
"...",
"prefixes",
")",
"{",
"if",
"(",
"prefixes",
"==",
"null",
"||",
"prefixes",
".",
"length",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"Map",
"<",
"String",
",",
"String",
">",
"fil... | Filters out all the configuration entries whose keys don't start with any of the white-listed prefixes
@param prefixes
@return | [
"Filters",
"out",
"all",
"the",
"configuration",
"entries",
"whose",
"keys",
"don",
"t",
"start",
"with",
"any",
"of",
"the",
"white",
"-",
"listed",
"prefixes"
] | f56dc10323dca21777feb5b609a9e9cc70ffaf62 | https://github.com/hawkular/hawkular-inventory/blob/f56dc10323dca21777feb5b609a9e9cc70ffaf62/hawkular-inventory-api/src/main/java/org/hawkular/inventory/api/Configuration.java#L121-L129 |
150,992 | hawkular/hawkular-inventory | hawkular-inventory-api/src/main/java/org/hawkular/inventory/api/Configuration.java | Configuration.getOverriddenImplementationConfiguration | private <T extends Property> Map<String, String> getOverriddenImplementationConfiguration(
Collection<T> overridableProperties) {
Map<String, String> ret = new HashMap<>();
overridableProperties.forEach(p -> {
String val = getProperty(p, null);
if (val != null) {
... | java | private <T extends Property> Map<String, String> getOverriddenImplementationConfiguration(
Collection<T> overridableProperties) {
Map<String, String> ret = new HashMap<>();
overridableProperties.forEach(p -> {
String val = getProperty(p, null);
if (val != null) {
... | [
"private",
"<",
"T",
"extends",
"Property",
">",
"Map",
"<",
"String",
",",
"String",
">",
"getOverriddenImplementationConfiguration",
"(",
"Collection",
"<",
"T",
">",
"overridableProperties",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"ret",
"=",
... | this hoop is needed so that we can type-check the "T" through the stream manipulations | [
"this",
"hoop",
"is",
"needed",
"so",
"that",
"we",
"can",
"type",
"-",
"check",
"the",
"T",
"through",
"the",
"stream",
"manipulations"
] | f56dc10323dca21777feb5b609a9e9cc70ffaf62 | https://github.com/hawkular/hawkular-inventory/blob/f56dc10323dca21777feb5b609a9e9cc70ffaf62/hawkular-inventory-api/src/main/java/org/hawkular/inventory/api/Configuration.java#L150-L165 |
150,993 | jtgeiger/iptools | src/main/java/com/sibilantsolutions/iptools/util/CertDuplicator.java | CertDuplicator.duplicate | static public X509Certificate duplicate( X509Certificate cert )
{
//log.info( "Duplicating cert={}.", cert );
X500Principal prince = cert.getSubjectX500Principal();
log.info( "Principal={}.", prince.getName() );
KeyPairGenerator kpg;
try
{
kpg = KeyPair... | java | static public X509Certificate duplicate( X509Certificate cert )
{
//log.info( "Duplicating cert={}.", cert );
X500Principal prince = cert.getSubjectX500Principal();
log.info( "Principal={}.", prince.getName() );
KeyPairGenerator kpg;
try
{
kpg = KeyPair... | [
"static",
"public",
"X509Certificate",
"duplicate",
"(",
"X509Certificate",
"cert",
")",
"{",
"//log.info( \"Duplicating cert={}.\", cert );",
"X500Principal",
"prince",
"=",
"cert",
".",
"getSubjectX500Principal",
"(",
")",
";",
"log",
".",
"info",
"(",
"\"Principal={}... | Create a self-signed certificate that duplicates as many of the given cert's fields as possible.
@param cert Source certificate
@return A self-signed X509Certificate certificate, not null | [
"Create",
"a",
"self",
"-",
"signed",
"certificate",
"that",
"duplicates",
"as",
"many",
"of",
"the",
"given",
"cert",
"s",
"fields",
"as",
"possible",
"."
] | 45059bdae220c273e40765438ff811691a34f976 | https://github.com/jtgeiger/iptools/blob/45059bdae220c273e40765438ff811691a34f976/src/main/java/com/sibilantsolutions/iptools/util/CertDuplicator.java#L45-L116 |
150,994 | jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mod/mixer/interpolation/CubicSpline.java | CubicSpline.initialize | private static void initialize()
{
double lFlen = 1.0f / (double)SPLINE_LUTLEN;
double lScale = (double)SPLINE_QUANTSCALE;
for(int i=0; i<SPLINE_LUTLEN; i++)
{
double lX = ((double)i)*lFlen;
int lIdx = i<<2;
double lCm1 = Math.floor(0.5 + lScale * (-0.5*lX*lX*lX + 1.0 * lX*lX - 0.5 * lX )... | java | private static void initialize()
{
double lFlen = 1.0f / (double)SPLINE_LUTLEN;
double lScale = (double)SPLINE_QUANTSCALE;
for(int i=0; i<SPLINE_LUTLEN; i++)
{
double lX = ((double)i)*lFlen;
int lIdx = i<<2;
double lCm1 = Math.floor(0.5 + lScale * (-0.5*lX*lX*lX + 1.0 * lX*lX - 0.5 * lX )... | [
"private",
"static",
"void",
"initialize",
"(",
")",
"{",
"double",
"lFlen",
"=",
"1.0f",
"/",
"(",
"double",
")",
"SPLINE_LUTLEN",
";",
"double",
"lScale",
"=",
"(",
"double",
")",
"SPLINE_QUANTSCALE",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
... | Init the static params
@since 15.06.2006 | [
"Init",
"the",
"static",
"params"
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mod/mixer/interpolation/CubicSpline.java#L103-L132 |
150,995 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/memory/ByteArrayCache.java | ByteArrayCache.free | public void free(byte[] array) {
int len = array.length;
synchronized (arraysBySize) {
if (totalSize + len > maxTotalSize) return;
Node<ArraysBySize> node = arraysBySize.get(len);
if (node == null) {
ArraysBySize arrays = new ArraysBySize();
arrays.arrays = new TurnArray<>(
len >= 128 * 1024 ?... | java | public void free(byte[] array) {
int len = array.length;
synchronized (arraysBySize) {
if (totalSize + len > maxTotalSize) return;
Node<ArraysBySize> node = arraysBySize.get(len);
if (node == null) {
ArraysBySize arrays = new ArraysBySize();
arrays.arrays = new TurnArray<>(
len >= 128 * 1024 ?... | [
"public",
"void",
"free",
"(",
"byte",
"[",
"]",
"array",
")",
"{",
"int",
"len",
"=",
"array",
".",
"length",
";",
"synchronized",
"(",
"arraysBySize",
")",
"{",
"if",
"(",
"totalSize",
"+",
"len",
">",
"maxTotalSize",
")",
"return",
";",
"Node",
"<... | Put an array in the cache. | [
"Put",
"an",
"array",
"in",
"the",
"cache",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/memory/ByteArrayCache.java#L82-L103 |
150,996 | khennig/lazy-datacontroller | lazy-datacontroller-impl/src/main/java/com/tri/ui/model/ListDataController.java | ListDataController.getIndexOf | int getIndexOf(final V value) {
Validate.notNull(value, "Value required");
Validate.validState(getSize() > 0, "No data");
return getData().indexOf(value);
} | java | int getIndexOf(final V value) {
Validate.notNull(value, "Value required");
Validate.validState(getSize() > 0, "No data");
return getData().indexOf(value);
} | [
"int",
"getIndexOf",
"(",
"final",
"V",
"value",
")",
"{",
"Validate",
".",
"notNull",
"(",
"value",
",",
"\"Value required\"",
")",
";",
"Validate",
".",
"validState",
"(",
"getSize",
"(",
")",
">",
"0",
",",
"\"No data\"",
")",
";",
"return",
"getData"... | Returns the index of the first occurrence of the specified value in this
controller, or -1 if this controller does not contain the value.
@param value
@return found index, or -1 if value was not found
@throws NullPointerException
if parameter value is null
@throws IllegalStateException
if there is no data available | [
"Returns",
"the",
"index",
"of",
"the",
"first",
"occurrence",
"of",
"the",
"specified",
"value",
"in",
"this",
"controller",
"or",
"-",
"1",
"if",
"this",
"controller",
"does",
"not",
"contain",
"the",
"value",
"."
] | a72a5fc6ced43d0e06fc839d68bd58cede10ab56 | https://github.com/khennig/lazy-datacontroller/blob/a72a5fc6ced43d0e06fc839d68bd58cede10ab56/lazy-datacontroller-impl/src/main/java/com/tri/ui/model/ListDataController.java#L202-L207 |
150,997 | khennig/lazy-datacontroller | lazy-datacontroller-impl/src/main/java/com/tri/ui/model/ListDataController.java | ListDataController.findChachedValueOf | public V findChachedValueOf(K key) {
// check selection
for (V value : selection) {
if (getKeyOf(value).equals(key)) {
return value;
}
}
// check data cache
for (V value : getData()) {
if (getKeyOf(value).equals(key)) {
return value;
}
}
return null;
} | java | public V findChachedValueOf(K key) {
// check selection
for (V value : selection) {
if (getKeyOf(value).equals(key)) {
return value;
}
}
// check data cache
for (V value : getData()) {
if (getKeyOf(value).equals(key)) {
return value;
}
}
return null;
} | [
"public",
"V",
"findChachedValueOf",
"(",
"K",
"key",
")",
"{",
"// check selection",
"for",
"(",
"V",
"value",
":",
"selection",
")",
"{",
"if",
"(",
"getKeyOf",
"(",
"value",
")",
".",
"equals",
"(",
"key",
")",
")",
"{",
"return",
"value",
";",
"}... | Find value in cached data.
@param key
@return found value or null if non was found | [
"Find",
"value",
"in",
"cached",
"data",
"."
] | a72a5fc6ced43d0e06fc839d68bd58cede10ab56 | https://github.com/khennig/lazy-datacontroller/blob/a72a5fc6ced43d0e06fc839d68bd58cede10ab56/lazy-datacontroller-impl/src/main/java/com/tri/ui/model/ListDataController.java#L234-L251 |
150,998 | khennig/lazy-datacontroller | lazy-datacontroller-impl/src/main/java/com/tri/ui/model/ListDataController.java | ListDataController.setSorting | public void setSorting(List<SortProperty> newSorting) {
Validate.notNull(newSorting, "Sorting required");
if (!sorting.equals(newSorting)) {
sorting.clear();
sorting.addAll(newSorting);
selectionIndex = -1;
clearCache();
}
} | java | public void setSorting(List<SortProperty> newSorting) {
Validate.notNull(newSorting, "Sorting required");
if (!sorting.equals(newSorting)) {
sorting.clear();
sorting.addAll(newSorting);
selectionIndex = -1;
clearCache();
}
} | [
"public",
"void",
"setSorting",
"(",
"List",
"<",
"SortProperty",
">",
"newSorting",
")",
"{",
"Validate",
".",
"notNull",
"(",
"newSorting",
",",
"\"Sorting required\"",
")",
";",
"if",
"(",
"!",
"sorting",
".",
"equals",
"(",
"newSorting",
")",
")",
"{",... | Sets sorting, does nothing if sorting will not change. Clears the cache
but does not notify observers for data changes.
@param newSorting
List of SortProperties, replacing | [
"Sets",
"sorting",
"does",
"nothing",
"if",
"sorting",
"will",
"not",
"change",
".",
"Clears",
"the",
"cache",
"but",
"does",
"not",
"notify",
"observers",
"for",
"data",
"changes",
"."
] | a72a5fc6ced43d0e06fc839d68bd58cede10ab56 | https://github.com/khennig/lazy-datacontroller/blob/a72a5fc6ced43d0e06fc839d68bd58cede10ab56/lazy-datacontroller-impl/src/main/java/com/tri/ui/model/ListDataController.java#L316-L325 |
150,999 | isisaddons-legacy/isis-module-publishmq | dom/jdo/src/main/java/org/isisaddons/module/publishmq/dom/jdo/events/PublishedEventRepository.java | PublishedEventRepository.findByTransactionIdAndSequence | @Programmatic
public PublishedEvent findByTransactionIdAndSequence(final UUID transactionId, final int sequence) {
return repositoryService.uniqueMatch(
new QueryDefault<>(PublishedEvent.class,
"findByTransactionIdAndSequence",
"transactionId",... | java | @Programmatic
public PublishedEvent findByTransactionIdAndSequence(final UUID transactionId, final int sequence) {
return repositoryService.uniqueMatch(
new QueryDefault<>(PublishedEvent.class,
"findByTransactionIdAndSequence",
"transactionId",... | [
"@",
"Programmatic",
"public",
"PublishedEvent",
"findByTransactionIdAndSequence",
"(",
"final",
"UUID",
"transactionId",
",",
"final",
"int",
"sequence",
")",
"{",
"return",
"repositoryService",
".",
"uniqueMatch",
"(",
"new",
"QueryDefault",
"<>",
"(",
"PublishedEve... | region > findByTransactionIdAndSequence | [
"region",
">",
"findByTransactionIdAndSequence"
] | b1a424f95b26a2a0369aac706c2e30074b7f6e43 | https://github.com/isisaddons-legacy/isis-module-publishmq/blob/b1a424f95b26a2a0369aac706c2e30074b7f6e43/dom/jdo/src/main/java/org/isisaddons/module/publishmq/dom/jdo/events/PublishedEventRepository.java#L61-L69 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.