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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
151,100 | jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mod/mixer/ProTrackerMixer.java | ProTrackerMixer.doPortaToNoteEffekt | private void doPortaToNoteEffekt(ChannelMemory aktMemo)
{
if (aktMemo.portaTargetNotePeriod<aktMemo.currentNotePeriod)
{
aktMemo.currentNotePeriod -= aktMemo.portaNoteStep;
if (aktMemo.currentNotePeriod<aktMemo.portaTargetNotePeriod)
aktMemo.currentNotePeriod=aktMemo.portaTargetNotePeriod;
}
else
{
aktMemo.currentNotePeriod += aktMemo.portaNoteStep;
if (aktMemo.currentNotePeriod>aktMemo.portaTargetNotePeriod)
aktMemo.currentNotePeriod=aktMemo.portaTargetNotePeriod;
}
setNewPlayerTuningFor(aktMemo);
} | java | private void doPortaToNoteEffekt(ChannelMemory aktMemo)
{
if (aktMemo.portaTargetNotePeriod<aktMemo.currentNotePeriod)
{
aktMemo.currentNotePeriod -= aktMemo.portaNoteStep;
if (aktMemo.currentNotePeriod<aktMemo.portaTargetNotePeriod)
aktMemo.currentNotePeriod=aktMemo.portaTargetNotePeriod;
}
else
{
aktMemo.currentNotePeriod += aktMemo.portaNoteStep;
if (aktMemo.currentNotePeriod>aktMemo.portaTargetNotePeriod)
aktMemo.currentNotePeriod=aktMemo.portaTargetNotePeriod;
}
setNewPlayerTuningFor(aktMemo);
} | [
"private",
"void",
"doPortaToNoteEffekt",
"(",
"ChannelMemory",
"aktMemo",
")",
"{",
"if",
"(",
"aktMemo",
".",
"portaTargetNotePeriod",
"<",
"aktMemo",
".",
"currentNotePeriod",
")",
"{",
"aktMemo",
".",
"currentNotePeriod",
"-=",
"aktMemo",
".",
"portaNoteStep",
... | Convenient Method for the Porta to note Effekt
@param aktMemo | [
"Convenient",
"Method",
"for",
"the",
"Porta",
"to",
"note",
"Effekt"
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mod/mixer/ProTrackerMixer.java#L442-L457 |
151,101 | jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mod/mixer/ProTrackerMixer.java | ProTrackerMixer.doVibratoEffekt | protected void doVibratoEffekt(ChannelMemory aktMemo)
{
int periodAdd;
switch (aktMemo.vibratoType & 0x03)
{
case 1: periodAdd = (Helpers.ModRampDownTable[aktMemo.vibratoTablePos]); // Sawtooth
break;
case 2: periodAdd = (Helpers.ModSquareTable [aktMemo.vibratoTablePos]); // Squarewave
break;
case 3: periodAdd = (Helpers.ModRandomTable [aktMemo.vibratoTablePos]); // Random.
break;
default:periodAdd = (Helpers.ModSinusTable [aktMemo.vibratoTablePos]); // Sinus
break;
}
periodAdd = ((periodAdd<<4)*aktMemo.vibratoAmplitude) >> 7;
setNewPlayerTuningFor(aktMemo, aktMemo.currentNotePeriod + periodAdd);
aktMemo.vibratoTablePos = (aktMemo.vibratoTablePos + aktMemo.vibratoStep) & 0x3F;
} | java | protected void doVibratoEffekt(ChannelMemory aktMemo)
{
int periodAdd;
switch (aktMemo.vibratoType & 0x03)
{
case 1: periodAdd = (Helpers.ModRampDownTable[aktMemo.vibratoTablePos]); // Sawtooth
break;
case 2: periodAdd = (Helpers.ModSquareTable [aktMemo.vibratoTablePos]); // Squarewave
break;
case 3: periodAdd = (Helpers.ModRandomTable [aktMemo.vibratoTablePos]); // Random.
break;
default:periodAdd = (Helpers.ModSinusTable [aktMemo.vibratoTablePos]); // Sinus
break;
}
periodAdd = ((periodAdd<<4)*aktMemo.vibratoAmplitude) >> 7;
setNewPlayerTuningFor(aktMemo, aktMemo.currentNotePeriod + periodAdd);
aktMemo.vibratoTablePos = (aktMemo.vibratoTablePos + aktMemo.vibratoStep) & 0x3F;
} | [
"protected",
"void",
"doVibratoEffekt",
"(",
"ChannelMemory",
"aktMemo",
")",
"{",
"int",
"periodAdd",
";",
"switch",
"(",
"aktMemo",
".",
"vibratoType",
"&",
"0x03",
")",
"{",
"case",
"1",
":",
"periodAdd",
"=",
"(",
"Helpers",
".",
"ModRampDownTable",
"[",... | Convenient Method for the vibrato effekt
@param aktMemo | [
"Convenient",
"Method",
"for",
"the",
"vibrato",
"effekt"
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mod/mixer/ProTrackerMixer.java#L462-L481 |
151,102 | jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mod/mixer/ProTrackerMixer.java | ProTrackerMixer.doTremoloEffekt | protected void doTremoloEffekt(ChannelMemory aktMemo)
{
int volumeAdd;
switch (aktMemo.tremoloType & 0x03)
{
case 1: volumeAdd = (Helpers.ModRampDownTable[aktMemo.tremoloTablePos]); // Sawtooth
break;
case 2: volumeAdd = (Helpers.ModSquareTable [aktMemo.tremoloTablePos]); // Squarewave
break;
case 3: volumeAdd = (Helpers.ModRandomTable [aktMemo.tremoloTablePos]); // Random.
break;
default:volumeAdd = (Helpers.ModSinusTable [aktMemo.tremoloTablePos]); // Sinus
break;
}
volumeAdd = (volumeAdd * aktMemo.tremoloAmplitude) >> 7;
aktMemo.currentVolume = aktMemo.currentSetVolume + volumeAdd;
aktMemo.tremoloTablePos = (aktMemo.tremoloTablePos + aktMemo.tremoloStep) & 0x3F;
} | java | protected void doTremoloEffekt(ChannelMemory aktMemo)
{
int volumeAdd;
switch (aktMemo.tremoloType & 0x03)
{
case 1: volumeAdd = (Helpers.ModRampDownTable[aktMemo.tremoloTablePos]); // Sawtooth
break;
case 2: volumeAdd = (Helpers.ModSquareTable [aktMemo.tremoloTablePos]); // Squarewave
break;
case 3: volumeAdd = (Helpers.ModRandomTable [aktMemo.tremoloTablePos]); // Random.
break;
default:volumeAdd = (Helpers.ModSinusTable [aktMemo.tremoloTablePos]); // Sinus
break;
}
volumeAdd = (volumeAdd * aktMemo.tremoloAmplitude) >> 7;
aktMemo.currentVolume = aktMemo.currentSetVolume + volumeAdd;
aktMemo.tremoloTablePos = (aktMemo.tremoloTablePos + aktMemo.tremoloStep) & 0x3F;
} | [
"protected",
"void",
"doTremoloEffekt",
"(",
"ChannelMemory",
"aktMemo",
")",
"{",
"int",
"volumeAdd",
";",
"switch",
"(",
"aktMemo",
".",
"tremoloType",
"&",
"0x03",
")",
"{",
"case",
"1",
":",
"volumeAdd",
"=",
"(",
"Helpers",
".",
"ModRampDownTable",
"[",... | Convenient Method for the tremolo effekt
@param aktMemo | [
"Convenient",
"Method",
"for",
"the",
"tremolo",
"effekt"
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mod/mixer/ProTrackerMixer.java#L486-L504 |
151,103 | jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mod/loader/instrument/Envelope.java | Envelope.updatePosition | public int updatePosition(int p, boolean keyOff)
{
p++;
if (loop && p>=position[loopEndPoint]) p=position[loopStartPoint];
if (sustain && p>=position[sustainEndPoint] && !keyOff) p=position[sustainStartPoint];
return p;
} | java | public int updatePosition(int p, boolean keyOff)
{
p++;
if (loop && p>=position[loopEndPoint]) p=position[loopStartPoint];
if (sustain && p>=position[sustainEndPoint] && !keyOff) p=position[sustainStartPoint];
return p;
} | [
"public",
"int",
"updatePosition",
"(",
"int",
"p",
",",
"boolean",
"keyOff",
")",
"{",
"p",
"++",
";",
"if",
"(",
"loop",
"&&",
"p",
">=",
"position",
"[",
"loopEndPoint",
"]",
")",
"p",
"=",
"position",
"[",
"loopStartPoint",
"]",
";",
"if",
"(",
... | Get the new position
@since 19.06.2006
@param p
@param keyOff
@return | [
"Get",
"the",
"new",
"position"
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mod/loader/instrument/Envelope.java#L57-L63 |
151,104 | jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mod/loader/instrument/Envelope.java | Envelope.getValueForPosition | public int getValueForPosition(int p)
{
int pt = nPoints - 1;
for (int i=0; i<pt; i++)
{
if (p <= position[i])
{
pt = i;
break;
}
}
int x2 = position[pt];
int x1, v;
if (p>=x2)
{
v = value[pt]<<SHIFT;
x1 = x2;
}
else
if (pt>0)
{
v = value[pt-1]<<SHIFT;
x1 = position[pt-1];
}
else
{
v = x1 = 0;
}
if (p>x2) p=x2;
if ((x2>x1) && (p>x1))
{
v += ((p - x1) * ((value[pt]<<SHIFT) - v)) / (x2 - x1);
}
if (v<0) v=0;
else
if (v>MAXVALUE) v = MAXVALUE;
return v;
} | java | public int getValueForPosition(int p)
{
int pt = nPoints - 1;
for (int i=0; i<pt; i++)
{
if (p <= position[i])
{
pt = i;
break;
}
}
int x2 = position[pt];
int x1, v;
if (p>=x2)
{
v = value[pt]<<SHIFT;
x1 = x2;
}
else
if (pt>0)
{
v = value[pt-1]<<SHIFT;
x1 = position[pt-1];
}
else
{
v = x1 = 0;
}
if (p>x2) p=x2;
if ((x2>x1) && (p>x1))
{
v += ((p - x1) * ((value[pt]<<SHIFT) - v)) / (x2 - x1);
}
if (v<0) v=0;
else
if (v>MAXVALUE) v = MAXVALUE;
return v;
} | [
"public",
"int",
"getValueForPosition",
"(",
"int",
"p",
")",
"{",
"int",
"pt",
"=",
"nPoints",
"-",
"1",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"pt",
";",
"i",
"++",
")",
"{",
"if",
"(",
"p",
"<=",
"position",
"[",
"i",
"]",
... | get the value at the position
Returns values between 0 and 512
@since 19.06.2006
@param p
@return | [
"get",
"the",
"value",
"at",
"the",
"position",
"Returns",
"values",
"between",
"0",
"and",
"512"
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mod/loader/instrument/Envelope.java#L71-L110 |
151,105 | jtrfp/javamod | src/main/java/de/quippy/javamod/multimedia/mod/loader/instrument/Envelope.java | Envelope.setXMType | public void setXMType(int flag)
{
on = (flag&0x01)!=0;
sustain = (flag&0x02)!=0;
loop = (flag&0x04)!=0;
carry = filter = false;
} | java | public void setXMType(int flag)
{
on = (flag&0x01)!=0;
sustain = (flag&0x02)!=0;
loop = (flag&0x04)!=0;
carry = filter = false;
} | [
"public",
"void",
"setXMType",
"(",
"int",
"flag",
")",
"{",
"on",
"=",
"(",
"flag",
"&",
"0x01",
")",
"!=",
"0",
";",
"sustain",
"=",
"(",
"flag",
"&",
"0x02",
")",
"!=",
"0",
";",
"loop",
"=",
"(",
"flag",
"&",
"0x04",
")",
"!=",
"0",
";",
... | Sets the boolean values corresponding to the flag value
XM-Version
@since 19.06.2006
@param flag | [
"Sets",
"the",
"boolean",
"values",
"corresponding",
"to",
"the",
"flag",
"value",
"XM",
"-",
"Version"
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/javamod/multimedia/mod/loader/instrument/Envelope.java#L117-L123 |
151,106 | jtrfp/javamod | src/main/java/de/quippy/mp3/decoder/Bitstream.java | Bitstream.loadID3v2 | private void loadID3v2(InputStream in)
{
int size = -1;
try
{
// Read ID3v2 header (10 bytes).
in.mark(10);
size = readID3v2Header(in);
header_pos = size;
}
catch (IOException e)
{}
finally
{
try
{
// Unread ID3v2 header (10 bytes).
in.reset();
}
catch (IOException e)
{}
}
// Load ID3v2 tags.
try
{
if (size > 0)
{
rawid3v2 = new byte[size];
in.read(rawid3v2,0,rawid3v2.length);
}
}
catch (IOException e)
{}
} | java | private void loadID3v2(InputStream in)
{
int size = -1;
try
{
// Read ID3v2 header (10 bytes).
in.mark(10);
size = readID3v2Header(in);
header_pos = size;
}
catch (IOException e)
{}
finally
{
try
{
// Unread ID3v2 header (10 bytes).
in.reset();
}
catch (IOException e)
{}
}
// Load ID3v2 tags.
try
{
if (size > 0)
{
rawid3v2 = new byte[size];
in.read(rawid3v2,0,rawid3v2.length);
}
}
catch (IOException e)
{}
} | [
"private",
"void",
"loadID3v2",
"(",
"InputStream",
"in",
")",
"{",
"int",
"size",
"=",
"-",
"1",
";",
"try",
"{",
"// Read ID3v2 header (10 bytes).",
"in",
".",
"mark",
"(",
"10",
")",
";",
"size",
"=",
"readID3v2Header",
"(",
"in",
")",
";",
"header_po... | Load ID3v2 frames.
@param in MP3 InputStream.
@author JavaZOOM | [
"Load",
"ID3v2",
"frames",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/mp3/decoder/Bitstream.java#L177-L210 |
151,107 | jtrfp/javamod | src/main/java/de/quippy/mp3/decoder/Bitstream.java | Bitstream.readID3v2Header | private int readID3v2Header(InputStream in) throws IOException
{
byte[] id3header = new byte[4];
int size = -10;
in.read(id3header,0,3);
// Look for ID3v2
if ( (id3header[0]=='I') && (id3header[1]=='D') && (id3header[2]=='3'))
{
in.read(id3header,0,3);
//int majorVersion = id3header[0];
//int revision = id3header[1];
in.read(id3header,0,4);
size = (int) (id3header[0] << 21) + (id3header[1] << 14) + (id3header[2] << 7) + (id3header[3]);
}
return (size+10);
} | java | private int readID3v2Header(InputStream in) throws IOException
{
byte[] id3header = new byte[4];
int size = -10;
in.read(id3header,0,3);
// Look for ID3v2
if ( (id3header[0]=='I') && (id3header[1]=='D') && (id3header[2]=='3'))
{
in.read(id3header,0,3);
//int majorVersion = id3header[0];
//int revision = id3header[1];
in.read(id3header,0,4);
size = (int) (id3header[0] << 21) + (id3header[1] << 14) + (id3header[2] << 7) + (id3header[3]);
}
return (size+10);
} | [
"private",
"int",
"readID3v2Header",
"(",
"InputStream",
"in",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"id3header",
"=",
"new",
"byte",
"[",
"4",
"]",
";",
"int",
"size",
"=",
"-",
"10",
";",
"in",
".",
"read",
"(",
"id3header",
",",
"0"... | Parse ID3v2 tag header to find out size of ID3v2 frames.
@param in MP3 InputStream
@return size of ID3v2 frames + header
@throws IOException
@author JavaZOOM | [
"Parse",
"ID3v2",
"tag",
"header",
"to",
"find",
"out",
"size",
"of",
"ID3v2",
"frames",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/mp3/decoder/Bitstream.java#L219-L234 |
151,108 | jtrfp/javamod | src/main/java/de/quippy/mp3/decoder/Bitstream.java | Bitstream.getRawID3v2 | public InputStream getRawID3v2()
{
if (rawid3v2 == null) return null;
else
{
ByteArrayInputStream bain = new ByteArrayInputStream(rawid3v2);
return bain;
}
} | java | public InputStream getRawID3v2()
{
if (rawid3v2 == null) return null;
else
{
ByteArrayInputStream bain = new ByteArrayInputStream(rawid3v2);
return bain;
}
} | [
"public",
"InputStream",
"getRawID3v2",
"(",
")",
"{",
"if",
"(",
"rawid3v2",
"==",
"null",
")",
"return",
"null",
";",
"else",
"{",
"ByteArrayInputStream",
"bain",
"=",
"new",
"ByteArrayInputStream",
"(",
"rawid3v2",
")",
";",
"return",
"bain",
";",
"}",
... | Return raw ID3v2 frames + header.
@return ID3v2 InputStream or null if ID3v2 frames are not available. | [
"Return",
"raw",
"ID3v2",
"frames",
"+",
"header",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/mp3/decoder/Bitstream.java#L240-L248 |
151,109 | jtrfp/javamod | src/main/java/de/quippy/mp3/decoder/Bitstream.java | Bitstream.readFrame | public Header readFrame() throws BitstreamException
{
Header result = null;
try
{
result = readNextFrame();
// E.B, Parse VBR (if any) first frame.
if (firstframe == true)
{
result.parseVBR(frame_bytes);
firstframe = false;
}
}
catch (BitstreamException ex)
{
if ((ex.getErrorCode()==INVALIDFRAME))
{
// Try to skip this frame.
//System.out.println("INVALIDFRAME");
try
{
closeFrame();
result = readNextFrame();
}
catch (BitstreamException e)
{
if ((e.getErrorCode()!=STREAM_EOF))
{
// wrap original exception so stack trace is maintained.
throw newBitstreamException(e.getErrorCode(), e);
}
}
}
else if ((ex.getErrorCode()!=STREAM_EOF))
{
// wrap original exception so stack trace is maintained.
throw newBitstreamException(ex.getErrorCode(), ex);
}
}
return result;
} | java | public Header readFrame() throws BitstreamException
{
Header result = null;
try
{
result = readNextFrame();
// E.B, Parse VBR (if any) first frame.
if (firstframe == true)
{
result.parseVBR(frame_bytes);
firstframe = false;
}
}
catch (BitstreamException ex)
{
if ((ex.getErrorCode()==INVALIDFRAME))
{
// Try to skip this frame.
//System.out.println("INVALIDFRAME");
try
{
closeFrame();
result = readNextFrame();
}
catch (BitstreamException e)
{
if ((e.getErrorCode()!=STREAM_EOF))
{
// wrap original exception so stack trace is maintained.
throw newBitstreamException(e.getErrorCode(), e);
}
}
}
else if ((ex.getErrorCode()!=STREAM_EOF))
{
// wrap original exception so stack trace is maintained.
throw newBitstreamException(ex.getErrorCode(), ex);
}
}
return result;
} | [
"public",
"Header",
"readFrame",
"(",
")",
"throws",
"BitstreamException",
"{",
"Header",
"result",
"=",
"null",
";",
"try",
"{",
"result",
"=",
"readNextFrame",
"(",
")",
";",
"// E.B, Parse VBR (if any) first frame.",
"if",
"(",
"firstframe",
"==",
"true",
")"... | Reads and parses the next frame from the input source.
@return the Header describing details of the frame read,
or null if the end of the stream has been reached. | [
"Reads",
"and",
"parses",
"the",
"next",
"frame",
"from",
"the",
"input",
"source",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/mp3/decoder/Bitstream.java#L271-L311 |
151,110 | jtrfp/javamod | src/main/java/de/quippy/mp3/decoder/Bitstream.java | Bitstream.isSyncCurrentPosition | public boolean isSyncCurrentPosition(int syncmode) throws BitstreamException
{
int read = readBytes(syncbuf, 0, 4);
int headerstring = ((syncbuf[0] << 24) & 0xFF000000) | ((syncbuf[1] << 16) & 0x00FF0000) | ((syncbuf[2] << 8) & 0x0000FF00) | ((syncbuf[3] << 0) & 0x000000FF);
try
{
source.unread(syncbuf, 0, read);
}
catch (IOException ex)
{
}
boolean sync = false;
switch (read)
{
case 0:
sync = true;
break;
case 4:
sync = isSyncMark(headerstring, syncmode, syncword);
break;
}
return sync;
} | java | public boolean isSyncCurrentPosition(int syncmode) throws BitstreamException
{
int read = readBytes(syncbuf, 0, 4);
int headerstring = ((syncbuf[0] << 24) & 0xFF000000) | ((syncbuf[1] << 16) & 0x00FF0000) | ((syncbuf[2] << 8) & 0x0000FF00) | ((syncbuf[3] << 0) & 0x000000FF);
try
{
source.unread(syncbuf, 0, read);
}
catch (IOException ex)
{
}
boolean sync = false;
switch (read)
{
case 0:
sync = true;
break;
case 4:
sync = isSyncMark(headerstring, syncmode, syncword);
break;
}
return sync;
} | [
"public",
"boolean",
"isSyncCurrentPosition",
"(",
"int",
"syncmode",
")",
"throws",
"BitstreamException",
"{",
"int",
"read",
"=",
"readBytes",
"(",
"syncbuf",
",",
"0",
",",
"4",
")",
";",
"int",
"headerstring",
"=",
"(",
"(",
"syncbuf",
"[",
"0",
"]",
... | Determines if the next 4 bytes of the stream represent a
frame header. | [
"Determines",
"if",
"the",
"next",
"4",
"bytes",
"of",
"the",
"stream",
"represent",
"a",
"frame",
"header",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/mp3/decoder/Bitstream.java#L372-L397 |
151,111 | jtrfp/javamod | src/main/java/de/quippy/mp3/decoder/Bitstream.java | Bitstream.syncHeader | int syncHeader(byte syncmode) throws BitstreamException
{
boolean sync;
int headerstring;
// read additional 2 bytes
int bytesRead = readBytes(syncbuf, 0, 3);
if (bytesRead!=3) throw newBitstreamException(STREAM_EOF, null);
headerstring = ((syncbuf[0] << 16) & 0x00FF0000) | ((syncbuf[1] << 8) & 0x0000FF00) | ((syncbuf[2] << 0) & 0x000000FF);
do
{
headerstring <<= 8;
if (readBytes(syncbuf, 3, 1)!=1)
throw newBitstreamException(STREAM_EOF, null);
headerstring |= (syncbuf[3] & 0x000000FF);
sync = isSyncMark(headerstring, syncmode, syncword);
}
while (!sync);
current_frame_number++;
if (last_frame_number < current_frame_number) last_frame_number = current_frame_number;
return headerstring;
} | java | int syncHeader(byte syncmode) throws BitstreamException
{
boolean sync;
int headerstring;
// read additional 2 bytes
int bytesRead = readBytes(syncbuf, 0, 3);
if (bytesRead!=3) throw newBitstreamException(STREAM_EOF, null);
headerstring = ((syncbuf[0] << 16) & 0x00FF0000) | ((syncbuf[1] << 8) & 0x0000FF00) | ((syncbuf[2] << 0) & 0x000000FF);
do
{
headerstring <<= 8;
if (readBytes(syncbuf, 3, 1)!=1)
throw newBitstreamException(STREAM_EOF, null);
headerstring |= (syncbuf[3] & 0x000000FF);
sync = isSyncMark(headerstring, syncmode, syncword);
}
while (!sync);
current_frame_number++;
if (last_frame_number < current_frame_number) last_frame_number = current_frame_number;
return headerstring;
} | [
"int",
"syncHeader",
"(",
"byte",
"syncmode",
")",
"throws",
"BitstreamException",
"{",
"boolean",
"sync",
";",
"int",
"headerstring",
";",
"// read additional 2 bytes",
"int",
"bytesRead",
"=",
"readBytes",
"(",
"syncbuf",
",",
"0",
",",
"3",
")",
";",
"if",
... | Get next 32 bits from bitstream.
They are stored in the headerstring.
syncmod allows Synchro flag ID
The returned value is False at the end of stream. | [
"Get",
"next",
"32",
"bits",
"from",
"bitstream",
".",
"They",
"are",
"stored",
"in",
"the",
"headerstring",
".",
"syncmod",
"allows",
"Synchro",
"flag",
"ID",
"The",
"returned",
"value",
"is",
"False",
"at",
"the",
"end",
"of",
"stream",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/mp3/decoder/Bitstream.java#L430-L458 |
151,112 | jtrfp/javamod | src/main/java/de/quippy/mp3/decoder/Bitstream.java | Bitstream.read_frame_data | int read_frame_data(int bytesize) throws BitstreamException
{
int numread = 0;
numread = readFully(frame_bytes, 0, bytesize);
framesize = bytesize;
wordpointer = -1;
bitindex = -1;
return numread;
} | java | int read_frame_data(int bytesize) throws BitstreamException
{
int numread = 0;
numread = readFully(frame_bytes, 0, bytesize);
framesize = bytesize;
wordpointer = -1;
bitindex = -1;
return numread;
} | [
"int",
"read_frame_data",
"(",
"int",
"bytesize",
")",
"throws",
"BitstreamException",
"{",
"int",
"numread",
"=",
"0",
";",
"numread",
"=",
"readFully",
"(",
"frame_bytes",
",",
"0",
",",
"bytesize",
")",
";",
"framesize",
"=",
"bytesize",
";",
"wordpointer... | Reads the data for the next frame. The frame is not parsed
until parse frame is called. | [
"Reads",
"the",
"data",
"for",
"the",
"next",
"frame",
".",
"The",
"frame",
"is",
"not",
"parsed",
"until",
"parse",
"frame",
"is",
"called",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/mp3/decoder/Bitstream.java#L492-L500 |
151,113 | jtrfp/javamod | src/main/java/de/quippy/mp3/decoder/Bitstream.java | Bitstream.readFully | private int readFully(byte[] b, int offs, int len)
throws BitstreamException
{
int nRead = 0;
try
{
while (len > 0)
{
int bytesread = source.read(b, offs, len);
if (bytesread == -1)
{
while (len-->0)
{
b[offs++] = 0;
}
break;
//throw newBitstreamException(UNEXPECTED_EOF, new EOFException());
}
nRead = nRead + bytesread;
offs += bytesread;
len -= bytesread;
}
}
catch (IOException ex)
{
throw newBitstreamException(STREAM_ERROR, ex);
}
return nRead;
} | java | private int readFully(byte[] b, int offs, int len)
throws BitstreamException
{
int nRead = 0;
try
{
while (len > 0)
{
int bytesread = source.read(b, offs, len);
if (bytesread == -1)
{
while (len-->0)
{
b[offs++] = 0;
}
break;
//throw newBitstreamException(UNEXPECTED_EOF, new EOFException());
}
nRead = nRead + bytesread;
offs += bytesread;
len -= bytesread;
}
}
catch (IOException ex)
{
throw newBitstreamException(STREAM_ERROR, ex);
}
return nRead;
} | [
"private",
"int",
"readFully",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"offs",
",",
"int",
"len",
")",
"throws",
"BitstreamException",
"{",
"int",
"nRead",
"=",
"0",
";",
"try",
"{",
"while",
"(",
"len",
">",
"0",
")",
"{",
"int",
"bytesread",
"=",... | Reads the exact number of bytes from the source
input stream into a byte array.
@param b The byte array to read the specified number
of bytes into.
@param offs The index in the array where the first byte
read should be stored.
@param len the number of bytes to read.
@exception BitstreamException is thrown if the specified
number of bytes could not be read from the stream. | [
"Reads",
"the",
"exact",
"number",
"of",
"bytes",
"from",
"the",
"source",
"input",
"stream",
"into",
"a",
"byte",
"array",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/mp3/decoder/Bitstream.java#L604-L632 |
151,114 | jtrfp/javamod | src/main/java/de/quippy/mp3/decoder/Bitstream.java | Bitstream.readBytes | private int readBytes(byte[] b, int offs, int len)
throws BitstreamException
{
int totalBytesRead = 0;
try
{
while (len > 0)
{
int bytesread = source.read(b, offs, len);
if (bytesread == -1)
{
break;
}
totalBytesRead += bytesread;
offs += bytesread;
len -= bytesread;
}
}
catch (IOException ex)
{
throw newBitstreamException(STREAM_ERROR, ex);
}
return totalBytesRead;
} | java | private int readBytes(byte[] b, int offs, int len)
throws BitstreamException
{
int totalBytesRead = 0;
try
{
while (len > 0)
{
int bytesread = source.read(b, offs, len);
if (bytesread == -1)
{
break;
}
totalBytesRead += bytesread;
offs += bytesread;
len -= bytesread;
}
}
catch (IOException ex)
{
throw newBitstreamException(STREAM_ERROR, ex);
}
return totalBytesRead;
} | [
"private",
"int",
"readBytes",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"offs",
",",
"int",
"len",
")",
"throws",
"BitstreamException",
"{",
"int",
"totalBytesRead",
"=",
"0",
";",
"try",
"{",
"while",
"(",
"len",
">",
"0",
")",
"{",
"int",
"bytesread... | Simlar to readFully, but doesn't throw exception when
EOF is reached. | [
"Simlar",
"to",
"readFully",
"but",
"doesn",
"t",
"throw",
"exception",
"when",
"EOF",
"is",
"reached",
"."
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/mp3/decoder/Bitstream.java#L638-L661 |
151,115 | oaqa/uima-ecd | src/main/java/edu/cmu/lti/oaqa/framework/types/ExperimentUUID.java | ExperimentUUID.getUuid | public String getUuid() {
if (ExperimentUUID_Type.featOkTst && ((ExperimentUUID_Type)jcasType).casFeat_uuid == null)
jcasType.jcas.throwFeatMissing("uuid", "edu.cmu.lti.oaqa.framework.types.ExperimentUUID");
return jcasType.ll_cas.ll_getStringValue(addr, ((ExperimentUUID_Type)jcasType).casFeatCode_uuid);} | java | public String getUuid() {
if (ExperimentUUID_Type.featOkTst && ((ExperimentUUID_Type)jcasType).casFeat_uuid == null)
jcasType.jcas.throwFeatMissing("uuid", "edu.cmu.lti.oaqa.framework.types.ExperimentUUID");
return jcasType.ll_cas.ll_getStringValue(addr, ((ExperimentUUID_Type)jcasType).casFeatCode_uuid);} | [
"public",
"String",
"getUuid",
"(",
")",
"{",
"if",
"(",
"ExperimentUUID_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"ExperimentUUID_Type",
")",
"jcasType",
")",
".",
"casFeat_uuid",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"u... | getter for uuid - gets
@generated | [
"getter",
"for",
"uuid",
"-",
"gets"
] | 09a0ae26647490b43affc36ab3a01100702b989f | https://github.com/oaqa/uima-ecd/blob/09a0ae26647490b43affc36ab3a01100702b989f/src/main/java/edu/cmu/lti/oaqa/framework/types/ExperimentUUID.java#L67-L70 |
151,116 | oaqa/uima-ecd | src/main/java/edu/cmu/lti/oaqa/framework/types/ExperimentUUID.java | ExperimentUUID.setUuid | public void setUuid(String v) {
if (ExperimentUUID_Type.featOkTst && ((ExperimentUUID_Type)jcasType).casFeat_uuid == null)
jcasType.jcas.throwFeatMissing("uuid", "edu.cmu.lti.oaqa.framework.types.ExperimentUUID");
jcasType.ll_cas.ll_setStringValue(addr, ((ExperimentUUID_Type)jcasType).casFeatCode_uuid, v);} | java | public void setUuid(String v) {
if (ExperimentUUID_Type.featOkTst && ((ExperimentUUID_Type)jcasType).casFeat_uuid == null)
jcasType.jcas.throwFeatMissing("uuid", "edu.cmu.lti.oaqa.framework.types.ExperimentUUID");
jcasType.ll_cas.ll_setStringValue(addr, ((ExperimentUUID_Type)jcasType).casFeatCode_uuid, v);} | [
"public",
"void",
"setUuid",
"(",
"String",
"v",
")",
"{",
"if",
"(",
"ExperimentUUID_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"ExperimentUUID_Type",
")",
"jcasType",
")",
".",
"casFeat_uuid",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissin... | setter for uuid - sets
@generated | [
"setter",
"for",
"uuid",
"-",
"sets"
] | 09a0ae26647490b43affc36ab3a01100702b989f | https://github.com/oaqa/uima-ecd/blob/09a0ae26647490b43affc36ab3a01100702b989f/src/main/java/edu/cmu/lti/oaqa/framework/types/ExperimentUUID.java#L74-L77 |
151,117 | oaqa/uima-ecd | src/main/java/edu/cmu/lti/oaqa/framework/types/ExperimentUUID.java | ExperimentUUID.getStageId | public int getStageId() {
if (ExperimentUUID_Type.featOkTst && ((ExperimentUUID_Type)jcasType).casFeat_stageId == null)
jcasType.jcas.throwFeatMissing("stageId", "edu.cmu.lti.oaqa.framework.types.ExperimentUUID");
return jcasType.ll_cas.ll_getIntValue(addr, ((ExperimentUUID_Type)jcasType).casFeatCode_stageId);} | java | public int getStageId() {
if (ExperimentUUID_Type.featOkTst && ((ExperimentUUID_Type)jcasType).casFeat_stageId == null)
jcasType.jcas.throwFeatMissing("stageId", "edu.cmu.lti.oaqa.framework.types.ExperimentUUID");
return jcasType.ll_cas.ll_getIntValue(addr, ((ExperimentUUID_Type)jcasType).casFeatCode_stageId);} | [
"public",
"int",
"getStageId",
"(",
")",
"{",
"if",
"(",
"ExperimentUUID_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"ExperimentUUID_Type",
")",
"jcasType",
")",
".",
"casFeat_stageId",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"... | getter for stageId - gets
@generated | [
"getter",
"for",
"stageId",
"-",
"gets"
] | 09a0ae26647490b43affc36ab3a01100702b989f | https://github.com/oaqa/uima-ecd/blob/09a0ae26647490b43affc36ab3a01100702b989f/src/main/java/edu/cmu/lti/oaqa/framework/types/ExperimentUUID.java#L85-L88 |
151,118 | oaqa/uima-ecd | src/main/java/edu/cmu/lti/oaqa/framework/types/ExperimentUUID.java | ExperimentUUID.setStageId | public void setStageId(int v) {
if (ExperimentUUID_Type.featOkTst && ((ExperimentUUID_Type)jcasType).casFeat_stageId == null)
jcasType.jcas.throwFeatMissing("stageId", "edu.cmu.lti.oaqa.framework.types.ExperimentUUID");
jcasType.ll_cas.ll_setIntValue(addr, ((ExperimentUUID_Type)jcasType).casFeatCode_stageId, v);} | java | public void setStageId(int v) {
if (ExperimentUUID_Type.featOkTst && ((ExperimentUUID_Type)jcasType).casFeat_stageId == null)
jcasType.jcas.throwFeatMissing("stageId", "edu.cmu.lti.oaqa.framework.types.ExperimentUUID");
jcasType.ll_cas.ll_setIntValue(addr, ((ExperimentUUID_Type)jcasType).casFeatCode_stageId, v);} | [
"public",
"void",
"setStageId",
"(",
"int",
"v",
")",
"{",
"if",
"(",
"ExperimentUUID_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"ExperimentUUID_Type",
")",
"jcasType",
")",
".",
"casFeat_stageId",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMis... | setter for stageId - sets
@generated | [
"setter",
"for",
"stageId",
"-",
"sets"
] | 09a0ae26647490b43affc36ab3a01100702b989f | https://github.com/oaqa/uima-ecd/blob/09a0ae26647490b43affc36ab3a01100702b989f/src/main/java/edu/cmu/lti/oaqa/framework/types/ExperimentUUID.java#L92-L95 |
151,119 | GerdHolz/TOVAL | src/de/invation/code/toval/graphic/diagrams/models/ScatterChartModel.java | ScatterChartModel.getValue | @Override
public Number getValue(ValueDimension dim, int index) {
return values.get(dim).get(index);
} | java | @Override
public Number getValue(ValueDimension dim, int index) {
return values.get(dim).get(index);
} | [
"@",
"Override",
"public",
"Number",
"getValue",
"(",
"ValueDimension",
"dim",
",",
"int",
"index",
")",
"{",
"return",
"values",
".",
"get",
"(",
"dim",
")",
".",
"get",
"(",
"index",
")",
";",
"}"
] | Returns the value with the given index of the given dimension.
@param dim Reference dimension for value extraction
@param index Index of the desired value
@return Value with the given index of the given dimension | [
"Returns",
"the",
"value",
"with",
"the",
"given",
"index",
"of",
"the",
"given",
"dimension",
"."
] | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/graphic/diagrams/models/ScatterChartModel.java#L72-L75 |
151,120 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/progress/WorkProgressUtil.java | WorkProgressUtil.propagateToParent | public static void propagateToParent(WorkProgress subTask, WorkProgress parentTask, long amount) {
Runnable update = new Runnable() {
private long propagated = 0;
@Override
public void run() {
long pos = subTask.getAmount();
if (pos > 0) pos = subTask.getPosition() * amount / pos;
if (pos == propagated) return;
synchronized (parentTask) {
parentTask.progress(pos - propagated);
}
propagated = pos;
}
};
subTask.listen(update);
update.run();
} | java | public static void propagateToParent(WorkProgress subTask, WorkProgress parentTask, long amount) {
Runnable update = new Runnable() {
private long propagated = 0;
@Override
public void run() {
long pos = subTask.getAmount();
if (pos > 0) pos = subTask.getPosition() * amount / pos;
if (pos == propagated) return;
synchronized (parentTask) {
parentTask.progress(pos - propagated);
}
propagated = pos;
}
};
subTask.listen(update);
update.run();
} | [
"public",
"static",
"void",
"propagateToParent",
"(",
"WorkProgress",
"subTask",
",",
"WorkProgress",
"parentTask",
",",
"long",
"amount",
")",
"{",
"Runnable",
"update",
"=",
"new",
"Runnable",
"(",
")",
"{",
"private",
"long",
"propagated",
"=",
"0",
";",
... | Propagate the progression of a sub-task to a prent. | [
"Propagate",
"the",
"progression",
"of",
"a",
"sub",
"-",
"task",
"to",
"a",
"prent",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/progress/WorkProgressUtil.java#L7-L23 |
151,121 | jtrfp/javamod | src/main/java/de/quippy/jmac/info/APETag.java | APETag.GetTagField | public APETagField GetTagField(String pFieldName) throws IOException {
int nIndex = GetTagFieldIndex(pFieldName);
return (nIndex != -1) ? (APETagField) m_aryFields.get(nIndex) : null;
} | java | public APETagField GetTagField(String pFieldName) throws IOException {
int nIndex = GetTagFieldIndex(pFieldName);
return (nIndex != -1) ? (APETagField) m_aryFields.get(nIndex) : null;
} | [
"public",
"APETagField",
"GetTagField",
"(",
"String",
"pFieldName",
")",
"throws",
"IOException",
"{",
"int",
"nIndex",
"=",
"GetTagFieldIndex",
"(",
"pFieldName",
")",
";",
"return",
"(",
"nIndex",
"!=",
"-",
"1",
")",
"?",
"(",
"APETagField",
")",
"m_aryF... | again, be careful, because this a pointer to the actual field in this class | [
"again",
"be",
"careful",
"because",
"this",
"a",
"pointer",
"to",
"the",
"actual",
"field",
"in",
"this",
"class"
] | cda4fe943a589dc49415f4413453e2eece72076a | https://github.com/jtrfp/javamod/blob/cda4fe943a589dc49415f4413453e2eece72076a/src/main/java/de/quippy/jmac/info/APETag.java#L232-L235 |
151,122 | lkwg82/enforcer-rules | src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java | RequireActiveProfile.isProfileActive | protected boolean isProfileActive( MavenProject project, String profileName )
{
@SuppressWarnings( "unchecked" )
List<Profile> activeProfiles = project.getActiveProfiles();
if ( activeProfiles != null && !activeProfiles.isEmpty() )
{
for ( Profile profile : activeProfiles )
{
if ( profile.getId().equals( profileName ) )
{
return true;
}
}
}
return false;
} | java | protected boolean isProfileActive( MavenProject project, String profileName )
{
@SuppressWarnings( "unchecked" )
List<Profile> activeProfiles = project.getActiveProfiles();
if ( activeProfiles != null && !activeProfiles.isEmpty() )
{
for ( Profile profile : activeProfiles )
{
if ( profile.getId().equals( profileName ) )
{
return true;
}
}
}
return false;
} | [
"protected",
"boolean",
"isProfileActive",
"(",
"MavenProject",
"project",
",",
"String",
"profileName",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"List",
"<",
"Profile",
">",
"activeProfiles",
"=",
"project",
".",
"getActiveProfiles",
"(",
")"... | Checks if profile is active.
@param project the project
@param profileName the profile name
@return <code>true</code> if profile is active, otherwise <code>false</code> | [
"Checks",
"if",
"profile",
"is",
"active",
"."
] | fa2d309af7907b17fc8eaf386f8056d77b654749 | https://github.com/lkwg82/enforcer-rules/blob/fa2d309af7907b17fc8eaf386f8056d77b654749/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java#L151-L167 |
151,123 | amlinv/amq-monitor | amq-monitor-web-impl/src/main/java/com/amlinv/activemq/monitor/web/MonitorWebsocket.java | MonitorWebsocket.queueSendToWebsocketNB | protected void queueSendToWebsocketNB(String msg) {
if (this.sendProcess.getPendingStepCount() < MAX_MSG_BACKLOG) {
MySendStep sendStep = new MySendStep(msg);
this.sendProcess.addStep(sendStep);
} else {
log.info("websocket backlog is full; aborting connection: sessionId={}", this.socketSessionId);
this.safeClose();
}
} | java | protected void queueSendToWebsocketNB(String msg) {
if (this.sendProcess.getPendingStepCount() < MAX_MSG_BACKLOG) {
MySendStep sendStep = new MySendStep(msg);
this.sendProcess.addStep(sendStep);
} else {
log.info("websocket backlog is full; aborting connection: sessionId={}", this.socketSessionId);
this.safeClose();
}
} | [
"protected",
"void",
"queueSendToWebsocketNB",
"(",
"String",
"msg",
")",
"{",
"if",
"(",
"this",
".",
"sendProcess",
".",
"getPendingStepCount",
"(",
")",
"<",
"MAX_MSG_BACKLOG",
")",
"{",
"MySendStep",
"sendStep",
"=",
"new",
"MySendStep",
"(",
"msg",
")",
... | Send the given message to the
@param msg | [
"Send",
"the",
"given",
"message",
"to",
"the"
] | 0ae0156f56d7d3edf98bca9c30b153b770fe5bfa | https://github.com/amlinv/amq-monitor/blob/0ae0156f56d7d3edf98bca9c30b153b770fe5bfa/amq-monitor-web-impl/src/main/java/com/amlinv/activemq/monitor/web/MonitorWebsocket.java#L151-L160 |
151,124 | amlinv/amq-monitor | amq-monitor-web-impl/src/main/java/com/amlinv/activemq/monitor/web/MonitorWebsocket.java | MonitorWebsocket.safeClose | protected void safeClose () {
Session closeSession = this.socketSession;
this.socketSession = null;
try {
if (closeSession != null) {
//
// Remove from the registry first in case the close blocks for a while. Doing so prevents additional
// errors logged for attempts to send to this now-defunct websocket.
//
registry.remove(this.socketSessionId);
closeSession.close();
}
} catch (IOException ioExc) {
log.debug("io exception on safe close of session", ioExc);
}
} | java | protected void safeClose () {
Session closeSession = this.socketSession;
this.socketSession = null;
try {
if (closeSession != null) {
//
// Remove from the registry first in case the close blocks for a while. Doing so prevents additional
// errors logged for attempts to send to this now-defunct websocket.
//
registry.remove(this.socketSessionId);
closeSession.close();
}
} catch (IOException ioExc) {
log.debug("io exception on safe close of session", ioExc);
}
} | [
"protected",
"void",
"safeClose",
"(",
")",
"{",
"Session",
"closeSession",
"=",
"this",
".",
"socketSession",
";",
"this",
".",
"socketSession",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"closeSession",
"!=",
"null",
")",
"{",
"//",
"// Remove from the regis... | Safely close the websocket. | [
"Safely",
"close",
"the",
"websocket",
"."
] | 0ae0156f56d7d3edf98bca9c30b153b770fe5bfa | https://github.com/amlinv/amq-monitor/blob/0ae0156f56d7d3edf98bca9c30b153b770fe5bfa/amq-monitor-web-impl/src/main/java/com/amlinv/activemq/monitor/web/MonitorWebsocket.java#L175-L191 |
151,125 | jpaoletti/java-presentation-manager | modules/jpm-core/src/main/java/jpaoletti/jpm/core/FieldComparator.java | FieldComparator.compare | @Override
public int compare(Field o1, Field o2) {
int i = order.indexOf(o1.getId());
int j = order.indexOf(o2.getId());
if(i==j) return 0;
if(i==-1 && j >= 0) return 1;
if(j==-1 && i >= 0) return -1;
return i - j;
} | java | @Override
public int compare(Field o1, Field o2) {
int i = order.indexOf(o1.getId());
int j = order.indexOf(o2.getId());
if(i==j) return 0;
if(i==-1 && j >= 0) return 1;
if(j==-1 && i >= 0) return -1;
return i - j;
} | [
"@",
"Override",
"public",
"int",
"compare",
"(",
"Field",
"o1",
",",
"Field",
"o2",
")",
"{",
"int",
"i",
"=",
"order",
".",
"indexOf",
"(",
"o1",
".",
"getId",
"(",
")",
")",
";",
"int",
"j",
"=",
"order",
".",
"indexOf",
"(",
"o2",
".",
"get... | Compare method.
@param o1 First field to compare
@param o2 Second field to compare
@return The lesser looking at order property | [
"Compare",
"method",
"."
] | d5aab55638383695db244744b4bfe27c5200e04f | https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/core/FieldComparator.java#L25-L33 |
151,126 | GerdHolz/TOVAL | src/de/invation/code/toval/statistic/Observation.java | Observation.getOccurrencesOf | public Integer getOccurrencesOf(Double value) {
if(!insertStat.containsKey(value))
throw new IllegalArgumentException("No occurrences of value \""+value+"\"");
return insertStat.get(value);
} | java | public Integer getOccurrencesOf(Double value) {
if(!insertStat.containsKey(value))
throw new IllegalArgumentException("No occurrences of value \""+value+"\"");
return insertStat.get(value);
} | [
"public",
"Integer",
"getOccurrencesOf",
"(",
"Double",
"value",
")",
"{",
"if",
"(",
"!",
"insertStat",
".",
"containsKey",
"(",
"value",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"No occurrences of value \\\"\"",
"+",
"value",
"+",
"\"\\\"\"",... | Returns the number of occurrences of the given value.
@param value The value for which the number of occurrences is desired
@return The number of occurrences of the given value
@throws IllegalArgumentException if there are no occurrences of <code>value</code> | [
"Returns",
"the",
"number",
"of",
"occurrences",
"of",
"the",
"given",
"value",
"."
] | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/statistic/Observation.java#L314-L318 |
151,127 | GerdHolz/TOVAL | src/de/invation/code/toval/statistic/Observation.java | Observation.getValueAt | public double getValueAt(int index) {
if(index <0 || index>=insertSeq.size())
throw new IndexOutOfBoundsException();
return insertSeq.get(index);
} | java | public double getValueAt(int index) {
if(index <0 || index>=insertSeq.size())
throw new IndexOutOfBoundsException();
return insertSeq.get(index);
} | [
"public",
"double",
"getValueAt",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"0",
"||",
"index",
">=",
"insertSeq",
".",
"size",
"(",
")",
")",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
")",
";",
"return",
"insertSeq",
".",
"get",
... | Returns the inserted value of a given insertion step.
@param index Index of the desired insertion step
@return The inserted value of a given insertion step. | [
"Returns",
"the",
"inserted",
"value",
"of",
"a",
"given",
"insertion",
"step",
"."
] | 036922cdfd710fa53b18e5dbe1e07f226f731fde | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/statistic/Observation.java#L349-L353 |
151,128 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/locale/annotations/LocalizableAnnotations.java | LocalizableAnnotations.get | public static ILocalizableString get(AnnotatedElement element, String name) {
for (LocalizableProperty p : element.getAnnotationsByType(LocalizableProperty.class)) {
if (!p.name().equals(name)) continue;
String ns = p.namespace();
if (ns.length() == 0) {
LocalizableNamespace lns = element.getAnnotation(LocalizableNamespace.class);
if (lns == null) {
if (element instanceof Member)
lns = ((Member)element).getDeclaringClass().getAnnotation(LocalizableNamespace.class);
}
if (lns != null)
ns = lns.value();
}
String[] values = p.values();
Object[] v = new Object[values.length];
for (int i = 0; i < values.length; ++i) v[i] = values[i];
return new LocalizableString(ns, p.key(), v);
}
for (Property p : element.getAnnotationsByType(Property.class)) {
if (!p.name().equals(name)) continue;
return new FixedLocalizedString(p.value());
}
return null;
} | java | public static ILocalizableString get(AnnotatedElement element, String name) {
for (LocalizableProperty p : element.getAnnotationsByType(LocalizableProperty.class)) {
if (!p.name().equals(name)) continue;
String ns = p.namespace();
if (ns.length() == 0) {
LocalizableNamespace lns = element.getAnnotation(LocalizableNamespace.class);
if (lns == null) {
if (element instanceof Member)
lns = ((Member)element).getDeclaringClass().getAnnotation(LocalizableNamespace.class);
}
if (lns != null)
ns = lns.value();
}
String[] values = p.values();
Object[] v = new Object[values.length];
for (int i = 0; i < values.length; ++i) v[i] = values[i];
return new LocalizableString(ns, p.key(), v);
}
for (Property p : element.getAnnotationsByType(Property.class)) {
if (!p.name().equals(name)) continue;
return new FixedLocalizedString(p.value());
}
return null;
} | [
"public",
"static",
"ILocalizableString",
"get",
"(",
"AnnotatedElement",
"element",
",",
"String",
"name",
")",
"{",
"for",
"(",
"LocalizableProperty",
"p",
":",
"element",
".",
"getAnnotationsByType",
"(",
"LocalizableProperty",
".",
"class",
")",
")",
"{",
"i... | Get a localizable string from the given element. | [
"Get",
"a",
"localizable",
"string",
"from",
"the",
"given",
"element",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/locale/annotations/LocalizableAnnotations.java#L17-L40 |
151,129 | ksclarke/solr-iso639-filter | src/main/java/info/freelibrary/solr/ISO639Converter.java | ISO639Converter.convert | public static String convert(final String aCode) {
String langName;
switch (aCode.length()) {
case 2:
langName = ISO639_1_MAP.get(aCode.toLowerCase());
break;
case 3:
langName = ISO639_2_MAP.get(aCode.toLowerCase());
break;
default:
langName = aCode;
}
return langName == null ? aCode : langName;
} | java | public static String convert(final String aCode) {
String langName;
switch (aCode.length()) {
case 2:
langName = ISO639_1_MAP.get(aCode.toLowerCase());
break;
case 3:
langName = ISO639_2_MAP.get(aCode.toLowerCase());
break;
default:
langName = aCode;
}
return langName == null ? aCode : langName;
} | [
"public",
"static",
"String",
"convert",
"(",
"final",
"String",
"aCode",
")",
"{",
"String",
"langName",
";",
"switch",
"(",
"aCode",
".",
"length",
"(",
")",
")",
"{",
"case",
"2",
":",
"langName",
"=",
"ISO639_1_MAP",
".",
"get",
"(",
"aCode",
".",
... | Converts a two or three digit ISO-639 language code into a human readable name for the language represented by
the code.
@param aCode A two or three digit ISO-639 code
@return An English name for the language represented by the two or three digit code | [
"Converts",
"a",
"two",
"or",
"three",
"digit",
"ISO",
"-",
"639",
"language",
"code",
"into",
"a",
"human",
"readable",
"name",
"for",
"the",
"language",
"represented",
"by",
"the",
"code",
"."
] | edcb3d898cfc153b5d089949b4b6609e7e7f082d | https://github.com/ksclarke/solr-iso639-filter/blob/edcb3d898cfc153b5d089949b4b6609e7e7f082d/src/main/java/info/freelibrary/solr/ISO639Converter.java#L125-L140 |
151,130 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/util/ProcessUtil.java | ProcessUtil.onProcessExited | public static void onProcessExited(Process process, Listener<Integer> exitValueListener) {
Application app = LCCore.getApplication();
Mutable<Thread> mt = new Mutable<>(null);
Thread t = app.getThreadFactory().newThread(() -> {
try { exitValueListener.fire(Integer.valueOf(process.waitFor())); }
catch (InterruptedException e) { /* ignore and quit */ }
app.interrupted(mt.get());
});
mt.set(t);
t.setName("Waiting for process to exit");
t.start();
app.toInterruptOnShutdown(t);
} | java | public static void onProcessExited(Process process, Listener<Integer> exitValueListener) {
Application app = LCCore.getApplication();
Mutable<Thread> mt = new Mutable<>(null);
Thread t = app.getThreadFactory().newThread(() -> {
try { exitValueListener.fire(Integer.valueOf(process.waitFor())); }
catch (InterruptedException e) { /* ignore and quit */ }
app.interrupted(mt.get());
});
mt.set(t);
t.setName("Waiting for process to exit");
t.start();
app.toInterruptOnShutdown(t);
} | [
"public",
"static",
"void",
"onProcessExited",
"(",
"Process",
"process",
",",
"Listener",
"<",
"Integer",
">",
"exitValueListener",
")",
"{",
"Application",
"app",
"=",
"LCCore",
".",
"getApplication",
"(",
")",
";",
"Mutable",
"<",
"Thread",
">",
"mt",
"="... | Create a thread that wait for the given process to end, and call the given listener. | [
"Create",
"a",
"thread",
"that",
"wait",
"for",
"the",
"given",
"process",
"to",
"end",
"and",
"call",
"the",
"given",
"listener",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/util/ProcessUtil.java#L22-L34 |
151,131 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/util/ProcessUtil.java | ProcessUtil.consumeProcessConsole | public static void consumeProcessConsole(Process process, Listener<String> outputListener, Listener<String> errorListener) {
Application app = LCCore.getApplication();
ThreadFactory factory = app.getThreadFactory();
Thread t;
ConsoleConsumer cc;
cc = new ConsoleConsumer(process.getInputStream(), outputListener);
t = factory.newThread(cc);
t.setName("Process output console consumer");
cc.app = app;
cc.t = t;
t.start();
app.toInterruptOnShutdown(t);
cc = new ConsoleConsumer(process.getErrorStream(), errorListener);
t = factory.newThread(cc);
t.setName("Process error console consumer");
cc.app = app;
cc.t = t;
t.start();
app.toInterruptOnShutdown(t);
} | java | public static void consumeProcessConsole(Process process, Listener<String> outputListener, Listener<String> errorListener) {
Application app = LCCore.getApplication();
ThreadFactory factory = app.getThreadFactory();
Thread t;
ConsoleConsumer cc;
cc = new ConsoleConsumer(process.getInputStream(), outputListener);
t = factory.newThread(cc);
t.setName("Process output console consumer");
cc.app = app;
cc.t = t;
t.start();
app.toInterruptOnShutdown(t);
cc = new ConsoleConsumer(process.getErrorStream(), errorListener);
t = factory.newThread(cc);
t.setName("Process error console consumer");
cc.app = app;
cc.t = t;
t.start();
app.toInterruptOnShutdown(t);
} | [
"public",
"static",
"void",
"consumeProcessConsole",
"(",
"Process",
"process",
",",
"Listener",
"<",
"String",
">",
"outputListener",
",",
"Listener",
"<",
"String",
">",
"errorListener",
")",
"{",
"Application",
"app",
"=",
"LCCore",
".",
"getApplication",
"("... | Launch 2 threads to consume both output and error streams, and call the listeners for each line read. | [
"Launch",
"2",
"threads",
"to",
"consume",
"both",
"output",
"and",
"error",
"streams",
"and",
"call",
"the",
"listeners",
"for",
"each",
"line",
"read",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/util/ProcessUtil.java#L37-L56 |
151,132 | vdmeer/skb-java-base | src/main/java/de/vandermeer/skb/base/strings/IdVersionString.java | IdVersionString.toMap | public Map<String, String> toMap(){
Map<String, String> ret = new HashMap<>();
ret.put("id", this.getID());
ret.put("version", this.getVersion().toString());
return ret;
} | java | public Map<String, String> toMap(){
Map<String, String> ret = new HashMap<>();
ret.put("id", this.getID());
ret.put("version", this.getVersion().toString());
return ret;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"toMap",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"ret",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"ret",
".",
"put",
"(",
"\"id\"",
",",
"this",
".",
"getID",
"(",
")",
")",... | Returns the string as a map using the key "id" for the identifier part and the key "version" for the version part.
@return map representation of the string | [
"Returns",
"the",
"string",
"as",
"a",
"map",
"using",
"the",
"key",
"id",
"for",
"the",
"identifier",
"part",
"and",
"the",
"key",
"version",
"for",
"the",
"version",
"part",
"."
] | 6d845bcc482aa9344d016e80c0c3455aeae13a13 | https://github.com/vdmeer/skb-java-base/blob/6d845bcc482aa9344d016e80c0c3455aeae13a13/src/main/java/de/vandermeer/skb/base/strings/IdVersionString.java#L110-L115 |
151,133 | vdmeer/skb-java-base | src/main/java/de/vandermeer/skb/base/strings/IdVersionString.java | IdVersionString.sameAs | public boolean sameAs(Object obj){
if(obj==null){
return false;
}
if(obj instanceof String || obj instanceof IdVersionString){
if(this.toString().equals(obj.toString())){
return true;
}
}
return false;
} | java | public boolean sameAs(Object obj){
if(obj==null){
return false;
}
if(obj instanceof String || obj instanceof IdVersionString){
if(this.toString().equals(obj.toString())){
return true;
}
}
return false;
} | [
"public",
"boolean",
"sameAs",
"(",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"obj",
"instanceof",
"String",
"||",
"obj",
"instanceof",
"IdVersionString",
")",
"{",
"if",
"(",
"this",
... | Tests if the parameter is the same id and version.
@param obj object to test
@return true if the parameter is an IdVersionString or a string with the same identifier and the same version, false otherwise | [
"Tests",
"if",
"the",
"parameter",
"is",
"the",
"same",
"id",
"and",
"version",
"."
] | 6d845bcc482aa9344d016e80c0c3455aeae13a13 | https://github.com/vdmeer/skb-java-base/blob/6d845bcc482aa9344d016e80c0c3455aeae13a13/src/main/java/de/vandermeer/skb/base/strings/IdVersionString.java#L122-L132 |
151,134 | sahan/RoboZombie | robozombie/src/main/java/org/apache/http42/util/EntityUtils.java | EntityUtils.consume | public static void consume(final HttpEntity entity) throws IOException {
if (entity == null) {
return;
}
if (entity.isStreaming()) {
InputStream instream = entity.getContent();
if (instream != null) {
instream.close();
}
}
} | java | public static void consume(final HttpEntity entity) throws IOException {
if (entity == null) {
return;
}
if (entity.isStreaming()) {
InputStream instream = entity.getContent();
if (instream != null) {
instream.close();
}
}
} | [
"public",
"static",
"void",
"consume",
"(",
"final",
"HttpEntity",
"entity",
")",
"throws",
"IOException",
"{",
"if",
"(",
"entity",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"entity",
".",
"isStreaming",
"(",
")",
")",
"{",
"InputStream",
... | Ensures that the entity content is fully consumed and the content stream, if exists,
is closed.
@param entity
@throws IOException if an error occurs reading the input stream
@since 4.1 | [
"Ensures",
"that",
"the",
"entity",
"content",
"is",
"fully",
"consumed",
"and",
"the",
"content",
"stream",
"if",
"exists",
"is",
"closed",
"."
] | 2e02f0d41647612e9d89360c5c48811ea86b33c8 | https://github.com/sahan/RoboZombie/blob/2e02f0d41647612e9d89360c5c48811ea86b33c8/robozombie/src/main/java/org/apache/http42/util/EntityUtils.java#L83-L93 |
151,135 | sahan/RoboZombie | robozombie/src/main/java/org/apache/http42/util/EntityUtils.java | EntityUtils.toByteArray | public static byte[] toByteArray(final HttpEntity entity) throws IOException {
if (entity == null) {
throw new IllegalArgumentException("HTTP entity may not be null");
}
InputStream instream = entity.getContent();
if (instream == null) {
return null;
}
try {
if (entity.getContentLength() > Integer.MAX_VALUE) {
throw new IllegalArgumentException("HTTP entity too large to be buffered in memory");
}
int i = (int)entity.getContentLength();
if (i < 0) {
i = 4096;
}
ByteArrayBuffer buffer = new ByteArrayBuffer(i);
byte[] tmp = new byte[4096];
int l;
while((l = instream.read(tmp)) != -1) {
buffer.append(tmp, 0, l);
}
return buffer.toByteArray();
} finally {
instream.close();
}
} | java | public static byte[] toByteArray(final HttpEntity entity) throws IOException {
if (entity == null) {
throw new IllegalArgumentException("HTTP entity may not be null");
}
InputStream instream = entity.getContent();
if (instream == null) {
return null;
}
try {
if (entity.getContentLength() > Integer.MAX_VALUE) {
throw new IllegalArgumentException("HTTP entity too large to be buffered in memory");
}
int i = (int)entity.getContentLength();
if (i < 0) {
i = 4096;
}
ByteArrayBuffer buffer = new ByteArrayBuffer(i);
byte[] tmp = new byte[4096];
int l;
while((l = instream.read(tmp)) != -1) {
buffer.append(tmp, 0, l);
}
return buffer.toByteArray();
} finally {
instream.close();
}
} | [
"public",
"static",
"byte",
"[",
"]",
"toByteArray",
"(",
"final",
"HttpEntity",
"entity",
")",
"throws",
"IOException",
"{",
"if",
"(",
"entity",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"HTTP entity may not be null\"",
")",
";... | Read the contents of an entity and return it as a byte array.
@param entity
@return byte array containing the entity content. May be null if
{@link HttpEntity#getContent()} is null.
@throws IOException if an error occurs reading the input stream
@throws IllegalArgumentException if entity is null or if content length > Integer.MAX_VALUE | [
"Read",
"the",
"contents",
"of",
"an",
"entity",
"and",
"return",
"it",
"as",
"a",
"byte",
"array",
"."
] | 2e02f0d41647612e9d89360c5c48811ea86b33c8 | https://github.com/sahan/RoboZombie/blob/2e02f0d41647612e9d89360c5c48811ea86b33c8/robozombie/src/main/java/org/apache/http42/util/EntityUtils.java#L104-L130 |
151,136 | sahan/RoboZombie | robozombie/src/main/java/org/apache/http42/util/EntityUtils.java | EntityUtils.getContentMimeType | @Deprecated
public static String getContentMimeType(final HttpEntity entity) throws ParseException {
if (entity == null) {
throw new IllegalArgumentException("HTTP entity may not be null");
}
String mimeType = null;
if (entity.getContentType() != null) {
HeaderElement values[] = entity.getContentType().getElements();
if (values.length > 0) {
mimeType = values[0].getName();
}
}
return mimeType;
} | java | @Deprecated
public static String getContentMimeType(final HttpEntity entity) throws ParseException {
if (entity == null) {
throw new IllegalArgumentException("HTTP entity may not be null");
}
String mimeType = null;
if (entity.getContentType() != null) {
HeaderElement values[] = entity.getContentType().getElements();
if (values.length > 0) {
mimeType = values[0].getName();
}
}
return mimeType;
} | [
"@",
"Deprecated",
"public",
"static",
"String",
"getContentMimeType",
"(",
"final",
"HttpEntity",
"entity",
")",
"throws",
"ParseException",
"{",
"if",
"(",
"entity",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"HTTP entity may not be... | Obtains mime type of the entity, if known.
@param entity must not be null
@return the character set, or null if not found
@throws ParseException if header elements cannot be deserialized
@throws IllegalArgumentException if entity is null
@since 4.1
@deprecated (4.1.3) use {@link ContentType#getOrDefault(HttpEntity)} | [
"Obtains",
"mime",
"type",
"of",
"the",
"entity",
"if",
"known",
"."
] | 2e02f0d41647612e9d89360c5c48811ea86b33c8 | https://github.com/sahan/RoboZombie/blob/2e02f0d41647612e9d89360c5c48811ea86b33c8/robozombie/src/main/java/org/apache/http42/util/EntityUtils.java#L172-L185 |
151,137 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/memory/IntArrayCache.java | IntArrayCache.get | public int[] get(int size, boolean acceptGreater) {
Node<ArraysBySize> node;
int[] buf;
synchronized (arraysBySize) {
if (acceptGreater)
node = arraysBySize.searchNearestHigher(size, true);
else
node = arraysBySize.get(size);
// limit to 3/2 of the size
if (node != null && acceptGreater && node.getValue() > size * 3 / 2)
node = null;
if (node == null)
buf = null;
else {
ArraysBySize arrays = node.getElement();
arrays.lastUsageTime = System.currentTimeMillis();
buf = arrays.arrays.poll();
if (arrays.arrays.isEmpty()) arraysBySize.remove(node);
}
}
if (buf == null)
return new int[size];
totalSize -= buf.length * 4;
return buf;
} | java | public int[] get(int size, boolean acceptGreater) {
Node<ArraysBySize> node;
int[] buf;
synchronized (arraysBySize) {
if (acceptGreater)
node = arraysBySize.searchNearestHigher(size, true);
else
node = arraysBySize.get(size);
// limit to 3/2 of the size
if (node != null && acceptGreater && node.getValue() > size * 3 / 2)
node = null;
if (node == null)
buf = null;
else {
ArraysBySize arrays = node.getElement();
arrays.lastUsageTime = System.currentTimeMillis();
buf = arrays.arrays.poll();
if (arrays.arrays.isEmpty()) arraysBySize.remove(node);
}
}
if (buf == null)
return new int[size];
totalSize -= buf.length * 4;
return buf;
} | [
"public",
"int",
"[",
"]",
"get",
"(",
"int",
"size",
",",
"boolean",
"acceptGreater",
")",
"{",
"Node",
"<",
"ArraysBySize",
">",
"node",
";",
"int",
"[",
"]",
"buf",
";",
"synchronized",
"(",
"arraysBySize",
")",
"{",
"if",
"(",
"acceptGreater",
")",... | Get an array. | [
"Get",
"an",
"array",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/memory/IntArrayCache.java#L55-L79 |
151,138 | hawkular/hawkular-inventory | hawkular-inventory-impl-tinkerpop-parent/hawkular-inventory-impl-tinkerpop/src/main/java/org/hawkular/inventory/impl/tinkerpop/FilterApplicator.java | FilterApplicator.applyAll | public static <S, E> void applyAll(Query filterTree, GraphTraversal<S, E> q) {
if (filterTree == null) {
return;
}
QueryTranslationState state = new QueryTranslationState();
applyAll(filterTree, q, false, state);
} | java | public static <S, E> void applyAll(Query filterTree, GraphTraversal<S, E> q) {
if (filterTree == null) {
return;
}
QueryTranslationState state = new QueryTranslationState();
applyAll(filterTree, q, false, state);
} | [
"public",
"static",
"<",
"S",
",",
"E",
">",
"void",
"applyAll",
"(",
"Query",
"filterTree",
",",
"GraphTraversal",
"<",
"S",
",",
"E",
">",
"q",
")",
"{",
"if",
"(",
"filterTree",
"==",
"null",
")",
"{",
"return",
";",
"}",
"QueryTranslationState",
... | Applies all the filters from the applicator tree to the provided Gremlin query.
@param filterTree the tree of filters to apply to the query
@param q the query to update with filters from the tree
@param <S> type of the source of the query
@param <E> type of the output of the query | [
"Applies",
"all",
"the",
"filters",
"from",
"the",
"applicator",
"tree",
"to",
"the",
"provided",
"Gremlin",
"query",
"."
] | f56dc10323dca21777feb5b609a9e9cc70ffaf62 | https://github.com/hawkular/hawkular-inventory/blob/f56dc10323dca21777feb5b609a9e9cc70ffaf62/hawkular-inventory-impl-tinkerpop-parent/hawkular-inventory-impl-tinkerpop/src/main/java/org/hawkular/inventory/impl/tinkerpop/FilterApplicator.java#L129-L137 |
151,139 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/collections/CollectionsUtil.java | CollectionsUtil.iterable | public static <T> Iterable<T> iterable(Enumeration<T> enumeration) {
LinkedList<T> list = new LinkedList<>();
while (enumeration.hasMoreElements()) list.add(enumeration.nextElement());
return list;
} | java | public static <T> Iterable<T> iterable(Enumeration<T> enumeration) {
LinkedList<T> list = new LinkedList<>();
while (enumeration.hasMoreElements()) list.add(enumeration.nextElement());
return list;
} | [
"public",
"static",
"<",
"T",
">",
"Iterable",
"<",
"T",
">",
"iterable",
"(",
"Enumeration",
"<",
"T",
">",
"enumeration",
")",
"{",
"LinkedList",
"<",
"T",
">",
"list",
"=",
"new",
"LinkedList",
"<>",
"(",
")",
";",
"while",
"(",
"enumeration",
"."... | Create an Iterable from the enumeration, by filling a LinkedList with the elements in the enumeration. | [
"Create",
"an",
"Iterable",
"from",
"the",
"enumeration",
"by",
"filling",
"a",
"LinkedList",
"with",
"the",
"elements",
"in",
"the",
"enumeration",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/collections/CollectionsUtil.java#L40-L44 |
151,140 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/collections/CollectionsUtil.java | CollectionsUtil.iterator | public static <T> Iterator<T> iterator(Enumeration<T> enumeration) {
return new Iterator<T>() {
@Override
public boolean hasNext() {
return enumeration.hasMoreElements();
}
@Override
public T next() {
return enumeration.nextElement();
}
};
} | java | public static <T> Iterator<T> iterator(Enumeration<T> enumeration) {
return new Iterator<T>() {
@Override
public boolean hasNext() {
return enumeration.hasMoreElements();
}
@Override
public T next() {
return enumeration.nextElement();
}
};
} | [
"public",
"static",
"<",
"T",
">",
"Iterator",
"<",
"T",
">",
"iterator",
"(",
"Enumeration",
"<",
"T",
">",
"enumeration",
")",
"{",
"return",
"new",
"Iterator",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"hasNext",
"(",
")"... | Create an Iterator from an Enumeration. | [
"Create",
"an",
"Iterator",
"from",
"an",
"Enumeration",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/collections/CollectionsUtil.java#L47-L59 |
151,141 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/collections/CollectionsUtil.java | CollectionsUtil.singleTimeIterable | public static <T> Iterable<T> singleTimeIterable(Enumeration<T> enumeration) {
return new Iterable<T>() {
@Override
public Iterator<T> iterator() {
return CollectionsUtil.iterator(enumeration);
}
};
} | java | public static <T> Iterable<T> singleTimeIterable(Enumeration<T> enumeration) {
return new Iterable<T>() {
@Override
public Iterator<T> iterator() {
return CollectionsUtil.iterator(enumeration);
}
};
} | [
"public",
"static",
"<",
"T",
">",
"Iterable",
"<",
"T",
">",
"singleTimeIterable",
"(",
"Enumeration",
"<",
"T",
">",
"enumeration",
")",
"{",
"return",
"new",
"Iterable",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Iterator",
"<",
"T",
... | Create an Iterable from an Enumeration, but avoiding to create a list, so the Iterable can be iterated only once. | [
"Create",
"an",
"Iterable",
"from",
"an",
"Enumeration",
"but",
"avoiding",
"to",
"create",
"a",
"list",
"so",
"the",
"Iterable",
"can",
"be",
"iterated",
"only",
"once",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/collections/CollectionsUtil.java#L62-L69 |
151,142 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/collections/CollectionsUtil.java | CollectionsUtil.addAll | public static <T> void addAll(Collection<T> col, Enumeration<T> e) {
while (e.hasMoreElements())
col.add(e.nextElement());
} | java | public static <T> void addAll(Collection<T> col, Enumeration<T> e) {
while (e.hasMoreElements())
col.add(e.nextElement());
} | [
"public",
"static",
"<",
"T",
">",
"void",
"addAll",
"(",
"Collection",
"<",
"T",
">",
"col",
",",
"Enumeration",
"<",
"T",
">",
"e",
")",
"{",
"while",
"(",
"e",
".",
"hasMoreElements",
"(",
")",
")",
"col",
".",
"add",
"(",
"e",
".",
"nextEleme... | Add all elements of the given enumeration into the given collection. | [
"Add",
"all",
"elements",
"of",
"the",
"given",
"enumeration",
"into",
"the",
"given",
"collection",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/collections/CollectionsUtil.java#L86-L89 |
151,143 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/Task.java | Task.rescheduleIfNeeded | final void rescheduleIfNeeded() {
if (executeEvery > 0 && !TaskScheduler.stopping) {
synchronized (this) {
status = Task.STATUS_NOT_STARTED;
executeIn(executeEvery);
}
TaskScheduler.schedule(this);
} else if (nextExecution > 0 && !TaskScheduler.stopping) {
synchronized (this) {
this.status = Task.STATUS_NOT_STARTED;
}
TaskScheduler.schedule(this);
}
} | java | final void rescheduleIfNeeded() {
if (executeEvery > 0 && !TaskScheduler.stopping) {
synchronized (this) {
status = Task.STATUS_NOT_STARTED;
executeIn(executeEvery);
}
TaskScheduler.schedule(this);
} else if (nextExecution > 0 && !TaskScheduler.stopping) {
synchronized (this) {
this.status = Task.STATUS_NOT_STARTED;
}
TaskScheduler.schedule(this);
}
} | [
"final",
"void",
"rescheduleIfNeeded",
"(",
")",
"{",
"if",
"(",
"executeEvery",
">",
"0",
"&&",
"!",
"TaskScheduler",
".",
"stopping",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"status",
"=",
"Task",
".",
"STATUS_NOT_STARTED",
";",
"executeIn",
"("... | Called by a task executor, just after execute method finished. | [
"Called",
"by",
"a",
"task",
"executor",
"just",
"after",
"execute",
"method",
"finished",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/Task.java#L384-L397 |
151,144 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/Task.java | Task.start | public final Task<T,TError> start() {
if (this instanceof Done) return this;
if (cancelling != null) result.cancelled(cancelling);
synchronized (this) {
if (result.isCancelled()) return this;
if (status != Task.STATUS_NOT_STARTED) {
if (status >= Task.STATUS_DONE)
throw new RuntimeException("Task already done: " + description
+ " with " + (result.getError() != null ? "error " + result.getError().getMessage() : "success"));
throw new RuntimeException("Task already started (" + status + "): " + description);
}
// check if waiting for time
if (nextExecution > 0) {
long now = System.currentTimeMillis();
if (nextExecution > now) {
TaskScheduler.schedule(this);
return this;
}
}
// ready to be executed
sendToTaskManager();
return this;
}
} | java | public final Task<T,TError> start() {
if (this instanceof Done) return this;
if (cancelling != null) result.cancelled(cancelling);
synchronized (this) {
if (result.isCancelled()) return this;
if (status != Task.STATUS_NOT_STARTED) {
if (status >= Task.STATUS_DONE)
throw new RuntimeException("Task already done: " + description
+ " with " + (result.getError() != null ? "error " + result.getError().getMessage() : "success"));
throw new RuntimeException("Task already started (" + status + "): " + description);
}
// check if waiting for time
if (nextExecution > 0) {
long now = System.currentTimeMillis();
if (nextExecution > now) {
TaskScheduler.schedule(this);
return this;
}
}
// ready to be executed
sendToTaskManager();
return this;
}
} | [
"public",
"final",
"Task",
"<",
"T",
",",
"TError",
">",
"start",
"(",
")",
"{",
"if",
"(",
"this",
"instanceof",
"Done",
")",
"return",
"this",
";",
"if",
"(",
"cancelling",
"!=",
"null",
")",
"result",
".",
"cancelled",
"(",
"cancelling",
")",
";",... | Ask to start the task. This does not start it immediately, but adds it to the queue of tasks to execute. | [
"Ask",
"to",
"start",
"the",
"task",
".",
"This",
"does",
"not",
"start",
"it",
"immediately",
"but",
"adds",
"it",
"to",
"the",
"queue",
"of",
"tasks",
"to",
"execute",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/Task.java#L408-L431 |
151,145 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/Task.java | Task.cancel | public final void cancel(CancelException reason) {
if (cancelling != null)
return;
if (reason == null) reason = new CancelException("No reason given");
cancelling = reason;
if (TaskScheduler.cancel(this)) {
status = Task.STATUS_DONE;
result.cancelled(reason);
return;
}
if (manager.remove(this)) {
status = Task.STATUS_DONE;
result.cancelled(reason);
return;
}
if (status == Task.STATUS_NOT_STARTED) {
status = Task.STATUS_DONE;
result.cancelled(reason);
return;
}
} | java | public final void cancel(CancelException reason) {
if (cancelling != null)
return;
if (reason == null) reason = new CancelException("No reason given");
cancelling = reason;
if (TaskScheduler.cancel(this)) {
status = Task.STATUS_DONE;
result.cancelled(reason);
return;
}
if (manager.remove(this)) {
status = Task.STATUS_DONE;
result.cancelled(reason);
return;
}
if (status == Task.STATUS_NOT_STARTED) {
status = Task.STATUS_DONE;
result.cancelled(reason);
return;
}
} | [
"public",
"final",
"void",
"cancel",
"(",
"CancelException",
"reason",
")",
"{",
"if",
"(",
"cancelling",
"!=",
"null",
")",
"return",
";",
"if",
"(",
"reason",
"==",
"null",
")",
"reason",
"=",
"new",
"CancelException",
"(",
"\"No reason given\"",
")",
";... | Cancel this task. | [
"Cancel",
"this",
"task",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/Task.java#L450-L470 |
151,146 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/Task.java | Task.setPriority | public final synchronized void setPriority(byte priority) {
if (this.priority == priority) return;
if (status == STATUS_STARTED_READY) {
if (manager.remove(this)) {
this.priority = priority;
while (manager.getTransferTarget() != null)
manager = manager.getTransferTarget();
manager.addReady(this);
return;
}
}
this.priority = priority;
} | java | public final synchronized void setPriority(byte priority) {
if (this.priority == priority) return;
if (status == STATUS_STARTED_READY) {
if (manager.remove(this)) {
this.priority = priority;
while (manager.getTransferTarget() != null)
manager = manager.getTransferTarget();
manager.addReady(this);
return;
}
}
this.priority = priority;
} | [
"public",
"final",
"synchronized",
"void",
"setPriority",
"(",
"byte",
"priority",
")",
"{",
"if",
"(",
"this",
".",
"priority",
"==",
"priority",
")",
"return",
";",
"if",
"(",
"status",
"==",
"STATUS_STARTED_READY",
")",
"{",
"if",
"(",
"manager",
".",
... | Change the priority of this task. | [
"Change",
"the",
"priority",
"of",
"this",
"task",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/Task.java#L518-L530 |
151,147 | OSSIndex/heuristic-version | src/main/java/net/ossindex/version/impl/SemanticVersion.java | SemanticVersion.setVersion | protected void setVersion(String buf)
{
// HACK to handle empty postfix
while (buf.endsWith("-")) {
buf = buf.substring(0, buf.length() - 1);
}
while (buf.endsWith(".")) {
buf = buf.substring(0, buf.length() - 1);
}
head = Version.valueOf(buf);
significantDigits = -1;
} | java | protected void setVersion(String buf)
{
// HACK to handle empty postfix
while (buf.endsWith("-")) {
buf = buf.substring(0, buf.length() - 1);
}
while (buf.endsWith(".")) {
buf = buf.substring(0, buf.length() - 1);
}
head = Version.valueOf(buf);
significantDigits = -1;
} | [
"protected",
"void",
"setVersion",
"(",
"String",
"buf",
")",
"{",
"// HACK to handle empty postfix",
"while",
"(",
"buf",
".",
"endsWith",
"(",
"\"-\"",
")",
")",
"{",
"buf",
"=",
"buf",
".",
"substring",
"(",
"0",
",",
"buf",
".",
"length",
"(",
")",
... | Set the version
@param buf Version we are trying to parse | [
"Set",
"the",
"version"
] | 9fe33a49d74acec54ddb91de9a3c3cd2f98fba40 | https://github.com/OSSIndex/heuristic-version/blob/9fe33a49d74acec54ddb91de9a3c3cd2f98fba40/src/main/java/net/ossindex/version/impl/SemanticVersion.java#L96-L108 |
151,148 | oaqa/uima-ecd | src/main/java/edu/cmu/lti/oaqa/framework/types/InputElement.java | InputElement.getQuestion | public String getQuestion() {
if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_question == null)
jcasType.jcas.throwFeatMissing("question", "edu.cmu.lti.oaqa.framework.types.InputElement");
return jcasType.ll_cas.ll_getStringValue(addr, ((InputElement_Type)jcasType).casFeatCode_question);} | java | public String getQuestion() {
if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_question == null)
jcasType.jcas.throwFeatMissing("question", "edu.cmu.lti.oaqa.framework.types.InputElement");
return jcasType.ll_cas.ll_getStringValue(addr, ((InputElement_Type)jcasType).casFeatCode_question);} | [
"public",
"String",
"getQuestion",
"(",
")",
"{",
"if",
"(",
"InputElement_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"InputElement_Type",
")",
"jcasType",
")",
".",
"casFeat_question",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
... | getter for question - gets
@generated | [
"getter",
"for",
"question",
"-",
"gets"
] | 09a0ae26647490b43affc36ab3a01100702b989f | https://github.com/oaqa/uima-ecd/blob/09a0ae26647490b43affc36ab3a01100702b989f/src/main/java/edu/cmu/lti/oaqa/framework/types/InputElement.java#L85-L88 |
151,149 | oaqa/uima-ecd | src/main/java/edu/cmu/lti/oaqa/framework/types/InputElement.java | InputElement.setQuestion | public void setQuestion(String v) {
if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_question == null)
jcasType.jcas.throwFeatMissing("question", "edu.cmu.lti.oaqa.framework.types.InputElement");
jcasType.ll_cas.ll_setStringValue(addr, ((InputElement_Type)jcasType).casFeatCode_question, v);} | java | public void setQuestion(String v) {
if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_question == null)
jcasType.jcas.throwFeatMissing("question", "edu.cmu.lti.oaqa.framework.types.InputElement");
jcasType.ll_cas.ll_setStringValue(addr, ((InputElement_Type)jcasType).casFeatCode_question, v);} | [
"public",
"void",
"setQuestion",
"(",
"String",
"v",
")",
"{",
"if",
"(",
"InputElement_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"InputElement_Type",
")",
"jcasType",
")",
".",
"casFeat_question",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMi... | setter for question - sets
@generated | [
"setter",
"for",
"question",
"-",
"sets"
] | 09a0ae26647490b43affc36ab3a01100702b989f | https://github.com/oaqa/uima-ecd/blob/09a0ae26647490b43affc36ab3a01100702b989f/src/main/java/edu/cmu/lti/oaqa/framework/types/InputElement.java#L92-L95 |
151,150 | oaqa/uima-ecd | src/main/java/edu/cmu/lti/oaqa/framework/types/InputElement.java | InputElement.getAnswerPattern | public String getAnswerPattern() {
if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_answerPattern == null)
jcasType.jcas.throwFeatMissing("answerPattern", "edu.cmu.lti.oaqa.framework.types.InputElement");
return jcasType.ll_cas.ll_getStringValue(addr, ((InputElement_Type)jcasType).casFeatCode_answerPattern);} | java | public String getAnswerPattern() {
if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_answerPattern == null)
jcasType.jcas.throwFeatMissing("answerPattern", "edu.cmu.lti.oaqa.framework.types.InputElement");
return jcasType.ll_cas.ll_getStringValue(addr, ((InputElement_Type)jcasType).casFeatCode_answerPattern);} | [
"public",
"String",
"getAnswerPattern",
"(",
")",
"{",
"if",
"(",
"InputElement_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"InputElement_Type",
")",
"jcasType",
")",
".",
"casFeat_answerPattern",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",... | getter for answerPattern - gets
@generated | [
"getter",
"for",
"answerPattern",
"-",
"gets"
] | 09a0ae26647490b43affc36ab3a01100702b989f | https://github.com/oaqa/uima-ecd/blob/09a0ae26647490b43affc36ab3a01100702b989f/src/main/java/edu/cmu/lti/oaqa/framework/types/InputElement.java#L103-L106 |
151,151 | oaqa/uima-ecd | src/main/java/edu/cmu/lti/oaqa/framework/types/InputElement.java | InputElement.setAnswerPattern | public void setAnswerPattern(String v) {
if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_answerPattern == null)
jcasType.jcas.throwFeatMissing("answerPattern", "edu.cmu.lti.oaqa.framework.types.InputElement");
jcasType.ll_cas.ll_setStringValue(addr, ((InputElement_Type)jcasType).casFeatCode_answerPattern, v);} | java | public void setAnswerPattern(String v) {
if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_answerPattern == null)
jcasType.jcas.throwFeatMissing("answerPattern", "edu.cmu.lti.oaqa.framework.types.InputElement");
jcasType.ll_cas.ll_setStringValue(addr, ((InputElement_Type)jcasType).casFeatCode_answerPattern, v);} | [
"public",
"void",
"setAnswerPattern",
"(",
"String",
"v",
")",
"{",
"if",
"(",
"InputElement_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"InputElement_Type",
")",
"jcasType",
")",
".",
"casFeat_answerPattern",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"t... | setter for answerPattern - sets
@generated | [
"setter",
"for",
"answerPattern",
"-",
"sets"
] | 09a0ae26647490b43affc36ab3a01100702b989f | https://github.com/oaqa/uima-ecd/blob/09a0ae26647490b43affc36ab3a01100702b989f/src/main/java/edu/cmu/lti/oaqa/framework/types/InputElement.java#L110-L113 |
151,152 | oaqa/uima-ecd | src/main/java/edu/cmu/lti/oaqa/framework/types/InputElement.java | InputElement.getDataset | public String getDataset() {
if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_dataset == null)
jcasType.jcas.throwFeatMissing("dataset", "edu.cmu.lti.oaqa.framework.types.InputElement");
return jcasType.ll_cas.ll_getStringValue(addr, ((InputElement_Type)jcasType).casFeatCode_dataset);} | java | public String getDataset() {
if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_dataset == null)
jcasType.jcas.throwFeatMissing("dataset", "edu.cmu.lti.oaqa.framework.types.InputElement");
return jcasType.ll_cas.ll_getStringValue(addr, ((InputElement_Type)jcasType).casFeatCode_dataset);} | [
"public",
"String",
"getDataset",
"(",
")",
"{",
"if",
"(",
"InputElement_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"InputElement_Type",
")",
"jcasType",
")",
".",
"casFeat_dataset",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\... | getter for dataset - gets
@generated | [
"getter",
"for",
"dataset",
"-",
"gets"
] | 09a0ae26647490b43affc36ab3a01100702b989f | https://github.com/oaqa/uima-ecd/blob/09a0ae26647490b43affc36ab3a01100702b989f/src/main/java/edu/cmu/lti/oaqa/framework/types/InputElement.java#L121-L124 |
151,153 | oaqa/uima-ecd | src/main/java/edu/cmu/lti/oaqa/framework/types/InputElement.java | InputElement.setDataset | public void setDataset(String v) {
if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_dataset == null)
jcasType.jcas.throwFeatMissing("dataset", "edu.cmu.lti.oaqa.framework.types.InputElement");
jcasType.ll_cas.ll_setStringValue(addr, ((InputElement_Type)jcasType).casFeatCode_dataset, v);} | java | public void setDataset(String v) {
if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_dataset == null)
jcasType.jcas.throwFeatMissing("dataset", "edu.cmu.lti.oaqa.framework.types.InputElement");
jcasType.ll_cas.ll_setStringValue(addr, ((InputElement_Type)jcasType).casFeatCode_dataset, v);} | [
"public",
"void",
"setDataset",
"(",
"String",
"v",
")",
"{",
"if",
"(",
"InputElement_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"InputElement_Type",
")",
"jcasType",
")",
".",
"casFeat_dataset",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMiss... | setter for dataset - sets
@generated | [
"setter",
"for",
"dataset",
"-",
"sets"
] | 09a0ae26647490b43affc36ab3a01100702b989f | https://github.com/oaqa/uima-ecd/blob/09a0ae26647490b43affc36ab3a01100702b989f/src/main/java/edu/cmu/lti/oaqa/framework/types/InputElement.java#L128-L131 |
151,154 | oaqa/uima-ecd | src/main/java/edu/cmu/lti/oaqa/framework/types/InputElement.java | InputElement.getQuuid | public String getQuuid() {
if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_quuid == null)
jcasType.jcas.throwFeatMissing("quuid", "edu.cmu.lti.oaqa.framework.types.InputElement");
return jcasType.ll_cas.ll_getStringValue(addr, ((InputElement_Type)jcasType).casFeatCode_quuid);} | java | public String getQuuid() {
if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_quuid == null)
jcasType.jcas.throwFeatMissing("quuid", "edu.cmu.lti.oaqa.framework.types.InputElement");
return jcasType.ll_cas.ll_getStringValue(addr, ((InputElement_Type)jcasType).casFeatCode_quuid);} | [
"public",
"String",
"getQuuid",
"(",
")",
"{",
"if",
"(",
"InputElement_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"InputElement_Type",
")",
"jcasType",
")",
".",
"casFeat_quuid",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"\"quu... | getter for quuid - gets
@generated | [
"getter",
"for",
"quuid",
"-",
"gets"
] | 09a0ae26647490b43affc36ab3a01100702b989f | https://github.com/oaqa/uima-ecd/blob/09a0ae26647490b43affc36ab3a01100702b989f/src/main/java/edu/cmu/lti/oaqa/framework/types/InputElement.java#L139-L142 |
151,155 | oaqa/uima-ecd | src/main/java/edu/cmu/lti/oaqa/framework/types/InputElement.java | InputElement.setQuuid | public void setQuuid(String v) {
if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_quuid == null)
jcasType.jcas.throwFeatMissing("quuid", "edu.cmu.lti.oaqa.framework.types.InputElement");
jcasType.ll_cas.ll_setStringValue(addr, ((InputElement_Type)jcasType).casFeatCode_quuid, v);} | java | public void setQuuid(String v) {
if (InputElement_Type.featOkTst && ((InputElement_Type)jcasType).casFeat_quuid == null)
jcasType.jcas.throwFeatMissing("quuid", "edu.cmu.lti.oaqa.framework.types.InputElement");
jcasType.ll_cas.ll_setStringValue(addr, ((InputElement_Type)jcasType).casFeatCode_quuid, v);} | [
"public",
"void",
"setQuuid",
"(",
"String",
"v",
")",
"{",
"if",
"(",
"InputElement_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"InputElement_Type",
")",
"jcasType",
")",
".",
"casFeat_quuid",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing"... | setter for quuid - sets
@generated | [
"setter",
"for",
"quuid",
"-",
"sets"
] | 09a0ae26647490b43affc36ab3a01100702b989f | https://github.com/oaqa/uima-ecd/blob/09a0ae26647490b43affc36ab3a01100702b989f/src/main/java/edu/cmu/lti/oaqa/framework/types/InputElement.java#L146-L149 |
151,156 | mgledi/DRUMS | src/main/java/com/unister/semweb/drums/bucket/Bucket.java | Bucket.getEmptyBucketWithSameProperties | public Bucket<Data> getEmptyBucketWithSameProperties() throws FileLockException, IOException {
Bucket<Data> newBucket = new Bucket<Data>(this.bucketId, gp);
return newBucket;
} | java | public Bucket<Data> getEmptyBucketWithSameProperties() throws FileLockException, IOException {
Bucket<Data> newBucket = new Bucket<Data>(this.bucketId, gp);
return newBucket;
} | [
"public",
"Bucket",
"<",
"Data",
">",
"getEmptyBucketWithSameProperties",
"(",
")",
"throws",
"FileLockException",
",",
"IOException",
"{",
"Bucket",
"<",
"Data",
">",
"newBucket",
"=",
"new",
"Bucket",
"<",
"Data",
">",
"(",
"this",
".",
"bucketId",
",",
"g... | returns a new empty Bucket with the same properties of this bucket
@return a new {@link Bucket} with the same {@link #bucketId}
@throws IOException
@throws FileLockException | [
"returns",
"a",
"new",
"empty",
"Bucket",
"with",
"the",
"same",
"properties",
"of",
"this",
"bucket"
] | a670f17a2186c9a15725f26617d77ce8e444e072 | https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/bucket/Bucket.java#L90-L93 |
151,157 | mgledi/DRUMS | src/main/java/com/unister/semweb/drums/bucket/Bucket.java | Bucket.freeMemory | public int freeMemory() {
int size = 0;
for (int m = 0; m < memory.length; m++) {
size += memory[m].length;
memory[m] = null;
}
memory = null;
return size;
} | java | public int freeMemory() {
int size = 0;
for (int m = 0; m < memory.length; m++) {
size += memory[m].length;
memory[m] = null;
}
memory = null;
return size;
} | [
"public",
"int",
"freeMemory",
"(",
")",
"{",
"int",
"size",
"=",
"0",
";",
"for",
"(",
"int",
"m",
"=",
"0",
";",
"m",
"<",
"memory",
".",
"length",
";",
"m",
"++",
")",
"{",
"size",
"+=",
"memory",
"[",
"m",
"]",
".",
"length",
";",
"memory... | This method frees the allocated memory.
@return the number of bytes which are available now | [
"This",
"method",
"frees",
"the",
"allocated",
"memory",
"."
] | a670f17a2186c9a15725f26617d77ce8e444e072 | https://github.com/mgledi/DRUMS/blob/a670f17a2186c9a15725f26617d77ce8e444e072/src/main/java/com/unister/semweb/drums/bucket/Bucket.java#L248-L256 |
151,158 | jpaoletti/java-presentation-manager | modules/jpm-core/src/main/java/jpaoletti/jpm/core/Operation.java | Operation.isDisplayed | public boolean isDisplayed(String other) {
return (getDisplay() == null || getDisplay().compareTo("all") == 0 || getDisplay().indexOf(other) != -1);
} | java | public boolean isDisplayed(String other) {
return (getDisplay() == null || getDisplay().compareTo("all") == 0 || getDisplay().indexOf(other) != -1);
} | [
"public",
"boolean",
"isDisplayed",
"(",
"String",
"other",
")",
"{",
"return",
"(",
"getDisplay",
"(",
")",
"==",
"null",
"||",
"getDisplay",
"(",
")",
".",
"compareTo",
"(",
"\"all\"",
")",
"==",
"0",
"||",
"getDisplay",
"(",
")",
".",
"indexOf",
"("... | Determine if this operation is visible in another.
@param other The id of the other operation
@return true if this operation is visible in the other | [
"Determine",
"if",
"this",
"operation",
"is",
"visible",
"in",
"another",
"."
] | d5aab55638383695db244744b4bfe27c5200e04f | https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/core/Operation.java#L109-L111 |
151,159 | xfcjscn/sudoor-server-lib | src/main/java/net/gplatform/sudoor/server/cors/CorsFilter.java | CorsFilter.handleInvalidCORS | private void handleInvalidCORS(final HttpServletRequest request, final HttpServletResponse response, final FilterChain filterChain) {
String origin = request.getHeader(CorsFilter.REQUEST_HEADER_ORIGIN);
String method = request.getMethod();
String accessControlRequestHeaders = request.getHeader(REQUEST_HEADER_ACCESS_CONTROL_REQUEST_HEADERS);
response.setContentType("text/plain");
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
response.resetBuffer();
if (log.isDebugEnabled()) {
// Debug so no need for i18n
StringBuilder message = new StringBuilder("Invalid CORS request; Origin=");
message.append(origin);
message.append(";Method=");
message.append(method);
if (accessControlRequestHeaders != null) {
message.append(";Access-Control-Request-Headers=");
message.append(accessControlRequestHeaders);
}
log.debug(message.toString());
}
} | java | private void handleInvalidCORS(final HttpServletRequest request, final HttpServletResponse response, final FilterChain filterChain) {
String origin = request.getHeader(CorsFilter.REQUEST_HEADER_ORIGIN);
String method = request.getMethod();
String accessControlRequestHeaders = request.getHeader(REQUEST_HEADER_ACCESS_CONTROL_REQUEST_HEADERS);
response.setContentType("text/plain");
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
response.resetBuffer();
if (log.isDebugEnabled()) {
// Debug so no need for i18n
StringBuilder message = new StringBuilder("Invalid CORS request; Origin=");
message.append(origin);
message.append(";Method=");
message.append(method);
if (accessControlRequestHeaders != null) {
message.append(";Access-Control-Request-Headers=");
message.append(accessControlRequestHeaders);
}
log.debug(message.toString());
}
} | [
"private",
"void",
"handleInvalidCORS",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"HttpServletResponse",
"response",
",",
"final",
"FilterChain",
"filterChain",
")",
"{",
"String",
"origin",
"=",
"request",
".",
"getHeader",
"(",
"CorsFilter",
"."... | Handles a CORS request that violates specification.
@param request
The {@link HttpServletRequest} object.
@param response
The {@link HttpServletResponse} object.
@param filterChain
The {@link FilterChain} object. | [
"Handles",
"a",
"CORS",
"request",
"that",
"violates",
"specification",
"."
] | 37dc1996eaa9cad25c82abd1de315ba565e32097 | https://github.com/xfcjscn/sudoor-server-lib/blob/37dc1996eaa9cad25c82abd1de315ba565e32097/src/main/java/net/gplatform/sudoor/server/cors/CorsFilter.java#L444-L465 |
151,160 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java | XMLStreamEvents.getNamespaceURI | public UnprotectedStringBuffer getNamespaceURI(CharSequence namespacePrefix) {
for (ElementContext ctx : event.context) {
for (Pair<UnprotectedStringBuffer, UnprotectedStringBuffer> ns : ctx.namespaces)
if (ns.getValue1().equals(namespacePrefix))
return ns.getValue2();
}
return new UnprotectedStringBuffer();
} | java | public UnprotectedStringBuffer getNamespaceURI(CharSequence namespacePrefix) {
for (ElementContext ctx : event.context) {
for (Pair<UnprotectedStringBuffer, UnprotectedStringBuffer> ns : ctx.namespaces)
if (ns.getValue1().equals(namespacePrefix))
return ns.getValue2();
}
return new UnprotectedStringBuffer();
} | [
"public",
"UnprotectedStringBuffer",
"getNamespaceURI",
"(",
"CharSequence",
"namespacePrefix",
")",
"{",
"for",
"(",
"ElementContext",
"ctx",
":",
"event",
".",
"context",
")",
"{",
"for",
"(",
"Pair",
"<",
"UnprotectedStringBuffer",
",",
"UnprotectedStringBuffer",
... | Get the namespace URI for a prefix, or empty string if the prefix is not defined. | [
"Get",
"the",
"namespace",
"URI",
"for",
"a",
"prefix",
"or",
"empty",
"string",
"if",
"the",
"prefix",
"is",
"not",
"defined",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java#L135-L142 |
151,161 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java | XMLStreamEvents.getAttributeByFullName | public Attribute getAttributeByFullName(CharSequence name) {
for (Attribute attr : event.attributes)
if (attr.text.equals(name))
return attr;
return null;
} | java | public Attribute getAttributeByFullName(CharSequence name) {
for (Attribute attr : event.attributes)
if (attr.text.equals(name))
return attr;
return null;
} | [
"public",
"Attribute",
"getAttributeByFullName",
"(",
"CharSequence",
"name",
")",
"{",
"for",
"(",
"Attribute",
"attr",
":",
"event",
".",
"attributes",
")",
"if",
"(",
"attr",
".",
"text",
".",
"equals",
"(",
"name",
")",
")",
"return",
"attr",
";",
"r... | Shortcut to get the attribute for the given full name. | [
"Shortcut",
"to",
"get",
"the",
"attribute",
"for",
"the",
"given",
"full",
"name",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java#L145-L150 |
151,162 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java | XMLStreamEvents.getAttributeByLocalName | public Attribute getAttributeByLocalName(CharSequence name) {
for (Attribute attr : event.attributes)
if (attr.localName.equals(name))
return attr;
return null;
} | java | public Attribute getAttributeByLocalName(CharSequence name) {
for (Attribute attr : event.attributes)
if (attr.localName.equals(name))
return attr;
return null;
} | [
"public",
"Attribute",
"getAttributeByLocalName",
"(",
"CharSequence",
"name",
")",
"{",
"for",
"(",
"Attribute",
"attr",
":",
"event",
".",
"attributes",
")",
"if",
"(",
"attr",
".",
"localName",
".",
"equals",
"(",
"name",
")",
")",
"return",
"attr",
";"... | Shortcut to get the attibute for the given local name. | [
"Shortcut",
"to",
"get",
"the",
"attibute",
"for",
"the",
"given",
"local",
"name",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java#L153-L158 |
151,163 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java | XMLStreamEvents.getAttributeWithPrefix | public Attribute getAttributeWithPrefix(CharSequence prefix, CharSequence name) {
for (Attribute attr : event.attributes)
if (attr.localName.equals(name) && attr.namespacePrefix.equals(prefix))
return attr;
return null;
} | java | public Attribute getAttributeWithPrefix(CharSequence prefix, CharSequence name) {
for (Attribute attr : event.attributes)
if (attr.localName.equals(name) && attr.namespacePrefix.equals(prefix))
return attr;
return null;
} | [
"public",
"Attribute",
"getAttributeWithPrefix",
"(",
"CharSequence",
"prefix",
",",
"CharSequence",
"name",
")",
"{",
"for",
"(",
"Attribute",
"attr",
":",
"event",
".",
"attributes",
")",
"if",
"(",
"attr",
".",
"localName",
".",
"equals",
"(",
"name",
")"... | Shortcut to get the attribute for the given namespace prefix and local name. | [
"Shortcut",
"to",
"get",
"the",
"attribute",
"for",
"the",
"given",
"namespace",
"prefix",
"and",
"local",
"name",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java#L161-L166 |
151,164 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java | XMLStreamEvents.getAttributeWithNamespaceURI | public Attribute getAttributeWithNamespaceURI(CharSequence uri, CharSequence name) {
for (Attribute attr : event.attributes)
if (attr.localName.equals(name) && getNamespaceURI(attr.namespacePrefix).equals(uri))
return attr;
return null;
} | java | public Attribute getAttributeWithNamespaceURI(CharSequence uri, CharSequence name) {
for (Attribute attr : event.attributes)
if (attr.localName.equals(name) && getNamespaceURI(attr.namespacePrefix).equals(uri))
return attr;
return null;
} | [
"public",
"Attribute",
"getAttributeWithNamespaceURI",
"(",
"CharSequence",
"uri",
",",
"CharSequence",
"name",
")",
"{",
"for",
"(",
"Attribute",
"attr",
":",
"event",
".",
"attributes",
")",
"if",
"(",
"attr",
".",
"localName",
".",
"equals",
"(",
"name",
... | Shortcut to get the attribute for the given namespace URI and local name. | [
"Shortcut",
"to",
"get",
"the",
"attribute",
"for",
"the",
"given",
"namespace",
"URI",
"and",
"local",
"name",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java#L169-L174 |
151,165 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java | XMLStreamEvents.removeAttributeByFullName | public Attribute removeAttributeByFullName(CharSequence name) {
for (Iterator<Attribute> it = event.attributes.iterator(); it.hasNext(); ) {
Attribute attr = it.next();
if (attr.text.equals(name)) {
it.remove();
return attr;
}
}
return null;
} | java | public Attribute removeAttributeByFullName(CharSequence name) {
for (Iterator<Attribute> it = event.attributes.iterator(); it.hasNext(); ) {
Attribute attr = it.next();
if (attr.text.equals(name)) {
it.remove();
return attr;
}
}
return null;
} | [
"public",
"Attribute",
"removeAttributeByFullName",
"(",
"CharSequence",
"name",
")",
"{",
"for",
"(",
"Iterator",
"<",
"Attribute",
">",
"it",
"=",
"event",
".",
"attributes",
".",
"iterator",
"(",
")",
";",
"it",
".",
"hasNext",
"(",
")",
";",
")",
"{"... | Remove and return the attribute for the given full name if it exists. | [
"Remove",
"and",
"return",
"the",
"attribute",
"for",
"the",
"given",
"full",
"name",
"if",
"it",
"exists",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java#L209-L218 |
151,166 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java | XMLStreamEvents.removeAttributeByLocalName | public Attribute removeAttributeByLocalName(CharSequence name) {
for (Iterator<Attribute> it = event.attributes.iterator(); it.hasNext(); ) {
Attribute attr = it.next();
if (attr.localName.equals(name)) {
it.remove();
return attr;
}
}
return null;
} | java | public Attribute removeAttributeByLocalName(CharSequence name) {
for (Iterator<Attribute> it = event.attributes.iterator(); it.hasNext(); ) {
Attribute attr = it.next();
if (attr.localName.equals(name)) {
it.remove();
return attr;
}
}
return null;
} | [
"public",
"Attribute",
"removeAttributeByLocalName",
"(",
"CharSequence",
"name",
")",
"{",
"for",
"(",
"Iterator",
"<",
"Attribute",
">",
"it",
"=",
"event",
".",
"attributes",
".",
"iterator",
"(",
")",
";",
"it",
".",
"hasNext",
"(",
")",
";",
")",
"{... | Remove and return the attibute for the given local name if it exists. | [
"Remove",
"and",
"return",
"the",
"attibute",
"for",
"the",
"given",
"local",
"name",
"if",
"it",
"exists",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java#L221-L230 |
151,167 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java | XMLStreamEvents.removeAttributeWithPrefix | public Attribute removeAttributeWithPrefix(CharSequence prefix, CharSequence name) {
for (Iterator<Attribute> it = event.attributes.iterator(); it.hasNext(); ) {
Attribute attr = it.next();
if (attr.localName.equals(name) && attr.namespacePrefix.equals(prefix)) {
it.remove();
return attr;
}
}
return null;
} | java | public Attribute removeAttributeWithPrefix(CharSequence prefix, CharSequence name) {
for (Iterator<Attribute> it = event.attributes.iterator(); it.hasNext(); ) {
Attribute attr = it.next();
if (attr.localName.equals(name) && attr.namespacePrefix.equals(prefix)) {
it.remove();
return attr;
}
}
return null;
} | [
"public",
"Attribute",
"removeAttributeWithPrefix",
"(",
"CharSequence",
"prefix",
",",
"CharSequence",
"name",
")",
"{",
"for",
"(",
"Iterator",
"<",
"Attribute",
">",
"it",
"=",
"event",
".",
"attributes",
".",
"iterator",
"(",
")",
";",
"it",
".",
"hasNex... | Remove and return the attribute for the given namespace prefix and local name if it exists. | [
"Remove",
"and",
"return",
"the",
"attribute",
"for",
"the",
"given",
"namespace",
"prefix",
"and",
"local",
"name",
"if",
"it",
"exists",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java#L233-L242 |
151,168 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java | XMLStreamEvents.removeAttributeWithNamespaceURI | public Attribute removeAttributeWithNamespaceURI(CharSequence uri, CharSequence name) {
for (Iterator<Attribute> it = event.attributes.iterator(); it.hasNext(); ) {
Attribute attr = it.next();
if (attr.localName.equals(name) && getNamespaceURI(attr.namespacePrefix).equals(uri)) {
it.remove();
return attr;
}
}
return null;
} | java | public Attribute removeAttributeWithNamespaceURI(CharSequence uri, CharSequence name) {
for (Iterator<Attribute> it = event.attributes.iterator(); it.hasNext(); ) {
Attribute attr = it.next();
if (attr.localName.equals(name) && getNamespaceURI(attr.namespacePrefix).equals(uri)) {
it.remove();
return attr;
}
}
return null;
} | [
"public",
"Attribute",
"removeAttributeWithNamespaceURI",
"(",
"CharSequence",
"uri",
",",
"CharSequence",
"name",
")",
"{",
"for",
"(",
"Iterator",
"<",
"Attribute",
">",
"it",
"=",
"event",
".",
"attributes",
".",
"iterator",
"(",
")",
";",
"it",
".",
"has... | Remove and return the attribute for the given namespace URI and local name if it exists. | [
"Remove",
"and",
"return",
"the",
"attribute",
"for",
"the",
"given",
"namespace",
"URI",
"and",
"local",
"name",
"if",
"it",
"exists",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java#L245-L254 |
151,169 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java | XMLStreamEvents.isSpaceChar | public static boolean isSpaceChar(char c) {
if (c == 0x20) return true;
if (c > 0xD) return false;
if (c < 0x9) return false;
return isSpace[c - 9];
} | java | public static boolean isSpaceChar(char c) {
if (c == 0x20) return true;
if (c > 0xD) return false;
if (c < 0x9) return false;
return isSpace[c - 9];
} | [
"public",
"static",
"boolean",
"isSpaceChar",
"(",
"char",
"c",
")",
"{",
"if",
"(",
"c",
"==",
"0x20",
")",
"return",
"true",
";",
"if",
"(",
"c",
">",
"0xD",
")",
"return",
"false",
";",
"if",
"(",
"c",
"<",
"0x9",
")",
"return",
"false",
";",
... | Return true if the given character is considered as a white space. | [
"Return",
"true",
"if",
"the",
"given",
"character",
"is",
"considered",
"as",
"a",
"white",
"space",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/xml/XMLStreamEvents.java#L314-L319 |
151,170 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/tasks/SavePropertiesFileTask.java | SavePropertiesFileTask.savePropertiesFile | @SuppressWarnings("resource")
public static ISynchronizationPoint<IOException> savePropertiesFile(
Properties properties, IO.Writable output, Charset charset, byte priority, boolean closeIOAtEnd
) {
BufferedWritableCharacterStream stream = new BufferedWritableCharacterStream(output, charset, 4096);
return savePropertiesFile(properties, stream, priority, closeIOAtEnd);
} | java | @SuppressWarnings("resource")
public static ISynchronizationPoint<IOException> savePropertiesFile(
Properties properties, IO.Writable output, Charset charset, byte priority, boolean closeIOAtEnd
) {
BufferedWritableCharacterStream stream = new BufferedWritableCharacterStream(output, charset, 4096);
return savePropertiesFile(properties, stream, priority, closeIOAtEnd);
} | [
"@",
"SuppressWarnings",
"(",
"\"resource\"",
")",
"public",
"static",
"ISynchronizationPoint",
"<",
"IOException",
">",
"savePropertiesFile",
"(",
"Properties",
"properties",
",",
"IO",
".",
"Writable",
"output",
",",
"Charset",
"charset",
",",
"byte",
"priority",
... | Save properties to a Writable IO. | [
"Save",
"properties",
"to",
"a",
"Writable",
"IO",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/tasks/SavePropertiesFileTask.java#L45-L51 |
151,171 | lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/tasks/SavePropertiesFileTask.java | SavePropertiesFileTask.savePropertiesFile | public static ISynchronizationPoint<IOException> savePropertiesFile(
Properties properties, ICharacterStream.Writable.Buffered output, byte priority, boolean closeStreamAtEnd
) {
SavePropertiesFileTask task = new SavePropertiesFileTask(properties, output, priority, closeStreamAtEnd);
task.start();
return task.getOutput();
} | java | public static ISynchronizationPoint<IOException> savePropertiesFile(
Properties properties, ICharacterStream.Writable.Buffered output, byte priority, boolean closeStreamAtEnd
) {
SavePropertiesFileTask task = new SavePropertiesFileTask(properties, output, priority, closeStreamAtEnd);
task.start();
return task.getOutput();
} | [
"public",
"static",
"ISynchronizationPoint",
"<",
"IOException",
">",
"savePropertiesFile",
"(",
"Properties",
"properties",
",",
"ICharacterStream",
".",
"Writable",
".",
"Buffered",
"output",
",",
"byte",
"priority",
",",
"boolean",
"closeStreamAtEnd",
")",
"{",
"... | Save properties to a writable character stream. | [
"Save",
"properties",
"to",
"a",
"writable",
"character",
"stream",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/concurrent/tasks/SavePropertiesFileTask.java#L54-L60 |
151,172 | hawkular/hawkular-inventory | hawkular-inventory-security-parent/hawkular-inventory-security-accounts/src/main/java/org/hawkular/inventory/rest/security/accounts/SecurityIntegration.java | SecurityIntegration.establishOwner | private Persona establishOwner(org.hawkular.accounts.api.model.Resource resource, Persona current) {
while (resource != null && resource.getPersona() == null) {
resource = resource.getParent();
}
if (resource != null && resource.getPersona().equals(current)) {
current = null;
}
return current;
} | java | private Persona establishOwner(org.hawkular.accounts.api.model.Resource resource, Persona current) {
while (resource != null && resource.getPersona() == null) {
resource = resource.getParent();
}
if (resource != null && resource.getPersona().equals(current)) {
current = null;
}
return current;
} | [
"private",
"Persona",
"establishOwner",
"(",
"org",
".",
"hawkular",
".",
"accounts",
".",
"api",
".",
"model",
".",
"Resource",
"resource",
",",
"Persona",
"current",
")",
"{",
"while",
"(",
"resource",
"!=",
"null",
"&&",
"resource",
".",
"getPersona",
"... | Establishes the owner. If the owner of the parent is the same as the current user, then create the resource
as being owner-less, inheriting the owner from the parent. | [
"Establishes",
"the",
"owner",
".",
"If",
"the",
"owner",
"of",
"the",
"parent",
"is",
"the",
"same",
"as",
"the",
"current",
"user",
"then",
"create",
"the",
"resource",
"as",
"being",
"owner",
"-",
"less",
"inheriting",
"the",
"owner",
"from",
"the",
"... | f56dc10323dca21777feb5b609a9e9cc70ffaf62 | https://github.com/hawkular/hawkular-inventory/blob/f56dc10323dca21777feb5b609a9e9cc70ffaf62/hawkular-inventory-security-parent/hawkular-inventory-security-accounts/src/main/java/org/hawkular/inventory/rest/security/accounts/SecurityIntegration.java#L131-L141 |
151,173 | rwl/CSparseJ | src/main/java/edu/emory/mathcs/csparsej/tdcomplex/DZcs_maxtrans.java | DZcs_maxtrans.cs_augment | private static void cs_augment(int k, DZcs A, int[] jmatch, int jmatch_offset, int[] cheap, int cheap_offset,
int[] w, int w_offset, int[] js, int js_offset, int[] is, int is_offset, int[] ps, int ps_offset)
{
int p, i = -1, Ap[] = A.p, Ai[] = A.i, head = 0, j ;
boolean found = false ;
js [js_offset + 0] = k ; /* start with just node k in jstack */
while (head >= 0)
{
/* --- Start (or continue) depth-first-search at node j ------------- */
j = js [js_offset + head] ; /* get j from top of jstack */
if (w [w_offset + j] != k) /* 1st time j visited for kth path */
{
w [w_offset + j] = k ; /* mark j as visited for kth path */
for (p = cheap [cheap_offset + j] ; p < Ap [j+1] && !found ; p++)
{
i = Ai [p] ; /* try a cheap assignment (i,j) */
found = (jmatch [jmatch_offset + i] == -1) ;
}
cheap [cheap_offset + j] = p ; /* start here next time j is traversed*/
if (found)
{
is [is_offset + head] = i ; /* column j matched with row i */
break ; /* end of augmenting path */
}
ps [ps_offset + head] = Ap [j] ; /* no cheap match: start dfs for j */
}
/* --- Depth-first-search of neighbors of j ------------------------- */
for (p = ps [ps_offset + head] ; p < Ap [j+1] ; p++)
{
i = Ai [p] ; /* consider row i */
if (w [w_offset + jmatch [jmatch_offset + i]] == k)
continue ; /* skip jmatch [i] if marked */
ps [ps_offset + head] = p + 1 ; /* pause dfs of node j */
is [is_offset + head] = i ; /* i will be matched with j if found */
js [js_offset + (++head)] = jmatch [jmatch_offset + i] ; /* start dfs at column jmatch [i] */
break;
}
if (p == Ap [j+1]) head-- ; /* node j is done; pop from stack */
} /* augment the match if path found: */
if (found) for (p = head ; p >= 0 ; p--) jmatch [jmatch_offset + is [is_offset + p]] = js [js_offset + p] ;
} | java | private static void cs_augment(int k, DZcs A, int[] jmatch, int jmatch_offset, int[] cheap, int cheap_offset,
int[] w, int w_offset, int[] js, int js_offset, int[] is, int is_offset, int[] ps, int ps_offset)
{
int p, i = -1, Ap[] = A.p, Ai[] = A.i, head = 0, j ;
boolean found = false ;
js [js_offset + 0] = k ; /* start with just node k in jstack */
while (head >= 0)
{
/* --- Start (or continue) depth-first-search at node j ------------- */
j = js [js_offset + head] ; /* get j from top of jstack */
if (w [w_offset + j] != k) /* 1st time j visited for kth path */
{
w [w_offset + j] = k ; /* mark j as visited for kth path */
for (p = cheap [cheap_offset + j] ; p < Ap [j+1] && !found ; p++)
{
i = Ai [p] ; /* try a cheap assignment (i,j) */
found = (jmatch [jmatch_offset + i] == -1) ;
}
cheap [cheap_offset + j] = p ; /* start here next time j is traversed*/
if (found)
{
is [is_offset + head] = i ; /* column j matched with row i */
break ; /* end of augmenting path */
}
ps [ps_offset + head] = Ap [j] ; /* no cheap match: start dfs for j */
}
/* --- Depth-first-search of neighbors of j ------------------------- */
for (p = ps [ps_offset + head] ; p < Ap [j+1] ; p++)
{
i = Ai [p] ; /* consider row i */
if (w [w_offset + jmatch [jmatch_offset + i]] == k)
continue ; /* skip jmatch [i] if marked */
ps [ps_offset + head] = p + 1 ; /* pause dfs of node j */
is [is_offset + head] = i ; /* i will be matched with j if found */
js [js_offset + (++head)] = jmatch [jmatch_offset + i] ; /* start dfs at column jmatch [i] */
break;
}
if (p == Ap [j+1]) head-- ; /* node j is done; pop from stack */
} /* augment the match if path found: */
if (found) for (p = head ; p >= 0 ; p--) jmatch [jmatch_offset + is [is_offset + p]] = js [js_offset + p] ;
} | [
"private",
"static",
"void",
"cs_augment",
"(",
"int",
"k",
",",
"DZcs",
"A",
",",
"int",
"[",
"]",
"jmatch",
",",
"int",
"jmatch_offset",
",",
"int",
"[",
"]",
"cheap",
",",
"int",
"cheap_offset",
",",
"int",
"[",
"]",
"w",
",",
"int",
"w_offset",
... | find an augmenting path starting at column k and extend the match if found | [
"find",
"an",
"augmenting",
"path",
"starting",
"at",
"column",
"k",
"and",
"extend",
"the",
"match",
"if",
"found"
] | 6a6f66bccce1558156a961494358952603b0ac84 | https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tdcomplex/DZcs_maxtrans.java#L46-L86 |
151,174 | vdmeer/skb-java-base | src/main/java/de/vandermeer/skb/base/info/DirectoryValidator.java | DirectoryValidator.validate | protected void validate(File directory, ValidationOptions option){
if(!directory.exists()){
this.errors.addError("directory <{}> does not exist in file system", directory.getAbsolutePath());
}
else if(!directory.isDirectory()){
this.errors.addError("directory <{}> is not a directory", directory.getAbsolutePath());
}
else if(directory.isHidden()){
this.errors.addError("directory <{}> is a hidden directory", directory.getAbsolutePath());
}
else{
switch(option){
case AS_SOURCE:
if(!directory.canRead()){
this.errors.addError("directory <{}> is not readable", directory.getAbsolutePath());
}
break;
case AS_SOURCE_AND_TARGET:
if(!directory.canRead()){
this.errors.addError("directory <{}> is not readable", directory.getAbsolutePath());
}
if(!directory.canWrite()){
this.errors.addError("directory <{}> is not writable", directory.getAbsolutePath());
}
break;
case AS_TARGET:
if(!directory.canWrite()){
this.errors.addError("directory <{}> is not writable", directory.getAbsolutePath());
}
break;
}
}
} | java | protected void validate(File directory, ValidationOptions option){
if(!directory.exists()){
this.errors.addError("directory <{}> does not exist in file system", directory.getAbsolutePath());
}
else if(!directory.isDirectory()){
this.errors.addError("directory <{}> is not a directory", directory.getAbsolutePath());
}
else if(directory.isHidden()){
this.errors.addError("directory <{}> is a hidden directory", directory.getAbsolutePath());
}
else{
switch(option){
case AS_SOURCE:
if(!directory.canRead()){
this.errors.addError("directory <{}> is not readable", directory.getAbsolutePath());
}
break;
case AS_SOURCE_AND_TARGET:
if(!directory.canRead()){
this.errors.addError("directory <{}> is not readable", directory.getAbsolutePath());
}
if(!directory.canWrite()){
this.errors.addError("directory <{}> is not writable", directory.getAbsolutePath());
}
break;
case AS_TARGET:
if(!directory.canWrite()){
this.errors.addError("directory <{}> is not writable", directory.getAbsolutePath());
}
break;
}
}
} | [
"protected",
"void",
"validate",
"(",
"File",
"directory",
",",
"ValidationOptions",
"option",
")",
"{",
"if",
"(",
"!",
"directory",
".",
"exists",
"(",
")",
")",
"{",
"this",
".",
"errors",
".",
"addError",
"(",
"\"directory <{}> does not exist in file system\... | Does the actual validation
@param directory the directory to validate
@param option validation options | [
"Does",
"the",
"actual",
"validation"
] | 6d845bcc482aa9344d016e80c0c3455aeae13a13 | https://github.com/vdmeer/skb-java-base/blob/6d845bcc482aa9344d016e80c0c3455aeae13a13/src/main/java/de/vandermeer/skb/base/info/DirectoryValidator.java#L79-L111 |
151,175 | jbundle/jbundle | base/db/client/src/main/java/org/jbundle/base/db/client/ClientTable.java | ClientTable.checkCacheMode | public void checkCacheMode(Boolean boolShouldBeCached)
{
try {
boolean bCurrentlyCached = (this.getRemoteTableType(CachedRemoteTable.class) != null);
if ((this.getRecord().getOpenMode() & DBConstants.OPEN_CACHE_RECORDS) == DBConstants.OPEN_CACHE_RECORDS)
boolShouldBeCached = Boolean.TRUE;
// if ((this.getRecord().getOpenMode() & DBConstants.OPEN_READ_ONLY) == DBConstants.OPEN_READ_ONLY);
// bShouldBeCached = true;
if ((this.getRecord().getOpenMode() & DBConstants.OPEN_DONT_CACHE) == DBConstants.OPEN_DONT_CACHE)
boolShouldBeCached = Boolean.FALSE;
if (boolShouldBeCached == null)
return; // Not specified, Don't change.
if ((!bCurrentlyCached) && (boolShouldBeCached.booleanValue()))
{ // Add a cache
Utility.getLogger().info("Cache ON: " + this.getRecord().getTableNames(false));
this.setRemoteTable(new CachedRemoteTable(m_tableRemote));
}
else if ((bCurrentlyCached) && (!boolShouldBeCached.booleanValue()))
{ // Remove the cache
Utility.getLogger().info("Cache OFF: " + this.getRecord().getTableNames(false));
// RemoteTable tableRemote = this.getRemoteTableType(org.jbundle.model.Remote.class);
RemoteTable tableRemote = this.getRemoteTableType(CachedRemoteTable.class).getRemoteTableType(null);
((CachedRemoteTable)m_tableRemote).setRemoteTable(null);
((CachedRemoteTable)m_tableRemote).free();
this.setRemoteTable(tableRemote);
}
} catch (RemoteException ex) {
// Never for this usage
}
} | java | public void checkCacheMode(Boolean boolShouldBeCached)
{
try {
boolean bCurrentlyCached = (this.getRemoteTableType(CachedRemoteTable.class) != null);
if ((this.getRecord().getOpenMode() & DBConstants.OPEN_CACHE_RECORDS) == DBConstants.OPEN_CACHE_RECORDS)
boolShouldBeCached = Boolean.TRUE;
// if ((this.getRecord().getOpenMode() & DBConstants.OPEN_READ_ONLY) == DBConstants.OPEN_READ_ONLY);
// bShouldBeCached = true;
if ((this.getRecord().getOpenMode() & DBConstants.OPEN_DONT_CACHE) == DBConstants.OPEN_DONT_CACHE)
boolShouldBeCached = Boolean.FALSE;
if (boolShouldBeCached == null)
return; // Not specified, Don't change.
if ((!bCurrentlyCached) && (boolShouldBeCached.booleanValue()))
{ // Add a cache
Utility.getLogger().info("Cache ON: " + this.getRecord().getTableNames(false));
this.setRemoteTable(new CachedRemoteTable(m_tableRemote));
}
else if ((bCurrentlyCached) && (!boolShouldBeCached.booleanValue()))
{ // Remove the cache
Utility.getLogger().info("Cache OFF: " + this.getRecord().getTableNames(false));
// RemoteTable tableRemote = this.getRemoteTableType(org.jbundle.model.Remote.class);
RemoteTable tableRemote = this.getRemoteTableType(CachedRemoteTable.class).getRemoteTableType(null);
((CachedRemoteTable)m_tableRemote).setRemoteTable(null);
((CachedRemoteTable)m_tableRemote).free();
this.setRemoteTable(tableRemote);
}
} catch (RemoteException ex) {
// Never for this usage
}
} | [
"public",
"void",
"checkCacheMode",
"(",
"Boolean",
"boolShouldBeCached",
")",
"{",
"try",
"{",
"boolean",
"bCurrentlyCached",
"=",
"(",
"this",
".",
"getRemoteTableType",
"(",
"CachedRemoteTable",
".",
"class",
")",
"!=",
"null",
")",
";",
"if",
"(",
"(",
"... | Make sure the cache is set up correctly for this type of query.
@param boolShouldBeCached Default cache mode (if null, no default assumed). | [
"Make",
"sure",
"the",
"cache",
"is",
"set",
"up",
"correctly",
"for",
"this",
"type",
"of",
"query",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/db/client/src/main/java/org/jbundle/base/db/client/ClientTable.java#L213-L242 |
151,176 | jbundle/jbundle | base/db/client/src/main/java/org/jbundle/base/db/client/ClientTable.java | ClientTable.dataToFields | public int dataToFields(Rec record) throws DBException
{
try {
return ((BaseBuffer)m_dataSource).bufferToFields((FieldList)record, DBConstants.DONT_DISPLAY, DBConstants.READ_MOVE);
} catch (Exception ex) {
throw DatabaseException.toDatabaseException(ex);
}
} | java | public int dataToFields(Rec record) throws DBException
{
try {
return ((BaseBuffer)m_dataSource).bufferToFields((FieldList)record, DBConstants.DONT_DISPLAY, DBConstants.READ_MOVE);
} catch (Exception ex) {
throw DatabaseException.toDatabaseException(ex);
}
} | [
"public",
"int",
"dataToFields",
"(",
"Rec",
"record",
")",
"throws",
"DBException",
"{",
"try",
"{",
"return",
"(",
"(",
"BaseBuffer",
")",
"m_dataSource",
")",
".",
"bufferToFields",
"(",
"(",
"FieldList",
")",
"record",
",",
"DBConstants",
".",
"DONT_DISP... | Move the data source buffer to all the fields.
In this implementation, move the local copy of the returned datasource to the fields.
@return an error code.
@exception DBException File exception. | [
"Move",
"the",
"data",
"source",
"buffer",
"to",
"all",
"the",
"fields",
".",
"In",
"this",
"implementation",
"move",
"the",
"local",
"copy",
"of",
"the",
"returned",
"datasource",
"to",
"the",
"fields",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/db/client/src/main/java/org/jbundle/base/db/client/ClientTable.java#L548-L555 |
151,177 | jbundle/jbundle | base/db/client/src/main/java/org/jbundle/base/db/client/ClientTable.java | ClientTable.fieldsToData | public void fieldsToData(Rec record) throws DBException
{
try {
int iFieldTypes = BaseBuffer.PHYSICAL_FIELDS;
if (!((Record)record).isAllSelected())
iFieldTypes = BaseBuffer.DATA_FIELDS; //SELECTED_FIELDS; (Selected and physical)
m_dataSource = new VectorBuffer(null, iFieldTypes); //x new StringBuff();
((BaseBuffer)m_dataSource).fieldsToBuffer((FieldList)record);
} catch (Exception ex) {
throw DatabaseException.toDatabaseException(ex);
}
} | java | public void fieldsToData(Rec record) throws DBException
{
try {
int iFieldTypes = BaseBuffer.PHYSICAL_FIELDS;
if (!((Record)record).isAllSelected())
iFieldTypes = BaseBuffer.DATA_FIELDS; //SELECTED_FIELDS; (Selected and physical)
m_dataSource = new VectorBuffer(null, iFieldTypes); //x new StringBuff();
((BaseBuffer)m_dataSource).fieldsToBuffer((FieldList)record);
} catch (Exception ex) {
throw DatabaseException.toDatabaseException(ex);
}
} | [
"public",
"void",
"fieldsToData",
"(",
"Rec",
"record",
")",
"throws",
"DBException",
"{",
"try",
"{",
"int",
"iFieldTypes",
"=",
"BaseBuffer",
".",
"PHYSICAL_FIELDS",
";",
"if",
"(",
"!",
"(",
"(",
"Record",
")",
"record",
")",
".",
"isAllSelected",
"(",
... | Move all the fields to the output buffer.
In this implementation, create a new VectorBuffer and move the fielddata to it.
@exception DBException File exception. | [
"Move",
"all",
"the",
"fields",
"to",
"the",
"output",
"buffer",
".",
"In",
"this",
"implementation",
"create",
"a",
"new",
"VectorBuffer",
"and",
"move",
"the",
"fielddata",
"to",
"it",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/db/client/src/main/java/org/jbundle/base/db/client/ClientTable.java#L561-L572 |
151,178 | aoindustries/ao-dao-base | src/main/java/com/aoindustries/dao/impl/GlobalCacheTable.java | GlobalCacheTable.tableUpdated | @Override
public void tableUpdated() {
super.tableUpdated();
synchronized(unsortedRowsCacheLock) {
unsortedRowsCache = null;
}
synchronized(sortedRowsCacheLock) {
sortedRowsCache = null;
}
synchronized(rowCacheLock) {
rowCacheLoaded = false;
rowCache.clear();
}
} | java | @Override
public void tableUpdated() {
super.tableUpdated();
synchronized(unsortedRowsCacheLock) {
unsortedRowsCache = null;
}
synchronized(sortedRowsCacheLock) {
sortedRowsCache = null;
}
synchronized(rowCacheLock) {
rowCacheLoaded = false;
rowCache.clear();
}
} | [
"@",
"Override",
"public",
"void",
"tableUpdated",
"(",
")",
"{",
"super",
".",
"tableUpdated",
"(",
")",
";",
"synchronized",
"(",
"unsortedRowsCacheLock",
")",
"{",
"unsortedRowsCache",
"=",
"null",
";",
"}",
"synchronized",
"(",
"sortedRowsCacheLock",
")",
... | Clears the global caches when the table is updated. | [
"Clears",
"the",
"global",
"caches",
"when",
"the",
"table",
"is",
"updated",
"."
] | b1cde7f8d976f2d1ab57d110a77e2399ffa595ac | https://github.com/aoindustries/ao-dao-base/blob/b1cde7f8d976f2d1ab57d110a77e2399ffa595ac/src/main/java/com/aoindustries/dao/impl/GlobalCacheTable.java#L74-L87 |
151,179 | jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/event/FileListener.java | FileListener.doInitialKey | public void doInitialKey()
{
FileListener nextListener = (FileListener)this.getNextEnabledListener();
if (nextListener != null)
{
boolean bOldState = nextListener.setEnabledListener(false); // Don't allow it to be called again
nextListener.doInitialKey();
nextListener.setEnabledListener(bOldState);
}
else if (this.getOwner() != null)
this.getOwner().doInitialKey();
} | java | public void doInitialKey()
{
FileListener nextListener = (FileListener)this.getNextEnabledListener();
if (nextListener != null)
{
boolean bOldState = nextListener.setEnabledListener(false); // Don't allow it to be called again
nextListener.doInitialKey();
nextListener.setEnabledListener(bOldState);
}
else if (this.getOwner() != null)
this.getOwner().doInitialKey();
} | [
"public",
"void",
"doInitialKey",
"(",
")",
"{",
"FileListener",
"nextListener",
"=",
"(",
"FileListener",
")",
"this",
".",
"getNextEnabledListener",
"(",
")",
";",
"if",
"(",
"nextListener",
"!=",
"null",
")",
"{",
"boolean",
"bOldState",
"=",
"nextListener"... | Setup the initial key position in this record... Save it! | [
"Setup",
"the",
"initial",
"key",
"position",
"in",
"this",
"record",
"...",
"Save",
"it!"
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/FileListener.java#L149-L160 |
151,180 | jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/event/FileListener.java | FileListener.writeField | public void writeField(ObjectOutputStream daOut, Converter converter) throws IOException
{
String strFieldName = DBConstants.BLANK;
if (converter != null) if (converter.getField() != null)
strFieldName = converter.getField().getClass().getName();
Object data = null;
if (converter != null)
data = converter.getData();
daOut.writeUTF(strFieldName);
daOut.writeObject(data);
} | java | public void writeField(ObjectOutputStream daOut, Converter converter) throws IOException
{
String strFieldName = DBConstants.BLANK;
if (converter != null) if (converter.getField() != null)
strFieldName = converter.getField().getClass().getName();
Object data = null;
if (converter != null)
data = converter.getData();
daOut.writeUTF(strFieldName);
daOut.writeObject(data);
} | [
"public",
"void",
"writeField",
"(",
"ObjectOutputStream",
"daOut",
",",
"Converter",
"converter",
")",
"throws",
"IOException",
"{",
"String",
"strFieldName",
"=",
"DBConstants",
".",
"BLANK",
";",
"if",
"(",
"converter",
"!=",
"null",
")",
"if",
"(",
"conver... | Encode and write this field's data to the stream.
@param daOut The output stream to marshal the data to.
@param converter The field to serialize. | [
"Encode",
"and",
"write",
"this",
"field",
"s",
"data",
"to",
"the",
"stream",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/FileListener.java#L405-L415 |
151,181 | jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/event/FileListener.java | FileListener.readField | public BaseField readField(ObjectInputStream daIn, BaseField fldCurrent) throws IOException, ClassNotFoundException
{
String strFieldName = daIn.readUTF();
Object objData = daIn.readObject();
if (fldCurrent == null) if (strFieldName.length() > 0)
{
fldCurrent = (BaseField)ClassServiceUtility.getClassService().makeObjectFromClassName(strFieldName);
if (fldCurrent != null)
{
fldCurrent.init(null, null, DBConstants.DEFAULT_FIELD_LENGTH, null, null);
if (this.getOwner() != null) // Make sure it is cleaned up
this.getOwner().addListener(new RemoveConverterOnCloseHandler(fldCurrent));
}
}
if (fldCurrent != null)
fldCurrent.setData(objData);
return fldCurrent;
} | java | public BaseField readField(ObjectInputStream daIn, BaseField fldCurrent) throws IOException, ClassNotFoundException
{
String strFieldName = daIn.readUTF();
Object objData = daIn.readObject();
if (fldCurrent == null) if (strFieldName.length() > 0)
{
fldCurrent = (BaseField)ClassServiceUtility.getClassService().makeObjectFromClassName(strFieldName);
if (fldCurrent != null)
{
fldCurrent.init(null, null, DBConstants.DEFAULT_FIELD_LENGTH, null, null);
if (this.getOwner() != null) // Make sure it is cleaned up
this.getOwner().addListener(new RemoveConverterOnCloseHandler(fldCurrent));
}
}
if (fldCurrent != null)
fldCurrent.setData(objData);
return fldCurrent;
} | [
"public",
"BaseField",
"readField",
"(",
"ObjectInputStream",
"daIn",
",",
"BaseField",
"fldCurrent",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"String",
"strFieldName",
"=",
"daIn",
".",
"readUTF",
"(",
")",
";",
"Object",
"objData",
"=",
... | Decode and read this field from the stream.
Will create a new field, init it and set the data if the field is not passed in.
@param daIn The input stream to unmarshal the data from.
@param fldCurrent The field to unmarshall the data into (optional). | [
"Decode",
"and",
"read",
"this",
"field",
"from",
"the",
"stream",
".",
"Will",
"create",
"a",
"new",
"field",
"init",
"it",
"and",
"set",
"the",
"data",
"if",
"the",
"field",
"is",
"not",
"passed",
"in",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/FileListener.java#L422-L439 |
151,182 | knowhowlab/org.knowhowlab.osgi.shell | felix-gogo/src/main/java/org/knowhowlab/osgi/shell/felixgogo/FelixGogoCommandsServiceGenerator.java | FelixGogoCommandsServiceGenerator.clean | public static void clean(String suffix) {
try {
CtClass ctClass = POOL.getCtClass(AbstractFelixCommandsService.class.getName() + suffix);
ctClass.defrost();
ctClass.detach();
} catch (NotFoundException e) {
LOG.log(Level.WARNING, "Unable to clean Console Service. " + e.getMessage(), e);
}
} | java | public static void clean(String suffix) {
try {
CtClass ctClass = POOL.getCtClass(AbstractFelixCommandsService.class.getName() + suffix);
ctClass.defrost();
ctClass.detach();
} catch (NotFoundException e) {
LOG.log(Level.WARNING, "Unable to clean Console Service. " + e.getMessage(), e);
}
} | [
"public",
"static",
"void",
"clean",
"(",
"String",
"suffix",
")",
"{",
"try",
"{",
"CtClass",
"ctClass",
"=",
"POOL",
".",
"getCtClass",
"(",
"AbstractFelixCommandsService",
".",
"class",
".",
"getName",
"(",
")",
"+",
"suffix",
")",
";",
"ctClass",
".",
... | Detach generated class
@param suffix unique class suffix | [
"Detach",
"generated",
"class"
] | 5c3172b1e6b741c753f02af48ab42adc4915a6ae | https://github.com/knowhowlab/org.knowhowlab.osgi.shell/blob/5c3172b1e6b741c753f02af48ab42adc4915a6ae/felix-gogo/src/main/java/org/knowhowlab/osgi/shell/felixgogo/FelixGogoCommandsServiceGenerator.java#L118-L126 |
151,183 | jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/ShortField.java | ShortField.getSQLType | public String getSQLType(boolean bIncludeLength, Map<String, Object> properties)
{
String strType = (String)properties.get(DBSQLTypes.SHORT);
if (strType == null)
strType = DBSQLTypes.SMALLINT; // The default SQL Type (Byte)
return strType; // The default SQL Type
} | java | public String getSQLType(boolean bIncludeLength, Map<String, Object> properties)
{
String strType = (String)properties.get(DBSQLTypes.SHORT);
if (strType == null)
strType = DBSQLTypes.SMALLINT; // The default SQL Type (Byte)
return strType; // The default SQL Type
} | [
"public",
"String",
"getSQLType",
"(",
"boolean",
"bIncludeLength",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"String",
"strType",
"=",
"(",
"String",
")",
"properties",
".",
"get",
"(",
"DBSQLTypes",
".",
"SHORT",
")",
";",
... | Get the SQL type of this field.
Typically SHORT or SMALLINT.
@param bIncludeLength Include the field length in this description.
@param properties Database properties to determine the SQL type.
@return The SQL Type. | [
"Get",
"the",
"SQL",
"type",
"of",
"this",
"field",
".",
"Typically",
"SHORT",
"or",
"SMALLINT",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/ShortField.java#L296-L302 |
151,184 | 99soft/sameas4j | src/main/java/org/nnsoft/sameas4j/AbstractEquivalenceDeserializer.java | AbstractEquivalenceDeserializer.urlEncode | public static String urlEncode(final String text) throws Exception {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
for (int b : toUTF8Bytes(text)) {
if (b < 0) {
b = 256 + b;
}
if (UNRESERVED_CHARS.get(b)) {
buffer.write(b);
} else {
buffer.write(URL_ESCAPE_CHAR);
char hex1 = Character.toUpperCase(Character.forDigit(
(b >> 4) & 0xF, 16));
char hex2 = Character.toUpperCase(Character.forDigit(b & 0xF,
16));
buffer.write(hex1);
buffer.write(hex2);
}
}
return new String(buffer.toByteArray());
} | java | public static String urlEncode(final String text) throws Exception {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
for (int b : toUTF8Bytes(text)) {
if (b < 0) {
b = 256 + b;
}
if (UNRESERVED_CHARS.get(b)) {
buffer.write(b);
} else {
buffer.write(URL_ESCAPE_CHAR);
char hex1 = Character.toUpperCase(Character.forDigit(
(b >> 4) & 0xF, 16));
char hex2 = Character.toUpperCase(Character.forDigit(b & 0xF,
16));
buffer.write(hex1);
buffer.write(hex2);
}
}
return new String(buffer.toByteArray());
} | [
"public",
"static",
"String",
"urlEncode",
"(",
"final",
"String",
"text",
")",
"throws",
"Exception",
"{",
"ByteArrayOutputStream",
"buffer",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"for",
"(",
"int",
"b",
":",
"toUTF8Bytes",
"(",
"text",
")",
"... | Encodes the given text.
@param text text to be encoded.
@return encoding result. | [
"Encodes",
"the",
"given",
"text",
"."
] | d6fcb6a137c5a80278001a6d11ee917be4f5ea41 | https://github.com/99soft/sameas4j/blob/d6fcb6a137c5a80278001a6d11ee917be4f5ea41/src/main/java/org/nnsoft/sameas4j/AbstractEquivalenceDeserializer.java#L103-L125 |
151,185 | JM-Lab/utils-java9 | src/main/java/kr/jm/utils/flow/publisher/LineSubmissionPublisher.java | LineSubmissionPublisher.submitFilePathOrClasspath | public int submitFilePathOrClasspath(
String filePathOrResourceClasspath) {
return submitStream(JMOptional
.getOptional(JMFiles.readLines(filePathOrResourceClasspath))
.orElseGet(() -> JMResources
.readLines(filePathOrResourceClasspath)).stream());
} | java | public int submitFilePathOrClasspath(
String filePathOrResourceClasspath) {
return submitStream(JMOptional
.getOptional(JMFiles.readLines(filePathOrResourceClasspath))
.orElseGet(() -> JMResources
.readLines(filePathOrResourceClasspath)).stream());
} | [
"public",
"int",
"submitFilePathOrClasspath",
"(",
"String",
"filePathOrResourceClasspath",
")",
"{",
"return",
"submitStream",
"(",
"JMOptional",
".",
"getOptional",
"(",
"JMFiles",
".",
"readLines",
"(",
"filePathOrResourceClasspath",
")",
")",
".",
"orElseGet",
"("... | Submit file path or classpath int.
@param filePathOrResourceClasspath the file path or resource classpath
@return the int | [
"Submit",
"file",
"path",
"or",
"classpath",
"int",
"."
] | ee80235b2760396a616cf7563cbdc98d4affe8e1 | https://github.com/JM-Lab/utils-java9/blob/ee80235b2760396a616cf7563cbdc98d4affe8e1/src/main/java/kr/jm/utils/flow/publisher/LineSubmissionPublisher.java#L64-L70 |
151,186 | OwlPlatform/java-owl-worldmodel | src/main/java/com/owlplatform/worldmodel/Attribute.java | Attribute.getSolverLength | public int getSolverLength() {
// Attribute name alias, creation date, Id length,
int length = 4 + 8 + 4;
// Id,
if (this.identifier != null) {
try {
length += this.identifier.getBytes("UTF-16BE").length;
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("Unable to encode UTF16 strings.", e);
}
}
// Data length
length += 4;
// Data
if (this.data != null) {
length += this.data.length;
}
return length;
} | java | public int getSolverLength() {
// Attribute name alias, creation date, Id length,
int length = 4 + 8 + 4;
// Id,
if (this.identifier != null) {
try {
length += this.identifier.getBytes("UTF-16BE").length;
} catch (UnsupportedEncodingException e) {
throw new RuntimeException("Unable to encode UTF16 strings.", e);
}
}
// Data length
length += 4;
// Data
if (this.data != null) {
length += this.data.length;
}
return length;
} | [
"public",
"int",
"getSolverLength",
"(",
")",
"{",
"// Attribute name alias, creation date, Id length,",
"int",
"length",
"=",
"4",
"+",
"8",
"+",
"4",
";",
"// Id,",
"if",
"(",
"this",
".",
"identifier",
"!=",
"null",
")",
"{",
"try",
"{",
"length",
"+=",
... | Returns the length of this attribute, in bytes, as encoded according to the
Solver-World Model protocol.
@return the length of the encoded form of this attribute object | [
"Returns",
"the",
"length",
"of",
"this",
"attribute",
"in",
"bytes",
"as",
"encoded",
"according",
"to",
"the",
"Solver",
"-",
"World",
"Model",
"protocol",
"."
] | a850e8b930c6e9787c7cad30c0de887858ca563d | https://github.com/OwlPlatform/java-owl-worldmodel/blob/a850e8b930c6e9787c7cad30c0de887858ca563d/src/main/java/com/owlplatform/worldmodel/Attribute.java#L106-L127 |
151,187 | microfocus-idol/java-configuration-impl | src/main/java/com/hp/autonomy/frontend/configuration/server/HostAndPort.java | HostAndPort.basicValidate | @Override
public void basicValidate(final String section) throws ConfigException {
if (StringUtils.isEmpty(host) || port == null || port <= 0 || port > MAX_PORT) {
throw new ConfigException(section, "Invalid host and port");
}
} | java | @Override
public void basicValidate(final String section) throws ConfigException {
if (StringUtils.isEmpty(host) || port == null || port <= 0 || port > MAX_PORT) {
throw new ConfigException(section, "Invalid host and port");
}
} | [
"@",
"Override",
"public",
"void",
"basicValidate",
"(",
"final",
"String",
"section",
")",
"throws",
"ConfigException",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"host",
")",
"||",
"port",
"==",
"null",
"||",
"port",
"<=",
"0",
"||",
"port",
"... | Returns the validation state of the config
@throws ConfigException if the hostname is empty or the port is not between 0 and 65536 | [
"Returns",
"the",
"validation",
"state",
"of",
"the",
"config"
] | cd9d744cacfaaae3c76cacc211e65742bbc7b00a | https://github.com/microfocus-idol/java-configuration-impl/blob/cd9d744cacfaaae3c76cacc211e65742bbc7b00a/src/main/java/com/hp/autonomy/frontend/configuration/server/HostAndPort.java#L35-L40 |
151,188 | pressgang-ccms/PressGangCCMSContentSpec | src/main/java/org/jboss/pressgang/ccms/contentspec/utils/logging/ErrorLoggerManager.java | ErrorLoggerManager.getLogger | public ErrorLogger getLogger(final String name) {
if (name == null || name.equals("")) return null;
if (!hasLog(name)) {
addLog(name);
}
return getLog(name);
} | java | public ErrorLogger getLogger(final String name) {
if (name == null || name.equals("")) return null;
if (!hasLog(name)) {
addLog(name);
}
return getLog(name);
} | [
"public",
"ErrorLogger",
"getLogger",
"(",
"final",
"String",
"name",
")",
"{",
"if",
"(",
"name",
"==",
"null",
"||",
"name",
".",
"equals",
"(",
"\"\"",
")",
")",
"return",
"null",
";",
"if",
"(",
"!",
"hasLog",
"(",
"name",
")",
")",
"{",
"addLo... | Gets a logger for a specified name. If the logger doesn't exist then it creates one.
@return An error logger object for the specified name | [
"Gets",
"a",
"logger",
"for",
"a",
"specified",
"name",
".",
"If",
"the",
"logger",
"doesn",
"t",
"exist",
"then",
"it",
"creates",
"one",
"."
] | 2bc02e2971e4522b47a130fb7ae5a0f5ad377df1 | https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/utils/logging/ErrorLoggerManager.java#L43-L49 |
151,189 | pressgang-ccms/PressGangCCMSContentSpec | src/main/java/org/jboss/pressgang/ccms/contentspec/utils/logging/ErrorLoggerManager.java | ErrorLoggerManager.getLog | public ErrorLogger getLog(final String name) {
return hasLog(name) ? logs.get(name) : null;
} | java | public ErrorLogger getLog(final String name) {
return hasLog(name) ? logs.get(name) : null;
} | [
"public",
"ErrorLogger",
"getLog",
"(",
"final",
"String",
"name",
")",
"{",
"return",
"hasLog",
"(",
"name",
")",
"?",
"logs",
".",
"get",
"(",
"name",
")",
":",
"null",
";",
"}"
] | Gets the error log
@param name The logger name
@return ErrorLogger | [
"Gets",
"the",
"error",
"log"
] | 2bc02e2971e4522b47a130fb7ae5a0f5ad377df1 | https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/utils/logging/ErrorLoggerManager.java#L89-L91 |
151,190 | pressgang-ccms/PressGangCCMSContentSpec | src/main/java/org/jboss/pressgang/ccms/contentspec/utils/logging/ErrorLoggerManager.java | ErrorLoggerManager.addLog | public void addLog(final String name) {
ErrorLogger log = new ErrorLogger(name);
logs.put(name, log);
log.setVerboseDebug(debugLevel);
} | java | public void addLog(final String name) {
ErrorLogger log = new ErrorLogger(name);
logs.put(name, log);
log.setVerboseDebug(debugLevel);
} | [
"public",
"void",
"addLog",
"(",
"final",
"String",
"name",
")",
"{",
"ErrorLogger",
"log",
"=",
"new",
"ErrorLogger",
"(",
"name",
")",
";",
"logs",
".",
"put",
"(",
"name",
",",
"log",
")",
";",
"log",
".",
"setVerboseDebug",
"(",
"debugLevel",
")",
... | Adds the error log
@param name The logger name | [
"Adds",
"the",
"error",
"log"
] | 2bc02e2971e4522b47a130fb7ae5a0f5ad377df1 | https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/utils/logging/ErrorLoggerManager.java#L98-L102 |
151,191 | pressgang-ccms/PressGangCCMSContentSpec | src/main/java/org/jboss/pressgang/ccms/contentspec/utils/logging/ErrorLoggerManager.java | ErrorLoggerManager.getLogs | public List<LogMessage> getLogs() {
final ArrayList<LogMessage> messages = new ArrayList<LogMessage>();
for (final String logName : logs.keySet()) {
messages.addAll(logs.get(logName).getLogMessages());
}
Collections.sort(messages, new LogMessageComparator());
return messages;
} | java | public List<LogMessage> getLogs() {
final ArrayList<LogMessage> messages = new ArrayList<LogMessage>();
for (final String logName : logs.keySet()) {
messages.addAll(logs.get(logName).getLogMessages());
}
Collections.sort(messages, new LogMessageComparator());
return messages;
} | [
"public",
"List",
"<",
"LogMessage",
">",
"getLogs",
"(",
")",
"{",
"final",
"ArrayList",
"<",
"LogMessage",
">",
"messages",
"=",
"new",
"ArrayList",
"<",
"LogMessage",
">",
"(",
")",
";",
"for",
"(",
"final",
"String",
"logName",
":",
"logs",
".",
"k... | Gets a list of all of the logs that are managed.
@return A List of all the log messages ordered by their timestamp. | [
"Gets",
"a",
"list",
"of",
"all",
"of",
"the",
"logs",
"that",
"are",
"managed",
"."
] | 2bc02e2971e4522b47a130fb7ae5a0f5ad377df1 | https://github.com/pressgang-ccms/PressGangCCMSContentSpec/blob/2bc02e2971e4522b47a130fb7ae5a0f5ad377df1/src/main/java/org/jboss/pressgang/ccms/contentspec/utils/logging/ErrorLoggerManager.java#L153-L160 |
151,192 | jbundle/jbundle | main/screen/src/main/java/org/jbundle/main/properties/db/PropertiesInput.java | PropertiesInput.setPropertiesField | public void setPropertiesField(Field fldProperties)
{
if (fldProperties != null)
{
m_fldProperties = (PropertiesField)fldProperties;
this.loadFieldProperties();
this.addListener(new FileListener(null)
{
public void setOwner(ListenerOwner owner)
{
if (owner == null)
if (this.getOwner() != null)
((PropertiesInput)PropertiesInput.this).restoreFieldProperties();
super.setOwner(owner);
}
});
}
} | java | public void setPropertiesField(Field fldProperties)
{
if (fldProperties != null)
{
m_fldProperties = (PropertiesField)fldProperties;
this.loadFieldProperties();
this.addListener(new FileListener(null)
{
public void setOwner(ListenerOwner owner)
{
if (owner == null)
if (this.getOwner() != null)
((PropertiesInput)PropertiesInput.this).restoreFieldProperties();
super.setOwner(owner);
}
});
}
} | [
"public",
"void",
"setPropertiesField",
"(",
"Field",
"fldProperties",
")",
"{",
"if",
"(",
"fldProperties",
"!=",
"null",
")",
"{",
"m_fldProperties",
"=",
"(",
"PropertiesField",
")",
"fldProperties",
";",
"this",
".",
"loadFieldProperties",
"(",
")",
";",
"... | SetPropertiesField Method. | [
"SetPropertiesField",
"Method",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/screen/src/main/java/org/jbundle/main/properties/db/PropertiesInput.java#L142-L159 |
151,193 | jbundle/jbundle | main/screen/src/main/java/org/jbundle/main/properties/db/PropertiesInput.java | PropertiesInput.loadFieldProperties | public void loadFieldProperties(Field fldProperties)
{
if (fldProperties == null)
return;
boolean[] rgbEnabled = this.setEnableListeners(false);;
try {
this.setKeyArea(PropertiesInput.KEY_KEY);
// First, delete the old records
this.close();
while (this.hasNext())
{
this.next();
this.edit();
this.remove();
}
// Now, add the properties to the record
Map<String,Object> properties = ((PropertiesField)fldProperties).getProperties();
Iterator<String> iterator = properties.keySet().iterator();
while (iterator.hasNext())
{
String strKey = iterator.next();
String strValue = (String)properties.get(strKey);
this.addNew();
this.getField(PropertiesInput.KEY).setString(strKey);
if (this.seek(null))
{
this.edit();
this.remove();
}
this.addNew();
this.getField(PropertiesInput.KEY).setString(strKey);
this.getField(PropertiesInput.VALUE).setString(strValue);
this.add();
}
if (this.getRecordOwner() instanceof GridScreen)
((GridScreen)this.getRecordOwner()).reSelectRecords();
} catch (DBException ex) {
ex.printStackTrace();
} finally {
this.setEnableListeners(rgbEnabled);
}
} | java | public void loadFieldProperties(Field fldProperties)
{
if (fldProperties == null)
return;
boolean[] rgbEnabled = this.setEnableListeners(false);;
try {
this.setKeyArea(PropertiesInput.KEY_KEY);
// First, delete the old records
this.close();
while (this.hasNext())
{
this.next();
this.edit();
this.remove();
}
// Now, add the properties to the record
Map<String,Object> properties = ((PropertiesField)fldProperties).getProperties();
Iterator<String> iterator = properties.keySet().iterator();
while (iterator.hasNext())
{
String strKey = iterator.next();
String strValue = (String)properties.get(strKey);
this.addNew();
this.getField(PropertiesInput.KEY).setString(strKey);
if (this.seek(null))
{
this.edit();
this.remove();
}
this.addNew();
this.getField(PropertiesInput.KEY).setString(strKey);
this.getField(PropertiesInput.VALUE).setString(strValue);
this.add();
}
if (this.getRecordOwner() instanceof GridScreen)
((GridScreen)this.getRecordOwner()).reSelectRecords();
} catch (DBException ex) {
ex.printStackTrace();
} finally {
this.setEnableListeners(rgbEnabled);
}
} | [
"public",
"void",
"loadFieldProperties",
"(",
"Field",
"fldProperties",
")",
"{",
"if",
"(",
"fldProperties",
"==",
"null",
")",
"return",
";",
"boolean",
"[",
"]",
"rgbEnabled",
"=",
"this",
".",
"setEnableListeners",
"(",
"false",
")",
";",
";",
"try",
"... | LoadFieldProperties Method. | [
"LoadFieldProperties",
"Method",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/screen/src/main/java/org/jbundle/main/properties/db/PropertiesInput.java#L170-L211 |
151,194 | jbundle/jbundle | main/screen/src/main/java/org/jbundle/main/properties/db/PropertiesInput.java | PropertiesInput.restoreFieldProperties | public void restoreFieldProperties(PropertiesField fldProperties)
{
if (fldProperties == null)
return;
try {
// This may seem a little wierd, but by doing this, I won't change the field if there was no change.
Map<String,Object> properties = fldProperties.getProperties();
this.close();
while (this.hasNext())
{
this.next();
String strKey = this.getField(PropertiesInput.KEY).getString();
String strValue = this.getField(PropertiesInput.VALUE).getString();
if (strValue != null)
if (strValue.length() > 0)
{
fldProperties.setProperty(strKey, strValue);
properties.remove(strKey);
}
}
Iterator<String> iterator = properties.keySet().iterator();
while (iterator.hasNext())
{
String strKey = iterator.next();
fldProperties.setProperty(strKey, null);
}
} catch (DBException ex) {
ex.printStackTrace();
}
} | java | public void restoreFieldProperties(PropertiesField fldProperties)
{
if (fldProperties == null)
return;
try {
// This may seem a little wierd, but by doing this, I won't change the field if there was no change.
Map<String,Object> properties = fldProperties.getProperties();
this.close();
while (this.hasNext())
{
this.next();
String strKey = this.getField(PropertiesInput.KEY).getString();
String strValue = this.getField(PropertiesInput.VALUE).getString();
if (strValue != null)
if (strValue.length() > 0)
{
fldProperties.setProperty(strKey, strValue);
properties.remove(strKey);
}
}
Iterator<String> iterator = properties.keySet().iterator();
while (iterator.hasNext())
{
String strKey = iterator.next();
fldProperties.setProperty(strKey, null);
}
} catch (DBException ex) {
ex.printStackTrace();
}
} | [
"public",
"void",
"restoreFieldProperties",
"(",
"PropertiesField",
"fldProperties",
")",
"{",
"if",
"(",
"fldProperties",
"==",
"null",
")",
"return",
";",
"try",
"{",
"// This may seem a little wierd, but by doing this, I won't change the field if there was no change.",
"Map"... | RestoreFieldProperties Method. | [
"RestoreFieldProperties",
"Method",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/screen/src/main/java/org/jbundle/main/properties/db/PropertiesInput.java#L222-L251 |
151,195 | trellis-ldp-archive/trellis-constraint-rules | src/main/java/org/trellisldp/constraint/LdpConstraints.java | LdpConstraints.inDomainRangeFilter | private static Predicate<Triple> inDomainRangeFilter(final String domain) {
return triple -> propertiesWithInDomainRange.contains(triple.getPredicate()) &&
!triple.getObject().ntriplesString().startsWith("<" + domain);
} | java | private static Predicate<Triple> inDomainRangeFilter(final String domain) {
return triple -> propertiesWithInDomainRange.contains(triple.getPredicate()) &&
!triple.getObject().ntriplesString().startsWith("<" + domain);
} | [
"private",
"static",
"Predicate",
"<",
"Triple",
">",
"inDomainRangeFilter",
"(",
"final",
"String",
"domain",
")",
"{",
"return",
"triple",
"->",
"propertiesWithInDomainRange",
".",
"contains",
"(",
"triple",
".",
"getPredicate",
"(",
")",
")",
"&&",
"!",
"tr... | Verify that the range of the property is in the repository domain | [
"Verify",
"that",
"the",
"range",
"of",
"the",
"property",
"is",
"in",
"the",
"repository",
"domain"
] | e038f421da71a42591a69565575300f848271503 | https://github.com/trellis-ldp-archive/trellis-constraint-rules/blob/e038f421da71a42591a69565575300f848271503/src/main/java/org/trellisldp/constraint/LdpConstraints.java#L111-L114 |
151,196 | webpagebytes/general-cms-plugins | src/main/java/com/webpagebytes/plugins/WPBMemCacheFactory.java | WPBMemCacheFactory.initialize | public void initialize(Map<String, String> params) throws WPBIOException
{
try
{
memcacheClient = new WPBMemCacheClient();
String address = "";
if (params!= null && params.get(CONFIG_MEMCACHE_SERVERS) != null)
{
address = params.get(CONFIG_MEMCACHE_SERVERS);
}
memcacheClient.initialize(address);
if (params.get(CONFIG_MEMCACHE_CHECK_INTERVAL) != null)
{
try
{
sleepTime = Integer.valueOf(params.get(CONFIG_MEMCACHE_CHECK_INTERVAL));
} catch (NumberFormatException e)
{
// do nothing, rely on default value
}
}
WPBMemCacheSyncRunnable syncRunnable = new WPBMemCacheSyncRunnable(this, memcacheClient, sleepTime);
(new Thread(syncRunnable)).start();
} catch (IOException e)
{
throw new WPBIOException("cannot create memcache client", e);
}
} | java | public void initialize(Map<String, String> params) throws WPBIOException
{
try
{
memcacheClient = new WPBMemCacheClient();
String address = "";
if (params!= null && params.get(CONFIG_MEMCACHE_SERVERS) != null)
{
address = params.get(CONFIG_MEMCACHE_SERVERS);
}
memcacheClient.initialize(address);
if (params.get(CONFIG_MEMCACHE_CHECK_INTERVAL) != null)
{
try
{
sleepTime = Integer.valueOf(params.get(CONFIG_MEMCACHE_CHECK_INTERVAL));
} catch (NumberFormatException e)
{
// do nothing, rely on default value
}
}
WPBMemCacheSyncRunnable syncRunnable = new WPBMemCacheSyncRunnable(this, memcacheClient, sleepTime);
(new Thread(syncRunnable)).start();
} catch (IOException e)
{
throw new WPBIOException("cannot create memcache client", e);
}
} | [
"public",
"void",
"initialize",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"throws",
"WPBIOException",
"{",
"try",
"{",
"memcacheClient",
"=",
"new",
"WPBMemCacheClient",
"(",
")",
";",
"String",
"address",
"=",
"\"\"",
";",
"if",
"(",
... | default sleep time is 10 seconds | [
"default",
"sleep",
"time",
"is",
"10",
"seconds"
] | 610dbaa49d92695be642d1888b30bc4671e1b9c1 | https://github.com/webpagebytes/general-cms-plugins/blob/610dbaa49d92695be642d1888b30bc4671e1b9c1/src/main/java/com/webpagebytes/plugins/WPBMemCacheFactory.java#L50-L79 |
151,197 | jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/event/SelectOnUpdateHandler.java | SelectOnUpdateHandler.init | public void init(Record record, Record recordToSync, boolean bUpdateOnSelect)
{
super.init(record, null, recordToSync, bUpdateOnSelect, DBConstants.SELECT_TYPE);
} | java | public void init(Record record, Record recordToSync, boolean bUpdateOnSelect)
{
super.init(record, null, recordToSync, bUpdateOnSelect, DBConstants.SELECT_TYPE);
} | [
"public",
"void",
"init",
"(",
"Record",
"record",
",",
"Record",
"recordToSync",
",",
"boolean",
"bUpdateOnSelect",
")",
"{",
"super",
".",
"init",
"(",
"record",
",",
"null",
",",
"recordToSync",
",",
"bUpdateOnSelect",
",",
"DBConstants",
".",
"SELECT_TYPE"... | SelectOnUpdateHandler - Constructor.
@param recordToSync The record to synchronize with this one.
@param bUpdateOnSelect If true, update or add a record in progress before syncing this record. | [
"SelectOnUpdateHandler",
"-",
"Constructor",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/SelectOnUpdateHandler.java#L50-L53 |
151,198 | jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/event/RecordChangedHandler.java | RecordChangedHandler.doErrorReturn | public int doErrorReturn(int iChangeType, int iErrorCode) // init this field override for other value
{
if (iChangeType == DBConstants.AFTER_UPDATE_TYPE)
if (this.isModLockMode())
{
if (this.getOwner().getTable().getCurrentTable() == this.getOwner().getTable())
{ // Must be the top-level record to do the merge. Otherwise, return an error and let the current record handle the merge
boolean bRunMergeCode = false;
if ((this.getOwner().getMasterSlave() & RecordOwner.MASTER) != 0)
if ((this.getOwner().getDatabaseType() & DBConstants.SERVER_REWRITES) == 0)
bRunMergeCode = true; // Typically refresh in the client so listeners can be run
if ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) != 0)
if ((this.getOwner().getDatabaseType() & DBConstants.SERVER_REWRITES) != 0)
bRunMergeCode = true; // Unless server rewrite is set, then do the rewrite in the server
if (bRunMergeCode)
return this.refreshMergeAndRewrite(iErrorCode); // Only do this in the master and shared code
}
}
return super.doErrorReturn(iChangeType, iErrorCode);
} | java | public int doErrorReturn(int iChangeType, int iErrorCode) // init this field override for other value
{
if (iChangeType == DBConstants.AFTER_UPDATE_TYPE)
if (this.isModLockMode())
{
if (this.getOwner().getTable().getCurrentTable() == this.getOwner().getTable())
{ // Must be the top-level record to do the merge. Otherwise, return an error and let the current record handle the merge
boolean bRunMergeCode = false;
if ((this.getOwner().getMasterSlave() & RecordOwner.MASTER) != 0)
if ((this.getOwner().getDatabaseType() & DBConstants.SERVER_REWRITES) == 0)
bRunMergeCode = true; // Typically refresh in the client so listeners can be run
if ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) != 0)
if ((this.getOwner().getDatabaseType() & DBConstants.SERVER_REWRITES) != 0)
bRunMergeCode = true; // Unless server rewrite is set, then do the rewrite in the server
if (bRunMergeCode)
return this.refreshMergeAndRewrite(iErrorCode); // Only do this in the master and shared code
}
}
return super.doErrorReturn(iChangeType, iErrorCode);
} | [
"public",
"int",
"doErrorReturn",
"(",
"int",
"iChangeType",
",",
"int",
"iErrorCode",
")",
"// init this field override for other value",
"{",
"if",
"(",
"iChangeType",
"==",
"DBConstants",
".",
"AFTER_UPDATE_TYPE",
")",
"if",
"(",
"this",
".",
"isModLockMode",
"("... | Called when a error happens on a file operation, return the error code, or fix the problem.
@param changeType The type of change that occurred.
@param iErrorCode The error code from the previous listener.
@return The new error code. | [
"Called",
"when",
"a",
"error",
"happens",
"on",
"a",
"file",
"operation",
"return",
"the",
"error",
"code",
"or",
"fix",
"the",
"problem",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/RecordChangedHandler.java#L133-L152 |
151,199 | jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/event/RecordChangedHandler.java | RecordChangedHandler.isModLockMode | public boolean isModLockMode()
{
Record record = this.getOwner();
if (record != null)
if ((record.getOpenMode() & DBConstants.OPEN_LAST_MOD_LOCK_TYPE) == DBConstants.OPEN_LAST_MOD_LOCK_TYPE)
return true;
return false;
} | java | public boolean isModLockMode()
{
Record record = this.getOwner();
if (record != null)
if ((record.getOpenMode() & DBConstants.OPEN_LAST_MOD_LOCK_TYPE) == DBConstants.OPEN_LAST_MOD_LOCK_TYPE)
return true;
return false;
} | [
"public",
"boolean",
"isModLockMode",
"(",
")",
"{",
"Record",
"record",
"=",
"this",
".",
"getOwner",
"(",
")",
";",
"if",
"(",
"record",
"!=",
"null",
")",
"if",
"(",
"(",
"record",
".",
"getOpenMode",
"(",
")",
"&",
"DBConstants",
".",
"OPEN_LAST_MO... | Am I checking for modification locks?
@return True if I am. | [
"Am",
"I",
"checking",
"for",
"modification",
"locks?"
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/event/RecordChangedHandler.java#L157-L164 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.