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,500 | DigitalPebble/TextClassification | src/main/java/com/digitalpebble/classification/Lexicon.java | Lexicon.compact | public Map<Integer, Integer> compact() {
Map<Integer, Integer> equiv = new HashMap<Integer, Integer>();
TreeMap<Integer, int[]> newIndex2docfreq = new TreeMap<Integer, int[]>();
// iterate on the map token -> Id and change the latter
Iterator<Entry<String, int[]>> iter = tokenForm2index.entrySet().iterator();... | java | public Map<Integer, Integer> compact() {
Map<Integer, Integer> equiv = new HashMap<Integer, Integer>();
TreeMap<Integer, int[]> newIndex2docfreq = new TreeMap<Integer, int[]>();
// iterate on the map token -> Id and change the latter
Iterator<Entry<String, int[]>> iter = tokenForm2index.entrySet().iterator();... | [
"public",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"compact",
"(",
")",
"{",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"equiv",
"=",
"new",
"HashMap",
"<",
"Integer",
",",
"Integer",
">",
"(",
")",
";",
"TreeMap",
"<",
"Integer",
",",
"int",
"... | Adjust the indices of the attributes so that maxAttributeID ==
getAttributesNum. Returns a Map containing the mapping between the old
indices and the new ones. | [
"Adjust",
"the",
"indices",
"of",
"the",
"attributes",
"so",
"that",
"maxAttributeID",
"==",
"getAttributesNum",
".",
"Returns",
"a",
"Map",
"containing",
"the",
"mapping",
"between",
"the",
"old",
"indices",
"and",
"the",
"new",
"ones",
"."
] | c510719c31633841af2bf393a20707d4624f865d | https://github.com/DigitalPebble/TextClassification/blob/c510719c31633841af2bf393a20707d4624f865d/src/main/java/com/digitalpebble/classification/Lexicon.java#L94-L119 |
10,501 | DigitalPebble/TextClassification | src/main/java/com/digitalpebble/classification/Lexicon.java | Lexicon.getMethod | public WeightingMethod getMethod(String fieldName) {
WeightingMethod method = this.customWeights.get(fieldName);
if (method != null)
return method;
return this.method_used;
} | java | public WeightingMethod getMethod(String fieldName) {
WeightingMethod method = this.customWeights.get(fieldName);
if (method != null)
return method;
return this.method_used;
} | [
"public",
"WeightingMethod",
"getMethod",
"(",
"String",
"fieldName",
")",
"{",
"WeightingMethod",
"method",
"=",
"this",
".",
"customWeights",
".",
"get",
"(",
"fieldName",
")",
";",
"if",
"(",
"method",
"!=",
"null",
")",
"return",
"method",
";",
"return",... | Returns the weighting scheme used for a specific field or the default one
if nothing has been specified for it | [
"Returns",
"the",
"weighting",
"scheme",
"used",
"for",
"a",
"specific",
"field",
"or",
"the",
"default",
"one",
"if",
"nothing",
"has",
"been",
"specified",
"for",
"it"
] | c510719c31633841af2bf393a20707d4624f865d | https://github.com/DigitalPebble/TextClassification/blob/c510719c31633841af2bf393a20707d4624f865d/src/main/java/com/digitalpebble/classification/Lexicon.java#L125-L130 |
10,502 | DigitalPebble/TextClassification | src/main/java/com/digitalpebble/classification/Lexicon.java | Lexicon.getIndex | public int getIndex(String tokenForm) {
// tokenForm = tokenForm.replaceAll("\\W+", "_");
int[] index = (int[]) tokenForm2index.get(tokenForm);
if (index == null)
return -1;
return index[0];
} | java | public int getIndex(String tokenForm) {
// tokenForm = tokenForm.replaceAll("\\W+", "_");
int[] index = (int[]) tokenForm2index.get(tokenForm);
if (index == null)
return -1;
return index[0];
} | [
"public",
"int",
"getIndex",
"(",
"String",
"tokenForm",
")",
"{",
"// tokenForm = tokenForm.replaceAll(\"\\\\W+\", \"_\");",
"int",
"[",
"]",
"index",
"=",
"(",
"int",
"[",
"]",
")",
"tokenForm2index",
".",
"get",
"(",
"tokenForm",
")",
";",
"if",
"(",
"index... | returns the position of a given tokenform or -1 if the tokenform is
unknown or has been filtered out
@param tokenForm
@return | [
"returns",
"the",
"position",
"of",
"a",
"given",
"tokenform",
"or",
"-",
"1",
"if",
"the",
"tokenform",
"is",
"unknown",
"or",
"has",
"been",
"filtered",
"out"
] | c510719c31633841af2bf393a20707d4624f865d | https://github.com/DigitalPebble/TextClassification/blob/c510719c31633841af2bf393a20707d4624f865d/src/main/java/com/digitalpebble/classification/Lexicon.java#L204-L210 |
10,503 | DigitalPebble/TextClassification | src/main/java/com/digitalpebble/classification/Lexicon.java | Lexicon.createIndex | public int createIndex(String tokenForm) {
int[] index = (int[]) tokenForm2index.get(tokenForm);
if (index == null) {
index = new int[] { nextAttributeID };
tokenForm2index.put(tokenForm, index);
nextAttributeID++;
}
// add information about number of documents
// for the term
Integer integ = Integ... | java | public int createIndex(String tokenForm) {
int[] index = (int[]) tokenForm2index.get(tokenForm);
if (index == null) {
index = new int[] { nextAttributeID };
tokenForm2index.put(tokenForm, index);
nextAttributeID++;
}
// add information about number of documents
// for the term
Integer integ = Integ... | [
"public",
"int",
"createIndex",
"(",
"String",
"tokenForm",
")",
"{",
"int",
"[",
"]",
"index",
"=",
"(",
"int",
"[",
"]",
")",
"tokenForm2index",
".",
"get",
"(",
"tokenForm",
")",
";",
"if",
"(",
"index",
"==",
"null",
")",
"{",
"index",
"=",
"ne... | called from Document | [
"called",
"from",
"Document"
] | c510719c31633841af2bf393a20707d4624f865d | https://github.com/DigitalPebble/TextClassification/blob/c510719c31633841af2bf393a20707d4624f865d/src/main/java/com/digitalpebble/classification/Lexicon.java#L278-L295 |
10,504 | DigitalPebble/TextClassification | src/main/java/com/digitalpebble/classification/FileTrainingCorpus.java | FileTrainingCorpus.addDocument | public void addDocument(Document doc) throws IOException {
// needs to differenciate SimpleDocuments from MultiField ones
// each class has its own way of serializing
String serial = doc.getStringSerialization();
raw_file_buffer.write(serial);
} | java | public void addDocument(Document doc) throws IOException {
// needs to differenciate SimpleDocuments from MultiField ones
// each class has its own way of serializing
String serial = doc.getStringSerialization();
raw_file_buffer.write(serial);
} | [
"public",
"void",
"addDocument",
"(",
"Document",
"doc",
")",
"throws",
"IOException",
"{",
"// needs to differenciate SimpleDocuments from MultiField ones",
"// each class has its own way of serializing",
"String",
"serial",
"=",
"doc",
".",
"getStringSerialization",
"(",
")",... | there is exactly one document per line | [
"there",
"is",
"exactly",
"one",
"document",
"per",
"line"
] | c510719c31633841af2bf393a20707d4624f865d | https://github.com/DigitalPebble/TextClassification/blob/c510719c31633841af2bf393a20707d4624f865d/src/main/java/com/digitalpebble/classification/FileTrainingCorpus.java#L67-L72 |
10,505 | DigitalPebble/TextClassification | src/main/java/com/digitalpebble/classification/util/ModelUtils.java | ModelUtils.getAttributeScores | public static void getAttributeScores(String modelPath, String lexiconF,
int topAttributesNumber) throws IOException {
// load the model + the lexicon
// try to see if we can get a list of the best scores from the model
// works only for liblinear
Lexicon lexicon = new Lexicon(lexiconF);
Model liblinearMod... | java | public static void getAttributeScores(String modelPath, String lexiconF,
int topAttributesNumber) throws IOException {
// load the model + the lexicon
// try to see if we can get a list of the best scores from the model
// works only for liblinear
Lexicon lexicon = new Lexicon(lexiconF);
Model liblinearMod... | [
"public",
"static",
"void",
"getAttributeScores",
"(",
"String",
"modelPath",
",",
"String",
"lexiconF",
",",
"int",
"topAttributesNumber",
")",
"throws",
"IOException",
"{",
"// load the model + the lexicon",
"// try to see if we can get a list of the best scores from the model"... | Prints out the attributes and their weights from the models generated by
liblinear. This is different from CorpusUtils.dumpBestAttributes which
computes a score for the attributes regardless of the model. | [
"Prints",
"out",
"the",
"attributes",
"and",
"their",
"weights",
"from",
"the",
"models",
"generated",
"by",
"liblinear",
".",
"This",
"is",
"different",
"from",
"CorpusUtils",
".",
"dumpBestAttributes",
"which",
"computes",
"a",
"score",
"for",
"the",
"attribut... | c510719c31633841af2bf393a20707d4624f865d | https://github.com/DigitalPebble/TextClassification/blob/c510719c31633841af2bf393a20707d4624f865d/src/main/java/com/digitalpebble/classification/util/ModelUtils.java#L44-L127 |
10,506 | DigitalPebble/TextClassification | src/main/java/com/digitalpebble/classification/util/ModelUtils.java | WeightedAttribute.compareTo | public int compareTo(WeightedAttribute att) {
double absoltarget = att.weight;
// if (absoltarget < 0)
// absoltarget = -absoltarget;
double absolsource = this.weight;
// if (absolsource < 0)
// absolsource = -absolsource;
double diff = absolsource - absoltarget;
if (diff < 0)
return -1;
if (diff >... | java | public int compareTo(WeightedAttribute att) {
double absoltarget = att.weight;
// if (absoltarget < 0)
// absoltarget = -absoltarget;
double absolsource = this.weight;
// if (absolsource < 0)
// absolsource = -absolsource;
double diff = absolsource - absoltarget;
if (diff < 0)
return -1;
if (diff >... | [
"public",
"int",
"compareTo",
"(",
"WeightedAttribute",
"att",
")",
"{",
"double",
"absoltarget",
"=",
"att",
".",
"weight",
";",
"// if (absoltarget < 0)",
"// absoltarget = -absoltarget;",
"double",
"absolsource",
"=",
"this",
".",
"weight",
";",
"// if (absolsource... | rank the attributes based on weight | [
"rank",
"the",
"attributes",
"based",
"on",
"weight"
] | c510719c31633841af2bf393a20707d4624f865d | https://github.com/DigitalPebble/TextClassification/blob/c510719c31633841af2bf393a20707d4624f865d/src/main/java/com/digitalpebble/classification/util/ModelUtils.java#L218-L231 |
10,507 | forge/furnace | container-api/src/main/java/org/jboss/forge/furnace/versions/Versions.java | Versions.isSnapshot | public static boolean isSnapshot(Version version)
{
Assert.notNull(version, "Version must not be null.");
return version.toString().endsWith(SNAPSHOT_SUFFIX);
} | java | public static boolean isSnapshot(Version version)
{
Assert.notNull(version, "Version must not be null.");
return version.toString().endsWith(SNAPSHOT_SUFFIX);
} | [
"public",
"static",
"boolean",
"isSnapshot",
"(",
"Version",
"version",
")",
"{",
"Assert",
".",
"notNull",
"(",
"version",
",",
"\"Version must not be null.\"",
")",
";",
"return",
"version",
".",
"toString",
"(",
")",
".",
"endsWith",
"(",
"SNAPSHOT_SUFFIX",
... | Returns if the version specified is a SNAPSHOT
@param version cannot be null
@return true if the version is a SNAPSHOT, false otherwise | [
"Returns",
"if",
"the",
"version",
"specified",
"is",
"a",
"SNAPSHOT"
] | bbe6deaa3c0d85ba43daa3e2f7d486f2dad21e0a | https://github.com/forge/furnace/blob/bbe6deaa3c0d85ba43daa3e2f7d486f2dad21e0a/container-api/src/main/java/org/jboss/forge/furnace/versions/Versions.java#L259-L263 |
10,508 | protobufel/protobuf-el | protobufel-grammar/src/main/java/com/github/protobufel/grammar/FileDescriptorEx.java | FileDescriptorEx.isCanonical | private boolean isCanonical(final FileDescriptor file) {
final FileDescriptorProto proto = file.toProto();
if (proto.hasOptions() && proto.getOptions().getUninterpretedOptionCount() > 0) {
return false;
}
for (final FieldDescriptorProto field : proto.getExtensionList()) {
if (!isFi... | java | private boolean isCanonical(final FileDescriptor file) {
final FileDescriptorProto proto = file.toProto();
if (proto.hasOptions() && proto.getOptions().getUninterpretedOptionCount() > 0) {
return false;
}
for (final FieldDescriptorProto field : proto.getExtensionList()) {
if (!isFi... | [
"private",
"boolean",
"isCanonical",
"(",
"final",
"FileDescriptor",
"file",
")",
"{",
"final",
"FileDescriptorProto",
"proto",
"=",
"file",
".",
"toProto",
"(",
")",
";",
"if",
"(",
"proto",
".",
"hasOptions",
"(",
")",
"&&",
"proto",
".",
"getOptions",
"... | very consuming and problematic! | [
"very",
"consuming",
"and",
"problematic!"
] | 3a600e2f7a8e74b637f44eee0331ef6e57e7441c | https://github.com/protobufel/protobuf-el/blob/3a600e2f7a8e74b637f44eee0331ef6e57e7441c/protobufel-grammar/src/main/java/com/github/protobufel/grammar/FileDescriptorEx.java#L451-L483 |
10,509 | protobufel/protobuf-el | protobufel/src/main/java/com/github/protobufel/RepeatedFieldBuilder.java | RepeatedFieldBuilder.ensureBuilders | private void ensureBuilders() {
if (this.builders == null) {
this.builders = new ArrayList<SingleFieldBuilder<MType, BType, IType>>(messages.size());
for (int i = 0; i < messages.size(); i++) {
builders.add(null);
}
}
} | java | private void ensureBuilders() {
if (this.builders == null) {
this.builders = new ArrayList<SingleFieldBuilder<MType, BType, IType>>(messages.size());
for (int i = 0; i < messages.size(); i++) {
builders.add(null);
}
}
} | [
"private",
"void",
"ensureBuilders",
"(",
")",
"{",
"if",
"(",
"this",
".",
"builders",
"==",
"null",
")",
"{",
"this",
".",
"builders",
"=",
"new",
"ArrayList",
"<",
"SingleFieldBuilder",
"<",
"MType",
",",
"BType",
",",
"IType",
">",
">",
"(",
"messa... | Ensures that the list of builders is not null. If it's null, the list is created and
initialized to be the same size as the messages list with null entries. | [
"Ensures",
"that",
"the",
"list",
"of",
"builders",
"is",
"not",
"null",
".",
"If",
"it",
"s",
"null",
"the",
"list",
"is",
"created",
"and",
"initialized",
"to",
"be",
"the",
"same",
"size",
"as",
"the",
"messages",
"list",
"with",
"null",
"entries",
... | 3a600e2f7a8e74b637f44eee0331ef6e57e7441c | https://github.com/protobufel/protobuf-el/blob/3a600e2f7a8e74b637f44eee0331ef6e57e7441c/protobufel/src/main/java/com/github/protobufel/RepeatedFieldBuilder.java#L168-L175 |
10,510 | protobufel/protobuf-el | protobufel/src/main/java/com/github/protobufel/RepeatedFieldBuilder.java | RepeatedFieldBuilder.addAllMessages | public RepeatedFieldBuilder<MType, BType, IType> addAllMessages(
final Iterable<? extends MType> values) {
for (final MType value : values) {
if (value == null) {
throw new NullPointerException();
}
}
if (values instanceof Collection) {
@SuppressWarnings("unchecked")
... | java | public RepeatedFieldBuilder<MType, BType, IType> addAllMessages(
final Iterable<? extends MType> values) {
for (final MType value : values) {
if (value == null) {
throw new NullPointerException();
}
}
if (values instanceof Collection) {
@SuppressWarnings("unchecked")
... | [
"public",
"RepeatedFieldBuilder",
"<",
"MType",
",",
"BType",
",",
"IType",
">",
"addAllMessages",
"(",
"final",
"Iterable",
"<",
"?",
"extends",
"MType",
">",
"values",
")",
"{",
"for",
"(",
"final",
"MType",
"value",
":",
"values",
")",
"{",
"if",
"(",... | Appends all of the messages in the specified collection to the end of this list, in the order
that they are returned by the specified collection's iterator.
@param values the messages to add
@return the builder | [
"Appends",
"all",
"of",
"the",
"messages",
"in",
"the",
"specified",
"collection",
"to",
"the",
"end",
"of",
"this",
"list",
"in",
"the",
"order",
"that",
"they",
"are",
"returned",
"by",
"the",
"specified",
"collection",
"s",
"iterator",
"."
] | 3a600e2f7a8e74b637f44eee0331ef6e57e7441c | https://github.com/protobufel/protobuf-el/blob/3a600e2f7a8e74b637f44eee0331ef6e57e7441c/protobufel/src/main/java/com/github/protobufel/RepeatedFieldBuilder.java#L355-L381 |
10,511 | protobufel/protobuf-el | protobufel/src/main/java/com/github/protobufel/RepeatedFieldBuilder.java | RepeatedFieldBuilder.addBuilder | public BType addBuilder(final MType message) {
ensureMutableMessageList();
ensureBuilders();
final SingleFieldBuilder<MType, BType, IType> builder =
newSingleFieldBuilder(message, this, isClean);
messages.add(null);
builders.add(builder);
onChanged();
incrementModCounts();
... | java | public BType addBuilder(final MType message) {
ensureMutableMessageList();
ensureBuilders();
final SingleFieldBuilder<MType, BType, IType> builder =
newSingleFieldBuilder(message, this, isClean);
messages.add(null);
builders.add(builder);
onChanged();
incrementModCounts();
... | [
"public",
"BType",
"addBuilder",
"(",
"final",
"MType",
"message",
")",
"{",
"ensureMutableMessageList",
"(",
")",
";",
"ensureBuilders",
"(",
")",
";",
"final",
"SingleFieldBuilder",
"<",
"MType",
",",
"BType",
",",
"IType",
">",
"builder",
"=",
"newSingleFie... | Appends a new builder to the end of this list and returns the builder.
@param message the message to add which is the basis of the builder
@return the new builder | [
"Appends",
"a",
"new",
"builder",
"to",
"the",
"end",
"of",
"this",
"list",
"and",
"returns",
"the",
"builder",
"."
] | 3a600e2f7a8e74b637f44eee0331ef6e57e7441c | https://github.com/protobufel/protobuf-el/blob/3a600e2f7a8e74b637f44eee0331ef6e57e7441c/protobufel/src/main/java/com/github/protobufel/RepeatedFieldBuilder.java#L389-L399 |
10,512 | protobufel/protobuf-el | protobufel/src/main/java/com/github/protobufel/RepeatedFieldBuilder.java | RepeatedFieldBuilder.getMessageList | public List<MType> getMessageList() {
if (externalMessageList == null) {
externalMessageList = new MessageExternalList<MType, BType, IType>(this);
}
return externalMessageList;
} | java | public List<MType> getMessageList() {
if (externalMessageList == null) {
externalMessageList = new MessageExternalList<MType, BType, IType>(this);
}
return externalMessageList;
} | [
"public",
"List",
"<",
"MType",
">",
"getMessageList",
"(",
")",
"{",
"if",
"(",
"externalMessageList",
"==",
"null",
")",
"{",
"externalMessageList",
"=",
"new",
"MessageExternalList",
"<",
"MType",
",",
"BType",
",",
"IType",
">",
"(",
"this",
")",
";",
... | Gets a view of the builder as a list of messages. The returned list is live and will reflect
any changes to the underlying builder.
@return the messages in the list | [
"Gets",
"a",
"view",
"of",
"the",
"builder",
"as",
"a",
"list",
"of",
"messages",
".",
"The",
"returned",
"list",
"is",
"live",
"and",
"will",
"reflect",
"any",
"changes",
"to",
"the",
"underlying",
"builder",
"."
] | 3a600e2f7a8e74b637f44eee0331ef6e57e7441c | https://github.com/protobufel/protobuf-el/blob/3a600e2f7a8e74b637f44eee0331ef6e57e7441c/protobufel/src/main/java/com/github/protobufel/RepeatedFieldBuilder.java#L515-L520 |
10,513 | protobufel/protobuf-el | protobufel/src/main/java/com/github/protobufel/RepeatedFieldBuilder.java | RepeatedFieldBuilder.getBuilderList | public List<BType> getBuilderList() {
if (externalBuilderList == null) {
externalBuilderList = new BuilderExternalList<MType, BType, IType>(this);
}
return externalBuilderList;
} | java | public List<BType> getBuilderList() {
if (externalBuilderList == null) {
externalBuilderList = new BuilderExternalList<MType, BType, IType>(this);
}
return externalBuilderList;
} | [
"public",
"List",
"<",
"BType",
">",
"getBuilderList",
"(",
")",
"{",
"if",
"(",
"externalBuilderList",
"==",
"null",
")",
"{",
"externalBuilderList",
"=",
"new",
"BuilderExternalList",
"<",
"MType",
",",
"BType",
",",
"IType",
">",
"(",
"this",
")",
";",
... | Gets a view of the builder as a list of builders. This returned list is live and will reflect
any changes to the underlying builder.
@return the builders in the list | [
"Gets",
"a",
"view",
"of",
"the",
"builder",
"as",
"a",
"list",
"of",
"builders",
".",
"This",
"returned",
"list",
"is",
"live",
"and",
"will",
"reflect",
"any",
"changes",
"to",
"the",
"underlying",
"builder",
"."
] | 3a600e2f7a8e74b637f44eee0331ef6e57e7441c | https://github.com/protobufel/protobuf-el/blob/3a600e2f7a8e74b637f44eee0331ef6e57e7441c/protobufel/src/main/java/com/github/protobufel/RepeatedFieldBuilder.java#L528-L533 |
10,514 | protobufel/protobuf-el | protobufel/src/main/java/com/github/protobufel/RepeatedFieldBuilder.java | RepeatedFieldBuilder.getMessageOrBuilderList | public List<IType> getMessageOrBuilderList() {
if (externalMessageOrBuilderList == null) {
externalMessageOrBuilderList = new MessageOrBuilderExternalList<MType, BType, IType>(this);
}
return externalMessageOrBuilderList;
} | java | public List<IType> getMessageOrBuilderList() {
if (externalMessageOrBuilderList == null) {
externalMessageOrBuilderList = new MessageOrBuilderExternalList<MType, BType, IType>(this);
}
return externalMessageOrBuilderList;
} | [
"public",
"List",
"<",
"IType",
">",
"getMessageOrBuilderList",
"(",
")",
"{",
"if",
"(",
"externalMessageOrBuilderList",
"==",
"null",
")",
"{",
"externalMessageOrBuilderList",
"=",
"new",
"MessageOrBuilderExternalList",
"<",
"MType",
",",
"BType",
",",
"IType",
... | Gets a view of the builder as a list of MessageOrBuilders. This returned list is live and will
reflect any changes to the underlying builder.
@return the builders in the list | [
"Gets",
"a",
"view",
"of",
"the",
"builder",
"as",
"a",
"list",
"of",
"MessageOrBuilders",
".",
"This",
"returned",
"list",
"is",
"live",
"and",
"will",
"reflect",
"any",
"changes",
"to",
"the",
"underlying",
"builder",
"."
] | 3a600e2f7a8e74b637f44eee0331ef6e57e7441c | https://github.com/protobufel/protobuf-el/blob/3a600e2f7a8e74b637f44eee0331ef6e57e7441c/protobufel/src/main/java/com/github/protobufel/RepeatedFieldBuilder.java#L541-L546 |
10,515 | protobufel/protobuf-el | protobufel/src/main/java/com/github/protobufel/RepeatedFieldBuilder.java | RepeatedFieldBuilder.incrementModCounts | private void incrementModCounts() {
if (externalMessageList != null) {
externalMessageList.incrementModCount();
}
if (externalBuilderList != null) {
externalBuilderList.incrementModCount();
}
if (externalMessageOrBuilderList != null) {
externalMessageOrBuilderList.increment... | java | private void incrementModCounts() {
if (externalMessageList != null) {
externalMessageList.incrementModCount();
}
if (externalBuilderList != null) {
externalBuilderList.incrementModCount();
}
if (externalMessageOrBuilderList != null) {
externalMessageOrBuilderList.increment... | [
"private",
"void",
"incrementModCounts",
"(",
")",
"{",
"if",
"(",
"externalMessageList",
"!=",
"null",
")",
"{",
"externalMessageList",
".",
"incrementModCount",
"(",
")",
";",
"}",
"if",
"(",
"externalBuilderList",
"!=",
"null",
")",
"{",
"externalBuilderList"... | Increments the mod counts so that an ConcurrentModificationException can be thrown if calling
code tries to modify the builder while its iterating the list. | [
"Increments",
"the",
"mod",
"counts",
"so",
"that",
"an",
"ConcurrentModificationException",
"can",
"be",
"thrown",
"if",
"calling",
"code",
"tries",
"to",
"modify",
"the",
"builder",
"while",
"its",
"iterating",
"the",
"list",
"."
] | 3a600e2f7a8e74b637f44eee0331ef6e57e7441c | https://github.com/protobufel/protobuf-el/blob/3a600e2f7a8e74b637f44eee0331ef6e57e7441c/protobufel/src/main/java/com/github/protobufel/RepeatedFieldBuilder.java#L571-L581 |
10,516 | forge/furnace | manager/impl/src/main/java/org/jboss/forge/furnace/manager/impl/AddonManagerImpl.java | AddonManagerImpl.collectRequiredAddons | private void collectRequiredAddons(AddonInfo addonInfo, List<AddonInfo> addons)
{
// Move this addon to the top of the list
addons.remove(addonInfo);
addons.add(0, addonInfo);
for (AddonId addonId : addonInfo.getRequiredAddons())
{
if (!addons.contains(addonId) && (!isDeployed(... | java | private void collectRequiredAddons(AddonInfo addonInfo, List<AddonInfo> addons)
{
// Move this addon to the top of the list
addons.remove(addonInfo);
addons.add(0, addonInfo);
for (AddonId addonId : addonInfo.getRequiredAddons())
{
if (!addons.contains(addonId) && (!isDeployed(... | [
"private",
"void",
"collectRequiredAddons",
"(",
"AddonInfo",
"addonInfo",
",",
"List",
"<",
"AddonInfo",
">",
"addons",
")",
"{",
"// Move this addon to the top of the list",
"addons",
".",
"remove",
"(",
"addonInfo",
")",
";",
"addons",
".",
"add",
"(",
"0",
"... | Collect all required addons for a specific addon.
It traverses the whole graph
@param addonInfo
@param addons | [
"Collect",
"all",
"required",
"addons",
"for",
"a",
"specific",
"addon",
"."
] | bbe6deaa3c0d85ba43daa3e2f7d486f2dad21e0a | https://github.com/forge/furnace/blob/bbe6deaa3c0d85ba43daa3e2f7d486f2dad21e0a/manager/impl/src/main/java/org/jboss/forge/furnace/manager/impl/AddonManagerImpl.java#L256-L269 |
10,517 | grahamedgecombe/jterminal | src/main/java/com/grahamedgecombe/jterminal/vt100/AnsiControlSequenceParser.java | AnsiControlSequenceParser.parse | public void parse(String str) {
if (buffer.length() > 0) {
str = buffer.toString().concat(str);
buffer = new StringBuilder();
}
Reader reader = new StringReader(str);
try {
try {
parse(reader);
} finally {
reader.close();
}
} catch (IOException ex) {
/* ignore */
}
} | java | public void parse(String str) {
if (buffer.length() > 0) {
str = buffer.toString().concat(str);
buffer = new StringBuilder();
}
Reader reader = new StringReader(str);
try {
try {
parse(reader);
} finally {
reader.close();
}
} catch (IOException ex) {
/* ignore */
}
} | [
"public",
"void",
"parse",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"buffer",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"str",
"=",
"buffer",
".",
"toString",
"(",
")",
".",
"concat",
"(",
"str",
")",
";",
"buffer",
"=",
"new",
"StringBuilde... | Parses the specified string.
@param str The string to parse. | [
"Parses",
"the",
"specified",
"string",
"."
] | 751142d9d2cafbde0ec36a80f73bb25bf297f2f3 | https://github.com/grahamedgecombe/jterminal/blob/751142d9d2cafbde0ec36a80f73bb25bf297f2f3/src/main/java/com/grahamedgecombe/jterminal/vt100/AnsiControlSequenceParser.java#L68-L83 |
10,518 | grahamedgecombe/jterminal | src/main/java/com/grahamedgecombe/jterminal/vt100/AnsiControlSequenceParser.java | AnsiControlSequenceParser.parse | private void parse(Reader reader) throws IOException {
StringBuilder text = new StringBuilder();
int character;
while ((character = reader.read()) != -1) {
boolean introducedControlSequence = false;
if (character == SINGLE_CSI) {
introducedControlSequence = true;
} else if (character == MULTI_CSI[0])... | java | private void parse(Reader reader) throws IOException {
StringBuilder text = new StringBuilder();
int character;
while ((character = reader.read()) != -1) {
boolean introducedControlSequence = false;
if (character == SINGLE_CSI) {
introducedControlSequence = true;
} else if (character == MULTI_CSI[0])... | [
"private",
"void",
"parse",
"(",
"Reader",
"reader",
")",
"throws",
"IOException",
"{",
"StringBuilder",
"text",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"int",
"character",
";",
"while",
"(",
"(",
"character",
"=",
"reader",
".",
"read",
"(",
")",
")... | Parses characters from the specified character reader.
@param reader The character reader.
@throws IOException if an I/O error occurs. | [
"Parses",
"characters",
"from",
"the",
"specified",
"character",
"reader",
"."
] | 751142d9d2cafbde0ec36a80f73bb25bf297f2f3 | https://github.com/grahamedgecombe/jterminal/blob/751142d9d2cafbde0ec36a80f73bb25bf297f2f3/src/main/java/com/grahamedgecombe/jterminal/vt100/AnsiControlSequenceParser.java#L90-L124 |
10,519 | grahamedgecombe/jterminal | src/main/java/com/grahamedgecombe/jterminal/vt100/AnsiControlSequenceParser.java | AnsiControlSequenceParser.parseControlSequence | private void parseControlSequence(Reader reader) throws IOException {
boolean finishedSequence = false;
StringBuilder parameters = new StringBuilder();
int character;
while ((character = reader.read()) != -1) {
if ((character >= 'a' && character <= 'z') || (character >= 'A' && character <= 'Z')) {
String... | java | private void parseControlSequence(Reader reader) throws IOException {
boolean finishedSequence = false;
StringBuilder parameters = new StringBuilder();
int character;
while ((character = reader.read()) != -1) {
if ((character >= 'a' && character <= 'z') || (character >= 'A' && character <= 'Z')) {
String... | [
"private",
"void",
"parseControlSequence",
"(",
"Reader",
"reader",
")",
"throws",
"IOException",
"{",
"boolean",
"finishedSequence",
"=",
"false",
";",
"StringBuilder",
"parameters",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"int",
"character",
";",
"while",
... | Parses a control sequence.
@param reader The character reader.
@throws IOException if an I/O error occurs. | [
"Parses",
"a",
"control",
"sequence",
"."
] | 751142d9d2cafbde0ec36a80f73bb25bf297f2f3 | https://github.com/grahamedgecombe/jterminal/blob/751142d9d2cafbde0ec36a80f73bb25bf297f2f3/src/main/java/com/grahamedgecombe/jterminal/vt100/AnsiControlSequenceParser.java#L131-L153 |
10,520 | jiaqi/jcli | src/main/java/org/cyclopsgroup/jcli/ArgumentProcessor.java | ArgumentProcessor.newInstance | public static <T> ArgumentProcessor<T> newInstance(Class<? extends T> beanType,
CommandLineParser parser) {
return ArgumentProcessorFactory.getInstance().newProcessor(beanType, parser);
} | java | public static <T> ArgumentProcessor<T> newInstance(Class<? extends T> beanType,
CommandLineParser parser) {
return ArgumentProcessorFactory.getInstance().newProcessor(beanType, parser);
} | [
"public",
"static",
"<",
"T",
">",
"ArgumentProcessor",
"<",
"T",
">",
"newInstance",
"(",
"Class",
"<",
"?",
"extends",
"T",
">",
"beanType",
",",
"CommandLineParser",
"parser",
")",
"{",
"return",
"ArgumentProcessorFactory",
".",
"getInstance",
"(",
")",
"... | Create new instance with given bean type and command line parser that describes command line
sytnax.
@param <T> type of bean
@param beanType Type of bean
@param parser command line parser that is aware of command line syntax
@return instance of an implementation of argument processor. | [
"Create",
"new",
"instance",
"with",
"given",
"bean",
"type",
"and",
"command",
"line",
"parser",
"that",
"describes",
"command",
"line",
"sytnax",
"."
] | 3854b3bb3c26bbe7407bf1b6600d8b25592d398e | https://github.com/jiaqi/jcli/blob/3854b3bb3c26bbe7407bf1b6600d8b25592d398e/src/main/java/org/cyclopsgroup/jcli/ArgumentProcessor.java#L43-L46 |
10,521 | jiaqi/jcli | src/main/java/org/cyclopsgroup/jcli/ArgumentProcessor.java | ArgumentProcessor.process | public T process(String[] arguments, T bean) {
return process(Arrays.asList(arguments), bean);
} | java | public T process(String[] arguments, T bean) {
return process(Arrays.asList(arguments), bean);
} | [
"public",
"T",
"process",
"(",
"String",
"[",
"]",
"arguments",
",",
"T",
"bean",
")",
"{",
"return",
"process",
"(",
"Arrays",
".",
"asList",
"(",
"arguments",
")",
",",
"bean",
")",
";",
"}"
] | Process argument array and pass values to given bean
@param arguments Arary of arguments
@param bean Bean to pass values to
@return the processed bean. | [
"Process",
"argument",
"array",
"and",
"pass",
"values",
"to",
"given",
"bean"
] | 3854b3bb3c26bbe7407bf1b6600d8b25592d398e | https://github.com/jiaqi/jcli/blob/3854b3bb3c26bbe7407bf1b6600d8b25592d398e/src/main/java/org/cyclopsgroup/jcli/ArgumentProcessor.java#L85-L87 |
10,522 | StanKocken/EfficientAdapter | efficientadapter/src/main/java/com/skocken/efficientadapter/lib/adapter/AdapterHelper.java | AdapterHelper.onBindViewHolder | public void onBindViewHolder(EfficientViewHolder<T> viewHolder, int position,
EfficientAdapter<T> adapter) {
T object = get(position);
viewHolder.onBindView(object, position);
viewHolder.setAdapter(adapter);
setClickListenerOnView(viewHolder);
se... | java | public void onBindViewHolder(EfficientViewHolder<T> viewHolder, int position,
EfficientAdapter<T> adapter) {
T object = get(position);
viewHolder.onBindView(object, position);
viewHolder.setAdapter(adapter);
setClickListenerOnView(viewHolder);
se... | [
"public",
"void",
"onBindViewHolder",
"(",
"EfficientViewHolder",
"<",
"T",
">",
"viewHolder",
",",
"int",
"position",
",",
"EfficientAdapter",
"<",
"T",
">",
"adapter",
")",
"{",
"T",
"object",
"=",
"get",
"(",
"position",
")",
";",
"viewHolder",
".",
"on... | Called by the view to display the data at the specified position.
<p>The default implementation of this method will call {@link EfficientViewHolder#onBindView(Object,
int)}
on the {@link EfficientViewHolder} and set the click listeners if necessary.</p>
@param viewHolder The ViewHolder which should be updated to repr... | [
"Called",
"by",
"the",
"view",
"to",
"display",
"the",
"data",
"at",
"the",
"specified",
"position",
"."
] | 0bcc3a20182cbce9d7901e1e2a9104251637167d | https://github.com/StanKocken/EfficientAdapter/blob/0bcc3a20182cbce9d7901e1e2a9104251637167d/efficientadapter/src/main/java/com/skocken/efficientadapter/lib/adapter/AdapterHelper.java#L91-L99 |
10,523 | StanKocken/EfficientAdapter | efficientadapter/src/main/java/com/skocken/efficientadapter/lib/adapter/AdapterHelper.java | AdapterHelper.remove | int remove(T object) {
int positionOfRemove = mObjects.indexOf(object);
if (positionOfRemove >= 0) {
T objectRemoved = removeAt(positionOfRemove);
if (objectRemoved != null) {
return positionOfRemove;
}
}
return -1;
} | java | int remove(T object) {
int positionOfRemove = mObjects.indexOf(object);
if (positionOfRemove >= 0) {
T objectRemoved = removeAt(positionOfRemove);
if (objectRemoved != null) {
return positionOfRemove;
}
}
return -1;
} | [
"int",
"remove",
"(",
"T",
"object",
")",
"{",
"int",
"positionOfRemove",
"=",
"mObjects",
".",
"indexOf",
"(",
"object",
")",
";",
"if",
"(",
"positionOfRemove",
">=",
"0",
")",
"{",
"T",
"objectRemoved",
"=",
"removeAt",
"(",
"positionOfRemove",
")",
"... | Remove the specified object of the array.
@param object The object to add at the end of the array. | [
"Remove",
"the",
"specified",
"object",
"of",
"the",
"array",
"."
] | 0bcc3a20182cbce9d7901e1e2a9104251637167d | https://github.com/StanKocken/EfficientAdapter/blob/0bcc3a20182cbce9d7901e1e2a9104251637167d/efficientadapter/src/main/java/com/skocken/efficientadapter/lib/adapter/AdapterHelper.java#L222-L231 |
10,524 | kazocsaba/imageviewer | src/main/java/hu/kazocsaba/imageviewer/PixelMarkerOverlay.java | PixelMarkerOverlay.addPoint | public void addPoint(Point p) {
if (p == null) throw new NullPointerException();
points.add(new Point(p));
repaint();
} | java | public void addPoint(Point p) {
if (p == null) throw new NullPointerException();
points.add(new Point(p));
repaint();
} | [
"public",
"void",
"addPoint",
"(",
"Point",
"p",
")",
"{",
"if",
"(",
"p",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"points",
".",
"add",
"(",
"new",
"Point",
"(",
"p",
")",
")",
";",
"repaint",
"(",
")",
";",
"}"... | Adds a point to the list of pixels marked by this overlay.
@param p a new point
@throws NullPointerException if {@code p} is {@code null} | [
"Adds",
"a",
"point",
"to",
"the",
"list",
"of",
"pixels",
"marked",
"by",
"this",
"overlay",
"."
] | 59b8834c9dbf87bd9ca0898da3458ae592e3851e | https://github.com/kazocsaba/imageviewer/blob/59b8834c9dbf87bd9ca0898da3458ae592e3851e/src/main/java/hu/kazocsaba/imageviewer/PixelMarkerOverlay.java#L56-L60 |
10,525 | kazocsaba/imageviewer | src/main/java/hu/kazocsaba/imageviewer/PixelMarkerOverlay.java | PixelMarkerOverlay.setPoint | public void setPoint(Point p) {
points.clear();
if (p!=null) {
points.add(new Point(p));
}
repaint();
} | java | public void setPoint(Point p) {
points.clear();
if (p!=null) {
points.add(new Point(p));
}
repaint();
} | [
"public",
"void",
"setPoint",
"(",
"Point",
"p",
")",
"{",
"points",
".",
"clear",
"(",
")",
";",
"if",
"(",
"p",
"!=",
"null",
")",
"{",
"points",
".",
"add",
"(",
"new",
"Point",
"(",
"p",
")",
")",
";",
"}",
"repaint",
"(",
")",
";",
"}"
] | Sets the argument as the only point marked by this overlay.
@param p the point to mark; if {@code null}, then no points will be selected | [
"Sets",
"the",
"argument",
"as",
"the",
"only",
"point",
"marked",
"by",
"this",
"overlay",
"."
] | 59b8834c9dbf87bd9ca0898da3458ae592e3851e | https://github.com/kazocsaba/imageviewer/blob/59b8834c9dbf87bd9ca0898da3458ae592e3851e/src/main/java/hu/kazocsaba/imageviewer/PixelMarkerOverlay.java#L66-L72 |
10,526 | kazocsaba/imageviewer | src/main/java/hu/kazocsaba/imageviewer/PixelMarkerOverlay.java | PixelMarkerOverlay.setPoints | public void setPoints(Iterable<Point> points) {
if (points==null) throw new NullPointerException();
this.points.clear();
for (Point p : points) {
this.points.add(new Point(p));
}
repaint();
} | java | public void setPoints(Iterable<Point> points) {
if (points==null) throw new NullPointerException();
this.points.clear();
for (Point p : points) {
this.points.add(new Point(p));
}
repaint();
} | [
"public",
"void",
"setPoints",
"(",
"Iterable",
"<",
"Point",
">",
"points",
")",
"{",
"if",
"(",
"points",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"this",
".",
"points",
".",
"clear",
"(",
")",
";",
"for",
"(",
"Poi... | Sets the marked pixels.
@param points an iterable of all the pixels that should be selected
@throws NullPointerException if {@code points} or any individual point is {@code null} | [
"Sets",
"the",
"marked",
"pixels",
"."
] | 59b8834c9dbf87bd9ca0898da3458ae592e3851e | https://github.com/kazocsaba/imageviewer/blob/59b8834c9dbf87bd9ca0898da3458ae592e3851e/src/main/java/hu/kazocsaba/imageviewer/PixelMarkerOverlay.java#L79-L86 |
10,527 | StanKocken/EfficientAdapter | efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java | ViewHelper.setVisibility | public static void setVisibility(EfficientCacheView cacheView, int viewId, int visibility) {
View view = cacheView.findViewByIdEfficient(viewId);
if (view != null) {
view.setVisibility(visibility);
}
} | java | public static void setVisibility(EfficientCacheView cacheView, int viewId, int visibility) {
View view = cacheView.findViewByIdEfficient(viewId);
if (view != null) {
view.setVisibility(visibility);
}
} | [
"public",
"static",
"void",
"setVisibility",
"(",
"EfficientCacheView",
"cacheView",
",",
"int",
"viewId",
",",
"int",
"visibility",
")",
"{",
"View",
"view",
"=",
"cacheView",
".",
"findViewByIdEfficient",
"(",
"viewId",
")",
";",
"if",
"(",
"view",
"!=",
"... | Equivalent to calling View.setVisibility
@param cacheView The cache of views to get the view from
@param viewId The id of the view whose visibility should change
@param visibility The new visibility for the view | [
"Equivalent",
"to",
"calling",
"View",
".",
"setVisibility"
] | 0bcc3a20182cbce9d7901e1e2a9104251637167d | https://github.com/StanKocken/EfficientAdapter/blob/0bcc3a20182cbce9d7901e1e2a9104251637167d/efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java#L24-L29 |
10,528 | StanKocken/EfficientAdapter | efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java | ViewHelper.setBackground | public static void setBackground(EfficientCacheView cacheView, int viewId, Drawable drawable) {
View view = cacheView.findViewByIdEfficient(viewId);
if (view != null) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
view.setBackgroundDrawable(drawable);
... | java | public static void setBackground(EfficientCacheView cacheView, int viewId, Drawable drawable) {
View view = cacheView.findViewByIdEfficient(viewId);
if (view != null) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
view.setBackgroundDrawable(drawable);
... | [
"public",
"static",
"void",
"setBackground",
"(",
"EfficientCacheView",
"cacheView",
",",
"int",
"viewId",
",",
"Drawable",
"drawable",
")",
"{",
"View",
"view",
"=",
"cacheView",
".",
"findViewByIdEfficient",
"(",
"viewId",
")",
";",
"if",
"(",
"view",
"!=",
... | Equivalent to calling View.setBackground
@param cacheView The cache of views to get the view from
@param viewId The id of the view whose background should change
@param drawable The new background for the view | [
"Equivalent",
"to",
"calling",
"View",
".",
"setBackground"
] | 0bcc3a20182cbce9d7901e1e2a9104251637167d | https://github.com/StanKocken/EfficientAdapter/blob/0bcc3a20182cbce9d7901e1e2a9104251637167d/efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java#L38-L47 |
10,529 | StanKocken/EfficientAdapter | efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java | ViewHelper.setImageDrawable | public static void setImageDrawable(EfficientCacheView cacheView, int viewId,
Drawable drawable) {
View view = cacheView.findViewByIdEfficient(viewId);
if (view instanceof ImageView) {
((ImageView) view).setImageDrawable(drawable);
}
} | java | public static void setImageDrawable(EfficientCacheView cacheView, int viewId,
Drawable drawable) {
View view = cacheView.findViewByIdEfficient(viewId);
if (view instanceof ImageView) {
((ImageView) view).setImageDrawable(drawable);
}
} | [
"public",
"static",
"void",
"setImageDrawable",
"(",
"EfficientCacheView",
"cacheView",
",",
"int",
"viewId",
",",
"Drawable",
"drawable",
")",
"{",
"View",
"view",
"=",
"cacheView",
".",
"findViewByIdEfficient",
"(",
"viewId",
")",
";",
"if",
"(",
"view",
"in... | Equivalent to calling ImageView.setImageDrawable
@param cacheView The cache of views to get the view from
@param viewId The id of the view whose image should change
@param drawable the Drawable to set, or {@code null} to clear the
content | [
"Equivalent",
"to",
"calling",
"ImageView",
".",
"setImageDrawable"
] | 0bcc3a20182cbce9d7901e1e2a9104251637167d | https://github.com/StanKocken/EfficientAdapter/blob/0bcc3a20182cbce9d7901e1e2a9104251637167d/efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java#L202-L208 |
10,530 | StanKocken/EfficientAdapter | efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java | ViewHelper.setImageBitmap | public static void setImageBitmap(EfficientCacheView cacheView, int viewId, Bitmap bm) {
View view = cacheView.findViewByIdEfficient(viewId);
if (view instanceof ImageView) {
((ImageView) view).setImageBitmap(bm);
}
} | java | public static void setImageBitmap(EfficientCacheView cacheView, int viewId, Bitmap bm) {
View view = cacheView.findViewByIdEfficient(viewId);
if (view instanceof ImageView) {
((ImageView) view).setImageBitmap(bm);
}
} | [
"public",
"static",
"void",
"setImageBitmap",
"(",
"EfficientCacheView",
"cacheView",
",",
"int",
"viewId",
",",
"Bitmap",
"bm",
")",
"{",
"View",
"view",
"=",
"cacheView",
".",
"findViewByIdEfficient",
"(",
"viewId",
")",
";",
"if",
"(",
"view",
"instanceof",... | Equivalent to calling ImageView.setImageBitmap
@param cacheView The cache of views to get the view from
@param viewId The id of the view whose image should change
@param bm The bitmap to set | [
"Equivalent",
"to",
"calling",
"ImageView",
".",
"setImageBitmap"
] | 0bcc3a20182cbce9d7901e1e2a9104251637167d | https://github.com/StanKocken/EfficientAdapter/blob/0bcc3a20182cbce9d7901e1e2a9104251637167d/efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/ViewHelper.java#L231-L236 |
10,531 | grahamedgecombe/jterminal | src/main/java/com/grahamedgecombe/jterminal/JTerminal.java | JTerminal.init | private void init() {
setLayout(new BorderLayout(0, 0));
int rows = model.getRows();
int bufferSize = model.getBufferSize();
if (bufferSize > rows) {
scrollBar = new JScrollBar(JScrollBar.VERTICAL, 0, rows, 0, bufferSize + 1);
scrollBar.addAdjustmentListener(new AdjustmentListener() {
@Override
... | java | private void init() {
setLayout(new BorderLayout(0, 0));
int rows = model.getRows();
int bufferSize = model.getBufferSize();
if (bufferSize > rows) {
scrollBar = new JScrollBar(JScrollBar.VERTICAL, 0, rows, 0, bufferSize + 1);
scrollBar.addAdjustmentListener(new AdjustmentListener() {
@Override
... | [
"private",
"void",
"init",
"(",
")",
"{",
"setLayout",
"(",
"new",
"BorderLayout",
"(",
"0",
",",
"0",
")",
")",
";",
"int",
"rows",
"=",
"model",
".",
"getRows",
"(",
")",
";",
"int",
"bufferSize",
"=",
"model",
".",
"getBufferSize",
"(",
")",
";"... | Initializes the terminal. | [
"Initializes",
"the",
"terminal",
"."
] | 751142d9d2cafbde0ec36a80f73bb25bf297f2f3 | https://github.com/grahamedgecombe/jterminal/blob/751142d9d2cafbde0ec36a80f73bb25bf297f2f3/src/main/java/com/grahamedgecombe/jterminal/JTerminal.java#L161-L181 |
10,532 | StanKocken/EfficientAdapter | efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/EfficientCacheView.java | EfficientCacheView.clearViewCached | public void clearViewCached(int parentId, int viewId) {
SparseArray<View> sparseArrayViewsParent = mSparseSparseArrayView.get(parentId);
if (sparseArrayViewsParent != null) {
sparseArrayViewsParent.remove(viewId);
}
} | java | public void clearViewCached(int parentId, int viewId) {
SparseArray<View> sparseArrayViewsParent = mSparseSparseArrayView.get(parentId);
if (sparseArrayViewsParent != null) {
sparseArrayViewsParent.remove(viewId);
}
} | [
"public",
"void",
"clearViewCached",
"(",
"int",
"parentId",
",",
"int",
"viewId",
")",
"{",
"SparseArray",
"<",
"View",
">",
"sparseArrayViewsParent",
"=",
"mSparseSparseArrayView",
".",
"get",
"(",
"parentId",
")",
";",
"if",
"(",
"sparseArrayViewsParent",
"!=... | Clear the cache for the view specify
@param parentId the parent id of the view to remove (if the view was retrieve with this
parent id)
@param viewId id of the view to remove from the cache | [
"Clear",
"the",
"cache",
"for",
"the",
"view",
"specify"
] | 0bcc3a20182cbce9d7901e1e2a9104251637167d | https://github.com/StanKocken/EfficientAdapter/blob/0bcc3a20182cbce9d7901e1e2a9104251637167d/efficientadapter/src/main/java/com/skocken/efficientadapter/lib/util/EfficientCacheView.java#L43-L48 |
10,533 | jiaqi/jcli | src/main/java/org/cyclopsgroup/jcli/spi/CommandLineBuilder.java | CommandLineBuilder.withLongOption | public CommandLineBuilder withLongOption(String name, String value) {
cl.addOptionValue(name, value, false);
return this;
} | java | public CommandLineBuilder withLongOption(String name, String value) {
cl.addOptionValue(name, value, false);
return this;
} | [
"public",
"CommandLineBuilder",
"withLongOption",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"cl",
".",
"addOptionValue",
"(",
"name",
",",
"value",
",",
"false",
")",
";",
"return",
"this",
";",
"}"
] | Add an option with its long name
@param name Long name of the option to add
@param value Value of the option to add
@return Builder itself | [
"Add",
"an",
"option",
"with",
"its",
"long",
"name"
] | 3854b3bb3c26bbe7407bf1b6600d8b25592d398e | https://github.com/jiaqi/jcli/blob/3854b3bb3c26bbe7407bf1b6600d8b25592d398e/src/main/java/org/cyclopsgroup/jcli/spi/CommandLineBuilder.java#L60-L63 |
10,534 | jiaqi/jcli | src/main/java/org/cyclopsgroup/jcli/spi/CommandLineBuilder.java | CommandLineBuilder.withShortOption | public CommandLineBuilder withShortOption(String name, String value) {
cl.addOptionValue(name, value, true);
return this;
} | java | public CommandLineBuilder withShortOption(String name, String value) {
cl.addOptionValue(name, value, true);
return this;
} | [
"public",
"CommandLineBuilder",
"withShortOption",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"cl",
".",
"addOptionValue",
"(",
"name",
",",
"value",
",",
"true",
")",
";",
"return",
"this",
";",
"}"
] | Add an option with its short name
@param name Short name of the option to add
@param value Value of option to add
@return Builder itself | [
"Add",
"an",
"option",
"with",
"its",
"short",
"name"
] | 3854b3bb3c26bbe7407bf1b6600d8b25592d398e | https://github.com/jiaqi/jcli/blob/3854b3bb3c26bbe7407bf1b6600d8b25592d398e/src/main/java/org/cyclopsgroup/jcli/spi/CommandLineBuilder.java#L83-L86 |
10,535 | jiaqi/jcli | src/main/java/org/cyclopsgroup/jcli/impl/MultiValueReference.java | MultiValueReference.setValues | @SuppressWarnings("unchecked")
<P> void setValues(T bean, List<String> values) {
Collection<P> col;
try {
col = (Collection<P>) listType.newInstance();
} catch (InstantiationException e) {
throw new RuntimeException("Can't instantiate " + listType, e);
} catch (IllegalAccessException e) {
... | java | @SuppressWarnings("unchecked")
<P> void setValues(T bean, List<String> values) {
Collection<P> col;
try {
col = (Collection<P>) listType.newInstance();
} catch (InstantiationException e) {
throw new RuntimeException("Can't instantiate " + listType, e);
} catch (IllegalAccessException e) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"<",
"P",
">",
"void",
"setValues",
"(",
"T",
"bean",
",",
"List",
"<",
"String",
">",
"values",
")",
"{",
"Collection",
"<",
"P",
">",
"col",
";",
"try",
"{",
"col",
"=",
"(",
"Collection",
"<",
... | Write multi value to bean
@param <P> Type of value to convert
@param bean Bean to set values
@param values List of values to set | [
"Write",
"multi",
"value",
"to",
"bean"
] | 3854b3bb3c26bbe7407bf1b6600d8b25592d398e | https://github.com/jiaqi/jcli/blob/3854b3bb3c26bbe7407bf1b6600d8b25592d398e/src/main/java/org/cyclopsgroup/jcli/impl/MultiValueReference.java#L25-L39 |
10,536 | jiaqi/jcli | src/main/java/org/cyclopsgroup/jcli/impl/ParsingContextBuilder.java | ParsingContextBuilder.getAnnotation | @Nullable
private static <A extends Annotation> A getAnnotation(PropertyDescriptor descriptor,
Class<A> type) {
A a = null;
if (descriptor.getWriteMethod() != null) {
a = descriptor.getWriteMethod().getAnnotation(type);
}
if (a == null && descriptor.getReadMethod() != null) {
a = des... | java | @Nullable
private static <A extends Annotation> A getAnnotation(PropertyDescriptor descriptor,
Class<A> type) {
A a = null;
if (descriptor.getWriteMethod() != null) {
a = descriptor.getWriteMethod().getAnnotation(type);
}
if (a == null && descriptor.getReadMethod() != null) {
a = des... | [
"@",
"Nullable",
"private",
"static",
"<",
"A",
"extends",
"Annotation",
">",
"A",
"getAnnotation",
"(",
"PropertyDescriptor",
"descriptor",
",",
"Class",
"<",
"A",
">",
"type",
")",
"{",
"A",
"a",
"=",
"null",
";",
"if",
"(",
"descriptor",
".",
"getWrit... | Get annotation from either writer or reader of a Java property
@param <A> Type of annotation
@param descriptor Field descriptor from which annotation is searched
@param type Type of annotation
@return Annotation or null if it's not found | [
"Get",
"annotation",
"from",
"either",
"writer",
"or",
"reader",
"of",
"a",
"Java",
"property"
] | 3854b3bb3c26bbe7407bf1b6600d8b25592d398e | https://github.com/jiaqi/jcli/blob/3854b3bb3c26bbe7407bf1b6600d8b25592d398e/src/main/java/org/cyclopsgroup/jcli/impl/ParsingContextBuilder.java#L56-L67 |
10,537 | kazocsaba/imageviewer | src/main/java/hu/kazocsaba/imageviewer/PixelInfoStatusBar.java | PixelInfoStatusBar.setModel | public final void setModel(PixelModel newModel) {
if (newModel == null) throw new NullPointerException();
if (model != newModel) {
if (model != null)
model.removeChangeListener(modelListener);
model = newModel;
model.addChangeListener(modelListener);
update();
}
} | java | public final void setModel(PixelModel newModel) {
if (newModel == null) throw new NullPointerException();
if (model != newModel) {
if (model != null)
model.removeChangeListener(modelListener);
model = newModel;
model.addChangeListener(modelListener);
update();
}
} | [
"public",
"final",
"void",
"setModel",
"(",
"PixelModel",
"newModel",
")",
"{",
"if",
"(",
"newModel",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"if",
"(",
"model",
"!=",
"newModel",
")",
"{",
"if",
"(",
"model",
"!=",
"... | Sets the model dictating the pixel shown by this status bar.
@param newModel the new model
@throws NullPointerException if {@code newModel} is {@code null} | [
"Sets",
"the",
"model",
"dictating",
"the",
"pixel",
"shown",
"by",
"this",
"status",
"bar",
"."
] | 59b8834c9dbf87bd9ca0898da3458ae592e3851e | https://github.com/kazocsaba/imageviewer/blob/59b8834c9dbf87bd9ca0898da3458ae592e3851e/src/main/java/hu/kazocsaba/imageviewer/PixelInfoStatusBar.java#L67-L77 |
10,538 | kazocsaba/imageviewer | src/main/java/hu/kazocsaba/imageviewer/PixelInfoStatusBar.java | PixelInfoStatusBar.update | protected final void update() {
BufferedImage image=getImageViewer()==null ? null : getImageViewer().getImage();
if (image==null || model.isInvalid() || model.getX()>=image.getWidth() || model.getY()>=image.getHeight())
updateLabelNoData();
else
updateLabel(image, model.getX(), model.getY(), statusBar.getWi... | java | protected final void update() {
BufferedImage image=getImageViewer()==null ? null : getImageViewer().getImage();
if (image==null || model.isInvalid() || model.getX()>=image.getWidth() || model.getY()>=image.getHeight())
updateLabelNoData();
else
updateLabel(image, model.getX(), model.getY(), statusBar.getWi... | [
"protected",
"final",
"void",
"update",
"(",
")",
"{",
"BufferedImage",
"image",
"=",
"getImageViewer",
"(",
")",
"==",
"null",
"?",
"null",
":",
"getImageViewer",
"(",
")",
".",
"getImage",
"(",
")",
";",
"if",
"(",
"image",
"==",
"null",
"||",
"model... | Updates the info label. This function is called when either the selected pixel
or the image shown in the viewer is changed. You can call this method to indicate
that the message should be updated for some different reason. | [
"Updates",
"the",
"info",
"label",
".",
"This",
"function",
"is",
"called",
"when",
"either",
"the",
"selected",
"pixel",
"or",
"the",
"image",
"shown",
"in",
"the",
"viewer",
"is",
"changed",
".",
"You",
"can",
"call",
"this",
"method",
"to",
"indicate",
... | 59b8834c9dbf87bd9ca0898da3458ae592e3851e | https://github.com/kazocsaba/imageviewer/blob/59b8834c9dbf87bd9ca0898da3458ae592e3851e/src/main/java/hu/kazocsaba/imageviewer/PixelInfoStatusBar.java#L107-L113 |
10,539 | kazocsaba/imageviewer | src/main/java/hu/kazocsaba/imageviewer/ImageSequenceViewer.java | ImageSequenceViewer.setPosition | public void setPosition(int pos) {
if (pos < 0 || pos >= number)
throw new IllegalArgumentException("Position " + pos + " out of range");
position = pos;
updateLocationDefinition(position);
forwardButton.setEnabled(position < number - 1);
backwardButton.setEnabled(position > 0);
if (panel.getParent()!=nu... | java | public void setPosition(int pos) {
if (pos < 0 || pos >= number)
throw new IllegalArgumentException("Position " + pos + " out of range");
position = pos;
updateLocationDefinition(position);
forwardButton.setEnabled(position < number - 1);
backwardButton.setEnabled(position > 0);
if (panel.getParent()!=nu... | [
"public",
"void",
"setPosition",
"(",
"int",
"pos",
")",
"{",
"if",
"(",
"pos",
"<",
"0",
"||",
"pos",
">=",
"number",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Position \"",
"+",
"pos",
"+",
"\" out of range\"",
")",
";",
"position",
"=",
... | Sets the position of the viewer.
@param pos the new position of the viewer
@throws IllegalArgumentException if the position is not valid | [
"Sets",
"the",
"position",
"of",
"the",
"viewer",
"."
] | 59b8834c9dbf87bd9ca0898da3458ae592e3851e | https://github.com/kazocsaba/imageviewer/blob/59b8834c9dbf87bd9ca0898da3458ae592e3851e/src/main/java/hu/kazocsaba/imageviewer/ImageSequenceViewer.java#L114-L122 |
10,540 | kazocsaba/imageviewer | src/main/java/hu/kazocsaba/imageviewer/ImageViewer.java | ImageViewer.setStatusBarVisible | public void setStatusBarVisible(boolean statusBarVisible) {
if (this.statusBarVisible == statusBarVisible) return;
if (statusBar!=null) {
if (statusBarVisible)
panel.add(statusBar.getComponent(), BorderLayout.SOUTH);
else
panel.remove(statusBar.getComponent());
panel.revalidate();
panel.repaint(... | java | public void setStatusBarVisible(boolean statusBarVisible) {
if (this.statusBarVisible == statusBarVisible) return;
if (statusBar!=null) {
if (statusBarVisible)
panel.add(statusBar.getComponent(), BorderLayout.SOUTH);
else
panel.remove(statusBar.getComponent());
panel.revalidate();
panel.repaint(... | [
"public",
"void",
"setStatusBarVisible",
"(",
"boolean",
"statusBarVisible",
")",
"{",
"if",
"(",
"this",
".",
"statusBarVisible",
"==",
"statusBarVisible",
")",
"return",
";",
"if",
"(",
"statusBar",
"!=",
"null",
")",
"{",
"if",
"(",
"statusBarVisible",
")",... | Sets whether the status bar is visible. The status bar is hidden by default.
@param statusBarVisible true, if the status bar should be visible; false otherwise | [
"Sets",
"whether",
"the",
"status",
"bar",
"is",
"visible",
".",
"The",
"status",
"bar",
"is",
"hidden",
"by",
"default",
"."
] | 59b8834c9dbf87bd9ca0898da3458ae592e3851e | https://github.com/kazocsaba/imageviewer/blob/59b8834c9dbf87bd9ca0898da3458ae592e3851e/src/main/java/hu/kazocsaba/imageviewer/ImageViewer.java#L173-L187 |
10,541 | StanKocken/EfficientAdapter | efficientadapter/src/main/java/com/skocken/efficientadapter/lib/viewholder/EfficientViewHolder.java | EfficientViewHolder.getOnClickListener | public View.OnClickListener getOnClickListener(boolean adapterHasListener) {
if (isClickable() && adapterHasListener) {
if (mViewHolderClickListener == null) {
mViewHolderClickListener = new ViewHolderClickListener<>(this);
}
} else {
mViewHolderClickL... | java | public View.OnClickListener getOnClickListener(boolean adapterHasListener) {
if (isClickable() && adapterHasListener) {
if (mViewHolderClickListener == null) {
mViewHolderClickListener = new ViewHolderClickListener<>(this);
}
} else {
mViewHolderClickL... | [
"public",
"View",
".",
"OnClickListener",
"getOnClickListener",
"(",
"boolean",
"adapterHasListener",
")",
"{",
"if",
"(",
"isClickable",
"(",
")",
"&&",
"adapterHasListener",
")",
"{",
"if",
"(",
"mViewHolderClickListener",
"==",
"null",
")",
"{",
"mViewHolderCli... | Get the OnClickListener to call when the user click on the item.
@param adapterHasListener true if the calling adapter has a global listener on the item.
@return the click listener to be put into the view. | [
"Get",
"the",
"OnClickListener",
"to",
"call",
"when",
"the",
"user",
"click",
"on",
"the",
"item",
"."
] | 0bcc3a20182cbce9d7901e1e2a9104251637167d | https://github.com/StanKocken/EfficientAdapter/blob/0bcc3a20182cbce9d7901e1e2a9104251637167d/efficientadapter/src/main/java/com/skocken/efficientadapter/lib/viewholder/EfficientViewHolder.java#L173-L182 |
10,542 | StanKocken/EfficientAdapter | efficientadapter/src/main/java/com/skocken/efficientadapter/lib/viewholder/EfficientViewHolder.java | EfficientViewHolder.getOnLongClickListener | public View.OnLongClickListener getOnLongClickListener(boolean adapterHasListener) {
if (isLongClickable() && adapterHasListener) {
if (mViewHolderLongClickListener == null) {
mViewHolderLongClickListener = new ViewHolderLongClickListener<>(this);
}
} else {
... | java | public View.OnLongClickListener getOnLongClickListener(boolean adapterHasListener) {
if (isLongClickable() && adapterHasListener) {
if (mViewHolderLongClickListener == null) {
mViewHolderLongClickListener = new ViewHolderLongClickListener<>(this);
}
} else {
... | [
"public",
"View",
".",
"OnLongClickListener",
"getOnLongClickListener",
"(",
"boolean",
"adapterHasListener",
")",
"{",
"if",
"(",
"isLongClickable",
"(",
")",
"&&",
"adapterHasListener",
")",
"{",
"if",
"(",
"mViewHolderLongClickListener",
"==",
"null",
")",
"{",
... | Get the OnLongClickListener to call when the user long-click on the item.
@param adapterHasListener true if the calling adapter has a global listener on the item.
@return the long-click listener to be put into the view. | [
"Get",
"the",
"OnLongClickListener",
"to",
"call",
"when",
"the",
"user",
"long",
"-",
"click",
"on",
"the",
"item",
"."
] | 0bcc3a20182cbce9d7901e1e2a9104251637167d | https://github.com/StanKocken/EfficientAdapter/blob/0bcc3a20182cbce9d7901e1e2a9104251637167d/efficientadapter/src/main/java/com/skocken/efficientadapter/lib/viewholder/EfficientViewHolder.java#L189-L198 |
10,543 | jiaqi/jcli | src/main/java/org/cyclopsgroup/jcli/impl/AnnotationParsingContext.java | AnnotationParsingContext.lookupReference | Reference<T> lookupReference(String name, boolean isLongName) {
if (isLongName) {
for (Reference<T> r : referenceMap.values()) {
if (r.longName.equals(name)) {
return r;
}
}
return null;
}
return referenceMap.get(name);
} | java | Reference<T> lookupReference(String name, boolean isLongName) {
if (isLongName) {
for (Reference<T> r : referenceMap.values()) {
if (r.longName.equals(name)) {
return r;
}
}
return null;
}
return referenceMap.get(name);
} | [
"Reference",
"<",
"T",
">",
"lookupReference",
"(",
"String",
"name",
",",
"boolean",
"isLongName",
")",
"{",
"if",
"(",
"isLongName",
")",
"{",
"for",
"(",
"Reference",
"<",
"T",
">",
"r",
":",
"referenceMap",
".",
"values",
"(",
")",
")",
"{",
"if"... | Find reference with given name of option or argument
@param name Name of option or argument
@param isLongName True if name is a long name
@return Reference that matches name or NULL | [
"Find",
"reference",
"with",
"given",
"name",
"of",
"option",
"or",
"argument"
] | 3854b3bb3c26bbe7407bf1b6600d8b25592d398e | https://github.com/jiaqi/jcli/blob/3854b3bb3c26bbe7407bf1b6600d8b25592d398e/src/main/java/org/cyclopsgroup/jcli/impl/AnnotationParsingContext.java#L52-L62 |
10,544 | jiaqi/jcli | src/main/java/org/cyclopsgroup/jcli/jline/ArgumentsInspector.java | ArgumentsInspector.end | void end() {
switch (state) {
case OPTION:
currentOption = context.optionWithShortName(currentValue.substring(1));
case LONG_OPTION:
if (state == ArgumentsInspectorState.LONG_OPTION) {
currentOption = context.optionWithLongName(currentValue.substring(2));
}
if (... | java | void end() {
switch (state) {
case OPTION:
currentOption = context.optionWithShortName(currentValue.substring(1));
case LONG_OPTION:
if (state == ArgumentsInspectorState.LONG_OPTION) {
currentOption = context.optionWithLongName(currentValue.substring(2));
}
if (... | [
"void",
"end",
"(",
")",
"{",
"switch",
"(",
"state",
")",
"{",
"case",
"OPTION",
":",
"currentOption",
"=",
"context",
".",
"optionWithShortName",
"(",
"currentValue",
".",
"substring",
"(",
"1",
")",
")",
";",
"case",
"LONG_OPTION",
":",
"if",
"(",
"... | End the process | [
"End",
"the",
"process"
] | 3854b3bb3c26bbe7407bf1b6600d8b25592d398e | https://github.com/jiaqi/jcli/blob/3854b3bb3c26bbe7407bf1b6600d8b25592d398e/src/main/java/org/cyclopsgroup/jcli/jline/ArgumentsInspector.java#L76-L97 |
10,545 | jiaqi/jcli | src/main/java/org/cyclopsgroup/jcli/impl/SingleValueReference.java | SingleValueReference.setValue | void setValue(T bean, String value) {
ref.writeValue(converter.fromCharacters(value), bean);
} | java | void setValue(T bean, String value) {
ref.writeValue(converter.fromCharacters(value), bean);
} | [
"void",
"setValue",
"(",
"T",
"bean",
",",
"String",
"value",
")",
"{",
"ref",
".",
"writeValue",
"(",
"converter",
".",
"fromCharacters",
"(",
"value",
")",
",",
"bean",
")",
";",
"}"
] | Set a string value to bean based on known conversion rule and value reference
@param bean Bean to set value to
@param value String expression of value to set | [
"Set",
"a",
"string",
"value",
"to",
"bean",
"based",
"on",
"known",
"conversion",
"rule",
"and",
"value",
"reference"
] | 3854b3bb3c26bbe7407bf1b6600d8b25592d398e | https://github.com/jiaqi/jcli/blob/3854b3bb3c26bbe7407bf1b6600d8b25592d398e/src/main/java/org/cyclopsgroup/jcli/impl/SingleValueReference.java#L18-L20 |
10,546 | kazocsaba/imageviewer | src/main/java/hu/kazocsaba/imageviewer/PixelModel.java | PixelModel.fireChange | protected void fireChange() {
Object[] listeners = listenerList.getListenerList();
ChangeEvent event = new ChangeEvent(this);
for (int i = listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i] == ChangeListener.class) {
((ChangeListener)listeners[i + 1]).stateChanged(event);
}
}
} | java | protected void fireChange() {
Object[] listeners = listenerList.getListenerList();
ChangeEvent event = new ChangeEvent(this);
for (int i = listeners.length - 2; i >= 0; i -= 2) {
if (listeners[i] == ChangeListener.class) {
((ChangeListener)listeners[i + 1]).stateChanged(event);
}
}
} | [
"protected",
"void",
"fireChange",
"(",
")",
"{",
"Object",
"[",
"]",
"listeners",
"=",
"listenerList",
".",
"getListenerList",
"(",
")",
";",
"ChangeEvent",
"event",
"=",
"new",
"ChangeEvent",
"(",
"this",
")",
";",
"for",
"(",
"int",
"i",
"=",
"listene... | Notifies the registered listeners that the model has changed. | [
"Notifies",
"the",
"registered",
"listeners",
"that",
"the",
"model",
"has",
"changed",
"."
] | 59b8834c9dbf87bd9ca0898da3458ae592e3851e | https://github.com/kazocsaba/imageviewer/blob/59b8834c9dbf87bd9ca0898da3458ae592e3851e/src/main/java/hu/kazocsaba/imageviewer/PixelModel.java#L36-L44 |
10,547 | kazocsaba/imageviewer | src/main/java/hu/kazocsaba/imageviewer/LayeredImageView.java | LayeredImageView.addOverlay | public void addOverlay(Overlay overlay, int layer) {
if (overlay==null) throw new NullPointerException();
OverlayComponent c=new OverlayComponent(overlay, theImage);
overlay.addOverlayComponent(c);
layeredPane.add(c, Integer.valueOf(layer));
layeredPane.revalidate();
layeredPane.repaint();
} | java | public void addOverlay(Overlay overlay, int layer) {
if (overlay==null) throw new NullPointerException();
OverlayComponent c=new OverlayComponent(overlay, theImage);
overlay.addOverlayComponent(c);
layeredPane.add(c, Integer.valueOf(layer));
layeredPane.revalidate();
layeredPane.repaint();
} | [
"public",
"void",
"addOverlay",
"(",
"Overlay",
"overlay",
",",
"int",
"layer",
")",
"{",
"if",
"(",
"overlay",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"OverlayComponent",
"c",
"=",
"new",
"OverlayComponent",
"(",
"overlay",... | Adds an overlay as the specified layer.
@param overlay the overlay to add
@param layer the layer to add the overlay to; higher layers are on top of lower layers;
the image resides in layer 0 | [
"Adds",
"an",
"overlay",
"as",
"the",
"specified",
"layer",
"."
] | 59b8834c9dbf87bd9ca0898da3458ae592e3851e | https://github.com/kazocsaba/imageviewer/blob/59b8834c9dbf87bd9ca0898da3458ae592e3851e/src/main/java/hu/kazocsaba/imageviewer/LayeredImageView.java#L40-L47 |
10,548 | kazocsaba/imageviewer | src/main/java/hu/kazocsaba/imageviewer/LayeredImageView.java | LayeredImageView.removeOverlay | public void removeOverlay(Overlay overlay) {
if (overlay==null) throw new NullPointerException();
for (Component c: layeredPane.getComponents()) {
if (c instanceof OverlayComponent && ((OverlayComponent)c).overlay==overlay) {
overlay.removeOverlayComponent((OverlayComponent)c);
layeredPane.remove(c);
... | java | public void removeOverlay(Overlay overlay) {
if (overlay==null) throw new NullPointerException();
for (Component c: layeredPane.getComponents()) {
if (c instanceof OverlayComponent && ((OverlayComponent)c).overlay==overlay) {
overlay.removeOverlayComponent((OverlayComponent)c);
layeredPane.remove(c);
... | [
"public",
"void",
"removeOverlay",
"(",
"Overlay",
"overlay",
")",
"{",
"if",
"(",
"overlay",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"for",
"(",
"Component",
"c",
":",
"layeredPane",
".",
"getComponents",
"(",
")",
")",
... | Removes an overlay from the image viewer.
@param overlay the overlay to remove
@throws IllegalArgumentException if the overlay is not in the image viewer | [
"Removes",
"an",
"overlay",
"from",
"the",
"image",
"viewer",
"."
] | 59b8834c9dbf87bd9ca0898da3458ae592e3851e | https://github.com/kazocsaba/imageviewer/blob/59b8834c9dbf87bd9ca0898da3458ae592e3851e/src/main/java/hu/kazocsaba/imageviewer/LayeredImageView.java#L53-L65 |
10,549 | gitblit/fathom | fathom-security/src/main/java/fathom/realm/MemoryRealm.java | MemoryRealm.parseDefinedRoles | protected Map<String, Role> parseDefinedRoles(Config config) {
// Parse the defined Roles
Map<String, Role> roleMap = new HashMap<>();
if (!config.hasPath("roles")) {
log.trace("'{}' has no roles", config);
} else if (config.hasPath("roles")) {
log.trace("Parsing ... | java | protected Map<String, Role> parseDefinedRoles(Config config) {
// Parse the defined Roles
Map<String, Role> roleMap = new HashMap<>();
if (!config.hasPath("roles")) {
log.trace("'{}' has no roles", config);
} else if (config.hasPath("roles")) {
log.trace("Parsing ... | [
"protected",
"Map",
"<",
"String",
",",
"Role",
">",
"parseDefinedRoles",
"(",
"Config",
"config",
")",
"{",
"// Parse the defined Roles",
"Map",
"<",
"String",
",",
"Role",
">",
"roleMap",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"if",
"(",
"!",
"con... | Parse the Roles specified in the Config object.
@param config
@return a map of Name-Role | [
"Parse",
"the",
"Roles",
"specified",
"in",
"the",
"Config",
"object",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-security/src/main/java/fathom/realm/MemoryRealm.java#L168-L185 |
10,550 | gitblit/fathom | fathom-core/src/main/java/fathom/utils/ClassUtil.java | ClassUtil.getClasses | public static Collection<Class<?>> getClasses(String... packageNames) {
List<Class<?>> classes = new ArrayList<>();
for (String packageName : packageNames) {
final String packagePath = packageName.replace('.', '/');
final String packagePrefix = packageName + '.';
List... | java | public static Collection<Class<?>> getClasses(String... packageNames) {
List<Class<?>> classes = new ArrayList<>();
for (String packageName : packageNames) {
final String packagePath = packageName.replace('.', '/');
final String packagePrefix = packageName + '.';
List... | [
"public",
"static",
"Collection",
"<",
"Class",
"<",
"?",
">",
">",
"getClasses",
"(",
"String",
"...",
"packageNames",
")",
"{",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"classes",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"String",... | Returns the list of all classes within a package.
@param packageNames
@return a collection of classes | [
"Returns",
"the",
"list",
"of",
"all",
"classes",
"within",
"a",
"package",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-core/src/main/java/fathom/utils/ClassUtil.java#L109-L163 |
10,551 | gitblit/fathom | fathom-core/src/main/java/fathom/utils/ClassUtil.java | ClassUtil.getAnnotation | public static <T extends Annotation> T getAnnotation(Method method, Class<T> annotationClass) {
T t = method.getAnnotation(annotationClass);
if (t == null) {
t = getAnnotation(method.getDeclaringClass(), annotationClass);
}
return t;
} | java | public static <T extends Annotation> T getAnnotation(Method method, Class<T> annotationClass) {
T t = method.getAnnotation(annotationClass);
if (t == null) {
t = getAnnotation(method.getDeclaringClass(), annotationClass);
}
return t;
} | [
"public",
"static",
"<",
"T",
"extends",
"Annotation",
">",
"T",
"getAnnotation",
"(",
"Method",
"method",
",",
"Class",
"<",
"T",
">",
"annotationClass",
")",
"{",
"T",
"t",
"=",
"method",
".",
"getAnnotation",
"(",
"annotationClass",
")",
";",
"if",
"(... | Extract the annotation from the method or the declaring class.
@param method
@param annotationClass
@param <T>
@return the annotation or null | [
"Extract",
"the",
"annotation",
"from",
"the",
"method",
"or",
"the",
"declaring",
"class",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-core/src/main/java/fathom/utils/ClassUtil.java#L180-L186 |
10,552 | gitblit/fathom | fathom-security-redis/src/main/java/fathom/realm/redis/RedisRealm.java | RedisRealm.executeScript | protected void executeScript(String scriptPath) {
URL scriptUrl = null;
try {
if (scriptPath.startsWith("classpath:")) {
String script = scriptPath.substring("classpath:".length());
scriptUrl = ClassUtil.getResource(script);
if (scriptUrl == nu... | java | protected void executeScript(String scriptPath) {
URL scriptUrl = null;
try {
if (scriptPath.startsWith("classpath:")) {
String script = scriptPath.substring("classpath:".length());
scriptUrl = ClassUtil.getResource(script);
if (scriptUrl == nu... | [
"protected",
"void",
"executeScript",
"(",
"String",
"scriptPath",
")",
"{",
"URL",
"scriptUrl",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"scriptPath",
".",
"startsWith",
"(",
"\"classpath:\"",
")",
")",
"{",
"String",
"script",
"=",
"scriptPath",
".",
"su... | Execute a script located either in the classpath or on the filesystem.
@param scriptPath | [
"Execute",
"a",
"script",
"located",
"either",
"in",
"the",
"classpath",
"or",
"on",
"the",
"filesystem",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-security-redis/src/main/java/fathom/realm/redis/RedisRealm.java#L242-L268 |
10,553 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/controls/SDFlagsControl.java | SDFlagsControl.berEncodedValue | private byte[] berEncodedValue() {
final ByteBuffer buff = ByteBuffer.allocate(5);
buff.put((byte) 0x30); // (Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
buff.put((byte) 0x03); // size
buff.put((byte) 0x02); // 4bytes int tag
buff.put((byte) 0x01); // int size
buff.put(Numbe... | java | private byte[] berEncodedValue() {
final ByteBuffer buff = ByteBuffer.allocate(5);
buff.put((byte) 0x30); // (Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);
buff.put((byte) 0x03); // size
buff.put((byte) 0x02); // 4bytes int tag
buff.put((byte) 0x01); // int size
buff.put(Numbe... | [
"private",
"byte",
"[",
"]",
"berEncodedValue",
"(",
")",
"{",
"final",
"ByteBuffer",
"buff",
"=",
"ByteBuffer",
".",
"allocate",
"(",
"5",
")",
";",
"buff",
".",
"put",
"(",
"(",
"byte",
")",
"0x30",
")",
";",
"// (Ber.ASN_SEQUENCE | Ber.ASN_CONSTRUCTOR);",... | BER encode the flags.
@return flags BER encoded. | [
"BER",
"encode",
"the",
"flags",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/controls/SDFlagsControl.java#L120-L128 |
10,554 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/utils/Hex.java | Hex.getEscaped | public static String getEscaped(byte... bytes) {
final StringBuilder bld = new StringBuilder();
for (byte b : bytes) {
bld.append("\\").append(Hex.get(b));
}
return bld.toString();
} | java | public static String getEscaped(byte... bytes) {
final StringBuilder bld = new StringBuilder();
for (byte b : bytes) {
bld.append("\\").append(Hex.get(b));
}
return bld.toString();
} | [
"public",
"static",
"String",
"getEscaped",
"(",
"byte",
"...",
"bytes",
")",
"{",
"final",
"StringBuilder",
"bld",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"byte",
"b",
":",
"bytes",
")",
"{",
"bld",
".",
"append",
"(",
"\"\\\\\"",
")",... | Gets escaped hex string corresponding to the given bytes.
@param bytes bytes.
@return escaped hex string | [
"Gets",
"escaped",
"hex",
"string",
"corresponding",
"to",
"the",
"given",
"bytes",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/utils/Hex.java#L59-L65 |
10,555 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/utils/Hex.java | Hex.reverse | public static byte[] reverse(byte... bytes) {
byte[] res = new byte[bytes.length];
int j = 0;
for (int i = bytes.length - 1; i >= 0; i--) {
res[j] = bytes[i];
j++;
}
return res;
} | java | public static byte[] reverse(byte... bytes) {
byte[] res = new byte[bytes.length];
int j = 0;
for (int i = bytes.length - 1; i >= 0; i--) {
res[j] = bytes[i];
j++;
}
return res;
} | [
"public",
"static",
"byte",
"[",
"]",
"reverse",
"(",
"byte",
"...",
"bytes",
")",
"{",
"byte",
"[",
"]",
"res",
"=",
"new",
"byte",
"[",
"bytes",
".",
"length",
"]",
";",
"int",
"j",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"bytes",
".",
... | Reverses bytes.
@param bytes bytes.
@return reversed byte array. | [
"Reverses",
"bytes",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/utils/Hex.java#L83-L91 |
10,556 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/SID.java | SID.newInstance | public static SID newInstance(final byte[] identifier) {
final SID sid = new SID();
sid.setRevision((byte) 0x01);
sid.setIdentifierAuthority(identifier);
return sid;
} | java | public static SID newInstance(final byte[] identifier) {
final SID sid = new SID();
sid.setRevision((byte) 0x01);
sid.setIdentifierAuthority(identifier);
return sid;
} | [
"public",
"static",
"SID",
"newInstance",
"(",
"final",
"byte",
"[",
"]",
"identifier",
")",
"{",
"final",
"SID",
"sid",
"=",
"new",
"SID",
"(",
")",
";",
"sid",
".",
"setRevision",
"(",
"(",
"byte",
")",
"0x01",
")",
";",
"sid",
".",
"setIdentifierA... | Instances a new SID with the given identifier authority.
@param identifier identifier authority (6 bytes only).
@return the SID instance. | [
"Instances",
"a",
"new",
"SID",
"with",
"the",
"given",
"identifier",
"authority",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/SID.java#L89-L94 |
10,557 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/SID.java | SID.parse | public static SID parse(final byte[] src) {
final ByteBuffer sddlBuffer = ByteBuffer.wrap(src);
final SID sid = new SID();
sid.parse(sddlBuffer.asIntBuffer(), 0);
return sid;
} | java | public static SID parse(final byte[] src) {
final ByteBuffer sddlBuffer = ByteBuffer.wrap(src);
final SID sid = new SID();
sid.parse(sddlBuffer.asIntBuffer(), 0);
return sid;
} | [
"public",
"static",
"SID",
"parse",
"(",
"final",
"byte",
"[",
"]",
"src",
")",
"{",
"final",
"ByteBuffer",
"sddlBuffer",
"=",
"ByteBuffer",
".",
"wrap",
"(",
"src",
")",
";",
"final",
"SID",
"sid",
"=",
"new",
"SID",
"(",
")",
";",
"sid",
".",
"pa... | Instances a SID instance of the given byte array.
@param src SID as byte array.
@return SID instance. | [
"Instances",
"a",
"SID",
"instance",
"of",
"the",
"given",
"byte",
"array",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/SID.java#L102-L107 |
10,558 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/SID.java | SID.parse | int parse(final IntBuffer buff, final int start) {
int pos = start;
// Check for a SID (http://msdn.microsoft.com/en-us/library/cc230371.aspx)
final byte[] sidHeader = NumberFacility.getBytes(buff.get(pos));
// Revision(1 byte): An 8-bit unsigned integer that specifies the revision lev... | java | int parse(final IntBuffer buff, final int start) {
int pos = start;
// Check for a SID (http://msdn.microsoft.com/en-us/library/cc230371.aspx)
final byte[] sidHeader = NumberFacility.getBytes(buff.get(pos));
// Revision(1 byte): An 8-bit unsigned integer that specifies the revision lev... | [
"int",
"parse",
"(",
"final",
"IntBuffer",
"buff",
",",
"final",
"int",
"start",
")",
"{",
"int",
"pos",
"=",
"start",
";",
"// Check for a SID (http://msdn.microsoft.com/en-us/library/cc230371.aspx)",
"final",
"byte",
"[",
"]",
"sidHeader",
"=",
"NumberFacility",
"... | Load the SID from the buffer returning the last SID segment position into the buffer.
@param buff source buffer.
@param start start loading position.
@return last loading position. | [
"Load",
"the",
"SID",
"from",
"the",
"buffer",
"returning",
"the",
"last",
"SID",
"segment",
"position",
"into",
"the",
"buffer",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/SID.java#L116-L149 |
10,559 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/utils/SDDLHelper.java | SDDLHelper.isUserCannotChangePassword | public static boolean isUserCannotChangePassword(final SDDL sddl) {
boolean res = false;
final List<ACE> aces = sddl.getDacl().getAces();
for (int i = 0; !res && i < aces.size(); i++) {
final ACE ace = aces.get(i);
if (ace.getType() == AceType.ACCESS_DENIED_OBJECT_ACE_T... | java | public static boolean isUserCannotChangePassword(final SDDL sddl) {
boolean res = false;
final List<ACE> aces = sddl.getDacl().getAces();
for (int i = 0; !res && i < aces.size(); i++) {
final ACE ace = aces.get(i);
if (ace.getType() == AceType.ACCESS_DENIED_OBJECT_ACE_T... | [
"public",
"static",
"boolean",
"isUserCannotChangePassword",
"(",
"final",
"SDDL",
"sddl",
")",
"{",
"boolean",
"res",
"=",
"false",
";",
"final",
"List",
"<",
"ACE",
">",
"aces",
"=",
"sddl",
".",
"getDacl",
"(",
")",
".",
"getAces",
"(",
")",
";",
"f... | Check if user canot change password.
@param sddl SSDL.
@return <tt>true</tt> if user cannot change password: <tt>false</tt> otherwise. | [
"Check",
"if",
"user",
"canot",
"change",
"password",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/utils/SDDLHelper.java#L44-L73 |
10,560 | gitblit/fathom | fathom-rest-security/src/main/java/fathom/rest/security/StandardCredentialsHandler.java | StandardCredentialsHandler.isAuthenticated | protected final boolean isAuthenticated(Context context) {
Account account = context.getSession(AuthConstants.ACCOUNT_ATTRIBUTE);
if (account == null) {
account = context.getLocal(AuthConstants.ACCOUNT_ATTRIBUTE);
}
return account != null && account.isAuthenticated();
} | java | protected final boolean isAuthenticated(Context context) {
Account account = context.getSession(AuthConstants.ACCOUNT_ATTRIBUTE);
if (account == null) {
account = context.getLocal(AuthConstants.ACCOUNT_ATTRIBUTE);
}
return account != null && account.isAuthenticated();
} | [
"protected",
"final",
"boolean",
"isAuthenticated",
"(",
"Context",
"context",
")",
"{",
"Account",
"account",
"=",
"context",
".",
"getSession",
"(",
"AuthConstants",
".",
"ACCOUNT_ATTRIBUTE",
")",
";",
"if",
"(",
"account",
"==",
"null",
")",
"{",
"account",... | Determines if the current Context has already been authenticated.
@param context
@return true if this Context is authenticated. | [
"Determines",
"if",
"the",
"current",
"Context",
"has",
"already",
"been",
"authenticated",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest-security/src/main/java/fathom/rest/security/StandardCredentialsHandler.java#L44-L50 |
10,561 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/controls/DirSyncControl.java | DirSyncControl.berEncodedValue | private byte[] berEncodedValue() {
final byte[] cookieSize = NumberFacility.leftTrim(NumberFacility.getBytes(cookie.length));
final byte[] size = NumberFacility.leftTrim(NumberFacility.getBytes(14 + cookieSize.length + cookie.length));
final ByteBuffer buff = ByteBuffer.allocate(1 + 1 + size.le... | java | private byte[] berEncodedValue() {
final byte[] cookieSize = NumberFacility.leftTrim(NumberFacility.getBytes(cookie.length));
final byte[] size = NumberFacility.leftTrim(NumberFacility.getBytes(14 + cookieSize.length + cookie.length));
final ByteBuffer buff = ByteBuffer.allocate(1 + 1 + size.le... | [
"private",
"byte",
"[",
"]",
"berEncodedValue",
"(",
")",
"{",
"final",
"byte",
"[",
"]",
"cookieSize",
"=",
"NumberFacility",
".",
"leftTrim",
"(",
"NumberFacility",
".",
"getBytes",
"(",
"cookie",
".",
"length",
")",
")",
";",
"final",
"byte",
"[",
"]"... | BER encode the cookie value.
@param cookie cookie value to be encoded.
@return ber encoded cookie value. | [
"BER",
"encode",
"the",
"cookie",
"value",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/controls/DirSyncControl.java#L86-L108 |
10,562 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/SDDL.java | SDDL.parse | private int parse(final IntBuffer buff, final int start) {
int pos = start;
/**
* Revision (1 byte): An unsigned 8-bit value that specifies the revision of the SECURITY_DESCRIPTOR
* structure. This field MUST be set to one.
*/
final byte[] header = NumberFacility.getB... | java | private int parse(final IntBuffer buff, final int start) {
int pos = start;
/**
* Revision (1 byte): An unsigned 8-bit value that specifies the revision of the SECURITY_DESCRIPTOR
* structure. This field MUST be set to one.
*/
final byte[] header = NumberFacility.getB... | [
"private",
"int",
"parse",
"(",
"final",
"IntBuffer",
"buff",
",",
"final",
"int",
"start",
")",
"{",
"int",
"pos",
"=",
"start",
";",
"/**\n * Revision (1 byte): An unsigned 8-bit value that specifies the revision of the SECURITY_DESCRIPTOR\n * structure. This fi... | Load the SDDL from the buffer returning the last SDDL segment position into the buffer.
@param buff source buffer.
@param start start loading position.
@return last loading position. | [
"Load",
"the",
"SDDL",
"from",
"the",
"buffer",
"returning",
"the",
"last",
"SDDL",
"segment",
"position",
"into",
"the",
"buffer",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/SDDL.java#L144-L259 |
10,563 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/SDDL.java | SDDL.getSize | public int getSize() {
return 20 + (sacl == null ? 0 : sacl.getSize())
+ (dacl == null ? 0 : dacl.getSize())
+ (owner == null ? 0 : owner.getSize())
+ (group == null ? 0 : group.getSize());
} | java | public int getSize() {
return 20 + (sacl == null ? 0 : sacl.getSize())
+ (dacl == null ? 0 : dacl.getSize())
+ (owner == null ? 0 : owner.getSize())
+ (group == null ? 0 : group.getSize());
} | [
"public",
"int",
"getSize",
"(",
")",
"{",
"return",
"20",
"+",
"(",
"sacl",
"==",
"null",
"?",
"0",
":",
"sacl",
".",
"getSize",
"(",
")",
")",
"+",
"(",
"dacl",
"==",
"null",
"?",
"0",
":",
"dacl",
".",
"getSize",
"(",
")",
")",
"+",
"(",
... | Gets size in terms of number of bytes.
@return size. | [
"Gets",
"size",
"in",
"terms",
"of",
"number",
"of",
"bytes",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/SDDL.java#L266-L271 |
10,564 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/SDDL.java | SDDL.toByteArray | public byte[] toByteArray() {
final ByteBuffer buff = ByteBuffer.allocate(getSize());
// add revision
buff.put(revision);
// add reserved
buff.put((byte) 0x00);
// add contro flags
buff.put(controlFlags[1]);
buff.put(controlFlags[0]);
// add of... | java | public byte[] toByteArray() {
final ByteBuffer buff = ByteBuffer.allocate(getSize());
// add revision
buff.put(revision);
// add reserved
buff.put((byte) 0x00);
// add contro flags
buff.put(controlFlags[1]);
buff.put(controlFlags[0]);
// add of... | [
"public",
"byte",
"[",
"]",
"toByteArray",
"(",
")",
"{",
"final",
"ByteBuffer",
"buff",
"=",
"ByteBuffer",
".",
"allocate",
"(",
"getSize",
"(",
")",
")",
";",
"// add revision",
"buff",
".",
"put",
"(",
"revision",
")",
";",
"// add reserved",
"buff",
... | Serializes SDDL as byte array.
@return SDL as byte array. | [
"Serializes",
"SDDL",
"as",
"byte",
"array",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/SDDL.java#L332-L398 |
10,565 | gitblit/fathom | fathom-security-ldap/src/main/java/fathom/realm/ldap/LdapRealm.java | LdapRealm.setAdminAttribute | private void setAdminAttribute(Account account) {
if (adminGroups != null) {
for (String adminGroup : adminGroups) {
if (adminGroup.startsWith("@") && account.getUsername().equalsIgnoreCase(adminGroup.substring(1))) {
// admin user
account.getA... | java | private void setAdminAttribute(Account account) {
if (adminGroups != null) {
for (String adminGroup : adminGroups) {
if (adminGroup.startsWith("@") && account.getUsername().equalsIgnoreCase(adminGroup.substring(1))) {
// admin user
account.getA... | [
"private",
"void",
"setAdminAttribute",
"(",
"Account",
"account",
")",
"{",
"if",
"(",
"adminGroups",
"!=",
"null",
")",
"{",
"for",
"(",
"String",
"adminGroup",
":",
"adminGroups",
")",
"{",
"if",
"(",
"adminGroup",
".",
"startsWith",
"(",
"\"@\"",
")",
... | Set the admin attribute from group memberships retrieved from LDAP.
@param account | [
"Set",
"the",
"admin",
"attribute",
"from",
"group",
"memberships",
"retrieved",
"from",
"LDAP",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-security-ldap/src/main/java/fathom/realm/ldap/LdapRealm.java#L433-L445 |
10,566 | gitblit/fathom | fathom-rest/src/main/java/fathom/rest/route/CORSFilter.java | CORSFilter.setAllowOrigin | public void setAllowOrigin(String... origin) {
allowOriginSet.clear();
allowOriginSet.addAll(Arrays.asList(origin));
allowOrigin = Joiner.on(",").join(origin);
} | java | public void setAllowOrigin(String... origin) {
allowOriginSet.clear();
allowOriginSet.addAll(Arrays.asList(origin));
allowOrigin = Joiner.on(",").join(origin);
} | [
"public",
"void",
"setAllowOrigin",
"(",
"String",
"...",
"origin",
")",
"{",
"allowOriginSet",
".",
"clear",
"(",
")",
";",
"allowOriginSet",
".",
"addAll",
"(",
"Arrays",
".",
"asList",
"(",
"origin",
")",
")",
";",
"allowOrigin",
"=",
"Joiner",
".",
"... | Set the list of request origins that are permitted to access the protected routes.
Multiple origins may be specified and they must be complete scheme, domain, & port
specifications. Alternatively, you can specify the wildcard origin "*" to accept
from all origins.
setAllowOrigin("*");
setAllowOrigin("http://mydomain... | [
"Set",
"the",
"list",
"of",
"request",
"origins",
"that",
"are",
"permitted",
"to",
"access",
"the",
"protected",
"routes",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest/src/main/java/fathom/rest/route/CORSFilter.java#L110-L114 |
10,567 | gitblit/fathom | fathom-rest/src/main/java/fathom/rest/route/CORSFilter.java | CORSFilter.setAllowMethods | public void setAllowMethods(String... methods) {
allowMethodsSet.clear();
for (String method : methods) {
allowMethodsSet.add(method.toUpperCase());
}
allowMethods = Joiner.on(",").join(allowMethodsSet);
} | java | public void setAllowMethods(String... methods) {
allowMethodsSet.clear();
for (String method : methods) {
allowMethodsSet.add(method.toUpperCase());
}
allowMethods = Joiner.on(",").join(allowMethodsSet);
} | [
"public",
"void",
"setAllowMethods",
"(",
"String",
"...",
"methods",
")",
"{",
"allowMethodsSet",
".",
"clear",
"(",
")",
";",
"for",
"(",
"String",
"method",
":",
"methods",
")",
"{",
"allowMethodsSet",
".",
"add",
"(",
"method",
".",
"toUpperCase",
"(",... | Set the list of request methods that may be sent by the browser for a CORS request.
setAllowMethods("GET", "PUT", "PATCH");
@param methods | [
"Set",
"the",
"list",
"of",
"request",
"methods",
"that",
"may",
"be",
"sent",
"by",
"the",
"browser",
"for",
"a",
"CORS",
"request",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest/src/main/java/fathom/rest/route/CORSFilter.java#L123-L129 |
10,568 | gitblit/fathom | fathom-rest/src/main/java/fathom/rest/route/CORSFilter.java | CORSFilter.setAllowHeaders | public void setAllowHeaders(String... headers) {
allowHeadersSet.clear();
for (String header : headers) {
allowHeadersSet.add(header.toLowerCase());
}
allowHeaders = Joiner.on(",").join(headers);
} | java | public void setAllowHeaders(String... headers) {
allowHeadersSet.clear();
for (String header : headers) {
allowHeadersSet.add(header.toLowerCase());
}
allowHeaders = Joiner.on(",").join(headers);
} | [
"public",
"void",
"setAllowHeaders",
"(",
"String",
"...",
"headers",
")",
"{",
"allowHeadersSet",
".",
"clear",
"(",
")",
";",
"for",
"(",
"String",
"header",
":",
"headers",
")",
"{",
"allowHeadersSet",
".",
"add",
"(",
"header",
".",
"toLowerCase",
"(",... | Set the list of headers that may be sent by the browser for a CORS request.
setAllowHeaders("Content-Type", "api_key", "Csrf-Token");
@param headers | [
"Set",
"the",
"list",
"of",
"headers",
"that",
"may",
"be",
"sent",
"by",
"the",
"browser",
"for",
"a",
"CORS",
"request",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest/src/main/java/fathom/rest/route/CORSFilter.java#L138-L144 |
10,569 | gitblit/fathom | fathom-rest/src/main/java/fathom/rest/controller/ControllerScanner.java | ControllerScanner.sortMethods | protected Collection<Method> sortMethods(Collection<Method> methods) {
List<Method> list = new ArrayList<>(methods);
Collections.sort(list, (m1, m2) -> {
int o1 = Integer.MAX_VALUE;
Order order1 = ClassUtil.getAnnotation(m1, Order.class);
if (order1 != null) {
... | java | protected Collection<Method> sortMethods(Collection<Method> methods) {
List<Method> list = new ArrayList<>(methods);
Collections.sort(list, (m1, m2) -> {
int o1 = Integer.MAX_VALUE;
Order order1 = ClassUtil.getAnnotation(m1, Order.class);
if (order1 != null) {
... | [
"protected",
"Collection",
"<",
"Method",
">",
"sortMethods",
"(",
"Collection",
"<",
"Method",
">",
"methods",
")",
"{",
"List",
"<",
"Method",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
"methods",
")",
";",
"Collections",
".",
"sort",
"(",
"list"... | Sort the methods by their preferred order, if specified.
@param methods
@return a sorted list of methods | [
"Sort",
"the",
"methods",
"by",
"their",
"preferred",
"order",
"if",
"specified",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest/src/main/java/fathom/rest/controller/ControllerScanner.java#L104-L134 |
10,570 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/utils/NumberFacility.java | NumberFacility.leftTrim | @SuppressWarnings("empty-statement")
public static byte[] leftTrim(final byte... bytes) {
int pos = 0;
for (; pos < bytes.length && bytes[pos] == 0x00; pos++);
if (pos < bytes.length) {
return Arrays.copyOfRange(bytes, pos, bytes.length);
} else {
return new ... | java | @SuppressWarnings("empty-statement")
public static byte[] leftTrim(final byte... bytes) {
int pos = 0;
for (; pos < bytes.length && bytes[pos] == 0x00; pos++);
if (pos < bytes.length) {
return Arrays.copyOfRange(bytes, pos, bytes.length);
} else {
return new ... | [
"@",
"SuppressWarnings",
"(",
"\"empty-statement\"",
")",
"public",
"static",
"byte",
"[",
"]",
"leftTrim",
"(",
"final",
"byte",
"...",
"bytes",
")",
"{",
"int",
"pos",
"=",
"0",
";",
"for",
"(",
";",
"pos",
"<",
"bytes",
".",
"length",
"&&",
"bytes",... | Remove 0x00 bytes from left side.
@param bytes source array.
@return trimmed array. | [
"Remove",
"0x00",
"bytes",
"from",
"left",
"side",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/utils/NumberFacility.java#L64-L74 |
10,571 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/utils/NumberFacility.java | NumberFacility.getBits | public static boolean[] getBits(final byte... bytes) {
if (bytes.length > 4) {
throw new InvalidParameterException("Invalid number of bytes");
}
final boolean[] res = new boolean[bytes.length * 8];
int pos = 0;
for (byte b : bytes) {
for (boolean bool :... | java | public static boolean[] getBits(final byte... bytes) {
if (bytes.length > 4) {
throw new InvalidParameterException("Invalid number of bytes");
}
final boolean[] res = new boolean[bytes.length * 8];
int pos = 0;
for (byte b : bytes) {
for (boolean bool :... | [
"public",
"static",
"boolean",
"[",
"]",
"getBits",
"(",
"final",
"byte",
"...",
"bytes",
")",
"{",
"if",
"(",
"bytes",
".",
"length",
">",
"4",
")",
"{",
"throw",
"new",
"InvalidParameterException",
"(",
"\"Invalid number of bytes\"",
")",
";",
"}",
"fina... | Gets bits as boolean array from a given byte array.
@param bytes bytes.
@return bits. | [
"Gets",
"bits",
"as",
"boolean",
"array",
"from",
"a",
"given",
"byte",
"array",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/utils/NumberFacility.java#L92-L109 |
10,572 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/utils/NumberFacility.java | NumberFacility.getBits | public static boolean[] getBits(final byte b) {
final boolean[] res = new boolean[8];
for (int i = 0; i < 8; i++) {
res[7 - i] = (b & (1 << i)) != 0;
}
return res;
} | java | public static boolean[] getBits(final byte b) {
final boolean[] res = new boolean[8];
for (int i = 0; i < 8; i++) {
res[7 - i] = (b & (1 << i)) != 0;
}
return res;
} | [
"public",
"static",
"boolean",
"[",
"]",
"getBits",
"(",
"final",
"byte",
"b",
")",
"{",
"final",
"boolean",
"[",
"]",
"res",
"=",
"new",
"boolean",
"[",
"8",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"8",
";",
"i",
"++",
")"... | Gets bits as boolean array from a given byte.
@param b byte.
@return bits. | [
"Gets",
"bits",
"as",
"boolean",
"array",
"from",
"a",
"given",
"byte",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/utils/NumberFacility.java#L117-L123 |
10,573 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/utils/NumberFacility.java | NumberFacility.getUInt | public static long getUInt(final byte... bytes) {
if (bytes.length > 4) {
throw new InvalidParameterException("Invalid number of bytes");
}
long res = 0;
for (int i = 0; i < bytes.length; i++) {
res |= bytes[i] & 0xFF;
if (i < bytes.length - 1) {
... | java | public static long getUInt(final byte... bytes) {
if (bytes.length > 4) {
throw new InvalidParameterException("Invalid number of bytes");
}
long res = 0;
for (int i = 0; i < bytes.length; i++) {
res |= bytes[i] & 0xFF;
if (i < bytes.length - 1) {
... | [
"public",
"static",
"long",
"getUInt",
"(",
"final",
"byte",
"...",
"bytes",
")",
"{",
"if",
"(",
"bytes",
".",
"length",
">",
"4",
")",
"{",
"throw",
"new",
"InvalidParameterException",
"(",
"\"Invalid number of bytes\"",
")",
";",
"}",
"long",
"res",
"="... | Gets unsigned integer value corresponding to the given bytes.
@param bytes bytes.
@return unsigned integer. | [
"Gets",
"unsigned",
"integer",
"value",
"corresponding",
"to",
"the",
"given",
"bytes",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/utils/NumberFacility.java#L183-L197 |
10,574 | gitblit/fathom | fathom-security-jdbc/src/main/java/fathom/realm/jdbc/JdbcRealm.java | JdbcRealm.toSet | private Set<String> toSet(String value, String delimiter) {
if (Strings.isNullOrEmpty(value)) {
return Collections.emptySet();
} else {
Set<String> stringSet = new LinkedHashSet<>();
String[] values = value.split(delimiter);
for (String stringValue : value... | java | private Set<String> toSet(String value, String delimiter) {
if (Strings.isNullOrEmpty(value)) {
return Collections.emptySet();
} else {
Set<String> stringSet = new LinkedHashSet<>();
String[] values = value.split(delimiter);
for (String stringValue : value... | [
"private",
"Set",
"<",
"String",
">",
"toSet",
"(",
"String",
"value",
",",
"String",
"delimiter",
")",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"value",
")",
")",
"{",
"return",
"Collections",
".",
"emptySet",
"(",
")",
";",
"}",
"else",
... | Creates an ordered set from a comma or semi-colon delimited string.
Empty values are discarded.
@param value
@return a set of strings | [
"Creates",
"an",
"ordered",
"set",
"from",
"a",
"comma",
"or",
"semi",
"-",
"colon",
"delimited",
"string",
".",
"Empty",
"values",
"are",
"discarded",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-security-jdbc/src/main/java/fathom/realm/jdbc/JdbcRealm.java#L558-L572 |
10,575 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/ACL.java | ACL.parse | int parse(final IntBuffer buff, final int start) {
int pos = start;
// read for Dacl
byte[] bytes = NumberFacility.getBytes(buff.get(pos));
revision = AclRevision.parseValue(bytes[0]);
pos++;
bytes = NumberFacility.getBytes(buff.get(pos));
final int aceCount = Nu... | java | int parse(final IntBuffer buff, final int start) {
int pos = start;
// read for Dacl
byte[] bytes = NumberFacility.getBytes(buff.get(pos));
revision = AclRevision.parseValue(bytes[0]);
pos++;
bytes = NumberFacility.getBytes(buff.get(pos));
final int aceCount = Nu... | [
"int",
"parse",
"(",
"final",
"IntBuffer",
"buff",
",",
"final",
"int",
"start",
")",
"{",
"int",
"pos",
"=",
"start",
";",
"// read for Dacl",
"byte",
"[",
"]",
"bytes",
"=",
"NumberFacility",
".",
"getBytes",
"(",
"buff",
".",
"get",
"(",
"pos",
")",... | Load the ACL from the buffer returning the last ACL segment position into the buffer.
@param buff source buffer.
@param start start loading position.
@return last loading position. | [
"Load",
"the",
"ACL",
"from",
"the",
"buffer",
"returning",
"the",
"last",
"ACL",
"segment",
"position",
"into",
"the",
"buffer",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/ACL.java#L90-L110 |
10,576 | gitblit/fathom | fathom-core/src/main/java/fathom/utils/RequireUtil.java | RequireUtil.allowInstance | public static boolean allowInstance(Settings settings, Object object) {
Preconditions.checkNotNull(object, "Can not check runtime permissions on a null instance!");
if (object instanceof Method) {
return allowMethod(settings, (Method) object);
}
return allowClass(settings,... | java | public static boolean allowInstance(Settings settings, Object object) {
Preconditions.checkNotNull(object, "Can not check runtime permissions on a null instance!");
if (object instanceof Method) {
return allowMethod(settings, (Method) object);
}
return allowClass(settings,... | [
"public",
"static",
"boolean",
"allowInstance",
"(",
"Settings",
"settings",
",",
"Object",
"object",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"object",
",",
"\"Can not check runtime permissions on a null instance!\"",
")",
";",
"if",
"(",
"object",
"insta... | Determines if this object may be used in the current runtime environment.
Fathom settings are considered as well as runtime modes.
@param settings
@param object
@return true if the object may be used | [
"Determines",
"if",
"this",
"object",
"may",
"be",
"used",
"in",
"the",
"current",
"runtime",
"environment",
".",
"Fathom",
"settings",
"are",
"considered",
"as",
"well",
"as",
"runtime",
"modes",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-core/src/main/java/fathom/utils/RequireUtil.java#L55-L64 |
10,577 | gitblit/fathom | fathom-core/src/main/java/fathom/utils/RequireUtil.java | RequireUtil.allowClass | public static boolean allowClass(Settings settings, Class<?> aClass) {
// Settings-based class exclusions/inclusions
if (aClass.isAnnotationPresent(RequireSettings.class)) {
// multiple keys required
RequireSetting[] requireSettings = aClass.getAnnotation(RequireSettings.class).v... | java | public static boolean allowClass(Settings settings, Class<?> aClass) {
// Settings-based class exclusions/inclusions
if (aClass.isAnnotationPresent(RequireSettings.class)) {
// multiple keys required
RequireSetting[] requireSettings = aClass.getAnnotation(RequireSettings.class).v... | [
"public",
"static",
"boolean",
"allowClass",
"(",
"Settings",
"settings",
",",
"Class",
"<",
"?",
">",
"aClass",
")",
"{",
"// Settings-based class exclusions/inclusions",
"if",
"(",
"aClass",
".",
"isAnnotationPresent",
"(",
"RequireSettings",
".",
"class",
")",
... | Determines if this class may be used in the current runtime environment.
Fathom settings are considered as well as runtime modes.
@param settings
@param aClass
@return true if the class may be used | [
"Determines",
"if",
"this",
"class",
"may",
"be",
"used",
"in",
"the",
"current",
"runtime",
"environment",
".",
"Fathom",
"settings",
"are",
"considered",
"as",
"well",
"as",
"runtime",
"modes",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-core/src/main/java/fathom/utils/RequireUtil.java#L74-L93 |
10,578 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/utils/GUID.java | GUID.getGuidAsString | public static String getGuidAsString(byte[] GUID) {
final StringBuilder res = new StringBuilder();
res.append(AddLeadingZero((int) GUID[3] & 0xFF));
res.append(AddLeadingZero((int) GUID[2] & 0xFF));
res.append(AddLeadingZero((int) GUID[1] & 0xFF));
res.append(AddLeadingZero((int... | java | public static String getGuidAsString(byte[] GUID) {
final StringBuilder res = new StringBuilder();
res.append(AddLeadingZero((int) GUID[3] & 0xFF));
res.append(AddLeadingZero((int) GUID[2] & 0xFF));
res.append(AddLeadingZero((int) GUID[1] & 0xFF));
res.append(AddLeadingZero((int... | [
"public",
"static",
"String",
"getGuidAsString",
"(",
"byte",
"[",
"]",
"GUID",
")",
"{",
"final",
"StringBuilder",
"res",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"res",
".",
"append",
"(",
"AddLeadingZero",
"(",
"(",
"int",
")",
"GUID",
"[",
"3",
... | Gets GUID as string.
@param GUID GUID.
@return GUID as string. | [
"Gets",
"GUID",
"as",
"string",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/utils/GUID.java#L36-L62 |
10,579 | Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/utils/GUID.java | GUID.getGuidAsByteArray | public static byte[] getGuidAsByteArray(final String GUID) {
final UUID uuid = UUID.fromString(GUID);
final ByteBuffer buff = ByteBuffer.wrap(new byte[16]);
buff.putLong(uuid.getMostSignificantBits());
buff.putLong(uuid.getLeastSignificantBits());
byte[] res = new byte[] {
... | java | public static byte[] getGuidAsByteArray(final String GUID) {
final UUID uuid = UUID.fromString(GUID);
final ByteBuffer buff = ByteBuffer.wrap(new byte[16]);
buff.putLong(uuid.getMostSignificantBits());
buff.putLong(uuid.getLeastSignificantBits());
byte[] res = new byte[] {
... | [
"public",
"static",
"byte",
"[",
"]",
"getGuidAsByteArray",
"(",
"final",
"String",
"GUID",
")",
"{",
"final",
"UUID",
"uuid",
"=",
"UUID",
".",
"fromString",
"(",
"GUID",
")",
";",
"final",
"ByteBuffer",
"buff",
"=",
"ByteBuffer",
".",
"wrap",
"(",
"new... | Gets GUID as byte array.
@param GUID GUID.
@return GUID as byte array. | [
"Gets",
"GUID",
"as",
"byte",
"array",
"."
] | 16dad53e1222c7faa904c64394af94ba18f6d09c | https://github.com/Tirasa/ADSDDL/blob/16dad53e1222c7faa904c64394af94ba18f6d09c/src/main/java/net/tirasa/adsddl/ntsd/utils/GUID.java#L70-L96 |
10,580 | gitblit/fathom | fathom-security/src/main/java/fathom/authz/Authorizations.java | Authorizations.setRoles | public Authorizations setRoles(Set<Role> roles) {
this.roles.clear();
this.aggregatePermissions = null;
addRoles(roles);
return this;
} | java | public Authorizations setRoles(Set<Role> roles) {
this.roles.clear();
this.aggregatePermissions = null;
addRoles(roles);
return this;
} | [
"public",
"Authorizations",
"setRoles",
"(",
"Set",
"<",
"Role",
">",
"roles",
")",
"{",
"this",
".",
"roles",
".",
"clear",
"(",
")",
";",
"this",
".",
"aggregatePermissions",
"=",
"null",
";",
"addRoles",
"(",
"roles",
")",
";",
"return",
"this",
";"... | Sets the roles assigned to the Account.
@param roles the roles assigned to the Account. | [
"Sets",
"the",
"roles",
"assigned",
"to",
"the",
"Account",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-security/src/main/java/fathom/authz/Authorizations.java#L92-L98 |
10,581 | gitblit/fathom | fathom-security/src/main/java/fathom/authz/Authorizations.java | Authorizations.addRoles | public Authorizations addRoles(String... roles) {
for (String role : roles) {
addRole(new Role(role));
}
return this;
} | java | public Authorizations addRoles(String... roles) {
for (String role : roles) {
addRole(new Role(role));
}
return this;
} | [
"public",
"Authorizations",
"addRoles",
"(",
"String",
"...",
"roles",
")",
"{",
"for",
"(",
"String",
"role",
":",
"roles",
")",
"{",
"addRole",
"(",
"new",
"Role",
"(",
"role",
")",
")",
";",
"}",
"return",
"this",
";",
"}"
] | Adds roles to the Account Authorizations.
@param roles the roles to add. | [
"Adds",
"roles",
"to",
"the",
"Account",
"Authorizations",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-security/src/main/java/fathom/authz/Authorizations.java#L105-L111 |
10,582 | gitblit/fathom | fathom-security/src/main/java/fathom/authz/Authorizations.java | Authorizations.getAggregatePermissions | public Collection<Permission> getAggregatePermissions() {
if (aggregatePermissions == null) {
Set<Permission> perms = new LinkedHashSet<>();
perms.addAll(permissions);
for (Role role : roles) {
perms.addAll(role.getPermissions());
}
if... | java | public Collection<Permission> getAggregatePermissions() {
if (aggregatePermissions == null) {
Set<Permission> perms = new LinkedHashSet<>();
perms.addAll(permissions);
for (Role role : roles) {
perms.addAll(role.getPermissions());
}
if... | [
"public",
"Collection",
"<",
"Permission",
">",
"getAggregatePermissions",
"(",
")",
"{",
"if",
"(",
"aggregatePermissions",
"==",
"null",
")",
"{",
"Set",
"<",
"Permission",
">",
"perms",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"perms",
".",
"ad... | Gets the collection of permissions including the role permissions and discrete permissions.
@return a collection of aggregate permissions | [
"Gets",
"the",
"collection",
"of",
"permissions",
"including",
"the",
"role",
"permissions",
"and",
"discrete",
"permissions",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-security/src/main/java/fathom/authz/Authorizations.java#L337-L353 |
10,583 | gitblit/fathom | fathom-rest/src/main/java/fathom/rest/controller/ControllerHandler.java | ControllerHandler.findMethod | protected Method findMethod(Class<?> controllerClass, String name) {
// identify first method which matches the name
Method controllerMethod = null;
for (Method method : controllerClass.getMethods()) {
if (method.getName().equals(name)) {
if (controllerMethod == null)... | java | protected Method findMethod(Class<?> controllerClass, String name) {
// identify first method which matches the name
Method controllerMethod = null;
for (Method method : controllerClass.getMethods()) {
if (method.getName().equals(name)) {
if (controllerMethod == null)... | [
"protected",
"Method",
"findMethod",
"(",
"Class",
"<",
"?",
">",
"controllerClass",
",",
"String",
"name",
")",
"{",
"// identify first method which matches the name",
"Method",
"controllerMethod",
"=",
"null",
";",
"for",
"(",
"Method",
"method",
":",
"controllerC... | Finds the named controller method.
@param controllerClass
@param name
@return the controller method or null | [
"Finds",
"the",
"named",
"controller",
"method",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest/src/main/java/fathom/rest/controller/ControllerHandler.java#L275-L290 |
10,584 | gitblit/fathom | fathom-rest/src/main/java/fathom/rest/controller/ControllerHandler.java | ControllerHandler.configureContentTypeSuffixes | protected Set<String> configureContentTypeSuffixes(ContentTypeEngines engines) {
if (null == ClassUtil.getAnnotation(method, ContentTypeBySuffix.class)) {
return Collections.emptySet();
}
Set<String> suffixes = new TreeSet<>();
for (String suffix : engines.getContentTypeSuff... | java | protected Set<String> configureContentTypeSuffixes(ContentTypeEngines engines) {
if (null == ClassUtil.getAnnotation(method, ContentTypeBySuffix.class)) {
return Collections.emptySet();
}
Set<String> suffixes = new TreeSet<>();
for (String suffix : engines.getContentTypeSuff... | [
"protected",
"Set",
"<",
"String",
">",
"configureContentTypeSuffixes",
"(",
"ContentTypeEngines",
"engines",
")",
"{",
"if",
"(",
"null",
"==",
"ClassUtil",
".",
"getAnnotation",
"(",
"method",
",",
"ContentTypeBySuffix",
".",
"class",
")",
")",
"{",
"return",
... | Configures the content-type suffixes
@param engines
@return acceptable content-type suffixes | [
"Configures",
"the",
"content",
"-",
"type",
"suffixes"
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest/src/main/java/fathom/rest/controller/ControllerHandler.java#L298-L311 |
10,585 | gitblit/fathom | fathom-rest/src/main/java/fathom/rest/controller/ControllerHandler.java | ControllerHandler.configureMethodArgs | protected void configureMethodArgs(Injector injector) {
Class<?>[] types = method.getParameterTypes();
extractors = new ArgumentExtractor[types.length];
patterns = new String[types.length];
for (int i = 0; i < types.length; i++) {
final Parameter parameter = method.getParame... | java | protected void configureMethodArgs(Injector injector) {
Class<?>[] types = method.getParameterTypes();
extractors = new ArgumentExtractor[types.length];
patterns = new String[types.length];
for (int i = 0; i < types.length; i++) {
final Parameter parameter = method.getParame... | [
"protected",
"void",
"configureMethodArgs",
"(",
"Injector",
"injector",
")",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"types",
"=",
"method",
".",
"getParameterTypes",
"(",
")",
";",
"extractors",
"=",
"new",
"ArgumentExtractor",
"[",
"types",
".",
"length",
... | Configures the controller method arguments.
@param injector | [
"Configures",
"the",
"controller",
"method",
"arguments",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest/src/main/java/fathom/rest/controller/ControllerHandler.java#L318-L394 |
10,586 | gitblit/fathom | fathom-rest/src/main/java/fathom/rest/controller/ControllerHandler.java | ControllerHandler.validateMethodArgs | public void validateMethodArgs(String uriPattern) {
Set<String> namedParameters = new LinkedHashSet<>();
for (ArgumentExtractor extractor : extractors) {
if (extractor instanceof NamedExtractor) {
NamedExtractor namedExtractor = (NamedExtractor) extractor;
nam... | java | public void validateMethodArgs(String uriPattern) {
Set<String> namedParameters = new LinkedHashSet<>();
for (ArgumentExtractor extractor : extractors) {
if (extractor instanceof NamedExtractor) {
NamedExtractor namedExtractor = (NamedExtractor) extractor;
nam... | [
"public",
"void",
"validateMethodArgs",
"(",
"String",
"uriPattern",
")",
"{",
"Set",
"<",
"String",
">",
"namedParameters",
"=",
"new",
"LinkedHashSet",
"<>",
"(",
")",
";",
"for",
"(",
"ArgumentExtractor",
"extractor",
":",
"extractors",
")",
"{",
"if",
"(... | Validate that the parameters specified in the uri pattern are declared in the method signature.
@param uriPattern
@throws FatalException if the controller method does not declare all named uri parameters | [
"Validate",
"that",
"the",
"parameters",
"specified",
"in",
"the",
"uri",
"pattern",
"are",
"declared",
"in",
"the",
"method",
"signature",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest/src/main/java/fathom/rest/controller/ControllerHandler.java#L402-L417 |
10,587 | gitblit/fathom | fathom-rest/src/main/java/fathom/rest/controller/ControllerHandler.java | ControllerHandler.validateConsumes | protected void validateConsumes(Collection<String> fathomContentTypes) {
Set<String> ignoreConsumes = new TreeSet<>();
ignoreConsumes.add(Consumes.ALL);
// these are handled by the TemplateEngine
ignoreConsumes.add(Consumes.HTML);
ignoreConsumes.add(Consumes.XHTML);
// ... | java | protected void validateConsumes(Collection<String> fathomContentTypes) {
Set<String> ignoreConsumes = new TreeSet<>();
ignoreConsumes.add(Consumes.ALL);
// these are handled by the TemplateEngine
ignoreConsumes.add(Consumes.HTML);
ignoreConsumes.add(Consumes.XHTML);
// ... | [
"protected",
"void",
"validateConsumes",
"(",
"Collection",
"<",
"String",
">",
"fathomContentTypes",
")",
"{",
"Set",
"<",
"String",
">",
"ignoreConsumes",
"=",
"new",
"TreeSet",
"<>",
"(",
")",
";",
"ignoreConsumes",
".",
"add",
"(",
"Consumes",
".",
"ALL"... | Validates that the declared consumes can actually be processed by Fathom.
@param fathomContentTypes | [
"Validates",
"that",
"the",
"declared",
"consumes",
"can",
"actually",
"be",
"processed",
"by",
"Fathom",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest/src/main/java/fathom/rest/controller/ControllerHandler.java#L448-L482 |
10,588 | gitblit/fathom | fathom-rest/src/main/java/fathom/rest/controller/ControllerHandler.java | ControllerHandler.validateProduces | protected void validateProduces(Collection<String> fathomContentTypes) {
Set<String> ignoreProduces = new TreeSet<>();
ignoreProduces.add(Produces.TEXT);
ignoreProduces.add(Produces.HTML);
ignoreProduces.add(Produces.XHTML);
for (String produces : declaredProduces) {
... | java | protected void validateProduces(Collection<String> fathomContentTypes) {
Set<String> ignoreProduces = new TreeSet<>();
ignoreProduces.add(Produces.TEXT);
ignoreProduces.add(Produces.HTML);
ignoreProduces.add(Produces.XHTML);
for (String produces : declaredProduces) {
... | [
"protected",
"void",
"validateProduces",
"(",
"Collection",
"<",
"String",
">",
"fathomContentTypes",
")",
"{",
"Set",
"<",
"String",
">",
"ignoreProduces",
"=",
"new",
"TreeSet",
"<>",
"(",
")",
";",
"ignoreProduces",
".",
"add",
"(",
"Produces",
".",
"TEXT... | Validates that the declared content-types can actually be generated by Fathom.
@param fathomContentTypes | [
"Validates",
"that",
"the",
"declared",
"content",
"-",
"types",
"can",
"actually",
"be",
"generated",
"by",
"Fathom",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest/src/main/java/fathom/rest/controller/ControllerHandler.java#L489-L505 |
10,589 | gitblit/fathom | fathom-rest/src/main/java/fathom/rest/controller/ControllerHandler.java | ControllerHandler.validateDeclaredReturns | protected void validateDeclaredReturns() {
boolean returnsObject = void.class != method.getReturnType();
if (returnsObject) {
for (Return declaredReturn : declaredReturns) {
if (declaredReturn.code() >= 200 && declaredReturn.code() < 300) {
return;
... | java | protected void validateDeclaredReturns() {
boolean returnsObject = void.class != method.getReturnType();
if (returnsObject) {
for (Return declaredReturn : declaredReturns) {
if (declaredReturn.code() >= 200 && declaredReturn.code() < 300) {
return;
... | [
"protected",
"void",
"validateDeclaredReturns",
"(",
")",
"{",
"boolean",
"returnsObject",
"=",
"void",
".",
"class",
"!=",
"method",
".",
"getReturnType",
"(",
")",
";",
"if",
"(",
"returnsObject",
")",
"{",
"for",
"(",
"Return",
"declaredReturn",
":",
"dec... | Validates the declared Returns of the controller method. If the controller method returns an object then
it must also declare a successful @Return with a status code in the 200 range. | [
"Validates",
"the",
"declared",
"Returns",
"of",
"the",
"controller",
"method",
".",
"If",
"the",
"controller",
"method",
"returns",
"an",
"object",
"then",
"it",
"must",
"also",
"declare",
"a",
"successful"
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest/src/main/java/fathom/rest/controller/ControllerHandler.java#L512-L523 |
10,590 | gitblit/fathom | fathom-core/src/main/java/fathom/Constants.java | Constants.getVersion | public static String getVersion() {
String FATHOM_PROPERTIES = "fathom/version.properties";
String version = null;
URL url = ClassUtil.getResource(FATHOM_PROPERTIES);
Preconditions.checkNotNull(url, "Failed to find " + FATHOM_PROPERTIES);
try (InputStream stream = url.openStre... | java | public static String getVersion() {
String FATHOM_PROPERTIES = "fathom/version.properties";
String version = null;
URL url = ClassUtil.getResource(FATHOM_PROPERTIES);
Preconditions.checkNotNull(url, "Failed to find " + FATHOM_PROPERTIES);
try (InputStream stream = url.openStre... | [
"public",
"static",
"String",
"getVersion",
"(",
")",
"{",
"String",
"FATHOM_PROPERTIES",
"=",
"\"fathom/version.properties\"",
";",
"String",
"version",
"=",
"null",
";",
"URL",
"url",
"=",
"ClassUtil",
".",
"getResource",
"(",
"FATHOM_PROPERTIES",
")",
";",
"P... | Returns the running Fathom version.
@return the running Fathom version | [
"Returns",
"the",
"running",
"Fathom",
"version",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-core/src/main/java/fathom/Constants.java#L78-L99 |
10,591 | gitblit/fathom | fathom-security/src/main/java/fathom/security/SecurityManager.java | SecurityManager.clearCache | public void clearCache() {
if (accountCache != null) {
accountCache.invalidateAll();
}
for (Realm realm : allRealms) {
if (realm instanceof CachingRealm) {
CachingRealm cachingRealm = (CachingRealm) realm;
cachingRealm.clearCache();
... | java | public void clearCache() {
if (accountCache != null) {
accountCache.invalidateAll();
}
for (Realm realm : allRealms) {
if (realm instanceof CachingRealm) {
CachingRealm cachingRealm = (CachingRealm) realm;
cachingRealm.clearCache();
... | [
"public",
"void",
"clearCache",
"(",
")",
"{",
"if",
"(",
"accountCache",
"!=",
"null",
")",
"{",
"accountCache",
".",
"invalidateAll",
"(",
")",
";",
"}",
"for",
"(",
"Realm",
"realm",
":",
"allRealms",
")",
"{",
"if",
"(",
"realm",
"instanceof",
"Cac... | Clears the SecurityManager account cache and any CachingRealm's cache.
MemoryRealms are not affected by this call. | [
"Clears",
"the",
"SecurityManager",
"account",
"cache",
"and",
"any",
"CachingRealm",
"s",
"cache",
".",
"MemoryRealms",
"are",
"not",
"affected",
"by",
"this",
"call",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-security/src/main/java/fathom/security/SecurityManager.java#L228-L238 |
10,592 | gitblit/fathom | fathom-security/src/main/java/fathom/security/SecurityManager.java | SecurityManager.parseDefinedRealms | protected Collection<Realm> parseDefinedRealms(Config config) {
List<Realm> realms = new ArrayList<>();
// Parse the Realms
if (config.hasPath("realms")) {
log.trace("Parsing Realm definitions");
for (Config realmConfig : config.getConfigList("realms")) {
... | java | protected Collection<Realm> parseDefinedRealms(Config config) {
List<Realm> realms = new ArrayList<>();
// Parse the Realms
if (config.hasPath("realms")) {
log.trace("Parsing Realm definitions");
for (Config realmConfig : config.getConfigList("realms")) {
... | [
"protected",
"Collection",
"<",
"Realm",
">",
"parseDefinedRealms",
"(",
"Config",
"config",
")",
"{",
"List",
"<",
"Realm",
">",
"realms",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"// Parse the Realms",
"if",
"(",
"config",
".",
"hasPath",
"(",
"\"re... | Parse the Realms from the Config object.
@param config
@return an ordered collection of Realms | [
"Parse",
"the",
"Realms",
"from",
"the",
"Config",
"object",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-security/src/main/java/fathom/security/SecurityManager.java#L256-L288 |
10,593 | gitblit/fathom | fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java | SwaggerBuilder.generateJSON | public String generateJSON(Collection<Route> routes) {
Swagger swagger = build(routes);
String json = Json.pretty(swagger);
return json;
} | java | public String generateJSON(Collection<Route> routes) {
Swagger swagger = build(routes);
String json = Json.pretty(swagger);
return json;
} | [
"public",
"String",
"generateJSON",
"(",
"Collection",
"<",
"Route",
">",
"routes",
")",
"{",
"Swagger",
"swagger",
"=",
"build",
"(",
"routes",
")",
";",
"String",
"json",
"=",
"Json",
".",
"pretty",
"(",
"swagger",
")",
";",
"return",
"json",
";",
"}... | Generates a Swagger 2.0 JSON specification from the collection of routes.
@param routes
@return a Swagger 2.0 JSON specification | [
"Generates",
"a",
"Swagger",
"2",
".",
"0",
"JSON",
"specification",
"from",
"the",
"collection",
"of",
"routes",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java#L164-L168 |
10,594 | gitblit/fathom | fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java | SwaggerBuilder.canRegister | protected boolean canRegister(Route route, ControllerHandler handler) {
if (!METHODS.contains(route.getRequestMethod().toUpperCase())) {
log.debug("Skip {} {}, {} Swagger does not support specified HTTP method",
route.getRequestMethod(), route.getUriPattern(), Util.toString(hand... | java | protected boolean canRegister(Route route, ControllerHandler handler) {
if (!METHODS.contains(route.getRequestMethod().toUpperCase())) {
log.debug("Skip {} {}, {} Swagger does not support specified HTTP method",
route.getRequestMethod(), route.getUriPattern(), Util.toString(hand... | [
"protected",
"boolean",
"canRegister",
"(",
"Route",
"route",
",",
"ControllerHandler",
"handler",
")",
"{",
"if",
"(",
"!",
"METHODS",
".",
"contains",
"(",
"route",
".",
"getRequestMethod",
"(",
")",
".",
"toUpperCase",
"(",
")",
")",
")",
"{",
"log",
... | Determines if this controller handler can be registered in the Swagger specification.
@param route
@param handler
@return true if the controller handler can be registered in the Swagger specification | [
"Determines",
"if",
"this",
"controller",
"handler",
"can",
"be",
"registered",
"in",
"the",
"Swagger",
"specification",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java#L273-L309 |
10,595 | gitblit/fathom | fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java | SwaggerBuilder.registerResponses | protected void registerResponses(Swagger swagger, Operation operation, Method method) {
for (Return aReturn : ControllerUtil.getReturns(method)) {
registerResponse(swagger, operation, aReturn);
}
} | java | protected void registerResponses(Swagger swagger, Operation operation, Method method) {
for (Return aReturn : ControllerUtil.getReturns(method)) {
registerResponse(swagger, operation, aReturn);
}
} | [
"protected",
"void",
"registerResponses",
"(",
"Swagger",
"swagger",
",",
"Operation",
"operation",
",",
"Method",
"method",
")",
"{",
"for",
"(",
"Return",
"aReturn",
":",
"ControllerUtil",
".",
"getReturns",
"(",
"method",
")",
")",
"{",
"registerResponse",
... | Registers the declared responses for the operation.
@param swagger
@param operation
@param method | [
"Registers",
"the",
"declared",
"responses",
"for",
"the",
"operation",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java#L446-L450 |
10,596 | gitblit/fathom | fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java | SwaggerBuilder.registerResponse | protected void registerResponse(Swagger swagger, Operation operation, Return aReturn) {
Response response = new Response();
response.setDescription(translate(aReturn.descriptionKey(), aReturn.description()));
Class<?> resultType = aReturn.onResult();
if (Exception.class.isAssignableFrom... | java | protected void registerResponse(Swagger swagger, Operation operation, Return aReturn) {
Response response = new Response();
response.setDescription(translate(aReturn.descriptionKey(), aReturn.description()));
Class<?> resultType = aReturn.onResult();
if (Exception.class.isAssignableFrom... | [
"protected",
"void",
"registerResponse",
"(",
"Swagger",
"swagger",
",",
"Operation",
"operation",
",",
"Return",
"aReturn",
")",
"{",
"Response",
"response",
"=",
"new",
"Response",
"(",
")",
";",
"response",
".",
"setDescription",
"(",
"translate",
"(",
"aRe... | Registers a declared response for the operation.
@param swagger
@param operation
@param aReturn | [
"Registers",
"a",
"declared",
"response",
"for",
"the",
"operation",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java#L459-L497 |
10,597 | gitblit/fathom | fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java | SwaggerBuilder.registerErrorModel | protected RefProperty registerErrorModel(Swagger swagger) {
String ref = Error.class.getSimpleName();
if (swagger.getDefinitions() != null && swagger.getDefinitions().containsKey(ref)) {
// model already registered
return new RefProperty(ref);
}
ModelImpl model =... | java | protected RefProperty registerErrorModel(Swagger swagger) {
String ref = Error.class.getSimpleName();
if (swagger.getDefinitions() != null && swagger.getDefinitions().containsKey(ref)) {
// model already registered
return new RefProperty(ref);
}
ModelImpl model =... | [
"protected",
"RefProperty",
"registerErrorModel",
"(",
"Swagger",
"swagger",
")",
"{",
"String",
"ref",
"=",
"Error",
".",
"class",
".",
"getSimpleName",
"(",
")",
";",
"if",
"(",
"swagger",
".",
"getDefinitions",
"(",
")",
"!=",
"null",
"&&",
"swagger",
"... | Manually register the Pippo Error class as Swagger model.
@param swagger
@return a ref for the Error model | [
"Manually",
"register",
"the",
"Pippo",
"Error",
"class",
"as",
"Swagger",
"model",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java#L597-L621 |
10,598 | gitblit/fathom | fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java | SwaggerBuilder.registerSecurity | protected void registerSecurity(Swagger swagger, Operation operation, Method method) {
RequireToken requireToken = ClassUtil.getAnnotation(method, RequireToken.class);
if (requireToken != null) {
String apiKeyName = requireToken.value();
if (swagger.getSecurityDefinitions() == nu... | java | protected void registerSecurity(Swagger swagger, Operation operation, Method method) {
RequireToken requireToken = ClassUtil.getAnnotation(method, RequireToken.class);
if (requireToken != null) {
String apiKeyName = requireToken.value();
if (swagger.getSecurityDefinitions() == nu... | [
"protected",
"void",
"registerSecurity",
"(",
"Swagger",
"swagger",
",",
"Operation",
"operation",
",",
"Method",
"method",
")",
"{",
"RequireToken",
"requireToken",
"=",
"ClassUtil",
".",
"getAnnotation",
"(",
"method",
",",
"RequireToken",
".",
"class",
")",
"... | Register authentication security.
@param swagger
@param operation
@param method | [
"Register",
"authentication",
"security",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java#L630-L654 |
10,599 | gitblit/fathom | fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java | SwaggerBuilder.getSwaggerProperty | protected Property getSwaggerProperty(Swagger swagger, Class<?> objectClass) {
Property swaggerProperty = null;
if (byte.class == objectClass || Byte.class == objectClass) {
// STRING
swaggerProperty = new StringProperty("byte");
} else if (char.class == objectClass || Ch... | java | protected Property getSwaggerProperty(Swagger swagger, Class<?> objectClass) {
Property swaggerProperty = null;
if (byte.class == objectClass || Byte.class == objectClass) {
// STRING
swaggerProperty = new StringProperty("byte");
} else if (char.class == objectClass || Ch... | [
"protected",
"Property",
"getSwaggerProperty",
"(",
"Swagger",
"swagger",
",",
"Class",
"<",
"?",
">",
"objectClass",
")",
"{",
"Property",
"swaggerProperty",
"=",
"null",
";",
"if",
"(",
"byte",
".",
"class",
"==",
"objectClass",
"||",
"Byte",
".",
"class",... | Returns the appropriate Swagger Property instance for a given object class.
@param swagger
@param objectClass
@return a SwaggerProperty instance | [
"Returns",
"the",
"appropriate",
"Swagger",
"Property",
"instance",
"for",
"a",
"given",
"object",
"class",
"."
] | f2f820eb16e9fea1e36ad4eda4ed51b35f056538 | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-rest-swagger/src/main/java/fathom/rest/swagger/SwaggerBuilder.java#L869-L938 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.