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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
10,000 | aerogear/aerogear-android-push | library/src/main/java/org/jboss/aerogear/android/unifiedpush/fcm/AeroGearFCMPushRegistrar.java | AeroGearFCMPushRegistrar.sendMetrics | @Override
public void sendMetrics(final UnifiedPushMetricsMessage metricsMessage,
final Callback<UnifiedPushMetricsMessage> callback) {
new AsyncTask<Void, Void, Exception>() {
@Override
protected Exception doInBackground(Void... params) {
try {
... | java | @Override
public void sendMetrics(final UnifiedPushMetricsMessage metricsMessage,
final Callback<UnifiedPushMetricsMessage> callback) {
new AsyncTask<Void, Void, Exception>() {
@Override
protected Exception doInBackground(Void... params) {
try {
... | [
"@",
"Override",
"public",
"void",
"sendMetrics",
"(",
"final",
"UnifiedPushMetricsMessage",
"metricsMessage",
",",
"final",
"Callback",
"<",
"UnifiedPushMetricsMessage",
">",
"callback",
")",
"{",
"new",
"AsyncTask",
"<",
"Void",
",",
"Void",
",",
"Exception",
">... | Send a confirmation the message was opened
@param metricsMessage The id of the message received
@param callback a callback. | [
"Send",
"a",
"confirmation",
"the",
"message",
"was",
"opened"
] | f21f93393a9f4590e9a8d6d045ab9aabca3d211f | https://github.com/aerogear/aerogear-android-push/blob/f21f93393a9f4590e9a8d6d045ab9aabca3d211f/library/src/main/java/org/jboss/aerogear/android/unifiedpush/fcm/AeroGearFCMPushRegistrar.java#L311-L351 |
10,001 | aerogear/aerogear-android-push | library/src/main/java/org/jboss/aerogear/android/unifiedpush/fcm/AeroGearFCMPushRegistrar.java | AeroGearFCMPushRegistrar.removeSavedPostData | private void removeSavedPostData(Context appContext) {
preferenceProvider.get(appContext).edit()
.remove(String.format(REGISTRAR_PREFERENCE_TEMPLATE, senderId))
.commit();
} | java | private void removeSavedPostData(Context appContext) {
preferenceProvider.get(appContext).edit()
.remove(String.format(REGISTRAR_PREFERENCE_TEMPLATE, senderId))
.commit();
} | [
"private",
"void",
"removeSavedPostData",
"(",
"Context",
"appContext",
")",
"{",
"preferenceProvider",
".",
"get",
"(",
"appContext",
")",
".",
"edit",
"(",
")",
".",
"remove",
"(",
"String",
".",
"format",
"(",
"REGISTRAR_PREFERENCE_TEMPLATE",
",",
"senderId",... | We are no longer registered. We do not need to respond to changes in
registration token.
@param appContext the application Context | [
"We",
"are",
"no",
"longer",
"registered",
".",
"We",
"do",
"not",
"need",
"to",
"respond",
"to",
"changes",
"in",
"registration",
"token",
"."
] | f21f93393a9f4590e9a8d6d045ab9aabca3d211f | https://github.com/aerogear/aerogear-android-push/blob/f21f93393a9f4590e9a8d6d045ab9aabca3d211f/library/src/main/java/org/jboss/aerogear/android/unifiedpush/fcm/AeroGearFCMPushRegistrar.java#L383-L387 |
10,002 | aerogear/aerogear-android-push | library/src/main/java/org/jboss/aerogear/android/unifiedpush/fcm/AeroGearFCMPushRegistrar.java | AeroGearFCMPushRegistrar.getOldToken | private String getOldToken(Context appContext) {
String jsonData = preferenceProvider.get(appContext).getString(String.format(REGISTRAR_PREFERENCE_TEMPLATE, senderId), "");
if (jsonData.isEmpty()) {
return "";
}
JsonObject jsonedPreferences = new JsonParser().parse(j... | java | private String getOldToken(Context appContext) {
String jsonData = preferenceProvider.get(appContext).getString(String.format(REGISTRAR_PREFERENCE_TEMPLATE, senderId), "");
if (jsonData.isEmpty()) {
return "";
}
JsonObject jsonedPreferences = new JsonParser().parse(j... | [
"private",
"String",
"getOldToken",
"(",
"Context",
"appContext",
")",
"{",
"String",
"jsonData",
"=",
"preferenceProvider",
".",
"get",
"(",
"appContext",
")",
".",
"getString",
"(",
"String",
".",
"format",
"(",
"REGISTRAR_PREFERENCE_TEMPLATE",
",",
"senderId",
... | Returns the most recently used deviceToken
@return a deviceToken or an empty string | [
"Returns",
"the",
"most",
"recently",
"used",
"deviceToken"
] | f21f93393a9f4590e9a8d6d045ab9aabca3d211f | https://github.com/aerogear/aerogear-android-push/blob/f21f93393a9f4590e9a8d6d045ab9aabca3d211f/library/src/main/java/org/jboss/aerogear/android/unifiedpush/fcm/AeroGearFCMPushRegistrar.java#L393-L409 |
10,003 | amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/RiceEncoder.java | RiceEncoder.beginResidual | public static int beginResidual(boolean useFiveBitParam, byte order,
EncodedElement ele) {
ele = ele.getEnd();
int paramSize = (useFiveBitParam) ? 1:0;
ele.addInt(paramSize, 2);
ele.addInt(order, 4);
return 6;
} | java | public static int beginResidual(boolean useFiveBitParam, byte order,
EncodedElement ele) {
ele = ele.getEnd();
int paramSize = (useFiveBitParam) ? 1:0;
ele.addInt(paramSize, 2);
ele.addInt(order, 4);
return 6;
} | [
"public",
"static",
"int",
"beginResidual",
"(",
"boolean",
"useFiveBitParam",
",",
"byte",
"order",
",",
"EncodedElement",
"ele",
")",
"{",
"ele",
"=",
"ele",
".",
"getEnd",
"(",
")",
";",
"int",
"paramSize",
"=",
"(",
"useFiveBitParam",
")",
"?",
"1",
... | Create the residual headers for a FLAC stream.
@param useFiveBitParam Set TRUE if using a five-bit parameter size, FALSE
for a four-bit parameter
@param order Specify order of partitions to be used(actual number of
partitions will be 2^order.
@param ele EncodedElement to write header to.
@return total written size o... | [
"Create",
"the",
"residual",
"headers",
"for",
"a",
"FLAC",
"stream",
"."
] | 3d536b877dee2a3fd4ab2e0d9569e292cae93bc9 | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/RiceEncoder.java#L61-L68 |
10,004 | amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/FrameThread.java | FrameThread.run | public void run() {
boolean process = true;
synchronized(this) {
BlockEncodeRequest ber = manager.getWaitingRequest();
if(ber != null && ber.frameNumber < 0)
ber = null;
while(ber != null && process) {
if(ber.frameNumber < 0) {
process = false;
}
else... | java | public void run() {
boolean process = true;
synchronized(this) {
BlockEncodeRequest ber = manager.getWaitingRequest();
if(ber != null && ber.frameNumber < 0)
ber = null;
while(ber != null && process) {
if(ber.frameNumber < 0) {
process = false;
}
else... | [
"public",
"void",
"run",
"(",
")",
"{",
"boolean",
"process",
"=",
"true",
";",
"synchronized",
"(",
"this",
")",
"{",
"BlockEncodeRequest",
"ber",
"=",
"manager",
".",
"getWaitingRequest",
"(",
")",
";",
"if",
"(",
"ber",
"!=",
"null",
"&&",
"ber",
".... | Run method. This FrameThread will get a BlockEncodeRequest from the
BlockThreadManager, encode the block, return it to the manager, then
repeat. If no BlockEncodeRequest is available, or if it recieves a
request with the "frameNumber" field set to a negative value, it will
break the loop and end, notifying the manager ... | [
"Run",
"method",
".",
"This",
"FrameThread",
"will",
"get",
"a",
"BlockEncodeRequest",
"from",
"the",
"BlockThreadManager",
"encode",
"the",
"block",
"return",
"it",
"to",
"the",
"manager",
"then",
"repeat",
".",
"If",
"no",
"BlockEncodeRequest",
"is",
"availabl... | 3d536b877dee2a3fd4ab2e0d9569e292cae93bc9 | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/FrameThread.java#L65-L85 |
10,005 | amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/FLACFileOutputStream.java | FLACFileOutputStream.write | public void write(byte data) throws IOException {
fos.write(data);
if(position + 1 > size)
size = position+1;
position+= 1;
} | java | public void write(byte data) throws IOException {
fos.write(data);
if(position + 1 > size)
size = position+1;
position+= 1;
} | [
"public",
"void",
"write",
"(",
"byte",
"data",
")",
"throws",
"IOException",
"{",
"fos",
".",
"write",
"(",
"data",
")",
";",
"if",
"(",
"position",
"+",
"1",
">",
"size",
")",
"size",
"=",
"position",
"+",
"1",
";",
"position",
"+=",
"1",
";",
... | Write a byte to this stream.
@param data byte to write.
@throws IOException IOException will be raised if an error occurred while
writing. | [
"Write",
"a",
"byte",
"to",
"this",
"stream",
"."
] | 3d536b877dee2a3fd4ab2e0d9569e292cae93bc9 | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/FLACFileOutputStream.java#L98-L103 |
10,006 | amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/FLACEncoder.java | FLACEncoder.addSamples | public void addSamples(int[] samples, int count) {
assert(count*streamConfig.getChannelCount() <= samples.length);
if(samples.length < count*streamConfig.getChannelCount())
throw new IllegalArgumentException("count given exceeds samples array bounds");
sampleLock.lock();
try {
//get number o... | java | public void addSamples(int[] samples, int count) {
assert(count*streamConfig.getChannelCount() <= samples.length);
if(samples.length < count*streamConfig.getChannelCount())
throw new IllegalArgumentException("count given exceeds samples array bounds");
sampleLock.lock();
try {
//get number o... | [
"public",
"void",
"addSamples",
"(",
"int",
"[",
"]",
"samples",
",",
"int",
"count",
")",
"{",
"assert",
"(",
"count",
"*",
"streamConfig",
".",
"getChannelCount",
"(",
")",
"<=",
"samples",
".",
"length",
")",
";",
"if",
"(",
"samples",
".",
"length"... | Add samples to the encoder, so they may then be encoded. This method uses
breaks the samples into blocks, which will then be made available to
encode.
@param samples Array holding the samples to encode. For all multi-channel
audio, the samples must be interleaved in this array. For example, with
stereo: sample 0 will ... | [
"Add",
"samples",
"to",
"the",
"encoder",
"so",
"they",
"may",
"then",
"be",
"encoded",
".",
"This",
"method",
"uses",
"breaks",
"the",
"samples",
"into",
"blocks",
"which",
"will",
"then",
"be",
"made",
"available",
"to",
"encode",
"."
] | 3d536b877dee2a3fd4ab2e0d9569e292cae93bc9 | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/FLACEncoder.java#L386-L414 |
10,007 | amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/FLACEncoder.java | FLACEncoder.checkForThreadErrors | private void checkForThreadErrors() throws IOException {
if(error == true && childException != null) {
error = false;
IOException temp = childException;
childException = null;
throw temp;
}
} | java | private void checkForThreadErrors() throws IOException {
if(error == true && childException != null) {
error = false;
IOException temp = childException;
childException = null;
throw temp;
}
} | [
"private",
"void",
"checkForThreadErrors",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"error",
"==",
"true",
"&&",
"childException",
"!=",
"null",
")",
"{",
"error",
"=",
"false",
";",
"IOException",
"temp",
"=",
"childException",
";",
"childException"... | Attempts to throw a stored exception that had been caught from a child
thread. This method should be called regularly in any public method to
let the calling thread know a problem occured.
@throws IOException | [
"Attempts",
"to",
"throw",
"a",
"stored",
"exception",
"that",
"had",
"been",
"caught",
"from",
"a",
"child",
"thread",
".",
"This",
"method",
"should",
"be",
"called",
"regularly",
"in",
"any",
"public",
"method",
"to",
"let",
"the",
"calling",
"thread",
... | 3d536b877dee2a3fd4ab2e0d9569e292cae93bc9 | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/FLACEncoder.java#L464-L471 |
10,008 | amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/FLACEncoder.java | FLACEncoder.encodeSamples | public int encodeSamples(int count, final boolean end) throws IOException {
int encodedCount = 0;
streamLock.lock();
try {
checkForThreadErrors();
int channels = streamConfig.getChannelCount();
boolean encodeError = false;
while(count > 0 && preparedRequests.size() > 0 && !encodeErro... | java | public int encodeSamples(int count, final boolean end) throws IOException {
int encodedCount = 0;
streamLock.lock();
try {
checkForThreadErrors();
int channels = streamConfig.getChannelCount();
boolean encodeError = false;
while(count > 0 && preparedRequests.size() > 0 && !encodeErro... | [
"public",
"int",
"encodeSamples",
"(",
"int",
"count",
",",
"final",
"boolean",
"end",
")",
"throws",
"IOException",
"{",
"int",
"encodedCount",
"=",
"0",
";",
"streamLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"checkForThreadErrors",
"(",
")",
";",
"... | Attempt to Encode a certain number of samples. Encodes as close to count
as possible.
@param count number of samples to attempt to encode. Actual number
encoded may be greater or less if count does not end on a block boundary.
@param end true to finalize stream after encode, false otherwise. If set
to true, and retur... | [
"Attempt",
"to",
"Encode",
"a",
"certain",
"number",
"of",
"samples",
".",
"Encodes",
"as",
"close",
"to",
"count",
"as",
"possible",
"."
] | 3d536b877dee2a3fd4ab2e0d9569e292cae93bc9 | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/FLACEncoder.java#L575-L629 |
10,009 | amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/FLACEncoder.java | FLACEncoder.setOutputStream | public void setOutputStream(FLACOutputStream fos) {
if(fos == null)
throw new IllegalArgumentException("FLACOutputStream fos must not be null.");
if(flacWriter == null)
flacWriter = new FLACStreamController(fos,streamConfig);
else
flacWriter.setFLACOutputStream(fos);
} | java | public void setOutputStream(FLACOutputStream fos) {
if(fos == null)
throw new IllegalArgumentException("FLACOutputStream fos must not be null.");
if(flacWriter == null)
flacWriter = new FLACStreamController(fos,streamConfig);
else
flacWriter.setFLACOutputStream(fos);
} | [
"public",
"void",
"setOutputStream",
"(",
"FLACOutputStream",
"fos",
")",
"{",
"if",
"(",
"fos",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"FLACOutputStream fos must not be null.\"",
")",
";",
"if",
"(",
"flacWriter",
"==",
"null",
")",... | Set the output stream to use. This must not be called while an encode
process is active, or a flac stream is already opened.
@param fos output stream to use. This must not be null. | [
"Set",
"the",
"output",
"stream",
"to",
"use",
".",
"This",
"must",
"not",
"be",
"called",
"while",
"an",
"encode",
"process",
"is",
"active",
"or",
"a",
"flac",
"stream",
"is",
"already",
"opened",
"."
] | 3d536b877dee2a3fd4ab2e0d9569e292cae93bc9 | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/FLACEncoder.java#L688-L695 |
10,010 | amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/FLAC_FileEncoder.java | FLAC_FileEncoder.encode | public Status encode(File inputFile, File outputFile) {
Status status = Status.FULL_ENCODE;
this.outFile = outputFile;
//take file and initial configuration.
//open file
AudioInputStream sin = null;
AudioFormat format = null;
try {
sin = AudioSystem.getAudioInputStream(inputFile);
... | java | public Status encode(File inputFile, File outputFile) {
Status status = Status.FULL_ENCODE;
this.outFile = outputFile;
//take file and initial configuration.
//open file
AudioInputStream sin = null;
AudioFormat format = null;
try {
sin = AudioSystem.getAudioInputStream(inputFile);
... | [
"public",
"Status",
"encode",
"(",
"File",
"inputFile",
",",
"File",
"outputFile",
")",
"{",
"Status",
"status",
"=",
"Status",
".",
"FULL_ENCODE",
";",
"this",
".",
"outFile",
"=",
"outputFile",
";",
"//take file and initial configuration.",
"//open file",
"Audio... | Encode the given input wav file to an output file.
@param inputFile Input wav file to encode.
@param outputFile Output file to write FLAC stream to. If file exists, it
will be overwritten without prompting.
@return Status flag for encode | [
"Encode",
"the",
"given",
"input",
"wav",
"file",
"to",
"an",
"output",
"file",
"."
] | 3d536b877dee2a3fd4ab2e0d9569e292cae93bc9 | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/FLAC_FileEncoder.java#L155-L207 |
10,011 | mojohaus/clirr-maven-plugin | src/main/java/org/codehaus/mojo/clirr/ClirrReportGenerator.java | ClirrReportGenerator.createNullObject | private Difference createNullObject()
{
Difference difference = new Difference();
difference.setClassName("");
difference.setMethod("");
difference.setField("");
difference.setFrom("");
difference.setTo("");
difference.setJustification( bundle.getString( "repo... | java | private Difference createNullObject()
{
Difference difference = new Difference();
difference.setClassName("");
difference.setMethod("");
difference.setField("");
difference.setFrom("");
difference.setTo("");
difference.setJustification( bundle.getString( "repo... | [
"private",
"Difference",
"createNullObject",
"(",
")",
"{",
"Difference",
"difference",
"=",
"new",
"Difference",
"(",
")",
";",
"difference",
".",
"setClassName",
"(",
"\"\"",
")",
";",
"difference",
".",
"setMethod",
"(",
"\"\"",
")",
";",
"difference",
".... | Use a null object to avoid doing null checks everywhere. | [
"Use",
"a",
"null",
"object",
"to",
"avoid",
"doing",
"null",
"checks",
"everywhere",
"."
] | 4348dc31ee003097fa352b1cc3a607dda502bb4c | https://github.com/mojohaus/clirr-maven-plugin/blob/4348dc31ee003097fa352b1cc3a607dda502bb4c/src/main/java/org/codehaus/mojo/clirr/ClirrReportGenerator.java#L530-L540 |
10,012 | mojohaus/clirr-maven-plugin | src/main/java/org/codehaus/mojo/clirr/Difference.java | Difference.matches4000 | private boolean matches4000( ApiDifference apiDiff )
{
throwIfMissing( false, false, false, true );
String newIface = getArgs( apiDiff )[0];
newIface = newIface.replace( '.', '/' );
return SelectorUtils.matchPath( to, newIface, "/", true );
} | java | private boolean matches4000( ApiDifference apiDiff )
{
throwIfMissing( false, false, false, true );
String newIface = getArgs( apiDiff )[0];
newIface = newIface.replace( '.', '/' );
return SelectorUtils.matchPath( to, newIface, "/", true );
} | [
"private",
"boolean",
"matches4000",
"(",
"ApiDifference",
"apiDiff",
")",
"{",
"throwIfMissing",
"(",
"false",
",",
"false",
",",
"false",
",",
"true",
")",
";",
"String",
"newIface",
"=",
"getArgs",
"(",
"apiDiff",
")",
"[",
"0",
"]",
";",
"newIface",
... | Added interface to the set of implemented interfaces | [
"Added",
"interface",
"to",
"the",
"set",
"of",
"implemented",
"interfaces"
] | 4348dc31ee003097fa352b1cc3a607dda502bb4c | https://github.com/mojohaus/clirr-maven-plugin/blob/4348dc31ee003097fa352b1cc3a607dda502bb4c/src/main/java/org/codehaus/mojo/clirr/Difference.java#L482-L490 |
10,013 | mojohaus/clirr-maven-plugin | src/main/java/org/codehaus/mojo/clirr/Difference.java | Difference.matches4001 | private boolean matches4001( ApiDifference apiDiff )
{
throwIfMissing( false, false, false, true );
String removedIface = getArgs( apiDiff )[0];
removedIface = removedIface.replace( '.', '/' );
return SelectorUtils.matchPath( to, removedIface, "/", true );
} | java | private boolean matches4001( ApiDifference apiDiff )
{
throwIfMissing( false, false, false, true );
String removedIface = getArgs( apiDiff )[0];
removedIface = removedIface.replace( '.', '/' );
return SelectorUtils.matchPath( to, removedIface, "/", true );
} | [
"private",
"boolean",
"matches4001",
"(",
"ApiDifference",
"apiDiff",
")",
"{",
"throwIfMissing",
"(",
"false",
",",
"false",
",",
"false",
",",
"true",
")",
";",
"String",
"removedIface",
"=",
"getArgs",
"(",
"apiDiff",
")",
"[",
"0",
"]",
";",
"removedIf... | Removed interface from the set of implemented interfaces | [
"Removed",
"interface",
"from",
"the",
"set",
"of",
"implemented",
"interfaces"
] | 4348dc31ee003097fa352b1cc3a607dda502bb4c | https://github.com/mojohaus/clirr-maven-plugin/blob/4348dc31ee003097fa352b1cc3a607dda502bb4c/src/main/java/org/codehaus/mojo/clirr/Difference.java#L495-L503 |
10,014 | mojohaus/clirr-maven-plugin | src/main/java/org/codehaus/mojo/clirr/Difference.java | Difference.matches5000 | private boolean matches5000( ApiDifference apiDiff )
{
throwIfMissing( false, false, false, true );
String newSuperclass = getArgs( apiDiff )[0];
newSuperclass = newSuperclass.replace( '.', '/' );
return SelectorUtils.matchPath( to, newSuperclass, "/", true );
} | java | private boolean matches5000( ApiDifference apiDiff )
{
throwIfMissing( false, false, false, true );
String newSuperclass = getArgs( apiDiff )[0];
newSuperclass = newSuperclass.replace( '.', '/' );
return SelectorUtils.matchPath( to, newSuperclass, "/", true );
} | [
"private",
"boolean",
"matches5000",
"(",
"ApiDifference",
"apiDiff",
")",
"{",
"throwIfMissing",
"(",
"false",
",",
"false",
",",
"false",
",",
"true",
")",
";",
"String",
"newSuperclass",
"=",
"getArgs",
"(",
"apiDiff",
")",
"[",
"0",
"]",
";",
"newSuper... | Added class to the set of superclasses | [
"Added",
"class",
"to",
"the",
"set",
"of",
"superclasses"
] | 4348dc31ee003097fa352b1cc3a607dda502bb4c | https://github.com/mojohaus/clirr-maven-plugin/blob/4348dc31ee003097fa352b1cc3a607dda502bb4c/src/main/java/org/codehaus/mojo/clirr/Difference.java#L508-L516 |
10,015 | mojohaus/clirr-maven-plugin | src/main/java/org/codehaus/mojo/clirr/Difference.java | Difference.matches5001 | private boolean matches5001( ApiDifference apiDiff )
{
throwIfMissing( false, false, false, true );
String removedSuperclass = getArgs( apiDiff )[0];
removedSuperclass = removedSuperclass.replace( '.', '/' );
return SelectorUtils.matchPath( to, removedSuperclass, "/", true );
} | java | private boolean matches5001( ApiDifference apiDiff )
{
throwIfMissing( false, false, false, true );
String removedSuperclass = getArgs( apiDiff )[0];
removedSuperclass = removedSuperclass.replace( '.', '/' );
return SelectorUtils.matchPath( to, removedSuperclass, "/", true );
} | [
"private",
"boolean",
"matches5001",
"(",
"ApiDifference",
"apiDiff",
")",
"{",
"throwIfMissing",
"(",
"false",
",",
"false",
",",
"false",
",",
"true",
")",
";",
"String",
"removedSuperclass",
"=",
"getArgs",
"(",
"apiDiff",
")",
"[",
"0",
"]",
";",
"remo... | Removed class from the set of superclasses | [
"Removed",
"class",
"from",
"the",
"set",
"of",
"superclasses"
] | 4348dc31ee003097fa352b1cc3a607dda502bb4c | https://github.com/mojohaus/clirr-maven-plugin/blob/4348dc31ee003097fa352b1cc3a607dda502bb4c/src/main/java/org/codehaus/mojo/clirr/Difference.java#L521-L529 |
10,016 | mojohaus/clirr-maven-plugin | src/main/java/org/codehaus/mojo/clirr/Difference.java | Difference.matches6004 | private boolean matches6004( ApiDifference apiDiff )
{
throwIfMissing( true, false, true, true );
if ( !SelectorUtils.matchPath( field, apiDiff.getAffectedField() ) )
{
return false;
}
String[] args = getArgs( apiDiff );
String diffFrom = args[0];
... | java | private boolean matches6004( ApiDifference apiDiff )
{
throwIfMissing( true, false, true, true );
if ( !SelectorUtils.matchPath( field, apiDiff.getAffectedField() ) )
{
return false;
}
String[] args = getArgs( apiDiff );
String diffFrom = args[0];
... | [
"private",
"boolean",
"matches6004",
"(",
"ApiDifference",
"apiDiff",
")",
"{",
"throwIfMissing",
"(",
"true",
",",
"false",
",",
"true",
",",
"true",
")",
";",
"if",
"(",
"!",
"SelectorUtils",
".",
"matchPath",
"(",
"field",
",",
"apiDiff",
".",
"getAffec... | field type changed | [
"field",
"type",
"changed"
] | 4348dc31ee003097fa352b1cc3a607dda502bb4c | https://github.com/mojohaus/clirr-maven-plugin/blob/4348dc31ee003097fa352b1cc3a607dda502bb4c/src/main/java/org/codehaus/mojo/clirr/Difference.java#L570-L584 |
10,017 | mojohaus/clirr-maven-plugin | src/main/java/org/codehaus/mojo/clirr/Difference.java | Difference.matches7000 | private boolean matches7000( ApiDifference apiDiff )
{
throwIfMissing( false, true, false, false );
return SelectorUtils.matchPath( method, removeVisibilityFromMethodSignature( apiDiff ) );
} | java | private boolean matches7000( ApiDifference apiDiff )
{
throwIfMissing( false, true, false, false );
return SelectorUtils.matchPath( method, removeVisibilityFromMethodSignature( apiDiff ) );
} | [
"private",
"boolean",
"matches7000",
"(",
"ApiDifference",
"apiDiff",
")",
"{",
"throwIfMissing",
"(",
"false",
",",
"true",
",",
"false",
",",
"false",
")",
";",
"return",
"SelectorUtils",
".",
"matchPath",
"(",
"method",
",",
"removeVisibilityFromMethodSignature... | method now in superclass | [
"method",
"now",
"in",
"superclass"
] | 4348dc31ee003097fa352b1cc3a607dda502bb4c | https://github.com/mojohaus/clirr-maven-plugin/blob/4348dc31ee003097fa352b1cc3a607dda502bb4c/src/main/java/org/codehaus/mojo/clirr/Difference.java#L652-L656 |
10,018 | mojohaus/clirr-maven-plugin | src/main/java/org/codehaus/mojo/clirr/Difference.java | Difference.matches7005 | private boolean matches7005( List<ApiDifference> apiDiffs )
{
throwIfMissing( false, true, false, true );
ApiDifference firstDiff = apiDiffs.get( 0 );
String methodSig = removeVisibilityFromMethodSignature( firstDiff );
if ( !SelectorUtils.matchPath( method, methodSig ) )
{
... | java | private boolean matches7005( List<ApiDifference> apiDiffs )
{
throwIfMissing( false, true, false, true );
ApiDifference firstDiff = apiDiffs.get( 0 );
String methodSig = removeVisibilityFromMethodSignature( firstDiff );
if ( !SelectorUtils.matchPath( method, methodSig ) )
{
... | [
"private",
"boolean",
"matches7005",
"(",
"List",
"<",
"ApiDifference",
">",
"apiDiffs",
")",
"{",
"throwIfMissing",
"(",
"false",
",",
"true",
",",
"false",
",",
"true",
")",
";",
"ApiDifference",
"firstDiff",
"=",
"apiDiffs",
".",
"get",
"(",
"0",
")",
... | Method Argument Type changed | [
"Method",
"Argument",
"Type",
"changed"
] | 4348dc31ee003097fa352b1cc3a607dda502bb4c | https://github.com/mojohaus/clirr-maven-plugin/blob/4348dc31ee003097fa352b1cc3a607dda502bb4c/src/main/java/org/codehaus/mojo/clirr/Difference.java#L702-L715 |
10,019 | mojohaus/clirr-maven-plugin | src/main/java/org/codehaus/mojo/clirr/Difference.java | Difference.matches7006 | private boolean matches7006( ApiDifference apiDiff )
{
throwIfMissing( false, true, false, true );
String methodSig = removeVisibilityFromMethodSignature( apiDiff );
if ( !SelectorUtils.matchPath( method, methodSig ) )
{
return false;
}
String newRetType... | java | private boolean matches7006( ApiDifference apiDiff )
{
throwIfMissing( false, true, false, true );
String methodSig = removeVisibilityFromMethodSignature( apiDiff );
if ( !SelectorUtils.matchPath( method, methodSig ) )
{
return false;
}
String newRetType... | [
"private",
"boolean",
"matches7006",
"(",
"ApiDifference",
"apiDiff",
")",
"{",
"throwIfMissing",
"(",
"false",
",",
"true",
",",
"false",
",",
"true",
")",
";",
"String",
"methodSig",
"=",
"removeVisibilityFromMethodSignature",
"(",
"apiDiff",
")",
";",
"if",
... | Method Return Type changed | [
"Method",
"Return",
"Type",
"changed"
] | 4348dc31ee003097fa352b1cc3a607dda502bb4c | https://github.com/mojohaus/clirr-maven-plugin/blob/4348dc31ee003097fa352b1cc3a607dda502bb4c/src/main/java/org/codehaus/mojo/clirr/Difference.java#L737-L750 |
10,020 | mojohaus/clirr-maven-plugin | src/main/java/org/codehaus/mojo/clirr/Difference.java | Difference.matches10000 | private boolean matches10000( ApiDifference apiDiff )
{
throwIfMissing( false, false, true, true );
int fromVersion = 0;
int toVersion = 0;
try
{
fromVersion = Integer.parseInt( from );
}
catch ( NumberFormatException e )
{
thr... | java | private boolean matches10000( ApiDifference apiDiff )
{
throwIfMissing( false, false, true, true );
int fromVersion = 0;
int toVersion = 0;
try
{
fromVersion = Integer.parseInt( from );
}
catch ( NumberFormatException e )
{
thr... | [
"private",
"boolean",
"matches10000",
"(",
"ApiDifference",
"apiDiff",
")",
"{",
"throwIfMissing",
"(",
"false",
",",
"false",
",",
"true",
",",
"true",
")",
";",
"int",
"fromVersion",
"=",
"0",
";",
"int",
"toVersion",
"=",
"0",
";",
"try",
"{",
"fromVe... | Class format version increased | [
"Class",
"format",
"version",
"increased"
] | 4348dc31ee003097fa352b1cc3a607dda502bb4c | https://github.com/mojohaus/clirr-maven-plugin/blob/4348dc31ee003097fa352b1cc3a607dda502bb4c/src/main/java/org/codehaus/mojo/clirr/Difference.java#L836-L866 |
10,021 | Doctoror/Geocoder | library/src/main/java/com/doctoror/geocoder/Geocoder.java | Geocoder.getFromLocation | @NonNull
public List<Address> getFromLocation(final double latitude, final double longitude,
final int maxResults, final boolean parseAddressComponents)
throws GeocoderException {
if (latitude < -90.0 || latitude > 90.0) {
throw new IllegalArgumentException("latitude == "... | java | @NonNull
public List<Address> getFromLocation(final double latitude, final double longitude,
final int maxResults, final boolean parseAddressComponents)
throws GeocoderException {
if (latitude < -90.0 || latitude > 90.0) {
throw new IllegalArgumentException("latitude == "... | [
"@",
"NonNull",
"public",
"List",
"<",
"Address",
">",
"getFromLocation",
"(",
"final",
"double",
"latitude",
",",
"final",
"double",
"longitude",
",",
"final",
"int",
"maxResults",
",",
"final",
"boolean",
"parseAddressComponents",
")",
"throws",
"GeocoderExcepti... | Returns an array of Addresses that are known to describe the area
immediately surrounding the given latitude and longitude. The returned
addresses will be localized for the locale provided to this class's
constructor.
<p>
The returned values may be obtained by means of a network lookup. The
results are a best guess an... | [
"Returns",
"an",
"array",
"of",
"Addresses",
"that",
"are",
"known",
"to",
"describe",
"the",
"area",
"immediately",
"surrounding",
"the",
"given",
"latitude",
"and",
"longitude",
".",
"The",
"returned",
"addresses",
"will",
"be",
"localized",
"for",
"the",
"l... | c55463266584c7ad79880ffc7869c25e5f9eb006 | https://github.com/Doctoror/Geocoder/blob/c55463266584c7ad79880ffc7869c25e5f9eb006/library/src/main/java/com/doctoror/geocoder/Geocoder.java#L141-L168 |
10,022 | Doctoror/Geocoder | library/src/main/java/com/doctoror/geocoder/Geocoder.java | Geocoder.getFromLocationName | @NonNull
public List<Address> getFromLocationName(final String locationName, final int maxResults,
final boolean parseAddressComponents)
throws GeocoderException {
if (locationName == null) {
throw new IllegalArgumentException("locationName == null");
}
i... | java | @NonNull
public List<Address> getFromLocationName(final String locationName, final int maxResults,
final boolean parseAddressComponents)
throws GeocoderException {
if (locationName == null) {
throw new IllegalArgumentException("locationName == null");
}
i... | [
"@",
"NonNull",
"public",
"List",
"<",
"Address",
">",
"getFromLocationName",
"(",
"final",
"String",
"locationName",
",",
"final",
"int",
"maxResults",
",",
"final",
"boolean",
"parseAddressComponents",
")",
"throws",
"GeocoderException",
"{",
"if",
"(",
"locatio... | Returns an array of Addresses that are known to describe the named
location, which may be a place name such as "Dalvik,
Iceland", an address such as "1600 Amphitheatre Parkway, Mountain View,
CA", an airport code such as "SFO", etc.. The returned addresses will be
localized for the locale provided to this class's const... | [
"Returns",
"an",
"array",
"of",
"Addresses",
"that",
"are",
"known",
"to",
"describe",
"the",
"named",
"location",
"which",
"may",
"be",
"a",
"place",
"name",
"such",
"as",
"Dalvik",
"Iceland",
"an",
"address",
"such",
"as",
"1600",
"Amphitheatre",
"Parkway"... | c55463266584c7ad79880ffc7869c25e5f9eb006 | https://github.com/Doctoror/Geocoder/blob/c55463266584c7ad79880ffc7869c25e5f9eb006/library/src/main/java/com/doctoror/geocoder/Geocoder.java#L194-L251 |
10,023 | Doctoror/Geocoder | library/src/main/java/com/doctoror/geocoder/Geocoder.java | Geocoder.download | @NonNull
private static byte[] download(String url) throws IOException {
InputStream is = null;
ByteArrayOutputStream os = null;
try {
final URL u = new URL(url);
final URLConnection connection = u.openConnection();
connection.connect();
is ... | java | @NonNull
private static byte[] download(String url) throws IOException {
InputStream is = null;
ByteArrayOutputStream os = null;
try {
final URL u = new URL(url);
final URLConnection connection = u.openConnection();
connection.connect();
is ... | [
"@",
"NonNull",
"private",
"static",
"byte",
"[",
"]",
"download",
"(",
"String",
"url",
")",
"throws",
"IOException",
"{",
"InputStream",
"is",
"=",
"null",
";",
"ByteArrayOutputStream",
"os",
"=",
"null",
";",
"try",
"{",
"final",
"URL",
"u",
"=",
"new... | Downloads data to buffer
@param url Data location
@return downloaded data or null if error occurred | [
"Downloads",
"data",
"to",
"buffer"
] | c55463266584c7ad79880ffc7869c25e5f9eb006 | https://github.com/Doctoror/Geocoder/blob/c55463266584c7ad79880ffc7869c25e5f9eb006/library/src/main/java/com/doctoror/geocoder/Geocoder.java#L259-L299 |
10,024 | Doctoror/Geocoder | library/src/main/java/com/doctoror/geocoder/Geocoder.java | Geocoder.setAllowedDate | private void setAllowedDate(final long date) {
mAllowedDate = date;
if (mSharedPreferences == null) {
mSharedPreferences = mContext.getSharedPreferences(
PREFERENCES_GEOCODER, Context.MODE_PRIVATE);
}
final Editor e = mSharedPreferences.edit();
e.p... | java | private void setAllowedDate(final long date) {
mAllowedDate = date;
if (mSharedPreferences == null) {
mSharedPreferences = mContext.getSharedPreferences(
PREFERENCES_GEOCODER, Context.MODE_PRIVATE);
}
final Editor e = mSharedPreferences.edit();
e.p... | [
"private",
"void",
"setAllowedDate",
"(",
"final",
"long",
"date",
")",
"{",
"mAllowedDate",
"=",
"date",
";",
"if",
"(",
"mSharedPreferences",
"==",
"null",
")",
"{",
"mSharedPreferences",
"=",
"mContext",
".",
"getSharedPreferences",
"(",
"PREFERENCES_GEOCODER",... | Sets date after which next geocoding query is allowed
@param date the date after which next geocoding query is allowed | [
"Sets",
"date",
"after",
"which",
"next",
"geocoding",
"query",
"is",
"allowed"
] | c55463266584c7ad79880ffc7869c25e5f9eb006 | https://github.com/Doctoror/Geocoder/blob/c55463266584c7ad79880ffc7869c25e5f9eb006/library/src/main/java/com/doctoror/geocoder/Geocoder.java#L316-L325 |
10,025 | Doctoror/Geocoder | library/src/main/java/com/doctoror/geocoder/Geocoder.java | Geocoder.getAllowedDate | private long getAllowedDate() {
if (mSharedPreferences == null) {
mSharedPreferences = mContext
.getSharedPreferences(PREFERENCES_GEOCODER, Context.MODE_PRIVATE);
mAllowedDate = mSharedPreferences.getLong(KEY_ALLOW, 0);
}
return mAllowedDate;
} | java | private long getAllowedDate() {
if (mSharedPreferences == null) {
mSharedPreferences = mContext
.getSharedPreferences(PREFERENCES_GEOCODER, Context.MODE_PRIVATE);
mAllowedDate = mSharedPreferences.getLong(KEY_ALLOW, 0);
}
return mAllowedDate;
} | [
"private",
"long",
"getAllowedDate",
"(",
")",
"{",
"if",
"(",
"mSharedPreferences",
"==",
"null",
")",
"{",
"mSharedPreferences",
"=",
"mContext",
".",
"getSharedPreferences",
"(",
"PREFERENCES_GEOCODER",
",",
"Context",
".",
"MODE_PRIVATE",
")",
";",
"mAllowedDa... | Returns date after which the next geocoding query is allowed
@return date after which the next geocoding query is allowed | [
"Returns",
"date",
"after",
"which",
"the",
"next",
"geocoding",
"query",
"is",
"allowed"
] | c55463266584c7ad79880ffc7869c25e5f9eb006 | https://github.com/Doctoror/Geocoder/blob/c55463266584c7ad79880ffc7869c25e5f9eb006/library/src/main/java/com/doctoror/geocoder/Geocoder.java#L332-L339 |
10,026 | Inbot/inbot-utils | src/main/java/io/inbot/utils/IOUtils.java | IOUtils.resource | public static BufferedReader resource(String resourcePath) throws IOException {
InputStream is = IOUtils.class.getClassLoader().getResourceAsStream(resourcePath);
if(is != null) {
return new BufferedReader(new InputStreamReader(is, UTF_8));
} else {
File file = new File(r... | java | public static BufferedReader resource(String resourcePath) throws IOException {
InputStream is = IOUtils.class.getClassLoader().getResourceAsStream(resourcePath);
if(is != null) {
return new BufferedReader(new InputStreamReader(is, UTF_8));
} else {
File file = new File(r... | [
"public",
"static",
"BufferedReader",
"resource",
"(",
"String",
"resourcePath",
")",
"throws",
"IOException",
"{",
"InputStream",
"is",
"=",
"IOUtils",
".",
"class",
".",
"getClassLoader",
"(",
")",
".",
"getResourceAsStream",
"(",
"resourcePath",
")",
";",
"if... | Read a resource from the classpath or fallback to treating it as a file.
@param resourcePath resource path inside your jar, or a path to an actual file
@return BufferedReader
@throws IOException if something goes wrong with the stream | [
"Read",
"a",
"resource",
"from",
"the",
"classpath",
"or",
"fallback",
"to",
"treating",
"it",
"as",
"a",
"file",
"."
] | 3112bc08d4237e95fe0f8a219a5bbceb390d0505 | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/IOUtils.java#L37-L49 |
10,027 | Inbot/inbot-utils | src/main/java/io/inbot/utils/IOUtils.java | IOUtils.byteCount | public long byteCount(Object object) {
try {
CountingOutputStream cos = new CountingOutputStream(new OutputStream() {
@Override
public void write(int b) throws IOException {
// do nothing
}
});
ObjectOutputSt... | java | public long byteCount(Object object) {
try {
CountingOutputStream cos = new CountingOutputStream(new OutputStream() {
@Override
public void write(int b) throws IOException {
// do nothing
}
});
ObjectOutputSt... | [
"public",
"long",
"byteCount",
"(",
"Object",
"object",
")",
"{",
"try",
"{",
"CountingOutputStream",
"cos",
"=",
"new",
"CountingOutputStream",
"(",
"new",
"OutputStream",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"write",
"(",
"int",
"b",
")",
"t... | Calculate the serialized object size in bytes. This is a good indication of how much memory the object roughly takes.
Note that this is typically not exactly the same for many objects.
@param object any object that implements {@link Serializable}
@return number of bytes of the serialized object. | [
"Calculate",
"the",
"serialized",
"object",
"size",
"in",
"bytes",
".",
"This",
"is",
"a",
"good",
"indication",
"of",
"how",
"much",
"memory",
"the",
"object",
"roughly",
"takes",
".",
"Note",
"that",
"this",
"is",
"typically",
"not",
"exactly",
"the",
"s... | 3112bc08d4237e95fe0f8a219a5bbceb390d0505 | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/IOUtils.java#L57-L74 |
10,028 | craftercms/deployer | src/main/java/org/craftercms/deployer/utils/ConfigUtils.java | ConfigUtils.getStringArrayProperty | public static String[] getStringArrayProperty(Configuration config,
String key) throws DeployerConfigurationException {
try {
return config.getStringArray(key);
} catch (Exception e) {
throw new DeployerConfigurationException("Fai... | java | public static String[] getStringArrayProperty(Configuration config,
String key) throws DeployerConfigurationException {
try {
return config.getStringArray(key);
} catch (Exception e) {
throw new DeployerConfigurationException("Fai... | [
"public",
"static",
"String",
"[",
"]",
"getStringArrayProperty",
"(",
"Configuration",
"config",
",",
"String",
"key",
")",
"throws",
"DeployerConfigurationException",
"{",
"try",
"{",
"return",
"config",
".",
"getStringArray",
"(",
"key",
")",
";",
"}",
"catch... | Returns the specified String array property from the configuration. A String array property is normally
specified as
a String with values separated by commas in the configuration.
@param config the configuration
@param key the key of the property
@return the String array value of the property, or null if not found
... | [
"Returns",
"the",
"specified",
"String",
"array",
"property",
"from",
"the",
"configuration",
".",
"A",
"String",
"array",
"property",
"is",
"normally",
"specified",
"as",
"a",
"String",
"with",
"values",
"separated",
"by",
"commas",
"in",
"the",
"configuration"... | 3ed446e3cc8af1055de2de6f871907f90ef27f63 | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/utils/ConfigUtils.java#L232-L239 |
10,029 | craftercms/deployer | src/main/java/org/craftercms/deployer/utils/ConfigUtils.java | ConfigUtils.getConfigurationsAt | @SuppressWarnings("unchecked")
public static List<HierarchicalConfiguration> getConfigurationsAt(HierarchicalConfiguration config,
String key) throws
DeployerConfigurationException {
try {
return config.configurationsA... | java | @SuppressWarnings("unchecked")
public static List<HierarchicalConfiguration> getConfigurationsAt(HierarchicalConfiguration config,
String key) throws
DeployerConfigurationException {
try {
return config.configurationsA... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"List",
"<",
"HierarchicalConfiguration",
">",
"getConfigurationsAt",
"(",
"HierarchicalConfiguration",
"config",
",",
"String",
"key",
")",
"throws",
"DeployerConfigurationException",
"{",
"try",
"... | Returns the sub-configuration tree whose root is the specified key.
@param config the configuration
@param key the key of the configuration tree
@return the sub-configuration tree, or null if not found
@throws DeployerConfigurationException if an error occurs | [
"Returns",
"the",
"sub",
"-",
"configuration",
"tree",
"whose",
"root",
"is",
"the",
"specified",
"key",
"."
] | 3ed446e3cc8af1055de2de6f871907f90ef27f63 | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/utils/ConfigUtils.java#L270-L279 |
10,030 | augustd/burp-suite-utils | src/main/java/com/monikamorrow/burp/BurpSuiteTab.java | BurpSuiteTab.highlight | public void highlight() {
final JTabbedPane parent = (JTabbedPane) this.getUiComponent().getParent();
//search through tabs until we find this one
for (int i = 0; i < parent.getTabCount(); i++) {
String title = parent.getTitleAt(i);
if (getTabCaption().equals(title)) { //found this tab
//create new c... | java | public void highlight() {
final JTabbedPane parent = (JTabbedPane) this.getUiComponent().getParent();
//search through tabs until we find this one
for (int i = 0; i < parent.getTabCount(); i++) {
String title = parent.getTitleAt(i);
if (getTabCaption().equals(title)) { //found this tab
//create new c... | [
"public",
"void",
"highlight",
"(",
")",
"{",
"final",
"JTabbedPane",
"parent",
"=",
"(",
"JTabbedPane",
")",
"this",
".",
"getUiComponent",
"(",
")",
".",
"getParent",
"(",
")",
";",
"//search through tabs until we find this one",
"for",
"(",
"int",
"i",
"=",... | Highlights the tab using Burp's color scheme. The highlight disappears
after 3 seconds. | [
"Highlights",
"the",
"tab",
"using",
"Burp",
"s",
"color",
"scheme",
".",
"The",
"highlight",
"disappears",
"after",
"3",
"seconds",
"."
] | 5e34a6b9147f5705382f98049dd9e4f387b78629 | https://github.com/augustd/burp-suite-utils/blob/5e34a6b9147f5705382f98049dd9e4f387b78629/src/main/java/com/monikamorrow/burp/BurpSuiteTab.java#L56-L84 |
10,031 | augustd/burp-suite-utils | src/main/java/com/codemagi/burp/parser/HttpResponse.java | HttpResponse.setHeader | public final String setHeader(String name, String value) {
sortedHeaders = null;
return headers.put(name, value);
} | java | public final String setHeader(String name, String value) {
sortedHeaders = null;
return headers.put(name, value);
} | [
"public",
"final",
"String",
"setHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"sortedHeaders",
"=",
"null",
";",
"return",
"headers",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"}"
] | Sets a header field value based on its name.
@param name The header name to set
@param value The header value to set
@return the previous value or null if the field was previously unset. | [
"Sets",
"a",
"header",
"field",
"value",
"based",
"on",
"its",
"name",
"."
] | 5e34a6b9147f5705382f98049dd9e4f387b78629 | https://github.com/augustd/burp-suite-utils/blob/5e34a6b9147f5705382f98049dd9e4f387b78629/src/main/java/com/codemagi/burp/parser/HttpResponse.java#L150-L153 |
10,032 | Inbot/inbot-utils | src/main/java/io/inbot/utils/SimpleStringTrie.java | SimpleStringTrie.from | public static SimpleStringTrie from(Map<String,?> map) {
SimpleStringTrie st = new SimpleStringTrie();
map.keySet().forEach(key -> st.add(key));
return st;
} | java | public static SimpleStringTrie from(Map<String,?> map) {
SimpleStringTrie st = new SimpleStringTrie();
map.keySet().forEach(key -> st.add(key));
return st;
} | [
"public",
"static",
"SimpleStringTrie",
"from",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"map",
")",
"{",
"SimpleStringTrie",
"st",
"=",
"new",
"SimpleStringTrie",
"(",
")",
";",
"map",
".",
"keySet",
"(",
")",
".",
"forEach",
"(",
"key",
"->",
"st",
... | Useful if you want to build a trie for an existing map so you can figure out a matching prefix that has an entry
@param map a map
@return a SimpleStringTrie for the map. | [
"Useful",
"if",
"you",
"want",
"to",
"build",
"a",
"trie",
"for",
"an",
"existing",
"map",
"so",
"you",
"can",
"figure",
"out",
"a",
"matching",
"prefix",
"that",
"has",
"an",
"entry"
] | 3112bc08d4237e95fe0f8a219a5bbceb390d0505 | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/SimpleStringTrie.java#L55-L59 |
10,033 | Inbot/inbot-utils | src/main/java/io/inbot/utils/SimpleStringTrie.java | SimpleStringTrie.add | public void add(String input) {
TrieNode currentNode = root;
for(char c: input.toCharArray()) {
Map<Character, TrieNode> children = currentNode.getChildren();
TrieNode matchingNode = children.get(c);
if(matchingNode != null) {
currentNode = matchingNo... | java | public void add(String input) {
TrieNode currentNode = root;
for(char c: input.toCharArray()) {
Map<Character, TrieNode> children = currentNode.getChildren();
TrieNode matchingNode = children.get(c);
if(matchingNode != null) {
currentNode = matchingNo... | [
"public",
"void",
"add",
"(",
"String",
"input",
")",
"{",
"TrieNode",
"currentNode",
"=",
"root",
";",
"for",
"(",
"char",
"c",
":",
"input",
".",
"toCharArray",
"(",
")",
")",
"{",
"Map",
"<",
"Character",
",",
"TrieNode",
">",
"children",
"=",
"cu... | Add a string to the trie.
@param input any String | [
"Add",
"a",
"string",
"to",
"the",
"trie",
"."
] | 3112bc08d4237e95fe0f8a219a5bbceb390d0505 | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/SimpleStringTrie.java#L65-L80 |
10,034 | Inbot/inbot-utils | src/main/java/io/inbot/utils/SimpleStringTrie.java | SimpleStringTrie.get | public Optional<String> get(String input) {
TrieNode currentNode = root;
int i=0;
for(char c: input.toCharArray()) {
TrieNode nextNode = currentNode.getChildren().get(c);
if(nextNode != null) {
i++;
currentNode=nextNode;
} else ... | java | public Optional<String> get(String input) {
TrieNode currentNode = root;
int i=0;
for(char c: input.toCharArray()) {
TrieNode nextNode = currentNode.getChildren().get(c);
if(nextNode != null) {
i++;
currentNode=nextNode;
} else ... | [
"public",
"Optional",
"<",
"String",
">",
"get",
"(",
"String",
"input",
")",
"{",
"TrieNode",
"currentNode",
"=",
"root",
";",
"int",
"i",
"=",
"0",
";",
"for",
"(",
"char",
"c",
":",
"input",
".",
"toCharArray",
"(",
")",
")",
"{",
"TrieNode",
"n... | Return the longest matching prefix of the input string that was added to the trie.
@param input a string
@return Optional of longest matching prefix that was added to the trie | [
"Return",
"the",
"longest",
"matching",
"prefix",
"of",
"the",
"input",
"string",
"that",
"was",
"added",
"to",
"the",
"trie",
"."
] | 3112bc08d4237e95fe0f8a219a5bbceb390d0505 | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/SimpleStringTrie.java#L87-L105 |
10,035 | rometools/rome-modules | src/main/java/com/rometools/modules/itunes/FeedInformationImpl.java | FeedInformationImpl.copyFrom | @Override
public void copyFrom(final CopyFrom obj) {
final FeedInformationImpl info = (FeedInformationImpl) obj;
setAuthor(info.getAuthor());
setBlock(info.getBlock());
getCategories().clear();
if (info.getCategories() != null) {
getCategories().addAll(info.getCa... | java | @Override
public void copyFrom(final CopyFrom obj) {
final FeedInformationImpl info = (FeedInformationImpl) obj;
setAuthor(info.getAuthor());
setBlock(info.getBlock());
getCategories().clear();
if (info.getCategories() != null) {
getCategories().addAll(info.getCa... | [
"@",
"Override",
"public",
"void",
"copyFrom",
"(",
"final",
"CopyFrom",
"obj",
")",
"{",
"final",
"FeedInformationImpl",
"info",
"=",
"(",
"FeedInformationImpl",
")",
"obj",
";",
"setAuthor",
"(",
"info",
".",
"getAuthor",
"(",
")",
")",
";",
"setBlock",
... | Required by the ROME API
@param obj object to copy property values from | [
"Required",
"by",
"the",
"ROME",
"API"
] | adc6be4ec33b8418c6cf01f15924f8daee37afc9 | https://github.com/rometools/rome-modules/blob/adc6be4ec33b8418c6cf01f15924f8daee37afc9/src/main/java/com/rometools/modules/itunes/FeedInformationImpl.java#L164-L195 |
10,036 | Inbot/inbot-utils | src/main/java/io/inbot/utils/PatternEvaluator.java | PatternEvaluator.matches | public static <I,O> BoolExprPattern<I,O> matches(Function<I,Boolean> expr, Function<I,O> f) {
return new BoolExprPattern<I, O>(expr, f);
} | java | public static <I,O> BoolExprPattern<I,O> matches(Function<I,Boolean> expr, Function<I,O> f) {
return new BoolExprPattern<I, O>(expr, f);
} | [
"public",
"static",
"<",
"I",
",",
"O",
">",
"BoolExprPattern",
"<",
"I",
",",
"O",
">",
"matches",
"(",
"Function",
"<",
"I",
",",
"Boolean",
">",
"expr",
",",
"Function",
"<",
"I",
",",
"O",
">",
"f",
")",
"{",
"return",
"new",
"BoolExprPattern",... | Allows you use a lambda to match on an input.
@param expr expression that evaluates to true/false
@param f function that produces O from I
@param <I> Input
@param <O> Output
@return pattern that matches on the expression | [
"Allows",
"you",
"use",
"a",
"lambda",
"to",
"match",
"on",
"an",
"input",
"."
] | 3112bc08d4237e95fe0f8a219a5bbceb390d0505 | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/PatternEvaluator.java#L105-L107 |
10,037 | Inbot/inbot-utils | src/main/java/io/inbot/utils/PatternEvaluator.java | PatternEvaluator.evaluate | @SafeVarargs
public static <I,O> Optional<O> evaluate(I input, Pattern<I,O>...patterns) {
return new PatternEvaluator<>(patterns).evaluate(input);
} | java | @SafeVarargs
public static <I,O> Optional<O> evaluate(I input, Pattern<I,O>...patterns) {
return new PatternEvaluator<>(patterns).evaluate(input);
} | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"I",
",",
"O",
">",
"Optional",
"<",
"O",
">",
"evaluate",
"(",
"I",
"input",
",",
"Pattern",
"<",
"I",
",",
"O",
">",
"...",
"patterns",
")",
"{",
"return",
"new",
"PatternEvaluator",
"<>",
"(",
"patterns... | Creates an evaluator and then evaluates the value right away.
@param input input value
@param patterns zero or more patterns
@param <I> Input
@param <O> Output
@return O | [
"Creates",
"an",
"evaluator",
"and",
"then",
"evaluates",
"the",
"value",
"right",
"away",
"."
] | 3112bc08d4237e95fe0f8a219a5bbceb390d0505 | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/PatternEvaluator.java#L140-L143 |
10,038 | augustd/burp-suite-utils | src/main/java/com/monikamorrow/burp/ToolsScopeComponent.java | ToolsScopeComponent.setToolDefault | public void setToolDefault(int tool, boolean enabled) {
switch (tool) {
case IBurpExtenderCallbacks.TOOL_PROXY:
if (mCallbacks.loadExtensionSetting(SETTING_PROXY) == null) {
jCheckBoxProxy.setSelected(enabled);
}
break;
... | java | public void setToolDefault(int tool, boolean enabled) {
switch (tool) {
case IBurpExtenderCallbacks.TOOL_PROXY:
if (mCallbacks.loadExtensionSetting(SETTING_PROXY) == null) {
jCheckBoxProxy.setSelected(enabled);
}
break;
... | [
"public",
"void",
"setToolDefault",
"(",
"int",
"tool",
",",
"boolean",
"enabled",
")",
"{",
"switch",
"(",
"tool",
")",
"{",
"case",
"IBurpExtenderCallbacks",
".",
"TOOL_PROXY",
":",
"if",
"(",
"mCallbacks",
".",
"loadExtensionSetting",
"(",
"SETTING_PROXY",
... | Allows the developer to set the default value for selected tools, not
every tool makes sense for every extension
@param tool The tool code, as defined in IBurpExtenderCallbacks
@param enabled True if the checkbox should be checked by default. | [
"Allows",
"the",
"developer",
"to",
"set",
"the",
"default",
"value",
"for",
"selected",
"tools",
"not",
"every",
"tool",
"makes",
"sense",
"for",
"every",
"extension"
] | 5e34a6b9147f5705382f98049dd9e4f387b78629 | https://github.com/augustd/burp-suite-utils/blob/5e34a6b9147f5705382f98049dd9e4f387b78629/src/main/java/com/monikamorrow/burp/ToolsScopeComponent.java#L84-L124 |
10,039 | augustd/burp-suite-utils | src/main/java/com/monikamorrow/burp/ToolsScopeComponent.java | ToolsScopeComponent.isToolSelected | public boolean isToolSelected(int tool) {
boolean selected = false;
switch (tool) {
case IBurpExtenderCallbacks.TOOL_PROXY:
selected = jCheckBoxProxy.isSelected();
break;
case IBurpExtenderCallbacks.TOOL_REPEATER:
selected = jCheckB... | java | public boolean isToolSelected(int tool) {
boolean selected = false;
switch (tool) {
case IBurpExtenderCallbacks.TOOL_PROXY:
selected = jCheckBoxProxy.isSelected();
break;
case IBurpExtenderCallbacks.TOOL_REPEATER:
selected = jCheckB... | [
"public",
"boolean",
"isToolSelected",
"(",
"int",
"tool",
")",
"{",
"boolean",
"selected",
"=",
"false",
";",
"switch",
"(",
"tool",
")",
"{",
"case",
"IBurpExtenderCallbacks",
".",
"TOOL_PROXY",
":",
"selected",
"=",
"jCheckBoxProxy",
".",
"isSelected",
"(",... | Returns true if the requested tool is selected in the GUI
@param tool The tool code, as defined in IBurpExtenderCallbacks
@return whether the selected tool is selected | [
"Returns",
"true",
"if",
"the",
"requested",
"tool",
"is",
"selected",
"in",
"the",
"GUI"
] | 5e34a6b9147f5705382f98049dd9e4f387b78629 | https://github.com/augustd/burp-suite-utils/blob/5e34a6b9147f5705382f98049dd9e4f387b78629/src/main/java/com/monikamorrow/burp/ToolsScopeComponent.java#L132-L162 |
10,040 | Inbot/inbot-utils | src/main/java/io/inbot/utils/JwtTokenCreationService.java | JwtTokenCreationService.create | public String create(Consumer<JWTCreator.Builder> jwtBuilderConsumer) {
Date issueTime = new Date();
Date expirationTime = new Date(issueTime.getTime() + defaultExpirationMs);
JWTCreator.Builder builder = JWT.create()
// opinionated creation, we enforce using an expiration
... | java | public String create(Consumer<JWTCreator.Builder> jwtBuilderConsumer) {
Date issueTime = new Date();
Date expirationTime = new Date(issueTime.getTime() + defaultExpirationMs);
JWTCreator.Builder builder = JWT.create()
// opinionated creation, we enforce using an expiration
... | [
"public",
"String",
"create",
"(",
"Consumer",
"<",
"JWTCreator",
".",
"Builder",
">",
"jwtBuilderConsumer",
")",
"{",
"Date",
"issueTime",
"=",
"new",
"Date",
"(",
")",
";",
"Date",
"expirationTime",
"=",
"new",
"Date",
"(",
"issueTime",
".",
"getTime",
"... | Creates a JWT token.
@param jwtBuilderConsumer a way for you to customise the token using a lambda function
@return token with the issuer and default expiration set. | [
"Creates",
"a",
"JWT",
"token",
"."
] | 3112bc08d4237e95fe0f8a219a5bbceb390d0505 | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/JwtTokenCreationService.java#L41-L52 |
10,041 | Inbot/inbot-utils | src/main/java/io/inbot/utils/JwtTokenCreationService.java | JwtTokenCreationService.sign | public String sign(JWTCreator.Builder builder) {
// use the strongest algorithm;
return builder.sign(Algorithm.ECDSA512(ecPublicKey, ecPrivateKey));
} | java | public String sign(JWTCreator.Builder builder) {
// use the strongest algorithm;
return builder.sign(Algorithm.ECDSA512(ecPublicKey, ecPrivateKey));
} | [
"public",
"String",
"sign",
"(",
"JWTCreator",
".",
"Builder",
"builder",
")",
"{",
"// use the strongest algorithm;",
"return",
"builder",
".",
"sign",
"(",
"Algorithm",
".",
"ECDSA512",
"(",
"ecPublicKey",
",",
"ecPrivateKey",
")",
")",
";",
"}"
] | Sign the jwt builder. Use this if you want to control issueing time, expiration time, and issuer.
@param builder
@return jwt token. | [
"Sign",
"the",
"jwt",
"builder",
".",
"Use",
"this",
"if",
"you",
"want",
"to",
"control",
"issueing",
"time",
"expiration",
"time",
"and",
"issuer",
"."
] | 3112bc08d4237e95fe0f8a219a5bbceb390d0505 | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/JwtTokenCreationService.java#L63-L66 |
10,042 | rometools/rome-modules | src/main/java/com/rometools/modules/activitystreams/types/Person.java | Person.setAvatar | public void setAvatar(final Link newavatar) {
final Link old = getAvatar();
if (old != null) {
getOtherLinks().remove(old);
}
newavatar.setRel("avatar");
getOtherLinks().add(newavatar);
} | java | public void setAvatar(final Link newavatar) {
final Link old = getAvatar();
if (old != null) {
getOtherLinks().remove(old);
}
newavatar.setRel("avatar");
getOtherLinks().add(newavatar);
} | [
"public",
"void",
"setAvatar",
"(",
"final",
"Link",
"newavatar",
")",
"{",
"final",
"Link",
"old",
"=",
"getAvatar",
"(",
")",
";",
"if",
"(",
"old",
"!=",
"null",
")",
"{",
"getOtherLinks",
"(",
")",
".",
"remove",
"(",
"old",
")",
";",
"}",
"new... | Set the value of avatar
@param newavatar new value of avatar | [
"Set",
"the",
"value",
"of",
"avatar"
] | adc6be4ec33b8418c6cf01f15924f8daee37afc9 | https://github.com/rometools/rome-modules/blob/adc6be4ec33b8418c6cf01f15924f8daee37afc9/src/main/java/com/rometools/modules/activitystreams/types/Person.java#L80-L87 |
10,043 | Inbot/inbot-utils | src/main/java/io/inbot/utils/Math.java | Math.safeAbs | public static long safeAbs(long number) {
// workaround for common issue where Math.abs returns a negative number for Long.MIN_VALUE
if(Long.MIN_VALUE == number) {
return Long.MAX_VALUE;
} else {
return java.lang.Math.abs(number);
}
} | java | public static long safeAbs(long number) {
// workaround for common issue where Math.abs returns a negative number for Long.MIN_VALUE
if(Long.MIN_VALUE == number) {
return Long.MAX_VALUE;
} else {
return java.lang.Math.abs(number);
}
} | [
"public",
"static",
"long",
"safeAbs",
"(",
"long",
"number",
")",
"{",
"// workaround for common issue where Math.abs returns a negative number for Long.MIN_VALUE",
"if",
"(",
"Long",
".",
"MIN_VALUE",
"==",
"number",
")",
"{",
"return",
"Long",
".",
"MAX_VALUE",
";",
... | Java Math.abs has an issue with Long and Integer MIN_VALUE where it returns MIN_VALUE.
@param number a number
@return the absolute value | [
"Java",
"Math",
".",
"abs",
"has",
"an",
"issue",
"with",
"Long",
"and",
"Integer",
"MIN_VALUE",
"where",
"it",
"returns",
"MIN_VALUE",
"."
] | 3112bc08d4237e95fe0f8a219a5bbceb390d0505 | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/Math.java#L14-L21 |
10,044 | Inbot/inbot-utils | src/main/java/io/inbot/utils/Math.java | Math.pow | public static long pow(long l, int exp) {
BigInteger bi = BigInteger.valueOf(l).pow(exp);
if(bi.compareTo(BigInteger.valueOf(Long.MAX_VALUE)) > 0 || bi.compareTo(BigInteger.valueOf(Long.MIN_VALUE)) < 0) {
throw new IllegalArgumentException("pow(" + l + "," + exp + ") exceeds Long.MAX_VALUE")... | java | public static long pow(long l, int exp) {
BigInteger bi = BigInteger.valueOf(l).pow(exp);
if(bi.compareTo(BigInteger.valueOf(Long.MAX_VALUE)) > 0 || bi.compareTo(BigInteger.valueOf(Long.MIN_VALUE)) < 0) {
throw new IllegalArgumentException("pow(" + l + "," + exp + ") exceeds Long.MAX_VALUE")... | [
"public",
"static",
"long",
"pow",
"(",
"long",
"l",
",",
"int",
"exp",
")",
"{",
"BigInteger",
"bi",
"=",
"BigInteger",
".",
"valueOf",
"(",
"l",
")",
".",
"pow",
"(",
"exp",
")",
";",
"if",
"(",
"bi",
".",
"compareTo",
"(",
"BigInteger",
".",
"... | Java.lang.pow only works on doubles; this fixes that.
Safe version of pow that relies on BigInteger that can raise a long to an int exponential. Uses BigInteger
internally to ensure this is done
correctly and does a check on the value to ensure it can safely be converted into a long
@param l
a long
@param exp
exponent... | [
"Java",
".",
"lang",
".",
"pow",
"only",
"works",
"on",
"doubles",
";",
"this",
"fixes",
"that",
".",
"Safe",
"version",
"of",
"pow",
"that",
"relies",
"on",
"BigInteger",
"that",
"can",
"raise",
"a",
"long",
"to",
"an",
"int",
"exponential",
".",
"Use... | 3112bc08d4237e95fe0f8a219a5bbceb390d0505 | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/Math.java#L52-L58 |
10,045 | craftercms/deployer | src/main/java/org/craftercms/deployer/impl/tasks/TargetCleanupTask.java | TargetCleanupTask.cleanupAllTargets | @Scheduled(cron = "${deployer.main.targets.cleanup.cron}")
public void cleanupAllTargets() {
try {
logger.info("Starting cleanup for all targets");
targetService.getAllTargets().forEach(Target::cleanup);
} catch (TargetServiceException e) {
logger.error("Error get... | java | @Scheduled(cron = "${deployer.main.targets.cleanup.cron}")
public void cleanupAllTargets() {
try {
logger.info("Starting cleanup for all targets");
targetService.getAllTargets().forEach(Target::cleanup);
} catch (TargetServiceException e) {
logger.error("Error get... | [
"@",
"Scheduled",
"(",
"cron",
"=",
"\"${deployer.main.targets.cleanup.cron}\"",
")",
"public",
"void",
"cleanupAllTargets",
"(",
")",
"{",
"try",
"{",
"logger",
".",
"info",
"(",
"\"Starting cleanup for all targets\"",
")",
";",
"targetService",
".",
"getAllTargets",... | Performs a cleanup on all loaded targets. | [
"Performs",
"a",
"cleanup",
"on",
"all",
"loaded",
"targets",
"."
] | 3ed446e3cc8af1055de2de6f871907f90ef27f63 | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/impl/tasks/TargetCleanupTask.java#L46-L54 |
10,046 | Inbot/inbot-utils | src/main/java/io/inbot/utils/MiscUtils.java | MiscUtils.urlEncode | public static String urlEncode(String s) {
try {
return URLEncoder.encode(s, StandardCharsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
throw new IllegalStateException("get a jdk that actually supports utf-8", e);
}
} | java | public static String urlEncode(String s) {
try {
return URLEncoder.encode(s, StandardCharsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
throw new IllegalStateException("get a jdk that actually supports utf-8", e);
}
} | [
"public",
"static",
"String",
"urlEncode",
"(",
"String",
"s",
")",
"{",
"try",
"{",
"return",
"URLEncoder",
".",
"encode",
"(",
"s",
",",
"StandardCharsets",
".",
"UTF_8",
".",
"name",
"(",
")",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",... | Url encode a string and don't throw a checked exception. Uses UTF-8 as per RFC 3986.
@param s a string
@return url encoded string | [
"Url",
"encode",
"a",
"string",
"and",
"don",
"t",
"throw",
"a",
"checked",
"exception",
".",
"Uses",
"UTF",
"-",
"8",
"as",
"per",
"RFC",
"3986",
"."
] | 3112bc08d4237e95fe0f8a219a5bbceb390d0505 | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/MiscUtils.java#L31-L37 |
10,047 | Inbot/inbot-utils | src/main/java/io/inbot/utils/MiscUtils.java | MiscUtils.urlDecode | public static String urlDecode(String s) {
try {
return URLDecoder.decode(s, StandardCharsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
throw new IllegalStateException("get a jdk that actually supports utf-8", e);
}
} | java | public static String urlDecode(String s) {
try {
return URLDecoder.decode(s, StandardCharsets.UTF_8.name());
} catch (UnsupportedEncodingException e) {
throw new IllegalStateException("get a jdk that actually supports utf-8", e);
}
} | [
"public",
"static",
"String",
"urlDecode",
"(",
"String",
"s",
")",
"{",
"try",
"{",
"return",
"URLDecoder",
".",
"decode",
"(",
"s",
",",
"StandardCharsets",
".",
"UTF_8",
".",
"name",
"(",
")",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",... | Url decode a string and don't throw a checked exception. Uses UTF-8 as per RFC 3986.
@param s a string
@return decoded string | [
"Url",
"decode",
"a",
"string",
"and",
"don",
"t",
"throw",
"a",
"checked",
"exception",
".",
"Uses",
"UTF",
"-",
"8",
"as",
"per",
"RFC",
"3986",
"."
] | 3112bc08d4237e95fe0f8a219a5bbceb390d0505 | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/MiscUtils.java#L44-L50 |
10,048 | craftercms/deployer | src/main/java/org/craftercms/deployer/impl/rest/MonitorController.java | MonitorController.memoryStats | @RequestMapping(value = MEMORY_URL, method = RequestMethod.GET)
public ResponseEntity<List<MemoryMonitor>> memoryStats() {
return new ResponseEntity<>(MemoryMonitor.getMemoryStats(), HttpStatus.OK);
} | java | @RequestMapping(value = MEMORY_URL, method = RequestMethod.GET)
public ResponseEntity<List<MemoryMonitor>> memoryStats() {
return new ResponseEntity<>(MemoryMonitor.getMemoryStats(), HttpStatus.OK);
} | [
"@",
"RequestMapping",
"(",
"value",
"=",
"MEMORY_URL",
",",
"method",
"=",
"RequestMethod",
".",
"GET",
")",
"public",
"ResponseEntity",
"<",
"List",
"<",
"MemoryMonitor",
">",
">",
"memoryStats",
"(",
")",
"{",
"return",
"new",
"ResponseEntity",
"<>",
"(",... | Uses Crafter Commons Memory Monitor POJO to get current JVM Memory stats.
@return {link {@link MemoryMonitor}} | [
"Uses",
"Crafter",
"Commons",
"Memory",
"Monitor",
"POJO",
"to",
"get",
"current",
"JVM",
"Memory",
"stats",
"."
] | 3ed446e3cc8af1055de2de6f871907f90ef27f63 | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/impl/rest/MonitorController.java#L68-L71 |
10,049 | craftercms/deployer | src/main/java/org/craftercms/deployer/impl/rest/MonitorController.java | MonitorController.status | @RequestMapping(value = STATUS_URL, method = RequestMethod.GET)
public ResponseEntity<StatusMonitor> status() {
return new ResponseEntity<>(StatusMonitor.getCurrentStatus(), HttpStatus.OK);
} | java | @RequestMapping(value = STATUS_URL, method = RequestMethod.GET)
public ResponseEntity<StatusMonitor> status() {
return new ResponseEntity<>(StatusMonitor.getCurrentStatus(), HttpStatus.OK);
} | [
"@",
"RequestMapping",
"(",
"value",
"=",
"STATUS_URL",
",",
"method",
"=",
"RequestMethod",
".",
"GET",
")",
"public",
"ResponseEntity",
"<",
"StatusMonitor",
">",
"status",
"(",
")",
"{",
"return",
"new",
"ResponseEntity",
"<>",
"(",
"StatusMonitor",
".",
... | Uses Crafter Commons Status Monitor POJO to get current System status.
@return {link {@link StatusMonitor}} | [
"Uses",
"Crafter",
"Commons",
"Status",
"Monitor",
"POJO",
"to",
"get",
"current",
"System",
"status",
"."
] | 3ed446e3cc8af1055de2de6f871907f90ef27f63 | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/impl/rest/MonitorController.java#L77-L80 |
10,050 | craftercms/deployer | src/main/java/org/craftercms/deployer/impl/rest/MonitorController.java | MonitorController.version | @RequestMapping(value = VERSION_URL, method = RequestMethod.GET)
public ResponseEntity<VersionMonitor> version() throws IOException {
try {
final VersionMonitor monitor = VersionMonitor.getVersion(MonitorController.class);
return new ResponseEntity<>(monitor, HttpStatus.OK);
... | java | @RequestMapping(value = VERSION_URL, method = RequestMethod.GET)
public ResponseEntity<VersionMonitor> version() throws IOException {
try {
final VersionMonitor monitor = VersionMonitor.getVersion(MonitorController.class);
return new ResponseEntity<>(monitor, HttpStatus.OK);
... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"VERSION_URL",
",",
"method",
"=",
"RequestMethod",
".",
"GET",
")",
"public",
"ResponseEntity",
"<",
"VersionMonitor",
">",
"version",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"final",
"VersionMonitor",
"mo... | Uses Crafter Commons Status Version POJO to get current Deployment
and JVM runtime and version information.
@return {link {@link VersionMonitor}}
@throws IOException If Manifest File can't be read. | [
"Uses",
"Crafter",
"Commons",
"Status",
"Version",
"POJO",
"to",
"get",
"current",
"Deployment",
"and",
"JVM",
"runtime",
"and",
"version",
"information",
"."
] | 3ed446e3cc8af1055de2de6f871907f90ef27f63 | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/impl/rest/MonitorController.java#L89-L98 |
10,051 | augustd/burp-suite-utils | src/main/java/com/codemagi/burp/Utils.java | Utils.getSelection | public static String getSelection(byte[] message, int[] offsets) {
if (offsets == null || message == null) return "";
if (offsets.length < 2 || offsets[0] == offsets[1]) return "";
byte[] selection = Arrays.copyOfRange(message, offsets[0], offsets[1]);
return n... | java | public static String getSelection(byte[] message, int[] offsets) {
if (offsets == null || message == null) return "";
if (offsets.length < 2 || offsets[0] == offsets[1]) return "";
byte[] selection = Arrays.copyOfRange(message, offsets[0], offsets[1]);
return n... | [
"public",
"static",
"String",
"getSelection",
"(",
"byte",
"[",
"]",
"message",
",",
"int",
"[",
"]",
"offsets",
")",
"{",
"if",
"(",
"offsets",
"==",
"null",
"||",
"message",
"==",
"null",
")",
"return",
"\"\"",
";",
"if",
"(",
"offsets",
".",
"leng... | Returns the user-selected text in the passed array.
@param message The array of bytes to get the selection from
@param offsets The offsets within the array that indicate the start and end points of the selection
@return A String representing the selected bytes. If offsets is null or if both values are the same, "" i... | [
"Returns",
"the",
"user",
"-",
"selected",
"text",
"in",
"the",
"passed",
"array",
"."
] | 5e34a6b9147f5705382f98049dd9e4f387b78629 | https://github.com/augustd/burp-suite-utils/blob/5e34a6b9147f5705382f98049dd9e4f387b78629/src/main/java/com/codemagi/burp/Utils.java#L71-L79 |
10,052 | augustd/burp-suite-utils | src/main/java/com/codemagi/burp/Utils.java | Utils.noNulls | public static String noNulls(String test, String output, String defaultOutput) {
if (isEmpty(test)) {
return defaultOutput;
}
return output;
} | java | public static String noNulls(String test, String output, String defaultOutput) {
if (isEmpty(test)) {
return defaultOutput;
}
return output;
} | [
"public",
"static",
"String",
"noNulls",
"(",
"String",
"test",
",",
"String",
"output",
",",
"String",
"defaultOutput",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"test",
")",
")",
"{",
"return",
"defaultOutput",
";",
"}",
"return",
"output",
";",
"}"
] | Outputs the String output if the test String is not empty, otherwise
outputs default
@param test String to test for emptyness
@param output String to output if the test String is not empty
@param defaultOutput String to output if the test String is empty
@return Object Empty String if the input was null, the input unc... | [
"Outputs",
"the",
"String",
"output",
"if",
"the",
"test",
"String",
"is",
"not",
"empty",
"otherwise",
"outputs",
"default"
] | 5e34a6b9147f5705382f98049dd9e4f387b78629 | https://github.com/augustd/burp-suite-utils/blob/5e34a6b9147f5705382f98049dd9e4f387b78629/src/main/java/com/codemagi/burp/Utils.java#L153-L159 |
10,053 | augustd/burp-suite-utils | src/main/java/com/codemagi/burp/Utils.java | Utils.getFileAsLines | public static List<String> getFileAsLines(String sFileName) throws Exception {
FileInputStream fIn = null;
BufferedReader fileReader = null;
try {
//open the file
fIn = new FileInputStream(sFileName);
fileReader = new BufferedReader(new InputStreamReader(fIn));
//create a Vector for output
... | java | public static List<String> getFileAsLines(String sFileName) throws Exception {
FileInputStream fIn = null;
BufferedReader fileReader = null;
try {
//open the file
fIn = new FileInputStream(sFileName);
fileReader = new BufferedReader(new InputStreamReader(fIn));
//create a Vector for output
... | [
"public",
"static",
"List",
"<",
"String",
">",
"getFileAsLines",
"(",
"String",
"sFileName",
")",
"throws",
"Exception",
"{",
"FileInputStream",
"fIn",
"=",
"null",
";",
"BufferedReader",
"fileReader",
"=",
"null",
";",
"try",
"{",
"//open the file ",
"fIn",
... | Returns the contents of an ASCII file as a List of Strings.
This method throws any fileIO errors.
@param sFileName Full file path.
@return String[] String array containing the contents of the file, one
element per line
@throws Exception Any fileIO errors | [
"Returns",
"the",
"contents",
"of",
"an",
"ASCII",
"file",
"as",
"a",
"List",
"of",
"Strings",
"."
] | 5e34a6b9147f5705382f98049dd9e4f387b78629 | https://github.com/augustd/burp-suite-utils/blob/5e34a6b9147f5705382f98049dd9e4f387b78629/src/main/java/com/codemagi/burp/Utils.java#L243-L276 |
10,054 | craftercms/deployer | src/main/java/org/craftercms/deployer/api/ChangeSet.java | ChangeSet.isEmpty | @JsonIgnore
public boolean isEmpty() {
return CollectionUtils.isEmpty(createdFiles) &&
CollectionUtils.isEmpty(updatedFiles) &&
CollectionUtils.isEmpty(deletedFiles);
} | java | @JsonIgnore
public boolean isEmpty() {
return CollectionUtils.isEmpty(createdFiles) &&
CollectionUtils.isEmpty(updatedFiles) &&
CollectionUtils.isEmpty(deletedFiles);
} | [
"@",
"JsonIgnore",
"public",
"boolean",
"isEmpty",
"(",
")",
"{",
"return",
"CollectionUtils",
".",
"isEmpty",
"(",
"createdFiles",
")",
"&&",
"CollectionUtils",
".",
"isEmpty",
"(",
"updatedFiles",
")",
"&&",
"CollectionUtils",
".",
"isEmpty",
"(",
"deletedFile... | Returns true if there are not created, updated or deleted files. | [
"Returns",
"true",
"if",
"there",
"are",
"not",
"created",
"updated",
"or",
"deleted",
"files",
"."
] | 3ed446e3cc8af1055de2de6f871907f90ef27f63 | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/api/ChangeSet.java#L78-L83 |
10,055 | craftercms/deployer | src/main/java/org/craftercms/deployer/utils/GitUtils.java | GitUtils.cloneRemoteRepository | public static Git cloneRemoteRepository(String remoteName, String remoteUrl, String branch,
GitAuthenticationConfigurator authConfigurator, File localFolder,
String bigFileThreshold, Integer compression,
... | java | public static Git cloneRemoteRepository(String remoteName, String remoteUrl, String branch,
GitAuthenticationConfigurator authConfigurator, File localFolder,
String bigFileThreshold, Integer compression,
... | [
"public",
"static",
"Git",
"cloneRemoteRepository",
"(",
"String",
"remoteName",
",",
"String",
"remoteUrl",
",",
"String",
"branch",
",",
"GitAuthenticationConfigurator",
"authConfigurator",
",",
"File",
"localFolder",
",",
"String",
"bigFileThreshold",
",",
"Integer",... | Clones a remote repository into a specific local folder.
@param remoteName the name of the remote
@param remoteUrl the URL of the remote. This should be a legal Git URL.
@param branch the branch which should be cloned
@param authConfigurator the {@link GitAuthenticationConfigurator} class used t... | [
"Clones",
"a",
"remote",
"repository",
"into",
"a",
"specific",
"local",
"folder",
"."
] | 3ed446e3cc8af1055de2de6f871907f90ef27f63 | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/utils/GitUtils.java#L83-L121 |
10,056 | craftercms/deployer | src/main/java/org/craftercms/deployer/utils/GitUtils.java | GitUtils.pull | public static PullResult pull(Git git, String remoteName, String remoteUrl, String branch,
MergeStrategy mergeStrategy, GitAuthenticationConfigurator authConfigurator)
throws GitAPIException, URISyntaxException {
addRemote(git, remoteName, remoteUrl);
PullC... | java | public static PullResult pull(Git git, String remoteName, String remoteUrl, String branch,
MergeStrategy mergeStrategy, GitAuthenticationConfigurator authConfigurator)
throws GitAPIException, URISyntaxException {
addRemote(git, remoteName, remoteUrl);
PullC... | [
"public",
"static",
"PullResult",
"pull",
"(",
"Git",
"git",
",",
"String",
"remoteName",
",",
"String",
"remoteUrl",
",",
"String",
"branch",
",",
"MergeStrategy",
"mergeStrategy",
",",
"GitAuthenticationConfigurator",
"authConfigurator",
")",
"throws",
"GitAPIExcept... | Execute a Git pull.
@param git the Git instance used to handle the repository
@param remoteName the name of the remote where to pull from
@param remoteUrl the URL of the remote (remote will be set to the URL)
@param branch the branch to pull
@param mergeStrategy the merge strateg... | [
"Execute",
"a",
"Git",
"pull",
"."
] | 3ed446e3cc8af1055de2de6f871907f90ef27f63 | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/utils/GitUtils.java#L137-L155 |
10,057 | craftercms/deployer | src/main/java/org/craftercms/deployer/utils/GitUtils.java | GitUtils.push | public static Iterable<PushResult> push(Git git, String remote, String branch,
GitAuthenticationConfigurator authConfigurator) throws GitAPIException {
PushCommand push = git.push();
push.setRemote(remote);
if (StringUtils.isNotEmpty(branch)) {
... | java | public static Iterable<PushResult> push(Git git, String remote, String branch,
GitAuthenticationConfigurator authConfigurator) throws GitAPIException {
PushCommand push = git.push();
push.setRemote(remote);
if (StringUtils.isNotEmpty(branch)) {
... | [
"public",
"static",
"Iterable",
"<",
"PushResult",
">",
"push",
"(",
"Git",
"git",
",",
"String",
"remote",
",",
"String",
"branch",
",",
"GitAuthenticationConfigurator",
"authConfigurator",
")",
"throws",
"GitAPIException",
"{",
"PushCommand",
"push",
"=",
"git",... | Executes a git push.
@param git the Git instance used to handle the repository
@param remote remote name or URL
@param branch the remote branch being pushed to
@param authConfigurator the {@link GitAuthenticationConfigurator} class used to configure the authentication
with the remote
r... | [
"Executes",
"a",
"git",
"push",
"."
] | 3ed446e3cc8af1055de2de6f871907f90ef27f63 | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/utils/GitUtils.java#L169-L182 |
10,058 | craftercms/deployer | src/main/java/org/craftercms/deployer/utils/GitUtils.java | GitUtils.cleanup | public static void cleanup(String repoPath) throws GitAPIException, IOException {
openRepository(new File(repoPath)).gc().call();
} | java | public static void cleanup(String repoPath) throws GitAPIException, IOException {
openRepository(new File(repoPath)).gc().call();
} | [
"public",
"static",
"void",
"cleanup",
"(",
"String",
"repoPath",
")",
"throws",
"GitAPIException",
",",
"IOException",
"{",
"openRepository",
"(",
"new",
"File",
"(",
"repoPath",
")",
")",
".",
"gc",
"(",
")",
".",
"call",
"(",
")",
";",
"}"
] | Executes a git gc.
@param repoPath full path of the repository
@throws GitAPIException if there is an error running the command
@throws IOException if there is an error opening the repository | [
"Executes",
"a",
"git",
"gc",
"."
] | 3ed446e3cc8af1055de2de6f871907f90ef27f63 | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/utils/GitUtils.java#L190-L192 |
10,059 | craftercms/deployer | src/main/java/org/craftercms/deployer/utils/GitUtils.java | GitUtils.addRemote | private static void addRemote(Git git, String remoteName, String remoteUrl) throws GitAPIException,
URISyntaxException {
String currentUrl = git.getRepository().getConfig().getString("remote", remoteName, "url");
if (... | java | private static void addRemote(Git git, String remoteName, String remoteUrl) throws GitAPIException,
URISyntaxException {
String currentUrl = git.getRepository().getConfig().getString("remote", remoteName, "url");
if (... | [
"private",
"static",
"void",
"addRemote",
"(",
"Git",
"git",
",",
"String",
"remoteName",
",",
"String",
"remoteUrl",
")",
"throws",
"GitAPIException",
",",
"URISyntaxException",
"{",
"String",
"currentUrl",
"=",
"git",
".",
"getRepository",
"(",
")",
".",
"ge... | Adds a remote if it doesn't exist. If the remote exists but the URL is different, updates the URL
@param git the Git repo
@param remoteName the name oif the remote
@param remoteUrl the URL of the remote
@throws GitAPIException if a Git error occurs
@throws URISyntaxException if the remote URL is an invalid Git URL | [
"Adds",
"a",
"remote",
"if",
"it",
"doesn",
"t",
"exist",
".",
"If",
"the",
"remote",
"exists",
"but",
"the",
"URL",
"is",
"different",
"updates",
"the",
"URL"
] | 3ed446e3cc8af1055de2de6f871907f90ef27f63 | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/utils/GitUtils.java#L204-L220 |
10,060 | Inbot/inbot-utils | src/main/java/io/inbot/utils/StrategyEvaluator.java | StrategyEvaluator.evaluate | @SafeVarargs
public static <T> Optional<T> evaluate(Supplier<Optional<T>>...suppliers) {
for(Supplier<Optional<T>>s: suppliers) {
Optional<T> maybe = s.get();
if(maybe.isPresent()) {
return maybe;
}
}
return Optional.empty();
} | java | @SafeVarargs
public static <T> Optional<T> evaluate(Supplier<Optional<T>>...suppliers) {
for(Supplier<Optional<T>>s: suppliers) {
Optional<T> maybe = s.get();
if(maybe.isPresent()) {
return maybe;
}
}
return Optional.empty();
} | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"Optional",
"<",
"T",
">",
"evaluate",
"(",
"Supplier",
"<",
"Optional",
"<",
"T",
">",
">",
"...",
"suppliers",
")",
"{",
"for",
"(",
"Supplier",
"<",
"Optional",
"<",
"T",
">",
">",
"s",
":",... | Evaluate supplier stategies that produce Optionals until one returns something. This implements the strategy
pattern with a simple varargs of suppliers that produce an Optional T. You can use this to use several
strategies to calculate a T.
@param suppliers
the strategies that produce Optionals of the desired output t... | [
"Evaluate",
"supplier",
"stategies",
"that",
"produce",
"Optionals",
"until",
"one",
"returns",
"something",
".",
"This",
"implements",
"the",
"strategy",
"pattern",
"with",
"a",
"simple",
"varargs",
"of",
"suppliers",
"that",
"produce",
"an",
"Optional",
"T",
"... | 3112bc08d4237e95fe0f8a219a5bbceb390d0505 | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/StrategyEvaluator.java#L18-L27 |
10,061 | Inbot/inbot-utils | src/main/java/io/inbot/utils/KeyPairUtils.java | KeyPairUtils.privateKey2String | public static String privateKey2String(PrivateKey key) {
PKCS8EncodedKeySpec spec = new PKCS8EncodedKeySpec(key.getEncoded());
return new String(Base64.getEncoder().encode(spec.getEncoded()), StandardCharsets.UTF_8);
} | java | public static String privateKey2String(PrivateKey key) {
PKCS8EncodedKeySpec spec = new PKCS8EncodedKeySpec(key.getEncoded());
return new String(Base64.getEncoder().encode(spec.getEncoded()), StandardCharsets.UTF_8);
} | [
"public",
"static",
"String",
"privateKey2String",
"(",
"PrivateKey",
"key",
")",
"{",
"PKCS8EncodedKeySpec",
"spec",
"=",
"new",
"PKCS8EncodedKeySpec",
"(",
"key",
".",
"getEncoded",
"(",
")",
")",
";",
"return",
"new",
"String",
"(",
"Base64",
".",
"getEncod... | Put this in a safe place obviously.
@param key the key
@return base 64 encoded string of the PKCS8 spec | [
"Put",
"this",
"in",
"a",
"safe",
"place",
"obviously",
"."
] | 3112bc08d4237e95fe0f8a219a5bbceb390d0505 | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/KeyPairUtils.java#L45-L48 |
10,062 | Inbot/inbot-utils | src/main/java/io/inbot/utils/KeyPairUtils.java | KeyPairUtils.publicKey2String | public static String publicKey2String(PublicKey key) {
X509EncodedKeySpec spec = new X509EncodedKeySpec(key.getEncoded());
return new String(Base64.getEncoder().encode(spec.getEncoded()), StandardCharsets.UTF_8);
} | java | public static String publicKey2String(PublicKey key) {
X509EncodedKeySpec spec = new X509EncodedKeySpec(key.getEncoded());
return new String(Base64.getEncoder().encode(spec.getEncoded()), StandardCharsets.UTF_8);
} | [
"public",
"static",
"String",
"publicKey2String",
"(",
"PublicKey",
"key",
")",
"{",
"X509EncodedKeySpec",
"spec",
"=",
"new",
"X509EncodedKeySpec",
"(",
"key",
".",
"getEncoded",
"(",
")",
")",
";",
"return",
"new",
"String",
"(",
"Base64",
".",
"getEncoder",... | This is what you can share.
@param key the key
@return base 64 encoded string of the X509 spec | [
"This",
"is",
"what",
"you",
"can",
"share",
"."
] | 3112bc08d4237e95fe0f8a219a5bbceb390d0505 | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/KeyPairUtils.java#L55-L58 |
10,063 | craftercms/deployer | src/main/java/org/craftercms/deployer/api/Deployment.java | Deployment.getDuration | @JsonProperty("duration")
public Long getDuration() {
if (start != null && end != null) {
return start.until(end, ChronoUnit.MILLIS);
} else {
return null;
}
} | java | @JsonProperty("duration")
public Long getDuration() {
if (start != null && end != null) {
return start.until(end, ChronoUnit.MILLIS);
} else {
return null;
}
} | [
"@",
"JsonProperty",
"(",
"\"duration\"",
")",
"public",
"Long",
"getDuration",
"(",
")",
"{",
"if",
"(",
"start",
"!=",
"null",
"&&",
"end",
"!=",
"null",
")",
"{",
"return",
"start",
".",
"until",
"(",
"end",
",",
"ChronoUnit",
".",
"MILLIS",
")",
... | Returns the duration of the deployment. | [
"Returns",
"the",
"duration",
"of",
"the",
"deployment",
"."
] | 3ed446e3cc8af1055de2de6f871907f90ef27f63 | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/api/Deployment.java#L97-L104 |
10,064 | augustd/burp-suite-utils | src/main/java/com/codemagi/burp/PassiveScan.java | PassiveScan.getMatchRule | public MatchRule getMatchRule(int index) {
if (index < rules.size()) {
return rules.get(index);
}
return null;
} | java | public MatchRule getMatchRule(int index) {
if (index < rules.size()) {
return rules.get(index);
}
return null;
} | [
"public",
"MatchRule",
"getMatchRule",
"(",
"int",
"index",
")",
"{",
"if",
"(",
"index",
"<",
"rules",
".",
"size",
"(",
")",
")",
"{",
"return",
"rules",
".",
"get",
"(",
"index",
")",
";",
"}",
"return",
"null",
";",
"}"
] | Get an existing match rule of the scan.
If no match rule exists at the specified index, this method returns null.
@param index Index of the match rule to return
@return The match rule at the specified index, or null if none exists | [
"Get",
"an",
"existing",
"match",
"rule",
"of",
"the",
"scan",
"."
] | 5e34a6b9147f5705382f98049dd9e4f387b78629 | https://github.com/augustd/burp-suite-utils/blob/5e34a6b9147f5705382f98049dd9e4f387b78629/src/main/java/com/codemagi/burp/PassiveScan.java#L93-L98 |
10,065 | augustd/burp-suite-utils | src/main/java/com/codemagi/burp/PassiveScan.java | PassiveScan.processIssues | protected List<IScanIssue> processIssues(List<ScannerMatch> matches, IHttpRequestResponse baseRequestResponse) {
List<IScanIssue> issues = new ArrayList<>();
if (!matches.isEmpty()) {
Collections.sort(matches); //matches must be in order
//get the offsets of scanner matches
List<int[]> startStop = new Arra... | java | protected List<IScanIssue> processIssues(List<ScannerMatch> matches, IHttpRequestResponse baseRequestResponse) {
List<IScanIssue> issues = new ArrayList<>();
if (!matches.isEmpty()) {
Collections.sort(matches); //matches must be in order
//get the offsets of scanner matches
List<int[]> startStop = new Arra... | [
"protected",
"List",
"<",
"IScanIssue",
">",
"processIssues",
"(",
"List",
"<",
"ScannerMatch",
">",
"matches",
",",
"IHttpRequestResponse",
"baseRequestResponse",
")",
"{",
"List",
"<",
"IScanIssue",
">",
"issues",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";"... | Process scanner matches into a list of reportable issues.
@param matches A list of matches found by the scanner
@param baseRequestResponse The request/response object that was scanned
@return the final list of scanner issues to be reported, or null if no issues are found. | [
"Process",
"scanner",
"matches",
"into",
"a",
"list",
"of",
"reportable",
"issues",
"."
] | 5e34a6b9147f5705382f98049dd9e4f387b78629 | https://github.com/augustd/burp-suite-utils/blob/5e34a6b9147f5705382f98049dd9e4f387b78629/src/main/java/com/codemagi/burp/PassiveScan.java#L150-L167 |
10,066 | omadahealth/TypefaceView | lib/src/main/java/com/github/omadahealth/typefaceview/TypefaceEditText.java | TypefaceEditText.setCustomTypeface | private void setCustomTypeface(Context context, AttributeSet attrs) {
DEFAULT_TYPEFACE = TypefaceType.getDefaultTypeface(context);
//Typeface.createFromAsset doesn't work in the layout editor. Skipping...
if (isInEditMode() || attrs == null || Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCO... | java | private void setCustomTypeface(Context context, AttributeSet attrs) {
DEFAULT_TYPEFACE = TypefaceType.getDefaultTypeface(context);
//Typeface.createFromAsset doesn't work in the layout editor. Skipping...
if (isInEditMode() || attrs == null || Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCO... | [
"private",
"void",
"setCustomTypeface",
"(",
"Context",
"context",
",",
"AttributeSet",
"attrs",
")",
"{",
"DEFAULT_TYPEFACE",
"=",
"TypefaceType",
".",
"getDefaultTypeface",
"(",
"context",
")",
";",
"//Typeface.createFromAsset doesn't work in the layout editor. Skipping..."... | Sets the typeface for the view
@param context
@param attrs | [
"Sets",
"the",
"typeface",
"for",
"the",
"view"
] | 9a36a67b0fb26584c3e20a24f8f0bafad6a0badd | https://github.com/omadahealth/TypefaceView/blob/9a36a67b0fb26584c3e20a24f8f0bafad6a0badd/lib/src/main/java/com/github/omadahealth/typefaceview/TypefaceEditText.java#L81-L96 |
10,067 | omadahealth/TypefaceView | lib/src/main/java/com/github/omadahealth/typefaceview/TypefaceEditText.java | TypefaceEditText.getFont | public static Typeface getFont(Context context, String fontName) {
synchronized (cache) {
if (!cache.containsKey(fontName)) {
try {
Typeface t = Typeface.createFromAsset(context.getAssets(), fontName);
cache.put(fontName, t);
} ... | java | public static Typeface getFont(Context context, String fontName) {
synchronized (cache) {
if (!cache.containsKey(fontName)) {
try {
Typeface t = Typeface.createFromAsset(context.getAssets(), fontName);
cache.put(fontName, t);
} ... | [
"public",
"static",
"Typeface",
"getFont",
"(",
"Context",
"context",
",",
"String",
"fontName",
")",
"{",
"synchronized",
"(",
"cache",
")",
"{",
"if",
"(",
"!",
"cache",
".",
"containsKey",
"(",
"fontName",
")",
")",
"{",
"try",
"{",
"Typeface",
"t",
... | Avoid reloading assets every time | [
"Avoid",
"reloading",
"assets",
"every",
"time"
] | 9a36a67b0fb26584c3e20a24f8f0bafad6a0badd | https://github.com/omadahealth/TypefaceView/blob/9a36a67b0fb26584c3e20a24f8f0bafad6a0badd/lib/src/main/java/com/github/omadahealth/typefaceview/TypefaceEditText.java#L101-L113 |
10,068 | Inbot/inbot-utils | src/main/java/io/inbot/utils/PasswordHash.java | PasswordHash.createHash | public static String createHash(char[] password) throws NoSuchAlgorithmException, InvalidKeySpecException {
// Generate a random salt
SecureRandom random = new SecureRandom();
byte[] salt = new byte[SALT_BYTE_SIZE];
random.nextBytes(salt);
// Hash the password
byte[] has... | java | public static String createHash(char[] password) throws NoSuchAlgorithmException, InvalidKeySpecException {
// Generate a random salt
SecureRandom random = new SecureRandom();
byte[] salt = new byte[SALT_BYTE_SIZE];
random.nextBytes(salt);
// Hash the password
byte[] has... | [
"public",
"static",
"String",
"createHash",
"(",
"char",
"[",
"]",
"password",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeySpecException",
"{",
"// Generate a random salt",
"SecureRandom",
"random",
"=",
"new",
"SecureRandom",
"(",
")",
";",
"byte",
"... | Returns a salted PBKDF2 hash of the password.
@param password
the password to hash
@return a salted PBKDF2 hash of the password
@throws NoSuchAlgorithmException if jdk does not support the algorithm
@throws InvalidKeySpecException if the password or salt are invalid | [
"Returns",
"a",
"salted",
"PBKDF2",
"hash",
"of",
"the",
"password",
"."
] | 3112bc08d4237e95fe0f8a219a5bbceb390d0505 | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/PasswordHash.java#L78-L88 |
10,069 | Inbot/inbot-utils | src/main/java/io/inbot/utils/PasswordHash.java | PasswordHash.slowEquals | private static boolean slowEquals(byte[] a, byte[] b) {
int diff = a.length ^ b.length;
for(int i = 0; i < a.length && i < b.length; i++) {
diff |= a[i] ^ b[i];
}
return diff == 0;
} | java | private static boolean slowEquals(byte[] a, byte[] b) {
int diff = a.length ^ b.length;
for(int i = 0; i < a.length && i < b.length; i++) {
diff |= a[i] ^ b[i];
}
return diff == 0;
} | [
"private",
"static",
"boolean",
"slowEquals",
"(",
"byte",
"[",
"]",
"a",
",",
"byte",
"[",
"]",
"b",
")",
"{",
"int",
"diff",
"=",
"a",
".",
"length",
"^",
"b",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"a",
".",
... | Compares two byte arrays in length-constant time. This comparison method is used so that password hashes cannot
be extracted from an on-line system using a timing attack and then attacked off-line.
@param a
the first byte array
@param b
the second byte array
@return true if both byte arrays are the same, false if not | [
"Compares",
"two",
"byte",
"arrays",
"in",
"length",
"-",
"constant",
"time",
".",
"This",
"comparison",
"method",
"is",
"used",
"so",
"that",
"password",
"hashes",
"cannot",
"be",
"extracted",
"from",
"an",
"on",
"-",
"line",
"system",
"using",
"a",
"timi... | 3112bc08d4237e95fe0f8a219a5bbceb390d0505 | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/PasswordHash.java#L140-L146 |
10,070 | rometools/rome-modules | src/main/java/com/rometools/modules/activitystreams/types/Bookmark.java | Bookmark.setThumbnail | public void setThumbnail(final Link newthumbnail) {
Link old = null;
for (final Link l : getOtherLinks()) {
if ("thumbnail".equals(l.getRel())) {
old = l;
break;
}
}
if (old != null) {
getOtherLinks().remove(old);
... | java | public void setThumbnail(final Link newthumbnail) {
Link old = null;
for (final Link l : getOtherLinks()) {
if ("thumbnail".equals(l.getRel())) {
old = l;
break;
}
}
if (old != null) {
getOtherLinks().remove(old);
... | [
"public",
"void",
"setThumbnail",
"(",
"final",
"Link",
"newthumbnail",
")",
"{",
"Link",
"old",
"=",
"null",
";",
"for",
"(",
"final",
"Link",
"l",
":",
"getOtherLinks",
"(",
")",
")",
"{",
"if",
"(",
"\"thumbnail\"",
".",
"equals",
"(",
"l",
".",
"... | Set the value of thumbnail
@param newthumbnail new value of thumbnail | [
"Set",
"the",
"value",
"of",
"thumbnail"
] | adc6be4ec33b8418c6cf01f15924f8daee37afc9 | https://github.com/rometools/rome-modules/blob/adc6be4ec33b8418c6cf01f15924f8daee37afc9/src/main/java/com/rometools/modules/activitystreams/types/Bookmark.java#L102-L115 |
10,071 | augustd/burp-suite-utils | src/main/java/com/codemagi/burp/parser/HttpRequest.java | HttpRequest.getCookies | public List<ICookie> getCookies() {
String cookies = getHeader("Cookie");
List<ICookie> output = new ArrayList<>();
if (Utils.isEmpty(cookies)) {
return output;
}
for (String cookieStr : cookies.split("[; ]+")) {
String[] pair = cookieStr.split("=", 2);
... | java | public List<ICookie> getCookies() {
String cookies = getHeader("Cookie");
List<ICookie> output = new ArrayList<>();
if (Utils.isEmpty(cookies)) {
return output;
}
for (String cookieStr : cookies.split("[; ]+")) {
String[] pair = cookieStr.split("=", 2);
... | [
"public",
"List",
"<",
"ICookie",
">",
"getCookies",
"(",
")",
"{",
"String",
"cookies",
"=",
"getHeader",
"(",
"\"Cookie\"",
")",
";",
"List",
"<",
"ICookie",
">",
"output",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"Utils",
".",
"isE... | Gets the value of the Cookie header
@return A list containing Cookie objects parsed from the internal string
representation | [
"Gets",
"the",
"value",
"of",
"the",
"Cookie",
"header"
] | 5e34a6b9147f5705382f98049dd9e4f387b78629 | https://github.com/augustd/burp-suite-utils/blob/5e34a6b9147f5705382f98049dd9e4f387b78629/src/main/java/com/codemagi/burp/parser/HttpRequest.java#L250-L263 |
10,072 | augustd/burp-suite-utils | src/main/java/com/codemagi/burp/parser/HttpRequest.java | HttpRequest.setParameter | public void setParameter(String name, String value) {
sortedParams = null;
parameters.add(new Parameter(name, value));
} | java | public void setParameter(String name, String value) {
sortedParams = null;
parameters.add(new Parameter(name, value));
} | [
"public",
"void",
"setParameter",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"sortedParams",
"=",
"null",
";",
"parameters",
".",
"add",
"(",
"new",
"Parameter",
"(",
"name",
",",
"value",
")",
")",
";",
"}"
] | Sets a parameter value based on its name.
@param name The parameter name to set
@param value The parameter value to set | [
"Sets",
"a",
"parameter",
"value",
"based",
"on",
"its",
"name",
"."
] | 5e34a6b9147f5705382f98049dd9e4f387b78629 | https://github.com/augustd/burp-suite-utils/blob/5e34a6b9147f5705382f98049dd9e4f387b78629/src/main/java/com/codemagi/burp/parser/HttpRequest.java#L309-L312 |
10,073 | augustd/burp-suite-utils | src/main/java/com/codemagi/burp/parser/HttpRequest.java | HttpRequest.parseParameters | private void parseParameters(String input) {
for (String param : input.split("&")) {
String[] pair = param.split("=");
String name = (pair.length > 0) ? pair[0] : null;
String value = (pair.length > 1) ? pair[1] : null;
if (name != null) {
setPar... | java | private void parseParameters(String input) {
for (String param : input.split("&")) {
String[] pair = param.split("=");
String name = (pair.length > 0) ? pair[0] : null;
String value = (pair.length > 1) ? pair[1] : null;
if (name != null) {
setPar... | [
"private",
"void",
"parseParameters",
"(",
"String",
"input",
")",
"{",
"for",
"(",
"String",
"param",
":",
"input",
".",
"split",
"(",
"\"&\"",
")",
")",
"{",
"String",
"[",
"]",
"pair",
"=",
"param",
".",
"split",
"(",
"\"=\"",
")",
";",
"String",
... | Parses a String of HTTP parameters into the internal parameters data
structure. No input checking or decoding is performed!
@param input A String of HTTP parameters in the form of:
name1=value1&name2=value2&... | [
"Parses",
"a",
"String",
"of",
"HTTP",
"parameters",
"into",
"the",
"internal",
"parameters",
"data",
"structure",
".",
"No",
"input",
"checking",
"or",
"decoding",
"is",
"performed!"
] | 5e34a6b9147f5705382f98049dd9e4f387b78629 | https://github.com/augustd/burp-suite-utils/blob/5e34a6b9147f5705382f98049dd9e4f387b78629/src/main/java/com/codemagi/burp/parser/HttpRequest.java#L488-L499 |
10,074 | Inbot/inbot-utils | src/main/java/io/inbot/utils/JwtVerificationService.java | JwtVerificationService.verify | public void verify(String token, Consumer<Verification> verificationConsumer) throws JWTVerificationException, IllegalArgumentException {
Verification verifierBuilder = JWT.require(Algorithm.ECDSA512(ecPublicKey, null))
.withIssuer(issuer);
// apply any custom verififaction
verif... | java | public void verify(String token, Consumer<Verification> verificationConsumer) throws JWTVerificationException, IllegalArgumentException {
Verification verifierBuilder = JWT.require(Algorithm.ECDSA512(ecPublicKey, null))
.withIssuer(issuer);
// apply any custom verififaction
verif... | [
"public",
"void",
"verify",
"(",
"String",
"token",
",",
"Consumer",
"<",
"Verification",
">",
"verificationConsumer",
")",
"throws",
"JWTVerificationException",
",",
"IllegalArgumentException",
"{",
"Verification",
"verifierBuilder",
"=",
"JWT",
".",
"require",
"(",
... | Verifies the token.
@param token a jwt token.
@param verificationConsumer a way for you to verify claims by passing in a lambda function that accepts a Verification on which you can call e.g. withSubject, withClaim, etc.
@throws JWTVerificationException if not valid
@throws IllegalArgumentException if token is malforme... | [
"Verifies",
"the",
"token",
"."
] | 3112bc08d4237e95fe0f8a219a5bbceb390d0505 | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/JwtVerificationService.java#L46-L53 |
10,075 | craftercms/deployer | src/main/java/org/craftercms/deployer/impl/rest/TargetController.java | TargetController.getPendingDeployments | @RequestMapping(value = GET_PENDING_DEPLOYMENTS_URL, method = RequestMethod.GET)
public ResponseEntity<Collection<Deployment>> getPendingDeployments(@PathVariable(ENV_PATH_VAR_NAME) String env,
@PathVariable(SITE_NAME_PATH_VAR_NAME) String site... | java | @RequestMapping(value = GET_PENDING_DEPLOYMENTS_URL, method = RequestMethod.GET)
public ResponseEntity<Collection<Deployment>> getPendingDeployments(@PathVariable(ENV_PATH_VAR_NAME) String env,
@PathVariable(SITE_NAME_PATH_VAR_NAME) String site... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"GET_PENDING_DEPLOYMENTS_URL",
",",
"method",
"=",
"RequestMethod",
".",
"GET",
")",
"public",
"ResponseEntity",
"<",
"Collection",
"<",
"Deployment",
">",
">",
"getPendingDeployments",
"(",
"@",
"PathVariable",
"(",
"ENV_... | Gets the pending deployments for a target.
@param env the target's environment
@param siteName the target's site name
@return the pending deployments for the target
@throws DeployerException if an error occurred | [
"Gets",
"the",
"pending",
"deployments",
"for",
"a",
"target",
"."
] | 3ed446e3cc8af1055de2de6f871907f90ef27f63 | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/impl/rest/TargetController.java#L268-L279 |
10,076 | craftercms/deployer | src/main/java/org/craftercms/deployer/impl/rest/TargetController.java | TargetController.getCurrentDeployment | @RequestMapping(value = GET_CURRENT_DEPLOYMENT_URL, method = RequestMethod.GET)
public ResponseEntity<Deployment> getCurrentDeployment(@PathVariable(ENV_PATH_VAR_NAME) String env,
@PathVariable(SITE_NAME_PATH_VAR_NAME) String siteName)
throws Deploy... | java | @RequestMapping(value = GET_CURRENT_DEPLOYMENT_URL, method = RequestMethod.GET)
public ResponseEntity<Deployment> getCurrentDeployment(@PathVariable(ENV_PATH_VAR_NAME) String env,
@PathVariable(SITE_NAME_PATH_VAR_NAME) String siteName)
throws Deploy... | [
"@",
"RequestMapping",
"(",
"value",
"=",
"GET_CURRENT_DEPLOYMENT_URL",
",",
"method",
"=",
"RequestMethod",
".",
"GET",
")",
"public",
"ResponseEntity",
"<",
"Deployment",
">",
"getCurrentDeployment",
"(",
"@",
"PathVariable",
"(",
"ENV_PATH_VAR_NAME",
")",
"String... | Gets the current deployment for a target.
@param env the target's environment
@param siteName the target's site name
@return the pending and current deployments for the target
@throws DeployerException if an error occurred | [
"Gets",
"the",
"current",
"deployment",
"for",
"a",
"target",
"."
] | 3ed446e3cc8af1055de2de6f871907f90ef27f63 | https://github.com/craftercms/deployer/blob/3ed446e3cc8af1055de2de6f871907f90ef27f63/src/main/java/org/craftercms/deployer/impl/rest/TargetController.java#L291-L302 |
10,077 | augustd/burp-suite-utils | src/main/java/com/codemagi/burp/RuleTableComponent.java | RuleTableComponent.loadMatchRules | private boolean loadMatchRules(String rulesUrl) {
//load match rules from file
try {
//check for file URL
if (rulesUrl != null && rulesUrl.toLowerCase().startsWith("file:")) {
return loadMatchRulesFromFile(rulesUrl);
}
//request match rules... | java | private boolean loadMatchRules(String rulesUrl) {
//load match rules from file
try {
//check for file URL
if (rulesUrl != null && rulesUrl.toLowerCase().startsWith("file:")) {
return loadMatchRulesFromFile(rulesUrl);
}
//request match rules... | [
"private",
"boolean",
"loadMatchRules",
"(",
"String",
"rulesUrl",
")",
"{",
"//load match rules from file",
"try",
"{",
"//check for file URL ",
"if",
"(",
"rulesUrl",
"!=",
"null",
"&&",
"rulesUrl",
".",
"toLowerCase",
"(",
")",
".",
"startsWith",
"(",
"\"file:\... | Load match rules from a URL | [
"Load",
"match",
"rules",
"from",
"a",
"URL"
] | 5e34a6b9147f5705382f98049dd9e4f387b78629 | https://github.com/augustd/burp-suite-utils/blob/5e34a6b9147f5705382f98049dd9e4f387b78629/src/main/java/com/codemagi/burp/RuleTableComponent.java#L105-L143 |
10,078 | augustd/burp-suite-utils | src/main/java/com/codemagi/burp/RuleTableComponent.java | RuleTableComponent.loadMatchRulesFromJar | private boolean loadMatchRulesFromJar(String rulesUrl) {
//load match rules from a local file
try {
mCallbacks.printOutput("Loading match rules from local jar: " + rulesUrl);
InputStream in = getClass().getClassLoader().getResourceAsStream(rulesUrl);
BufferedReader reader = new BufferedR... | java | private boolean loadMatchRulesFromJar(String rulesUrl) {
//load match rules from a local file
try {
mCallbacks.printOutput("Loading match rules from local jar: " + rulesUrl);
InputStream in = getClass().getClassLoader().getResourceAsStream(rulesUrl);
BufferedReader reader = new BufferedR... | [
"private",
"boolean",
"loadMatchRulesFromJar",
"(",
"String",
"rulesUrl",
")",
"{",
"//load match rules from a local file",
"try",
"{",
"mCallbacks",
".",
"printOutput",
"(",
"\"Loading match rules from local jar: \"",
"+",
"rulesUrl",
")",
";",
"InputStream",
"in",
"=",
... | Load match rules from within the jar | [
"Load",
"match",
"rules",
"from",
"within",
"the",
"jar"
] | 5e34a6b9147f5705382f98049dd9e4f387b78629 | https://github.com/augustd/burp-suite-utils/blob/5e34a6b9147f5705382f98049dd9e4f387b78629/src/main/java/com/codemagi/burp/RuleTableComponent.java#L170-L188 |
10,079 | augustd/burp-suite-utils | src/main/java/com/codemagi/burp/RuleTableComponent.java | RuleTableComponent.loadMatchRulesFromFile | private boolean loadMatchRulesFromFile(String rulesUrl) {
//load match rules from a local file
try {
mCallbacks.printOutput("Loading match rules from file: " + rulesUrl);
InputStream in = new URL(rulesUrl).openStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(in, ... | java | private boolean loadMatchRulesFromFile(String rulesUrl) {
//load match rules from a local file
try {
mCallbacks.printOutput("Loading match rules from file: " + rulesUrl);
InputStream in = new URL(rulesUrl).openStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(in, ... | [
"private",
"boolean",
"loadMatchRulesFromFile",
"(",
"String",
"rulesUrl",
")",
"{",
"//load match rules from a local file",
"try",
"{",
"mCallbacks",
".",
"printOutput",
"(",
"\"Loading match rules from file: \"",
"+",
"rulesUrl",
")",
";",
"InputStream",
"in",
"=",
"n... | Load match rules from a file URL | [
"Load",
"match",
"rules",
"from",
"a",
"file",
"URL"
] | 5e34a6b9147f5705382f98049dd9e4f387b78629 | https://github.com/augustd/burp-suite-utils/blob/5e34a6b9147f5705382f98049dd9e4f387b78629/src/main/java/com/codemagi/burp/RuleTableComponent.java#L193-L211 |
10,080 | rometools/rome-modules | src/main/java/com/rometools/modules/base/types/GenderEnumeration.java | GenderEnumeration.findByValue | public static GenderEnumeration findByValue(final String value) {
if (value == null) {
return null;
}
final String gender = value.toUpperCase();
if (gender.charAt(0) == 'M') {
return GenderEnumeration.MALE;
} else if (gender.charAt(0) == 'F') {
... | java | public static GenderEnumeration findByValue(final String value) {
if (value == null) {
return null;
}
final String gender = value.toUpperCase();
if (gender.charAt(0) == 'M') {
return GenderEnumeration.MALE;
} else if (gender.charAt(0) == 'F') {
... | [
"public",
"static",
"GenderEnumeration",
"findByValue",
"(",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"String",
"gender",
"=",
"value",
".",
"toUpperCase",
"(",
")",
";",
"if",... | Returns the proper instance based on the string value | [
"Returns",
"the",
"proper",
"instance",
"based",
"on",
"the",
"string",
"value"
] | adc6be4ec33b8418c6cf01f15924f8daee37afc9 | https://github.com/rometools/rome-modules/blob/adc6be4ec33b8418c6cf01f15924f8daee37afc9/src/main/java/com/rometools/modules/base/types/GenderEnumeration.java#L60-L74 |
10,081 | Inbot/inbot-utils | src/main/java/io/inbot/utils/HashUtils.java | HashUtils.bitString | public static String bitString(long number) {
return String.format(Locale.ROOT,"%064d", new BigInteger(Long.toBinaryString(number)));
} | java | public static String bitString(long number) {
return String.format(Locale.ROOT,"%064d", new BigInteger(Long.toBinaryString(number)));
} | [
"public",
"static",
"String",
"bitString",
"(",
"long",
"number",
")",
"{",
"return",
"String",
".",
"format",
"(",
"Locale",
".",
"ROOT",
",",
"\"%064d\"",
",",
"new",
"BigInteger",
"(",
"Long",
".",
"toBinaryString",
"(",
"number",
")",
")",
")",
";",
... | Get a String representations of the bit in a 64 bit long.
@param number the long you want rendered as bits
@return formatted string with raw bits for the long number | [
"Get",
"a",
"String",
"representations",
"of",
"the",
"bit",
"in",
"a",
"64",
"bit",
"long",
"."
] | 3112bc08d4237e95fe0f8a219a5bbceb390d0505 | https://github.com/Inbot/inbot-utils/blob/3112bc08d4237e95fe0f8a219a5bbceb390d0505/src/main/java/io/inbot/utils/HashUtils.java#L131-L133 |
10,082 | kenyee/android-ddp-client | src/com/keysolutions/ddpclient/android/MeteorAuthCommands.java | MeteorAuthCommands.login | public void login(String token) {
TokenAuth tokenAuth = new TokenAuth(token);
Object[] methodArgs = new Object[1];
methodArgs[0] = tokenAuth;
getDDP().call("login", methodArgs, new DDPListener() {
@Override
public void onResult(Map<String, Object> jsonFields) {
... | java | public void login(String token) {
TokenAuth tokenAuth = new TokenAuth(token);
Object[] methodArgs = new Object[1];
methodArgs[0] = tokenAuth;
getDDP().call("login", methodArgs, new DDPListener() {
@Override
public void onResult(Map<String, Object> jsonFields) {
... | [
"public",
"void",
"login",
"(",
"String",
"token",
")",
"{",
"TokenAuth",
"tokenAuth",
"=",
"new",
"TokenAuth",
"(",
"token",
")",
";",
"Object",
"[",
"]",
"methodArgs",
"=",
"new",
"Object",
"[",
"1",
"]",
";",
"methodArgs",
"[",
"0",
"]",
"=",
"tok... | Logs in using resume token
@param token resume token | [
"Logs",
"in",
"using",
"resume",
"token"
] | 6ab416e415570a03f96c383497144dd742de3f08 | https://github.com/kenyee/android-ddp-client/blob/6ab416e415570a03f96c383497144dd742de3f08/src/com/keysolutions/ddpclient/android/MeteorAuthCommands.java#L38-L48 |
10,083 | kenyee/android-ddp-client | src/com/keysolutions/ddpclient/android/MeteorAuthCommands.java | MeteorAuthCommands.registerUser | public boolean registerUser(String username, String email,
String password) {
if (((username == null) && (email == null)) || (password == null)) {
return false;
}
Object[] methodArgs = new Object[1];
Map<String,Object> options = new HashMap<>();
methodArgs... | java | public boolean registerUser(String username, String email,
String password) {
if (((username == null) && (email == null)) || (password == null)) {
return false;
}
Object[] methodArgs = new Object[1];
Map<String,Object> options = new HashMap<>();
methodArgs... | [
"public",
"boolean",
"registerUser",
"(",
"String",
"username",
",",
"String",
"email",
",",
"String",
"password",
")",
"{",
"if",
"(",
"(",
"(",
"username",
"==",
"null",
")",
"&&",
"(",
"email",
"==",
"null",
")",
")",
"||",
"(",
"password",
"==",
... | Register's user into Meteor's accounts-password system
@param username user's username (this or email has to be specified)
@param email user's email (this or username has to be specified)
@param password password
@return true if create user called | [
"Register",
"s",
"user",
"into",
"Meteor",
"s",
"accounts",
"-",
"password",
"system"
] | 6ab416e415570a03f96c383497144dd742de3f08 | https://github.com/kenyee/android-ddp-client/blob/6ab416e415570a03f96c383497144dd742de3f08/src/com/keysolutions/ddpclient/android/MeteorAuthCommands.java#L80-L102 |
10,084 | kenyee/android-ddp-client | src/com/keysolutions/ddpclient/android/MeteorAuthCommands.java | MeteorAuthCommands.forgotPassword | public void forgotPassword(String email)
{
if (email == null) {
return;
}
Object[] methodArgs = new Object[1];
Map<String,Object> options = new HashMap<>();
methodArgs[0] = options;
options.put("email", email);
getDDP().call("forgotPassword", metho... | java | public void forgotPassword(String email)
{
if (email == null) {
return;
}
Object[] methodArgs = new Object[1];
Map<String,Object> options = new HashMap<>();
methodArgs[0] = options;
options.put("email", email);
getDDP().call("forgotPassword", metho... | [
"public",
"void",
"forgotPassword",
"(",
"String",
"email",
")",
"{",
"if",
"(",
"email",
"==",
"null",
")",
"{",
"return",
";",
"}",
"Object",
"[",
"]",
"methodArgs",
"=",
"new",
"Object",
"[",
"1",
"]",
";",
"Map",
"<",
"String",
",",
"Object",
"... | Sends password reset mail to specified email address
@param email email address of user | [
"Sends",
"password",
"reset",
"mail",
"to",
"specified",
"email",
"address"
] | 6ab416e415570a03f96c383497144dd742de3f08 | https://github.com/kenyee/android-ddp-client/blob/6ab416e415570a03f96c383497144dd742de3f08/src/com/keysolutions/ddpclient/android/MeteorAuthCommands.java#L108-L123 |
10,085 | cogroo/cogroo4 | cogroo-ruta/src/main/java/org/cogroo/ruta/uima/AnnotatorUtil.java | AnnotatorUtil.getType | public static Type getType(TypeSystem typeSystem, String name)
throws AnalysisEngineProcessException {
Type type = typeSystem.getType(name);
if (type == null) {
throw new OpenNlpAnnotatorProcessException(
ExceptionMessages.TYPE_NOT_FOUND,
new Object[] {name});
}
return ... | java | public static Type getType(TypeSystem typeSystem, String name)
throws AnalysisEngineProcessException {
Type type = typeSystem.getType(name);
if (type == null) {
throw new OpenNlpAnnotatorProcessException(
ExceptionMessages.TYPE_NOT_FOUND,
new Object[] {name});
}
return ... | [
"public",
"static",
"Type",
"getType",
"(",
"TypeSystem",
"typeSystem",
",",
"String",
"name",
")",
"throws",
"AnalysisEngineProcessException",
"{",
"Type",
"type",
"=",
"typeSystem",
".",
"getType",
"(",
"name",
")",
";",
"if",
"(",
"type",
"==",
"null",
")... | Retrieves a type of the given name from the given type system.
@param typeSystem
@param name
@return the type
@throws AnalysisEngineProcessException | [
"Retrieves",
"a",
"type",
"of",
"the",
"given",
"name",
"from",
"the",
"given",
"type",
"system",
"."
] | b6228900c20c6b37eac10a03708a9669dd562f52 | https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/cogroo-ruta/src/main/java/org/cogroo/ruta/uima/AnnotatorUtil.java#L50-L61 |
10,086 | cogroo/cogroo4 | cogroo-ruta/src/main/java/org/cogroo/ruta/uima/AnnotatorUtil.java | AnnotatorUtil.checkFeatureType | private static void checkFeatureType(Feature feature, String expectedType)
throws AnalysisEngineProcessException {
if (!feature.getRange().getName().equals(expectedType)) {
throw new OpenNlpAnnotatorProcessException(
ExceptionMessages.WRONG_FEATURE_TYPE,
new Object[] {feature.getName... | java | private static void checkFeatureType(Feature feature, String expectedType)
throws AnalysisEngineProcessException {
if (!feature.getRange().getName().equals(expectedType)) {
throw new OpenNlpAnnotatorProcessException(
ExceptionMessages.WRONG_FEATURE_TYPE,
new Object[] {feature.getName... | [
"private",
"static",
"void",
"checkFeatureType",
"(",
"Feature",
"feature",
",",
"String",
"expectedType",
")",
"throws",
"AnalysisEngineProcessException",
"{",
"if",
"(",
"!",
"feature",
".",
"getRange",
"(",
")",
".",
"getName",
"(",
")",
".",
"equals",
"(",... | Checks if the given feature has the expected type otherwise
an exception is thrown.
@param feature
@param expectedType
@throws AnalysisEngineProcessException - if type does not match | [
"Checks",
"if",
"the",
"given",
"feature",
"has",
"the",
"expected",
"type",
"otherwise",
"an",
"exception",
"is",
"thrown",
"."
] | b6228900c20c6b37eac10a03708a9669dd562f52 | https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/cogroo-ruta/src/main/java/org/cogroo/ruta/uima/AnnotatorUtil.java#L72-L81 |
10,087 | cogroo/cogroo4 | cogroo-ruta/src/main/java/org/cogroo/ruta/uima/AnnotatorUtil.java | AnnotatorUtil.getRequiredFeature | public static Feature getRequiredFeature(Type type, String featureName,
String rangeType) throws AnalysisEngineProcessException {
Feature feature = getRequiredFeature(type, featureName);
checkFeatureType(feature, rangeType);
return feature;
} | java | public static Feature getRequiredFeature(Type type, String featureName,
String rangeType) throws AnalysisEngineProcessException {
Feature feature = getRequiredFeature(type, featureName);
checkFeatureType(feature, rangeType);
return feature;
} | [
"public",
"static",
"Feature",
"getRequiredFeature",
"(",
"Type",
"type",
",",
"String",
"featureName",
",",
"String",
"rangeType",
")",
"throws",
"AnalysisEngineProcessException",
"{",
"Feature",
"feature",
"=",
"getRequiredFeature",
"(",
"type",
",",
"featureName",
... | Retrieves a required feature from the given type.
@param type the type
@param featureName the name of the feature
@param rangeType the expected range type
@return the requested parameter
@throws AnalysisEngineProcessException | [
"Retrieves",
"a",
"required",
"feature",
"from",
"the",
"given",
"type",
"."
] | b6228900c20c6b37eac10a03708a9669dd562f52 | https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/cogroo-ruta/src/main/java/org/cogroo/ruta/uima/AnnotatorUtil.java#L107-L115 |
10,088 | cogroo/cogroo4 | cogroo-ruta/src/main/java/org/cogroo/ruta/uima/AnnotatorUtil.java | AnnotatorUtil.getOptionalBooleanParameter | public static Boolean getOptionalBooleanParameter(UimaContext context,
String parameter)
throws ResourceInitializationException {
Object value = getOptionalParameter(context, parameter);
if (value instanceof Boolean) {
return (Boolean) value;
}
else if (value == null) {
return n... | java | public static Boolean getOptionalBooleanParameter(UimaContext context,
String parameter)
throws ResourceInitializationException {
Object value = getOptionalParameter(context, parameter);
if (value instanceof Boolean) {
return (Boolean) value;
}
else if (value == null) {
return n... | [
"public",
"static",
"Boolean",
"getOptionalBooleanParameter",
"(",
"UimaContext",
"context",
",",
"String",
"parameter",
")",
"throws",
"ResourceInitializationException",
"{",
"Object",
"value",
"=",
"getOptionalParameter",
"(",
"context",
",",
"parameter",
")",
";",
... | Retrieves an optional parameter from the given context.
@param context
@param parameter
@return the parameter or null if not set
@throws ResourceInitializationException | [
"Retrieves",
"an",
"optional",
"parameter",
"from",
"the",
"given",
"context",
"."
] | b6228900c20c6b37eac10a03708a9669dd562f52 | https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/cogroo-ruta/src/main/java/org/cogroo/ruta/uima/AnnotatorUtil.java#L407-L424 |
10,089 | cogroo/cogroo4 | cogroo-ruta/src/main/java/org/cogroo/ruta/uima/AnnotatorUtil.java | AnnotatorUtil.getResourceAsStream | public static InputStream getResourceAsStream(UimaContext context, String name)
throws ResourceInitializationException {
InputStream inResource = getOptionalResourceAsStream(context, name);
if (inResource == null) {
throw new ResourceInitializationException(
ExceptionMessages.MESSAGE_CAT... | java | public static InputStream getResourceAsStream(UimaContext context, String name)
throws ResourceInitializationException {
InputStream inResource = getOptionalResourceAsStream(context, name);
if (inResource == null) {
throw new ResourceInitializationException(
ExceptionMessages.MESSAGE_CAT... | [
"public",
"static",
"InputStream",
"getResourceAsStream",
"(",
"UimaContext",
"context",
",",
"String",
"name",
")",
"throws",
"ResourceInitializationException",
"{",
"InputStream",
"inResource",
"=",
"getOptionalResourceAsStream",
"(",
"context",
",",
"name",
")",
";",... | Retrieves a resource as stream from the given context.
@param context
@param name
@return the stream
@throws ResourceInitializationException | [
"Retrieves",
"a",
"resource",
"as",
"stream",
"from",
"the",
"given",
"context",
"."
] | b6228900c20c6b37eac10a03708a9669dd562f52 | https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/cogroo-ruta/src/main/java/org/cogroo/ruta/uima/AnnotatorUtil.java#L451-L464 |
10,090 | cogroo/cogroo4 | cogroo-nlp/src/main/java/org/cogroo/formats/ad/ADContractionNameSampleStream.java | ADContractionNameSampleStream.process | private void process(Node node, List<String> sentence, List<Span> names) {
if (node != null) {
for (TreeElement element : node.getElements()) {
if (element.isLeaf()) {
processLeaf((Leaf) element, sentence, names);
} else {
process((Node) element, sentence, names);
}... | java | private void process(Node node, List<String> sentence, List<Span> names) {
if (node != null) {
for (TreeElement element : node.getElements()) {
if (element.isLeaf()) {
processLeaf((Leaf) element, sentence, names);
} else {
process((Node) element, sentence, names);
}... | [
"private",
"void",
"process",
"(",
"Node",
"node",
",",
"List",
"<",
"String",
">",
"sentence",
",",
"List",
"<",
"Span",
">",
"names",
")",
"{",
"if",
"(",
"node",
"!=",
"null",
")",
"{",
"for",
"(",
"TreeElement",
"element",
":",
"node",
".",
"ge... | Recursive method to process a node in Arvores Deitadas format.
@param node
the node to be processed
@param sentence
the sentence tokens we got so far
@param names
the names we got so far | [
"Recursive",
"method",
"to",
"process",
"a",
"node",
"in",
"Arvores",
"Deitadas",
"format",
"."
] | b6228900c20c6b37eac10a03708a9669dd562f52 | https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/cogroo-nlp/src/main/java/org/cogroo/formats/ad/ADContractionNameSampleStream.java#L142-L152 |
10,091 | cogroo/cogroo4 | cogroo-ruta/src/main/java/org/cogroo/ruta/uima/CoGrOOUIMA.java | CoGrOOUIMA.process | public void process(CAS tcas) {
String text = tcas.getDocumentText();
Document document = new DocumentImpl(text);
cogroo.analyze(document);
for (Sentence sentence : document.getSentences()) {
// create sentence annotations
AnnotationFS sentenceAnn = tcas.createAnnotation(mSentenceType,
sentence.g... | java | public void process(CAS tcas) {
String text = tcas.getDocumentText();
Document document = new DocumentImpl(text);
cogroo.analyze(document);
for (Sentence sentence : document.getSentences()) {
// create sentence annotations
AnnotationFS sentenceAnn = tcas.createAnnotation(mSentenceType,
sentence.g... | [
"public",
"void",
"process",
"(",
"CAS",
"tcas",
")",
"{",
"String",
"text",
"=",
"tcas",
".",
"getDocumentText",
"(",
")",
";",
"Document",
"document",
"=",
"new",
"DocumentImpl",
"(",
"text",
")",
";",
"cogroo",
".",
"analyze",
"(",
"document",
")",
... | Performs chunking on the given tcas object. | [
"Performs",
"chunking",
"on",
"the",
"given",
"tcas",
"object",
"."
] | b6228900c20c6b37eac10a03708a9669dd562f52 | https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/cogroo-ruta/src/main/java/org/cogroo/ruta/uima/CoGrOOUIMA.java#L152-L237 |
10,092 | cogroo/cogroo4 | cogroo-gc/src/main/java/org/cogroo/entities/impl/MorphologicalTag.java | MorphologicalTag.match | public boolean match(TagMask tagMask, boolean restricted) {
if (tagMask.getClazz() != null) {
if ((this.getClazzE() != null || restricted)
&& !match( this.getClazzE(), tagMask.getClazz()))
return false;
}
if (tagMask.getGender() != null) {
if ((this.getGenderE() != null || res... | java | public boolean match(TagMask tagMask, boolean restricted) {
if (tagMask.getClazz() != null) {
if ((this.getClazzE() != null || restricted)
&& !match( this.getClazzE(), tagMask.getClazz()))
return false;
}
if (tagMask.getGender() != null) {
if ((this.getGenderE() != null || res... | [
"public",
"boolean",
"match",
"(",
"TagMask",
"tagMask",
",",
"boolean",
"restricted",
")",
"{",
"if",
"(",
"tagMask",
".",
"getClazz",
"(",
")",
"!=",
"null",
")",
"{",
"if",
"(",
"(",
"this",
".",
"getClazzE",
"(",
")",
"!=",
"null",
"||",
"restric... | tag doesn't | [
"tag",
"doesn",
"t"
] | b6228900c20c6b37eac10a03708a9669dd562f52 | https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/cogroo-gc/src/main/java/org/cogroo/entities/impl/MorphologicalTag.java#L219-L269 |
10,093 | cogroo/cogroo4 | lang/pt_br/cogroo-addon/src/org/cogroo/addon/dialogs/MessageBox.java | MessageBox.showMessageBox | public short showMessageBox(XWindowPeer _xParentWindowPeer, String _sTitle, String _sMessage, String _aType, int _aButtons) {
short nResult = -1;
XComponent xComponent = null;
try {
Object oToolkit = m_xMCF.createInstanceWithContext("com.sun.star.awt.Toolkit", m_xContext);
... | java | public short showMessageBox(XWindowPeer _xParentWindowPeer, String _sTitle, String _sMessage, String _aType, int _aButtons) {
short nResult = -1;
XComponent xComponent = null;
try {
Object oToolkit = m_xMCF.createInstanceWithContext("com.sun.star.awt.Toolkit", m_xContext);
... | [
"public",
"short",
"showMessageBox",
"(",
"XWindowPeer",
"_xParentWindowPeer",
",",
"String",
"_sTitle",
",",
"String",
"_sMessage",
",",
"String",
"_aType",
",",
"int",
"_aButtons",
")",
"{",
"short",
"nResult",
"=",
"-",
"1",
";",
"XComponent",
"xComponent",
... | Shows an messagebox
@param _xParentWindowPeer the windowpeer of the parent window
@param _sTitle the title of the messagebox
@param _sMessage the message of the messagebox
@param _aType string which determines the message box type: (infobox|warningbox|errorbox|querybox|messbox)
@param _aButtons MessageBoxButtons which ... | [
"Shows",
"an",
"messagebox"
] | b6228900c20c6b37eac10a03708a9669dd562f52 | https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/lang/pt_br/cogroo-addon/src/org/cogroo/addon/dialogs/MessageBox.java#L58-L80 |
10,094 | kenyee/android-ddp-client | src/com/keysolutions/ddpclient/android/DDPBroadcastReceiver.java | DDPBroadcastReceiver.onReceive | @Override
public void onReceive(Context context, Intent intent) {
// display errors to the user
Bundle bundle = intent.getExtras();
if (intent.getAction().equals(DDPStateSingleton.MESSAGE_ERROR)) {
String message = bundle
.getString(DDPStateSingleton.MESSAGE_E... | java | @Override
public void onReceive(Context context, Intent intent) {
// display errors to the user
Bundle bundle = intent.getExtras();
if (intent.getAction().equals(DDPStateSingleton.MESSAGE_ERROR)) {
String message = bundle
.getString(DDPStateSingleton.MESSAGE_E... | [
"@",
"Override",
"public",
"void",
"onReceive",
"(",
"Context",
"context",
",",
"Intent",
"intent",
")",
"{",
"// display errors to the user",
"Bundle",
"bundle",
"=",
"intent",
".",
"getExtras",
"(",
")",
";",
"if",
"(",
"intent",
".",
"getAction",
"(",
")"... | Handles receiving Android broadcast messages
@param context Android context
@param intent Android intent | [
"Handles",
"receiving",
"Android",
"broadcast",
"messages"
] | 6ab416e415570a03f96c383497144dd742de3f08 | https://github.com/kenyee/android-ddp-client/blob/6ab416e415570a03f96c383497144dd742de3f08/src/com/keysolutions/ddpclient/android/DDPBroadcastReceiver.java#L74-L105 |
10,095 | kenyee/android-ddp-client | src/com/keysolutions/ddpclient/android/DDPBroadcastReceiver.java | DDPBroadcastReceiver.onDDPConnect | protected void onDDPConnect(DDPStateSingleton ddp) {
if (!ddp.isLoggedIn()) {
// override this to handle first time connection (usually to subscribe)
// if we have a login resume token, use it
String resumeToken = ddp.getResumeToken();
if (resumeToken != null) {
... | java | protected void onDDPConnect(DDPStateSingleton ddp) {
if (!ddp.isLoggedIn()) {
// override this to handle first time connection (usually to subscribe)
// if we have a login resume token, use it
String resumeToken = ddp.getResumeToken();
if (resumeToken != null) {
... | [
"protected",
"void",
"onDDPConnect",
"(",
"DDPStateSingleton",
"ddp",
")",
"{",
"if",
"(",
"!",
"ddp",
".",
"isLoggedIn",
"(",
")",
")",
"{",
"// override this to handle first time connection (usually to subscribe)",
"// if we have a login resume token, use it",
"String",
"... | Override this to hook into what happens when DDP connect happens
Default behavior is to feed in the resume token if available
@param ddp DDP singleton | [
"Override",
"this",
"to",
"hook",
"into",
"what",
"happens",
"when",
"DDP",
"connect",
"happens",
"Default",
"behavior",
"is",
"to",
"feed",
"in",
"the",
"resume",
"token",
"if",
"available"
] | 6ab416e415570a03f96c383497144dd742de3f08 | https://github.com/kenyee/android-ddp-client/blob/6ab416e415570a03f96c383497144dd742de3f08/src/com/keysolutions/ddpclient/android/DDPBroadcastReceiver.java#L134-L143 |
10,096 | kenyee/android-ddp-client | src/com/keysolutions/ddpclient/android/DDPBroadcastReceiver.java | DDPBroadcastReceiver.onError | protected void onError(String title, String msg) {
// override this to override default error handling behavior
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
builder.setMessage(msg).setTitle(title);
builder.setPositiveButton("OK", new DialogInterface.OnClickListener()... | java | protected void onError(String title, String msg) {
// override this to override default error handling behavior
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity);
builder.setMessage(msg).setTitle(title);
builder.setPositiveButton("OK", new DialogInterface.OnClickListener()... | [
"protected",
"void",
"onError",
"(",
"String",
"title",
",",
"String",
"msg",
")",
"{",
"// override this to override default error handling behavior",
"AlertDialog",
".",
"Builder",
"builder",
"=",
"new",
"AlertDialog",
".",
"Builder",
"(",
"mActivity",
")",
";",
"... | Override this to hook into error display
Default behavior is to display the error as a dialog in your application
@param title title of error
@param msg detail of error | [
"Override",
"this",
"to",
"hook",
"into",
"error",
"display",
"Default",
"behavior",
"is",
"to",
"display",
"the",
"error",
"as",
"a",
"dialog",
"in",
"your",
"application"
] | 6ab416e415570a03f96c383497144dd742de3f08 | https://github.com/kenyee/android-ddp-client/blob/6ab416e415570a03f96c383497144dd742de3f08/src/com/keysolutions/ddpclient/android/DDPBroadcastReceiver.java#L151-L162 |
10,097 | cogroo/cogroo4 | cogroo-nlp/src/main/java/org/cogroo/tools/featurizer/FeaturizerFactory.java | FeaturizerFactory.validateFeatureDictionary | protected void validateFeatureDictionary() {
FeatureDictionary dict = getFeatureDictionary();
if (dict != null) {
if (dict instanceof Iterable<?>) {
FeatureDictionary posDict = (FeatureDictionary) dict;
Set<String> dictTags = new HashSet<String>();
Set<String> poisoned = new ... | java | protected void validateFeatureDictionary() {
FeatureDictionary dict = getFeatureDictionary();
if (dict != null) {
if (dict instanceof Iterable<?>) {
FeatureDictionary posDict = (FeatureDictionary) dict;
Set<String> dictTags = new HashSet<String>();
Set<String> poisoned = new ... | [
"protected",
"void",
"validateFeatureDictionary",
"(",
")",
"{",
"FeatureDictionary",
"dict",
"=",
"getFeatureDictionary",
"(",
")",
";",
"if",
"(",
"dict",
"!=",
"null",
")",
"{",
"if",
"(",
"dict",
"instanceof",
"Iterable",
"<",
"?",
">",
")",
"{",
"Feat... | because the poisoned tags are persisted... | [
"because",
"the",
"poisoned",
"tags",
"are",
"persisted",
"..."
] | b6228900c20c6b37eac10a03708a9669dd562f52 | https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/cogroo-nlp/src/main/java/org/cogroo/tools/featurizer/FeaturizerFactory.java#L142-L180 |
10,098 | DataArt/CalculationEngine | calculation-engine/engine-evaluation/src/main/java/com/dataart/spreadsheetanalytics/engine/graph/GraphBuilderUtils.java | GraphBuilderUtils.copyProperties | static void copyProperties(ExecutionGraphVertex standard, Set<ExecutionGraphVertex> vertices) {
for (ExecutionGraphVertex vertex : vertices) {
if (standard.equals(vertex)) { continue; }
IExecutionGraphVertexProperties from = standard.properties();
IExecutionGraphVertexP... | java | static void copyProperties(ExecutionGraphVertex standard, Set<ExecutionGraphVertex> vertices) {
for (ExecutionGraphVertex vertex : vertices) {
if (standard.equals(vertex)) { continue; }
IExecutionGraphVertexProperties from = standard.properties();
IExecutionGraphVertexP... | [
"static",
"void",
"copyProperties",
"(",
"ExecutionGraphVertex",
"standard",
",",
"Set",
"<",
"ExecutionGraphVertex",
">",
"vertices",
")",
"{",
"for",
"(",
"ExecutionGraphVertex",
"vertex",
":",
"vertices",
")",
"{",
"if",
"(",
"standard",
".",
"equals",
"(",
... | Does copy of all properties for every Vertex from @param vertices. the
first @param standard is used as object to copy from. | [
"Does",
"copy",
"of",
"all",
"properties",
"for",
"every",
"Vertex",
"from"
] | 34ce1d9c1f9b57a502906b274311d28580b134e5 | https://github.com/DataArt/CalculationEngine/blob/34ce1d9c1f9b57a502906b274311d28580b134e5/calculation-engine/engine-evaluation/src/main/java/com/dataart/spreadsheetanalytics/engine/graph/GraphBuilderUtils.java#L100-L125 |
10,099 | cogroo/cogroo4 | cogroo-eval/BaselineCogrooAE/src/main/java/cogroo/uima/ae/UimaPOSTagger.java | UimaPOSTagger.createSpanList | public static List<TypedSpan> createSpanList(String[] toks, String[] tags) {
// initialize with the list maximum size
List<TypedSpan> phrases = new ArrayList<TypedSpan>(toks.length);
String startTag = "";
int startIndex = 0;
boolean foundPhrase = false;
for (int ci = 0, cn = tags.length; ci <... | java | public static List<TypedSpan> createSpanList(String[] toks, String[] tags) {
// initialize with the list maximum size
List<TypedSpan> phrases = new ArrayList<TypedSpan>(toks.length);
String startTag = "";
int startIndex = 0;
boolean foundPhrase = false;
for (int ci = 0, cn = tags.length; ci <... | [
"public",
"static",
"List",
"<",
"TypedSpan",
">",
"createSpanList",
"(",
"String",
"[",
"]",
"toks",
",",
"String",
"[",
"]",
"tags",
")",
"{",
"// initialize with the list maximum size",
"List",
"<",
"TypedSpan",
">",
"phrases",
"=",
"new",
"ArrayList",
"<",... | this is from opennlp | [
"this",
"is",
"from",
"opennlp"
] | b6228900c20c6b37eac10a03708a9669dd562f52 | https://github.com/cogroo/cogroo4/blob/b6228900c20c6b37eac10a03708a9669dd562f52/cogroo-eval/BaselineCogrooAE/src/main/java/cogroo/uima/ae/UimaPOSTagger.java#L88-L122 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.