id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
22045363_239 | {
"fields": [
{
"declarator": "PRODUCT_FOLDER = \"_alos\"+ File.separator",
"modifier": "private static final",
"original_string": "private static final String PRODUCT_FOLDER = \"_alos\"+ File.separator;",
"type": "String",
"var_name": "PRODUCT_FOLDER"
}
],
"file": "s2tbx-alo... | {
"body": "@Test\n public void testMetadataInspector() throws URISyntaxException, IOException {\n assumeTrue(TestUtil.testdataAvailable());\n\n File productFile = TestUtil.getTestFile(PRODUCT_FOLDER + \"AL1_NESR_AV2_OBS_1C_20080715T181736_20080715T181748_013182_0539_1810_0410.SIP\"+File.separator+\"A... | {
"fields": [],
"file": "s2tbx-alosAV2-reader/src/main/java/org/esa/s2tbx/dataio/alos/av2/AlosAV2MetadataInspector.java",
"identifier": "AlosAV2MetadataInspector",
"interfaces": "implements MetadataInspector",
"methods": [
{
"class_method_signature": "AlosAV2MetadataInspector.AlosAV2MetadataInspecto... | {
"body": "@Override\n public Metadata getMetadata(Path productPath) throws IOException {\n try (VirtualDirEx productDirectory = VirtualDirEx.build(productPath, false, true)) {\n Path imageMetadataParentPath = AlosAV2ProductReader.buildImageMetadataParentPath(productDirectory);\n\n Alo... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_147 | {
"fields": [
{
"declarator": "metadata",
"modifier": "private",
"original_string": "private WorldView2Metadata metadata;",
"type": "WorldView2Metadata",
"var_name": "metadata"
},
{
"declarator": "productsFolder = \"_worldView\" + File.separator",
"modifier": "pri... | {
"body": "@Test\n public void testGetRasterWidth() throws Exception {\n assertEquals(0, metadata.getRasterWidth());\n }",
"class_method_signature": "WorldView2MetadataTest.testGetRasterWidth()",
"constructor": false,
"full_signature": "@Test public void testGetRasterWidth()",
"identifier": "test... | {
"fields": [
{
"declarator": "EXCLUSION_STRING = \"README\"",
"modifier": "public static final",
"original_string": "public static final String EXCLUSION_STRING = \"README\";",
"type": "String",
"var_name": "EXCLUSION_STRING"
},
{
"declarator": "subProducts",
"mo... | {
"body": "@Override\n public int getRasterWidth() {\n return 0;\n }",
"class_method_signature": "WorldView2Metadata.getRasterWidth()",
"constructor": false,
"full_signature": "@Override public int getRasterWidth()",
"identifier": "getRasterWidth",
"invocations": [],
"modifiers": "@Override p... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_86 | {
"fields": [
{
"declarator": "metadata",
"modifier": "private",
"original_string": "private RapidEyeMetadata metadata;",
"type": "RapidEyeMetadata",
"var_name": "metadata"
},
{
"declarator": "productsFolder = \"_rapideye\" + File.separator",
"modifier": "private"... | {
"body": "@Test\n public void testGetCornersLongitudes() throws Exception {\n assertEquals(15.082264, metadata.getCornersLongitudes()[0], 0.001);\n assertEquals(16.193775, metadata.getCornersLongitudes()[1], 0.001);\n assertEquals(14.893127, metadata.getCornersLongitudes()[2], 0.001);\n ... | {
"fields": [
{
"declarator": "scaleFactors",
"modifier": "private",
"original_string": "private float[] scaleFactors;",
"type": "float[]",
"var_name": "scaleFactors"
}
],
"file": "s2tbx-rapideye-reader/src/main/java/org/esa/s2tbx/dataio/rapideye/metadata/RapidEyeMetadata.jav... | {
"body": "public float[] getCornersLongitudes() {\n float[] longs = null;\n MetadataElement currentElement;\n if (((currentElement = rootElement.getElement(RapidEyeConstants.TAG_TARGET)) != null) &&\n ((currentElement = currentElement.getElement(RapidEyeConstants.TAG_FOOTPRINT)) !... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_69 | {
"fields": [
{
"declarator": "specPixelsContainer",
"modifier": "private",
"original_string": "private SpectrumClassReferencePixelsContainer specPixelsContainer;",
"type": "SpectrumClassReferencePixelsContainer",
"var_name": "specPixelsContainer"
},
{
"declarator": "th... | {
"body": "@Test\n public void testSpectrumClassPixelsComputing() throws Exception {\n\n this.specPixelsContainer = new SpectrumClassReferencePixelsContainer();\n this.threadCount = Runtime.getRuntime().availableProcessors();\n\n SpectrumInput[] spectrumInput = new SpectrumInput[3];\n s... | {
"fields": [
{
"declarator": "spectrumInput",
"modifier": "private final",
"original_string": "private final SpectrumInput spectrumInput;",
"type": "SpectrumInput",
"var_name": "spectrumInput"
},
{
"declarator": "spectrumClassReferencePixelsContainer",
"modifier"... | {
"body": "public SpectrumClassPixelsComputing(SpectrumInput spectrumInput, SpectrumClassReferencePixelsContainer spectrumClassReferencePixelsContainer){\n this.spectrumInput = spectrumInput;\n this.spectrumClassReferencePixelsContainer = spectrumClassReferencePixelsContainer;\n }",
"class_method_s... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_151 | {
"fields": [
{
"declarator": "metadata",
"modifier": "private",
"original_string": "private MuscateMetadata metadata;",
"type": "MuscateMetadata",
"var_name": "metadata"
}
],
"file": "s2tbx-muscate-reader/src/test/java/org/esa/s2tbx/dataio/muscate/MuscateMetadataTest.java",
... | {
"body": "@Test\n public void testGetFileName() throws Exception {\n //metadata.getImages();\n //metadata.getMasks();\n //assertEquals(\"DEIMOS\", metadata.getFileName());\n }",
"class_method_signature": "MuscateMetadataTest.testGetFileName()",
"constructor": false,
"full_signature":... | {
"fields": [
{
"declarator": "images",
"modifier": "private",
"original_string": "private ArrayList<MuscateImage> images;",
"type": "ArrayList<MuscateImage>",
"var_name": "images"
},
{
"declarator": "masks",
"modifier": "private",
"original_string": "privat... | {
"body": "@Override\n public String getFileName() {\n return name;\n }",
"class_method_signature": "MuscateMetadata.getFileName()",
"constructor": false,
"full_signature": "@Override public String getFileName()",
"identifier": "getFileName",
"invocations": [],
"modifiers": "@Override public"... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_90 | {
"fields": [
{
"declarator": "metadata",
"modifier": "private",
"original_string": "private RapidEyeMetadata metadata;",
"type": "RapidEyeMetadata",
"var_name": "metadata"
},
{
"declarator": "productsFolder = \"_rapideye\" + File.separator",
"modifier": "private"... | {
"body": "@Test\n public void testGetNumBands() throws Exception {\n assertEquals(5, metadata.getNumBands());\n }",
"class_method_signature": "RapidEyeMetadataTest.testGetNumBands()",
"constructor": false,
"full_signature": "@Test public void testGetNumBands()",
"identifier": "testGetNumBands",
... | {
"fields": [
{
"declarator": "scaleFactors",
"modifier": "private",
"original_string": "private float[] scaleFactors;",
"type": "float[]",
"var_name": "scaleFactors"
}
],
"file": "s2tbx-rapideye-reader/src/main/java/org/esa/s2tbx/dataio/rapideye/metadata/RapidEyeMetadata.jav... | {
"body": "@Override\n public int getNumBands() {\n if (numBands == 0) {\n MetadataElement currentElement;\n if (((currentElement = rootElement.getElement(RapidEyeConstants.TAG_RESULT_OF)) != null) &&\n ((currentElement = currentElement.getElement(RapidEyeConstants.T... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_106 | {
"fields": [],
"file": "s2tbx-forest-cover-change/src/test/java/org/esa/s2tbx/fcc/trimming/ColorFillerTilesComputingTest.java",
"identifier": "ColorFillerTilesComputingTest",
"interfaces": "",
"superclass": "extends AbstractOpTest"
} | {
"body": "@Test\n public void testColorFillerTileComputing() throws Exception {\n Dimension tileSize = JAI.getDefaultTileSize();\n int threadCount = Runtime.getRuntime().availableProcessors() - 1;\n ExecutorService threadPool = Executors.newCachedThreadPool();\n\n ProductReaderPlugIn p... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(ColorFillerTilesComputing.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(ColorFillerTilesComputing.class.getName());",
"type": "Logger",
"var_nam... | {
"body": "public IntMatrix runTilesInParallel(int threadCount, Executor threadPool) throws Exception {\n super.executeInParallel(threadCount, threadPool);\n\n return this.result;\n }",
"class_method_signature": "ColorFillerTilesComputing.runTilesInParallel(int threadCount, Executor threadPool)",
... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_28 | {
"fields": [
{
"declarator": "metadata",
"modifier": "private",
"original_string": "private AlosPRIMetadata metadata;",
"type": "AlosPRIMetadata",
"var_name": "metadata"
},
{
"declarator": "productsFolder = \"_alos\" + File.separator",
"modifier": "private",
... | {
"body": "@Test\n public void testMinInsertPointY() throws Exception {\n assertEquals(9046182, metadata.getMinInsertPointY(), 0.0);\n }",
"class_method_signature": "AlosPRIMetadataTest.testMinInsertPointY()",
"constructor": false,
"full_signature": "@Test public void testMinInsertPointY()",
"ide... | {
"fields": [
{
"declarator": "imageDirectoryPath",
"modifier": "private",
"original_string": "private String imageDirectoryPath;",
"type": "String",
"var_name": "imageDirectoryPath"
},
{
"declarator": "upperLeftPointOrigin",
"modifier": "private",
"original... | {
"body": "public float getMinInsertPointY() {\n return componentMetadata.stream()\n .filter(metadata -> metadata instanceof ImageMetadata)\n .map(metadata -> (ImageMetadata) metadata)\n .map(ImageMetadata::getInsertPointY)\n .collect(Collectors.minBy... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_258 | {
"fields": [
{
"declarator": "metadata",
"modifier": "private",
"original_string": "private AlosAV2Metadata metadata;",
"type": "AlosAV2Metadata",
"var_name": "metadata"
},
{
"declarator": "productsFolder = \"_alos\" + File.separator",
"modifier": "private",
... | {
"body": "@Test\n public void testGetProcessingLevel() throws Exception {\n assertEquals(AlosAV2Constants.PROCESSING_1B, metadata.getProcessingLevel());\n }",
"class_method_signature": "AlosAV2MetadataTest.testGetProcessingLevel()",
"constructor": false,
"full_signature": "@Test public void testGe... | {
"fields": [
{
"declarator": "bandGains",
"modifier": "private",
"original_string": "private HashMap<String, Float> bandGains;",
"type": "HashMap<String, Float>",
"var_name": "bandGains"
},
{
"declarator": "bandBiases",
"modifier": "private",
"original_stri... | {
"body": "public String getProcessingLevel() {\n String value = null;\n try {\n value = getAttributeValue(AlosAV2Constants.PATH_IMG_PROCESSING_LEVEL, null);\n } catch (Exception e) {\n warn(MISSING_ELEMENT_WARNING, AlosAV2Constants.PATH_IMG_PROCESSING_LEVEL);\n }\n ... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_7 | {
"fields": [
{
"declarator": "metadata",
"modifier": "private",
"original_string": "private Kompsat2Metadata metadata;",
"type": "Kompsat2Metadata",
"var_name": "metadata"
},
{
"declarator": "productsFolder = \"_kompsat\" + File.separator",
"modifier": "private",... | {
"body": "@Test\n public void testGetFormatName() throws Exception {\n assertEquals(Kompsat2Constants.PRODUCT_GENERIC_NAME, metadata.getFormatName());\n }",
"class_method_signature": "Kompsat2MetadataTest.testGetFormatName()",
"constructor": false,
"full_signature": "@Test public void testGetForma... | {
"fields": [
{
"declarator": "component",
"modifier": "private",
"original_string": "private Kompsat2Component component;",
"type": "Kompsat2Component",
"var_name": "component"
}
],
"file": "s2tbx-kompsat2-reader/src/main/java/org/esa/s2tbx/dataio/kompsat2/metadata/Kompsat2M... | {
"body": "@Override\n public String getFormatName() {\n return Kompsat2Constants.PRODUCT_GENERIC_NAME;\n }",
"class_method_signature": "Kompsat2Metadata.getFormatName()",
"constructor": false,
"full_signature": "@Override public String getFormatName()",
"identifier": "getFormatName",
"invocati... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_171 | {
"fields": [
{
"declarator": "PRODUCTS_FOLDER = \"_spot\" + File.separator",
"modifier": "private static final",
"original_string": "private static final String PRODUCTS_FOLDER = \"_spot\" + File.separator;",
"type": "String",
"var_name": "PRODUCTS_FOLDER"
}
],
"file": "s2tb... | {
"body": "@Test\n public void testReaderProductGeometrySubset() throws ConversionException, IOException {\n assumeTrue(TestUtil.testdataAvailable());\n\n File file = TestUtil.getTestFile(PRODUCTS_FOLDER + \"30382639609301123571X0_1A_NETWORK.ZIP\");\n\n JtsGeometryConverter converter = new Jts... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(SpotDimapProductReader.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(SpotDimapProductReader.class.getName());",
"type": "Logger",
"var_name": "l... | {
"body": "@Override\n public TreeNode<File> getProductComponents() {\n if (productDirectory.isCompressed()) {\n return super.getProductComponents();\n } else {\n TreeNode<File> result = super.getProductComponents();\n //if the volume metadata file is present, but it ... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_126 | {
"fields": [
{
"declarator": "readerPlugIn",
"modifier": "private final",
"original_string": "private final AbstractDriverProductReaderPlugIn readerPlugIn;",
"type": "AbstractDriverProductReaderPlugIn",
"var_name": "readerPlugIn"
},
{
"declarator": "extensions",
... | {
"body": "@Test\n public final void testInputTypes() {\n if (GDALInstallInfo.INSTANCE.isPresent()) {\n Class[] classes = this.readerPlugIn.getInputTypes();\n assertNotNull(classes);\n\n assertEquals(2, classes.length);\n\n List<Class> list = Arrays.asList(classes... | {
"fields": [
{
"declarator": "driverName",
"modifier": "private final",
"original_string": "private final String driverName;",
"type": "String",
"var_name": "driverName"
},
{
"declarator": "driverDisplayName",
"modifier": "private final",
"original_string":... | {
"body": "@Override\n public final Class[] getInputTypes() {\n return new Class[] { String.class, File.class };\n }",
"class_method_signature": "AbstractDriverProductReaderPlugIn.getInputTypes()",
"constructor": false,
"full_signature": "@Override public final Class[] getInputTypes()",
"identifi... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_219 | {
"fields": [
{
"declarator": "metadata",
"modifier": "private",
"original_string": "private SpotDimapMetadata metadata;",
"type": "SpotDimapMetadata",
"var_name": "metadata"
},
{
"declarator": "productsFolder = \"_spot\" + File.separator",
"modifier": "private",
... | {
"body": "@Test\n public void testGetGain() throws Exception {\n assertEquals(0, metadata.getGain(0), 0.001);\n assertEquals(0, metadata.getGain(1), 0.001);\n assertEquals(0, metadata.getGain(2), 0.001);\n assertEquals(0, metadata.getGain(3), 0.001);\n }",
"class_method_signature"... | {
"fields": [
{
"declarator": "wavelengths",
"modifier": "private",
"original_string": "private float[] wavelengths;",
"type": "float[]",
"var_name": "wavelengths"
},
{
"declarator": "bandwidths",
"modifier": "private",
"original_string": "private float[] ba... | {
"body": "public float getGain(int bandIndex) {\n if (bandGains == null) {\n extractGainsAndBiases();\n }\n return bandGains[bandIndex];\n }",
"class_method_signature": "SpotDimapMetadata.getGain(int bandIndex)",
"constructor": false,
"full_signature": "public float getGain(i... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_130 | {
"fields": [
{
"declarator": "metadata",
"modifier": "private",
"original_string": "private WorldView2ESAMetadata metadata;",
"type": "WorldView2ESAMetadata",
"var_name": "metadata"
},
{
"declarator": "productsFolder = \"_worldView\" + File.separator",
"modifier"... | {
"body": "@Test\n public void testGetFormatName() throws Exception {\n assertEquals(WorldView2ESAConstants.PRODUCT_GENERIC_NAME, metadata.getFormatName());\n }",
"class_method_signature": "WorldView2ESAMetadataTest.testGetFormatName()",
"constructor": false,
"full_signature": "@Test public void te... | {
"fields": [],
"file": "s2tbx-worldview2esa-reader/src/main/java/org/esa/s2tbx/dataio/worldview2esa/metadata/WorldView2ESAMetadata.java",
"identifier": "WorldView2ESAMetadata",
"interfaces": "",
"methods": [
{
"class_method_signature": "WorldView2ESAMetadata.WorldView2ESAMetadata(String name)",
... | {
"body": "@Override\n public String getFormatName() {\n return WorldView2ESAConstants.PRODUCT_GENERIC_NAME;\n }",
"class_method_signature": "WorldView2ESAMetadata.getFormatName()",
"constructor": false,
"full_signature": "@Override public String getFormatName()",
"identifier": "getFormatName",
... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_49 | {
"fields": [
{
"declarator": "metadata",
"modifier": "private",
"original_string": "private DeimosMetadata metadata;",
"type": "DeimosMetadata",
"var_name": "metadata"
},
{
"declarator": "productsFolder = \"_deimos\" + File.separator",
"modifier": "private",
... | {
"body": "@Test\n public void testGetProductName() throws Exception {\n assertEquals(\"DE004502p_023150_046799_042858_045602\", metadata.getProductName());\n }",
"class_method_signature": "DeimosMetadataTest.testGetProductName()",
"constructor": false,
"full_signature": "@Test public void testGetP... | {
"fields": [
{
"declarator": "bandGains",
"modifier": "private",
"original_string": "private float[] bandGains;",
"type": "float[]",
"var_name": "bandGains"
},
{
"declarator": "bandBiases",
"modifier": "private",
"original_string": "private float[] bandBias... | {
"body": "@Override\n public String getProductName() {\n String name = getAttributeValue(DeimosConstants.PATH_SOURCE_ID, DeimosConstants.VALUE_NOT_AVAILABLE);\n rootElement.setDescription(name);\n return name;\n }",
"class_method_signature": "DeimosMetadata.getProductName()",
"construc... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_188 | {
"fields": [
{
"declarator": "metadata",
"modifier": "private",
"original_string": "private SpotViewMetadata metadata;",
"type": "SpotViewMetadata",
"var_name": "metadata"
},
{
"declarator": "productsFolder = \"_spot\" + File.separator",
"modifier": "private",
... | {
"body": "@Test\n public void testGetGeolayerFileName() throws Exception {\n assertEquals(\"geolayer.bil\", metadata.getGeolayerFileName());\n }",
"class_method_signature": "SpotViewMetadataTest.testGetGeolayerFileName()",
"constructor": false,
"full_signature": "@Test public void testGetGeolayerF... | {
"fields": [],
"file": "s2tbx-spot-reader/src/main/java/org/esa/s2tbx/dataio/spot/dimap/SpotViewMetadata.java",
"identifier": "SpotViewMetadata",
"interfaces": "",
"methods": [
{
"class_method_signature": "SpotViewMetadata.SpotViewMetadata(String name)",
"constructor": true,
"full_signa... | {
"body": "@SuppressWarnings(\"SameReturnValue\")\n public String getGeolayerFileName() {\n return SpotConstants.SPOTVIEW_GEOLAYER_FILENAME;\n }",
"class_method_signature": "SpotViewMetadata.getGeolayerFileName()",
"constructor": false,
"full_signature": "@SuppressWarnings(\"SameReturnValue\") publ... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_167 | {
"fields": [
{
"declarator": "PRODUCTS_FOLDER = \"_spot\" + File.separator",
"modifier": "private static final",
"original_string": "private static final String PRODUCTS_FOLDER = \"_spot\" + File.separator;",
"type": "String",
"var_name": "PRODUCTS_FOLDER"
}
],
"file": "s2tb... | {
"body": "@Test\n public void testGetProductComponentsOnVolumeFileInputBySimpleProductReader() throws IOException {\n assumeTrue(TestUtil.testdataAvailable());\n\n File file = TestUtil.getTestFile(PRODUCTS_FOLDER + \"vol_list.dim\");\n\n SpotDimapProductReader reader = buildProductReader();\n... | {
"fields": [
{
"declarator": "logger = Logger.getLogger(SpotDimapProductReader.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger logger = Logger.getLogger(SpotDimapProductReader.class.getName());",
"type": "Logger",
"var_name": "l... | {
"body": "@Override\n public TreeNode<File> getProductComponents() {\n if (productDirectory.isCompressed()) {\n return super.getProductComponents();\n } else {\n TreeNode<File> result = super.getProductComponents();\n //if the volume metadata file is present, but it ... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_235 | {
"fields": [
{
"declarator": "plugIn",
"modifier": "private",
"original_string": "private Spot5Take5ProductReaderPlugin plugIn;",
"type": "Spot5Take5ProductReaderPlugin",
"var_name": "plugIn"
},
{
"declarator": "productsFolder = \"_spot\" + File.separator",
"modi... | {
"body": "@Test\n public void testInputTypes() {\n final Class[] classes = plugIn.getInputTypes();\n assertNotNull(classes);\n assertEquals(2, classes.length);\n final List<Class> list = Arrays.asList(classes);\n assertEquals(true, list.contains(File.class));\n assertEqua... | {
"fields": [
{
"declarator": "COLOR_PALETTE_FILE_NAME = \"Spot_color_palette.cpd\"",
"modifier": "private static final",
"original_string": "private static final String COLOR_PALETTE_FILE_NAME = \"Spot_color_palette.cpd\";",
"type": "String",
"var_name": "COLOR_PALETTE_FILE_NAME"
... | {
"body": "@Override\n public Class[] getInputTypes() {\n return SpotConstants.SPOT4_TAKE5_READER_INPUT_TYPES;\n }",
"class_method_signature": "Spot5Take5ProductReaderPlugin.getInputTypes()",
"constructor": false,
"full_signature": "@Override public Class[] getInputTypes()",
"identifier": "getInp... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_32 | {
"fields": [
{
"declarator": "metadata",
"modifier": "private",
"original_string": "private AlosPRIMetadata metadata;",
"type": "AlosPRIMetadata",
"var_name": "metadata"
},
{
"declarator": "productsFolder = \"_alos\" + File.separator",
"modifier": "private",
... | {
"body": "@Test\n public void testGetNumBands() throws Exception {\n assertEquals(1, metadata.getImageMetadataList().get(0).getNumBands());\n }",
"class_method_signature": "AlosPRIMetadataTest.testGetNumBands()",
"constructor": false,
"full_signature": "@Test public void testGetNumBands()",
"ide... | {
"fields": [
{
"declarator": "imageDirectoryPath",
"modifier": "private",
"original_string": "private String imageDirectoryPath;",
"type": "String",
"var_name": "imageDirectoryPath"
},
{
"declarator": "upperLeftPointOrigin",
"modifier": "private",
"original... | {
"body": "@Override\n public int getNumBands() {\n return 0;\n }",
"class_method_signature": "AlosPRIMetadata.getNumBands()",
"constructor": false,
"full_signature": "@Override public int getNumBands()",
"identifier": "getNumBands",
"invocations": [],
"modifiers": "@Override public",
"para... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_65 | {
"fields": [
{
"declarator": "plugIn",
"modifier": "private",
"original_string": "private DeimosProductReaderPlugin plugIn;",
"type": "DeimosProductReaderPlugin",
"var_name": "plugIn"
},
{
"declarator": "productsFolder = \"_deimos\" + File.separator",
"modifier":... | {
"body": "@Test\n public void testFileExtensions() {\n final String[] fileExtensions = plugIn.getDefaultFileExtensions();\n assertNotNull(fileExtensions);\n final List<String> extensionList = Arrays.asList(fileExtensions);\n assertEquals(3, extensionList.size());\n assertEquals(... | {
"fields": [
{
"declarator": "COLOR_PALETTE_FILE_NAME = \"Deimos_color_palette.cpd\"",
"modifier": "private static final",
"original_string": "private static final String COLOR_PALETTE_FILE_NAME = \"Deimos_color_palette.cpd\";",
"type": "String",
"var_name": "COLOR_PALETTE_FILE_NAME... | {
"body": "@Override\n public String[] getDefaultFileExtensions() {\n return DeimosConstants.DIMAP_DEFAULT_EXTENSIONS;\n }",
"class_method_signature": "DeimosProductReaderPlugin.getDefaultFileExtensions()",
"constructor": false,
"full_signature": "@Override public String[] getDefaultFileExtensions(... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_262 | {
"fields": [
{
"declarator": "writerPlugIn",
"modifier": "private final",
"original_string": "private final AbstractDriverProductWriterPlugIn writerPlugIn;",
"type": "AbstractDriverProductWriterPlugIn",
"var_name": "writerPlugIn"
},
{
"declarator": "driverName",
... | {
"body": "@Test\n public void testFormatNames() {\n if (GDALInstallInfo.INSTANCE.isPresent()) {\n String[] formatNames = this.writerPlugIn.getFormatNames();\n assertNotNull(formatNames);\n assertEquals(1, formatNames.length);\n\n String formatNamesToCheck = getFo... | {
"fields": [
{
"declarator": "writerDriver",
"modifier": "private final",
"original_string": "private final GDALDriverInfo writerDriver;",
"type": "GDALDriverInfo",
"var_name": "writerDriver"
}
],
"file": "s2tbx-gdal-writer/src/main/java/org/esa/s2tbx/dataio/gdal/writer/plug... | {
"body": "@Override\n public final String[] getFormatNames() {\n return new String[] {this.writerDriver.getWriterPluginFormatName()};\n }",
"class_method_signature": "AbstractDriverProductWriterPlugIn.getFormatNames()",
"constructor": false,
"full_signature": "@Override public final String[] getFo... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_73 | {
"fields": [
{
"declarator": "plugIn",
"modifier": "private",
"original_string": "private RapidEyeL1ReaderPlugin plugIn;",
"type": "RapidEyeL1ReaderPlugin",
"var_name": "plugIn"
},
{
"declarator": "productsFolder = \"_rapideye\" + File.separator",
"modifier": "pr... | {
"body": "@Test\n public void testFormatNames() {\n final String[] formatNames = plugIn.getFormatNames();\n assertNotNull(formatNames);\n assertEquals(1, formatNames.length);\n assertEquals(\"RapidEyeNITF\", formatNames[0]);\n }",
"class_method_signature": "RapidEyeL1ReaderPluginT... | {
"fields": [
{
"declarator": "COLOR_PALETTE_FILE_NAME = \"RapidEye_color_palette.cpd\"",
"modifier": "private static final",
"original_string": "private static final String COLOR_PALETTE_FILE_NAME = \"RapidEye_color_palette.cpd\";",
"type": "String",
"var_name": "COLOR_PALETTE_FILE_... | {
"body": "@Override\n public String[] getFormatNames() {\n return RapidEyeConstants.L1_FORMAT_NAMES;\n }",
"class_method_signature": "RapidEyeL1ReaderPlugin.getFormatNames()",
"constructor": false,
"full_signature": "@Override public String[] getFormatNames()",
"identifier": "getFormatNames",
... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_24 | {
"fields": [
{
"declarator": "metadata",
"modifier": "private",
"original_string": "private AlosPRIMetadata metadata;",
"type": "AlosPRIMetadata",
"var_name": "metadata"
},
{
"declarator": "productsFolder = \"_alos\" + File.separator",
"modifier": "private",
... | {
"body": "@Test\n public void testGetMetadataProfile() throws Exception {\n assertEquals(AlosPRIConstants.ALOSPRI, metadata.getImageMetadataList().get(0).getMetadataProfile());\n assertEquals(AlosPRIConstants.ALOSPRI, metadata.getImageMetadataList().get(1).getMetadataProfile());\n assertEqual... | {
"fields": [
{
"declarator": "imageDirectoryPath",
"modifier": "private",
"original_string": "private String imageDirectoryPath;",
"type": "String",
"var_name": "imageDirectoryPath"
},
{
"declarator": "upperLeftPointOrigin",
"modifier": "private",
"original... | {
"body": "@Override\n public String getMetadataProfile() {\n return null;\n }",
"class_method_signature": "AlosPRIMetadata.getMetadataProfile()",
"constructor": false,
"full_signature": "@Override public String getMetadataProfile()",
"identifier": "getMetadataProfile",
"invocations": [],
"mo... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
22045363_223 | {
"fields": [
{
"declarator": "metadata",
"modifier": "private",
"original_string": "private SpotDimapMetadata metadata;",
"type": "SpotDimapMetadata",
"var_name": "metadata"
},
{
"declarator": "productsFolder = \"_spot\" + File.separator",
"modifier": "private",
... | {
"body": "@Test\n public void testGetStatistics() throws Exception {\n //add some other test with statistics??\n assertEquals(null, metadata.getStatistics(0));\n }",
"class_method_signature": "SpotDimapMetadataTest.testGetStatistics()",
"constructor": false,
"full_signature": "@Test public ... | {
"fields": [
{
"declarator": "wavelengths",
"modifier": "private",
"original_string": "private float[] wavelengths;",
"type": "float[]",
"var_name": "wavelengths"
},
{
"declarator": "bandwidths",
"modifier": "private",
"original_string": "private float[] ba... | {
"body": "public HashMap<String, Double> getStatistics(int bandIndex) {\n if (bandStatistics == null) {\n bandStatistics = new ArrayList<HashMap<String, Double>>(getNumBands());\n if (rootElement != null) {\n MetadataElement currentElement;\n if ((currentEle... | {
"created": "7/20/2014 10:51:51 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 22045363,
"size": null,
"stargazer_count": null,
"stars": 65,
"updates": "2020-01-21T12:26:31+00:00",
"url": "https://github.com/senbox-org/s2tbx... |
52507351_12 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/sql/CalcitePlannerTest.java",
"identifier": "CalcitePlannerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = TableSpaceDoesNotExistException.class)\n public void showCreateTable_Non_Existent_TableSpace() throws Exception {\n String nodeId = \"localhost\";\n try (DBManager manager = new DBManager(\"localhost\", new MemoryMetadataStorageManager(), new MemoryDataStorageManager(), ne... | {
"fields": [
{
"declarator": "USE_DDL_PARSER = Pattern.compile(\"^[\\\\s]*(EXECUTE|CREATE|DROP|ALTER|TRUNCATE|BEGIN|COMMIT|ROLLBACK).*\", Pattern.CASE_INSENSITIVE | Pattern.DOTALL)",
"modifier": "private static final",
"original_string": "private static final Pattern USE_DDL_PARSER = Pattern.co... | {
"body": "@Override\n public TranslatedQuery translate(String defaultTableSpace, String query, List<Object> parameters, boolean scan, boolean allowCache, boolean returnValues, int maxRows) throws StatementExecutionException {\n ensureDefaultTableSpaceBootedLocally(defaultTableSpace);\n /* Strips out... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_28 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/index/brin/BlockRangeIndexTest.java",
"identifier": "BlockRangeIndexTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDelete() {\n BlockRangeIndex<Sized<Integer>, Sized<String>> index =\n new BlockRangeIndex<>(1024, new RandomPageReplacementPolicy(10));\n index.boot(BlockRangeIndexMetadata.empty());\n index.put(Sized.valueOf(3), Sized.valueOf(\"c\"));\n ... | {
"fields": [
{
"declarator": "LOG = Logger.getLogger(BlockRangeIndex.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOG = Logger.getLogger(BlockRangeIndex.class.getName());",
"type": "Logger",
"var_name": "LOG"
},
{
... | {
"body": "public void delete(K key, V value) {\n\n /* Lookup from the first possible block that could contain the value*/\n final BlockStartKey<K> lookUp = BlockStartKey.valueOf(key, Long.MIN_VALUE);\n\n final DeleteState<K, V> state = new DeleteState<>();\n\n /* There is always at least ... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_3 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/codec/RecordSerializerTest.java",
"identifier": "RecordSerializerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSerializeWithNullAndNonNullTypes() {\n byte[] iBytes = RecordSerializer.serialize(new Integer(10), ColumnTypes.INTEGER);\n byte[] iBytesNonNullType = RecordSerializer.serialize(new Integer(10), ColumnTypes.NOTNULL_INTEGER);\n assertArrayEquals(iBytes, iBytesN... | {
"fields": [
{
"declarator": "INITIAL_BUFFER_SIZE = SystemProperties.getIntSystemProperty(\"herddb.serializer.initbufsize\", 1024)",
"modifier": "private static final",
"original_string": "private static final int INITIAL_BUFFER_SIZE = SystemProperties.getIntSystemProperty(\"herddb.serializer.i... | {
"body": "public static byte[] serialize(Object v, int type) {\n if (v == null) {\n return null;\n }\n switch (type) {\n case ColumnTypes.BYTEARRAY:\n case ColumnTypes.NOTNULL_BYTEARRAY:\n return (byte[]) v;\n case ColumnTypes.INTEGER:\n... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_24 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/utils/QueryUtilsTest.java",
"identifier": "QueryUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDiscoverTablespaceFromTruncateTable() {\n String defaultTableSpace = TableSpace.DEFAULT;\n String theTableSpace = \"myts\";\n assertEquals(defaultTableSpace, QueryUtils.discoverTablespace(defaultTableSpace, \"truncate table test\"));\n assertEquals(the... | {
"fields": [
{
"declarator": "PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\"",
"modifier": "private static final",
"original_string": "private static final String PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\";",
"type": "String",
... | {
"body": "public static String discoverTablespace(String defaultTableSpace, String query) {\n if (query == null) {\n return defaultTableSpace;\n }\n\n final Matcher matcher = TABLE_SPACE_NAME_PATTERN.matcher(query);\n\n /* A find will be used, no trim is needed */\n if (... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_32 | {
"fields": [],
"file": "herddb-utils/src/test/java/herddb/utils/ExtendedDataInputStreamTest.java",
"identifier": "ExtendedDataInputStreamTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testReadVInt() throws IOException {\n\n checkAndCompareVInt(0, new byte[]{0});\n checkAndCompareVInt(1, new byte[]{1});\n checkAndCompareVInt(-1, new byte[]{-1, -1, -1, -1, 15});\n checkAndCompareVInt(Integer.MIN_VALUE, new byte[]{-128, -128, -128, -128, 8... | {
"fields": [
{
"declarator": "eof",
"modifier": "private",
"original_string": "private boolean eof;",
"type": "boolean",
"var_name": "eof"
},
{
"declarator": "EMPTY_ARRAY = new byte[0]",
"modifier": "private static final",
"original_string": "private static... | {
"body": "public int readVInt() throws IOException {\n return readVInt(readByte());\n }",
"class_method_signature": "ExtendedDataInputStream.readVInt()",
"constructor": false,
"full_signature": "public int readVInt()",
"identifier": "readVInt",
"invocations": [
"readVInt",
"readByte"
],... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_33 | {
"fields": [],
"file": "herddb-utils/src/test/java/herddb/utils/VisibleByteArrayOutputStreamTest.java",
"identifier": "VisibleByteArrayOutputStreamTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testToByteArrayNoCopy() throws Exception {\n byte[] content = \"foo\".getBytes(StandardCharsets.UTF_8);\n byte[] content2 = \"fooa\".getBytes(StandardCharsets.UTF_8);\n try (VisibleByteArrayOutputStream oo = new VisibleByteArrayOutputStream(3)) {\n oo.... | {
"fields": [
{
"declarator": "buf[]",
"modifier": "",
"original_string": "byte buf[];",
"type": "byte",
"var_name": "buf"
},
{
"declarator": "count",
"modifier": "",
"original_string": "int count;",
"type": "int",
"var_name": "count"
},
... | {
"body": "public byte[] toByteArrayNoCopy() {\n if (count == buf.length) {\n return buf;\n }\n return Arrays.copyOf(buf, count);\n }",
"class_method_signature": "VisibleByteArrayOutputStream.toByteArrayNoCopy()",
"constructor": false,
"full_signature": "public byte[] toByteAr... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_2 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/codec/RecordSerializerTest.java",
"identifier": "RecordSerializerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testConvert() {\n testTimestamp(\"2015-03-29 01:00:00\", \"UTC\", 1427590800000L);\n testTimestamp(\"2015-03-29 02:00:00\", \"UTC\", 1427594400000L);\n testTimestamp(\"2015-03-29 03:00:00\", \"UTC\", 1427598000000L);\n\n }",
"class_method_signature": "Record... | {
"fields": [
{
"declarator": "INITIAL_BUFFER_SIZE = SystemProperties.getIntSystemProperty(\"herddb.serializer.initbufsize\", 1024)",
"modifier": "private static final",
"original_string": "private static final int INITIAL_BUFFER_SIZE = SystemProperties.getIntSystemProperty(\"herddb.serializer.i... | {
"body": "public static Object convert(int type, Object value) throws StatementExecutionException {\n if (value == null && ColumnTypes.isNotNullDataType(type)) {\n throw new StatementExecutionException(\"Cannot have null value in non-NULL type \" + ColumnTypes.sqlDataType(type));\n }\n ... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_25 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/utils/QueryUtilsTest.java",
"identifier": "QueryUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDiscoverTablespaceFromAlterTable() {\n String defaultTableSpace = TableSpace.DEFAULT;\n String theTableSpace = \"myts\";\n assertEquals(defaultTableSpace, QueryUtils.discoverTablespace(defaultTableSpace, \"alter table test\"));\n assertEquals(theTableS... | {
"fields": [
{
"declarator": "PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\"",
"modifier": "private static final",
"original_string": "private static final String PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\";",
"type": "String",
... | {
"body": "public static String discoverTablespace(String defaultTableSpace, String query) {\n if (query == null) {\n return defaultTableSpace;\n }\n\n final Matcher matcher = TABLE_SPACE_NAME_PATTERN.matcher(query);\n\n /* A find will be used, no trim is needed */\n if (... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_29 | {
"fields": [
{
"declarator": "folder = new TemporaryFolder()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TemporaryFolder folder = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "folder"
}
],
"file": "herddb-core/src/test/java/her... | {
"body": "@Test\n public void testLog() throws Exception {\n try (FileCommitLogManager manager = new FileCommitLogManager(folder.newFolder().toPath())) {\n manager.start();\n int writeCount = 0;\n final long _startWrite = System.currentTimeMillis();\n try (Commit... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(FileCommitLog.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(FileCommitLog.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "@Override\n public CommitLogResult log(LogEntry edit, boolean sync) throws LogNotAvailableException {\n if (failed) {\n throw new LogNotAvailableException(\"file commit log is failed\");\n }\n boolean hasListeners = isHasListeners();\n if (hasListeners) {\n ... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_13 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/sql/CalcitePlannerTest.java",
"identifier": "CalcitePlannerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = TableDoesNotExistException.class)\n public void showCreateTable_Within_TransactionContext() throws Exception {\n String nodeId = \"localhost\";\n try (DBManager manager = new DBManager(\"localhost\", new MemoryMetadataStorageManager(), new MemoryDataStorageManager(), new M... | {
"fields": [
{
"declarator": "USE_DDL_PARSER = Pattern.compile(\"^[\\\\s]*(EXECUTE|CREATE|DROP|ALTER|TRUNCATE|BEGIN|COMMIT|ROLLBACK).*\", Pattern.CASE_INSENSITIVE | Pattern.DOTALL)",
"modifier": "private static final",
"original_string": "private static final Pattern USE_DDL_PARSER = Pattern.co... | {
"body": "@Override\n public TranslatedQuery translate(String defaultTableSpace, String query, List<Object> parameters, boolean scan, boolean allowCache, boolean returnValues, int maxRows) throws StatementExecutionException {\n ensureDefaultTableSpaceBootedLocally(defaultTableSpace);\n /* Strips out... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_18 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/utils/QueryUtilsTest.java",
"identifier": "QueryUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDiscoverTablespaceFromUpdate() {\n String defaultTableSpace = TableSpace.DEFAULT;\n String theTableSpace = \"myts\";\n assertEquals(defaultTableSpace, QueryUtils.discoverTablespace(defaultTableSpace, \"update test\"));\n assertEquals(defaultTableSpace,... | {
"fields": [
{
"declarator": "PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\"",
"modifier": "private static final",
"original_string": "private static final String PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\";",
"type": "String",
... | {
"body": "public static String discoverTablespace(String defaultTableSpace, String query) {\n if (query == null) {\n return defaultTableSpace;\n }\n\n final Matcher matcher = TABLE_SPACE_NAME_PATTERN.matcher(query);\n\n /* A find will be used, no trim is needed */\n if (... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_5 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/codec/RecordSerializerTest.java",
"identifier": "RecordSerializerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDeserializeWithNullAndNonNullTypes() {\n byte[] byteValueForInt = Bytes.from_int(1000).to_array();\n int iValue = (int) RecordSerializer.deserialize(byteValueForInt, ColumnTypes.INTEGER);\n assertEquals(iValue, 1000);\n\n int iValueNonNullType = (int) ... | {
"fields": [
{
"declarator": "INITIAL_BUFFER_SIZE = SystemProperties.getIntSystemProperty(\"herddb.serializer.initbufsize\", 1024)",
"modifier": "private static final",
"original_string": "private static final int INITIAL_BUFFER_SIZE = SystemProperties.getIntSystemProperty(\"herddb.serializer.i... | {
"body": "public static Object deserialize(Bytes data, int type) {\n switch (type) {\n case ColumnTypes.BYTEARRAY:\n case ColumnTypes.NOTNULL_BYTEARRAY:\n return data.to_array();\n case ColumnTypes.INTEGER:\n case ColumnTypes.NOTNULL_INTEGER:\n ... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_22 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/utils/QueryUtilsTest.java",
"identifier": "QueryUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDiscoverTablespaceFromCreateTable() {\n String defaultTableSpace = TableSpace.DEFAULT;\n String theTableSpace = \"myts\";\n assertEquals(defaultTableSpace, QueryUtils.discoverTablespace(defaultTableSpace, \"create table test(a,b)\"));\n assertEquals(th... | {
"fields": [
{
"declarator": "PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\"",
"modifier": "private static final",
"original_string": "private static final String PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\";",
"type": "String",
... | {
"body": "public static String discoverTablespace(String defaultTableSpace, String query) {\n if (query == null) {\n return defaultTableSpace;\n }\n\n final Matcher matcher = TABLE_SPACE_NAME_PATTERN.matcher(query);\n\n /* A find will be used, no trim is needed */\n if (... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_34 | {
"fields": [],
"file": "herddb-utils/src/test/java/herddb/proto/PduCodecTest.java",
"identifier": "PduCodecTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void readObjectsTrailer() throws Exception {\n long msgId = 1234;\n String ts = \"dsfs\";\n String query = \"q\";\n long scannerId = 2332;\n long tx = 353;\n List<Object> params = Arrays.asList(\"1\", 12L, 3d);\n long statementId = 2342;\n ... | {
"fields": [
{
"declarator": "SEND_FULL_STACKTRACES = SystemProperties.getBooleanSystemProperty(\"herddb.network.sendstacktraces\", true)",
"modifier": "private static final",
"original_string": "private static final boolean SEND_FULL_STACKTRACES = SystemProperties.getBooleanSystemProperty(\"he... | {
"body": "public static Pdu decodePdu(ByteBuf in) throws IOException {\n byte version = in.getByte(0);\n if (version == VERSION_3) {\n byte flags = in.getByte(1);\n byte type = in.getByte(2);\n long messageId = in.getLong(3);\n return Pdu.newPdu(in, type, fla... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_14 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/sql/CalcitePlannerTest.java",
"identifier": "CalcitePlannerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsDdl() {\n\n assertTrue(CalcitePlanner.isDDL(\"CREATE TABLE\"));\n assertTrue(CalcitePlanner.isDDL(\" CREATE TABLE `sm_machine`\"));\n assertTrue(CalcitePlanner.isDDL(\"CREATE TABLE `sm_machine` (\\n\"\n + \" `ip` varchar(20) NOT NULL DEFAU... | {
"fields": [
{
"declarator": "USE_DDL_PARSER = Pattern.compile(\"^[\\\\s]*(EXECUTE|CREATE|DROP|ALTER|TRUNCATE|BEGIN|COMMIT|ROLLBACK).*\", Pattern.CASE_INSENSITIVE | Pattern.DOTALL)",
"modifier": "private static final",
"original_string": "private static final Pattern USE_DDL_PARSER = Pattern.co... | {
"body": "static final boolean isDDL(String query) {\n // this is quite expensive and it allocates temporary objects\n return USE_DDL_PARSER.matcher(query).matches();\n }",
"class_method_signature": "CalcitePlanner.isDDL(String query)",
"constructor": false,
"full_signature": "static final boo... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_9 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/sql/CalcitePlannerTest.java",
"identifier": "CalcitePlannerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void showCreateTableTest_with_Indexes() throws Exception {\n String nodeId = \"localhost\";\n try (DBManager manager = new DBManager(\"localhost\", new MemoryMetadataStorageManager(), new MemoryDataStorageManager(), new MemoryCommitLogManager(), null, null)) {\n m... | {
"fields": [
{
"declarator": "USE_DDL_PARSER = Pattern.compile(\"^[\\\\s]*(EXECUTE|CREATE|DROP|ALTER|TRUNCATE|BEGIN|COMMIT|ROLLBACK).*\", Pattern.CASE_INSENSITIVE | Pattern.DOTALL)",
"modifier": "private static final",
"original_string": "private static final Pattern USE_DDL_PARSER = Pattern.co... | {
"body": "@Override\n public TranslatedQuery translate(String defaultTableSpace, String query, List<Object> parameters, boolean scan, boolean allowCache, boolean returnValues, int maxRows) throws StatementExecutionException {\n ensureDefaultTableSpaceBootedLocally(defaultTableSpace);\n /* Strips out... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_38 | {
"fields": [],
"file": "herddb-utils/src/test/java/herddb/index/blink/BLinkTest.java",
"identifier": "BLinkTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testUnload() throws Exception {\n\n final int pages = 5;\n final int inserts = 100;\n BLinkIndexDataStorage<Sized<Long>, Long> storage = new DummyBLinkIndexDataStorage<>();\n\n PageReplacementPolicy policy = new RandomPageReplacementPolicy(pages);\n\n ... | {
"fields": [
{
"declarator": "DEBUG = false",
"modifier": "private static final",
"original_string": "private static final boolean DEBUG = false;",
"type": "boolean",
"var_name": "DEBUG"
},
{
"declarator": "LOGGER = Logger.getLogger(BLink.class.getName())",
"modi... | {
"body": "@Override\n public void unload(long pageId) {\n nodes.get(pageId).unload(true, false);\n }",
"class_method_signature": "BLink.unload(long pageId)",
"constructor": false,
"full_signature": "@Override public void unload(long pageId)",
"identifier": "unload",
"invocations": [
"unloa... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_39 | {
"fields": [],
"file": "herddb-cli/src/test/java/herddb/cli/SQLFileParserTest.java",
"identifier": "SQLFileParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testParseSQLFile() throws Exception {\n String sql = \"-- MySQL dump 10.13 Distrib 5.6.35, for Linux (x86_64)\\n\"\n + \"--\\n\"\n + \"-- Host: localhost Database: seleniummonitor\\n\"\n + \"-- ----------------------------------... | {
"fields": [
{
"declarator": "EOF = -1",
"modifier": "private static final",
"original_string": "private static final int EOF = -1;",
"type": "int",
"var_name": "EOF"
}
],
"file": "herddb-cli/src/main/java/herddb/cli/SQLFileParser.java",
"identifier": "SQLFileParser",
"i... | {
"body": "public static void parseSQLFile(Reader stream, StatementAcceptor statements) throws Exception {\n StringBuilder current = new StringBuilder();\n State state = State.OUT;\n while (true) {\n int _c = stream.read();\n char c = (char) _c;\n switch (state) {... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_8 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/sql/CalcitePlannerTest.java",
"identifier": "CalcitePlannerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void showCreateTableTest() throws Exception {\n String nodeId = \"localhost\";\n try (DBManager manager = new DBManager(\"localhost\", new MemoryMetadataStorageManager(), new MemoryDataStorageManager(), new MemoryCommitLogManager(), null, null)) {\n manager.start(... | {
"fields": [
{
"declarator": "USE_DDL_PARSER = Pattern.compile(\"^[\\\\s]*(EXECUTE|CREATE|DROP|ALTER|TRUNCATE|BEGIN|COMMIT|ROLLBACK).*\", Pattern.CASE_INSENSITIVE | Pattern.DOTALL)",
"modifier": "private static final",
"original_string": "private static final Pattern USE_DDL_PARSER = Pattern.co... | {
"body": "@Override\n public TranslatedQuery translate(String defaultTableSpace, String query, List<Object> parameters, boolean scan, boolean allowCache, boolean returnValues, int maxRows) throws StatementExecutionException {\n ensureDefaultTableSpaceBootedLocally(defaultTableSpace);\n /* Strips out... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_15 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/sql/functions/ShowCreateTableCalculatorTest.java",
"identifier": "ShowCreateTableCalculatorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void test() {\n Table t = Table.builder()\n .uuid(\"1234\")\n .column(\"k1\", ColumnTypes.INTEGER)\n .column(\"s1\", ColumnTypes.STRING)\n .primaryKey(\"k1\")\n .tablespace(\"ts1\")\n .name(\"... | {
"fields": [],
"file": "herddb-core/src/main/java/herddb/sql/functions/ShowCreateTableCalculator.java",
"identifier": "ShowCreateTableCalculator",
"interfaces": "",
"methods": [
{
"class_method_signature": "ShowCreateTableCalculator.calculate(boolean showCreateIndex, String tableName, String tableS... | {
"body": "public static String calculate(boolean showCreateIndex, String tableName, String tableSpace, AbstractTableManager tableManager) {\n\n Table t = tableManager.getTable();\n if (t == null) {\n throw new TableDoesNotExistException(String.format(\"Table %s does not exist.\", tableName))... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_35 | {
"fields": [],
"file": "herddb-utils/src/test/java/herddb/index/blink/BLinkTest.java",
"identifier": "BLinkTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSearch() throws Exception {\n List<Long> l = new ArrayList<>();\n for (long i = 0; i < 50; i++) {\n l.add(i);\n }\n testDataSet(l);\n }",
"class_method_signature": "BLinkTest.testSearch()",
"constructor": false,
"full_signature": "@... | {
"fields": [
{
"declarator": "DEBUG = false",
"modifier": "private static final",
"original_string": "private static final boolean DEBUG = false;",
"type": "boolean",
"var_name": "DEBUG"
},
{
"declarator": "LOGGER = Logger.getLogger(BLink.class.getName())",
"modi... | {
"body": "public V search(K v) {\n\n Node<K, V> n;\n @SuppressWarnings(\"unchecked\")\n Deque<ResultCouple<K, V>> descent = DummyDeque.INSTANCE;\n\n try {\n\n n = locate_leaf(v, READ_LOCK, descent); // v € coverset(n), n read-locked\n\n } catch (IOException ex) {\n\n ... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_4 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/codec/RecordSerializerTest.java",
"identifier": "RecordSerializerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSerializeThrowsExceptionOnNullObject() {\n assertNull(RecordSerializer.serialize(null, ColumnTypes.STRING));\n }",
"class_method_signature": "RecordSerializerTest.testSerializeThrowsExceptionOnNullObject()",
"constructor": false,
"full_signature": "@Test public vo... | {
"fields": [
{
"declarator": "INITIAL_BUFFER_SIZE = SystemProperties.getIntSystemProperty(\"herddb.serializer.initbufsize\", 1024)",
"modifier": "private static final",
"original_string": "private static final int INITIAL_BUFFER_SIZE = SystemProperties.getIntSystemProperty(\"herddb.serializer.i... | {
"body": "public static byte[] serialize(Object v, int type) {\n if (v == null) {\n return null;\n }\n switch (type) {\n case ColumnTypes.BYTEARRAY:\n case ColumnTypes.NOTNULL_BYTEARRAY:\n return (byte[]) v;\n case ColumnTypes.INTEGER:\n... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_23 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/utils/QueryUtilsTest.java",
"identifier": "QueryUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDiscoverTablespaceFromDropTable() {\n String defaultTableSpace = TableSpace.DEFAULT;\n String theTableSpace = \"myts\";\n assertEquals(defaultTableSpace, QueryUtils.discoverTablespace(defaultTableSpace, \"drop table test\"));\n assertEquals(theTableSpa... | {
"fields": [
{
"declarator": "PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\"",
"modifier": "private static final",
"original_string": "private static final String PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\";",
"type": "String",
... | {
"body": "public static String discoverTablespace(String defaultTableSpace, String query) {\n if (query == null) {\n return defaultTableSpace;\n }\n\n final Matcher matcher = TABLE_SPACE_NAME_PATTERN.matcher(query);\n\n /* A find will be used, no trim is needed */\n if (... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_19 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/utils/QueryUtilsTest.java",
"identifier": "QueryUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDiscoverTablespaceFromInsert() {\n String defaultTableSpace = TableSpace.DEFAULT;\n String theTableSpace = \"myts\";\n assertEquals(defaultTableSpace, QueryUtils.discoverTablespace(defaultTableSpace, \"insert into test(a,b) values(?,?,?)\"));\n assertE... | {
"fields": [
{
"declarator": "PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\"",
"modifier": "private static final",
"original_string": "private static final String PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\";",
"type": "String",
... | {
"body": "public static String discoverTablespace(String defaultTableSpace, String query) {\n if (query == null) {\n return defaultTableSpace;\n }\n\n final Matcher matcher = TABLE_SPACE_NAME_PATTERN.matcher(query);\n\n /* A find will be used, no trim is needed */\n if (... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_36 | {
"fields": [],
"file": "herddb-utils/src/test/java/herddb/index/blink/BLinkTest.java",
"identifier": "BLinkTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDelete() throws Exception {\n\n final long inserts = 100000;\n\n BLinkIndexDataStorage<Sized<Long>, Long> storage = new DummyBLinkIndexDataStorage<>();\n\n try (BLink<Sized<Long>, Long> blink = new BLink<>(2048L, new LongSizeEvaluator(), new RandomPageReplace... | {
"fields": [
{
"declarator": "DEBUG = false",
"modifier": "private static final",
"original_string": "private static final boolean DEBUG = false;",
"type": "boolean",
"var_name": "DEBUG"
},
{
"declarator": "LOGGER = Logger.getLogger(BLink.class.getName())",
"modi... | {
"body": "public V delete(K v) {\n\n Node<K, V> n;\n Deque<ResultCouple<K, V>> descent = new LinkedList<>();\n Queue<CriticJob> maintenance = new LinkedList<>();\n\n try {\n\n n = locate_leaf(v, WRITE_LOCK, descent); // v € coverset(n), n write-locked\n\n } catch (IOExce... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_7 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/codec/RecordSerializerTest.java",
"identifier": "RecordSerializerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSerializeIndexKey() throws Exception {\n Map<String, Object> data = new HashMap<>();\n data.put(\"k1\", \"key1\");\n data.put(\"n1\", 1);\n data.put(\"l1\", 9L);\n data.put(\"s1\", \"aa\");\n data.put(\"n2\", null);\n data.put(\"s2... | {
"fields": [
{
"declarator": "INITIAL_BUFFER_SIZE = SystemProperties.getIntSystemProperty(\"herddb.serializer.initbufsize\", 1024)",
"modifier": "private static final",
"original_string": "private static final int INITIAL_BUFFER_SIZE = SystemProperties.getIntSystemProperty(\"herddb.serializer.i... | {
"body": "public static Bytes serializeIndexKey(DataAccessor record, ColumnsList index, String[] columns) {\n String[] indexedColumnsList = index.getPrimaryKey();\n if (indexedColumnsList.length == 1) {\n String pkColumn = indexedColumnsList[0];\n if (columns.length != 1 && !colum... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_20 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/utils/QueryUtilsTest.java",
"identifier": "QueryUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDiscoverTablespaceFromUpsert() {\n String defaultTableSpace = TableSpace.DEFAULT;\n String theTableSpace = \"myts\";\n assertEquals(defaultTableSpace, QueryUtils.discoverTablespace(defaultTableSpace, \"upsert into test(a,b) values(?,?,?)\"));\n assertE... | {
"fields": [
{
"declarator": "PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\"",
"modifier": "private static final",
"original_string": "private static final String PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\";",
"type": "String",
... | {
"body": "public static String discoverTablespace(String defaultTableSpace, String query) {\n if (query == null) {\n return defaultTableSpace;\n }\n\n final Matcher matcher = TABLE_SPACE_NAME_PATTERN.matcher(query);\n\n /* A find will be used, no trim is needed */\n if (... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_16 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/sql/SQLRecordPredicateTest.java",
"identifier": "SQLRecordPredicateTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCast() throws Exception {\n testCast(null, null, ColumnTypes.INTEGER);\n\n testCast(1, 1L, ColumnTypes.INTEGER);\n testCast(1, 1d, ColumnTypes.INTEGER);\n testCast(1, true, ColumnTypes.INTEGER);\n testCast(0, false, ColumnTypes.INTEGER);\n ... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(SQLRecordPredicate.class.getName())",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(SQLRecordPredicate.class.getName());",
"type": "Logger",
"var_name": "LOGGER"
... | {
"body": "public static Object cast(Object value, int type) {\n if (value == null) {\n return null;\n }\n try {\n switch (type) {\n case ColumnTypes.BOOLEAN:\n case ColumnTypes.NOTNULL_BOOLEAN: {\n if (value instanceof Boolea... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_41 | {
"fields": [],
"file": "herddb-cli/src/test/java/herddb/cli/MySqlDumpInsertStatementRewriterTest.java",
"identifier": "MySqlDumpInsertStatementRewriterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testRewriteSimpleInsertStatement() throws Exception {\n\n check(\"INSERT INTO table VALUES ('a',1)\", \"INSERT INTO table VALUES (?,?)\", Arrays.asList(\"a\", Long.valueOf(1)));\n check(\"INSERT INTO table VALUES ('a')\", \"INSERT INTO table VALUES (?)\", Arrays.asList(... | {
"fields": [
{
"declarator": "STATE_START_RECORD = 0",
"modifier": "static final",
"original_string": "static final int STATE_START_RECORD = 0;",
"type": "int",
"var_name": "STATE_START_RECORD"
},
{
"declarator": "STATE_IN_VALUE = 1",
"modifier": "static final",
... | {
"body": "public static QueryWithParameters rewriteSimpleInsertStatement(String query) {\n if (!query.startsWith(\"INSERT INTO \")) {\n return null;\n }\n int startValues = query.indexOf(\"VALUES \");\n if (startValues <= 0) {\n return null;\n }\n Strin... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_40 | {
"fields": [],
"file": "herddb-cli/src/test/java/herddb/cli/TableSpaceMapperTest.java",
"identifier": "TableSpaceMapperTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetTableSpace() throws Exception {\n String script = \"if (tableName.startsWith('test')) return 'ns1' else return 'ns2';\";\n TableSpaceMapper mapper = new TableSpaceMapper(script);\n {\n Insert insert = new Insert();\n Table table = new... | {
"fields": [
{
"declarator": "engine",
"modifier": "",
"original_string": "ScriptEngine engine;",
"type": "ScriptEngine",
"var_name": "engine"
},
{
"declarator": "groovyScript",
"modifier": "",
"original_string": "String groovyScript;",
"type": "Strin... | {
"body": "public String getTableSpace(Statement statement) throws ScriptException {\n String tableName = null;\n if (statement instanceof Insert) {\n Insert st = (Insert) statement;\n tableName = st.getTable().getFullyQualifiedName();\n } else if (statement instanceof Updat... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_17 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/utils/QueryUtilsTest.java",
"identifier": "QueryUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDiscoverTablespaceFromSelect() {\n String defaultTableSpace = TableSpace.DEFAULT;\n String theTableSpace = \"myts\";\n assertEquals(defaultTableSpace, QueryUtils.discoverTablespace(defaultTableSpace, \"select * from test\"));\n assertEquals(defaultTabl... | {
"fields": [
{
"declarator": "PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\"",
"modifier": "private static final",
"original_string": "private static final String PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\";",
"type": "String",
... | {
"body": "public static String discoverTablespace(String defaultTableSpace, String query) {\n if (query == null) {\n return defaultTableSpace;\n }\n\n final Matcher matcher = TABLE_SPACE_NAME_PATTERN.matcher(query);\n\n /* A find will be used, no trim is needed */\n if (... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_6 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/codec/RecordSerializerTest.java",
"identifier": "RecordSerializerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalArgumentException.class)\n public void testSerializeThrowsExceptionOnUnknownType() {\n RecordSerializer.serialize(\"test\", ColumnTypes.ANYTYPE);\n }",
"class_method_signature": "RecordSerializerTest.testSerializeThrowsExceptionOnUnknownType()",
"constructor": false... | {
"fields": [
{
"declarator": "INITIAL_BUFFER_SIZE = SystemProperties.getIntSystemProperty(\"herddb.serializer.initbufsize\", 1024)",
"modifier": "private static final",
"original_string": "private static final int INITIAL_BUFFER_SIZE = SystemProperties.getIntSystemProperty(\"herddb.serializer.i... | {
"body": "public static byte[] serialize(Object v, int type) {\n if (v == null) {\n return null;\n }\n switch (type) {\n case ColumnTypes.BYTEARRAY:\n case ColumnTypes.NOTNULL_BYTEARRAY:\n return (byte[]) v;\n case ColumnTypes.INTEGER:\n... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_21 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/utils/QueryUtilsTest.java",
"identifier": "QueryUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDiscoverTablespaceFromDelete() {\n String defaultTableSpace = TableSpace.DEFAULT;\n String theTableSpace = \"myts\";\n assertEquals(defaultTableSpace, QueryUtils.discoverTablespace(defaultTableSpace, \"delete * from test\"));\n assertEquals(defaultTabl... | {
"fields": [
{
"declarator": "PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\"",
"modifier": "private static final",
"original_string": "private static final String PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\";",
"type": "String",
... | {
"body": "public static String discoverTablespace(String defaultTableSpace, String query) {\n if (query == null) {\n return defaultTableSpace;\n }\n\n final Matcher matcher = TABLE_SPACE_NAME_PATTERN.matcher(query);\n\n /* A find will be used, no trim is needed */\n if (... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_37 | {
"fields": [],
"file": "herddb-utils/src/test/java/herddb/index/blink/BLinkTest.java",
"identifier": "BLinkTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testScan() throws Exception {\n\n BLinkIndexDataStorage<Sized<Long>, Long> storage = new DummyBLinkIndexDataStorage<>();\n\n try (BLink<Sized<Long>, Long> blink = new BLink<>(2048L, new LongSizeEvaluator(), new RandomPageReplacementPolicy(10), storage)) {\n\n ... | {
"fields": [
{
"declarator": "DEBUG = false",
"modifier": "private static final",
"original_string": "private static final boolean DEBUG = false;",
"type": "boolean",
"var_name": "DEBUG"
},
{
"declarator": "LOGGER = Logger.getLogger(BLink.class.getName())",
"modi... | {
"body": "public Stream<Entry<K, V>> scan(K from, K to) {\n\n Node<K, V> n;\n\n @SuppressWarnings(\"unchecked\")\n Deque<ResultCouple<K, V>> descent = DummyDeque.INSTANCE;\n\n if (from == null) {\n lock_anchor(READ_LOCK);\n n = anchor.first;\n unlock_ancho... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_10 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/sql/CalcitePlannerTest.java",
"identifier": "CalcitePlannerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void showCreateTable_with_recreating_table_from_command_output() throws Exception {\n String nodeId = \"localhost\";\n try (DBManager manager = new DBManager(\"localhost\", new MemoryMetadataStorageManager(), new MemoryDataStorageManager(), new MemoryCommitLogManager(), null... | {
"fields": [
{
"declarator": "USE_DDL_PARSER = Pattern.compile(\"^[\\\\s]*(EXECUTE|CREATE|DROP|ALTER|TRUNCATE|BEGIN|COMMIT|ROLLBACK).*\", Pattern.CASE_INSENSITIVE | Pattern.DOTALL)",
"modifier": "private static final",
"original_string": "private static final Pattern USE_DDL_PARSER = Pattern.co... | {
"body": "@Override\n public TranslatedQuery translate(String defaultTableSpace, String query, List<Object> parameters, boolean scan, boolean allowCache, boolean returnValues, int maxRows) throws StatementExecutionException {\n ensureDefaultTableSpaceBootedLocally(defaultTableSpace);\n /* Strips out... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_30 | {
"fields": [],
"file": "herddb-utils/src/test/java/herddb/utils/ExtendedDataOutputStreamTest.java",
"identifier": "ExtendedDataOutputStreamTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testWriteVInt() throws IOException {\n\n checkAndCompareVInt(new byte[]{0}, 0);\n checkAndCompareVInt(new byte[]{1}, 1);\n checkAndCompareVInt(new byte[]{-1, -1, -1, -1, 15}, -1);\n checkAndCompareVInt(new byte[]{-128, -128, -128, -128, 8}, Integer.MIN_VAL... | {
"fields": [
{
"declarator": "NULL = new ExtendedDataOutputStream(NullOutputStream.INSTANCE)",
"modifier": "public static final",
"original_string": "public static final ExtendedDataOutputStream NULL = new ExtendedDataOutputStream(NullOutputStream.INSTANCE);",
"type": "ExtendedDataOutputS... | {
"body": "public void writeVInt(int i) throws IOException {\n if ((i & ~0x7F) != 0) {\n writeByte((byte) ((i & 0x7F) | 0x80));\n i >>>= 7;\n\n if ((i & ~0x7F) != 0) {\n writeByte((byte) ((i & 0x7F) | 0x80));\n i >>>= 7;\n\n if ((i &... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_1 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/codec/RecordSerializerTest.java",
"identifier": "RecordSerializerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testToBean() {\n Table table = Table.builder()\n .name(\"t1\")\n .column(\"pk\", ColumnTypes.STRING)\n .column(\"a\", ColumnTypes.STRING)\n .column(\"b\", ColumnTypes.LONG)\n .column(\"c\", ColumnTypes.... | {
"fields": [
{
"declarator": "INITIAL_BUFFER_SIZE = SystemProperties.getIntSystemProperty(\"herddb.serializer.initbufsize\", 1024)",
"modifier": "private static final",
"original_string": "private static final int INITIAL_BUFFER_SIZE = SystemProperties.getIntSystemProperty(\"herddb.serializer.i... | {
"body": "@SuppressFBWarnings(\"RV_RETURN_VALUE_IGNORED\")\n public static Map<String, Object> toBean(Record record, Table table) {\n try {\n ImmutableMap.Builder<String, Object> res = new ImmutableMap.Builder<>();\n\n if (table.primaryKey.length == 1) {\n Object key = ... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_26 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/utils/QueryUtilsTest.java",
"identifier": "QueryUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDiscoverTablespaceFromCreateIndex() {\n String defaultTableSpace = TableSpace.DEFAULT;\n String theTableSpace = \"myts\";\n assertEquals(defaultTableSpace, QueryUtils.discoverTablespace(defaultTableSpace, \"create index test on test\"));\n assertEquals... | {
"fields": [
{
"declarator": "PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\"",
"modifier": "private static final",
"original_string": "private static final String PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\";",
"type": "String",
... | {
"body": "public static String discoverTablespace(String defaultTableSpace, String query) {\n if (query == null) {\n return defaultTableSpace;\n }\n\n final Matcher matcher = TABLE_SPACE_NAME_PATTERN.matcher(query);\n\n /* A find will be used, no trim is needed */\n if (... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_0 | {
"fields": [
{
"declarator": "folder = new TemporaryFolder()",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final TemporaryFolder folder = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "folder"
}
],
"file": "herddb-jdbc/src/t... | {
"body": "@Test\n public void getStatement() throws Exception {\n try (final Server server = new Server(new ServerConfiguration(folder.newFolder().toPath()))) {\n server.start();\n server.waitForStandaloneBoot();\n\n try (final HDBClient client = new HDBClient(new ClientCon... | {
"fields": [
{
"declarator": "IDGENERATOR = new AtomicLong()",
"modifier": "private static final",
"original_string": "private static final AtomicLong IDGENERATOR = new AtomicLong();",
"type": "AtomicLong",
"var_name": "IDGENERATOR"
},
{
"declarator": "id = IDGENERATOR... | {
"body": "@Override\n public Statement getStatement() throws SQLException {\n return parent;\n }",
"class_method_signature": "HerdDBResultSet.getStatement()",
"constructor": false,
"full_signature": "@Override public Statement getStatement()",
"identifier": "getStatement",
"invocations": [],
... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_27 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/utils/QueryUtilsTest.java",
"identifier": "QueryUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDiscoverTablespaceFromDropIndex() {\n String defaultTableSpace = TableSpace.DEFAULT;\n String theTableSpace = \"myts\";\n assertEquals(defaultTableSpace, QueryUtils.discoverTablespace(defaultTableSpace, \"drop index test\"));\n assertEquals(theTableSpa... | {
"fields": [
{
"declarator": "PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\"",
"modifier": "private static final",
"original_string": "private static final String PREFIX_SELECT = \"(?i)select.+[^a-zA-Z_0-9'\\\"]+from[^a-zA-Z_0-9'\\\"]+\";",
"type": "String",
... | {
"body": "public static String discoverTablespace(String defaultTableSpace, String query) {\n if (query == null) {\n return defaultTableSpace;\n }\n\n final Matcher matcher = TABLE_SPACE_NAME_PATTERN.matcher(query);\n\n /* A find will be used, no trim is needed */\n if (... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_31 | {
"fields": [],
"file": "herddb-utils/src/test/java/herddb/utils/InstrumentationUtilsTest.java",
"identifier": "InstrumentationUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testInstrument() {\n AtomicInteger i = new AtomicInteger();\n InstrumentationUtils.addListener((String id, Object... args) -> {\n if (id.equals(\"one\") && args.length == 1 && args[0].equals(\"two\")) {\n i.incrementAndGet();\n }\n ... | {
"fields": [
{
"declarator": "listeners = new Listener[0]",
"modifier": "private static",
"original_string": "private static Listener[] listeners = new Listener[0];",
"type": "Listener[]",
"var_name": "listeners"
}
],
"file": "herddb-utils/src/main/java/herddb/utils/Instrume... | {
"body": "public static void instrument(String id, Object... args) {\n try {\n for (Listener l : listeners) {\n l.run(id, args);\n }\n } catch (Throwable t) {\n throw new RuntimeException(t);\n }\n }",
"class_method_signature": "Instrumentatio... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
52507351_11 | {
"fields": [],
"file": "herddb-core/src/test/java/herddb/sql/CalcitePlannerTest.java",
"identifier": "CalcitePlannerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = TableDoesNotExistException.class)\n public void showCreateTable_Non_Existent_Table() throws Exception {\n String nodeId = \"localhost\";\n try (DBManager manager = new DBManager(\"localhost\", new MemoryMetadataStorageManager(), new MemoryDataStorageManager(), new MemoryCo... | {
"fields": [
{
"declarator": "USE_DDL_PARSER = Pattern.compile(\"^[\\\\s]*(EXECUTE|CREATE|DROP|ALTER|TRUNCATE|BEGIN|COMMIT|ROLLBACK).*\", Pattern.CASE_INSENSITIVE | Pattern.DOTALL)",
"modifier": "private static final",
"original_string": "private static final Pattern USE_DDL_PARSER = Pattern.co... | {
"body": "@Override\n public TranslatedQuery translate(String defaultTableSpace, String query, List<Object> parameters, boolean scan, boolean allowCache, boolean returnValues, int maxRows) throws StatementExecutionException {\n ensureDefaultTableSpaceBootedLocally(defaultTableSpace);\n /* Strips out... | {
"created": "2/25/2016 8:01:32 AM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 52507351,
"size": null,
"stargazer_count": null,
"stars": 115,
"updates": "2020-01-27T15:40:52+00:00",
"url": "https://github.com/diennea/herddb"
... |
77435673_0 | {
"fields": [
{
"declarator": "EXPECTED_MEASUREMENT_NAMES = new HashSet<>(Arrays.asList(\"VMMemoryPoolStats:PS Eden Space-Heap memory\",\n\t\t\t\"CachePerfStats:cachePerfStats\", \"CacheServerStats:192.168.0.12-/127.0.0.1:40405\", \"VMGCStats:PS MarkSweep\",\n\t\t\t\"FunctionServiceStatistics:FunctionExecut... | {
"body": "@Test\n\tpublic void test1() throws IOException {\n\n\t\tTestMeasurementLoader testLoader = new TestMeasurementLoader(false,\n\t\t\t\tnew File(\"src/test/resources/myStatisticsArchiveFile.gfs\"), \"SERVER666\");\n\n\t\ttestLoader.load();\n\n\t\tassertEquals(\"SERVER666\", testLoader.geodeMemberName);\n\t\t... | {
"fields": [
{
"declarator": "LOG = LoggerFactory.getLogger(AbstractStatisticsTSDBLoader.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOG = LoggerFactory.getLogger(AbstractStatisticsTSDBLoader.class);",
"type": "Logger",
"var_name": "L... | {
"body": "public void load() throws IOException {\n\n\t\tif (cleanDatabaseOnLoad) {\n\t\t\tdoCreateEmptyDatabase();\n\t\t}\n\n\t\tstatValueCache.clear();\n\t\tstatValueEmpty.clear();\n\n\t\tfinal StatArchiveReader reader =\n\t\t\t\tnew StatArchiveReader(new File[] { archiveFileName }, statFilters, false);\n\n\t\tfor... | {
"created": null,
"fork": null,
"fork_count": 26,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 77435673,
"size": 766,
"stargazer_count": 35,
"stars": null,
"updates": null,
"url": "https://github.com/tzolov/geode-dashboard"
} |
3028163_55 | {
"fields": [
{
"declarator": "user",
"modifier": "private",
"original_string": "private FeatureUser user;",
"type": "FeatureUser",
"var_name": "user"
},
{
"declarator": "state",
"modifier": "private",
"original_string": "private FeatureState state;",
... | {
"body": "@Test\n public void shouldNotBeActiveWhenRequestHeaderDoesNotIncludeFeatureToggle() {\n when(request.getHeader(\"X-Features\")).thenReturn(\"OTHERFEATURE,ANOTHERFEATURE\");\n\n boolean isActive = strategy.isActive(state, user);\n\n assertFalse(isActive);\n }",
"class_method_signature": "Header... | {
"fields": [
{
"declarator": "ID = \"header\"",
"modifier": "static final",
"original_string": "static final String ID = \"header\";",
"type": "String",
"var_name": "ID"
}
],
"file": "servlet/src/main/java/org/togglz/servlet/activation/HeaderActivationStrategy.java",
"iden... | {
"body": "@Override\n public boolean isActive(FeatureState featureState, FeatureUser user) {\n HttpServletRequest request = HttpServletRequestHolder.get();\n if (request == null || featureState == null || featureState.getFeature() == null) {\n return false;\n }\n String head... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_120 | {
"fields": [],
"file": "core/src/test/java/org/togglz/core/util/ClassUtilsTest.java",
"identifier": "ClassUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void testCreateInstance() {\n CharSequence string = ClassUtils.createInstance(\"java.lang.String\", CharSequence.class);\n assertNotNull(string);\n assertTrue(string instanceof String);\n assertEquals(\"\", string);\n }",
"class_method_signature": "ClassUtilsTest... | {
"fields": [],
"file": "core/src/main/java/org/togglz/core/util/ClassUtils.java",
"identifier": "ClassUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "ClassUtils.createInstance(String classname, Class<T> interfaceClazz)",
"constructor": false,
"full_signature": "@Supp... | {
"body": "@SuppressWarnings(\"unchecked\")\n public static <T> T createInstance(String classname, Class<T> interfaceClazz) {\n ClassLoader classLoader = Thread.currentThread().getContextClassLoader();\n\n if (classLoader == null) {\n classLoader = interfaceClazz.getClassLoader();\n ... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_14 | {
"fields": [
{
"declarator": "MAX_ENTITY_GROUPS = 25",
"modifier": "public static final",
"original_string": "public static final int MAX_ENTITY_GROUPS = 25;",
"type": "int",
"var_name": "MAX_ENTITY_GROUPS"
},
{
"declarator": "helper = new LocalServiceTestHelper(\n ... | {
"body": "@Test\n public void shouldNotStartNewTransaction() {\n update(\"F1\", false, null, null, null);\n DatastoreService spyDatastoreService = Mockito.spy(DelegateDatastoreService.getInstance(datastoreService));\n repository = new DatastoreStateRepository(spyDatastoreService);\n re... | {
"fields": [
{
"declarator": "STRATEGY_PARAMS_VALUES = \"strategyParamsValues\"",
"modifier": "public static final",
"original_string": "public static final String STRATEGY_PARAMS_VALUES = \"strategyParamsValues\";",
"type": "String",
"var_name": "STRATEGY_PARAMS_VALUES"
},
... | {
"body": "@Override\n public FeatureState getFeatureState(final Feature feature) {\n try {\n final Key key = KeyFactory.createKey(kind(), feature.name());\n return createFeatureState(feature, getInsideTransaction(key));\n } catch (final EntityNotFoundException ignored) {\n ... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_161 | {
"fields": [],
"file": "core/src/test/java/org/togglz/core/repository/jdbc/SchemaUpdaterTest.java",
"identifier": "SchemaUpdaterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldDetectMissingTable() throws SQLException {\n\n Connection connection = createConnection();\n try {\n\n SchemaUpdater updater = new SchemaUpdater(connection, \"TOGGLZ\", DefaultMapSerializer.multiline());\n assertFalse(updater.doesTableExist()... | {
"fields": [
{
"declarator": "connection",
"modifier": "private final",
"original_string": "private final Connection connection;",
"type": "Connection",
"var_name": "connection"
},
{
"declarator": "tableName",
"modifier": "private final",
"original_string":... | {
"body": "protected boolean doesTableExist() throws SQLException {\n return isSuccessful(\"SELECT * FROM %TABLE%\");\n }",
"class_method_signature": "SchemaUpdater.doesTableExist()",
"constructor": false,
"full_signature": "protected boolean doesTableExist()",
"identifier": "doesTableExist",
"inv... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_136 | {
"fields": [
{
"declarator": "strategy = new TestingGradualActivationStrategy()",
"modifier": "private final",
"original_string": "private final ActivationStrategy strategy = new TestingGradualActivationStrategy();",
"type": "ActivationStrategy",
"var_name": "strategy"
}
],
... | {
"body": "@Test\n void shouldReturnFalseForInvalidPercentage() {\n FeatureState state = new FeatureState(GradualFeature.FEATURE);\n state.setEnabled(true);\n state.setParameter(GradualActivationStrategy.PARAM_PERCENTAGE, \"100x\");\n\n assertFalse(strategy.isActive(state, aUserWithHash... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(GradualActivationStrategy.class)",
"modifier": "private final",
"original_string": "private final Log log = LogFactory.getLog(GradualActivationStrategy.class);",
"type": "Log",
"var_name": "log"
},
{
"declarator": "... | {
"body": "@Override\n public boolean isActive(FeatureState state, FeatureUser user) {\n\n if (user != null && Strings.isNotBlank(user.getName())) {\n\n String percentageAsString = state.getParameter(PARAM_PERCENTAGE);\n try {\n\n int percentage = Integer.valueOf(percent... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_43 | {
"fields": [
{
"declarator": "applicationListener",
"modifier": "private",
"original_string": "private TogglzApplicationContextBinderApplicationListener applicationListener;",
"type": "TogglzApplicationContextBinderApplicationListener",
"var_name": "applicationListener"
},
{... | {
"body": "@Test\n void contextRefreshedIgnored() {\n // Release any application context before context refreshed event invoked\n ContextClassLoaderApplicationContextHolder.release();\n applicationContext = mock(ApplicationContext.class);\n ContextRefreshedEvent contextRefreshedEvent = ... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(TogglzApplicationContextBinderApplicationListener.class)",
"modifier": "private static final",
"original_string": "private static final Log log = LogFactory.getLog(TogglzApplicationContextBinderApplicationListener.class);",
"type": "Lo... | {
"body": "@Override\n public void onApplicationEvent(ApplicationEvent event) {\n if (event instanceof ContextRefreshedEvent && filter.test((ContextRefreshedEvent) event)) {\n if (ContextClassLoaderApplicationContextHolder.get() != null) {\n log.warn(\"ApplicationContext already bo... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_38 | {
"fields": [
{
"declarator": "mockApplicationContext",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private ApplicationContext mockApplicationContext;",
"type": "ApplicationContext",
"var_name": "mockApplicationContext"
},
{
"declarator": "mockEnvir... | {
"body": "@Test\n void testGetId() {\n assertEquals(SpringEnvironmentPropertyActivationStrategy.ID, strategy.getId());\n }",
"class_method_signature": "SpringEnvironmentPropertyActivationStrategyTest.testGetId()",
"constructor": false,
"full_signature": "@Test void testGetId()",
"identifier": "t... | {
"fields": [
{
"declarator": "ID = \"spring-environment-property\"",
"modifier": "public static final",
"original_string": "public static final String ID = \"spring-environment-property\";",
"type": "String",
"var_name": "ID"
}
],
"file": "spring-core/src/main/java/org/toggl... | {
"body": "@Override\n public String getId() {\n return ID;\n }",
"class_method_signature": "SpringEnvironmentPropertyActivationStrategy.getId()",
"constructor": false,
"full_signature": "@Override public String getId()",
"identifier": "getId",
"invocations": [],
"modifiers": "@Override publi... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_80 | {
"fields": [],
"file": "spring-boot/starter/src/test/java/org/togglz/spring/boot/actuate/TogglzEndpointTest.java",
"identifier": "TogglzEndpointTest",
"interfaces": "",
"superclass": "extends BaseTest"
} | {
"body": "@Test\n public void getAllFeatures() {\n contextRunner.withConfiguration(AutoConfigurations.of(\n DispatcherServletPathConfig.class,\n TogglzAutoConfiguration.class,\n TogglzEndpointAutoConfiguration.class))\n .withPropertyValues(\n ... | {
"fields": [
{
"declarator": "featureManager",
"modifier": "private final",
"original_string": "private final FeatureManager featureManager;",
"type": "FeatureManager",
"var_name": "featureManager"
}
],
"file": "spring-boot/starter/src/main/java/org/togglz/spring/boot/actuat... | {
"body": "@ReadOperation\n public List<TogglzFeature> getAllFeatures() {\n List<TogglzFeature> features = new ArrayList<>();\n for (Feature feature : this.featureManager.getFeatures()) {\n FeatureState featureState = this.featureManager.getFeatureState(feature);\n features.add(... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_79 | {
"fields": [
{
"declarator": "stateRepository = HazelcastStateRepository.newBuilder().mapName(\"togglzMap\").build()",
"modifier": "private final",
"original_string": "private final StateRepository stateRepository = HazelcastStateRepository.newBuilder().mapName(\"togglzMap\").build();",
"... | {
"body": "@Test\n\tvoid multipleConfiguredPiecesThrowsIllegalStateException() {\n\t\tassertThrows(IllegalStateException.class, () -> {\n\t\t\tHazelcastStateRepository.newBuilder()\n\t\t\t\t\t.clientConfig(new ClientConfig())\n\t\t\t\t\t.config(new Config())\n\t\t\t\t\t.build();\n\t\t});\n\t}",
"class_method_signat... | {
"fields": [
{
"declarator": "hazelcastInstance",
"modifier": "protected final",
"original_string": "protected final HazelcastInstance hazelcastInstance;",
"type": "HazelcastInstance",
"var_name": "hazelcastInstance"
},
{
"declarator": "hazelcastConfig",
"modifie... | {
"body": "public static Builder newBuilder() {\n\t\treturn new Builder();\n\t}",
"class_method_signature": "HazelcastStateRepository.newBuilder()",
"constructor": false,
"full_signature": "public static Builder newBuilder()",
"identifier": "newBuilder",
"invocations": [],
"modifiers": "public static",
... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_96 | {
"fields": [],
"file": "core/src/test/java/org/togglz/core/manager/EnumBasedFeatureProviderTest.java",
"identifier": "EnumBasedFeatureProviderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void providerShouldNotEagerlyCreateFeaturesSet() {\n FeatureProvider provider = new EnumBasedFeatureProvider();\n assertEquals(0, provider.getFeatures().size());\n }",
"class_method_signature": "EnumBasedFeatureProviderTest.providerShouldNotEagerlyCreateFeaturesSet()",
... | {
"fields": [
{
"declarator": "metaDataCache = null",
"modifier": "private",
"original_string": "private Map<String, FeatureMetaData> metaDataCache = null;",
"type": "Map<String, FeatureMetaData>",
"var_name": "metaDataCache"
},
{
"declarator": "features = null",
... | {
"body": "@Override\n public Set<Feature> getFeatures() {\n if (this.features == null){\n return Collections.emptySet();\n }\n return Collections.unmodifiableSet(features);\n }",
"class_method_signature": "EnumBasedFeatureProvider.getFeatures()",
"constructor": false,
"ful... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_59 | {
"fields": [
{
"declarator": "user",
"modifier": "private",
"original_string": "private FeatureUser user;",
"type": "FeatureUser",
"var_name": "user"
},
{
"declarator": "state",
"modifier": "private",
"original_string": "private FeatureState state;",
... | {
"body": "@Test\n public void shouldNotBeActiveWhenOnlyNonMatchingParametersArePresent() {\n Map<String, String[]> parameters = new HashMap<>();\n parameters.put(\"somethingThatDoesNotMatch\", new String[]{\"true\"});\n parameters.put(\"somethingElse\", new String[]{\"aValue\"});\n\n w... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(QueryParameterActivationStrategy.class)",
"modifier": "private static final",
"original_string": "private static final Log log = LogFactory.getLog(QueryParameterActivationStrategy.class);",
"type": "Log",
"var_name": "log"
},... | {
"body": "@Override\n public boolean isActive(FeatureState featureState, FeatureUser user) {\n\n HttpServletRequest request = HttpServletRequestHolder.get();\n if (request == null) {\n return false;\n }\n\n String triggerParamsString = featureState.getParameter(PARAM_URL_PAR... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_18 | {
"fields": [
{
"declarator": "MAX_ENTITY_GROUPS = 25",
"modifier": "public static final",
"original_string": "public static final int MAX_ENTITY_GROUPS = 25;",
"type": "int",
"var_name": "MAX_ENTITY_GROUPS"
},
{
"declarator": "helper = new LocalServiceTestHelper(\n ... | {
"body": "@SuppressWarnings(\"serial\")\n @Test\n public void testShouldReadStateWithStrategyAndParameters() {\n\n /*\n * GIVEN a database row containing a simple feature state\n */\n final Map<String, String> map = new HashMap<String, String>() {\n {\n p... | {
"fields": [
{
"declarator": "STRATEGY_PARAMS_VALUES = \"strategyParamsValues\"",
"modifier": "public static final",
"original_string": "public static final String STRATEGY_PARAMS_VALUES = \"strategyParamsValues\";",
"type": "String",
"var_name": "STRATEGY_PARAMS_VALUES"
},
... | {
"body": "@Override\n public FeatureState getFeatureState(final Feature feature) {\n try {\n final Key key = KeyFactory.createKey(kind(), feature.name());\n return createFeatureState(feature, getInsideTransaction(key));\n } catch (final EntityNotFoundException ignored) {\n ... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_34 | {
"fields": [
{
"declarator": "activeProfiles",
"modifier": "private",
"original_string": "private String[] activeProfiles;",
"type": "String[]",
"var_name": "activeProfiles"
},
{
"declarator": "mockApplicationContext",
"modifier": "@Mock\n private",
"ori... | {
"body": "@Test\n void testIsActiveThrowsWhenNoApplicationContext() {\n FeatureState featureState = new FeatureState(TestFeatures.FEATURE_ONE, true);\n\n ContextClassLoaderApplicationContextHolder.release();\n\n assertThrows(IllegalStateException.class, () -> strategy.isActive(featureState, n... | {
"fields": [
{
"declarator": "ID = \"spring-profile\"",
"modifier": "public static final",
"original_string": "public static final String ID = \"spring-profile\";",
"type": "String",
"var_name": "ID"
},
{
"declarator": "PARAM_PROFILES = \"profiles\"",
"modifier":... | {
"body": "@Override\n public boolean isActive(FeatureState featureState, FeatureUser user, List<Token> tokens) {\n ApplicationContext applicationContext = ContextClassLoaderApplicationContextHolder.get();\n if (applicationContext == null) {\n throw new IllegalStateException(\"ApplicationC... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_141 | {
"fields": [
{
"declarator": "activationStrategy",
"modifier": "@InjectMocks\n private",
"original_string": "@InjectMocks\n private UserRoleActivationStrategy activationStrategy;",
"type": "UserRoleActivationStrategy",
"var_name": "activationStrategy"
},
{
"decla... | {
"body": "@Test\n void isActiveWillReturnFalseWhenThereIsNoRolesParam() {\n when(user.getAttribute(USER_ATTRIBUTE_ROLES)).thenReturn(userRoles);\n when(state.getParameter(PARAM_ROLES_NAME)).thenReturn(null);\n\n boolean result = activationStrategy.isActive(state, user);\n\n assertFalse... | {
"fields": [
{
"declarator": "ID = \"user-role\"",
"modifier": "public static final",
"original_string": "public static final String ID = \"user-role\";",
"type": "String",
"var_name": "ID"
},
{
"declarator": "NAME = \"Users by role\"",
"modifier": "public static... | {
"body": "@Override\n public boolean isActive(FeatureState state, FeatureUser user) {\n\n if (user != null) {\n\n Collection<String> userRoles = \n (Collection<String>) user.getAttribute(USER_ATTRIBUTE_ROLES);\n\n if (userRoles != null) {\n\n String roles... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_1 | {
"fields": [
{
"declarator": "strategy",
"modifier": "private",
"original_string": "private MicroProfileConfigActivationStrategy strategy;",
"type": "MicroProfileConfigActivationStrategy",
"var_name": "strategy"
}
],
"file": "microprofile-config/src/test/java/org/togglz/micr... | {
"body": "@Test\n void strategyNameShouldNotBeBlankByDefault() {\n assertTrue(Strings.isNotBlank(strategy.getName()));\n }",
"class_method_signature": "MicroProfileConfigActivationStrategyTest.strategyNameShouldNotBeBlankByDefault()",
"constructor": false,
"full_signature": "@Test void strategyNam... | {
"fields": [
{
"declarator": "ID = \"microprofile-config-property\"",
"modifier": "public static final",
"original_string": "public static final String ID = \"microprofile-config-property\";",
"type": "String",
"var_name": "ID"
}
],
"file": "microprofile-config/src/main/java... | {
"body": "@Override\n public String getName() {\n return \"MicroProfile Config Property\";\n }",
"class_method_signature": "MicroProfileConfigActivationStrategy.getName()",
"constructor": false,
"full_signature": "@Override public String getName()",
"identifier": "getName",
"invocations": [],
... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_116 | {
"fields": [],
"file": "core/src/test/java/org/togglz/core/util/StringsTest.java",
"identifier": "StringsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void testToBooleanThrowsIfStringIsInvalid() {\n assertThrows(IllegalArgumentException.class, () -> Strings.toBoolean(\"foo\"));\n }",
"class_method_signature": "StringsTest.testToBooleanThrowsIfStringIsInvalid()",
"constructor": false,
"full_signature": "@Test void testToBooleanT... | {
"fields": [
{
"declarator": "falseValues = new HashSet<>(4)",
"modifier": "private static final",
"original_string": "private static final Set<String> falseValues = new HashSet<>(4);",
"type": "Set<String>",
"var_name": "falseValues"
},
{
"declarator": "trueValues = n... | {
"body": "public static Boolean toBoolean(String s) {\n String value = trimToNull(s);\n if (value == null) {\n return null;\n }\n\n value = value.toLowerCase();\n\n if (trueValues.contains(value)) {\n return Boolean.TRUE;\n }\n if (falseValues.co... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_63 | {
"fields": [
{
"declarator": "user",
"modifier": "private",
"original_string": "private FeatureUser user;",
"type": "FeatureUser",
"var_name": "user"
},
{
"declarator": "state",
"modifier": "private",
"original_string": "private FeatureState state;",
... | {
"body": "@Test\n public void shouldBeActiveWhenAnAcceptedParameterWithoutRequiredValueIsPresent() {\n Map<String, String[]> parameters = new HashMap<>();\n parameters.put(\"parameterWithoutValue\", null);\n when(request.getParameterMap()).thenReturn(parameters);\n\n boolean isActive =... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(QueryParameterActivationStrategy.class)",
"modifier": "private static final",
"original_string": "private static final Log log = LogFactory.getLog(QueryParameterActivationStrategy.class);",
"type": "Log",
"var_name": "log"
},... | {
"body": "@Override\n public boolean isActive(FeatureState featureState, FeatureUser user) {\n\n HttpServletRequest request = HttpServletRequestHolder.get();\n if (request == null) {\n return false;\n }\n\n String triggerParamsString = featureState.getParameter(PARAM_URL_PAR... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_75 | {
"fields": [
{
"declarator": "MATCHING_VHOST_NAME = \"enabled.example.com\"",
"modifier": "private static final",
"original_string": "private static final String MATCHING_VHOST_NAME = \"enabled.example.com\";",
"type": "String",
"var_name": "MATCHING_VHOST_NAME"
},
{
"... | {
"body": "@Test\n public void shouldReturnTrueForFeatureOnMatchingOneDomainNameFromDomainList() {\n // given\n state.setParameter(ServerNameActivationStrategy.PARAM_SERVER_NAMES,\n format(\"%s,%s\", MATCHING_VHOST_NAME, DIFFERENT_VHOST_NAME));\n // when\n boolean active = st... | {
"fields": [
{
"declarator": "ID = \"servername\"",
"modifier": "static final",
"original_string": "static final String ID = \"servername\";",
"type": "String",
"var_name": "ID"
},
{
"declarator": "PARAM_SERVER_NAMES = \"servernames\"",
"modifier": "static final"... | {
"body": "@Override\n public boolean isActive(FeatureState featureState, FeatureUser user) {\n HttpServletRequest request = getServletRequest();\n if (request != null) {\n String allowedServerNamesParam = featureState.getParameter(PARAM_SERVER_NAMES);\n List<String> allowedServ... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_100 | {
"fields": [
{
"declarator": "repository",
"modifier": "private",
"original_string": "private StateRepository repository;",
"type": "StateRepository",
"var_name": "repository"
},
{
"declarator": "manager",
"modifier": "private",
"original_string": "private ... | {
"body": "@Test\n public void testGetFeatureState() {\n\n FeatureState state = manager.getFeatureState(MyFeatures.DELETE_USERS);\n assertEquals(MyFeatures.DELETE_USERS, state.getFeature());\n assertTrue(state.isEnabled());\n assertEquals(\"admin\", state.getParameter(UsernameActivation... | {
"fields": [
{
"declarator": "name",
"modifier": "private final",
"original_string": "private final String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "stateRepository",
"modifier": "private final",
"original_string": "private final Stat... | {
"body": "@Override\n public FeatureState getFeatureState(Feature feature) {\n Validate.notNull(feature, \"feature is required\");\n FeatureState state = stateRepository.getFeatureState(feature);\n if (state == null) {\n state = getMetaData(feature).getDefaultFeatureState();\n ... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_157 | {
"fields": [
{
"declarator": "delegate",
"modifier": "private",
"original_string": "private StateRepository delegate;",
"type": "StateRepository",
"var_name": "delegate"
}
],
"file": "core/src/test/java/org/togglz/core/repository/cache/CachingStateRepositoryTest.java",
"id... | {
"body": "@Test\n void testCachingOfReadOperationsWithTimeToLife() throws InterruptedException {\n StateRepository repository = new CachingStateRepository(delegate, 10000);\n\n // do some lookups\n for (int i = 0; i < 10; i++) {\n assertTrue(repository.getFeatureState(DummyFeature.... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final StateRepository delegate;",
"type": "StateRepository",
"var_name": "delegate"
},
{
"declarator": "cache = new ConcurrentHashMap<String, CacheEntry>()",
"modifi... | {
"body": "@Override\n public FeatureState getFeatureState(Feature feature) {\n\n // first try to find it from the cache\n CacheEntry entry = cache.get(feature.name());\n if (entry != null && !isExpired(entry)) {\n return entry.getState() != null ? entry.getState().copy() : null;\n ... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_22 | {
"fields": [
{
"declarator": "helper = new LocalServiceTestHelper(\n new LocalDatastoreServiceTestConfig())",
"modifier": "private final",
"original_string": "private final LocalServiceTestHelper helper = new LocalServiceTestHelper(\n new LocalDatastoreServiceTestConfig());",
... | {
"body": "@Test\n public void setFeatureStateShouldRunWithinGivenNamespace() {\n repository = new FixedNamespaceStateRepository(ACME_NAMESPACE, new StateRepository() {\n @Override\n public void setFeatureState(FeatureState featureState) {\n assertEquals(ACME_NAMESPACE, ... | {
"fields": [
{
"declarator": "namespace",
"modifier": "private final",
"original_string": "private final String namespace;",
"type": "String",
"var_name": "namespace"
},
{
"declarator": "decorated",
"modifier": "private final",
"original_string": "private f... | {
"body": "@Override\n public void setFeatureState(final FeatureState featureState) {\n withinNamespace(namespace, new VoidWork() {\n @Override\n void vrun() {\n decorated.setFeatureState(featureState);\n }\n });\n }",
"class_method_signature": "Fi... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_156 | {
"fields": [
{
"declarator": "FIELD_LEVEL_GROUP_LABEL = \"Field Level Group Label\"",
"modifier": "static final",
"original_string": "static final String FIELD_LEVEL_GROUP_LABEL = \"Field Level Group Label\";",
"type": "String",
"var_name": "FIELD_LEVEL_GROUP_LABEL"
},
{
... | {
"body": "@Test\n void buildWillReturnNullWhenFeatureGroupAnnotationIsNotPresent() throws Exception {\n FeatureGroup result = AnnotationFeatureGroup.build(Label.class);\n\n assertNull(result);\n }",
"class_method_signature": "AnnotationFeatureGroupTest.buildWillReturnNullWhenFeatureGroupAnnotat... | {
"fields": [
{
"declarator": "label",
"modifier": "private final",
"original_string": "private final String label;",
"type": "String",
"var_name": "label"
},
{
"declarator": "annotation",
"modifier": "private final",
"original_string": "private final Class<... | {
"body": "public static FeatureGroup build(Class<? extends Annotation> groupAnnotation) {\n if (groupAnnotation.isAnnotationPresent(org.togglz.core.annotation.FeatureGroup.class)) {\n return new AnnotationFeatureGroup(groupAnnotation);\n }\n return null;\n }",
"class_method_signa... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_23 | {
"fields": [
{
"declarator": "helper =\n new LocalServiceTestHelper(new LocalMemcacheServiceTestConfig())",
"modifier": "private final",
"original_string": "private final LocalServiceTestHelper helper =\n new LocalServiceTestHelper(new LocalMemcacheServiceTestConfig());",
"t... | {
"body": "@Test\n public void testCacheExpiryBecauseOfTimeToLife() throws InterruptedException {\n\n int ttl = 5;\n MemcacheStateRepository repository = new MemcacheStateRepository(delegate, ttl);\n\n // do some lookups\n for (int i = 0; i < 5; i++) {\n assertTrue(repository... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private",
"original_string": "private StateRepository delegate;",
"type": "StateRepository",
"var_name": "delegate"
},
{
"declarator": "cache = MemcacheServiceFactory.getMemcacheService()",
"modifier": "privat... | {
"body": "@Override\n public FeatureState getFeatureState(Feature feature) {\n // first try to find it from the cache\n CacheEntry entry = (CacheEntry) cache.get(key(feature.name()));\n if (entry != null) {\n return entry.getState() != null ? entry.getState() : null;\n }\n\n... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_74 | {
"fields": [
{
"declarator": "MATCHING_VHOST_NAME = \"enabled.example.com\"",
"modifier": "private static final",
"original_string": "private static final String MATCHING_VHOST_NAME = \"enabled.example.com\";",
"type": "String",
"var_name": "MATCHING_VHOST_NAME"
},
{
"... | {
"body": "@Test\n public void shouldReturnFalseForFeatureOnDifferentDomainName() {\n // given\n state.setParameter(ServerNameActivationStrategy.PARAM_SERVER_NAMES, DIFFERENT_VHOST_NAME);\n // when\n boolean active = strategySpy.isActive(state, user);\n // then\n assertTha... | {
"fields": [
{
"declarator": "ID = \"servername\"",
"modifier": "static final",
"original_string": "static final String ID = \"servername\";",
"type": "String",
"var_name": "ID"
},
{
"declarator": "PARAM_SERVER_NAMES = \"servernames\"",
"modifier": "static final"... | {
"body": "@Override\n public boolean isActive(FeatureState featureState, FeatureUser user) {\n HttpServletRequest request = getServletRequest();\n if (request != null) {\n String allowedServerNamesParam = featureState.getParameter(PARAM_SERVER_NAMES);\n List<String> allowedServ... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_101 | {
"fields": [],
"file": "core/src/test/java/org/togglz/core/manager/PropertyFeatureProviderTest.java",
"identifier": "PropertyFeatureProviderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldNotAllowTheDefaultFeatureStateToBeChangedByExternalClasses() {\n Properties properties = new Properties();\n properties.setProperty(\"F1\", \"\");\n\n PropertyFeatureProvider provider = new PropertyFeatureProvider(properties);\n\n FeatureMetaData met... | {
"fields": [
{
"declarator": "features = new LinkedHashSet<Feature>()",
"modifier": "private final",
"original_string": "private final Set<Feature> features = new LinkedHashSet<Feature>();",
"type": "Set<Feature>",
"var_name": "features"
},
{
"declarator": "metadata = ... | {
"body": "@Override\n public FeatureMetaData getMetaData(Feature feature) {\n return metadata.get(feature.name());\n }",
"class_method_signature": "PropertyFeatureProvider.getMetaData(Feature feature)",
"constructor": false,
"full_signature": "@Override public FeatureMetaData getMetaData(Feature f... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_117 | {
"fields": [],
"file": "core/src/test/java/org/togglz/core/util/FeatureMapTest.java",
"identifier": "FeatureMapTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n void shouldReturnCorrectSize() {\n List<Feature> features = Arrays.<Feature>asList(\n new NamedFeature(\"f1\"),\n new NamedFeature(\"f2\")\n );\n\n FeatureManager featureManager = mock(FeatureManager.class);\n when(featureManager.getFeatures(... | {
"fields": [
{
"declarator": "manager",
"modifier": "private final",
"original_string": "private final FeatureManager manager;",
"type": "FeatureManager",
"var_name": "manager"
}
],
"file": "core/src/main/java/org/togglz/core/util/FeatureMap.java",
"identifier": "FeatureMa... | {
"body": "@Override\n public int size() {\n return manager.getFeatures().size();\n }",
"class_method_signature": "FeatureMap.size()",
"constructor": false,
"full_signature": "@Override public int size()",
"identifier": "size",
"invocations": [
"size",
"getFeatures"
],
"modifiers": ... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_62 | {
"fields": [
{
"declarator": "user",
"modifier": "private",
"original_string": "private FeatureUser user;",
"type": "FeatureUser",
"var_name": "user"
},
{
"declarator": "state",
"modifier": "private",
"original_string": "private FeatureState state;",
... | {
"body": "@Test\n public void shouldBeActiveWhenAnAcceptedParameterAndValueArePresent() {\n Map<String, String[]> parameters = new HashMap<>();\n parameters.put(\"toggleFeatureX\", new String[]{\"true\"});\n parameters.put(\"toggleAll\", new String[]{\"nope\"});\n when(request.getParam... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(QueryParameterActivationStrategy.class)",
"modifier": "private static final",
"original_string": "private static final Log log = LogFactory.getLog(QueryParameterActivationStrategy.class);",
"type": "Log",
"var_name": "log"
},... | {
"body": "@Override\n public boolean isActive(FeatureState featureState, FeatureUser user) {\n\n HttpServletRequest request = HttpServletRequestHolder.get();\n if (request == null) {\n return false;\n }\n\n String triggerParamsString = featureState.getParameter(PARAM_URL_PAR... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_0 | {
"fields": [
{
"declarator": "strategy",
"modifier": "private",
"original_string": "private MicroProfileConfigActivationStrategy strategy;",
"type": "MicroProfileConfigActivationStrategy",
"var_name": "strategy"
}
],
"file": "microprofile-config/src/test/java/org/togglz/micr... | {
"body": "@Test\n void shouldHaveSameActivationStrategyId() {\n assertEquals(MicroProfileConfigActivationStrategy.ID, strategy.getId());\n }",
"class_method_signature": "MicroProfileConfigActivationStrategyTest.shouldHaveSameActivationStrategyId()",
"constructor": false,
"full_signature": "@Test v... | {
"fields": [
{
"declarator": "ID = \"microprofile-config-property\"",
"modifier": "public static final",
"original_string": "public static final String ID = \"microprofile-config-property\";",
"type": "String",
"var_name": "ID"
}
],
"file": "microprofile-config/src/main/java... | {
"body": "@Override\n public String getId() {\n return ID;\n }",
"class_method_signature": "MicroProfileConfigActivationStrategy.getId()",
"constructor": false,
"full_signature": "@Override public String getId()",
"identifier": "getId",
"invocations": [],
"modifiers": "@Override public",
"... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_35 | {
"fields": [
{
"declarator": "activeProfiles",
"modifier": "private",
"original_string": "private String[] activeProfiles;",
"type": "String[]",
"var_name": "activeProfiles"
},
{
"declarator": "mockApplicationContext",
"modifier": "@Mock\n private",
"ori... | {
"body": "@Test\n void testGetParameters() {\n Parameter[] parameters = strategy.getParameters();\n\n assertEquals(1, parameters.length);\n\n Parameter parameter = parameters[0];\n\n assertNotNull(parameter);\n assertEquals(SpringProfileActivationStrategy.PARAM_PROFILES, paramet... | {
"fields": [
{
"declarator": "ID = \"spring-profile\"",
"modifier": "public static final",
"original_string": "public static final String ID = \"spring-profile\";",
"type": "String",
"var_name": "ID"
},
{
"declarator": "PARAM_PROFILES = \"profiles\"",
"modifier":... | {
"body": "@Override\n public Parameter[] getParameters() {\n return new Parameter[] {\n ParameterBuilder.create(PARAM_PROFILES)\n .label(\"Profile Names\")\n .description(\"A comma-separated list of profile names for which the feature should be active. A \"\n ... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_140 | {
"fields": [
{
"declarator": "activationStrategy",
"modifier": "@InjectMocks\n private",
"original_string": "@InjectMocks\n private UserRoleActivationStrategy activationStrategy;",
"type": "UserRoleActivationStrategy",
"var_name": "activationStrategy"
},
{
"decla... | {
"body": "@Test\n void isActiveWillReturnFalseWhenThereIsNoRolesAttribute() {\n when(user.getAttribute(USER_ATTRIBUTE_ROLES)).thenReturn(null);\n\n boolean result = activationStrategy.isActive(state, user);\n\n assertFalse(result);\n }",
"class_method_signature": "UserRoleActivationStrat... | {
"fields": [
{
"declarator": "ID = \"user-role\"",
"modifier": "public static final",
"original_string": "public static final String ID = \"user-role\";",
"type": "String",
"var_name": "ID"
},
{
"declarator": "NAME = \"Users by role\"",
"modifier": "public static... | {
"body": "@Override\n public boolean isActive(FeatureState state, FeatureUser user) {\n\n if (user != null) {\n\n Collection<String> userRoles = \n (Collection<String>) user.getAttribute(USER_ATTRIBUTE_ROLES);\n\n if (userRoles != null) {\n\n String roles... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_19 | {
"fields": [
{
"declarator": "helper = new LocalServiceTestHelper(\n new LocalDatastoreServiceTestConfig())",
"modifier": "private final",
"original_string": "private final LocalServiceTestHelper helper = new LocalServiceTestHelper(\n new LocalDatastoreServiceTestConfig());",
... | {
"body": "@Test\n public void getFeatureStateShouldRunWithinGivenNamespace() {\n repository = new FixedNamespaceStateRepository(ACME_NAMESPACE, new StateRepository() {\n @Override\n public void setFeatureState(FeatureState featureState) {\n }\n\n @Override\n ... | {
"fields": [
{
"declarator": "namespace",
"modifier": "private final",
"original_string": "private final String namespace;",
"type": "String",
"var_name": "namespace"
},
{
"declarator": "decorated",
"modifier": "private final",
"original_string": "private f... | {
"body": "@Override\n public FeatureState getFeatureState(final Feature feature) {\n return withinNamespace(namespace, () -> decorated.getFeatureState(feature));\n }",
"class_method_signature": "FixedNamespaceStateRepository.getFeatureState(final Feature feature)",
"constructor": false,
"full_sign... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_58 | {
"fields": [
{
"declarator": "user",
"modifier": "private",
"original_string": "private FeatureUser user;",
"type": "FeatureUser",
"var_name": "user"
},
{
"declarator": "state",
"modifier": "private",
"original_string": "private FeatureState state;",
... | {
"body": "@Test\n public void shouldNotBeActiveWithNoPermittedParameters() {\n when(request.getParameterMap()).thenReturn(Collections.EMPTY_MAP);\n\n boolean isActive = strategy.isActive(state, user);\n\n assertFalse(isActive);\n }",
"class_method_signature": "QueryParameterActivationStr... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(QueryParameterActivationStrategy.class)",
"modifier": "private static final",
"original_string": "private static final Log log = LogFactory.getLog(QueryParameterActivationStrategy.class);",
"type": "Log",
"var_name": "log"
},... | {
"body": "@Override\n public boolean isActive(FeatureState featureState, FeatureUser user) {\n\n HttpServletRequest request = HttpServletRequestHolder.get();\n if (request == null) {\n return false;\n }\n\n String triggerParamsString = featureState.getParameter(PARAM_URL_PAR... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
3028163_78 | {
"fields": [
{
"declarator": "stateRepository = HazelcastStateRepository.newBuilder().mapName(\"togglzMap\").build()",
"modifier": "private final",
"original_string": "private final StateRepository stateRepository = HazelcastStateRepository.newBuilder().mapName(\"togglzMap\").build();",
"... | {
"body": "@Test\n\tvoid onlyHazelcastInstanceSetBuildsSuccessfully() {\n\t\tHazelcastStateRepository stateRepository = HazelcastStateRepository.newBuilder()\n\t\t\t\t.hazelcastInstance(Hazelcast.newHazelcastInstance())\n\t\t\t\t.build();\n\n\t\tassertNotNull(stateRepository);\n\t}",
"class_method_signature": "Haze... | {
"fields": [
{
"declarator": "hazelcastInstance",
"modifier": "protected final",
"original_string": "protected final HazelcastInstance hazelcastInstance;",
"type": "HazelcastInstance",
"var_name": "hazelcastInstance"
},
{
"declarator": "hazelcastConfig",
"modifie... | {
"body": "public static Builder newBuilder() {\n\t\treturn new Builder();\n\t}",
"class_method_signature": "HazelcastStateRepository.newBuilder()",
"constructor": false,
"full_signature": "public static Builder newBuilder()",
"identifier": "newBuilder",
"invocations": [],
"modifiers": "public static",
... | {
"created": "12/21/2011 4:49:03 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 3028163,
"size": null,
"stargazer_count": null,
"stars": 570,
"updates": "2020-01-24T21:03:21+00:00",
"url": "https://github.com/togglz/togglz"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.