id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
1164965_27 | {
"fields": [
{
"declarator": "link = new Link()",
"modifier": "static",
"original_string": "static Link link = new Link();",
"type": "Link",
"var_name": "link"
},
{
"declarator": "mapping = new UrlMapping()",
"modifier": "static",
"original_string": "static... | {
"body": "@Test\n public void testBuildMappedUrlPrettyUrlMappingSingleParameterContainingList()\n {\n List<UIParameter> parameters = new ArrayList<UIParameter>();\n UIParameter param = new UIParameter();\n param.setValue(values);\n parameters.add(param);\n\n String mappedUrl = builder.bu... | {
"fields": [],
"file": "core/src/main/java/com/ocpsoft/pretty/faces/util/PrettyURLBuilder.java",
"identifier": "PrettyURLBuilder",
"interfaces": "",
"methods": [
{
"class_method_signature": "PrettyURLBuilder.extractParameters(final UIComponent component)",
"constructor": false,
"full_si... | {
"body": "@Deprecated\n public String build(final UrlMapping mapping, final Map<String, String[]> parameters)\n {\n return build(mapping, false, parameters);\n }",
"class_method_signature": "PrettyURLBuilder.build(final UrlMapping mapping, final Map<String, String[]> parameters)",
"constructor": false... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_100 | {
"fields": [],
"file": "impl-jsf11/src/test/java/com/ocpsoft/pretty/config/PrettyConfiguratorTest.java",
"identifier": "PrettyConfiguratorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void configureSpecial() throws SAXException, IOException\n {\n final ServletContext servletContext = EasyMock.createNiceMock(ServletContext.class);\n\n EasyMock.expect(servletContext.getInitParameter(PrettyFilter.CONFIG_FILES_ATTR)).andReturn(\"car.xml, cdr.xml\")\n ... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(PrettyConfigurator.class)",
"modifier": "private static final",
"original_string": "private static final Log log = LogFactory.getLog(PrettyConfigurator.class);",
"type": "Log",
"var_name": "log"
},
{
"declarator": "... | {
"body": "public PrettyConfig configure() throws IOException, SAXException\n {\n final PrettyConfigBuilder builder = new PrettyConfigBuilder();\n // Load configurations from the class path\n feedClassLoaderConfigs(builder);\n // Load configurations from the config files configured in t... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_50 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/config/annotation/WebClassesFinderTest.java",
"identifier": "WebClassesFinderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testWebClassesFinder() throws Exception\n {\n\n // URLs of simulated directories and files\n URL classesUrl = new URL(\"file:/somewhere/WEB-INF/classes/\");\n URL packageUrl = new URL(\"file:/somewhere/WEB-INF/classes/package/\");\n URL classUrl = new URL(\"file:... | {
"fields": [
{
"declarator": "CLASSES_FOLDER = \"/WEB-INF/classes/\"",
"modifier": "private final static",
"original_string": "private final static String CLASSES_FOLDER = \"/WEB-INF/classes/\";",
"type": "String",
"var_name": "CLASSES_FOLDER"
},
{
"declarator": "proce... | {
"body": "public WebClassesFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter)\n {\n super(servletContext, classLoader, packageFilter);\n }",
"class_method_signature": "WebClassesFinder.WebClassesFinder(ServletContext servletContext, ClassLoader classLoader, Package... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_11 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/url/URLPatternParserTest.java",
"identifier": "URLPatternParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetMappedUrl()\n {\n URLPatternParser parser = new URLPatternParser(\n \"/project/#{paramsBean.project}/#{paramsBean.iteration}/#{paramsBean.story}\");\n String mappedUrl = parser.getMappedURL(\"p1\", 22, 55).toURL();\n assertEquals(\"/project/p1/22/... | {
"fields": [
{
"declarator": "EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX)",
"modifier": "private static final",
"original_string": "private static final Pattern EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX);",
"type": "Pattern",
"var_name": "EL_REGEX_PATTERN"... | {
"body": "public URL getMappedURL(final Object... params)\n {\n URL result = null;\n if (params != null)\n {\n Object[] parameters = params;\n\n /*\n * Check to see if our parameters were provided as a single List\n */\n if ((params.length == 1) && (params[0... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_46 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/config/annotation/PackageFilterTest.java",
"identifier": "PackageFilterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEmptyFilter()\n {\n assertTrue(new PackageFilter(null).isAllowedPackage(\"com.ocpsoft\"));\n assertTrue(new PackageFilter(\"\").isAllowedPackage(\"com.ocpsoft\"));\n assertTrue(new PackageFilter(\" \").isAllowedPackage(\"com.ocpsoft\"));\n assertTrue(new Pac... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(PackageFilter.class)",
"modifier": "private final static",
"original_string": "private final static Log log = LogFactory.getLog(PackageFilter.class);",
"type": "Log",
"var_name": "log"
},
{
"declarator": "packageSet... | {
"body": "public boolean isAllowedPackage(String packageName)\n {\n\n // No packages in set? Accept all packages.\n if (packageSet.isEmpty())\n {\n return true;\n }\n\n // check all valid packages\n for (String validPackage : packageSet)\n {\n // accept if package... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_85 | {
"fields": [
{
"declarator": "parser = new UrlPatternParser(\n \"/project/#{paramsBean.project}/#{paramsBean.project}/#{paramsBean.story}\")",
"modifier": "",
"original_string": "UrlPatternParser parser = new UrlPatternParser(\n \"/project/#{paramsBean.project}/#{paramsBea... | {
"body": "@Test\n public void testGetMappedUrl()\n {\n String mappedUrl = parser.getMappedUrl(\"p1\", 22, 55);\n assertEquals(\"/project/p1/22/55\", mappedUrl);\n }",
"class_method_signature": "UrlPatternParserTest.testGetMappedUrl()",
"constructor": false,
"full_signature": "@Test publi... | {
"fields": [
{
"declarator": "originalPattern",
"modifier": "private",
"original_string": "private String originalPattern;",
"type": "String",
"var_name": "originalPattern"
},
{
"declarator": "urlPattern",
"modifier": "private",
"original_string": "private ... | {
"body": "public String getMappedUrl(final Object... params)\n {\n StringBuffer result = new StringBuffer();\n if (params != null)\n {\n Matcher matcher = FacesElUtils.elPattern.matcher(originalPattern);\n Object[] parameters = params;\n\n if ((params.length == 1) && (params[... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_93 | {
"fields": [
{
"declarator": "config = new PrettyConfig()",
"modifier": "private static",
"original_string": "private static PrettyConfig config = new PrettyConfig();",
"type": "PrettyConfig",
"var_name": "config"
},
{
"declarator": "mapping = new PrettyUrlMapping()",
... | {
"body": "@Test\n public void testGetMappingByNullIdReturnsNull()\n {\n PrettyUrlMapping mapping2 = config.getMappingById(null);\n assertEquals(null, mapping2);\n }",
"class_method_signature": "PrettyConfigTest.testGetMappingByNullIdReturnsNull()",
"constructor": false,
"full_signature": "@Test... | {
"fields": [
{
"declarator": "CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\"",
"modifier": "public static final",
"original_string": "public static final String CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\";",
"type": "String",
"var_name": "CONFIG_REQUEST_KEY"
},
{
... | {
"body": "public PrettyUrlMapping getMappingById(String id)\n {\n if (id != null)\n {\n if (id.startsWith(PrettyContext.PRETTY_PREFIX))\n {\n id = id.substring(PrettyContext.PRETTY_PREFIX.length());\n }\n for (PrettyUrlMapping mapping : getMappings())\n ... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_107 | {
"fields": [
{
"declarator": "executor = new ActionExecutor()",
"modifier": "",
"original_string": "ActionExecutor executor = new ActionExecutor();",
"type": "ActionExecutor",
"var_name": "executor"
}
],
"file": "impl-jsf11/src/test/java/com/ocpsoft/pretty/beans/ActionExecut... | {
"body": "@Test\n public void testShouldExecuteOnPhasePostback()\n {\n UrlAction action = new UrlAction(\"action\", PhaseId.RESTORE_VIEW);\n action.setOnPostback(true);\n assertTrue(executor.shouldExecute(action, PhaseId.RESTORE_VIEW, true));\n }",
"class_method_signature": "ActionExe... | {
"fields": [
{
"declarator": "elUtils = new FacesElUtils()",
"modifier": "private static final",
"original_string": "private static final FacesElUtils elUtils = new FacesElUtils();",
"type": "FacesElUtils",
"var_name": "elUtils"
},
{
"declarator": "facesStateUtils = ne... | {
"body": "boolean shouldExecute(final UrlAction action, final PhaseId currentPhaseId, final boolean isPostback)\n\t{\n\t\tboolean result = false;\n\t\tif (currentPhaseId.equals(action.getPhaseId()) || PhaseId.ANY_PHASE.equals(action.getPhaseId()))\n\t\t{\n\t\t\tif (action.onPostback())\n\t\t\t{\n\t\t\t\tresult = tru... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_20 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/url/URLTest.java",
"identifier": "URLTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testDecode() throws Exception\n {\n String value = \"/\\u010d\";\n URL url = new URL(value);\n URL encoded = url.encode();\n assertEquals(\"/%C4%8D\", encoded.toURL());\n }",
"class_method_signature": "URLTest.testDecode()",
"constructor": false,
"full_si... | {
"fields": [
{
"declarator": "metadata = new Metadata()",
"modifier": "private",
"original_string": "private Metadata metadata = new Metadata();",
"type": "Metadata",
"var_name": "metadata"
},
{
"declarator": "originalURL = \"\"",
"modifier": "private",
"or... | {
"body": "public URL decode()\n {\n return new URL(getDecodedSegments(), metadata);\n }",
"class_method_signature": "URL.decode()",
"constructor": false,
"full_signature": "public URL decode()",
"identifier": "decode",
"invocations": [
"getDecodedSegments"
],
"modifiers": "public",
"para... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_0 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/url/URLPatternParserTest.java",
"identifier": "URLPatternParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetNamedParameterList()\n {\n URLPatternParser namedParamParser = new URLPatternParser(\"/foo/#{named}/\");\n List<PathParameter> params = namedParamParser.parse(new URL(\"/foo/love/\"));\n assertEquals(1, params.size());\n\n PathParameter p = params.get(0);\... | {
"fields": [
{
"declarator": "EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX)",
"modifier": "private static final",
"original_string": "private static final Pattern EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX);",
"type": "Pattern",
"var_name": "EL_REGEX_PATTERN"... | {
"body": "public List<PathParameter> parse(final URL url)\n {\n List<PathParameter> result = new ArrayList<PathParameter>();\n\n String inboundUrl = url.toURL();\n if (this.matches(url))\n {\n Iterator<Segment> iter = pathSegments.iterator();\n while (iter.hasNext())\n {... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_98 | {
"fields": [
{
"declarator": "CONFIG_PATH = \"mock-pretty-config.xml\"",
"modifier": "private static final",
"original_string": "private static final String CONFIG_PATH = \"mock-pretty-config.xml\";",
"type": "String",
"var_name": "CONFIG_PATH"
},
{
"declarator": "conf... | {
"body": "@Test\n public void testParse()\n {\n PrettyUrlMapping mapping = config.getMappingById(\"0\");\n\n assertEquals(\"0\", mapping.getId());\n assertEquals(\"/project/#{viewProjectBean.projectId}/\", mapping.getPattern());\n assertEquals(\"#{viewProjectBean.getPrettyTarget}\", mapping.g... | {
"fields": [],
"file": "impl-jsf11/src/main/java/com/ocpsoft/pretty/config/DigesterPrettyConfigParser.java",
"identifier": "DigesterPrettyConfigParser",
"interfaces": "implements PrettyConfigParser",
"methods": [
{
"class_method_signature": "DigesterPrettyConfigParser.parse(final PrettyConfigBuilde... | {
"body": "public void parse(final PrettyConfigBuilder builder, final InputStream resource) throws IOException, SAXException\n {\n if (builder == null)\n {\n throw new IllegalArgumentException(\"Builder must not be null.\");\n }\n if (resource == null)\n {\n throw new Illega... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_77 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/el/resolver/SeamBeanNameResolverTest.java",
"identifier": "SeamBeanNameResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNoSeamEnvironment() throws Exception\n {\n\n // Simple mock of ServletContext doing nothing\n ServletContext servletContext = EasyMock.createNiceMock(ServletContext.class);\n\n // ClassLoader that always throws ClassNotFoundExceptions\n ClassLoader classLoade... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(SeamBeanNameResolver.class)",
"modifier": "private final static",
"original_string": "private final static Log log = LogFactory.getLog(SeamBeanNameResolver.class);",
"type": "Log",
"var_name": "log"
},
{
"declarator... | {
"body": "public boolean init(ServletContext servletContext, ClassLoader classLoader)\n {\n\n try\n {\n // get Seam class\n Class<?> seamClass = classLoader.loadClass(SEAM_CLASS);\n\n // get getComponentName method\n getComponentNameMethod = seamClass.getMethod(GET_COMPONE... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_61 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/config/mapping/UrlActionTest.java",
"identifier": "UrlActionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testUrlActionStringSetsActionMethod()\n {\n String action = \"#{this.is.my.action}\";\n UrlAction urlAction = new UrlAction(action);\n assertEquals(action, urlAction.getAction().getELExpression());\n }",
"class_method_signature": "UrlActionTest.testUrlActionString... | {
"fields": [
{
"declarator": "action",
"modifier": "private",
"original_string": "private PrettyExpression action;",
"type": "PrettyExpression",
"var_name": "action"
},
{
"declarator": "phaseId = PhaseId.RESTORE_VIEW",
"modifier": "private",
"original_strin... | {
"body": "public PrettyExpression getAction()\n {\n return action;\n }",
"class_method_signature": "UrlAction.getAction()",
"constructor": false,
"full_signature": "public PrettyExpression getAction()",
"identifier": "getAction",
"invocations": [],
"modifiers": "public",
"parameters": "()",
... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_36 | {
"fields": [
{
"declarator": "decoder = new HTTPDecoder()",
"modifier": "",
"original_string": "HTTPDecoder decoder = new HTTPDecoder();",
"type": "HTTPDecoder",
"var_name": "decoder"
}
],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/util/HTTPDecoderTest.java",
"id... | {
"body": "@Test\n public void testDecodeNullProducesNull()\n {\n String value = null;\n assertEquals(null, decoder.decode(value));\n }",
"class_method_signature": "HTTPDecoderTest.testDecodeNullProducesNull()",
"constructor": false,
"full_signature": "@Test public void testDecodeNullProd... | {
"fields": [],
"file": "core/src/main/java/com/ocpsoft/pretty/faces/util/HTTPDecoder.java",
"identifier": "HTTPDecoder",
"interfaces": "",
"methods": [
{
"class_method_signature": "HTTPDecoder.decode(final String value)",
"constructor": false,
"full_signature": "public String decode(fin... | {
"body": "public String decode(final String value)\n {\n String result = value;\n if (value != null)\n {\n try\n {\n result = URLDecoder.decode(value, \"UTF-8\");\n }\n catch (Exception e)\n {\n throw new Pre... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_94 | {
"fields": [
{
"declarator": "config = new PrettyConfig()",
"modifier": "private static",
"original_string": "private static PrettyConfig config = new PrettyConfig();",
"type": "PrettyConfig",
"var_name": "config"
},
{
"declarator": "mapping = new PrettyUrlMapping()",
... | {
"body": "@Test\n public void testGetMappingForUrl()\n {\n PrettyUrlMapping mapping2 = config.getMappingForUrl(\"/home/en/test/\");\n assertEquals(mapping, mapping2);\n }",
"class_method_signature": "PrettyConfigTest.testGetMappingForUrl()",
"constructor": false,
"full_signature": "@Test public... | {
"fields": [
{
"declarator": "CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\"",
"modifier": "public static final",
"original_string": "public static final String CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\";",
"type": "String",
"var_name": "CONFIG_REQUEST_KEY"
},
{
... | {
"body": "public PrettyUrlMapping getMappingForUrl(final String url)\n {\n for (PrettyUrlMapping mapping : getMappings())\n {\n String urlPattern = mapping.getPattern();\n UrlPatternParser um = new UrlPatternParser(urlPattern);\n if (um.matches(url))\n {\n retur... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_82 | {
"fields": [
{
"declarator": "parser = new UrlPatternParser(\n \"/project/#{paramsBean.project}/#{paramsBean.project}/#{paramsBean.story}\")",
"modifier": "",
"original_string": "UrlPatternParser parser = new UrlPatternParser(\n \"/project/#{paramsBean.project}/#{paramsBea... | {
"body": "@Test\n public void testUrlPatternParser()\n {\n assertTrue(parser instanceof UrlPatternParser);\n }",
"class_method_signature": "UrlPatternParserTest.testUrlPatternParser()",
"constructor": false,
"full_signature": "@Test public void testUrlPatternParser()",
"identifier": "testUrlP... | {
"fields": [
{
"declarator": "originalPattern",
"modifier": "private",
"original_string": "private String originalPattern;",
"type": "String",
"var_name": "originalPattern"
},
{
"declarator": "urlPattern",
"modifier": "private",
"original_string": "private ... | {
"body": "public UrlPatternParser(final String pattern)\n {\n setUrlPattern(pattern);\n }",
"class_method_signature": "UrlPatternParser.UrlPatternParser(final String pattern)",
"constructor": true,
"full_signature": "public UrlPatternParser(final String pattern)",
"identifier": "UrlPatternParser",
... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_41 | {
"fields": [
{
"declarator": "filter",
"modifier": "private",
"original_string": "private ByteCodeAnnotationFilter filter;",
"type": "ByteCodeAnnotationFilter",
"var_name": "filter"
}
],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/config/annotation/ByteCodeAnnotatio... | {
"body": "@Test\n public void testJdk14Class() throws IOException\n {\n assertFalse( filter.accept( new ByteArrayInputStream( new byte[] {\n (byte) 0xca, (byte) 0xfe, (byte) 0xba, (byte) 0xbe, // magic\n (byte) 0x00, (byte) 0x00, // minor \n (byte) 0x00, (byte) 48 ... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(ByteCodeAnnotationFilter.class)",
"modifier": "private final static",
"original_string": "private final static Log log = LogFactory.getLog(ByteCodeAnnotationFilter.class);",
"type": "Log",
"var_name": "log"
},
{
"de... | {
"body": "@SuppressWarnings(\"unused\")\n public boolean accept(InputStream classFileStream) throws IOException\n {\n\n // open a DataInputStream\n DataInputStream in = new DataInputStream(classFileStream);\n\n // read magic and abort if it doesn't match\n int magic = in.readInt();\n if ... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_16 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/url/URLPatternParserTest.java",
"identifier": "URLPatternParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetMappedUrlWithListWithoutParams()\n {\n URLPatternParser noParamsParser = new URLPatternParser(\"/no/param\");\n List<?> params = new ArrayList<Object>();\n String mappedUrl = noParamsParser.getMappedURL(params).toURL();\n assertEquals(\"Empty list failed\"... | {
"fields": [
{
"declarator": "EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX)",
"modifier": "private static final",
"original_string": "private static final Pattern EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX);",
"type": "Pattern",
"var_name": "EL_REGEX_PATTERN"... | {
"body": "public URL getMappedURL(final Object... params)\n {\n URL result = null;\n if (params != null)\n {\n Object[] parameters = params;\n\n /*\n * Check to see if our parameters were provided as a single List\n */\n if ((params.length == 1) && (params[0... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_57 | {
"fields": [
{
"declarator": "config = new PrettyConfig()",
"modifier": "private static",
"original_string": "private static PrettyConfig config = new PrettyConfig();",
"type": "PrettyConfig",
"var_name": "config"
},
{
"declarator": "mapping = new UrlMapping()",
... | {
"body": "@Test\n public void testIsURLMapped() throws Exception\n {\n assertTrue(config.isURLMapped(new URL(\"/home/en/test/\")));\n assertFalse(config.isViewMapped(\"/home/en/notmapped/okthen\"));\n }",
"class_method_signature": "PrettyConfigTest.testIsURLMapped()",
"constructor": false,
"ful... | {
"fields": [
{
"declarator": "CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\"",
"modifier": "public static final",
"original_string": "public static final String CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\";",
"type": "String",
"var_name": "CONFIG_REQUEST_KEY"
},
{
... | {
"body": "public boolean isURLMapped(final URL url)\n {\n UrlMapping mapping = getMappingForUrl(url);\n return mapping != null;\n }",
"class_method_signature": "PrettyConfig.isURLMapped(final URL url)",
"constructor": false,
"full_signature": "public boolean isURLMapped(final URL url)",
"identi... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_56 | {
"fields": [
{
"declarator": "config = new PrettyConfig()",
"modifier": "private static",
"original_string": "private static PrettyConfig config = new PrettyConfig();",
"type": "PrettyConfig",
"var_name": "config"
},
{
"declarator": "mapping = new UrlMapping()",
... | {
"body": "@Test\n public void isNullViewMappedReturnsFalse() throws Exception\n {\n assertFalse(config.isViewMapped(null));\n }",
"class_method_signature": "PrettyConfigTest.isNullViewMappedReturnsFalse()",
"constructor": false,
"full_signature": "@Test public void isNullViewMappedReturnsFalse()",
... | {
"fields": [
{
"declarator": "CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\"",
"modifier": "public static final",
"original_string": "public static final String CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\";",
"type": "String",
"var_name": "CONFIG_REQUEST_KEY"
},
{
... | {
"body": "public boolean isViewMapped(String viewId)\n {\n if (viewId != null)\n {\n viewId = viewId.trim();\n for (UrlMapping mapping : mappings)\n {\n if (viewId.equals(mapping.getViewId())\n || (viewId.startsWith(\"/\") && viewId.substring(1).equa... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_17 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/url/URLPatternParserTest.java",
"identifier": "URLPatternParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetMappedUrlNullListWithoutParams()\n {\n URLPatternParser noParamsParser = new URLPatternParser(\"/no/param\");\n List<?> params = null;\n String mappedUrl = noParamsParser.getMappedURL(params).toURL();\n assertEquals(\"Null param failed\", \"/no/param\", ma... | {
"fields": [
{
"declarator": "EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX)",
"modifier": "private static final",
"original_string": "private static final Pattern EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX);",
"type": "Pattern",
"var_name": "EL_REGEX_PATTERN"... | {
"body": "public URL getMappedURL(final Object... params)\n {\n URL result = null;\n if (params != null)\n {\n Object[] parameters = params;\n\n /*\n * Check to see if our parameters were provided as a single List\n */\n if ((params.length == 1) && (params[0... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_40 | {
"fields": [
{
"declarator": "filter",
"modifier": "private",
"original_string": "private ByteCodeAnnotationFilter filter;",
"type": "ByteCodeAnnotationFilter",
"var_name": "filter"
}
],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/config/annotation/ByteCodeAnnotatio... | {
"body": "@Test\n public void testInvalidClass() throws IOException\n {\n assertFalse( filter.accept( new ByteArrayInputStream( new byte[] {\n // some random bytes\n (byte) 0x12, (byte) 0x34, (byte) 0xd3, (byte) 0x45,\n (byte) 0x13, (byte) 0x35, (byte) 0xd4, (byte) 0x46,\n ... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(ByteCodeAnnotationFilter.class)",
"modifier": "private final static",
"original_string": "private final static Log log = LogFactory.getLog(ByteCodeAnnotationFilter.class);",
"type": "Log",
"var_name": "log"
},
{
"de... | {
"body": "@SuppressWarnings(\"unused\")\n public boolean accept(InputStream classFileStream) throws IOException\n {\n\n // open a DataInputStream\n DataInputStream in = new DataInputStream(classFileStream);\n\n // read magic and abort if it doesn't match\n int magic = in.readInt();\n if ... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_83 | {
"fields": [
{
"declarator": "parser = new UrlPatternParser(\n \"/project/#{paramsBean.project}/#{paramsBean.project}/#{paramsBean.story}\")",
"modifier": "",
"original_string": "UrlPatternParser parser = new UrlPatternParser(\n \"/project/#{paramsBean.project}/#{paramsBea... | {
"body": "@Test\n public void testMatches()\n {\n assertTrue(parser.matches(\"/project/starfish1/starfish2/story1\"));\n assertFalse(parser.matches(\"project/starfish1/starfish2/story1\"));\n assertFalse(parser.matches(\"/project/starfish1/starfish2/story1/\"));\n assertFalse(parser... | {
"fields": [
{
"declarator": "originalPattern",
"modifier": "private",
"original_string": "private String originalPattern;",
"type": "String",
"var_name": "originalPattern"
},
{
"declarator": "urlPattern",
"modifier": "private",
"original_string": "private ... | {
"body": "public boolean matches(final String url)\n {\n return Pattern.compile(urlPattern).matcher(url).matches();\n }",
"class_method_signature": "UrlPatternParser.matches(final String url)",
"constructor": false,
"full_signature": "public boolean matches(final String url)",
"identifier": "matches... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_95 | {
"fields": [
{
"declarator": "config = new PrettyConfig()",
"modifier": "private static",
"original_string": "private static PrettyConfig config = new PrettyConfig();",
"type": "PrettyConfig",
"var_name": "config"
},
{
"declarator": "mapping = new PrettyUrlMapping()",
... | {
"body": "@Test\n public void isViewMapped() throws Exception\n {\n assertTrue(config.isViewMapped(\"/faces/view.jsf\"));\n assertFalse(config.isViewMapped(\"/faces/view2.jsf\"));\n }",
"class_method_signature": "PrettyConfigTest.isViewMapped()",
"constructor": false,
"full_signature": "@Test p... | {
"fields": [
{
"declarator": "CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\"",
"modifier": "public static final",
"original_string": "public static final String CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\";",
"type": "String",
"var_name": "CONFIG_REQUEST_KEY"
},
{
... | {
"body": "public boolean isViewMapped(String viewId)\n {\n if (viewId != null)\n {\n viewId = viewId.trim();\n PrettyUrlMapping needle = new PrettyUrlMapping();\n needle.setViewId(viewId);\n if (viewId.startsWith(\"/\"))\n {\n if (getMappings().contains(... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_37 | {
"fields": [
{
"declarator": "c = new URLDuplicatePathCanonicalizer()",
"modifier": "",
"original_string": "URLDuplicatePathCanonicalizer c = new URLDuplicatePathCanonicalizer();",
"type": "URLDuplicatePathCanonicalizer",
"var_name": "c"
}
],
"file": "core/src/test/java/com/... | {
"body": "@Test\n public void testRemovesDuplicatePaths() throws Exception\n {\n String url = \"http://ocpsoft.com/prettyfaces/../prettyfaces/\";\n\n String expected = \"http://ocpsoft.com/prettyfaces/\";\n\n assertEquals(expected, c.canonicalize(url));\n }",
"class_method_signature":... | {
"fields": [
{
"declarator": "pattern = Pattern.compile(\"(/[^/]+/)\\\\.\\\\.(/[^/]+/)\")",
"modifier": "private final",
"original_string": "private final Pattern pattern = Pattern.compile(\"(/[^/]+/)\\\\.\\\\.(/[^/]+/)\");",
"type": "Pattern",
"var_name": "pattern"
}
],
"fi... | {
"body": "public String canonicalize(final String url)\n {\n if (url != null && url.contains(\"/../\"))\n {\n StringBuffer result = new StringBuffer();\n Matcher m = pattern.matcher(url);\n while (m.find())\n {\n if (m.group(1).equals(m.grou... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_110 | {
"fields": [
{
"declarator": "executor = new ActionExecutor()",
"modifier": "",
"original_string": "ActionExecutor executor = new ActionExecutor();",
"type": "ActionExecutor",
"var_name": "executor"
}
],
"file": "impl-jsf11/src/test/java/com/ocpsoft/pretty/beans/ActionExecut... | {
"body": "@Test\n public void testShouldExecuteOnPostbackFalseWhenNotPostback()\n {\n UrlAction action = new UrlAction(\"action\", PhaseId.ANY_PHASE);\n action.setOnPostback(false);\n assertTrue(executor.shouldExecute(action, PhaseId.RESTORE_VIEW, false));\n }",
"class_method_signatur... | {
"fields": [
{
"declarator": "elUtils = new FacesElUtils()",
"modifier": "private static final",
"original_string": "private static final FacesElUtils elUtils = new FacesElUtils();",
"type": "FacesElUtils",
"var_name": "elUtils"
},
{
"declarator": "facesStateUtils = ne... | {
"body": "boolean shouldExecute(final UrlAction action, final PhaseId currentPhaseId, final boolean isPostback)\n\t{\n\t\tboolean result = false;\n\t\tif (currentPhaseId.equals(action.getPhaseId()) || PhaseId.ANY_PHASE.equals(action.getPhaseId()))\n\t\t{\n\t\t\tif (action.onPostback())\n\t\t\t{\n\t\t\t\tresult = tru... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_60 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/config/mapping/PathParameterTest.java",
"identifier": "PathParameterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsNamedTrueWhenNameSet()\n {\n PathParameter parameter = new PathParameter();\n parameter.setName(\"name\");\n assertTrue(parameter.isNamed());\n }",
"class_method_signature": "PathParameterTest.testIsNamedTrueWhenNameSet()",
"constructor": false,
... | {
"fields": [
{
"declarator": "PATH_PARAM_NAME_PREFIX = \"com.ocpsoft.vP_\"",
"modifier": "private static final",
"original_string": "private static final String PATH_PARAM_NAME_PREFIX = \"com.ocpsoft.vP_\";",
"type": "String",
"var_name": "PATH_PARAM_NAME_PREFIX"
},
{
... | {
"body": "public boolean isNamed()\n {\n return (null != super.getName()) && !\"\".equals(super.getName().trim());\n }",
"class_method_signature": "PathParameter.isNamed()",
"constructor": false,
"full_signature": "public boolean isNamed()",
"identifier": "isNamed",
"invocations": [
"getName",... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_1 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/url/URLPatternParserTest.java",
"identifier": "URLPatternParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetInjectedParameterList()\n {\n URLPatternParser namedParamParser = new URLPatternParser(\"/foo/#{:injected}/\");\n List<PathParameter> params = namedParamParser.parse(new URL(\"/foo/love/\"));\n assertEquals(1, params.size());\n\n PathParameter p = params.g... | {
"fields": [
{
"declarator": "EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX)",
"modifier": "private static final",
"original_string": "private static final Pattern EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX);",
"type": "Pattern",
"var_name": "EL_REGEX_PATTERN"... | {
"body": "public List<PathParameter> parse(final URL url)\n {\n List<PathParameter> result = new ArrayList<PathParameter>();\n\n String inboundUrl = url.toURL();\n if (this.matches(url))\n {\n Iterator<Segment> iter = pathSegments.iterator();\n while (iter.hasNext())\n {... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_99 | {
"fields": [],
"file": "impl-jsf11/src/test/java/com/ocpsoft/pretty/config/PrettyConfiguratorTest.java",
"identifier": "PrettyConfiguratorTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void configureDefault() throws SAXException, IOException\n {\n final ServletContext servletContext = EasyMock.createNiceMock(ServletContext.class);\n\n EasyMock.expect(servletContext.getInitParameter(PrettyFilter.CONFIG_FILES_ATTR)).andReturn(null).anyTimes();\n Ea... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(PrettyConfigurator.class)",
"modifier": "private static final",
"original_string": "private static final Log log = LogFactory.getLog(PrettyConfigurator.class);",
"type": "Log",
"var_name": "log"
},
{
"declarator": "... | {
"body": "public PrettyConfig configure() throws IOException, SAXException\n {\n final PrettyConfigBuilder builder = new PrettyConfigBuilder();\n // Load configurations from the class path\n feedClassLoaderConfigs(builder);\n // Load configurations from the config files configured in t... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_76 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/el/resolver/SpringBeanNameResolverTest.java",
"identifier": "SpringBeanNameResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNoSpringEnvironment() throws Exception\n {\n\n // Simple mock of ServletContext doing nothing\n ServletContext servletContext = EasyMock.createNiceMock(ServletContext.class);\n\n // ClassLoader that always throws ClassNotFoundExceptions\n ClassLoader classLoa... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(SpringBeanNameResolver.class)",
"modifier": "private final static",
"original_string": "private final static Log log = LogFactory.getLog(SpringBeanNameResolver.class);",
"type": "Log",
"var_name": "log"
},
{
"declar... | {
"body": "public boolean init(ServletContext servletContext, ClassLoader classLoader)\n {\n\n // try to get WebApplicationContext from ServletContext\n webAppContext = servletContext.getAttribute(\"org.springframework.web.context.WebApplicationContext.ROOT\");\n\n // Not found? Disable resolver!\n ... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_106 | {
"fields": [
{
"declarator": "executor = new ActionExecutor()",
"modifier": "",
"original_string": "ActionExecutor executor = new ActionExecutor();",
"type": "ActionExecutor",
"var_name": "executor"
}
],
"file": "impl-jsf11/src/test/java/com/ocpsoft/pretty/beans/ActionExecut... | {
"body": "@Test\n public void testShouldNotExecuteOnWrongPhaseNonPostback()\n {\n UrlAction action = new UrlAction(\"action\", PhaseId.RESTORE_VIEW);\n action.setOnPostback(true);\n assertFalse(executor.shouldExecute(action, PhaseId.APPLY_REQUEST_VALUES, false));\n }",
"class_method_s... | {
"fields": [
{
"declarator": "elUtils = new FacesElUtils()",
"modifier": "private static final",
"original_string": "private static final FacesElUtils elUtils = new FacesElUtils();",
"type": "FacesElUtils",
"var_name": "elUtils"
},
{
"declarator": "facesStateUtils = ne... | {
"body": "boolean shouldExecute(final UrlAction action, final PhaseId currentPhaseId, final boolean isPostback)\n\t{\n\t\tboolean result = false;\n\t\tif (currentPhaseId.equals(action.getPhaseId()) || PhaseId.ANY_PHASE.equals(action.getPhaseId()))\n\t\t{\n\t\t\tif (action.onPostback())\n\t\t\t{\n\t\t\t\tresult = tru... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_21 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/url/URLTest.java",
"identifier": "URLTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testEncode() throws Exception\n {\n String value = \"/\\u010d\";\n URL url = new URL(value);\n URL encoded = url.encode();\n assertEquals(\"/%C4%8D\", encoded.toURL());\n URL original = encoded.decode();\n assertEquals(\"/\\u010d\", original.toURL());\n... | {
"fields": [
{
"declarator": "metadata = new Metadata()",
"modifier": "private",
"original_string": "private Metadata metadata = new Metadata();",
"type": "Metadata",
"var_name": "metadata"
},
{
"declarator": "originalURL = \"\"",
"modifier": "private",
"or... | {
"body": "public URL encode()\n {\n return new URL(getEncodedSegments(), metadata);\n }",
"class_method_signature": "URL.encode()",
"constructor": false,
"full_signature": "public URL encode()",
"identifier": "encode",
"invocations": [
"getEncodedSegments"
],
"modifiers": "public",
"para... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_59 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/config/mapping/PathParameterTest.java",
"identifier": "PathParameterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsNamedFalseWhenNameEmpty()\n {\n PathParameter parameter = new PathParameter();\n parameter.setName(\"\");\n assertFalse(parameter.isNamed());\n }",
"class_method_signature": "PathParameterTest.testIsNamedFalseWhenNameEmpty()",
"constructor": false... | {
"fields": [
{
"declarator": "PATH_PARAM_NAME_PREFIX = \"com.ocpsoft.vP_\"",
"modifier": "private static final",
"original_string": "private static final String PATH_PARAM_NAME_PREFIX = \"com.ocpsoft.vP_\";",
"type": "String",
"var_name": "PATH_PARAM_NAME_PREFIX"
},
{
... | {
"body": "public boolean isNamed()\n {\n return (null != super.getName()) && !\"\".equals(super.getName().trim());\n }",
"class_method_signature": "PathParameter.isNamed()",
"constructor": false,
"full_signature": "public boolean isNamed()",
"identifier": "isNamed",
"invocations": [
"getName",... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_18 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/url/URLPatternParserTest.java",
"identifier": "URLPatternParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetMappedUrlWithRegexes()\n {\n URLPatternParser regexParser = new URLPatternParser(\"/(foo|bar|baz|cat|dog).jsf\");\n List<PathParameter> params = regexParser.parse(new URL(\"/foo.jsf\"));\n }",
"class_method_signature": "URLPatternParserTest.testGetMappedUrlWithR... | {
"fields": [
{
"declarator": "EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX)",
"modifier": "private static final",
"original_string": "private static final Pattern EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX);",
"type": "Pattern",
"var_name": "EL_REGEX_PATTERN"... | {
"body": "public List<PathParameter> parse(final URL url)\n {\n List<PathParameter> result = new ArrayList<PathParameter>();\n\n String inboundUrl = url.toURL();\n if (this.matches(url))\n {\n Iterator<Segment> iter = pathSegments.iterator();\n while (iter.hasNext())\n {... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_34 | {
"fields": [
{
"declarator": "decoder = new HTTPDecoder()",
"modifier": "",
"original_string": "HTTPDecoder decoder = new HTTPDecoder();",
"type": "HTTPDecoder",
"var_name": "decoder"
}
],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/util/HTTPDecoderTest.java",
"id... | {
"body": "@Test\n public void testDecodeValidInputReturnsDecodedInput()\n {\n String value = \"foo+bar\";\n assertEquals(\"foo bar\", decoder.decode(value));\n }",
"class_method_signature": "HTTPDecoderTest.testDecodeValidInputReturnsDecodedInput()",
"constructor": false,
"full_signature... | {
"fields": [],
"file": "core/src/main/java/com/ocpsoft/pretty/faces/util/HTTPDecoder.java",
"identifier": "HTTPDecoder",
"interfaces": "",
"methods": [
{
"class_method_signature": "HTTPDecoder.decode(final String value)",
"constructor": false,
"full_signature": "public String decode(fin... | {
"body": "public String decode(final String value)\n {\n String result = value;\n if (value != null)\n {\n try\n {\n result = URLDecoder.decode(value, \"UTF-8\");\n }\n catch (Exception e)\n {\n throw new Pre... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_63 | {
"fields": [
{
"declarator": "executor = new ActionExecutor()",
"modifier": "",
"original_string": "ActionExecutor executor = new ActionExecutor();",
"type": "ActionExecutor",
"var_name": "executor"
}
],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/beans/ActionExecut... | {
"body": "@Test\n public void testShouldExecuteOnNonPostback()\n {\n UrlAction action = new UrlAction(\"action\", PhaseId.ANY_PHASE);\n action.setOnPostback(true);\n assertTrue(executor.shouldExecute(action, javax.faces.event.PhaseId.RESTORE_VIEW, false));\n }",
"class_method_signature": "Acti... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(ActionExecutor.class)",
"modifier": "private static final",
"original_string": "private static final Log log = LogFactory.getLog(ActionExecutor.class);",
"type": "Log",
"var_name": "log"
},
{
"declarator": "elUtils ... | {
"body": "boolean shouldExecute(final UrlAction action, final PhaseId currentPhaseId, final boolean isPostback)\n {\n boolean result = false;\n if (PhaseIdComparator.equals(action.getPhaseId(), currentPhaseId)\n || PhaseIdComparator.equals(action.getPhaseId(), PhaseId.ANY_PHASE))\n {\n... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_75 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/el/resolver/CDIBeanNameResolverTest.java",
"identifier": "CDIBeanNameResolverTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNoCDIEnvironment() throws Exception\n {\n\n // Simple mock of ServletContext doing nothing\n ServletContext servletContext = EasyMock.createNiceMock(ServletContext.class);\n\n // ClassLoader that always throws ClassNotFoundExceptions\n ClassLoader classLoader... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(CDIBeanNameResolver.class)",
"modifier": "private final static",
"original_string": "private final static Log log = LogFactory.getLog(CDIBeanNameResolver.class);",
"type": "Log",
"var_name": "log"
},
{
"declarator":... | {
"body": "public boolean init(ServletContext servletContext, ClassLoader classLoader)\n {\n\n // catch reflection exceptions\n try\n {\n\n // get BeanManager class and getBeans() method\n Class<?> beanManagerClass = classLoader.loadClass(BEAN_MANAGER_CLASS);\n getBeansMethod ... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_2 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/url/URLPatternParserTest.java",
"identifier": "URLPatternParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetNamedValuedParameterList()\n {\n URLPatternParser namedValuedParamParser = new URLPatternParser(\"/foo/#{named:bean.value}/\");\n List<PathParameter> params = namedValuedParamParser.parse(new URL(\"/foo/love/\"));\n assertEquals(1, params.size());\n\n Path... | {
"fields": [
{
"declarator": "EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX)",
"modifier": "private static final",
"original_string": "private static final Pattern EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX);",
"type": "Pattern",
"var_name": "EL_REGEX_PATTERN"... | {
"body": "public List<PathParameter> parse(final URL url)\n {\n List<PathParameter> result = new ArrayList<PathParameter>();\n\n String inboundUrl = url.toURL();\n if (this.matches(url))\n {\n Iterator<Segment> iter = pathSegments.iterator();\n while (iter.hasNext())\n {... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_22 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/util/StringUtilsTest.java",
"identifier": "StringUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testHasLeadingSlash()\n {\n assertTrue(StringUtils.hasLeadingSlash(\"/\"));\n assertTrue(StringUtils.hasLeadingSlash(\"/test\"));\n assertTrue(StringUtils.hasLeadingSlash(\"//\"));\n assertTrue(StringUtils.hasLeadingSlash(\"//test\"));\n assertTrue(StringUti... | {
"fields": [
{
"declarator": "SLASH = '/'",
"modifier": "private static final",
"original_string": "private static final char SLASH = '/';",
"type": "char",
"var_name": "SLASH"
}
],
"file": "core/src/main/java/com/ocpsoft/pretty/faces/util/StringUtils.java",
"identifier": ... | {
"body": "public static boolean hasLeadingSlash(final String s)\n {\n return s != null && isNotBlank(s) && SLASH == s.charAt(0);\n }",
"class_method_signature": "StringUtils.hasLeadingSlash(final String s)",
"constructor": false,
"full_signature": "public static boolean hasLeadingSlash(final String s)... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_105 | {
"fields": [
{
"declarator": "executor = new ActionExecutor()",
"modifier": "",
"original_string": "ActionExecutor executor = new ActionExecutor();",
"type": "ActionExecutor",
"var_name": "executor"
}
],
"file": "impl-jsf11/src/test/java/com/ocpsoft/pretty/beans/ActionExecut... | {
"body": "@Test\n public void testShouldExecuteOnPhaseNonPostback()\n {\n UrlAction action = new UrlAction(\"action\", PhaseId.RESTORE_VIEW);\n action.setOnPostback(true);\n assertTrue(executor.shouldExecute(action, PhaseId.RESTORE_VIEW, false));\n }",
"class_method_signature": "Actio... | {
"fields": [
{
"declarator": "elUtils = new FacesElUtils()",
"modifier": "private static final",
"original_string": "private static final FacesElUtils elUtils = new FacesElUtils();",
"type": "FacesElUtils",
"var_name": "elUtils"
},
{
"declarator": "facesStateUtils = ne... | {
"body": "boolean shouldExecute(final UrlAction action, final PhaseId currentPhaseId, final boolean isPostback)\n\t{\n\t\tboolean result = false;\n\t\tif (currentPhaseId.equals(action.getPhaseId()) || PhaseId.ANY_PHASE.equals(action.getPhaseId()))\n\t\t{\n\t\t\tif (action.onPostback())\n\t\t\t{\n\t\t\t\tresult = tru... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_55 | {
"fields": [
{
"declarator": "config = new PrettyConfig()",
"modifier": "private static",
"original_string": "private static PrettyConfig config = new PrettyConfig();",
"type": "PrettyConfig",
"var_name": "config"
},
{
"declarator": "mapping = new UrlMapping()",
... | {
"body": "@Test\n public void isViewMapped() throws Exception\n {\n assertTrue(config.isViewMapped(\"/faces/view.jsf\"));\n assertFalse(config.isViewMapped(\"/faces/view2.jsf\"));\n }",
"class_method_signature": "PrettyConfigTest.isViewMapped()",
"constructor": false,
"full_signature": "@Test p... | {
"fields": [
{
"declarator": "CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\"",
"modifier": "public static final",
"original_string": "public static final String CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\";",
"type": "String",
"var_name": "CONFIG_REQUEST_KEY"
},
{
... | {
"body": "public boolean isViewMapped(String viewId)\n {\n if (viewId != null)\n {\n viewId = viewId.trim();\n for (UrlMapping mapping : mappings)\n {\n if (viewId.equals(mapping.getViewId())\n || (viewId.startsWith(\"/\") && viewId.substring(1).equa... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_14 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/url/URLPatternParserTest.java",
"identifier": "URLPatternParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetMappedUrlWithArray()\n {\n URLPatternParser parser = new URLPatternParser(\n \"/project/#{paramsBean.project}/#{paramsBean.iteration}/#{paramsBean.story}\");\n Object[] params = new Object[3];\n params[0] = \"p1\";\n params[1] = 22;\n pa... | {
"fields": [
{
"declarator": "EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX)",
"modifier": "private static final",
"original_string": "private static final Pattern EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX);",
"type": "Pattern",
"var_name": "EL_REGEX_PATTERN"... | {
"body": "public URL getMappedURL(final Object... params)\n {\n URL result = null;\n if (params != null)\n {\n Object[] parameters = params;\n\n /*\n * Check to see if our parameters were provided as a single List\n */\n if ((params.length == 1) && (params[0... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_43 | {
"fields": [
{
"declarator": "filter",
"modifier": "private",
"original_string": "private ByteCodeAnnotationFilter filter;",
"type": "ByteCodeAnnotationFilter",
"var_name": "filter"
}
],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/config/annotation/ByteCodeAnnotatio... | {
"body": "@Test\n public void testUrlMappingAnnotationOnClass() throws IOException\n {\n assertTrue( filter.accept(getByteCodeInputStream(ClassWithUrlMapping.class)) );\n }",
"class_method_signature": "ByteCodeAnnotationFilterTest.testUrlMappingAnnotationOnClass()",
"constructor": false,
"full_signa... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(ByteCodeAnnotationFilter.class)",
"modifier": "private final static",
"original_string": "private final static Log log = LogFactory.getLog(ByteCodeAnnotationFilter.class);",
"type": "Log",
"var_name": "log"
},
{
"de... | {
"body": "@SuppressWarnings(\"unused\")\n public boolean accept(InputStream classFileStream) throws IOException\n {\n\n // open a DataInputStream\n DataInputStream in = new DataInputStream(classFileStream);\n\n // read magic and abort if it doesn't match\n int magic = in.readInt();\n if ... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_38 | {
"fields": [
{
"declarator": "c = new URLDuplicatePathCanonicalizer()",
"modifier": "",
"original_string": "URLDuplicatePathCanonicalizer c = new URLDuplicatePathCanonicalizer();",
"type": "URLDuplicatePathCanonicalizer",
"var_name": "c"
}
],
"file": "core/src/test/java/com/... | {
"body": "@Test\n public void testIgnoresRelativePaths() throws Exception\n {\n String url = \"http://ocpsoft.com/prettyfaces/../scrumshark/\";\n\n String expected = \"http://ocpsoft.com/prettyfaces/../scrumshark/\";\n\n assertEquals(expected, c.canonicalize(url));\n }",
"class_method... | {
"fields": [
{
"declarator": "pattern = Pattern.compile(\"(/[^/]+/)\\\\.\\\\.(/[^/]+/)\")",
"modifier": "private final",
"original_string": "private final Pattern pattern = Pattern.compile(\"(/[^/]+/)\\\\.\\\\.(/[^/]+/)\");",
"type": "Pattern",
"var_name": "pattern"
}
],
"fi... | {
"body": "public String canonicalize(final String url)\n {\n if (url != null && url.contains(\"/../\"))\n {\n StringBuffer result = new StringBuffer();\n Matcher m = pattern.matcher(url);\n while (m.find())\n {\n if (m.group(1).equals(m.grou... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_80 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/el/LazyExpressionTest.java",
"identifier": "LazyExpressionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected = IllegalStateException.class)\n public void testUnresolvableLazyExpression()\n {\n\n // prepare LazyBeanNameFinder mock\n LazyBeanNameFinder beanNameFinder = EasyMock.createNiceMock(LazyBeanNameFinder.class);\n EasyMock.expect(beanNameFinder.findBeanName(SomeTestBean.clas... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(LazyExpression.class)",
"modifier": "private final static",
"original_string": "private final static Log log = LogFactory.getLog(LazyExpression.class);",
"type": "Log",
"var_name": "log"
},
{
"declarator": "finder",... | {
"body": "public String getELExpression()\n {\n\n // build the expression if not already done\n if (expression == null)\n {\n\n /*\n * Build the expression. Note that findBeanName() will either\n * return the resolved bean name or throw a runtime exception\n */\n ... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_79 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/el/LazyExpressionTest.java",
"identifier": "LazyExpressionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSimpleLazyExpression()\n {\n\n // prepare LazyBeanNameFinder mock\n LazyBeanNameFinder beanNameFinder = EasyMock.createNiceMock(LazyBeanNameFinder.class);\n EasyMock.expect(beanNameFinder.findBeanName(SomeTestBean.class)).andReturn(\"someTestBean\").once();\n ... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(LazyExpression.class)",
"modifier": "private final static",
"original_string": "private final static Log log = LogFactory.getLog(LazyExpression.class);",
"type": "Log",
"var_name": "log"
},
{
"declarator": "finder",... | {
"body": "public String getELExpression()\n {\n\n // build the expression if not already done\n if (expression == null)\n {\n\n /*\n * Build the expression. Note that findBeanName() will either\n * return the resolved bean name or throw a runtime exception\n */\n ... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_96 | {
"fields": [
{
"declarator": "config = new PrettyConfig()",
"modifier": "private static",
"original_string": "private static PrettyConfig config = new PrettyConfig();",
"type": "PrettyConfig",
"var_name": "config"
},
{
"declarator": "mapping = new PrettyUrlMapping()",
... | {
"body": "@Test\n public void isNullViewMappedReturnsFalse() throws Exception\n {\n assertFalse(config.isViewMapped(null));\n }",
"class_method_signature": "PrettyConfigTest.isNullViewMappedReturnsFalse()",
"constructor": false,
"full_signature": "@Test public void isNullViewMappedReturnsFalse()",
... | {
"fields": [
{
"declarator": "CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\"",
"modifier": "public static final",
"original_string": "public static final String CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\";",
"type": "String",
"var_name": "CONFIG_REQUEST_KEY"
},
{
... | {
"body": "public boolean isViewMapped(String viewId)\n {\n if (viewId != null)\n {\n viewId = viewId.trim();\n PrettyUrlMapping needle = new PrettyUrlMapping();\n needle.setViewId(viewId);\n if (viewId.startsWith(\"/\"))\n {\n if (getMappings().contains(... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_109 | {
"fields": [
{
"declarator": "executor = new ActionExecutor()",
"modifier": "",
"original_string": "ActionExecutor executor = new ActionExecutor();",
"type": "ActionExecutor",
"var_name": "executor"
}
],
"file": "impl-jsf11/src/test/java/com/ocpsoft/pretty/beans/ActionExecut... | {
"body": "@Test\n public void testShouldNotExecuteOnPostbackFalse()\n {\n UrlAction action = new UrlAction(\"action\", PhaseId.ANY_PHASE);\n action.setOnPostback(false);\n assertFalse(executor.shouldExecute(action, PhaseId.RESTORE_VIEW, true));\n }",
"class_method_signature": "ActionE... | {
"fields": [
{
"declarator": "elUtils = new FacesElUtils()",
"modifier": "private static final",
"original_string": "private static final FacesElUtils elUtils = new FacesElUtils();",
"type": "FacesElUtils",
"var_name": "elUtils"
},
{
"declarator": "facesStateUtils = ne... | {
"body": "boolean shouldExecute(final UrlAction action, final PhaseId currentPhaseId, final boolean isPostback)\n\t{\n\t\tboolean result = false;\n\t\tif (currentPhaseId.equals(action.getPhaseId()) || PhaseId.ANY_PHASE.equals(action.getPhaseId()))\n\t\t{\n\t\t\tif (action.onPostback())\n\t\t\t{\n\t\t\t\tresult = tru... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_108 | {
"fields": [
{
"declarator": "executor = new ActionExecutor()",
"modifier": "",
"original_string": "ActionExecutor executor = new ActionExecutor();",
"type": "ActionExecutor",
"var_name": "executor"
}
],
"file": "impl-jsf11/src/test/java/com/ocpsoft/pretty/beans/ActionExecut... | {
"body": "@Test\n public void testShouldNotExecuteOnWrongPhasePostback()\n {\n UrlAction action = new UrlAction(\"action\", PhaseId.RESTORE_VIEW);\n action.setOnPostback(true);\n assertFalse(executor.shouldExecute(action, PhaseId.APPLY_REQUEST_VALUES, true));\n }",
"class_method_signa... | {
"fields": [
{
"declarator": "elUtils = new FacesElUtils()",
"modifier": "private static final",
"original_string": "private static final FacesElUtils elUtils = new FacesElUtils();",
"type": "FacesElUtils",
"var_name": "elUtils"
},
{
"declarator": "facesStateUtils = ne... | {
"body": "boolean shouldExecute(final UrlAction action, final PhaseId currentPhaseId, final boolean isPostback)\n\t{\n\t\tboolean result = false;\n\t\tif (currentPhaseId.equals(action.getPhaseId()) || PhaseId.ANY_PHASE.equals(action.getPhaseId()))\n\t\t{\n\t\t\tif (action.onPostback())\n\t\t\t{\n\t\t\t\tresult = tru... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_78 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/el/ConstantExpressionTest.java",
"identifier": "ConstantExpressionTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSimpleConstantExpression()\n {\n\n PrettyExpression expr = new ConstantExpression(\"#{someBean.someProperty}\");\n assertEquals(\"#{someBean.someProperty}\", expr.getELExpression());\n\n }",
"class_method_signature": "ConstantExpressionTest.testSimpleConstantExpres... | {
"fields": [
{
"declarator": "expression",
"modifier": "private final",
"original_string": "private final String expression;",
"type": "String",
"var_name": "expression"
}
],
"file": "core/src/main/java/com/ocpsoft/pretty/faces/el/ConstantExpression.java",
"identifier": "C... | {
"body": "public String getELExpression()\n {\n return expression;\n }",
"class_method_signature": "ConstantExpression.getELExpression()",
"constructor": false,
"full_signature": "public String getELExpression()",
"identifier": "getELExpression",
"invocations": [],
"modifiers": "public",
"para... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_97 | {
"fields": [
{
"declarator": "config = new PrettyConfig()",
"modifier": "private static",
"original_string": "private static PrettyConfig config = new PrettyConfig();",
"type": "PrettyConfig",
"var_name": "config"
},
{
"declarator": "mapping = new PrettyUrlMapping()",
... | {
"body": "@Test\n public void testIsURLMapped() throws Exception\n {\n assertTrue(config.isURLMapped(\"/home/en/test/\"));\n assertFalse(config.isViewMapped(\"/home/en/notmapped/okthen\"));\n }",
"class_method_signature": "PrettyConfigTest.testIsURLMapped()",
"constructor": false,
"full_signatu... | {
"fields": [
{
"declarator": "CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\"",
"modifier": "public static final",
"original_string": "public static final String CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\";",
"type": "String",
"var_name": "CONFIG_REQUEST_KEY"
},
{
... | {
"body": "public boolean isURLMapped(final String url)\n {\n PrettyUrlMapping mapping = getMappingForUrl(url);\n return (mapping != null);\n }",
"class_method_signature": "PrettyConfig.isURLMapped(final String url)",
"constructor": false,
"full_signature": "public boolean isURLMapped(final String... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_81 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/event/PrettyPhaseListenerTest.java",
"identifier": "PrettyPhaseListenerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetPhaseId()\n {\n assertEquals(PhaseId.ANY_PHASE, new PrettyPhaseListener().getPhaseId());\n }",
"class_method_signature": "PrettyPhaseListenerTest.testGetPhaseId()",
"constructor": false,
"full_signature": "@Test public void testGetPhaseId()",
"identifier": "tes... | {
"fields": [
{
"declarator": "serialVersionUID = 2345410822999587673L",
"modifier": "private static final",
"original_string": "private static final long serialVersionUID = 2345410822999587673L;",
"type": "long",
"var_name": "serialVersionUID"
},
{
"declarator": "messa... | {
"body": "public PhaseId getPhaseId()\n {\n return PhaseId.ANY_PHASE;\n }",
"class_method_signature": "PrettyPhaseListener.getPhaseId()",
"constructor": false,
"full_signature": "public PhaseId getPhaseId()",
"identifier": "getPhaseId",
"invocations": [],
"modifiers": "public",
"parameters": "... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_39 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/util/FacesMessagesUtilsTest.java",
"identifier": "FacesMessagesUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSaveMessages()\n {\n\n // set up FacesContext\n FacesContextMock facesContext = new FacesContextMock();\n facesContext.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, \"Summary A\", \"Detail A\"));\n facesContext.addMessage(null, new FacesMessag... | {
"fields": [
{
"declarator": "token = \"com.ocpsoft.pretty.SAVED_FACES_MESSAGES\"",
"modifier": "protected static final",
"original_string": "protected static final String token = \"com.ocpsoft.pretty.SAVED_FACES_MESSAGES\";",
"type": "String",
"var_name": "token"
}
],
"file... | {
"body": "@SuppressWarnings(\"unchecked\")\n public int saveMessages(final FacesContext facesContext, final Map<String, Object> destination)\n {\n int savedCount = 0;\n if (facesContext != null)\n {\n Set<FacesMessageWrapper> messages = new LinkedHashSet<FacesMessageWrapper>();\... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_42 | {
"fields": [
{
"declarator": "filter",
"modifier": "private",
"original_string": "private ByteCodeAnnotationFilter filter;",
"type": "ByteCodeAnnotationFilter",
"var_name": "filter"
}
],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/config/annotation/ByteCodeAnnotatio... | {
"body": "@Test\n public void testNoAnnotationsOnClass() throws IOException\n {\n assertFalse( filter.accept(getByteCodeInputStream(ClassWithoutAnnotations.class)) );\n }",
"class_method_signature": "ByteCodeAnnotationFilterTest.testNoAnnotationsOnClass()",
"constructor": false,
"full_signature": "@... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(ByteCodeAnnotationFilter.class)",
"modifier": "private final static",
"original_string": "private final static Log log = LogFactory.getLog(ByteCodeAnnotationFilter.class);",
"type": "Log",
"var_name": "log"
},
{
"de... | {
"body": "@SuppressWarnings(\"unused\")\n public boolean accept(InputStream classFileStream) throws IOException\n {\n\n // open a DataInputStream\n DataInputStream in = new DataInputStream(classFileStream);\n\n // read magic and abort if it doesn't match\n int magic = in.readInt();\n if ... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_15 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/url/URLPatternParserTest.java",
"identifier": "URLPatternParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetMappedUrlWithMap()\n {\n URLPatternParser parser = new URLPatternParser(\n \"/project/#{paramsBean.project}/#{paramsBean.iteration}/#{paramsBean.story}\");\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"1\", \"p1\");\... | {
"fields": [
{
"declarator": "EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX)",
"modifier": "private static final",
"original_string": "private static final Pattern EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX);",
"type": "Pattern",
"var_name": "EL_REGEX_PATTERN"... | {
"body": "public URL getMappedURL(final Object... params)\n {\n URL result = null;\n if (params != null)\n {\n Object[] parameters = params;\n\n /*\n * Check to see if our parameters were provided as a single List\n */\n if ((params.length == 1) && (params[0... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_54 | {
"fields": [
{
"declarator": "config = new PrettyConfig()",
"modifier": "private static",
"original_string": "private static PrettyConfig config = new PrettyConfig();",
"type": "PrettyConfig",
"var_name": "config"
},
{
"declarator": "mapping = new UrlMapping()",
... | {
"body": "@Test\n public void testGetMappingForUrl()\n {\n UrlMapping mapping2 = config.getMappingForUrl(new URL(\"/home/en/test/\"));\n assertEquals(mapping, mapping2);\n }",
"class_method_signature": "PrettyConfigTest.testGetMappingForUrl()",
"constructor": false,
"full_signature": "@Test pub... | {
"fields": [
{
"declarator": "CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\"",
"modifier": "public static final",
"original_string": "public static final String CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\";",
"type": "String",
"var_name": "CONFIG_REQUEST_KEY"
},
{
... | {
"body": "public UrlMapping getMappingForUrl(final URL url)\n {\n final String mappingKey = url.toURL();\n if (cachedMappings.containsKey(mappingKey)) {\n return cachedMappings.get(mappingKey);\n }\n for (UrlMapping mapping : getMappings())\n {\n if (mapping.matches(url))\n... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_23 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/util/StringUtilsTest.java",
"identifier": "StringUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testHasTrailingSlash()\n {\n assertTrue(StringUtils.hasTrailingSlash(\"/\"));\n assertTrue(StringUtils.hasTrailingSlash(\"test/\"));\n assertTrue(StringUtils.hasTrailingSlash(\"//\"));\n assertTrue(StringUtils.hasTrailingSlash(\"test//\"));\n assertTrue(Stri... | {
"fields": [
{
"declarator": "SLASH = '/'",
"modifier": "private static final",
"original_string": "private static final char SLASH = '/';",
"type": "char",
"var_name": "SLASH"
}
],
"file": "core/src/main/java/com/ocpsoft/pretty/faces/util/StringUtils.java",
"identifier": ... | {
"body": "public static boolean hasTrailingSlash(final String s)\n {\n return s != null && isNotBlank(s) && SLASH == s.charAt(s.length() - 1);\n }",
"class_method_signature": "StringUtils.hasTrailingSlash(final String s)",
"constructor": false,
"full_signature": "public static boolean hasTrailingSlash... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_104 | {
"fields": [
{
"declarator": "executor = new ActionExecutor()",
"modifier": "",
"original_string": "ActionExecutor executor = new ActionExecutor();",
"type": "ActionExecutor",
"var_name": "executor"
}
],
"file": "impl-jsf11/src/test/java/com/ocpsoft/pretty/beans/ActionExecut... | {
"body": "@Test\n public void testShouldExecuteOnNonPostback()\n {\n UrlAction action = new UrlAction(\"action\", PhaseId.ANY_PHASE);\n action.setOnPostback(true);\n assertTrue(executor.shouldExecute(action, PhaseId.RESTORE_VIEW, false));\n }",
"class_method_signature": "ActionExecuto... | {
"fields": [
{
"declarator": "elUtils = new FacesElUtils()",
"modifier": "private static final",
"original_string": "private static final FacesElUtils elUtils = new FacesElUtils();",
"type": "FacesElUtils",
"var_name": "elUtils"
},
{
"declarator": "facesStateUtils = ne... | {
"body": "boolean shouldExecute(final UrlAction action, final PhaseId currentPhaseId, final boolean isPostback)\n\t{\n\t\tboolean result = false;\n\t\tif (currentPhaseId.equals(action.getPhaseId()) || PhaseId.ANY_PHASE.equals(action.getPhaseId()))\n\t\t{\n\t\t\tif (action.onPostback())\n\t\t\t{\n\t\t\t\tresult = tru... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_74 | {
"fields": [
{
"declarator": "url = \"/my/foo/is/COOL\"",
"modifier": "",
"original_string": "String url = \"/my/foo/is/COOL\";",
"type": "String",
"var_name": "url"
},
{
"declarator": "rewriteEngine = new RewriteEngine()",
"modifier": "",
"original_string"... | {
"body": "@Test\n public void testCustomClassProcessor() throws Exception\n {\n RewriteRule c = new RewriteRule();\n c.setProcessor(MockCustomClassProcessor.class.getName());\n assertEquals(MockCustomClassProcessor.RESULT, rewriteEngine.processInbound(null, null, c, url));\n }",
"class_method_... | {
"fields": [
{
"declarator": "processors",
"modifier": "private static",
"original_string": "private static List<Processor> processors;",
"type": "List<Processor>",
"var_name": "processors"
}
],
"file": "core/src/main/java/com/ocpsoft/pretty/faces/rewrite/RewriteEngine.java"... | {
"body": "public String processInbound(final HttpServletRequest request, final HttpServletResponse response,\n final RewriteRule rule, final String url)\n {\n String result = url;\n if ((rule != null) && rule.isInbound() && rule.matches(url))\n {\n for (Processor p : processors)\n... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_3 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/url/URLPatternParserTest.java",
"identifier": "URLPatternParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMatches()\n {\n URLPatternParser parser = new URLPatternParser(\n \"/project/#{paramsBean.project}/#{paramsBean.iteration}/#{paramsBean.story}\");\n assertTrue(parser.matches(new URL(\"/project/starfish1/starfish2/story1\")));\n assertFalse(parser.ma... | {
"fields": [
{
"declarator": "EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX)",
"modifier": "private static final",
"original_string": "private static final Pattern EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX);",
"type": "Pattern",
"var_name": "EL_REGEX_PATTERN"... | {
"body": "public boolean matches(final URL target)\n {\n if (elPattern) {\n return urlElPattern.matcher(target.toURL()).matches();\n } else {\n return urlPattern.toURL().equals(target.toURL());\n }\n }",
"class_method_signature": "URLPatternParser.matches(final URL target)",
"c... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_62 | {
"fields": [
{
"declarator": "executor = new ActionExecutor()",
"modifier": "",
"original_string": "ActionExecutor executor = new ActionExecutor();",
"type": "ActionExecutor",
"var_name": "executor"
}
],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/beans/ActionExecut... | {
"body": "@Test\n public void testShouldExecuteOnPostback()\n {\n UrlAction action = new UrlAction(\"action\", PhaseId.ANY_PHASE);\n action.setOnPostback(true);\n assertTrue(executor.shouldExecute(action, javax.faces.event.PhaseId.RESTORE_VIEW, true));\n }",
"class_method_signature": "ActionEx... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(ActionExecutor.class)",
"modifier": "private static final",
"original_string": "private static final Log log = LogFactory.getLog(ActionExecutor.class);",
"type": "Log",
"var_name": "log"
},
{
"declarator": "elUtils ... | {
"body": "boolean shouldExecute(final UrlAction action, final PhaseId currentPhaseId, final boolean isPostback)\n {\n boolean result = false;\n if (PhaseIdComparator.equals(action.getPhaseId(), currentPhaseId)\n || PhaseIdComparator.equals(action.getPhaseId(), PhaseId.ANY_PHASE))\n {\n... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_35 | {
"fields": [
{
"declarator": "decoder = new HTTPDecoder()",
"modifier": "",
"original_string": "HTTPDecoder decoder = new HTTPDecoder();",
"type": "HTTPDecoder",
"var_name": "decoder"
}
],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/util/HTTPDecoderTest.java",
"id... | {
"body": "@Test(expected = PrettyException.class)\n public void testDecodeInvalidInputThrowsException()\n {\n String value = \"foo+bar%\";\n assertEquals(\"foo+bar%\", decoder.decode(value));\n }",
"class_method_signature": "HTTPDecoderTest.testDecodeInvalidInputThrowsException()",
"constr... | {
"fields": [],
"file": "core/src/main/java/com/ocpsoft/pretty/faces/util/HTTPDecoder.java",
"identifier": "HTTPDecoder",
"interfaces": "",
"methods": [
{
"class_method_signature": "HTTPDecoder.decode(final String value)",
"constructor": false,
"full_signature": "public String decode(fin... | {
"body": "public String decode(final String value)\n {\n String result = value;\n if (value != null)\n {\n try\n {\n result = URLDecoder.decode(value, \"UTF-8\");\n }\n catch (Exception e)\n {\n throw new Pre... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_19 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/url/URLTest.java",
"identifier": "URLTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testURLPreservesOriginalURL() throws Exception\n {\n String value = \"/com/ocpsoft/pretty/\";\n URL url = new URL(value);\n assertEquals(value, url.toURL());\n }",
"class_method_signature": "URLTest.testURLPreservesOriginalURL()",
"constructor": false,
"full_s... | {
"fields": [
{
"declarator": "metadata = new Metadata()",
"modifier": "private",
"original_string": "private Metadata metadata = new Metadata();",
"type": "Metadata",
"var_name": "metadata"
},
{
"declarator": "originalURL = \"\"",
"modifier": "private",
"or... | {
"body": "public String toURL()\n {\n return originalURL;\n }",
"class_method_signature": "URL.toURL()",
"constructor": false,
"full_signature": "public String toURL()",
"identifier": "toURL",
"invocations": [],
"modifiers": "public",
"parameters": "()",
"return": "String",
"signature": "S... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_58 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/config/mapping/PathParameterTest.java",
"identifier": "PathParameterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testIsNamedFalseWhenNameNull()\n {\n PathParameter parameter = new PathParameter();\n assertFalse(parameter.isNamed());\n }",
"class_method_signature": "PathParameterTest.testIsNamedFalseWhenNameNull()",
"constructor": false,
"full_signature": "@Test public ... | {
"fields": [
{
"declarator": "PATH_PARAM_NAME_PREFIX = \"com.ocpsoft.vP_\"",
"modifier": "private static final",
"original_string": "private static final String PATH_PARAM_NAME_PREFIX = \"com.ocpsoft.vP_\";",
"type": "String",
"var_name": "PATH_PARAM_NAME_PREFIX"
},
{
... | {
"body": "public boolean isNamed()\n {\n return (null != super.getName()) && !\"\".equals(super.getName().trim());\n }",
"class_method_signature": "PathParameter.isNamed()",
"constructor": false,
"full_signature": "public boolean isNamed()",
"identifier": "isNamed",
"invocations": [
"getName",... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_53 | {
"fields": [
{
"declarator": "config = new PrettyConfig()",
"modifier": "private static",
"original_string": "private static PrettyConfig config = new PrettyConfig();",
"type": "PrettyConfig",
"var_name": "config"
},
{
"declarator": "mapping = new UrlMapping()",
... | {
"body": "@Test\n public void testGetMappingByNullIdReturnsNull()\n {\n UrlMapping mapping2 = config.getMappingById(null);\n assertEquals(null, mapping2);\n }",
"class_method_signature": "PrettyConfigTest.testGetMappingByNullIdReturnsNull()",
"constructor": false,
"full_signature": "@Test publi... | {
"fields": [
{
"declarator": "CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\"",
"modifier": "public static final",
"original_string": "public static final String CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\";",
"type": "String",
"var_name": "CONFIG_REQUEST_KEY"
},
{
... | {
"body": "public UrlMapping getMappingById(String id)\n {\n if (id != null)\n {\n if (id.startsWith(PrettyContext.PRETTY_PREFIX))\n {\n id = id.substring(PrettyContext.PRETTY_PREFIX.length());\n }\n for (UrlMapping mapping : getMappings())\n {\n ... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_12 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/url/URLPatternParserTest.java",
"identifier": "URLPatternParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetParameterCount()\n {\n URLPatternParser parser = new URLPatternParser(\n \"/project/#{paramsBean.project}/#{paramsBean.iteration}/#{paramsBean.story}\");\n assertEquals(3, parser.getParameterCount());\n }",
"class_method_signature": "URLPatternPars... | {
"fields": [
{
"declarator": "EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX)",
"modifier": "private static final",
"original_string": "private static final Pattern EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX);",
"type": "Pattern",
"var_name": "EL_REGEX_PATTERN"... | {
"body": "public int getParameterCount()\n {\n return pathParameters.size();\n }",
"class_method_signature": "URLPatternParser.getParameterCount()",
"constructor": false,
"full_signature": "public int getParameterCount()",
"identifier": "getParameterCount",
"invocations": [
"size"
],
"modi... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_45 | {
"fields": [
{
"declarator": "filter",
"modifier": "private",
"original_string": "private ByteCodeAnnotationFilter filter;",
"type": "ByteCodeAnnotationFilter",
"var_name": "filter"
}
],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/config/annotation/ByteCodeAnnotatio... | {
"body": "@Test\n public void testUrlActionOnMethod() throws IOException\n {\n assertTrue( filter.accept(getByteCodeInputStream(ClassWithUrlAction.class)) );\n }",
"class_method_signature": "ByteCodeAnnotationFilterTest.testUrlActionOnMethod()",
"constructor": false,
"full_signature": "@Test public ... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(ByteCodeAnnotationFilter.class)",
"modifier": "private final static",
"original_string": "private final static Log log = LogFactory.getLog(ByteCodeAnnotationFilter.class);",
"type": "Log",
"var_name": "log"
},
{
"de... | {
"body": "@SuppressWarnings(\"unused\")\n public boolean accept(InputStream classFileStream) throws IOException\n {\n\n // open a DataInputStream\n DataInputStream in = new DataInputStream(classFileStream);\n\n // read magic and abort if it doesn't match\n int magic = in.readInt();\n if ... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_69 | {
"fields": [
{
"declarator": "executor = new ActionExecutor()",
"modifier": "",
"original_string": "ActionExecutor executor = new ActionExecutor();",
"type": "ActionExecutor",
"var_name": "executor"
}
],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/beans/ActionExecut... | {
"body": "@Test\n public void testShouldExecuteOnPostbackFalseWhenNotPostback()\n {\n UrlAction action = new UrlAction(\"action\", PhaseId.ANY_PHASE);\n action.setOnPostback(false);\n assertTrue(executor.shouldExecute(action, javax.faces.event.PhaseId.RESTORE_VIEW, false));\n }",
"class_method... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(ActionExecutor.class)",
"modifier": "private static final",
"original_string": "private static final Log log = LogFactory.getLog(ActionExecutor.class);",
"type": "Log",
"var_name": "log"
},
{
"declarator": "elUtils ... | {
"body": "boolean shouldExecute(final UrlAction action, final PhaseId currentPhaseId, final boolean isPostback)\n {\n boolean result = false;\n if (PhaseIdComparator.equals(action.getPhaseId(), currentPhaseId)\n || PhaseIdComparator.equals(action.getPhaseId(), PhaseId.ANY_PHASE))\n {\n... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_86 | {
"fields": [
{
"declarator": "parser = new UrlPatternParser(\n \"/project/#{paramsBean.project}/#{paramsBean.project}/#{paramsBean.story}\")",
"modifier": "",
"original_string": "UrlPatternParser parser = new UrlPatternParser(\n \"/project/#{paramsBean.project}/#{paramsBea... | {
"body": "@Test\n public void testSetUrlPattern()\n {\n UrlPatternParser parser = new UrlPatternParser(\n \"/project/#{paramsBean.project}/#{paramsBean.project}/#{paramsBean.story}\");\n assertEquals(3, parser.getParameterCount());\n parser.setUrlPattern(\"/public/home\");\n... | {
"fields": [
{
"declarator": "originalPattern",
"modifier": "private",
"original_string": "private String originalPattern;",
"type": "String",
"var_name": "originalPattern"
},
{
"declarator": "urlPattern",
"modifier": "private",
"original_string": "private ... | {
"body": "public void setUrlPattern(final String urlPattern)\n {\n originalPattern = urlPattern;\n expressions.clear();\n Matcher matcher = FacesElUtils.elPattern.matcher(urlPattern);\n while (matcher.find())\n {\n expressions.add(matcher.group());\n }\n this.urlPattern =... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_8 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/url/URLPatternParserTest.java",
"identifier": "URLPatternParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetMappedParameters()\n {\n URLPatternParser parser = new URLPatternParser(\n \"/project/#{paramsBean.project}/#{paramsBean.iteration}/#{paramsBean.story}\");\n List<PathParameter> params = parser.parse(new URL(\"/project/starfish1/sprint1/story1\"));\n ... | {
"fields": [
{
"declarator": "EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX)",
"modifier": "private static final",
"original_string": "private static final Pattern EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX);",
"type": "Pattern",
"var_name": "EL_REGEX_PATTERN"... | {
"body": "public List<PathParameter> parse(final URL url)\n {\n List<PathParameter> result = new ArrayList<PathParameter>();\n\n String inboundUrl = url.toURL();\n if (this.matches(url))\n {\n Iterator<Segment> iter = pathSegments.iterator();\n while (iter.hasNext())\n {... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_90 | {
"fields": [
{
"declarator": "decoder = new HTTPDecoder()",
"modifier": "",
"original_string": "HTTPDecoder decoder = new HTTPDecoder();",
"type": "HTTPDecoder",
"var_name": "decoder"
}
],
"file": "impl-jsf11/src/test/java/com/ocpsoft/pretty/util/HTTPDecoderTest.java",
"id... | {
"body": "@Test\n public void testDecodeNullProducesNull()\n {\n String value = null;\n assertEquals(null, decoder.decode(value));\n }",
"class_method_signature": "HTTPDecoderTest.testDecodeNullProducesNull()",
"constructor": false,
"full_signature": "@Test public void testDecodeNullProd... | {
"fields": [],
"file": "impl-jsf11/src/main/java/com/ocpsoft/pretty/util/HTTPDecoder.java",
"identifier": "HTTPDecoder",
"interfaces": "",
"methods": [
{
"class_method_signature": "HTTPDecoder.decode(final String value)",
"constructor": false,
"full_signature": "public String decode(fin... | {
"body": "public String decode(final String value)\n {\n String result = value;\n if (value != null)\n {\n try\n {\n result = URLDecoder.decode(value, \"UTF-8\");\n }\n catch (Exception e)\n {\n throw new Pre... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_28 | {
"fields": [
{
"declarator": "link = new Link()",
"modifier": "static",
"original_string": "static Link link = new Link();",
"type": "Link",
"var_name": "link"
},
{
"declarator": "mapping = new UrlMapping()",
"modifier": "static",
"original_string": "static... | {
"body": "@Test\n public void testBuildMappedUrlPrettyUrlMappingSingleParameterContainingArray()\n {\n List<UIParameter> parameters = new ArrayList<UIParameter>();\n UIParameter param = new UIParameter();\n param.setValue(valuesArray);\n parameters.add(param);\n\n String mappedUrl = buil... | {
"fields": [],
"file": "core/src/main/java/com/ocpsoft/pretty/faces/util/PrettyURLBuilder.java",
"identifier": "PrettyURLBuilder",
"interfaces": "",
"methods": [
{
"class_method_signature": "PrettyURLBuilder.extractParameters(final UIComponent component)",
"constructor": false,
"full_si... | {
"body": "@Deprecated\n public String build(final UrlMapping mapping, final Map<String, String[]> parameters)\n {\n return build(mapping, false, parameters);\n }",
"class_method_signature": "PrettyURLBuilder.build(final UrlMapping mapping, final Map<String, String[]> parameters)",
"constructor": false... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_49 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/config/annotation/WebLibFinderTest.java",
"identifier": "WebLibFinderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n @SuppressWarnings(\"unchecked\")\n public void testWebLibFinder() throws Exception\n {\n\n // URLs of simulated directories and files\n URL libUrl = new URL(\"file:/somewhere/WEB-INF/lib/\");\n URL jarUrl = new URL(\"file\", null, 0, \"/somewhere/WEB-INF/lib/mylib.jar\", new Te... | {
"fields": [
{
"declarator": "LIB_FOLDER = \"/WEB-INF/lib/\"",
"modifier": "private final static",
"original_string": "private final static String LIB_FOLDER = \"/WEB-INF/lib/\";",
"type": "String",
"var_name": "LIB_FOLDER"
}
],
"file": "core/src/main/java/com/ocpsoft/pretty... | {
"body": "public WebLibFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packageFilter)\n {\n super(servletContext, classLoader, packageFilter);\n }",
"class_method_signature": "WebLibFinder.WebLibFinder(ServletContext servletContext, ClassLoader classLoader, PackageFilter packa... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_32 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/util/FacesNavigationURLCanonicalizerTest.java",
"identifier": "FacesNavigationURLCanonicalizerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNormalizeRequestUriWithExtensionMapping()\n {\n assertEquals(\"/page2.jsf\", FacesNavigationURLCanonicalizer.normalizeRequestURI(\"/page1.jsf\", null, \"/page2.jsf\"));\n }",
"class_method_signature": "FacesNavigationURLCanonicalizerTest.testNormalizeRequestUriWithExten... | {
"fields": [],
"file": "core/src/main/java/com/ocpsoft/pretty/faces/util/FacesNavigationURLCanonicalizer.java",
"identifier": "FacesNavigationURLCanonicalizer",
"interfaces": "",
"methods": [
{
"class_method_signature": "FacesNavigationURLCanonicalizer.normalizeRequestURI(final FacesContext context... | {
"body": "public static String normalizeRequestURI(final FacesContext context, final String viewId)\n {\n ExternalContext externalContext = context.getExternalContext();\n return normalizeRequestURI(externalContext.getRequestServletPath(), externalContext.getRequestPathInfo(), viewId);\n }",
"class_m... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_65 | {
"fields": [
{
"declarator": "executor = new ActionExecutor()",
"modifier": "",
"original_string": "ActionExecutor executor = new ActionExecutor();",
"type": "ActionExecutor",
"var_name": "executor"
}
],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/beans/ActionExecut... | {
"body": "@Test\n public void testShouldNotExecuteOnWrongPhaseNonPostback()\n {\n UrlAction action = new UrlAction(\"action\", PhaseId.RESTORE_VIEW);\n action.setOnPostback(true);\n assertFalse(executor.shouldExecute(action, javax.faces.event.PhaseId.APPLY_REQUEST_VALUES, false));\n }",
"class... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(ActionExecutor.class)",
"modifier": "private static final",
"original_string": "private static final Log log = LogFactory.getLog(ActionExecutor.class);",
"type": "Log",
"var_name": "log"
},
{
"declarator": "elUtils ... | {
"body": "boolean shouldExecute(final UrlAction action, final PhaseId currentPhaseId, final boolean isPostback)\n {\n boolean result = false;\n if (PhaseIdComparator.equals(action.getPhaseId(), currentPhaseId)\n || PhaseIdComparator.equals(action.getPhaseId(), PhaseId.ANY_PHASE))\n {\n... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_73 | {
"fields": [
{
"declarator": "url = \"/my/foo/is/COOL\"",
"modifier": "",
"original_string": "String url = \"/my/foo/is/COOL\";",
"type": "String",
"var_name": "url"
},
{
"declarator": "rewriteEngine = new RewriteEngine()",
"modifier": "",
"original_string"... | {
"body": "@Test\n public void testToLowerCase() throws Exception\n {\n RewriteRule c = new RewriteRule();\n c.setToCase(Case.LOWERCASE);\n assertEquals(\"/my/foo/is/cool\", rewriteEngine.processInbound(null, null, c, url));\n }",
"class_method_signature": "RewriteEngineTest.testToLowerCase()",... | {
"fields": [
{
"declarator": "processors",
"modifier": "private static",
"original_string": "private static List<Processor> processors;",
"type": "List<Processor>",
"var_name": "processors"
}
],
"file": "core/src/main/java/com/ocpsoft/pretty/faces/rewrite/RewriteEngine.java"... | {
"body": "public String processInbound(final HttpServletRequest request, final HttpServletResponse response,\n final RewriteRule rule, final String url)\n {\n String result = url;\n if ((rule != null) && rule.isInbound() && rule.matches(url))\n {\n for (Processor p : processors)\n... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_4 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/url/URLPatternParserTest.java",
"identifier": "URLPatternParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMatchesPrefixedSegmentExpressionInjected()\n {\n URLPatternParser parser = new URLPatternParser(\"/project/#{paramsBean.project}/story-#{paramsBean.story}/\");\n assertTrue(parser.matches(new URL(\"/project/starfish/story-1/\")));\n assertFalse(parser.matches(new ... | {
"fields": [
{
"declarator": "EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX)",
"modifier": "private static final",
"original_string": "private static final Pattern EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX);",
"type": "Pattern",
"var_name": "EL_REGEX_PATTERN"... | {
"body": "public boolean matches(final URL target)\n {\n if (elPattern) {\n return urlElPattern.matcher(target.toURL()).matches();\n } else {\n return urlPattern.toURL().equals(target.toURL());\n }\n }",
"class_method_signature": "URLPatternParser.matches(final URL target)",
"c... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_103 | {
"fields": [
{
"declarator": "executor = new ActionExecutor()",
"modifier": "",
"original_string": "ActionExecutor executor = new ActionExecutor();",
"type": "ActionExecutor",
"var_name": "executor"
}
],
"file": "impl-jsf11/src/test/java/com/ocpsoft/pretty/beans/ActionExecut... | {
"body": "@Test\n public void testShouldExecuteOnPostback()\n {\n UrlAction action = new UrlAction(\"action\", PhaseId.ANY_PHASE);\n action.setOnPostback(true);\n assertTrue(executor.shouldExecute(action, PhaseId.RESTORE_VIEW, true));\n }",
"class_method_signature": "ActionExecutorTes... | {
"fields": [
{
"declarator": "elUtils = new FacesElUtils()",
"modifier": "private static final",
"original_string": "private static final FacesElUtils elUtils = new FacesElUtils();",
"type": "FacesElUtils",
"var_name": "elUtils"
},
{
"declarator": "facesStateUtils = ne... | {
"body": "boolean shouldExecute(final UrlAction action, final PhaseId currentPhaseId, final boolean isPostback)\n\t{\n\t\tboolean result = false;\n\t\tif (currentPhaseId.equals(action.getPhaseId()) || PhaseId.ANY_PHASE.equals(action.getPhaseId()))\n\t\t{\n\t\t\tif (action.onPostback())\n\t\t\t{\n\t\t\t\tresult = tru... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_24 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/util/StringUtilsTest.java",
"identifier": "StringUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testSplitBySlash()\n {\n assertArrayEquals(new String[0], StringUtils.splitBySlash(null));\n assertArrayEquals(new String[0], StringUtils.splitBySlash(\"\"));\n\n assertArrayEquals(new String[] { \"test\" }, StringUtils.splitBySlash(\"test\"));\n assertArrayEqual... | {
"fields": [
{
"declarator": "SLASH = '/'",
"modifier": "private static final",
"original_string": "private static final char SLASH = '/';",
"type": "char",
"var_name": "SLASH"
}
],
"file": "core/src/main/java/com/ocpsoft/pretty/faces/util/StringUtils.java",
"identifier": ... | {
"body": "public static String[] splitBySlash(final String s)\n {\n if (s == null || isBlank(s))\n {\n return new String[0];\n }\n char[] chars = s.toCharArray();\n int numberOfSegments = countSlashes(s) + 1;\n\n final String[] segments = new String[numberOfSegments];\n i... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_102 | {
"fields": [],
"file": "impl-jsf11/src/test/java/com/ocpsoft/pretty/config/mapping/QueryParameterTest.java",
"identifier": "QueryParameterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testHashCodeAndEquals()\n {\n QueryParameter param1 = new QueryParameter(\"foo\", \"bar\");\n QueryParameter param2 = new QueryParameter(\"foo\", \"bar\");\n QueryParameter param3 = new QueryParameter(\"foo\", \"bar2\");\n QueryParameter param4 = new Qu... | {
"fields": [
{
"declarator": "name",
"modifier": "private",
"original_string": "private String name;",
"type": "String",
"var_name": "name"
},
{
"declarator": "expression",
"modifier": "private",
"original_string": "private String expression;",
"type"... | {
"body": "@Override\n public int hashCode()\n {\n final int prime = 31;\n int result = 1;\n result = prime * result + ((expression == null) ? 0 : expression.hashCode());\n result = prime * result + ((name == null) ? 0 : name.hashCode());\n return result;\n }",
"class_met... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_25 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/util/StringUtilsTest.java",
"identifier": "StringUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCountSlashes()\n {\n assertEquals(0, StringUtils.countSlashes(\"\"));\n assertEquals(0, StringUtils.countSlashes(\"abcde\"));\n assertEquals(1, StringUtils.countSlashes(\"/\"));\n assertEquals(1, StringUtils.countSlashes(\"/test\"));\n assertEquals(1, St... | {
"fields": [
{
"declarator": "SLASH = '/'",
"modifier": "private static final",
"original_string": "private static final char SLASH = '/';",
"type": "char",
"var_name": "SLASH"
}
],
"file": "core/src/main/java/com/ocpsoft/pretty/faces/util/StringUtils.java",
"identifier": ... | {
"body": "public static int countSlashes(final String s)\n {\n int result = 0;\n for (char ch : s.toCharArray())\n {\n if (ch == '/')\n {\n ++result;\n }\n }\n return result;\n }",
"class_method_signature": "StringUtils.countSlashes(final String s)",
... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_72 | {
"fields": [
{
"declarator": "url = \"/my/foo/is/COOL\"",
"modifier": "",
"original_string": "String url = \"/my/foo/is/COOL\";",
"type": "String",
"var_name": "url"
},
{
"declarator": "rewriteEngine = new RewriteEngine()",
"modifier": "",
"original_string"... | {
"body": "@Test\n public void testRemoveSingleTrailingSlash() throws Exception\n {\n RewriteRule c = new RewriteRule();\n c.setTrailingSlash(TrailingSlash.APPEND);\n assertEquals(\"/\", rewriteEngine.processInbound(null, null, c, \"/\"));\n }",
"class_method_signature": "RewriteEngineTest.test... | {
"fields": [
{
"declarator": "processors",
"modifier": "private static",
"original_string": "private static List<Processor> processors;",
"type": "List<Processor>",
"var_name": "processors"
}
],
"file": "core/src/main/java/com/ocpsoft/pretty/faces/rewrite/RewriteEngine.java"... | {
"body": "public String processInbound(final HttpServletRequest request, final HttpServletResponse response,\n final RewriteRule rule, final String url)\n {\n String result = url;\n if ((rule != null) && rule.isInbound() && rule.matches(url))\n {\n for (Processor p : processors)\n... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_5 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/url/URLPatternParserTest.java",
"identifier": "URLPatternParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMatchesPrefixedSegmentExpressionNamed()\n {\n URLPatternParser parser = new URLPatternParser(\"/project/#{paramsBean.project}/story-#{story}/\");\n assertTrue(parser.matches(new URL(\"/project/starfish/story-1/\")));\n }",
"class_method_signature": "URLPatternParse... | {
"fields": [
{
"declarator": "EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX)",
"modifier": "private static final",
"original_string": "private static final Pattern EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX);",
"type": "Pattern",
"var_name": "EL_REGEX_PATTERN"... | {
"body": "public boolean matches(final URL target)\n {\n if (elPattern) {\n return urlElPattern.matcher(target.toURL()).matches();\n } else {\n return urlPattern.toURL().equals(target.toURL());\n }\n }",
"class_method_signature": "URLPatternParser.matches(final URL target)",
"c... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_64 | {
"fields": [
{
"declarator": "executor = new ActionExecutor()",
"modifier": "",
"original_string": "ActionExecutor executor = new ActionExecutor();",
"type": "ActionExecutor",
"var_name": "executor"
}
],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/beans/ActionExecut... | {
"body": "@Test\n public void testShouldExecuteOnPhaseNonPostback()\n {\n UrlAction action = new UrlAction(\"action\", PhaseId.RESTORE_VIEW);\n action.setOnPostback(true);\n assertTrue(executor.shouldExecute(action, javax.faces.event.PhaseId.RESTORE_VIEW, false));\n }",
"class_method_signature... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(ActionExecutor.class)",
"modifier": "private static final",
"original_string": "private static final Log log = LogFactory.getLog(ActionExecutor.class);",
"type": "Log",
"var_name": "log"
},
{
"declarator": "elUtils ... | {
"body": "boolean shouldExecute(final UrlAction action, final PhaseId currentPhaseId, final boolean isPostback)\n {\n boolean result = false;\n if (PhaseIdComparator.equals(action.getPhaseId(), currentPhaseId)\n || PhaseIdComparator.equals(action.getPhaseId(), PhaseId.ANY_PHASE))\n {\n... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_33 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/util/FacesNavigationURLCanonicalizerTest.java",
"identifier": "FacesNavigationURLCanonicalizerTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testNormalizeRequestUriWithPathMapping()\n {\n assertEquals(\"/page2.xhtml\", FacesNavigationURLCanonicalizer.normalizeRequestURI(\"/faces\", \"/page1.xhtml\", \"/faces/page2.xhtml\"));\n }",
"class_method_signature": "FacesNavigationURLCanonicalizerTest.testNormalizeReques... | {
"fields": [],
"file": "core/src/main/java/com/ocpsoft/pretty/faces/util/FacesNavigationURLCanonicalizer.java",
"identifier": "FacesNavigationURLCanonicalizer",
"interfaces": "",
"methods": [
{
"class_method_signature": "FacesNavigationURLCanonicalizer.normalizeRequestURI(final FacesContext context... | {
"body": "public static String normalizeRequestURI(final FacesContext context, final String viewId)\n {\n ExternalContext externalContext = context.getExternalContext();\n return normalizeRequestURI(externalContext.getRequestServletPath(), externalContext.getRequestPathInfo(), viewId);\n }",
"class_m... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_48 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/config/annotation/PackageFilterTest.java",
"identifier": "PackageFilterTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testMultiplePackages()\n {\n\n // test simple filter\n PackageFilter filter = new PackageFilter(\"com.ocpsoft,de.chkal\");\n assertEquals(true, filter.isAllowedPackage(\"com.ocpsoft.pretty.faces\"));\n assertEquals(true, filter.isAllowedPackage(\"com.ocpsoft\"));... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(PackageFilter.class)",
"modifier": "private final static",
"original_string": "private final static Log log = LogFactory.getLog(PackageFilter.class);",
"type": "Log",
"var_name": "log"
},
{
"declarator": "packageSet... | {
"body": "public boolean isAllowedPackage(String packageName)\n {\n\n // No packages in set? Accept all packages.\n if (packageSet.isEmpty())\n {\n return true;\n }\n\n // check all valid packages\n for (String validPackage : packageSet)\n {\n // accept if package... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_29 | {
"fields": [
{
"declarator": "link = new Link()",
"modifier": "static",
"original_string": "static Link link = new Link();",
"type": "Link",
"var_name": "link"
},
{
"declarator": "mapping = new UrlMapping()",
"modifier": "static",
"original_string": "static... | {
"body": "@Test(expected = PrettyException.class)\n public void testBuildMappedUrlPrettyUrlMappingSingleNamedParameterDefaultsToNonListBuild()\n {\n List<UIParameter> parameters = new ArrayList<UIParameter>();\n UIParameter param = new UIParameter();\n param.setValue(values);\n param.setName(... | {
"fields": [],
"file": "core/src/main/java/com/ocpsoft/pretty/faces/util/PrettyURLBuilder.java",
"identifier": "PrettyURLBuilder",
"interfaces": "",
"methods": [
{
"class_method_signature": "PrettyURLBuilder.extractParameters(final UIComponent component)",
"constructor": false,
"full_si... | {
"body": "@Deprecated\n public String build(final UrlMapping mapping, final Map<String, String[]> parameters)\n {\n return build(mapping, false, parameters);\n }",
"class_method_signature": "PrettyURLBuilder.build(final UrlMapping mapping, final Map<String, String[]> parameters)",
"constructor": false... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_9 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/url/URLPatternParserTest.java",
"identifier": "URLPatternParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetMappedParametersDuplicatesAreRepresented()\n {\n URLPatternParser duplicateParamsParser = new URLPatternParser(\n \"/project/#{paramsBean.project}/#{paramsBean.project}/#{paramsBean.story}\");\n List<PathParameter> params = duplicateParamsParser.parse(... | {
"fields": [
{
"declarator": "EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX)",
"modifier": "private static final",
"original_string": "private static final Pattern EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX);",
"type": "Pattern",
"var_name": "EL_REGEX_PATTERN"... | {
"body": "public List<PathParameter> parse(final URL url)\n {\n List<PathParameter> result = new ArrayList<PathParameter>();\n\n String inboundUrl = url.toURL();\n if (this.matches(url))\n {\n Iterator<Segment> iter = pathSegments.iterator();\n while (iter.hasNext())\n {... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_91 | {
"fields": [],
"file": "impl-jsf11/src/test/java/com/ocpsoft/pretty/util/FacesElUtilsTest.java",
"identifier": "FacesElUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCallElMethodWithNoArguments()\n throws SecurityException, NoSuchMethodException\n {\n\n FacesContext context =\n createMock(FacesContext.class, new Method[] {\n FacesContext.class.getMethod(\"getApplication\") });\n Appli... | {
"fields": [
{
"declarator": "EL_REGEX = \"\\\\#\\\\{[\\\\w\\\\.]{1,}\\\\}\"",
"modifier": "public static final",
"original_string": "public static final String EL_REGEX = \"\\\\#\\\\{[\\\\w\\\\.]{1,}\\\\}\";",
"type": "String",
"var_name": "EL_REGEX"
},
{
"declarator"... | {
"body": "public Object invokeMethod(final FacesContext context, final String expression) throws ELException\n { \n MethodBinding methodBinding = context.getApplication().createMethodBinding(expression, null);\n return methodBinding.invoke(context, null);\n }",
"class_method_signature": "... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_68 | {
"fields": [
{
"declarator": "executor = new ActionExecutor()",
"modifier": "",
"original_string": "ActionExecutor executor = new ActionExecutor();",
"type": "ActionExecutor",
"var_name": "executor"
}
],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/beans/ActionExecut... | {
"body": "@Test\n public void testShouldNotExecuteOnPostbackFalse()\n {\n UrlAction action = new UrlAction(\"action\", PhaseId.ANY_PHASE);\n action.setOnPostback(false);\n assertFalse(executor.shouldExecute(action, javax.faces.event.PhaseId.RESTORE_VIEW, true));\n }",
"class_method_signature":... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(ActionExecutor.class)",
"modifier": "private static final",
"original_string": "private static final Log log = LogFactory.getLog(ActionExecutor.class);",
"type": "Log",
"var_name": "log"
},
{
"declarator": "elUtils ... | {
"body": "boolean shouldExecute(final UrlAction action, final PhaseId currentPhaseId, final boolean isPostback)\n {\n boolean result = false;\n if (PhaseIdComparator.equals(action.getPhaseId(), currentPhaseId)\n || PhaseIdComparator.equals(action.getPhaseId(), PhaseId.ANY_PHASE))\n {\n... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_87 | {
"fields": [
{
"declarator": "parser = new UrlPatternParser(\n \"/project/#{paramsBean.project}/#{paramsBean.project}/#{paramsBean.story}\")",
"modifier": "",
"original_string": "UrlPatternParser parser = new UrlPatternParser(\n \"/project/#{paramsBean.project}/#{paramsBea... | {
"body": "@Test\n public void testGetParameterCount()\n {\n assertEquals(3, parser.getParameterCount());\n }",
"class_method_signature": "UrlPatternParserTest.testGetParameterCount()",
"constructor": false,
"full_signature": "@Test public void testGetParameterCount()",
"identifier": "testGetP... | {
"fields": [
{
"declarator": "originalPattern",
"modifier": "private",
"original_string": "private String originalPattern;",
"type": "String",
"var_name": "originalPattern"
},
{
"declarator": "urlPattern",
"modifier": "private",
"original_string": "private ... | {
"body": "public int getParameterCount()\n {\n return expressions.size();\n }",
"class_method_signature": "UrlPatternParser.getParameterCount()",
"constructor": false,
"full_signature": "public int getParameterCount()",
"identifier": "getParameterCount",
"invocations": [
"size"
],
"modifie... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_44 | {
"fields": [
{
"declarator": "filter",
"modifier": "private",
"original_string": "private ByteCodeAnnotationFilter filter;",
"type": "ByteCodeAnnotationFilter",
"var_name": "filter"
}
],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/config/annotation/ByteCodeAnnotatio... | {
"body": "@Test\n public void testClassWithLongValueInConstantPool() throws IOException\n {\n assertFalse( filter.accept(getByteCodeInputStream(ClassWithLongValueInConstantPool.class)) );\n }",
"class_method_signature": "ByteCodeAnnotationFilterTest.testClassWithLongValueInConstantPool()",
"constructo... | {
"fields": [
{
"declarator": "log = LogFactory.getLog(ByteCodeAnnotationFilter.class)",
"modifier": "private final static",
"original_string": "private final static Log log = LogFactory.getLog(ByteCodeAnnotationFilter.class);",
"type": "Log",
"var_name": "log"
},
{
"de... | {
"body": "@SuppressWarnings(\"unused\")\n public boolean accept(InputStream classFileStream) throws IOException\n {\n\n // open a DataInputStream\n DataInputStream in = new DataInputStream(classFileStream);\n\n // read magic and abort if it doesn't match\n int magic = in.readInt();\n if ... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_13 | {
"fields": [],
"file": "core/src/test/java/com/ocpsoft/pretty/faces/url/URLPatternParserTest.java",
"identifier": "URLPatternParserTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testGetMappedUrlWithList()\n {\n URLPatternParser parser = new URLPatternParser(\n \"/project/#{paramsBean.project}/#{paramsBean.iteration}/#{paramsBean.story}\");\n List<Object> params = new ArrayList<Object>();\n params.add(\"p1\");\n params.add(2... | {
"fields": [
{
"declarator": "EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX)",
"modifier": "private static final",
"original_string": "private static final Pattern EL_REGEX_PATTERN = Pattern.compile(Expressions.EL_REGEX);",
"type": "Pattern",
"var_name": "EL_REGEX_PATTERN"... | {
"body": "public URL getMappedURL(final Object... params)\n {\n URL result = null;\n if (params != null)\n {\n Object[] parameters = params;\n\n /*\n * Check to see if our parameters were provided as a single List\n */\n if ((params.length == 1) && (params[0... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1164965_52 | {
"fields": [
{
"declarator": "config = new PrettyConfig()",
"modifier": "private static",
"original_string": "private static PrettyConfig config = new PrettyConfig();",
"type": "PrettyConfig",
"var_name": "config"
},
{
"declarator": "mapping = new UrlMapping()",
... | {
"body": "@Test\n public void testGetMappingById()\n {\n UrlMapping mapping2 = config.getMappingById(\"testid\");\n assertEquals(mapping, mapping2);\n }",
"class_method_signature": "PrettyConfigTest.testGetMappingById()",
"constructor": false,
"full_signature": "@Test public void testGetMapping... | {
"fields": [
{
"declarator": "CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\"",
"modifier": "public static final",
"original_string": "public static final String CONFIG_REQUEST_KEY = \"pretty_CONFIG_REQUEST_KEY\";",
"type": "String",
"var_name": "CONFIG_REQUEST_KEY"
},
{
... | {
"body": "public UrlMapping getMappingById(String id)\n {\n if (id != null)\n {\n if (id.startsWith(PrettyContext.PRETTY_PREFIX))\n {\n id = id.substring(PrettyContext.PRETTY_PREFIX.length());\n }\n for (UrlMapping mapping : getMappings())\n {\n ... | {
"created": null,
"fork": null,
"fork_count": 23,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1164965,
"size": 2126,
"stargazer_count": 53,
"stars": null,
"updates": null,
"url": "https://github.com/ocpsoft/prettyfaces"
} |
1583138_15 | {
"fields": [],
"file": "commons-gdx-core/src/test/java/com/gemserk/commons/gdx/camera/MultipleVirtualViewportBuilderTest.java",
"identifier": "MultipleVirtualViewportBuilderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void shouldReturnVirtualViewportForNormalSize() {\n\t\tMultipleVirtualViewportBuilder multipleVirtualViewportBuilder = new MultipleVirtualViewportBuilder(800f, 480f, 854f, 600f);\n\t\tVirtualViewport virtualViewport = multipleVirtualViewportBuilder.getVirtualViewport(854f, 480f);\n\t\tasser... | {
"fields": [
{
"declarator": "minWidth",
"modifier": "private final",
"original_string": "private final float minWidth;",
"type": "float",
"var_name": "minWidth"
},
{
"declarator": "minHeight",
"modifier": "private final",
"original_string": "private final ... | {
"body": "public VirtualViewport getVirtualViewport(float width, float height) {\n\t\tif (width >= minWidth && width <= maxWidth && height >= minHeight && height <= maxHeight)\n\t\t\treturn new VirtualViewport(width, height, true);\n\n\t\tfloat aspect = width / height;\n\n\t\tfloat scaleForMinSize = minWidth / width... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1583138,
"size": 1472,
"stargazer_count": 69,
"stars": null,
"updates": null,
"url": "https://github.com/gemserk/commons-gdx"
} |
1583138_42 | {
"fields": [],
"file": "commons-gdx-core/src/test/java/com/gemserk/commons/gdx/games/SpatialUtilsTest.java",
"identifier": "SpatialUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void testConvertToAbsoluteSpatial() {\n\t\tSpatial parent = new SpatialImpl(20, 50, 1f, 1f, 0f);\n\t\tSpatial child = new SpatialImpl(-20f, -50f, 1f, 1f, 0f);\n\t\t\n\t\tSpatialUtils.convertToAbsolute(parent, child);\n\t\t\n\t\tassertThat(child.getX(), IsEqual.equalTo(0f));\n\t\tassertThat(... | {
"fields": [],
"file": "commons-gdx-core/src/main/java/com/gemserk/commons/gdx/games/SpatialUtils.java",
"identifier": "SpatialUtils",
"interfaces": "",
"methods": [
{
"class_method_signature": "SpatialUtils.convertToLocal(Spatial parent, Spatial child)",
"constructor": false,
"full_sig... | {
"body": "public static Spatial convertToAbsolute(Spatial parent, Spatial child) {\n\t\tfloat x = child.getX();\n\t\tfloat y = child.getY();\n\n\t\tfloat angle = child.getAngle();\n\n\t\tchild.setPosition(x + parent.getX(), y + parent.getY());\n\t\tchild.setAngle(angle + parent.getAngle());\n\n\t\treturn child;\n\t}... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1583138,
"size": 1472,
"stargazer_count": 69,
"stars": null,
"updates": null,
"url": "https://github.com/gemserk/commons-gdx"
} |
1583138_54 | {
"fields": [],
"file": "commons-gdx-core/src/test/java/com/gemserk/commons/svg/inkscape/SvgInkscapeUtilsTest.java",
"identifier": "SvgInkscapeUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void shouldParseScaleTransformWithTwoValues() {\n\t\tString transformAttribute = \" scale (2, -3) \";\n\n\t\tMatrix3f matrix = new Matrix3f();\n\t\tmatrix.setIdentity();\n\t\tSvgInkscapeUtils.parseTransformAttribute(transformAttribute, matrix);\n\n\t\tMatrix3f expectedMatrix = new Matri... | {
"fields": [
{
"declarator": "INKSCAPE = \"http://www.inkscape.org/namespaces/inkscape\"",
"modifier": "public static final",
"original_string": "public static final String INKSCAPE = \"http://www.inkscape.org/namespaces/inkscape\";",
"type": "String",
"var_name": "INKSCAPE"
},
... | {
"body": "public static Matrix3f parseTransformAttribute(String transformAttribute, Matrix3f m) {\n\t\treturn SvgTransformUtils.parseTransform(transformAttribute, m);\n\t}",
"class_method_signature": "SvgInkscapeUtils.parseTransformAttribute(String transformAttribute, Matrix3f m)",
"constructor": false,
"full_... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1583138,
"size": 1472,
"stargazer_count": 69,
"stars": null,
"updates": null,
"url": "https://github.com/gemserk/commons-gdx"
} |
1583138_4 | {
"fields": [
{
"declarator": "map",
"modifier": "private",
"original_string": "private RandomAccessMap<String, String> map;",
"type": "RandomAccessMap<String, String>",
"var_name": "map"
}
],
"file": "commons-gdx-core/src/test/java/com/gemserk/componentsengine/utils/RandomAc... | {
"body": "@Test\n\tpublic void aNewMapShouldBeEmpty(){\n\t\tAssert.assertTrue(map.isEmpty());\n\t}",
"class_method_signature": "RandomAccessMapTest.aNewMapShouldBeEmpty()",
"constructor": false,
"full_signature": "@Test public void aNewMapShouldBeEmpty()",
"identifier": "aNewMapShouldBeEmpty",
"invocations... | {
"fields": [
{
"declarator": "items",
"modifier": "",
"original_string": "ArrayList<V> items;",
"type": "ArrayList<V>",
"var_name": "items"
},
{
"declarator": "keys",
"modifier": "",
"original_string": "ArrayList<K> keys;",
"type": "ArrayList<K>",
... | {
"body": "@Override\n\tpublic boolean isEmpty() {\n\t\treturn items.isEmpty();\n\t}",
"class_method_signature": "RandomAccessMap.isEmpty()",
"constructor": false,
"full_signature": "@Override public boolean isEmpty()",
"identifier": "isEmpty",
"invocations": [
"isEmpty"
],
"modifiers": "@Override p... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1583138,
"size": 1472,
"stargazer_count": 69,
"stars": null,
"updates": null,
"url": "https://github.com/gemserk/commons-gdx"
} |
1583138_39 | {
"fields": [],
"file": "commons-gdx-core/src/test/java/com/gemserk/commons/gdx/graphics/ColorUtilsTest.java",
"identifier": "ColorUtilsTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test(expected=IllegalArgumentException.class)\n\tpublic void testConvertFromHexString() {\n\t\tColor color = new Color();\n\t\tcolor.set(0.2f, 0.3f, 0.4f, 0.5f);\n\t\tColorUtils.hexRGBToColor(color, \"akldfkla;shfkla;\");\n\t}",
"class_method_signature": "ColorUtilsTest.testConvertFromHexString()",
"c... | {
"fields": [
{
"declarator": "intToFloat = 1f / 256f",
"modifier": "private static final",
"original_string": "private static final float intToFloat = 1f / 256f;",
"type": "float",
"var_name": "intToFloat"
},
{
"declarator": "hexNotationPrefix = \"#\"",
"modifier... | {
"body": "public static Color hexRGBToColor(String hexColor) {\n\t\treturn hexRGBToColor(new Color(1f, 1f, 1f, 1f), hexColor);\n\t}",
"class_method_signature": "ColorUtils.hexRGBToColor(String hexColor)",
"constructor": false,
"full_signature": "public static Color hexRGBToColor(String hexColor)",
"identifie... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1583138,
"size": 1472,
"stargazer_count": 69,
"stars": null,
"updates": null,
"url": "https://github.com/gemserk/commons-gdx"
} |
1583138_19 | {
"fields": [],
"file": "commons-gdx-core/src/test/java/com/gemserk/commons/gdx/camera/MultipleVirtualViewportBuilderTest.java",
"identifier": "MultipleVirtualViewportBuilderTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n\tpublic void shouldReturnVirtualViewportViewportWithDoubleSizeTheMaxSize() {\n\t\tMultipleVirtualViewportBuilder multipleVirtualViewportBuilder = new MultipleVirtualViewportBuilder(800f, 480f, 854f, 600f);\n\t\tVirtualViewport virtualViewport = multipleVirtualViewportBuilder.getVirtualViewport(854f... | {
"fields": [
{
"declarator": "minWidth",
"modifier": "private final",
"original_string": "private final float minWidth;",
"type": "float",
"var_name": "minWidth"
},
{
"declarator": "minHeight",
"modifier": "private final",
"original_string": "private final ... | {
"body": "public VirtualViewport getVirtualViewport(float width, float height) {\n\t\tif (width >= minWidth && width <= maxWidth && height >= minHeight && height <= maxHeight)\n\t\t\treturn new VirtualViewport(width, height, true);\n\n\t\tfloat aspect = width / height;\n\n\t\tfloat scaleForMinSize = minWidth / width... | {
"created": null,
"fork": null,
"fork_count": 16,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 1583138,
"size": 1472,
"stargazer_count": 69,
"stars": null,
"updates": null,
"url": "https://github.com/gemserk/commons-gdx"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.