repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
reinert/requestor | requestor/core/requestor-api/src/main/java/io/reinert/requestor/SerdesManagerImpl.java | SerdesManagerImpl.getSerializer | @SuppressWarnings("unchecked")
public <T> Serializer<T> getSerializer(Class<T> type, String mediaType) throws SerializationException {
checkNotNull(type, "Type (Class<T>) cannot be null.");
checkNotNull(mediaType, "Media-Type cannot be null.");
final String typeName = getClassName(type);
... | java | @SuppressWarnings("unchecked")
public <T> Serializer<T> getSerializer(Class<T> type, String mediaType) throws SerializationException {
checkNotNull(type, "Type (Class<T>) cannot be null.");
checkNotNull(mediaType, "Media-Type cannot be null.");
final String typeName = getClassName(type);
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"Serializer",
"<",
"T",
">",
"getSerializer",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"String",
"mediaType",
")",
"throws",
"SerializationException",
"{",
"checkNotNull",
"(",
"ty... | Retrieve Serializer from manager.
@param type The type class of the serializer.
@param <T> The type of the serializer.
@return The serializer of the specified type.
@throws SerializationException if no serializer was registered for the class. | [
"Retrieve",
"Serializer",
"from",
"manager",
"."
] | 40163a75cd17815d5089935d0dd97b8d652ad6d4 | https://github.com/reinert/requestor/blob/40163a75cd17815d5089935d0dd97b8d652ad6d4/requestor/core/requestor-api/src/main/java/io/reinert/requestor/SerdesManagerImpl.java#L190-L218 | train |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/DataTableConversionUtility.java | DataTableConversionUtility.loadData | private RecordList loadData(AbstractDataTable table, DataSchema schema) {
RecordListBuilder recordListBuilder = new RecordListBuilder(RecordListBuilder.CompressionMode.CANONICAL, schema);
// simple check to ensure schema and table definitions are aligned
if(schema.size()!= table.getNumberOfColum... | java | private RecordList loadData(AbstractDataTable table, DataSchema schema) {
RecordListBuilder recordListBuilder = new RecordListBuilder(RecordListBuilder.CompressionMode.CANONICAL, schema);
// simple check to ensure schema and table definitions are aligned
if(schema.size()!= table.getNumberOfColum... | [
"private",
"RecordList",
"loadData",
"(",
"AbstractDataTable",
"table",
",",
"DataSchema",
"schema",
")",
"{",
"RecordListBuilder",
"recordListBuilder",
"=",
"new",
"RecordListBuilder",
"(",
"RecordListBuilder",
".",
"CompressionMode",
".",
"CANONICAL",
",",
"schema",
... | Given a schema, attempts to load table into internal structure
@param table the existing DataTable/DataView containing rows to load into RecordList | [
"Given",
"a",
"schema",
"attempts",
"to",
"load",
"table",
"into",
"internal",
"structure"
] | 224280bcd6e8045bda6b673584caf0aea5e4c841 | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/DataTableConversionUtility.java#L58-L85 | train |
lightblue-platform/lightblue-client | http/src/main/java/com/redhat/lightblue/client/http/auth/SslSocketFactories.java | SslSocketFactories.createNaiveTrustManager | private static TrustManager createNaiveTrustManager() {
return new X509TrustManager() {
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}
public void checkServerTrusted(X509Certificate[] chain, String authType) throws Ce... | java | private static TrustManager createNaiveTrustManager() {
return new X509TrustManager() {
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}
public void checkServerTrusted(X509Certificate[] chain, String authType) throws Ce... | [
"private",
"static",
"TrustManager",
"createNaiveTrustManager",
"(",
")",
"{",
"return",
"new",
"X509TrustManager",
"(",
")",
"{",
"public",
"void",
"checkClientTrusted",
"(",
"X509Certificate",
"[",
"]",
"chain",
",",
"String",
"authType",
")",
"throws",
"Certifi... | Naive trust manager trusts all. | [
"Naive",
"trust",
"manager",
"trusts",
"all",
"."
] | 03790aff34e90d3889f60fd6c603c21a21dc1a40 | https://github.com/lightblue-platform/lightblue-client/blob/03790aff34e90d3889f60fd6c603c21a21dc1a40/http/src/main/java/com/redhat/lightblue/client/http/auth/SslSocketFactories.java#L137-L149 | train |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | MapCore/src/main/java/org/wwarn/mapcore/client/components/customwidgets/AbstractYuiSliderGwtWidgetWithLabelMarkers.java | AbstractYuiSliderGwtWidgetWithLabelMarkers.onLoad | @Override
protected void onLoad() {
mainAbsolutePanel.setSize(
String.valueOf(yuiSliderGwtWidget.getOffsetWidth()),
String.valueOf(yuiSliderGwtWidget.getOffsetHeight())
);
setupMarkerLabels();
} | java | @Override
protected void onLoad() {
mainAbsolutePanel.setSize(
String.valueOf(yuiSliderGwtWidget.getOffsetWidth()),
String.valueOf(yuiSliderGwtWidget.getOffsetHeight())
);
setupMarkerLabels();
} | [
"@",
"Override",
"protected",
"void",
"onLoad",
"(",
")",
"{",
"mainAbsolutePanel",
".",
"setSize",
"(",
"String",
".",
"valueOf",
"(",
"yuiSliderGwtWidget",
".",
"getOffsetWidth",
"(",
")",
")",
",",
"String",
".",
"valueOf",
"(",
"yuiSliderGwtWidget",
".",
... | override onLoad to know when absolutePanel's size can be set | [
"override",
"onLoad",
"to",
"know",
"when",
"absolutePanel",
"s",
"size",
"can",
"be",
"set"
] | 224280bcd6e8045bda6b673584caf0aea5e4c841 | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/MapCore/src/main/java/org/wwarn/mapcore/client/components/customwidgets/AbstractYuiSliderGwtWidgetWithLabelMarkers.java#L67-L77 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/msg/MsgSaver.java | MsgSaver.urlCheckAndSave | public void urlCheckAndSave(BasicCheckInfo basicCheckInfo, ParamType paramType, ReqUrl reqUrl, Class<?> type) {
if (!this.validationConfig.isFreshUrlSave() || !basicCheckInfo.isUrlMapping()) {
return;
}
List<ValidationData> datas = this.validationDataRepository.findByParamTypeAndMet... | java | public void urlCheckAndSave(BasicCheckInfo basicCheckInfo, ParamType paramType, ReqUrl reqUrl, Class<?> type) {
if (!this.validationConfig.isFreshUrlSave() || !basicCheckInfo.isUrlMapping()) {
return;
}
List<ValidationData> datas = this.validationDataRepository.findByParamTypeAndMet... | [
"public",
"void",
"urlCheckAndSave",
"(",
"BasicCheckInfo",
"basicCheckInfo",
",",
"ParamType",
"paramType",
",",
"ReqUrl",
"reqUrl",
",",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"if",
"(",
"!",
"this",
".",
"validationConfig",
".",
"isFreshUrlSave",
"(",
... | Url check and save.
@param basicCheckInfo the basic check info
@param paramType the param type
@param reqUrl the req url
@param type the type | [
"Url",
"check",
"and",
"save",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/msg/MsgSaver.java#L74-L85 | train |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | MapCore/src/main/java/org/wwarn/mapcore/client/components/customwidgets/map/MapBuilder.java | MapBuilder.configureMapDimension | public MapBuilder configureMapDimension(Integer width, Integer height) {
this.mapHeight = height;
this.mapWidth = width;
return this;
} | java | public MapBuilder configureMapDimension(Integer width, Integer height) {
this.mapHeight = height;
this.mapWidth = width;
return this;
} | [
"public",
"MapBuilder",
"configureMapDimension",
"(",
"Integer",
"width",
",",
"Integer",
"height",
")",
"{",
"this",
".",
"mapHeight",
"=",
"height",
";",
"this",
".",
"mapWidth",
"=",
"width",
";",
"return",
"this",
";",
"}"
] | Setup map display properties
@param width value in px
@param height value in px | [
"Setup",
"map",
"display",
"properties"
] | 224280bcd6e8045bda6b673584caf0aea5e4c841 | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/MapCore/src/main/java/org/wwarn/mapcore/client/components/customwidgets/map/MapBuilder.java#L100-L104 | train |
OpenCompare/OpenCompare | org.opencompare/api-java/src/main/java/org/opencompare/api/java/io/ImportMatrixLoader.java | ImportMatrixLoader.detectTypes | protected void detectTypes(ImportMatrix matrix) {
for (int row = 0; row < matrix.getNumberOfRows(); row++) {
for (int column = 0; column < matrix.getNumberOfColumns(); column++) {
ImportCell cell = matrix.getCell(row, column);
if (cell != null && cell.getInterpretatio... | java | protected void detectTypes(ImportMatrix matrix) {
for (int row = 0; row < matrix.getNumberOfRows(); row++) {
for (int column = 0; column < matrix.getNumberOfColumns(); column++) {
ImportCell cell = matrix.getCell(row, column);
if (cell != null && cell.getInterpretatio... | [
"protected",
"void",
"detectTypes",
"(",
"ImportMatrix",
"matrix",
")",
"{",
"for",
"(",
"int",
"row",
"=",
"0",
";",
"row",
"<",
"matrix",
".",
"getNumberOfRows",
"(",
")",
";",
"row",
"++",
")",
"{",
"for",
"(",
"int",
"column",
"=",
"0",
";",
"c... | Detect types of each cell of the matrix
@param matrix matrix | [
"Detect",
"types",
"of",
"each",
"cell",
"of",
"the",
"matrix"
] | 6cd776466b375cb8ecca08fcd94e573d65e20b14 | https://github.com/OpenCompare/OpenCompare/blob/6cd776466b375cb8ecca08fcd94e573d65e20b14/org.opencompare/api-java/src/main/java/org/opencompare/api/java/io/ImportMatrixLoader.java#L90-L101 | train |
OpenCompare/OpenCompare | org.opencompare/api-java/src/main/java/org/opencompare/api/java/io/ImportMatrixLoader.java | ImportMatrixLoader.detectDirection | protected PCMDirection detectDirection(ImportMatrix matrix) {
// Compute homogeneity of rows
double sumHomogeneityOfRow = 0;
for (int row = 0; row < matrix.getNumberOfRows(); row++) {
Map<String, Integer> types = new HashMap<>();
// Retrieve types of values
... | java | protected PCMDirection detectDirection(ImportMatrix matrix) {
// Compute homogeneity of rows
double sumHomogeneityOfRow = 0;
for (int row = 0; row < matrix.getNumberOfRows(); row++) {
Map<String, Integer> types = new HashMap<>();
// Retrieve types of values
... | [
"protected",
"PCMDirection",
"detectDirection",
"(",
"ImportMatrix",
"matrix",
")",
"{",
"// Compute homogeneity of rows",
"double",
"sumHomogeneityOfRow",
"=",
"0",
";",
"for",
"(",
"int",
"row",
"=",
"0",
";",
"row",
"<",
"matrix",
".",
"getNumberOfRows",
"(",
... | Detect if products are represented by a line or a column
@param matrix matrix
@return direction of the matrix | [
"Detect",
"if",
"products",
"are",
"represented",
"by",
"a",
"line",
"or",
"a",
"column"
] | 6cd776466b375cb8ecca08fcd94e573d65e20b14 | https://github.com/OpenCompare/OpenCompare/blob/6cd776466b375cb8ecca08fcd94e573d65e20b14/org.opencompare/api-java/src/main/java/org/opencompare/api/java/io/ImportMatrixLoader.java#L108-L151 | train |
OpenCompare/OpenCompare | org.opencompare/api-java/src/main/java/org/opencompare/api/java/io/ImportMatrixLoader.java | ImportMatrixLoader.detectFeatures | protected IONode<String> detectFeatures(ImportMatrix matrix, PCMContainer pcmContainer) {
IONode<String> root = new IONode<>(null);
List<IONode<String>> parents = new ArrayList<>();
// Init parents
for (int column = 0; column < matrix.getNumberOfColumns(); column++) {
paren... | java | protected IONode<String> detectFeatures(ImportMatrix matrix, PCMContainer pcmContainer) {
IONode<String> root = new IONode<>(null);
List<IONode<String>> parents = new ArrayList<>();
// Init parents
for (int column = 0; column < matrix.getNumberOfColumns(); column++) {
paren... | [
"protected",
"IONode",
"<",
"String",
">",
"detectFeatures",
"(",
"ImportMatrix",
"matrix",
",",
"PCMContainer",
"pcmContainer",
")",
"{",
"IONode",
"<",
"String",
">",
"root",
"=",
"new",
"IONode",
"<>",
"(",
"null",
")",
";",
"List",
"<",
"IONode",
"<",
... | Detect features from the information contained in the matrix and the provided direction
@param matrix matrix
@param pcmContainer PCM container
@return graph representing the hierarchy of features | [
"Detect",
"features",
"from",
"the",
"information",
"contained",
"in",
"the",
"matrix",
"and",
"the",
"provided",
"direction"
] | 6cd776466b375cb8ecca08fcd94e573d65e20b14 | https://github.com/OpenCompare/OpenCompare/blob/6cd776466b375cb8ecca08fcd94e573d65e20b14/org.opencompare/api-java/src/main/java/org/opencompare/api/java/io/ImportMatrixLoader.java#L172-L235 | train |
OpenCompare/OpenCompare | org.opencompare/api-java/src/main/java/org/opencompare/api/java/io/ImportMatrixLoader.java | ImportMatrixLoader.createProducts | protected void createProducts(ImportMatrix matrix, PCMContainer pcmContainer, Map<Integer, Feature> positionToFeature) {
int featuresDepth = pcmContainer.getPcm().getFeaturesDepth();
for (int row = featuresDepth; row < matrix.getNumberOfRows(); row++) {
Product product = factory.createProd... | java | protected void createProducts(ImportMatrix matrix, PCMContainer pcmContainer, Map<Integer, Feature> positionToFeature) {
int featuresDepth = pcmContainer.getPcm().getFeaturesDepth();
for (int row = featuresDepth; row < matrix.getNumberOfRows(); row++) {
Product product = factory.createProd... | [
"protected",
"void",
"createProducts",
"(",
"ImportMatrix",
"matrix",
",",
"PCMContainer",
"pcmContainer",
",",
"Map",
"<",
"Integer",
",",
"Feature",
">",
"positionToFeature",
")",
"{",
"int",
"featuresDepth",
"=",
"pcmContainer",
".",
"getPcm",
"(",
")",
".",
... | Detect and create products from the information contained in the matrix and the provided direction
@param matrix matrix
@param pcmContainer PCM container
@param positionToFeature map between positions and features | [
"Detect",
"and",
"create",
"products",
"from",
"the",
"information",
"contained",
"in",
"the",
"matrix",
"and",
"the",
"provided",
"direction"
] | 6cd776466b375cb8ecca08fcd94e573d65e20b14 | https://github.com/OpenCompare/OpenCompare/blob/6cd776466b375cb8ecca08fcd94e573d65e20b14/org.opencompare/api-java/src/main/java/org/opencompare/api/java/io/ImportMatrixLoader.java#L270-L298 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationHttpUtil.java | ValidationHttpUtil.readBody | public static String readBody(HttpServletRequest request) {
BufferedReader input = null;
try {
input = new BufferedReader(new InputStreamReader(request.getInputStream()));
StringBuilder builder = new StringBuilder();
String buffer;
while ((buffer = input.... | java | public static String readBody(HttpServletRequest request) {
BufferedReader input = null;
try {
input = new BufferedReader(new InputStreamReader(request.getInputStream()));
StringBuilder builder = new StringBuilder();
String buffer;
while ((buffer = input.... | [
"public",
"static",
"String",
"readBody",
"(",
"HttpServletRequest",
"request",
")",
"{",
"BufferedReader",
"input",
"=",
"null",
";",
"try",
"{",
"input",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"request",
".",
"getInputStream",
"(",... | Read body string.
@param request the request
@return the string | [
"Read",
"body",
"string",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationHttpUtil.java#L25-L43 | train |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/DataTableExtensions.java | DataTableExtensions.convertDataTable | private RecordList convertDataTable(AbstractDataTable table, DataSchema schema) {
return dataTableConversionUtility.convertDataTableToRecordList(schema, table);
} | java | private RecordList convertDataTable(AbstractDataTable table, DataSchema schema) {
return dataTableConversionUtility.convertDataTableToRecordList(schema, table);
} | [
"private",
"RecordList",
"convertDataTable",
"(",
"AbstractDataTable",
"table",
",",
"DataSchema",
"schema",
")",
"{",
"return",
"dataTableConversionUtility",
".",
"convertDataTableToRecordList",
"(",
"schema",
",",
"table",
")",
";",
"}"
] | covert a gwtDatatable to an internal RecordList
@param table
@param schema
@return | [
"covert",
"a",
"gwtDatatable",
"to",
"an",
"internal",
"RecordList"
] | 224280bcd6e8045bda6b673584caf0aea5e4c841 | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/DataTableExtensions.java#L122-L124 | train |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/DataTableExtensions.java | DataTableExtensions.calculateRowsToFilter | private List<Integer> calculateRowsToFilter(DataView dataView, FilterQuery filterQuery, DataSchema schema) {
JsArray<JavaScriptObject> propertiesJsArray = convertToColumnIndexAndValueArray(filterQuery, schema);
JsArrayInteger jsArrayInteger = getFilteredRows(dataView, propertiesJsArray);
return ... | java | private List<Integer> calculateRowsToFilter(DataView dataView, FilterQuery filterQuery, DataSchema schema) {
JsArray<JavaScriptObject> propertiesJsArray = convertToColumnIndexAndValueArray(filterQuery, schema);
JsArrayInteger jsArrayInteger = getFilteredRows(dataView, propertiesJsArray);
return ... | [
"private",
"List",
"<",
"Integer",
">",
"calculateRowsToFilter",
"(",
"DataView",
"dataView",
",",
"FilterQuery",
"filterQuery",
",",
"DataSchema",
"schema",
")",
"{",
"JsArray",
"<",
"JavaScriptObject",
">",
"propertiesJsArray",
"=",
"convertToColumnIndexAndValueArray"... | Calculate the row indexes for rows that match all of the given filters.
Parses the filterQuery
@param dataView
@param filterQuery
@param schema
@return a list of rows to filter | [
"Calculate",
"the",
"row",
"indexes",
"for",
"rows",
"that",
"match",
"all",
"of",
"the",
"given",
"filters",
".",
"Parses",
"the",
"filterQuery"
] | 224280bcd6e8045bda6b673584caf0aea5e4c841 | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/DataTableExtensions.java#L134-L138 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationObjUtil.java | ValidationObjUtil.getDefaultObjectMapper | public static ObjectMapper getDefaultObjectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL, true);
mapper.configure(SerializationFe... | java | public static ObjectMapper getDefaultObjectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.configure(DeserializationFeature.READ_UNKNOWN_ENUM_VALUES_AS_NULL, true);
mapper.configure(SerializationFe... | [
"public",
"static",
"ObjectMapper",
"getDefaultObjectMapper",
"(",
")",
"{",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"mapper",
".",
"configure",
"(",
"DeserializationFeature",
".",
"FAIL_ON_UNKNOWN_PROPERTIES",
",",
"false",
")",
";",
... | Gets default object mapper.
@return the default object mapper | [
"Gets",
"default",
"object",
"mapper",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L34-L45 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationObjUtil.java | ValidationObjUtil.isNumberObj | public static boolean isNumberObj(Object type) {
try {
Double.valueOf(type + "");
} catch (NumberFormatException e) {
return false;
}
return true;
} | java | public static boolean isNumberObj(Object type) {
try {
Double.valueOf(type + "");
} catch (NumberFormatException e) {
return false;
}
return true;
} | [
"public",
"static",
"boolean",
"isNumberObj",
"(",
"Object",
"type",
")",
"{",
"try",
"{",
"Double",
".",
"valueOf",
"(",
"type",
"+",
"\"\"",
")",
";",
"}",
"catch",
"(",
"NumberFormatException",
"e",
")",
"{",
"return",
"false",
";",
"}",
"return",
"... | Is number obj boolean.
@param type the type
@return the boolean | [
"Is",
"number",
"obj",
"boolean",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L70-L77 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationObjUtil.java | ValidationObjUtil.isDoubleType | public static boolean isDoubleType(Class<?> type) {
return (type.isPrimitive() && type == float.class) || (type.isPrimitive() && type == double.class)
|| (!type.isPrimitive() && type == Float.class) || (!type.isPrimitive() && type == Double.class);
} | java | public static boolean isDoubleType(Class<?> type) {
return (type.isPrimitive() && type == float.class) || (type.isPrimitive() && type == double.class)
|| (!type.isPrimitive() && type == Float.class) || (!type.isPrimitive() && type == Double.class);
} | [
"public",
"static",
"boolean",
"isDoubleType",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"return",
"(",
"type",
".",
"isPrimitive",
"(",
")",
"&&",
"type",
"==",
"float",
".",
"class",
")",
"||",
"(",
"type",
".",
"isPrimitive",
"(",
")",
"&&",
... | Is double type boolean.
@param type the type
@return the boolean | [
"Is",
"double",
"type",
"boolean",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L95-L98 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationObjUtil.java | ValidationObjUtil.isIntType | public static boolean isIntType(Class<?> type) {
return (type.isPrimitive() && type == int.class) || (type.isPrimitive() && type == long.class)
|| (!type.isPrimitive() && type == Integer.class) || (!type.isPrimitive() && type == Long.class);
} | java | public static boolean isIntType(Class<?> type) {
return (type.isPrimitive() && type == int.class) || (type.isPrimitive() && type == long.class)
|| (!type.isPrimitive() && type == Integer.class) || (!type.isPrimitive() && type == Long.class);
} | [
"public",
"static",
"boolean",
"isIntType",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"return",
"(",
"type",
".",
"isPrimitive",
"(",
")",
"&&",
"type",
"==",
"int",
".",
"class",
")",
"||",
"(",
"type",
".",
"isPrimitive",
"(",
")",
"&&",
"ty... | Is int type boolean.
@param type the type
@return the boolean | [
"Is",
"int",
"type",
"boolean",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L107-L110 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationObjUtil.java | ValidationObjUtil.getSetterMethodNotCheckParamType | public static Method getSetterMethodNotCheckParamType(Class<?> cType, String fieldName) {
String methodName = getMethodName(fieldName, SET_METHOD_PREFIX);
Method[] methods = cType.getMethods();
for (Method m : methods) {
if (m.getName().equals(methodName) && m.getParameterCount() == ... | java | public static Method getSetterMethodNotCheckParamType(Class<?> cType, String fieldName) {
String methodName = getMethodName(fieldName, SET_METHOD_PREFIX);
Method[] methods = cType.getMethods();
for (Method m : methods) {
if (m.getName().equals(methodName) && m.getParameterCount() == ... | [
"public",
"static",
"Method",
"getSetterMethodNotCheckParamType",
"(",
"Class",
"<",
"?",
">",
"cType",
",",
"String",
"fieldName",
")",
"{",
"String",
"methodName",
"=",
"getMethodName",
"(",
"fieldName",
",",
"SET_METHOD_PREFIX",
")",
";",
"Method",
"[",
"]",
... | Gets setter method not check param type.
@param cType the c type
@param fieldName the field name
@return the setter method not check param type | [
"Gets",
"setter",
"method",
"not",
"check",
"param",
"type",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L141-L150 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationObjUtil.java | ValidationObjUtil.getSetterMethod | public static Method getSetterMethod(Class<?> cType, String fieldName, Class<?> paramType) {
Class<?> subType = getSubType(paramType);
String methodName = getMethodName(fieldName, SET_METHOD_PREFIX);
try {
return cType.getMethod(methodName, paramType);
} catch (NoSuchMethod... | java | public static Method getSetterMethod(Class<?> cType, String fieldName, Class<?> paramType) {
Class<?> subType = getSubType(paramType);
String methodName = getMethodName(fieldName, SET_METHOD_PREFIX);
try {
return cType.getMethod(methodName, paramType);
} catch (NoSuchMethod... | [
"public",
"static",
"Method",
"getSetterMethod",
"(",
"Class",
"<",
"?",
">",
"cType",
",",
"String",
"fieldName",
",",
"Class",
"<",
"?",
">",
"paramType",
")",
"{",
"Class",
"<",
"?",
">",
"subType",
"=",
"getSubType",
"(",
"paramType",
")",
";",
"St... | Gets setter method.
@param cType the c type
@param fieldName the field name
@param paramType the param type
@return the setter method | [
"Gets",
"setter",
"method",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L160-L175 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationObjUtil.java | ValidationObjUtil.getMethodName | public static String getMethodName(String name, String prefix) {
return prefix + name.substring(0, 1).toUpperCase() + name.substring(1);
} | java | public static String getMethodName(String name, String prefix) {
return prefix + name.substring(0, 1).toUpperCase() + name.substring(1);
} | [
"public",
"static",
"String",
"getMethodName",
"(",
"String",
"name",
",",
"String",
"prefix",
")",
"{",
"return",
"prefix",
"+",
"name",
".",
"substring",
"(",
"0",
",",
"1",
")",
".",
"toUpperCase",
"(",
")",
"+",
"name",
".",
"substring",
"(",
"1",
... | Gets method name.
@param name the name
@param prefix the prefix
@return the method name | [
"Gets",
"method",
"name",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L184-L186 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationObjUtil.java | ValidationObjUtil.getFieldNameFromMethod | public static String getFieldNameFromMethod(Method m) {
String methodName = m.getName();
if (methodName.startsWith(GET_METHOD_PREFIX)) {
methodName = methodName.replaceFirst(GET_METHOD_PREFIX, "");
} else if (methodName.startsWith(IS_METHOD_PREFIX)) {
methodName = method... | java | public static String getFieldNameFromMethod(Method m) {
String methodName = m.getName();
if (methodName.startsWith(GET_METHOD_PREFIX)) {
methodName = methodName.replaceFirst(GET_METHOD_PREFIX, "");
} else if (methodName.startsWith(IS_METHOD_PREFIX)) {
methodName = method... | [
"public",
"static",
"String",
"getFieldNameFromMethod",
"(",
"Method",
"m",
")",
"{",
"String",
"methodName",
"=",
"m",
".",
"getName",
"(",
")",
";",
"if",
"(",
"methodName",
".",
"startsWith",
"(",
"GET_METHOD_PREFIX",
")",
")",
"{",
"methodName",
"=",
"... | Gets field name from method.
@param m the m
@return the field name from method | [
"Gets",
"field",
"name",
"from",
"method",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L194-L207 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationObjUtil.java | ValidationObjUtil.getGetterMethod | public static Method getGetterMethod(Class<?> c, String field) {
try {
return c.getMethod(getMethodName(field, GET_METHOD_PREFIX), EMPTY_CLASS);
} catch (NoSuchMethodException e) {
try {
return c.getMethod(getMethodName(field, IS_METHOD_PREFIX), EMPTY_CLASS);
... | java | public static Method getGetterMethod(Class<?> c, String field) {
try {
return c.getMethod(getMethodName(field, GET_METHOD_PREFIX), EMPTY_CLASS);
} catch (NoSuchMethodException e) {
try {
return c.getMethod(getMethodName(field, IS_METHOD_PREFIX), EMPTY_CLASS);
... | [
"public",
"static",
"Method",
"getGetterMethod",
"(",
"Class",
"<",
"?",
">",
"c",
",",
"String",
"field",
")",
"{",
"try",
"{",
"return",
"c",
".",
"getMethod",
"(",
"getMethodName",
"(",
"field",
",",
"GET_METHOD_PREFIX",
")",
",",
"EMPTY_CLASS",
")",
... | Gets getter method.
@param c the c
@param field the field
@return the getter method | [
"Gets",
"getter",
"method",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L216-L228 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationObjUtil.java | ValidationObjUtil.getValue | public static Object getValue(Object obj, String field) {
Method getter = getGetterMethod(obj.getClass(), field);
try {
return getter.invoke(obj);
} catch (IllegalAccessException | InvocationTargetException e) {
return null;
}
} | java | public static Object getValue(Object obj, String field) {
Method getter = getGetterMethod(obj.getClass(), field);
try {
return getter.invoke(obj);
} catch (IllegalAccessException | InvocationTargetException e) {
return null;
}
} | [
"public",
"static",
"Object",
"getValue",
"(",
"Object",
"obj",
",",
"String",
"field",
")",
"{",
"Method",
"getter",
"=",
"getGetterMethod",
"(",
"obj",
".",
"getClass",
"(",
")",
",",
"field",
")",
";",
"try",
"{",
"return",
"getter",
".",
"invoke",
... | Gets value.
@param obj the obj
@param field the field
@return the value | [
"Gets",
"value",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L237-L245 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationObjUtil.java | ValidationObjUtil.objDeepCopy | public static Object objDeepCopy(Object from, Object to, String... copyFields) {
if (from == null || to == null) {
log.error("object deep copy from or to is null ");
return to;
}
for (String field : copyFields) {
copyFromTo(from, to, field);
}
... | java | public static Object objDeepCopy(Object from, Object to, String... copyFields) {
if (from == null || to == null) {
log.error("object deep copy from or to is null ");
return to;
}
for (String field : copyFields) {
copyFromTo(from, to, field);
}
... | [
"public",
"static",
"Object",
"objDeepCopy",
"(",
"Object",
"from",
",",
"Object",
"to",
",",
"String",
"...",
"copyFields",
")",
"{",
"if",
"(",
"from",
"==",
"null",
"||",
"to",
"==",
"null",
")",
"{",
"log",
".",
"error",
"(",
"\"object deep copy from... | Obj deep copy object.
@param from the from
@param to the to
@param copyFields the copy fields
@return the object | [
"Obj",
"deep",
"copy",
"object",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L338-L349 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationObjUtil.java | ValidationObjUtil.objectDeepCopyWithWhiteList | public static <T> T objectDeepCopyWithWhiteList(Object from, Object to, String... copyFields) {
return (T) to.getClass().cast(objDeepCopy(from, to, copyFields));
} | java | public static <T> T objectDeepCopyWithWhiteList(Object from, Object to, String... copyFields) {
return (T) to.getClass().cast(objDeepCopy(from, to, copyFields));
} | [
"public",
"static",
"<",
"T",
">",
"T",
"objectDeepCopyWithWhiteList",
"(",
"Object",
"from",
",",
"Object",
"to",
",",
"String",
"...",
"copyFields",
")",
"{",
"return",
"(",
"T",
")",
"to",
".",
"getClass",
"(",
")",
".",
"cast",
"(",
"objDeepCopy",
... | Object deep copy with white list t.
@param <T> the type parameter
@param from the from
@param to the to
@param copyFields the copy fields
@return the t | [
"Object",
"deep",
"copy",
"with",
"white",
"list",
"t",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L360-L362 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationObjUtil.java | ValidationObjUtil.isGetterMethod | public static boolean isGetterMethod(Method m) {
String methodName = m.getName();
if (methodName.equals("getClass")) {
return false;
}
if (!methodName.startsWith(GET_METHOD_PREFIX) && !methodName.startsWith(IS_METHOD_PREFIX)) {
return false;
}
i... | java | public static boolean isGetterMethod(Method m) {
String methodName = m.getName();
if (methodName.equals("getClass")) {
return false;
}
if (!methodName.startsWith(GET_METHOD_PREFIX) && !methodName.startsWith(IS_METHOD_PREFIX)) {
return false;
}
i... | [
"public",
"static",
"boolean",
"isGetterMethod",
"(",
"Method",
"m",
")",
"{",
"String",
"methodName",
"=",
"m",
".",
"getName",
"(",
")",
";",
"if",
"(",
"methodName",
".",
"equals",
"(",
"\"getClass\"",
")",
")",
"{",
"return",
"false",
";",
"}",
"if... | Is getter method boolean.
@param m the m
@return the boolean | [
"Is",
"getter",
"method",
"boolean",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L370-L386 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationObjUtil.java | ValidationObjUtil.getObjectSize | public static Double getObjectSize(Object value) {
double v = 1;
if (value instanceof String) {
v = ((String) value).length();
if (v < 1) {
return null;
}
} else if (value instanceof List) {
v = ((List) value).size();
} el... | java | public static Double getObjectSize(Object value) {
double v = 1;
if (value instanceof String) {
v = ((String) value).length();
if (v < 1) {
return null;
}
} else if (value instanceof List) {
v = ((List) value).size();
} el... | [
"public",
"static",
"Double",
"getObjectSize",
"(",
"Object",
"value",
")",
"{",
"double",
"v",
"=",
"1",
";",
"if",
"(",
"value",
"instanceof",
"String",
")",
"{",
"v",
"=",
"(",
"(",
"String",
")",
"value",
")",
".",
"length",
"(",
")",
";",
"if"... | Gets object size.
@param value the value
@return the object size | [
"Gets",
"object",
"size",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L481-L497 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationObjUtil.java | ValidationObjUtil.getListInnerClassFromGenericType | public static Class<?> getListInnerClassFromGenericType(Type genericType) {
ParameterizedType innerClass = (ParameterizedType) genericType;
return (Class<?>) innerClass.getActualTypeArguments()[0];
} | java | public static Class<?> getListInnerClassFromGenericType(Type genericType) {
ParameterizedType innerClass = (ParameterizedType) genericType;
return (Class<?>) innerClass.getActualTypeArguments()[0];
} | [
"public",
"static",
"Class",
"<",
"?",
">",
"getListInnerClassFromGenericType",
"(",
"Type",
"genericType",
")",
"{",
"ParameterizedType",
"innerClass",
"=",
"(",
"ParameterizedType",
")",
"genericType",
";",
"return",
"(",
"Class",
"<",
"?",
">",
")",
"innerCla... | Gets list inner class from generic type.
@param genericType the generic type
@return the list inner class from generic type | [
"Gets",
"list",
"inner",
"class",
"from",
"generic",
"type",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationObjUtil.java#L505-L508 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/msg/MsgChecker.java | MsgChecker.replaceCallback | public MsgChecker replaceCallback(BasicCheckRule type, ValidationInvalidCallback cb) {
this.callbackMap.put(type.name(), cb);
return this;
} | java | public MsgChecker replaceCallback(BasicCheckRule type, ValidationInvalidCallback cb) {
this.callbackMap.put(type.name(), cb);
return this;
} | [
"public",
"MsgChecker",
"replaceCallback",
"(",
"BasicCheckRule",
"type",
",",
"ValidationInvalidCallback",
"cb",
")",
"{",
"this",
".",
"callbackMap",
".",
"put",
"(",
"type",
".",
"name",
"(",
")",
",",
"cb",
")",
";",
"return",
"this",
";",
"}"
] | Replace callback msg checker.
@param type the type
@param cb the cb
@return the msg checker | [
"Replace",
"callback",
"msg",
"checker",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/msg/MsgChecker.java#L36-L39 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/msg/MsgChecker.java | MsgChecker.checkPoint | public void checkPoint(ValidationData param, ValidationRule rule, Object bodyObj, Object standardValue) {
//check
Object value = param.getValue(bodyObj);
BaseValidationCheck checker = this.validationRuleStore.getValidationChecker(rule);
if ((value != null && standardValue != null) || rul... | java | public void checkPoint(ValidationData param, ValidationRule rule, Object bodyObj, Object standardValue) {
//check
Object value = param.getValue(bodyObj);
BaseValidationCheck checker = this.validationRuleStore.getValidationChecker(rule);
if ((value != null && standardValue != null) || rul... | [
"public",
"void",
"checkPoint",
"(",
"ValidationData",
"param",
",",
"ValidationRule",
"rule",
",",
"Object",
"bodyObj",
",",
"Object",
"standardValue",
")",
"{",
"//check",
"Object",
"value",
"=",
"param",
".",
"getValue",
"(",
"bodyObj",
")",
";",
"BaseValid... | Check point.
@param param the param
@param rule the rule
@param bodyObj the body obj
@param standardValue the standard value | [
"Check",
"point",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/msg/MsgChecker.java#L59-L76 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/msg/MsgChecker.java | MsgChecker.checkPointListChild | public void checkPointListChild(ValidationData param, ValidationRule rule, Object bodyObj, Object standardValue) {
ValidationData listParent = param.findListParent();
List list = (List) listParent.getValue(bodyObj);
if (list == null || list.isEmpty()) {
return;
}
lis... | java | public void checkPointListChild(ValidationData param, ValidationRule rule, Object bodyObj, Object standardValue) {
ValidationData listParent = param.findListParent();
List list = (List) listParent.getValue(bodyObj);
if (list == null || list.isEmpty()) {
return;
}
lis... | [
"public",
"void",
"checkPointListChild",
"(",
"ValidationData",
"param",
",",
"ValidationRule",
"rule",
",",
"Object",
"bodyObj",
",",
"Object",
"standardValue",
")",
"{",
"ValidationData",
"listParent",
"=",
"param",
".",
"findListParent",
"(",
")",
";",
"List",
... | Check point list child.
@param param the param
@param rule the rule
@param bodyObj the body obj
@param standardValue the standard value | [
"Check",
"point",
"list",
"child",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/msg/MsgChecker.java#L86-L97 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/msg/MsgChecker.java | MsgChecker.checkDataInnerRules | public void checkDataInnerRules(ValidationData data, Object bodyObj) {
data.getValidationRules().stream().filter(vr -> vr.isUse()).forEach(rule -> {
if (data.isListChild()) {
this.checkPointListChild(data, rule, bodyObj, rule.getStandardValue());
} else {
... | java | public void checkDataInnerRules(ValidationData data, Object bodyObj) {
data.getValidationRules().stream().filter(vr -> vr.isUse()).forEach(rule -> {
if (data.isListChild()) {
this.checkPointListChild(data, rule, bodyObj, rule.getStandardValue());
} else {
... | [
"public",
"void",
"checkDataInnerRules",
"(",
"ValidationData",
"data",
",",
"Object",
"bodyObj",
")",
"{",
"data",
".",
"getValidationRules",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"vr",
"->",
"vr",
".",
"isUse",
"(",
")",
")",
".",
"f... | Check data inner rules.
@param data the data
@param bodyObj the body obj | [
"Check",
"data",
"inner",
"rules",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/msg/MsgChecker.java#L105-L113 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/msg/MsgChecker.java | MsgChecker.checkRequest | public void checkRequest(BasicCheckInfo basicCheckInfo, Object bodyObj) {
String key = basicCheckInfo.getUniqueKey();
List<ValidationData> checkData = this.validationStore.getValidationDatas(basicCheckInfo.getParamType(), key);
if (checkData == null || checkData.isEmpty()) {
return... | java | public void checkRequest(BasicCheckInfo basicCheckInfo, Object bodyObj) {
String key = basicCheckInfo.getUniqueKey();
List<ValidationData> checkData = this.validationStore.getValidationDatas(basicCheckInfo.getParamType(), key);
if (checkData == null || checkData.isEmpty()) {
return... | [
"public",
"void",
"checkRequest",
"(",
"BasicCheckInfo",
"basicCheckInfo",
",",
"Object",
"bodyObj",
")",
"{",
"String",
"key",
"=",
"basicCheckInfo",
".",
"getUniqueKey",
"(",
")",
";",
"List",
"<",
"ValidationData",
">",
"checkData",
"=",
"this",
".",
"valid... | Check request.
@param basicCheckInfo the basic check info
@param bodyObj the body obj | [
"Check",
"request",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/msg/MsgChecker.java#L121-L132 | train |
wcm-io/wcm-io-config | core/src/main/java/io/wcm/config/core/management/impl/ParameterResolverImpl.java | ParameterResolverImpl.applyDefaultValues | private void applyDefaultValues(Map<String, Object> parameterValues) {
for (Parameter<?> parameter : allParameters) {
parameterValues.put(parameter.getName(), getParameterDefaultValue(parameter));
}
} | java | private void applyDefaultValues(Map<String, Object> parameterValues) {
for (Parameter<?> parameter : allParameters) {
parameterValues.put(parameter.getName(), getParameterDefaultValue(parameter));
}
} | [
"private",
"void",
"applyDefaultValues",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"parameterValues",
")",
"{",
"for",
"(",
"Parameter",
"<",
"?",
">",
"parameter",
":",
"allParameters",
")",
"{",
"parameterValues",
".",
"put",
"(",
"parameter",
".",
... | Apply default values for all parameters.
@param parameterValues Parameter values | [
"Apply",
"default",
"values",
"for",
"all",
"parameters",
"."
] | 9a03d72a4314163a171c7ef815fb6a1eba181828 | https://github.com/wcm-io/wcm-io-config/blob/9a03d72a4314163a171c7ef815fb6a1eba181828/core/src/main/java/io/wcm/config/core/management/impl/ParameterResolverImpl.java#L120-L124 | train |
wcm-io/wcm-io-config | core/src/main/java/io/wcm/config/core/management/impl/ParameterResolverImpl.java | ParameterResolverImpl.getParameterDefaultValue | private <T> T getParameterDefaultValue(Parameter<T> parameter) {
String defaultOsgiConfigProperty = parameter.getDefaultOsgiConfigProperty();
if (StringUtils.isNotBlank(defaultOsgiConfigProperty)) {
String[] parts = StringUtils.split(defaultOsgiConfigProperty, ":");
String className = parts[0];
... | java | private <T> T getParameterDefaultValue(Parameter<T> parameter) {
String defaultOsgiConfigProperty = parameter.getDefaultOsgiConfigProperty();
if (StringUtils.isNotBlank(defaultOsgiConfigProperty)) {
String[] parts = StringUtils.split(defaultOsgiConfigProperty, ":");
String className = parts[0];
... | [
"private",
"<",
"T",
">",
"T",
"getParameterDefaultValue",
"(",
"Parameter",
"<",
"T",
">",
"parameter",
")",
"{",
"String",
"defaultOsgiConfigProperty",
"=",
"parameter",
".",
"getDefaultOsgiConfigProperty",
"(",
")",
";",
"if",
"(",
"StringUtils",
".",
"isNotB... | Get default value for parameter - from OSGi configuration property or parameter definition itself.
@param parameter Parameter definition
@return Default value or null | [
"Get",
"default",
"value",
"for",
"parameter",
"-",
"from",
"OSGi",
"configuration",
"property",
"or",
"parameter",
"definition",
"itself",
"."
] | 9a03d72a4314163a171c7ef815fb6a1eba181828 | https://github.com/wcm-io/wcm-io-config/blob/9a03d72a4314163a171c7ef815fb6a1eba181828/core/src/main/java/io/wcm/config/core/management/impl/ParameterResolverImpl.java#L131-L144 | train |
wcm-io/wcm-io-config | core/src/main/java/io/wcm/config/core/management/impl/ParameterResolverImpl.java | ParameterResolverImpl.applyOverrideSystemDefault | private void applyOverrideSystemDefault(Map<String, Object> parameterValues) {
for (Parameter<?> parameter : allParameters) {
Object overrideValue = parameterOverride.getOverrideSystemDefault(parameter);
if (overrideValue != null) {
parameterValues.put(parameter.getName(), overrideValue);
... | java | private void applyOverrideSystemDefault(Map<String, Object> parameterValues) {
for (Parameter<?> parameter : allParameters) {
Object overrideValue = parameterOverride.getOverrideSystemDefault(parameter);
if (overrideValue != null) {
parameterValues.put(parameter.getName(), overrideValue);
... | [
"private",
"void",
"applyOverrideSystemDefault",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"parameterValues",
")",
"{",
"for",
"(",
"Parameter",
"<",
"?",
">",
"parameter",
":",
"allParameters",
")",
"{",
"Object",
"overrideValue",
"=",
"parameterOverride",... | Apply system-wide overrides for default values.
@param parameterValues Parameter values | [
"Apply",
"system",
"-",
"wide",
"overrides",
"for",
"default",
"values",
"."
] | 9a03d72a4314163a171c7ef815fb6a1eba181828 | https://github.com/wcm-io/wcm-io-config/blob/9a03d72a4314163a171c7ef815fb6a1eba181828/core/src/main/java/io/wcm/config/core/management/impl/ParameterResolverImpl.java#L150-L157 | train |
wcm-io/wcm-io-config | core/src/main/java/io/wcm/config/core/management/impl/ParameterResolverImpl.java | ParameterResolverImpl.ensureValidValueTypes | private Map<String, Object> ensureValidValueTypes(Map<String, Object> parameterValues) {
Map<String, Object> transformedParameterValues = new HashMap<>();
for (Map.Entry<String, Object> entry : parameterValues.entrySet()) {
if (entry.getKey() == null || entry.getValue() == null) {
continue;
... | java | private Map<String, Object> ensureValidValueTypes(Map<String, Object> parameterValues) {
Map<String, Object> transformedParameterValues = new HashMap<>();
for (Map.Entry<String, Object> entry : parameterValues.entrySet()) {
if (entry.getKey() == null || entry.getValue() == null) {
continue;
... | [
"private",
"Map",
"<",
"String",
",",
"Object",
">",
"ensureValidValueTypes",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"parameterValues",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"transformedParameterValues",
"=",
"new",
"HashMap",
"<>",
"("... | Make sure value types match with declared parameter types. Values which types do not match, or for which no
parameter definition exists are removed. Types are converted from persistence format if required.
@return Cleaned up parameter values | [
"Make",
"sure",
"value",
"types",
"match",
"with",
"declared",
"parameter",
"types",
".",
"Values",
"which",
"types",
"do",
"not",
"match",
"or",
"for",
"which",
"no",
"parameter",
"definition",
"exists",
"are",
"removed",
".",
"Types",
"are",
"converted",
"... | 9a03d72a4314163a171c7ef815fb6a1eba181828 | https://github.com/wcm-io/wcm-io-config/blob/9a03d72a4314163a171c7ef815fb6a1eba181828/core/src/main/java/io/wcm/config/core/management/impl/ParameterResolverImpl.java#L198-L219 | train |
wcm-io/wcm-io-config | core/src/main/java/io/wcm/config/core/management/impl/ParameterResolverImpl.java | ParameterResolverImpl.applyOverrideForce | private SortedSet<String> applyOverrideForce(String configurationId, Map<String, Object> parameterValues,
SortedSet<String> ancestorLockedParameterNames) {
for (Parameter<?> parameter : allParameters) {
Object overrideValue = parameterOverride.getOverrideForce(configurationId, parameter);
if (over... | java | private SortedSet<String> applyOverrideForce(String configurationId, Map<String, Object> parameterValues,
SortedSet<String> ancestorLockedParameterNames) {
for (Parameter<?> parameter : allParameters) {
Object overrideValue = parameterOverride.getOverrideForce(configurationId, parameter);
if (over... | [
"private",
"SortedSet",
"<",
"String",
">",
"applyOverrideForce",
"(",
"String",
"configurationId",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"parameterValues",
",",
"SortedSet",
"<",
"String",
">",
"ancestorLockedParameterNames",
")",
"{",
"for",
"(",
"Par... | Apply forced overrides for a configurationId.
@param configurationId Configuration id
@param parameterValues Parameter values
@param ancestorLockedParameterNames Set of locked parameter names on the configuration levels above.
@return Set of locked parameter names on this configuration level combined with the from the ... | [
"Apply",
"forced",
"overrides",
"for",
"a",
"configurationId",
"."
] | 9a03d72a4314163a171c7ef815fb6a1eba181828 | https://github.com/wcm-io/wcm-io-config/blob/9a03d72a4314163a171c7ef815fb6a1eba181828/core/src/main/java/io/wcm/config/core/management/impl/ParameterResolverImpl.java#L228-L241 | train |
wcm-io/wcm-io-config | core/src/main/java/io/wcm/config/core/management/impl/ParameterResolverImpl.java | ParameterResolverImpl.validateParameterProviders | private void validateParameterProviders() {
Set<String> parameterNames = new HashSet<>();
for (ParameterProvider provider : this.parameterProviders) {
Set<String> applicationIdsOfThisProvider = new HashSet<>();
for (Parameter<?> parameter : provider.getParameters()) {
if (StringUtils.isNotEm... | java | private void validateParameterProviders() {
Set<String> parameterNames = new HashSet<>();
for (ParameterProvider provider : this.parameterProviders) {
Set<String> applicationIdsOfThisProvider = new HashSet<>();
for (Parameter<?> parameter : provider.getParameters()) {
if (StringUtils.isNotEm... | [
"private",
"void",
"validateParameterProviders",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"parameterNames",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"ParameterProvider",
"provider",
":",
"this",
".",
"parameterProviders",
")",
"{",
"Set",
"<"... | Validate that application ids and configuration names are unique over all providers. | [
"Validate",
"that",
"application",
"ids",
"and",
"configuration",
"names",
"are",
"unique",
"over",
"all",
"providers",
"."
] | 9a03d72a4314163a171c7ef815fb6a1eba181828 | https://github.com/wcm-io/wcm-io-config/blob/9a03d72a4314163a171c7ef815fb6a1eba181828/core/src/main/java/io/wcm/config/core/management/impl/ParameterResolverImpl.java#L246-L266 | train |
wcm-io/wcm-io-config | core/src/main/java/io/wcm/config/core/management/impl/ParameterResolverImpl.java | ParameterResolverImpl.mergeSets | private SortedSet<String> mergeSets(SortedSet<String> primary, Set<String> secondary) {
SortedSet<String> result = primary;
if (!secondary.isEmpty()) {
result = new TreeSet<>();
result.addAll(primary);
result.addAll(secondary);
}
return result;
} | java | private SortedSet<String> mergeSets(SortedSet<String> primary, Set<String> secondary) {
SortedSet<String> result = primary;
if (!secondary.isEmpty()) {
result = new TreeSet<>();
result.addAll(primary);
result.addAll(secondary);
}
return result;
} | [
"private",
"SortedSet",
"<",
"String",
">",
"mergeSets",
"(",
"SortedSet",
"<",
"String",
">",
"primary",
",",
"Set",
"<",
"String",
">",
"secondary",
")",
"{",
"SortedSet",
"<",
"String",
">",
"result",
"=",
"primary",
";",
"if",
"(",
"!",
"secondary",
... | Merge two sets. If secondary set is empty return primary.
@param primary Primary set
@param secondary Secondary set
@return Merged set | [
"Merge",
"two",
"sets",
".",
"If",
"secondary",
"set",
"is",
"empty",
"return",
"primary",
"."
] | 9a03d72a4314163a171c7ef815fb6a1eba181828 | https://github.com/wcm-io/wcm-io-config/blob/9a03d72a4314163a171c7ef815fb6a1eba181828/core/src/main/java/io/wcm/config/core/management/impl/ParameterResolverImpl.java#L274-L282 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/domain/ValidationData.java | ValidationData.equalUrl | public boolean equalUrl(ReqUrl url) {
return url.getMethod().equalsIgnoreCase(this.method) && url.getUrl().equalsIgnoreCase(this.url);
} | java | public boolean equalUrl(ReqUrl url) {
return url.getMethod().equalsIgnoreCase(this.method) && url.getUrl().equalsIgnoreCase(this.url);
} | [
"public",
"boolean",
"equalUrl",
"(",
"ReqUrl",
"url",
")",
"{",
"return",
"url",
".",
"getMethod",
"(",
")",
".",
"equalsIgnoreCase",
"(",
"this",
".",
"method",
")",
"&&",
"url",
".",
"getUrl",
"(",
")",
".",
"equalsIgnoreCase",
"(",
"this",
".",
"ur... | Equal url boolean.
@param url the url
@return the boolean | [
"Equal",
"url",
"boolean",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/domain/ValidationData.java#L99-L101 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/domain/ValidationData.java | ValidationData.replaceValue | public void replaceValue(Object bodyObj, Object replaceValue) {
Object parentObj = bodyObj;
if(this.listChild) {
ValidationData rootListParent = this.findListParent();
if(this.deepLevel - rootListParent.deepLevel > 1 ){
parentObj = this.parent.getValue(bodyObj);
... | java | public void replaceValue(Object bodyObj, Object replaceValue) {
Object parentObj = bodyObj;
if(this.listChild) {
ValidationData rootListParent = this.findListParent();
if(this.deepLevel - rootListParent.deepLevel > 1 ){
parentObj = this.parent.getValue(bodyObj);
... | [
"public",
"void",
"replaceValue",
"(",
"Object",
"bodyObj",
",",
"Object",
"replaceValue",
")",
"{",
"Object",
"parentObj",
"=",
"bodyObj",
";",
"if",
"(",
"this",
".",
"listChild",
")",
"{",
"ValidationData",
"rootListParent",
"=",
"this",
".",
"findListParen... | Replace value.
@param bodyObj the body obj
@param replaceValue the replace value | [
"Replace",
"value",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/domain/ValidationData.java#L137-L153 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/domain/ValidationData.java | ValidationData.updateKey | public ValidationData updateKey(DetailParam detailParam) {
if (detailParam == null) {
return this;
}
this.methodKey = detailParam.getMethodKey();
this.parameterKey = this.paramType.getUniqueKey(this.methodKey);
this.urlMapping = detailParam.isUrlMapping();
re... | java | public ValidationData updateKey(DetailParam detailParam) {
if (detailParam == null) {
return this;
}
this.methodKey = detailParam.getMethodKey();
this.parameterKey = this.paramType.getUniqueKey(this.methodKey);
this.urlMapping = detailParam.isUrlMapping();
re... | [
"public",
"ValidationData",
"updateKey",
"(",
"DetailParam",
"detailParam",
")",
"{",
"if",
"(",
"detailParam",
"==",
"null",
")",
"{",
"return",
"this",
";",
"}",
"this",
".",
"methodKey",
"=",
"detailParam",
".",
"getMethodKey",
"(",
")",
";",
"this",
".... | Update key validation data.
@param detailParam the detail param
@return the validation data | [
"Update",
"key",
"validation",
"data",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/domain/ValidationData.java#L216-L225 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/domain/ValidationData.java | ValidationData.diffKey | public boolean diffKey(DetailParam detailParam){
if (detailParam == null) {
return false;
}
if(!detailParam.getMethodKey().equals(this.methodKey)){
return true;
}
return detailParam.isUrlMapping() != this.isUrlMapping();
} | java | public boolean diffKey(DetailParam detailParam){
if (detailParam == null) {
return false;
}
if(!detailParam.getMethodKey().equals(this.methodKey)){
return true;
}
return detailParam.isUrlMapping() != this.isUrlMapping();
} | [
"public",
"boolean",
"diffKey",
"(",
"DetailParam",
"detailParam",
")",
"{",
"if",
"(",
"detailParam",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"detailParam",
".",
"getMethodKey",
"(",
")",
".",
"equals",
"(",
"this",
".",
"... | Diff key boolean.
@param detailParam the detail param
@return the boolean | [
"Diff",
"key",
"boolean",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/domain/ValidationData.java#L233-L243 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/domain/ValidationData.java | ValidationData.updateField | public void updateField(Field field) {
this.name = field.getName();
this.obj = TypeCheckUtil.isObjClass(field);
this.list = TypeCheckUtil.isListClass(field);
this.number = TypeCheckUtil.isNumberClass(field);
this.enumType = field.getType().isEnum();
this.typeClass = field... | java | public void updateField(Field field) {
this.name = field.getName();
this.obj = TypeCheckUtil.isObjClass(field);
this.list = TypeCheckUtil.isListClass(field);
this.number = TypeCheckUtil.isNumberClass(field);
this.enumType = field.getType().isEnum();
this.typeClass = field... | [
"public",
"void",
"updateField",
"(",
"Field",
"field",
")",
"{",
"this",
".",
"name",
"=",
"field",
".",
"getName",
"(",
")",
";",
"this",
".",
"obj",
"=",
"TypeCheckUtil",
".",
"isObjClass",
"(",
"field",
")",
";",
"this",
".",
"list",
"=",
"TypeCh... | Update field.
@param field the field | [
"Update",
"field",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/domain/ValidationData.java#L250-L263 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/domain/ValidationData.java | ValidationData.minimalize | public ValidationData minimalize() {
this.setValidationRules(this.validationRules.stream().filter(vr -> vr.isUse()).collect(Collectors.toList()));
return this;
} | java | public ValidationData minimalize() {
this.setValidationRules(this.validationRules.stream().filter(vr -> vr.isUse()).collect(Collectors.toList()));
return this;
} | [
"public",
"ValidationData",
"minimalize",
"(",
")",
"{",
"this",
".",
"setValidationRules",
"(",
"this",
".",
"validationRules",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"vr",
"->",
"vr",
".",
"isUse",
"(",
")",
")",
".",
"collect",
"(",
"Collectors"... | Minimalize validation data.
@return the validation data | [
"Minimalize",
"validation",
"data",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/domain/ValidationData.java#L294-L297 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/domain/ValidationData.java | ValidationData.ruleSync | public ValidationData ruleSync(List<ValidationRule> rules) {
List<ValidationRule> ruleList = new ArrayList<>();
rules.forEach(rule -> {
ValidationRule existRule = this.getExistRule(rule);
ruleList.add(existRule != null ? existRule : rule);
});
this.validationRul... | java | public ValidationData ruleSync(List<ValidationRule> rules) {
List<ValidationRule> ruleList = new ArrayList<>();
rules.forEach(rule -> {
ValidationRule existRule = this.getExistRule(rule);
ruleList.add(existRule != null ? existRule : rule);
});
this.validationRul... | [
"public",
"ValidationData",
"ruleSync",
"(",
"List",
"<",
"ValidationRule",
">",
"rules",
")",
"{",
"List",
"<",
"ValidationRule",
">",
"ruleList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"rules",
".",
"forEach",
"(",
"rule",
"->",
"{",
"ValidationRu... | Rule sync validation data.
@param rules the rules
@return the validation data | [
"Rule",
"sync",
"validation",
"data",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/domain/ValidationData.java#L313-L328 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/domain/ValidationData.java | ValidationData.findListParent | public ValidationData findListParent() {
if (!this.listChild) {
return null;
}
ValidationData parent = this.parent;
while (parent != null && !parent.isList()) {
parent = parent.parent;
}
return parent;
} | java | public ValidationData findListParent() {
if (!this.listChild) {
return null;
}
ValidationData parent = this.parent;
while (parent != null && !parent.isList()) {
parent = parent.parent;
}
return parent;
} | [
"public",
"ValidationData",
"findListParent",
"(",
")",
"{",
"if",
"(",
"!",
"this",
".",
"listChild",
")",
"{",
"return",
"null",
";",
"}",
"ValidationData",
"parent",
"=",
"this",
".",
"parent",
";",
"while",
"(",
"parent",
"!=",
"null",
"&&",
"!",
"... | Find list parent validation data.
@return the validation data | [
"Find",
"list",
"parent",
"validation",
"data",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/domain/ValidationData.java#L335-L345 | train |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/RecordList.java | RecordList.getUniqueRecordsBy | public RecordList getUniqueRecordsBy(String fieldName) {
Set<String> uniqueKeys = new HashSet<String>();
final RecordListBuilder uniqueRecordListBuilder = new RecordListBuilder(schema);
for (int rowIndex = 0; rowIndex < this.size(); rowIndex++) {
final Record currentRecord = this.rec... | java | public RecordList getUniqueRecordsBy(String fieldName) {
Set<String> uniqueKeys = new HashSet<String>();
final RecordListBuilder uniqueRecordListBuilder = new RecordListBuilder(schema);
for (int rowIndex = 0; rowIndex < this.size(); rowIndex++) {
final Record currentRecord = this.rec... | [
"public",
"RecordList",
"getUniqueRecordsBy",
"(",
"String",
"fieldName",
")",
"{",
"Set",
"<",
"String",
">",
"uniqueKeys",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"final",
"RecordListBuilder",
"uniqueRecordListBuilder",
"=",
"new",
"RecordLis... | Picks the first available record by given fieldName
@param fieldName the unique field value
@return | [
"Picks",
"the",
"first",
"available",
"record",
"by",
"given",
"fieldName"
] | 224280bcd6e8045bda6b673584caf0aea5e4c841 | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/RecordList.java#L82-L94 | train |
OpenCompare/OpenCompare | org.opencompare/pcmdata-importers/src/main/java/pcm_Filter/mutate/Main.java | Main.main | public static void main(String[] args) throws IOException {
// TODO : le pcm mutate est bien différent du pcm de base, mais les changements ne sont pas pris en compte. A travailler !
// inputpath = args[0];
inputpath = "off_output/pcms/test_paget/input";
outputpath = "off_output/pcms/test_paget/output";
... | java | public static void main(String[] args) throws IOException {
// TODO : le pcm mutate est bien différent du pcm de base, mais les changements ne sont pas pris en compte. A travailler !
// inputpath = args[0];
inputpath = "off_output/pcms/test_paget/input";
outputpath = "off_output/pcms/test_paget/output";
... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"IOException",
"{",
"// TODO : le pcm mutate est bien différent du pcm de base, mais les changements ne sont pas pris en compte. A travailler !",
"// inputpath = args[0];",
"inputpath",
"=",
"\"off_... | give path with argv | [
"give",
"path",
"with",
"argv"
] | 6cd776466b375cb8ecca08fcd94e573d65e20b14 | https://github.com/OpenCompare/OpenCompare/blob/6cd776466b375cb8ecca08fcd94e573d65e20b14/org.opencompare/pcmdata-importers/src/main/java/pcm_Filter/mutate/Main.java#L27-L100 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/excel/PoiWorkBook.java | PoiWorkBook.writeFile | public void writeFile(String fn, HttpServletResponse res) {
ValidationFileUtil.initFileSendHeader(res, ValidationFileUtil.getEncodingFileName(fn + ".xls"), null);
try {
this.workBook.write(res.getOutputStream());
} catch (IOException e) {
throw new ValidationLibExceptio... | java | public void writeFile(String fn, HttpServletResponse res) {
ValidationFileUtil.initFileSendHeader(res, ValidationFileUtil.getEncodingFileName(fn + ".xls"), null);
try {
this.workBook.write(res.getOutputStream());
} catch (IOException e) {
throw new ValidationLibExceptio... | [
"public",
"void",
"writeFile",
"(",
"String",
"fn",
",",
"HttpServletResponse",
"res",
")",
"{",
"ValidationFileUtil",
".",
"initFileSendHeader",
"(",
"res",
",",
"ValidationFileUtil",
".",
"getEncodingFileName",
"(",
"fn",
"+",
"\".xls\"",
")",
",",
"null",
")"... | Write file.
@param fn the fn
@param res the res | [
"Write",
"file",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/excel/PoiWorkBook.java#L62-L71 | train |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/client/mvp/view/filter/FilterViewUI.java | FilterViewUI.onSelectFilter | @EventHandler
public void onSelectFilter(SelectFilterEvent selectFilterEvent){
for (FacetWidget facetWidget : filterList) {
if(facetWidget.getFacetField().equals(selectFilterEvent.getFilterName())){
for (FacetWidgetItem facetWidgetItem : facetWidget.getFacetWidgetItems()) {
... | java | @EventHandler
public void onSelectFilter(SelectFilterEvent selectFilterEvent){
for (FacetWidget facetWidget : filterList) {
if(facetWidget.getFacetField().equals(selectFilterEvent.getFilterName())){
for (FacetWidgetItem facetWidgetItem : facetWidget.getFacetWidgetItems()) {
... | [
"@",
"EventHandler",
"public",
"void",
"onSelectFilter",
"(",
"SelectFilterEvent",
"selectFilterEvent",
")",
"{",
"for",
"(",
"FacetWidget",
"facetWidget",
":",
"filterList",
")",
"{",
"if",
"(",
"facetWidget",
".",
"getFacetField",
"(",
")",
".",
"equals",
"(",... | When a SelectFilterEvent is triggered, this method will look for the filter and value and will select it. | [
"When",
"a",
"SelectFilterEvent",
"is",
"triggered",
"this",
"method",
"will",
"look",
"for",
"the",
"filter",
"and",
"value",
"and",
"will",
"select",
"it",
"."
] | 224280bcd6e8045bda6b673584caf0aea5e4c841 | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/mvp/view/filter/FilterViewUI.java#L414-L426 | train |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | MapCore/src/main/java/org/wwarn/mapcore/client/components/customwidgets/map/MapMarkerBuilder.java | MapMarkerBuilder.createMarker | public <T> GenericMarker<T> createMarker(T markerContext, GenericMapWidget mapWidget) {
this.map = mapWidget;
validateRequiredParameters();
if(map instanceof GoogleV3MapWidget){
return new GoogleV3Marker<T>(this, markerContext);
}
if(map instanceof OfflineMapWidget){
... | java | public <T> GenericMarker<T> createMarker(T markerContext, GenericMapWidget mapWidget) {
this.map = mapWidget;
validateRequiredParameters();
if(map instanceof GoogleV3MapWidget){
return new GoogleV3Marker<T>(this, markerContext);
}
if(map instanceof OfflineMapWidget){
... | [
"public",
"<",
"T",
">",
"GenericMarker",
"<",
"T",
">",
"createMarker",
"(",
"T",
"markerContext",
",",
"GenericMapWidget",
"mapWidget",
")",
"{",
"this",
".",
"map",
"=",
"mapWidget",
";",
"validateRequiredParameters",
"(",
")",
";",
"if",
"(",
"map",
"i... | Final build method of the builder, called once all parameters are setup for the Generic Marker
@param markerContext the marker context is intended to hold a reference to the record set backing the marker,
this used later in pop up panel and hover label construction to aid the client in building relevant
markup from th... | [
"Final",
"build",
"method",
"of",
"the",
"builder",
"called",
"once",
"all",
"parameters",
"are",
"setup",
"for",
"the",
"Generic",
"Marker"
] | 224280bcd6e8045bda6b673584caf0aea5e4c841 | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/MapCore/src/main/java/org/wwarn/mapcore/client/components/customwidgets/map/MapMarkerBuilder.java#L101-L111 | train |
wcm-io/wcm-io-config | core/src/main/java/io/wcm/config/core/impl/AdaptableUtil.java | AdaptableUtil.getResource | public static Resource getResource(Object adaptable) {
if (adaptable instanceof Resource) {
return (Resource)adaptable;
}
else if (adaptable instanceof SlingHttpServletRequest) {
SlingHttpServletRequest request = (SlingHttpServletRequest)adaptable;
return request.getResource();
}
r... | java | public static Resource getResource(Object adaptable) {
if (adaptable instanceof Resource) {
return (Resource)adaptable;
}
else if (adaptable instanceof SlingHttpServletRequest) {
SlingHttpServletRequest request = (SlingHttpServletRequest)adaptable;
return request.getResource();
}
r... | [
"public",
"static",
"Resource",
"getResource",
"(",
"Object",
"adaptable",
")",
"{",
"if",
"(",
"adaptable",
"instanceof",
"Resource",
")",
"{",
"return",
"(",
"Resource",
")",
"adaptable",
";",
"}",
"else",
"if",
"(",
"adaptable",
"instanceof",
"SlingHttpServ... | Tries to get the resource associated with the adaptable.
@param adaptable Adaptable
@return Resource or null | [
"Tries",
"to",
"get",
"the",
"resource",
"associated",
"with",
"the",
"adaptable",
"."
] | 9a03d72a4314163a171c7ef815fb6a1eba181828 | https://github.com/wcm-io/wcm-io-config/blob/9a03d72a4314163a171c7ef815fb6a1eba181828/core/src/main/java/io/wcm/config/core/impl/AdaptableUtil.java#L39-L48 | train |
metamx/extendedset | src/main/java/it/uniroma3/mat/extendedset/utilities/random/MersenneTwisterFast.java | MersenneTwisterFast.readState | public void readState(DataInputStream stream) throws IOException
{
int len = mt.length;
for(int x=0;x<len;x++) mt[x] = stream.readInt();
len = mag01.length;
for(int x=0;x<len;x++) mag01[x] = stream.readInt();
mti = stream.readInt();
__nextNextGau... | java | public void readState(DataInputStream stream) throws IOException
{
int len = mt.length;
for(int x=0;x<len;x++) mt[x] = stream.readInt();
len = mag01.length;
for(int x=0;x<len;x++) mag01[x] = stream.readInt();
mti = stream.readInt();
__nextNextGau... | [
"public",
"void",
"readState",
"(",
"DataInputStream",
"stream",
")",
"throws",
"IOException",
"{",
"int",
"len",
"=",
"mt",
".",
"length",
";",
"for",
"(",
"int",
"x",
"=",
"0",
";",
"x",
"<",
"len",
";",
"x",
"++",
")",
"mt",
"[",
"x",
"]",
"="... | Reads the entire state of the MersenneTwister RNG from the stream
@param stream
@throws IOException | [
"Reads",
"the",
"entire",
"state",
"of",
"the",
"MersenneTwister",
"RNG",
"from",
"the",
"stream"
] | 0f77c28057fac9c1bd6d79fbe5425b8efe5742a8 | https://github.com/metamx/extendedset/blob/0f77c28057fac9c1bd6d79fbe5425b8efe5742a8/src/main/java/it/uniroma3/mat/extendedset/utilities/random/MersenneTwisterFast.java#L215-L226 | train |
metamx/extendedset | src/main/java/it/uniroma3/mat/extendedset/utilities/random/MersenneTwisterFast.java | MersenneTwisterFast.writeState | public void writeState(DataOutputStream stream) throws IOException
{
int len = mt.length;
for(int x=0;x<len;x++) stream.writeInt(mt[x]);
len = mag01.length;
for(int x=0;x<len;x++) stream.writeInt(mag01[x]);
stream.writeInt(mti);
stream.writeDoubl... | java | public void writeState(DataOutputStream stream) throws IOException
{
int len = mt.length;
for(int x=0;x<len;x++) stream.writeInt(mt[x]);
len = mag01.length;
for(int x=0;x<len;x++) stream.writeInt(mag01[x]);
stream.writeInt(mti);
stream.writeDoubl... | [
"public",
"void",
"writeState",
"(",
"DataOutputStream",
"stream",
")",
"throws",
"IOException",
"{",
"int",
"len",
"=",
"mt",
".",
"length",
";",
"for",
"(",
"int",
"x",
"=",
"0",
";",
"x",
"<",
"len",
";",
"x",
"++",
")",
"stream",
".",
"writeInt",... | Writes the entire state of the MersenneTwister RNG to the stream
@param stream
@throws IOException | [
"Writes",
"the",
"entire",
"state",
"of",
"the",
"MersenneTwister",
"RNG",
"to",
"the",
"stream"
] | 0f77c28057fac9c1bd6d79fbe5425b8efe5742a8 | https://github.com/metamx/extendedset/blob/0f77c28057fac9c1bd6d79fbe5425b8efe5742a8/src/main/java/it/uniroma3/mat/extendedset/utilities/random/MersenneTwisterFast.java#L231-L242 | train |
metamx/extendedset | src/main/java/it/uniroma3/mat/extendedset/utilities/random/MersenneTwisterFast.java | MersenneTwisterFast.setSeed | synchronized public void setSeed(final int[] array)
{
if (array.length == 0)
throw new IllegalArgumentException("Array length must be greater than zero");
int i, j, k;
setSeed(19650218);
i=1; j=0;
k = (N>array.length ? N : array.length);
for (; k!=0; k... | java | synchronized public void setSeed(final int[] array)
{
if (array.length == 0)
throw new IllegalArgumentException("Array length must be greater than zero");
int i, j, k;
setSeed(19650218);
i=1; j=0;
k = (N>array.length ? N : array.length);
for (; k!=0; k... | [
"synchronized",
"public",
"void",
"setSeed",
"(",
"final",
"int",
"[",
"]",
"array",
")",
"{",
"if",
"(",
"array",
".",
"length",
"==",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Array length must be greater than zero\"",
")",
";",
"int",
"i... | Sets the seed of the MersenneTwister using an array of integers.
Your array must have a non-zero length. Only the first 624 integers
in the array are used; if the array is shorter than this then
integers are repeatedly used in a wrap-around fashion.
@param array | [
"Sets",
"the",
"seed",
"of",
"the",
"MersenneTwister",
"using",
"an",
"array",
"of",
"integers",
".",
"Your",
"array",
"must",
"have",
"a",
"non",
"-",
"zero",
"length",
".",
"Only",
"the",
"first",
"624",
"integers",
"in",
"the",
"array",
"are",
"used",... | 0f77c28057fac9c1bd6d79fbe5425b8efe5742a8 | https://github.com/metamx/extendedset/blob/0f77c28057fac9c1bd6d79fbe5425b8efe5742a8/src/main/java/it/uniroma3/mat/extendedset/utilities/random/MersenneTwisterFast.java#L316-L344 | train |
OpenCompare/OpenCompare | org.opencompare/pcmdata-importers/src/main/java/data_omdb/TexttoFile.java | Lireetecrire.lire | public void lire()
{
try
{
String adressedufichier = System.getProperty("user.dir") + "\\monfichier.txt";
FileReader fr = new FileReader(adressedufichier);
BufferedReader br = new BufferedReader(fr);
String texte = "";
int a = 0;
while(a<2) //petite boucle 2 fois
{
text... | java | public void lire()
{
try
{
String adressedufichier = System.getProperty("user.dir") + "\\monfichier.txt";
FileReader fr = new FileReader(adressedufichier);
BufferedReader br = new BufferedReader(fr);
String texte = "";
int a = 0;
while(a<2) //petite boucle 2 fois
{
text... | [
"public",
"void",
"lire",
"(",
")",
"{",
"try",
"{",
"String",
"adressedufichier",
"=",
"System",
".",
"getProperty",
"(",
"\"user.dir\"",
")",
"+",
"\"\\\\monfichier.txt\"",
";",
"FileReader",
"fr",
"=",
"new",
"FileReader",
"(",
"adressedufichier",
")",
";",... | je vais moins commenter cette partie c'est presque la meme chose | [
"je",
"vais",
"moins",
"commenter",
"cette",
"partie",
"c",
"est",
"presque",
"la",
"meme",
"chose"
] | 6cd776466b375cb8ecca08fcd94e573d65e20b14 | https://github.com/OpenCompare/OpenCompare/blob/6cd776466b375cb8ecca08fcd94e573d65e20b14/org.opencompare/pcmdata-importers/src/main/java/data_omdb/TexttoFile.java#L73-L106 | train |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/client/util/SerializationUtil.java | SerializationUtil.deserialize | public <T> T deserialize(Class<T> clazz, String stringContainingSerialisedInput) {
T instance;
try {
instance = storageSerializer.deserialize(clazz, stringContainingSerialisedInput);
} catch (SerializationException e) {
throw new IllegalStateException("unable to serialise... | java | public <T> T deserialize(Class<T> clazz, String stringContainingSerialisedInput) {
T instance;
try {
instance = storageSerializer.deserialize(clazz, stringContainingSerialisedInput);
} catch (SerializationException e) {
throw new IllegalStateException("unable to serialise... | [
"public",
"<",
"T",
">",
"T",
"deserialize",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"String",
"stringContainingSerialisedInput",
")",
"{",
"T",
"instance",
";",
"try",
"{",
"instance",
"=",
"storageSerializer",
".",
"deserialize",
"(",
"clazz",
",",
"s... | Returns an object from a serialised string
@param clazz Class.name value
@param stringContainingSerialisedInput
@param <T>
@return | [
"Returns",
"an",
"object",
"from",
"a",
"serialised",
"string"
] | 224280bcd6e8045bda6b673584caf0aea5e4c841 | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/util/SerializationUtil.java#L65-L73 | train |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/ClientSideSearchDataProvider.java | ClientSideSearchDataProvider.parseQuery | private BitSet parseQuery(FilterQuery filterQuery, DataSchema schema) {
BitSet queryBitSet = new BitSet();
if(filterQuery instanceof MatchAllQuery || filterQuery.getFilterQueries().size() < 1) return queryBitSet;
//facet drill down happens here
for (String filterField : filterQuery.getF... | java | private BitSet parseQuery(FilterQuery filterQuery, DataSchema schema) {
BitSet queryBitSet = new BitSet();
if(filterQuery instanceof MatchAllQuery || filterQuery.getFilterQueries().size() < 1) return queryBitSet;
//facet drill down happens here
for (String filterField : filterQuery.getF... | [
"private",
"BitSet",
"parseQuery",
"(",
"FilterQuery",
"filterQuery",
",",
"DataSchema",
"schema",
")",
"{",
"BitSet",
"queryBitSet",
"=",
"new",
"BitSet",
"(",
")",
";",
"if",
"(",
"filterQuery",
"instanceof",
"MatchAllQuery",
"||",
"filterQuery",
".",
"getFilt... | Calculates which documents are available given the current FilterQuery selection
@param filterQuery
@param schema
@return a restrictedBitSetOfDocumentsAvailableAfterQuery document order is preserved | [
"Calculates",
"which",
"documents",
"are",
"available",
"given",
"the",
"current",
"FilterQuery",
"selection"
] | 224280bcd6e8045bda6b673584caf0aea5e4c841 | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/ClientSideSearchDataProvider.java#L578-L627 | train |
lightblue-platform/lightblue-client | core/src/main/java/com/redhat/lightblue/client/response/DefaultLightblueDataResponse.java | DefaultLightblueDataResponse.getResultMetadata | @Override
public ResultMetadata[] getResultMetadata() throws LightblueParseException {
JsonNode node=getJson().get("resultMetadata");
if(node instanceof ArrayNode) {
try {
return getMapper().readValue(node.traverse(),ResultMetadata[].class);
} catch (IOExcepti... | java | @Override
public ResultMetadata[] getResultMetadata() throws LightblueParseException {
JsonNode node=getJson().get("resultMetadata");
if(node instanceof ArrayNode) {
try {
return getMapper().readValue(node.traverse(),ResultMetadata[].class);
} catch (IOExcepti... | [
"@",
"Override",
"public",
"ResultMetadata",
"[",
"]",
"getResultMetadata",
"(",
")",
"throws",
"LightblueParseException",
"{",
"JsonNode",
"node",
"=",
"getJson",
"(",
")",
".",
"get",
"(",
"\"resultMetadata\"",
")",
";",
"if",
"(",
"node",
"instanceof",
"Arr... | Returns a result metadata array where each element corresponds
to the metadata for the result at the same index in processed
array. | [
"Returns",
"a",
"result",
"metadata",
"array",
"where",
"each",
"element",
"corresponds",
"to",
"the",
"metadata",
"for",
"the",
"result",
"at",
"the",
"same",
"index",
"in",
"processed",
"array",
"."
] | 03790aff34e90d3889f60fd6c603c21a21dc1a40 | https://github.com/lightblue-platform/lightblue-client/blob/03790aff34e90d3889f60fd6c603c21a21dc1a40/core/src/main/java/com/redhat/lightblue/client/response/DefaultLightblueDataResponse.java#L60-L72 | train |
OpenCompare/OpenCompare | org.opencompare/api-java-impl/src/main/java/org/opencompare/api/java/impl/PCMImpl.java | PCMImpl.diffFeatures | private Map<Feature, Feature> diffFeatures(List<Feature> pcm1Features, List<Feature> pcm2Features, PCMElementComparator comparator, DiffResult result) {
List<Feature> commonFeatures = new ArrayList<Feature>();
List<Feature> featuresOnlyInPCM1 = new ArrayList<Feature>();
List<Feature> featuresOnl... | java | private Map<Feature, Feature> diffFeatures(List<Feature> pcm1Features, List<Feature> pcm2Features, PCMElementComparator comparator, DiffResult result) {
List<Feature> commonFeatures = new ArrayList<Feature>();
List<Feature> featuresOnlyInPCM1 = new ArrayList<Feature>();
List<Feature> featuresOnl... | [
"private",
"Map",
"<",
"Feature",
",",
"Feature",
">",
"diffFeatures",
"(",
"List",
"<",
"Feature",
">",
"pcm1Features",
",",
"List",
"<",
"Feature",
">",
"pcm2Features",
",",
"PCMElementComparator",
"comparator",
",",
"DiffResult",
"result",
")",
"{",
"List",... | Compare the features of two PCMs
@param pcm1Features
@param pcm2Features
@param comparator
@param result
@return equivalent features | [
"Compare",
"the",
"features",
"of",
"two",
"PCMs"
] | 6cd776466b375cb8ecca08fcd94e573d65e20b14 | https://github.com/OpenCompare/OpenCompare/blob/6cd776466b375cb8ecca08fcd94e573d65e20b14/org.opencompare/api-java-impl/src/main/java/org/opencompare/api/java/impl/PCMImpl.java#L383-L412 | train |
OpenCompare/OpenCompare | org.opencompare/api-java-impl/src/main/java/org/opencompare/api/java/impl/PCMImpl.java | PCMImpl.diffProducts | private Map<Product, Product> diffProducts(List<Product> pcm1Products, List<Product> pcm2Products, PCMElementComparator comparator, DiffResult result) {
List<Product> commonProducts = new ArrayList<Product>();
List<Product> productsOnlyInPCM1 = new ArrayList<Product>();
List<Product> productsOnl... | java | private Map<Product, Product> diffProducts(List<Product> pcm1Products, List<Product> pcm2Products, PCMElementComparator comparator, DiffResult result) {
List<Product> commonProducts = new ArrayList<Product>();
List<Product> productsOnlyInPCM1 = new ArrayList<Product>();
List<Product> productsOnl... | [
"private",
"Map",
"<",
"Product",
",",
"Product",
">",
"diffProducts",
"(",
"List",
"<",
"Product",
">",
"pcm1Products",
",",
"List",
"<",
"Product",
">",
"pcm2Products",
",",
"PCMElementComparator",
"comparator",
",",
"DiffResult",
"result",
")",
"{",
"List",... | Compare the products of two PCMs
@param pcm1Products
@param pcm2Products
@param comparator
@param result
@return equivalent products | [
"Compare",
"the",
"products",
"of",
"two",
"PCMs"
] | 6cd776466b375cb8ecca08fcd94e573d65e20b14 | https://github.com/OpenCompare/OpenCompare/blob/6cd776466b375cb8ecca08fcd94e573d65e20b14/org.opencompare/api-java-impl/src/main/java/org/opencompare/api/java/impl/PCMImpl.java#L422-L454 | train |
wcm-io/wcm-io-config | core/src/main/java/io/wcm/config/core/management/impl/PersistenceTypeConversion.java | PersistenceTypeConversion.toPersistenceType | public static Object toPersistenceType(Object value, Class<?> parameterType) {
if (!isTypeConversionRequired(parameterType)) {
return value;
}
if (Map.class.isAssignableFrom(parameterType) && (value instanceof Map)) {
Map<?, ?> map = (Map<?, ?>)value;
Map.Entry<?, ?>[] entries = Iterators.... | java | public static Object toPersistenceType(Object value, Class<?> parameterType) {
if (!isTypeConversionRequired(parameterType)) {
return value;
}
if (Map.class.isAssignableFrom(parameterType) && (value instanceof Map)) {
Map<?, ?> map = (Map<?, ?>)value;
Map.Entry<?, ?>[] entries = Iterators.... | [
"public",
"static",
"Object",
"toPersistenceType",
"(",
"Object",
"value",
",",
"Class",
"<",
"?",
">",
"parameterType",
")",
"{",
"if",
"(",
"!",
"isTypeConversionRequired",
"(",
"parameterType",
")",
")",
"{",
"return",
"value",
";",
"}",
"if",
"(",
"Map... | Convert object to be persisted.
@param value Configured value
@param parameterType Parameter type
@return value that can be persisted | [
"Convert",
"object",
"to",
"be",
"persisted",
"."
] | 9a03d72a4314163a171c7ef815fb6a1eba181828 | https://github.com/wcm-io/wcm-io-config/blob/9a03d72a4314163a171c7ef815fb6a1eba181828/core/src/main/java/io/wcm/config/core/management/impl/PersistenceTypeConversion.java#L63-L80 | train |
wcm-io/wcm-io-config | core/src/main/java/io/wcm/config/core/management/impl/PersistenceTypeConversion.java | PersistenceTypeConversion.fromPersistenceType | public static Object fromPersistenceType(Object value, Class<?> parameterType) {
if (!isTypeConversionRequired(parameterType)) {
return value;
}
if (Map.class.isAssignableFrom(parameterType) && (value instanceof String[])) {
String[] rows = (String[])value;
Map<String, String> map = new Li... | java | public static Object fromPersistenceType(Object value, Class<?> parameterType) {
if (!isTypeConversionRequired(parameterType)) {
return value;
}
if (Map.class.isAssignableFrom(parameterType) && (value instanceof String[])) {
String[] rows = (String[])value;
Map<String, String> map = new Li... | [
"public",
"static",
"Object",
"fromPersistenceType",
"(",
"Object",
"value",
",",
"Class",
"<",
"?",
">",
"parameterType",
")",
"{",
"if",
"(",
"!",
"isTypeConversionRequired",
"(",
"parameterType",
")",
")",
"{",
"return",
"value",
";",
"}",
"if",
"(",
"M... | Convert object from persistence to be used in configuration.
@param value Persisted value
@param parameterType Parameter type
@return Configured value | [
"Convert",
"object",
"from",
"persistence",
"to",
"be",
"used",
"in",
"configuration",
"."
] | 9a03d72a4314163a171c7ef815fb6a1eba181828 | https://github.com/wcm-io/wcm-io-config/blob/9a03d72a4314163a171c7ef815fb6a1eba181828/core/src/main/java/io/wcm/config/core/management/impl/PersistenceTypeConversion.java#L88-L106 | train |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/FilterQuery.java | FilterQuery.addFilter | public void addFilter(String field, String valueToFilter){
if(StringUtils.isEmpty(field) || StringUtils.isEmpty(valueToFilter)){
throw new IllegalArgumentException("Expected all attributes to be non empty");
}
Set<String> valuesToFilter = new HashSet<String>();
valuesToFilter... | java | public void addFilter(String field, String valueToFilter){
if(StringUtils.isEmpty(field) || StringUtils.isEmpty(valueToFilter)){
throw new IllegalArgumentException("Expected all attributes to be non empty");
}
Set<String> valuesToFilter = new HashSet<String>();
valuesToFilter... | [
"public",
"void",
"addFilter",
"(",
"String",
"field",
",",
"String",
"valueToFilter",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"field",
")",
"||",
"StringUtils",
".",
"isEmpty",
"(",
"valueToFilter",
")",
")",
"{",
"throw",
"new",
"Illegal... | add a filter to the to build FilterQuery instance
@param field
@param valueToFilter | [
"add",
"a",
"filter",
"to",
"the",
"to",
"build",
"FilterQuery",
"instance"
] | 224280bcd6e8045bda6b673584caf0aea5e4c841 | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/FilterQuery.java#L91-L98 | train |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/FilterQuery.java | FilterQuery.addMultipleValuesFilter | public void addMultipleValuesFilter(String field, Set<String> valueToFilter){
if(!valueToFilter.isEmpty()){
filterQueries.put(field, new FilterFieldValue(field, valueToFilter));
}
} | java | public void addMultipleValuesFilter(String field, Set<String> valueToFilter){
if(!valueToFilter.isEmpty()){
filterQueries.put(field, new FilterFieldValue(field, valueToFilter));
}
} | [
"public",
"void",
"addMultipleValuesFilter",
"(",
"String",
"field",
",",
"Set",
"<",
"String",
">",
"valueToFilter",
")",
"{",
"if",
"(",
"!",
"valueToFilter",
".",
"isEmpty",
"(",
")",
")",
"{",
"filterQueries",
".",
"put",
"(",
"field",
",",
"new",
"F... | add a filter with multiple values to build FilterQuery instance
@param field
@param valueToFilter | [
"add",
"a",
"filter",
"with",
"multiple",
"values",
"to",
"build",
"FilterQuery",
"instance"
] | 224280bcd6e8045bda6b673584caf0aea5e4c841 | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/FilterQuery.java#L105-L109 | train |
metamx/extendedset | src/main/java/it/uniroma3/mat/extendedset/utilities/random/MersenneTwister.java | MersenneTwister.nextLong | public long nextLong(final long n)
{
if (n<=0)
throw new IllegalArgumentException("n must be > 0");
long bits, val;
do
{
bits = (nextLong() >>> 1);
val = bits % n;
}
while(bits - val + (n-1) < 0);
ret... | java | public long nextLong(final long n)
{
if (n<=0)
throw new IllegalArgumentException("n must be > 0");
long bits, val;
do
{
bits = (nextLong() >>> 1);
val = bits % n;
}
while(bits - val + (n-1) < 0);
ret... | [
"public",
"long",
"nextLong",
"(",
"final",
"long",
"n",
")",
"{",
"if",
"(",
"n",
"<=",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"n must be > 0\"",
")",
";",
"long",
"bits",
",",
"val",
";",
"do",
"{",
"bits",
"=",
"(",
"nextLong",... | This method is for completness' sake.
Returns a long drawn uniformly from 0 to n-1. Suffice it to say,
n must be > 0, or an IllegalArgumentException is raised.
@param n
@return ? | [
"This",
"method",
"is",
"for",
"completness",
"sake",
".",
"Returns",
"a",
"long",
"drawn",
"uniformly",
"from",
"0",
"to",
"n",
"-",
"1",
".",
"Suffice",
"it",
"to",
"say",
"n",
"must",
"be",
">",
"0",
"or",
"an",
"IllegalArgumentException",
"is",
"ra... | 0f77c28057fac9c1bd6d79fbe5425b8efe5742a8 | https://github.com/metamx/extendedset/blob/0f77c28057fac9c1bd6d79fbe5425b8efe5742a8/src/main/java/it/uniroma3/mat/extendedset/utilities/random/MersenneTwister.java#L470-L483 | train |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/FieldInvertedIndex.java | FieldInvertedIndex.addDocument | public void addDocument(String... fields){
for (int i = 0; i < fields.length; i++) {
final DataType type = schema.getType(i);
String field = fields[i];
final Map<String, Set<Integer>> stringSetMap = this.fields.get(i);
if(type == DataType.DateYear){ // reformat fi... | java | public void addDocument(String... fields){
for (int i = 0; i < fields.length; i++) {
final DataType type = schema.getType(i);
String field = fields[i];
final Map<String, Set<Integer>> stringSetMap = this.fields.get(i);
if(type == DataType.DateYear){ // reformat fi... | [
"public",
"void",
"addDocument",
"(",
"String",
"...",
"fields",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"fields",
".",
"length",
";",
"i",
"++",
")",
"{",
"final",
"DataType",
"type",
"=",
"schema",
".",
"getType",
"(",
"i",
"... | add fields on index | [
"add",
"fields",
"on",
"index"
] | 224280bcd6e8045bda6b673584caf0aea5e4c841 | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/FieldInvertedIndex.java#L78-L94 | train |
OpenCompare/OpenCompare | org.opencompare/pcmdata-importers/src/main/java/misc/hints/MyPCMPrinter.java | MyPCMPrinter.print | public void print(PCM pcm) {
// We start by listing the names of the products
System.out.println("--- Products ---");
for (Product product : pcm.getProducts()) {
System.out.println(product.getKeyContent());
}
// Then, we use a visitor to print the content of the cel... | java | public void print(PCM pcm) {
// We start by listing the names of the products
System.out.println("--- Products ---");
for (Product product : pcm.getProducts()) {
System.out.println(product.getKeyContent());
}
// Then, we use a visitor to print the content of the cel... | [
"public",
"void",
"print",
"(",
"PCM",
"pcm",
")",
"{",
"// We start by listing the names of the products",
"System",
".",
"out",
".",
"println",
"(",
"\"--- Products ---\"",
")",
";",
"for",
"(",
"Product",
"product",
":",
"pcm",
".",
"getProducts",
"(",
")",
... | Print some information contained in a PCM
@param pcm: PCM to print | [
"Print",
"some",
"information",
"contained",
"in",
"a",
"PCM"
] | 6cd776466b375cb8ecca08fcd94e573d65e20b14 | https://github.com/OpenCompare/OpenCompare/blob/6cd776466b375cb8ecca08fcd94e573d65e20b14/org.opencompare/pcmdata-importers/src/main/java/misc/hints/MyPCMPrinter.java#L20-L32 | train |
OpenCompare/OpenCompare | org.opencompare/pcmdata-importers/src/main/java/misc/hints/MyPCMPrinter.java | MyPCMPrinter.visit | @Override
public void visit(PCM pcm) {
for (Product product : pcm.getProducts()) {
product.accept(this);
}
} | java | @Override
public void visit(PCM pcm) {
for (Product product : pcm.getProducts()) {
product.accept(this);
}
} | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"PCM",
"pcm",
")",
"{",
"for",
"(",
"Product",
"product",
":",
"pcm",
".",
"getProducts",
"(",
")",
")",
"{",
"product",
".",
"accept",
"(",
"this",
")",
";",
"}",
"}"
] | Methods for the visitor | [
"Methods",
"for",
"the",
"visitor"
] | 6cd776466b375cb8ecca08fcd94e573d65e20b14 | https://github.com/OpenCompare/OpenCompare/blob/6cd776466b375cb8ecca08fcd94e573d65e20b14/org.opencompare/pcmdata-importers/src/main/java/misc/hints/MyPCMPrinter.java#L37-L42 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/domain/ReqUrl.java | ReqUrl.getSheetName | public String getSheetName(int idx) {
String name = method + "|" + url.replace("/", "|");
if (name.length() > 30) {
return name.substring(0, 29) + idx;
}
return name;
} | java | public String getSheetName(int idx) {
String name = method + "|" + url.replace("/", "|");
if (name.length() > 30) {
return name.substring(0, 29) + idx;
}
return name;
} | [
"public",
"String",
"getSheetName",
"(",
"int",
"idx",
")",
"{",
"String",
"name",
"=",
"method",
"+",
"\"|\"",
"+",
"url",
".",
"replace",
"(",
"\"/\"",
",",
"\"|\"",
")",
";",
"if",
"(",
"name",
".",
"length",
"(",
")",
">",
"30",
")",
"{",
"re... | Gets sheet name.
@param idx the idx
@return the sheet name | [
"Gets",
"sheet",
"name",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/domain/ReqUrl.java#L70-L76 | train |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/server/core/LuceneSearchServiceImpl.java | LuceneSearchServiceImpl.setupIndexMonitor | private void setupIndexMonitor(final DataSchema dataSchema, final GenericDataSource dataSource) {
logger.log(FINE,"LuceneSearchServiceImpl::setupIndexMonitor Attempting to setup Index monitor...");
try {
if(GoogleAppEngineUtil.isGaeEnv()){
return; // only use for pure lucene... | java | private void setupIndexMonitor(final DataSchema dataSchema, final GenericDataSource dataSource) {
logger.log(FINE,"LuceneSearchServiceImpl::setupIndexMonitor Attempting to setup Index monitor...");
try {
if(GoogleAppEngineUtil.isGaeEnv()){
return; // only use for pure lucene... | [
"private",
"void",
"setupIndexMonitor",
"(",
"final",
"DataSchema",
"dataSchema",
",",
"final",
"GenericDataSource",
"dataSource",
")",
"{",
"logger",
".",
"log",
"(",
"FINE",
",",
"\"LuceneSearchServiceImpl::setupIndexMonitor Attempting to setup Index monitor...\"",
")",
"... | setup a monitor to watch for changes in datasource
@param dataSchema
@param dataSource | [
"setup",
"a",
"monitor",
"to",
"watch",
"for",
"changes",
"in",
"datasource"
] | 224280bcd6e8045bda6b673584caf0aea5e4c841 | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/server/core/LuceneSearchServiceImpl.java#L120-L158 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ValidationReqUrlUtil.java | ValidationReqUrlUtil.getUrlListFromValidationDatas | public static List<ReqUrl> getUrlListFromValidationDatas(List<ValidationData> datas) {
Map<String, ReqUrl> urlMap = new HashMap<>();
datas.stream().forEach(data -> {
ReqUrl url = new ReqUrl(data);
urlMap.put(url.getUniqueKey(), url);
});
return urlMap.entrySet().... | java | public static List<ReqUrl> getUrlListFromValidationDatas(List<ValidationData> datas) {
Map<String, ReqUrl> urlMap = new HashMap<>();
datas.stream().forEach(data -> {
ReqUrl url = new ReqUrl(data);
urlMap.put(url.getUniqueKey(), url);
});
return urlMap.entrySet().... | [
"public",
"static",
"List",
"<",
"ReqUrl",
">",
"getUrlListFromValidationDatas",
"(",
"List",
"<",
"ValidationData",
">",
"datas",
")",
"{",
"Map",
"<",
"String",
",",
"ReqUrl",
">",
"urlMap",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"datas",
".",
"st... | Gets url list from validation datas.
@param datas the datas
@return the url list from validation datas | [
"Gets",
"url",
"list",
"from",
"validation",
"datas",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ValidationReqUrlUtil.java#L22-L30 | train |
metamx/extendedset | src/main/java/it/uniroma3/mat/extendedset/intset/ConciseSet.java | ConciseSet.appendLiteral | private void appendLiteral(int word)
{
// when we have a zero sequence of the maximum lenght (that is,
// 00.00000.1111111111111111111111111 = 0x01FFFFFF), it could happen
// that we try to append a zero literal because the result of the given operation must be an
// empty set. Whitout the follow... | java | private void appendLiteral(int word)
{
// when we have a zero sequence of the maximum lenght (that is,
// 00.00000.1111111111111111111111111 = 0x01FFFFFF), it could happen
// that we try to append a zero literal because the result of the given operation must be an
// empty set. Whitout the follow... | [
"private",
"void",
"appendLiteral",
"(",
"int",
"word",
")",
"{",
"// when we have a zero sequence of the maximum lenght (that is,\r",
"// 00.00000.1111111111111111111111111 = 0x01FFFFFF), it could happen\r",
"// that we try to append a zero literal because the result of the given operation must... | Append a literal word after the last word
@param word the new literal word. Note that the leftmost bit <b>must</b>
be set to 1. | [
"Append",
"a",
"literal",
"word",
"after",
"the",
"last",
"word"
] | 0f77c28057fac9c1bd6d79fbe5425b8efe5742a8 | https://github.com/metamx/extendedset/blob/0f77c28057fac9c1bd6d79fbe5425b8efe5742a8/src/main/java/it/uniroma3/mat/extendedset/intset/ConciseSet.java#L809-L852 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/repository/index/util/ValidationIndexUtil.java | ValidationIndexUtil.addIndexData | public static void addIndexData(ValidationData data, ValidationDataIndex index) {
String key = index.getKey(data);
List<ValidationData> datas = index.get(key);
if (datas == null) {
datas = new ArrayList<>();
}
datas.add(data);
index.getMap().put(key, datas);
... | java | public static void addIndexData(ValidationData data, ValidationDataIndex index) {
String key = index.getKey(data);
List<ValidationData> datas = index.get(key);
if (datas == null) {
datas = new ArrayList<>();
}
datas.add(data);
index.getMap().put(key, datas);
... | [
"public",
"static",
"void",
"addIndexData",
"(",
"ValidationData",
"data",
",",
"ValidationDataIndex",
"index",
")",
"{",
"String",
"key",
"=",
"index",
".",
"getKey",
"(",
"data",
")",
";",
"List",
"<",
"ValidationData",
">",
"datas",
"=",
"index",
".",
"... | Add index data.
@param data the data
@param index the index | [
"Add",
"index",
"data",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/repository/index/util/ValidationIndexUtil.java#L21-L29 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/repository/index/util/ValidationIndexUtil.java | ValidationIndexUtil.removeIndexData | public static void removeIndexData(ValidationData data, ValidationDataIndex index) {
String key = index.getKey(data);
List<ValidationData> datas = index.get(key);
if (!datas.isEmpty()) {
datas = datas.stream().filter(d -> !d.getId().equals(data.getId())).collect(Collectors.toList()... | java | public static void removeIndexData(ValidationData data, ValidationDataIndex index) {
String key = index.getKey(data);
List<ValidationData> datas = index.get(key);
if (!datas.isEmpty()) {
datas = datas.stream().filter(d -> !d.getId().equals(data.getId())).collect(Collectors.toList()... | [
"public",
"static",
"void",
"removeIndexData",
"(",
"ValidationData",
"data",
",",
"ValidationDataIndex",
"index",
")",
"{",
"String",
"key",
"=",
"index",
".",
"getKey",
"(",
"data",
")",
";",
"List",
"<",
"ValidationData",
">",
"datas",
"=",
"index",
".",
... | Remove index data.
@param data the data
@param index the index | [
"Remove",
"index",
"data",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/repository/index/util/ValidationIndexUtil.java#L37-L50 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/repository/index/util/ValidationIndexUtil.java | ValidationIndexUtil.makeKey | public static String makeKey(String... keys) {
StringBuffer keyBuffer = new StringBuffer();
for (String s : keys) {
keyBuffer.append(s);
keyBuffer.append(":");
}
return keyBuffer.toString();
} | java | public static String makeKey(String... keys) {
StringBuffer keyBuffer = new StringBuffer();
for (String s : keys) {
keyBuffer.append(s);
keyBuffer.append(":");
}
return keyBuffer.toString();
} | [
"public",
"static",
"String",
"makeKey",
"(",
"String",
"...",
"keys",
")",
"{",
"StringBuffer",
"keyBuffer",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
"String",
"s",
":",
"keys",
")",
"{",
"keyBuffer",
".",
"append",
"(",
"s",
")",
";",
... | Make key string.
@param keys the keys
@return the string | [
"Make",
"key",
"string",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/repository/index/util/ValidationIndexUtil.java#L58-L65 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ParameterMapper.java | ParameterMapper.findMethod | public static Method findMethod(Class<?> c, String methodName) {
for (Method m : c.getMethods()) {
if (!m.getName().equalsIgnoreCase(methodName)) {
continue;
}
if (m.getParameterCount() != 1) {
continue;
}
return m;
... | java | public static Method findMethod(Class<?> c, String methodName) {
for (Method m : c.getMethods()) {
if (!m.getName().equalsIgnoreCase(methodName)) {
continue;
}
if (m.getParameterCount() != 1) {
continue;
}
return m;
... | [
"public",
"static",
"Method",
"findMethod",
"(",
"Class",
"<",
"?",
">",
"c",
",",
"String",
"methodName",
")",
"{",
"for",
"(",
"Method",
"m",
":",
"c",
".",
"getMethods",
"(",
")",
")",
"{",
"if",
"(",
"!",
"m",
".",
"getName",
"(",
")",
".",
... | Find method method.
@param c the c
@param methodName the method name
@return the method | [
"Find",
"method",
"method",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ParameterMapper.java#L92-L104 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ParameterMapper.java | ParameterMapper.castValue | @SuppressWarnings("PMD.LooseCoupling")
public static Object castValue(Method m, Class<?> castType, String value) {
try {
if (castType.isEnum()) {
Method valueOf;
try {
valueOf = castType.getMethod("valueOf", String.class);
... | java | @SuppressWarnings("PMD.LooseCoupling")
public static Object castValue(Method m, Class<?> castType, String value) {
try {
if (castType.isEnum()) {
Method valueOf;
try {
valueOf = castType.getMethod("valueOf", String.class);
... | [
"@",
"SuppressWarnings",
"(",
"\"PMD.LooseCoupling\"",
")",
"public",
"static",
"Object",
"castValue",
"(",
"Method",
"m",
",",
"Class",
"<",
"?",
">",
"castType",
",",
"String",
"value",
")",
"{",
"try",
"{",
"if",
"(",
"castType",
".",
"isEnum",
"(",
"... | Cast value object.
@param m the m
@param castType the cast type
@param value the value
@return the object | [
"Cast",
"value",
"object",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ParameterMapper.java#L114-L157 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/util/ParameterMapper.java | ParameterMapper.mapToObject | public static Object mapToObject(Map<String, String> map, Class<?> c) {
Method m = null;
Object obj = null;
try {
obj = c.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
log.info("instance create fail : " + c.getName());
... | java | public static Object mapToObject(Map<String, String> map, Class<?> c) {
Method m = null;
Object obj = null;
try {
obj = c.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
log.info("instance create fail : " + c.getName());
... | [
"public",
"static",
"Object",
"mapToObject",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"map",
",",
"Class",
"<",
"?",
">",
"c",
")",
"{",
"Method",
"m",
"=",
"null",
";",
"Object",
"obj",
"=",
"null",
";",
"try",
"{",
"obj",
"=",
"c",
".",
... | Map to object object.
@param map the map
@param c the c
@return the object | [
"Map",
"to",
"object",
"object",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/util/ParameterMapper.java#L167-L206 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java | ValidationDataRepository.findByIds | public List<ValidationData> findByIds(List<Long> ids) {
return this.datas.stream().filter(d -> ids.contains(d.getId())).collect(Collectors.toList());
} | java | public List<ValidationData> findByIds(List<Long> ids) {
return this.datas.stream().filter(d -> ids.contains(d.getId())).collect(Collectors.toList());
} | [
"public",
"List",
"<",
"ValidationData",
">",
"findByIds",
"(",
"List",
"<",
"Long",
">",
"ids",
")",
"{",
"return",
"this",
".",
"datas",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"d",
"->",
"ids",
".",
"contains",
"(",
"d",
".",
"getId",
"(",
... | Find by ids list.
@param ids the ids
@return the list | [
"Find",
"by",
"ids",
"list",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java#L90-L92 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java | ValidationDataRepository.findAll | public List<ValidationData> findAll(boolean referenceCache) {
if (referenceCache && this.datas != null) {
return this.datas;
}
List<ValidationData> list = null;
File repositroyFile = new File(this.validationConfig.getRepositoryPath());
try {
String jsonS... | java | public List<ValidationData> findAll(boolean referenceCache) {
if (referenceCache && this.datas != null) {
return this.datas;
}
List<ValidationData> list = null;
File repositroyFile = new File(this.validationConfig.getRepositoryPath());
try {
String jsonS... | [
"public",
"List",
"<",
"ValidationData",
">",
"findAll",
"(",
"boolean",
"referenceCache",
")",
"{",
"if",
"(",
"referenceCache",
"&&",
"this",
".",
"datas",
"!=",
"null",
")",
"{",
"return",
"this",
".",
"datas",
";",
"}",
"List",
"<",
"ValidationData",
... | Find all list.
@param referenceCache the reference cache
@return the list | [
"Find",
"all",
"list",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java#L119-L142 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java | ValidationDataRepository.findByParamTypeAndMethodAndUrl | public List<ValidationData> findByParamTypeAndMethodAndUrl(ParamType paramType, String method, String url) {
return this.findByMethodAndUrl(method, url).stream().filter(d -> d.getParamType().equals(paramType)).collect(Collectors.toList());
} | java | public List<ValidationData> findByParamTypeAndMethodAndUrl(ParamType paramType, String method, String url) {
return this.findByMethodAndUrl(method, url).stream().filter(d -> d.getParamType().equals(paramType)).collect(Collectors.toList());
} | [
"public",
"List",
"<",
"ValidationData",
">",
"findByParamTypeAndMethodAndUrl",
"(",
"ParamType",
"paramType",
",",
"String",
"method",
",",
"String",
"url",
")",
"{",
"return",
"this",
".",
"findByMethodAndUrl",
"(",
"method",
",",
"url",
")",
".",
"stream",
... | Find by param type and method and url list.
@param paramType the param type
@param method the method
@param url the url
@return the list | [
"Find",
"by",
"param",
"type",
"and",
"method",
"and",
"url",
"list",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java#L170-L172 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java | ValidationDataRepository.findByParamTypeAndMethodAndUrlAndName | public List<ValidationData> findByParamTypeAndMethodAndUrlAndName(ParamType paramType, String method, String url, String name) {
return this.findByMethodAndUrlAndName(method, url, name).stream().filter(vd -> vd.getParamType().equals(paramType)).collect(Collectors.toList());
} | java | public List<ValidationData> findByParamTypeAndMethodAndUrlAndName(ParamType paramType, String method, String url, String name) {
return this.findByMethodAndUrlAndName(method, url, name).stream().filter(vd -> vd.getParamType().equals(paramType)).collect(Collectors.toList());
} | [
"public",
"List",
"<",
"ValidationData",
">",
"findByParamTypeAndMethodAndUrlAndName",
"(",
"ParamType",
"paramType",
",",
"String",
"method",
",",
"String",
"url",
",",
"String",
"name",
")",
"{",
"return",
"this",
".",
"findByMethodAndUrlAndName",
"(",
"method",
... | Find by param type and method and url and name list.
@param paramType the param type
@param method the method
@param url the url
@param name the name
@return the list | [
"Find",
"by",
"param",
"type",
"and",
"method",
"and",
"url",
"and",
"name",
"list",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java#L183-L185 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java | ValidationDataRepository.findByParamTypeAndMethodAndUrlAndNameAndParentId | public ValidationData findByParamTypeAndMethodAndUrlAndNameAndParentId(ParamType paramType, String method, String url, String name, Long parentId) {
if (parentId == null) {
return this.findByParamTypeAndMethodAndUrlAndName(paramType, method, url, name).stream().filter(d -> d.getParentId() == null).f... | java | public ValidationData findByParamTypeAndMethodAndUrlAndNameAndParentId(ParamType paramType, String method, String url, String name, Long parentId) {
if (parentId == null) {
return this.findByParamTypeAndMethodAndUrlAndName(paramType, method, url, name).stream().filter(d -> d.getParentId() == null).f... | [
"public",
"ValidationData",
"findByParamTypeAndMethodAndUrlAndNameAndParentId",
"(",
"ParamType",
"paramType",
",",
"String",
"method",
",",
"String",
"url",
",",
"String",
"name",
",",
"Long",
"parentId",
")",
"{",
"if",
"(",
"parentId",
"==",
"null",
")",
"{",
... | Find by param type and method and url and name and parent id validation data.
@param paramType the param type
@param method the method
@param url the url
@param name the name
@param parentId the parent id
@return the validation data | [
"Find",
"by",
"param",
"type",
"and",
"method",
"and",
"url",
"and",
"name",
"and",
"parent",
"id",
"validation",
"data",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java#L197-L204 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java | ValidationDataRepository.findByMethodAndUrlAndName | public List<ValidationData> findByMethodAndUrlAndName(String method, String url, String name) {
return this.findByMethodAndUrl(method, url).stream().filter(d -> d.getName().equalsIgnoreCase(name)).collect(Collectors.toList());
} | java | public List<ValidationData> findByMethodAndUrlAndName(String method, String url, String name) {
return this.findByMethodAndUrl(method, url).stream().filter(d -> d.getName().equalsIgnoreCase(name)).collect(Collectors.toList());
} | [
"public",
"List",
"<",
"ValidationData",
">",
"findByMethodAndUrlAndName",
"(",
"String",
"method",
",",
"String",
"url",
",",
"String",
"name",
")",
"{",
"return",
"this",
".",
"findByMethodAndUrl",
"(",
"method",
",",
"url",
")",
".",
"stream",
"(",
")",
... | Find by method and url and name list.
@param method the method
@param url the url
@param name the name
@return the list | [
"Find",
"by",
"method",
"and",
"url",
"and",
"name",
"list",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java#L214-L216 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java | ValidationDataRepository.findByParentId | public List<ValidationData> findByParentId(Long id) {
return this.datas.stream().filter(d -> d.getParentId() != null && d.getParentId().equals(id)).collect(Collectors.toList());
} | java | public List<ValidationData> findByParentId(Long id) {
return this.datas.stream().filter(d -> d.getParentId() != null && d.getParentId().equals(id)).collect(Collectors.toList());
} | [
"public",
"List",
"<",
"ValidationData",
">",
"findByParentId",
"(",
"Long",
"id",
")",
"{",
"return",
"this",
".",
"datas",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"d",
"->",
"d",
".",
"getParentId",
"(",
")",
"!=",
"null",
"&&",
"d",
".",
"g... | Find by parent id list.
@param id the id
@return the list | [
"Find",
"by",
"parent",
"id",
"list",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java#L225-L227 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java | ValidationDataRepository.findByMethodAndUrlAndNameAndParentId | public ValidationData findByMethodAndUrlAndNameAndParentId(String method, String url, String name, Long parentId) {
if (parentId == null) {
return this.findByMethodAndUrlAndName(method, url, name).stream().filter(d -> d.getParentId() == null).findAny().orElse(null);
}
return this.fin... | java | public ValidationData findByMethodAndUrlAndNameAndParentId(String method, String url, String name, Long parentId) {
if (parentId == null) {
return this.findByMethodAndUrlAndName(method, url, name).stream().filter(d -> d.getParentId() == null).findAny().orElse(null);
}
return this.fin... | [
"public",
"ValidationData",
"findByMethodAndUrlAndNameAndParentId",
"(",
"String",
"method",
",",
"String",
"url",
",",
"String",
"name",
",",
"Long",
"parentId",
")",
"{",
"if",
"(",
"parentId",
"==",
"null",
")",
"{",
"return",
"this",
".",
"findByMethodAndUrl... | Find by method and url and name and parent id validation data.
@param method the method
@param url the url
@param name the name
@param parentId the parent id
@return the validation data | [
"Find",
"by",
"method",
"and",
"url",
"and",
"name",
"and",
"parent",
"id",
"validation",
"data",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java#L239-L246 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java | ValidationDataRepository.saveAll | public List<ValidationData> saveAll(List<ValidationData> pDatas) {
pDatas.forEach(this::save);
return pDatas;
} | java | public List<ValidationData> saveAll(List<ValidationData> pDatas) {
pDatas.forEach(this::save);
return pDatas;
} | [
"public",
"List",
"<",
"ValidationData",
">",
"saveAll",
"(",
"List",
"<",
"ValidationData",
">",
"pDatas",
")",
"{",
"pDatas",
".",
"forEach",
"(",
"this",
"::",
"save",
")",
";",
"return",
"pDatas",
";",
"}"
] | Save all list.
@param pDatas the p datas
@return the list | [
"Save",
"all",
"list",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java#L255-L258 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java | ValidationDataRepository.save | public ValidationData save(ValidationData data) {
if (data.getParamType() == null || data.getUrl() == null || data.getMethod() == null || data.getType() == null || data.getTypeClass() == null) {
throw new ValidationLibException("mandatory field is null ", HttpStatus.BAD_REQUEST);
}
... | java | public ValidationData save(ValidationData data) {
if (data.getParamType() == null || data.getUrl() == null || data.getMethod() == null || data.getType() == null || data.getTypeClass() == null) {
throw new ValidationLibException("mandatory field is null ", HttpStatus.BAD_REQUEST);
}
... | [
"public",
"ValidationData",
"save",
"(",
"ValidationData",
"data",
")",
"{",
"if",
"(",
"data",
".",
"getParamType",
"(",
")",
"==",
"null",
"||",
"data",
".",
"getUrl",
"(",
")",
"==",
"null",
"||",
"data",
".",
"getMethod",
"(",
")",
"==",
"null",
... | Save validation data.
@param data the data
@return the validation data | [
"Save",
"validation",
"data",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/core/repository/ValidationDataRepository.java#L302-L315 | train |
reinert/requestor | requestor/core/requestor-api/src/main/java/io/reinert/requestor/uri/UriBuilder.java | UriBuilder.fromPath | public static UriBuilder fromPath(String path) {
if (path == null)
throw new IllegalArgumentException("Path cannot be null");
final UriBuilder builder = newInstance();
builder.path(path);
return builder;
} | java | public static UriBuilder fromPath(String path) {
if (path == null)
throw new IllegalArgumentException("Path cannot be null");
final UriBuilder builder = newInstance();
builder.path(path);
return builder;
} | [
"public",
"static",
"UriBuilder",
"fromPath",
"(",
"String",
"path",
")",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Path cannot be null\"",
")",
";",
"final",
"UriBuilder",
"builder",
"=",
"newInstance",
"(",
... | Create a new instance representing a relative URI initialized from a URI path.
@param path a URI path that will be used to initialize the UriBuilder, may contain URI template parameters.
@return a new UriBuilder
@throws IllegalArgumentException if path is null | [
"Create",
"a",
"new",
"instance",
"representing",
"a",
"relative",
"URI",
"initialized",
"from",
"a",
"URI",
"path",
"."
] | 40163a75cd17815d5089935d0dd97b8d652ad6d4 | https://github.com/reinert/requestor/blob/40163a75cd17815d5089935d0dd97b8d652ad6d4/requestor/core/requestor-api/src/main/java/io/reinert/requestor/uri/UriBuilder.java#L39-L46 | train |
lightblue-platform/lightblue-client | core/src/main/java/com/redhat/lightblue/client/util/JSON.java | JSON.toJson | public static String toJson(Object obj) {
StringWriter sw = new StringWriter();
ObjectMapper mapper = getDefaultObjectMapper();
try {
JsonGenerator jg = mapper.getFactory().createGenerator(sw);
mapper.writeValue(jg, obj);
} catch (JsonMappingException e) {
... | java | public static String toJson(Object obj) {
StringWriter sw = new StringWriter();
ObjectMapper mapper = getDefaultObjectMapper();
try {
JsonGenerator jg = mapper.getFactory().createGenerator(sw);
mapper.writeValue(jg, obj);
} catch (JsonMappingException e) {
... | [
"public",
"static",
"String",
"toJson",
"(",
"Object",
"obj",
")",
"{",
"StringWriter",
"sw",
"=",
"new",
"StringWriter",
"(",
")",
";",
"ObjectMapper",
"mapper",
"=",
"getDefaultObjectMapper",
"(",
")",
";",
"try",
"{",
"JsonGenerator",
"jg",
"=",
"mapper",... | Convert object to json. If object contains fields of type date, they will
be converted to strings using lightblue date format.
@param obj
@return | [
"Convert",
"object",
"to",
"json",
".",
"If",
"object",
"contains",
"fields",
"of",
"type",
"date",
"they",
"will",
"be",
"converted",
"to",
"strings",
"using",
"lightblue",
"date",
"format",
"."
] | 03790aff34e90d3889f60fd6c603c21a21dc1a40 | https://github.com/lightblue-platform/lightblue-client/blob/03790aff34e90d3889f60fd6c603c21a21dc1a40/core/src/main/java/com/redhat/lightblue/client/util/JSON.java#L72-L86 | train |
metamx/extendedset | src/main/java/it/uniroma3/mat/extendedset/intset/HashIntSet.java | HashIntSet.remove | @Override
public boolean remove(int element)
{
if (element < 0) {
throw new IndexOutOfBoundsException("element < 0: " + element);
}
int index = findElementOrEmpty(element);
if (index < 0) {
return false;
}
cells[index] = REMOVED;
modCount++;
size--;
ret... | java | @Override
public boolean remove(int element)
{
if (element < 0) {
throw new IndexOutOfBoundsException("element < 0: " + element);
}
int index = findElementOrEmpty(element);
if (index < 0) {
return false;
}
cells[index] = REMOVED;
modCount++;
size--;
ret... | [
"@",
"Override",
"public",
"boolean",
"remove",
"(",
"int",
"element",
")",
"{",
"if",
"(",
"element",
"<",
"0",
")",
"{",
"throw",
"new",
"IndexOutOfBoundsException",
"(",
"\"element < 0: \"",
"+",
"element",
")",
";",
"}",
"int",
"index",
"=",
"findEleme... | Removes the specified element from the set. | [
"Removes",
"the",
"specified",
"element",
"from",
"the",
"set",
"."
] | 0f77c28057fac9c1bd6d79fbe5425b8efe5742a8 | https://github.com/metamx/extendedset/blob/0f77c28057fac9c1bd6d79fbe5425b8efe5742a8/src/main/java/it/uniroma3/mat/extendedset/intset/HashIntSet.java#L297-L312 | train |
metamx/extendedset | src/main/java/it/uniroma3/mat/extendedset/intset/HashIntSet.java | HashIntSet.clear | @Override
public void clear()
{
size = 0;
Arrays.fill(cells, EMPTY);
freecells = cells.length;
modCount++;
} | java | @Override
public void clear()
{
size = 0;
Arrays.fill(cells, EMPTY);
freecells = cells.length;
modCount++;
} | [
"@",
"Override",
"public",
"void",
"clear",
"(",
")",
"{",
"size",
"=",
"0",
";",
"Arrays",
".",
"fill",
"(",
"cells",
",",
"EMPTY",
")",
";",
"freecells",
"=",
"cells",
".",
"length",
";",
"modCount",
"++",
";",
"}"
] | Removes all of the elements from this set. | [
"Removes",
"all",
"of",
"the",
"elements",
"from",
"this",
"set",
"."
] | 0f77c28057fac9c1bd6d79fbe5425b8efe5742a8 | https://github.com/metamx/extendedset/blob/0f77c28057fac9c1bd6d79fbe5425b8efe5742a8/src/main/java/it/uniroma3/mat/extendedset/intset/HashIntSet.java#L317-L324 | train |
metamx/extendedset | src/main/java/it/uniroma3/mat/extendedset/intset/HashIntSet.java | HashIntSet.rehash | protected void rehash()
{
// do we need to increase capacity, or are there so many
// deleted objects hanging around that rehashing to the same
// size is sufficient? if 5% (arbitrarily chosen number) of
// cells can be freed up by a rehash, we do it.
int gargagecells = cells.length - (siz... | java | protected void rehash()
{
// do we need to increase capacity, or are there so many
// deleted objects hanging around that rehashing to the same
// size is sufficient? if 5% (arbitrarily chosen number) of
// cells can be freed up by a rehash, we do it.
int gargagecells = cells.length - (siz... | [
"protected",
"void",
"rehash",
"(",
")",
"{",
"// do we need to increase capacity, or are there so many\r",
"// deleted objects hanging around that rehashing to the same\r",
"// size is sufficient? if 5% (arbitrarily chosen number) of\r",
"// cells can be freed up by a rehash, we do it.\r",
"int... | Figures out correct size for rehashed set, then does the rehash. | [
"Figures",
"out",
"correct",
"size",
"for",
"rehashed",
"set",
"then",
"does",
"the",
"rehash",
"."
] | 0f77c28057fac9c1bd6d79fbe5425b8efe5742a8 | https://github.com/metamx/extendedset/blob/0f77c28057fac9c1bd6d79fbe5425b8efe5742a8/src/main/java/it/uniroma3/mat/extendedset/intset/HashIntSet.java#L329-L346 | train |
metamx/extendedset | src/main/java/it/uniroma3/mat/extendedset/intset/HashIntSet.java | HashIntSet.rehash | protected void rehash(int newCapacity)
{
HashIntSet rehashed = new HashIntSet(newCapacity);
@SuppressWarnings("hiding")
int[] cells = rehashed.cells;
for (int element : this.cells) {
if (element < 0)
// removed or empty
{
continue;
}
// add the elemen... | java | protected void rehash(int newCapacity)
{
HashIntSet rehashed = new HashIntSet(newCapacity);
@SuppressWarnings("hiding")
int[] cells = rehashed.cells;
for (int element : this.cells) {
if (element < 0)
// removed or empty
{
continue;
}
// add the elemen... | [
"protected",
"void",
"rehash",
"(",
"int",
"newCapacity",
")",
"{",
"HashIntSet",
"rehashed",
"=",
"new",
"HashIntSet",
"(",
"newCapacity",
")",
";",
"@",
"SuppressWarnings",
"(",
"\"hiding\"",
")",
"int",
"[",
"]",
"cells",
"=",
"rehashed",
".",
"cells",
... | Rehashes to a bigger size. | [
"Rehashes",
"to",
"a",
"bigger",
"size",
"."
] | 0f77c28057fac9c1bd6d79fbe5425b8efe5742a8 | https://github.com/metamx/extendedset/blob/0f77c28057fac9c1bd6d79fbe5425b8efe5742a8/src/main/java/it/uniroma3/mat/extendedset/intset/HashIntSet.java#L351-L369 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/helper/CheckPointHelper.java | CheckPointHelper.replaceExceptionCallback | public CheckPointHelper replaceExceptionCallback(BasicCheckRule checkRule, ValidationInvalidCallback cb) {
this.msgChecker.replaceCallback(checkRule, cb);
return this;
} | java | public CheckPointHelper replaceExceptionCallback(BasicCheckRule checkRule, ValidationInvalidCallback cb) {
this.msgChecker.replaceCallback(checkRule, cb);
return this;
} | [
"public",
"CheckPointHelper",
"replaceExceptionCallback",
"(",
"BasicCheckRule",
"checkRule",
",",
"ValidationInvalidCallback",
"cb",
")",
"{",
"this",
".",
"msgChecker",
".",
"replaceCallback",
"(",
"checkRule",
",",
"cb",
")",
";",
"return",
"this",
";",
"}"
] | Replace the callback to be used basic exception.
@param checkRule basic rule type ex,, BasicCheckRule.Mandatory
@param cb callback class with implement ValidationInvalidCallback
@return CheckPointHeler check point helper | [
"Replace",
"the",
"callback",
"to",
"be",
"used",
"basic",
"exception",
"."
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/helper/CheckPointHelper.java#L49-L52 | train |
ckpoint/CheckPoint | src/main/java/hsim/checkpoint/helper/CheckPointHelper.java | CheckPointHelper.addValidationRule | public CheckPointHelper addValidationRule(String ruleName, StandardValueType standardValueType, BaseValidationCheck validationCheck, AssistType assistType) {
ValidationRule rule = new ValidationRule(ruleName, standardValueType, validationCheck);
if (assistType == null) {
assistType = AssistT... | java | public CheckPointHelper addValidationRule(String ruleName, StandardValueType standardValueType, BaseValidationCheck validationCheck, AssistType assistType) {
ValidationRule rule = new ValidationRule(ruleName, standardValueType, validationCheck);
if (assistType == null) {
assistType = AssistT... | [
"public",
"CheckPointHelper",
"addValidationRule",
"(",
"String",
"ruleName",
",",
"StandardValueType",
"standardValueType",
",",
"BaseValidationCheck",
"validationCheck",
",",
"AssistType",
"assistType",
")",
"{",
"ValidationRule",
"rule",
"=",
"new",
"ValidationRule",
"... | Add the fresh user rule
@param ruleName use rule name - must uniqueue
@param standardValueType rule check standardvalue type
@param validationCheck rule check class with extends BaseValidationCheck and overide replace or check method and exception method
@param assistType input field type
@return Che... | [
"Add",
"the",
"fresh",
"user",
"rule"
] | 2c2b1a87a88485d49ea6afa34acdf16ef4134f19 | https://github.com/ckpoint/CheckPoint/blob/2c2b1a87a88485d49ea6afa34acdf16ef4134f19/src/main/java/hsim/checkpoint/helper/CheckPointHelper.java#L63-L71 | train |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | MapCore/src/main/java/org/wwarn/mapcore/client/utils/Track.java | Track.track | private static void track(String historyToken) {
if (historyToken == null) {
historyToken = "historyToken_null";
}
historyToken = URL.encode("/WWARN-GWT-Analytics/V1.0/" + historyToken);
boolean hasErrored = false;
try{
trackGoogleAnalytics(historyToken)... | java | private static void track(String historyToken) {
if (historyToken == null) {
historyToken = "historyToken_null";
}
historyToken = URL.encode("/WWARN-GWT-Analytics/V1.0/" + historyToken);
boolean hasErrored = false;
try{
trackGoogleAnalytics(historyToken)... | [
"private",
"static",
"void",
"track",
"(",
"String",
"historyToken",
")",
"{",
"if",
"(",
"historyToken",
"==",
"null",
")",
"{",
"historyToken",
"=",
"\"historyToken_null\"",
";",
"}",
"historyToken",
"=",
"URL",
".",
"encode",
"(",
"\"/WWARN-GWT-Analytics/V1.0... | track an event
@param historyToken | [
"track",
"an",
"event"
] | 224280bcd6e8045bda6b673584caf0aea5e4c841 | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/MapCore/src/main/java/org/wwarn/mapcore/client/utils/Track.java#L74-L89 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.