id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
60,000 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BetterCFGBuilder2.java | BetterCFGBuilder2.inlineAll | private CFG inlineAll() throws CFGBuilderException {
CFG result = new CFG();
Context rootContext = new Context(null, topLevelSubroutine, result);
rootContext.mapBlock(topLevelSubroutine.getEntry(), result.getEntry());
rootContext.mapBlock(topLevelSubroutine.getExit(), result.getExit());... | java | private CFG inlineAll() throws CFGBuilderException {
CFG result = new CFG();
Context rootContext = new Context(null, topLevelSubroutine, result);
rootContext.mapBlock(topLevelSubroutine.getEntry(), result.getEntry());
rootContext.mapBlock(topLevelSubroutine.getExit(), result.getExit());... | [
"private",
"CFG",
"inlineAll",
"(",
")",
"throws",
"CFGBuilderException",
"{",
"CFG",
"result",
"=",
"new",
"CFG",
"(",
")",
";",
"Context",
"rootContext",
"=",
"new",
"Context",
"(",
"null",
",",
"topLevelSubroutine",
",",
"result",
")",
";",
"rootContext",... | Inline all JSR subroutines into the top-level subroutine. This produces a
complete CFG for the entire method, in which all JSR subroutines are
inlined.
@return the CFG for the method | [
"Inline",
"all",
"JSR",
"subroutines",
"into",
"the",
"top",
"-",
"level",
"subroutine",
".",
"This",
"produces",
"a",
"complete",
"CFG",
"for",
"the",
"entire",
"method",
"in",
"which",
"all",
"JSR",
"subroutines",
"are",
"inlined",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BetterCFGBuilder2.java#L1098-L1111 |
60,001 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BetterCFGBuilder2.java | BetterCFGBuilder2.main | public static void main(String[] argv) throws Exception {
if (argv.length != 1) {
System.err.println("Usage: " + BetterCFGBuilder2.class.getName() + " <class file>");
System.exit(1);
}
String methodName = SystemProperties.getProperty("cfgbuilder.method");
JavaCl... | java | public static void main(String[] argv) throws Exception {
if (argv.length != 1) {
System.err.println("Usage: " + BetterCFGBuilder2.class.getName() + " <class file>");
System.exit(1);
}
String methodName = SystemProperties.getProperty("cfgbuilder.method");
JavaCl... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"argv",
")",
"throws",
"Exception",
"{",
"if",
"(",
"argv",
".",
"length",
"!=",
"1",
")",
"{",
"System",
".",
"err",
".",
"println",
"(",
"\"Usage: \"",
"+",
"BetterCFGBuilder2",
".",
"class... | Test driver. | [
"Test",
"driver",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/BetterCFGBuilder2.java#L1271-L1306 |
60,002 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/XFactory.java | XFactory.createXField | public static XField createXField(String className, Field field) {
String fieldName = field.getName();
String fieldSig = field.getSignature();
XField xfield = getExactXField(className, fieldName, fieldSig, field.isStatic());
assert xfield.isResolved() : "Could not exactly resolve " + xf... | java | public static XField createXField(String className, Field field) {
String fieldName = field.getName();
String fieldSig = field.getSignature();
XField xfield = getExactXField(className, fieldName, fieldSig, field.isStatic());
assert xfield.isResolved() : "Could not exactly resolve " + xf... | [
"public",
"static",
"XField",
"createXField",
"(",
"String",
"className",
",",
"Field",
"field",
")",
"{",
"String",
"fieldName",
"=",
"field",
".",
"getName",
"(",
")",
";",
"String",
"fieldSig",
"=",
"field",
".",
"getSignature",
"(",
")",
";",
"XField",... | Create an XField object from a BCEL Field.
@param className
the name of the Java class containing the field
@param field
the Field within the JavaClass
@return the created XField | [
"Create",
"an",
"XField",
"object",
"from",
"a",
"BCEL",
"Field",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/XFactory.java#L509-L516 |
60,003 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/XFactory.java | XFactory.createXMethod | public static XMethod createXMethod(InvokeInstruction invokeInstruction, ConstantPoolGen cpg) {
String className = invokeInstruction.getClassName(cpg);
String methodName = invokeInstruction.getName(cpg);
String methodSig = invokeInstruction.getSignature(cpg);
if (invokeInstruction instan... | java | public static XMethod createXMethod(InvokeInstruction invokeInstruction, ConstantPoolGen cpg) {
String className = invokeInstruction.getClassName(cpg);
String methodName = invokeInstruction.getName(cpg);
String methodSig = invokeInstruction.getSignature(cpg);
if (invokeInstruction instan... | [
"public",
"static",
"XMethod",
"createXMethod",
"(",
"InvokeInstruction",
"invokeInstruction",
",",
"ConstantPoolGen",
"cpg",
")",
"{",
"String",
"className",
"=",
"invokeInstruction",
".",
"getClassName",
"(",
"cpg",
")",
";",
"String",
"methodName",
"=",
"invokeIn... | Create an XMethod object from an InvokeInstruction.
@param invokeInstruction
the InvokeInstruction
@param cpg
ConstantPoolGen from the class containing the instruction
@return XMethod representing the method called by the InvokeInstruction | [
"Create",
"an",
"XMethod",
"object",
"from",
"an",
"InvokeInstruction",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/XFactory.java#L616-L631 |
60,004 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/XFactory.java | XFactory.createXMethod | public static XMethod createXMethod(PreorderVisitor visitor) {
JavaClass javaClass = visitor.getThisClass();
Method method = visitor.getMethod();
XMethod m = createXMethod(javaClass, method);
return m;
} | java | public static XMethod createXMethod(PreorderVisitor visitor) {
JavaClass javaClass = visitor.getThisClass();
Method method = visitor.getMethod();
XMethod m = createXMethod(javaClass, method);
return m;
} | [
"public",
"static",
"XMethod",
"createXMethod",
"(",
"PreorderVisitor",
"visitor",
")",
"{",
"JavaClass",
"javaClass",
"=",
"visitor",
".",
"getThisClass",
"(",
")",
";",
"Method",
"method",
"=",
"visitor",
".",
"getMethod",
"(",
")",
";",
"XMethod",
"m",
"=... | Create an XMethod object from the method currently being visited by the
given PreorderVisitor.
@param visitor
the PreorderVisitor
@return the XMethod representing the method currently being visited | [
"Create",
"an",
"XMethod",
"object",
"from",
"the",
"method",
"currently",
"being",
"visited",
"by",
"the",
"given",
"PreorderVisitor",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/XFactory.java#L641-L646 |
60,005 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/XFactory.java | XFactory.createXField | public static XField createXField(PreorderVisitor visitor) {
JavaClass javaClass = visitor.getThisClass();
Field field = visitor.getField();
XField f = createXField(javaClass, field);
return f;
} | java | public static XField createXField(PreorderVisitor visitor) {
JavaClass javaClass = visitor.getThisClass();
Field field = visitor.getField();
XField f = createXField(javaClass, field);
return f;
} | [
"public",
"static",
"XField",
"createXField",
"(",
"PreorderVisitor",
"visitor",
")",
"{",
"JavaClass",
"javaClass",
"=",
"visitor",
".",
"getThisClass",
"(",
")",
";",
"Field",
"field",
"=",
"visitor",
".",
"getField",
"(",
")",
";",
"XField",
"f",
"=",
"... | Create an XField object from the field currently being visited by the
given PreorderVisitor.
@param visitor
the PreorderVisitor
@return the XField representing the method currently being visited | [
"Create",
"an",
"XField",
"object",
"from",
"the",
"field",
"currently",
"being",
"visited",
"by",
"the",
"given",
"PreorderVisitor",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/XFactory.java#L656-L661 |
60,006 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/XFactory.java | XFactory.getXClass | public @CheckForNull
XClass getXClass(ClassDescriptor classDescriptor) {
try {
IAnalysisCache analysisCache = Global.getAnalysisCache();
return analysisCache.getClassAnalysis(XClass.class, classDescriptor);
} catch (CheckedAnalysisException e) {
return null;
... | java | public @CheckForNull
XClass getXClass(ClassDescriptor classDescriptor) {
try {
IAnalysisCache analysisCache = Global.getAnalysisCache();
return analysisCache.getClassAnalysis(XClass.class, classDescriptor);
} catch (CheckedAnalysisException e) {
return null;
... | [
"public",
"@",
"CheckForNull",
"XClass",
"getXClass",
"(",
"ClassDescriptor",
"classDescriptor",
")",
"{",
"try",
"{",
"IAnalysisCache",
"analysisCache",
"=",
"Global",
".",
"getAnalysisCache",
"(",
")",
";",
"return",
"analysisCache",
".",
"getClassAnalysis",
"(",
... | Get the XClass object providing information about the class named by the
given ClassDescriptor.
@param classDescriptor
a ClassDescriptor
@return an XClass object providing information about the class, or null
if the class cannot be found | [
"Get",
"the",
"XClass",
"object",
"providing",
"information",
"about",
"the",
"class",
"named",
"by",
"the",
"given",
"ClassDescriptor",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/XFactory.java#L684-L692 |
60,007 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/actions/FindBugsAction.java | FindBugsAction.work | protected void work(IWorkbenchPart part, final IResource resource, final List<WorkItem> resources) {
FindBugsJob runFindBugs = new StartedFromViewJob("Finding bugs in " + resource.getName() + "...", resource, resources, part);
runFindBugs.scheduleInteractive();
} | java | protected void work(IWorkbenchPart part, final IResource resource, final List<WorkItem> resources) {
FindBugsJob runFindBugs = new StartedFromViewJob("Finding bugs in " + resource.getName() + "...", resource, resources, part);
runFindBugs.scheduleInteractive();
} | [
"protected",
"void",
"work",
"(",
"IWorkbenchPart",
"part",
",",
"final",
"IResource",
"resource",
",",
"final",
"List",
"<",
"WorkItem",
">",
"resources",
")",
"{",
"FindBugsJob",
"runFindBugs",
"=",
"new",
"StartedFromViewJob",
"(",
"\"Finding bugs in \"",
"+",
... | Run a FindBugs analysis on the given resource, displaying a progress
monitor.
@param part
@param resources
The resource to run the analysis on. | [
"Run",
"a",
"FindBugs",
"analysis",
"on",
"the",
"given",
"resource",
"displaying",
"a",
"progress",
"monitor",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/actions/FindBugsAction.java#L167-L170 |
60,008 | spotbugs/spotbugs | spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/AbstractFindBugsTask.java | AbstractFindBugsTask.setClasspath | public void setClasspath(Path src) {
if (classpath == null) {
classpath = src;
} else {
classpath.append(src);
}
} | java | public void setClasspath(Path src) {
if (classpath == null) {
classpath = src;
} else {
classpath.append(src);
}
} | [
"public",
"void",
"setClasspath",
"(",
"Path",
"src",
")",
"{",
"if",
"(",
"classpath",
"==",
"null",
")",
"{",
"classpath",
"=",
"src",
";",
"}",
"else",
"{",
"classpath",
".",
"append",
"(",
"src",
")",
";",
"}",
"}"
] | Set the classpath to use.
@param src
classpath to use | [
"Set",
"the",
"classpath",
"to",
"use",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/AbstractFindBugsTask.java#L200-L206 |
60,009 | spotbugs/spotbugs | spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/AbstractFindBugsTask.java | AbstractFindBugsTask.setClasspathRef | public void setClasspathRef(Reference r) {
Path path = createClasspath();
path.setRefid(r);
path.toString(); // Evaluated for its side-effects (throwing a
// BuildException)
} | java | public void setClasspathRef(Reference r) {
Path path = createClasspath();
path.setRefid(r);
path.toString(); // Evaluated for its side-effects (throwing a
// BuildException)
} | [
"public",
"void",
"setClasspathRef",
"(",
"Reference",
"r",
")",
"{",
"Path",
"path",
"=",
"createClasspath",
"(",
")",
";",
"path",
".",
"setRefid",
"(",
"r",
")",
";",
"path",
".",
"toString",
"(",
")",
";",
"// Evaluated for its side-effects (throwing a",
... | Adds a reference to a classpath defined elsewhere.
@param r
reference to a classpath defined elsewhere | [
"Adds",
"a",
"reference",
"to",
"a",
"classpath",
"defined",
"elsewhere",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/AbstractFindBugsTask.java#L226-L231 |
60,010 | spotbugs/spotbugs | spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/AbstractFindBugsTask.java | AbstractFindBugsTask.checkParameters | protected void checkParameters() {
if (homeDir == null && classpath == null) {
throw new BuildException("either home attribute or " + "classpath attributes "
+ " must be defined for task <" + getTaskName() + "/>", getLocation());
}
if (pluginList != null) {
... | java | protected void checkParameters() {
if (homeDir == null && classpath == null) {
throw new BuildException("either home attribute or " + "classpath attributes "
+ " must be defined for task <" + getTaskName() + "/>", getLocation());
}
if (pluginList != null) {
... | [
"protected",
"void",
"checkParameters",
"(",
")",
"{",
"if",
"(",
"homeDir",
"==",
"null",
"&&",
"classpath",
"==",
"null",
")",
"{",
"throw",
"new",
"BuildException",
"(",
"\"either home attribute or \"",
"+",
"\"classpath attributes \"",
"+",
"\" must be defined f... | Check that all required attributes have been set. | [
"Check",
"that",
"all",
"required",
"attributes",
"have",
"been",
"set",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/AbstractFindBugsTask.java#L288-L310 |
60,011 | spotbugs/spotbugs | spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/AbstractFindBugsTask.java | AbstractFindBugsTask.execFindbugs | private void execFindbugs() throws BuildException {
System.out.println("Executing SpotBugs " + this.getClass().getSimpleName() + " from ant task");
createFindbugsEngine();
configureFindbugsEngine();
beforeExecuteJavaProcess();
if (getDebug()) {
log(getFindbugsEngin... | java | private void execFindbugs() throws BuildException {
System.out.println("Executing SpotBugs " + this.getClass().getSimpleName() + " from ant task");
createFindbugsEngine();
configureFindbugsEngine();
beforeExecuteJavaProcess();
if (getDebug()) {
log(getFindbugsEngin... | [
"private",
"void",
"execFindbugs",
"(",
")",
"throws",
"BuildException",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Executing SpotBugs \"",
"+",
"this",
".",
"getClass",
"(",
")",
".",
"getSimpleName",
"(",
")",
"+",
"\" from ant task\"",
")",
";",
"... | Create a new JVM to do the work.
@since Ant 1.5 | [
"Create",
"a",
"new",
"JVM",
"to",
"do",
"the",
"work",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs-ant/src/main/java/edu/umd/cs/findbugs/anttask/AbstractFindBugsTask.java#L400-L438 |
60,012 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs.java | FindBugs.configureTrainingDatabases | public static void configureTrainingDatabases(IFindBugsEngine findBugs) throws IOException {
if (findBugs.emitTrainingOutput()) {
String trainingOutputDir = findBugs.getTrainingOutputDir();
if (!new File(trainingOutputDir).isDirectory()) {
throw new IOException("Training... | java | public static void configureTrainingDatabases(IFindBugsEngine findBugs) throws IOException {
if (findBugs.emitTrainingOutput()) {
String trainingOutputDir = findBugs.getTrainingOutputDir();
if (!new File(trainingOutputDir).isDirectory()) {
throw new IOException("Training... | [
"public",
"static",
"void",
"configureTrainingDatabases",
"(",
"IFindBugsEngine",
"findBugs",
")",
"throws",
"IOException",
"{",
"if",
"(",
"findBugs",
".",
"emitTrainingOutput",
"(",
")",
")",
"{",
"String",
"trainingOutputDir",
"=",
"findBugs",
".",
"getTrainingOu... | Configure training databases.
@param findBugs
the IFindBugsEngine to configure
@throws IOException | [
"Configure",
"training",
"databases",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs.java#L218-L242 |
60,013 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs.java | FindBugs.isDetectorEnabled | public static boolean isDetectorEnabled(IFindBugsEngine findBugs, DetectorFactory factory, int rankThreshold) {
if (!findBugs.getUserPreferences().isDetectorEnabled(factory)) {
return false;
}
if (!factory.isEnabledForCurrentJRE()) {
return false;
}
// ... | java | public static boolean isDetectorEnabled(IFindBugsEngine findBugs, DetectorFactory factory, int rankThreshold) {
if (!findBugs.getUserPreferences().isDetectorEnabled(factory)) {
return false;
}
if (!factory.isEnabledForCurrentJRE()) {
return false;
}
// ... | [
"public",
"static",
"boolean",
"isDetectorEnabled",
"(",
"IFindBugsEngine",
"findBugs",
",",
"DetectorFactory",
"factory",
",",
"int",
"rankThreshold",
")",
"{",
"if",
"(",
"!",
"findBugs",
".",
"getUserPreferences",
"(",
")",
".",
"isDetectorEnabled",
"(",
"facto... | Determines whether or not given DetectorFactory should be enabled.
@param findBugs
the IFindBugsEngine
@param factory
the DetectorFactory
@param rankThreshold
TODO
@return true if the DetectorFactory should be enabled, false otherwise | [
"Determines",
"whether",
"or",
"not",
"given",
"DetectorFactory",
"should",
"be",
"enabled",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs.java#L255-L295 |
60,014 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs.java | FindBugs.handleBugCategories | public static Set<String> handleBugCategories(String categories) {
// Parse list of bug categories
Set<String> categorySet = new HashSet<>();
StringTokenizer tok = new StringTokenizer(categories, ",");
while (tok.hasMoreTokens()) {
categorySet.add(tok.nextToken());
}
... | java | public static Set<String> handleBugCategories(String categories) {
// Parse list of bug categories
Set<String> categorySet = new HashSet<>();
StringTokenizer tok = new StringTokenizer(categories, ",");
while (tok.hasMoreTokens()) {
categorySet.add(tok.nextToken());
}
... | [
"public",
"static",
"Set",
"<",
"String",
">",
"handleBugCategories",
"(",
"String",
"categories",
")",
"{",
"// Parse list of bug categories",
"Set",
"<",
"String",
">",
"categorySet",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"StringTokenizer",
"tok",
"=",
... | Process -bugCategories option.
@param categories
comma-separated list of bug categories
@return Set of categories to be used | [
"Process",
"-",
"bugCategories",
"option",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs.java#L305-L314 |
60,015 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs.java | FindBugs.processCommandLine | public static void processCommandLine(TextUICommandLine commandLine, String[] argv, IFindBugsEngine findBugs)
throws IOException, FilterException {
// Expand option files in command line.
// An argument beginning with "@" is treated as specifying
// the name of an option file.
... | java | public static void processCommandLine(TextUICommandLine commandLine, String[] argv, IFindBugsEngine findBugs)
throws IOException, FilterException {
// Expand option files in command line.
// An argument beginning with "@" is treated as specifying
// the name of an option file.
... | [
"public",
"static",
"void",
"processCommandLine",
"(",
"TextUICommandLine",
"commandLine",
",",
"String",
"[",
"]",
"argv",
",",
"IFindBugsEngine",
"findBugs",
")",
"throws",
"IOException",
",",
"FilterException",
"{",
"// Expand option files in command line.",
"// An arg... | Process the command line.
@param commandLine
the TextUICommandLine object which will parse the command line
@param argv
the command line arguments
@param findBugs
the IFindBugsEngine to configure
@throws IOException
@throws FilterException | [
"Process",
"the",
"command",
"line",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs.java#L328-L365 |
60,016 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs.java | FindBugs.showHelp | @SuppressFBWarnings("DM_EXIT")
public static void showHelp(TextUICommandLine commandLine) {
showSynopsis();
ShowHelp.showGeneralOptions();
FindBugs.showCommandLineOptions(commandLine);
System.exit(1);
} | java | @SuppressFBWarnings("DM_EXIT")
public static void showHelp(TextUICommandLine commandLine) {
showSynopsis();
ShowHelp.showGeneralOptions();
FindBugs.showCommandLineOptions(commandLine);
System.exit(1);
} | [
"@",
"SuppressFBWarnings",
"(",
"\"DM_EXIT\"",
")",
"public",
"static",
"void",
"showHelp",
"(",
"TextUICommandLine",
"commandLine",
")",
"{",
"showSynopsis",
"(",
")",
";",
"ShowHelp",
".",
"showGeneralOptions",
"(",
")",
";",
"FindBugs",
".",
"showCommandLineOpt... | Show -help message.
@param commandLine | [
"Show",
"-",
"help",
"message",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs.java#L372-L378 |
60,017 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs.java | FindBugs.runMain | @SuppressFBWarnings("DM_EXIT")
public static void runMain(IFindBugsEngine findBugs, TextUICommandLine commandLine) throws IOException {
boolean verbose = !commandLine.quiet();
try {
findBugs.execute();
} catch (InterruptedException e) {
assert false; // should not oc... | java | @SuppressFBWarnings("DM_EXIT")
public static void runMain(IFindBugsEngine findBugs, TextUICommandLine commandLine) throws IOException {
boolean verbose = !commandLine.quiet();
try {
findBugs.execute();
} catch (InterruptedException e) {
assert false; // should not oc... | [
"@",
"SuppressFBWarnings",
"(",
"\"DM_EXIT\"",
")",
"public",
"static",
"void",
"runMain",
"(",
"IFindBugsEngine",
"findBugs",
",",
"TextUICommandLine",
"commandLine",
")",
"throws",
"IOException",
"{",
"boolean",
"verbose",
"=",
"!",
"commandLine",
".",
"quiet",
... | Given a fully-configured IFindBugsEngine and the TextUICommandLine used
to configure it, execute the analysis.
@param findBugs
a fully-configured IFindBugsEngine
@param commandLine
the TextUICommandLine used to configure the IFindBugsEngine | [
"Given",
"a",
"fully",
"-",
"configured",
"IFindBugsEngine",
"and",
"the",
"TextUICommandLine",
"used",
"to",
"configure",
"it",
"execute",
"the",
"analysis",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs.java#L389-L433 |
60,018 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs.java | FindBugs.configureBaselineFilter | public static BugReporter configureBaselineFilter(BugReporter bugReporter, String baselineFileName) throws IOException,
DocumentException {
return new ExcludingHashesBugReporter(bugReporter, baselineFileName);
} | java | public static BugReporter configureBaselineFilter(BugReporter bugReporter, String baselineFileName) throws IOException,
DocumentException {
return new ExcludingHashesBugReporter(bugReporter, baselineFileName);
} | [
"public",
"static",
"BugReporter",
"configureBaselineFilter",
"(",
"BugReporter",
"bugReporter",
",",
"String",
"baselineFileName",
")",
"throws",
"IOException",
",",
"DocumentException",
"{",
"return",
"new",
"ExcludingHashesBugReporter",
"(",
"bugReporter",
",",
"baseli... | Configure a baseline bug instance filter.
@param bugReporter
a DelegatingBugReporter
@param baselineFileName
filename of baseline Filter
@throws java.io.IOException
@throws org.dom4j.DocumentException | [
"Configure",
"a",
"baseline",
"bug",
"instance",
"filter",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs.java#L500-L503 |
60,019 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AbstractFrameModelingVisitor.java | AbstractFrameModelingVisitor.analyzeInstruction | public void analyzeInstruction(Instruction ins) throws DataflowAnalysisException {
if (frame.isValid()) {
try {
ins.accept(this);
} catch (InvalidBytecodeException e) {
String message = "Invalid bytecode: could not analyze instr. " + ins + " at frame " + f... | java | public void analyzeInstruction(Instruction ins) throws DataflowAnalysisException {
if (frame.isValid()) {
try {
ins.accept(this);
} catch (InvalidBytecodeException e) {
String message = "Invalid bytecode: could not analyze instr. " + ins + " at frame " + f... | [
"public",
"void",
"analyzeInstruction",
"(",
"Instruction",
"ins",
")",
"throws",
"DataflowAnalysisException",
"{",
"if",
"(",
"frame",
".",
"isValid",
"(",
")",
")",
"{",
"try",
"{",
"ins",
".",
"accept",
"(",
"this",
")",
";",
"}",
"catch",
"(",
"Inval... | Analyze the given Instruction.
@param ins
the Instruction
@throws DataflowAnalysisException
if an error occurs analyzing the instruction; in most cases,
this indicates that the bytecode for the method being
analyzed is invalid | [
"Analyze",
"the",
"given",
"Instruction",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AbstractFrameModelingVisitor.java#L81-L90 |
60,020 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AbstractFrameModelingVisitor.java | AbstractFrameModelingVisitor.getNumWordsConsumed | public int getNumWordsConsumed(Instruction ins) {
int numWordsConsumed = ins.consumeStack(cpg);
if (numWordsConsumed == Const.UNPREDICTABLE) {
throw new InvalidBytecodeException("Unpredictable stack consumption");
}
return numWordsConsumed;
} | java | public int getNumWordsConsumed(Instruction ins) {
int numWordsConsumed = ins.consumeStack(cpg);
if (numWordsConsumed == Const.UNPREDICTABLE) {
throw new InvalidBytecodeException("Unpredictable stack consumption");
}
return numWordsConsumed;
} | [
"public",
"int",
"getNumWordsConsumed",
"(",
"Instruction",
"ins",
")",
"{",
"int",
"numWordsConsumed",
"=",
"ins",
".",
"consumeStack",
"(",
"cpg",
")",
";",
"if",
"(",
"numWordsConsumed",
"==",
"Const",
".",
"UNPREDICTABLE",
")",
"{",
"throw",
"new",
"Inva... | Get the number of words consumed by given instruction. | [
"Get",
"the",
"number",
"of",
"words",
"consumed",
"by",
"given",
"instruction",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AbstractFrameModelingVisitor.java#L140-L146 |
60,021 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AbstractFrameModelingVisitor.java | AbstractFrameModelingVisitor.getNumWordsProduced | public int getNumWordsProduced(Instruction ins) {
int numWordsProduced = ins.produceStack(cpg);
if (numWordsProduced == Const.UNPREDICTABLE) {
throw new InvalidBytecodeException("Unpredictable stack productions");
}
return numWordsProduced;
} | java | public int getNumWordsProduced(Instruction ins) {
int numWordsProduced = ins.produceStack(cpg);
if (numWordsProduced == Const.UNPREDICTABLE) {
throw new InvalidBytecodeException("Unpredictable stack productions");
}
return numWordsProduced;
} | [
"public",
"int",
"getNumWordsProduced",
"(",
"Instruction",
"ins",
")",
"{",
"int",
"numWordsProduced",
"=",
"ins",
".",
"produceStack",
"(",
"cpg",
")",
";",
"if",
"(",
"numWordsProduced",
"==",
"Const",
".",
"UNPREDICTABLE",
")",
"{",
"throw",
"new",
"Inva... | Get the number of words produced by given instruction. | [
"Get",
"the",
"number",
"of",
"words",
"produced",
"by",
"given",
"instruction",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AbstractFrameModelingVisitor.java#L151-L158 |
60,022 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AbstractFrameModelingVisitor.java | AbstractFrameModelingVisitor.visitConversionInstruction | @Override
public final void visitConversionInstruction(ConversionInstruction obj) {
visitConversionInstruction2(obj);
if (obj instanceof NULL2Z) {
visitNULL2Z((NULL2Z) obj);
} else if (obj instanceof NONNULL2Z) {
visitNONNULL2Z((NONNULL2Z) obj);
}
} | java | @Override
public final void visitConversionInstruction(ConversionInstruction obj) {
visitConversionInstruction2(obj);
if (obj instanceof NULL2Z) {
visitNULL2Z((NULL2Z) obj);
} else if (obj instanceof NONNULL2Z) {
visitNONNULL2Z((NONNULL2Z) obj);
}
} | [
"@",
"Override",
"public",
"final",
"void",
"visitConversionInstruction",
"(",
"ConversionInstruction",
"obj",
")",
"{",
"visitConversionInstruction2",
"(",
"obj",
")",
";",
"if",
"(",
"obj",
"instanceof",
"NULL2Z",
")",
"{",
"visitNULL2Z",
"(",
"(",
"NULL2Z",
"... | To allow for calls to visitNULL2Z and visitNONNULL2Z, this method is made final.
If you want to override it, override visitConversionInstruction2 instead. | [
"To",
"allow",
"for",
"calls",
"to",
"visitNULL2Z",
"and",
"visitNONNULL2Z",
"this",
"method",
"is",
"made",
"final",
".",
"If",
"you",
"want",
"to",
"override",
"it",
"override",
"visitConversionInstruction2",
"instead",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AbstractFrameModelingVisitor.java#L202-L210 |
60,023 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AbstractFrameModelingVisitor.java | AbstractFrameModelingVisitor.handleStoreInstruction | public void handleStoreInstruction(StoreInstruction obj) {
try {
int numConsumed = obj.consumeStack(cpg);
if (numConsumed == Const.UNPREDICTABLE) {
throw new InvalidBytecodeException("Unpredictable stack consumption");
}
int index = obj.getIndex()... | java | public void handleStoreInstruction(StoreInstruction obj) {
try {
int numConsumed = obj.consumeStack(cpg);
if (numConsumed == Const.UNPREDICTABLE) {
throw new InvalidBytecodeException("Unpredictable stack consumption");
}
int index = obj.getIndex()... | [
"public",
"void",
"handleStoreInstruction",
"(",
"StoreInstruction",
"obj",
")",
"{",
"try",
"{",
"int",
"numConsumed",
"=",
"obj",
".",
"consumeStack",
"(",
"cpg",
")",
";",
"if",
"(",
"numConsumed",
"==",
"Const",
".",
"UNPREDICTABLE",
")",
"{",
"throw",
... | Handler for all instructions which pop values from the stack and store
them in a local variable. Note that two locals are stored into for long
and double stores. | [
"Handler",
"for",
"all",
"instructions",
"which",
"pop",
"values",
"from",
"the",
"stack",
"and",
"store",
"them",
"in",
"a",
"local",
"variable",
".",
"Note",
"that",
"two",
"locals",
"are",
"stored",
"into",
"for",
"long",
"and",
"double",
"stores",
"."
... | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AbstractFrameModelingVisitor.java#L311-L329 |
60,024 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AbstractFrameModelingVisitor.java | AbstractFrameModelingVisitor.modelInstruction | public void modelInstruction(Instruction ins, int numWordsConsumed, int numWordsProduced, Value pushValue) {
if (frame.getStackDepth() < numWordsConsumed) {
try {
throw new IllegalArgumentException(" asked to pop " + numWordsConsumed + " stack elements but only "
... | java | public void modelInstruction(Instruction ins, int numWordsConsumed, int numWordsProduced, Value pushValue) {
if (frame.getStackDepth() < numWordsConsumed) {
try {
throw new IllegalArgumentException(" asked to pop " + numWordsConsumed + " stack elements but only "
... | [
"public",
"void",
"modelInstruction",
"(",
"Instruction",
"ins",
",",
"int",
"numWordsConsumed",
",",
"int",
"numWordsProduced",
",",
"Value",
"pushValue",
")",
"{",
"if",
"(",
"frame",
".",
"getStackDepth",
"(",
")",
"<",
"numWordsConsumed",
")",
"{",
"try",
... | Primitive to model the stack effect of a single instruction, explicitly
specifying the value to be pushed on the stack.
@param ins
the Instruction to model
@param numWordsConsumed
number of stack words consumed
@param numWordsProduced
number of stack words produced
@param pushValue
value to push on the stack | [
"Primitive",
"to",
"model",
"the",
"stack",
"effect",
"of",
"a",
"single",
"instruction",
"explicitly",
"specifying",
"the",
"value",
"to",
"be",
"pushed",
"on",
"the",
"stack",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AbstractFrameModelingVisitor.java#L390-L411 |
60,025 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java | ClassPathBuilder.locateCodebasesRequiredForAnalysis | private void locateCodebasesRequiredForAnalysis(IClassPath classPath, IClassPathBuilderProgress progress)
throws InterruptedException, IOException, ResourceNotFoundException {
boolean foundJavaLangObject = false;
boolean foundFindBugsAnnotations = false;
boolean foundJSR305Annotation... | java | private void locateCodebasesRequiredForAnalysis(IClassPath classPath, IClassPathBuilderProgress progress)
throws InterruptedException, IOException, ResourceNotFoundException {
boolean foundJavaLangObject = false;
boolean foundFindBugsAnnotations = false;
boolean foundJSR305Annotation... | [
"private",
"void",
"locateCodebasesRequiredForAnalysis",
"(",
"IClassPath",
"classPath",
",",
"IClassPathBuilderProgress",
"progress",
")",
"throws",
"InterruptedException",
",",
"IOException",
",",
"ResourceNotFoundException",
"{",
"boolean",
"foundJavaLangObject",
"=",
"fal... | Make an effort to find the codebases containing any files required for
analysis. | [
"Make",
"an",
"effort",
"to",
"find",
"the",
"codebases",
"containing",
"any",
"files",
"required",
"for",
"analysis",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java#L292-L334 |
60,026 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java | ClassPathBuilder.probeCodeBaseForResource | private boolean probeCodeBaseForResource(DiscoveredCodeBase discoveredCodeBase, String resourceName) {
ICodeBaseEntry resource = discoveredCodeBase.getCodeBase().lookupResource(resourceName);
return resource != null;
} | java | private boolean probeCodeBaseForResource(DiscoveredCodeBase discoveredCodeBase, String resourceName) {
ICodeBaseEntry resource = discoveredCodeBase.getCodeBase().lookupResource(resourceName);
return resource != null;
} | [
"private",
"boolean",
"probeCodeBaseForResource",
"(",
"DiscoveredCodeBase",
"discoveredCodeBase",
",",
"String",
"resourceName",
")",
"{",
"ICodeBaseEntry",
"resource",
"=",
"discoveredCodeBase",
".",
"getCodeBase",
"(",
")",
".",
"lookupResource",
"(",
"resourceName",
... | Probe a codebase to see if a given source exists in that code base.
@param resourceName
name of a resource
@return true if the resource exists in the codebase, false if not | [
"Probe",
"a",
"codebase",
"to",
"see",
"if",
"a",
"given",
"source",
"exists",
"in",
"that",
"code",
"base",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java#L366-L369 |
60,027 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java | ClassPathBuilder.addWorkListItemsForClasspath | private void addWorkListItemsForClasspath(LinkedList<WorkListItem> workList, String path) {
if (path == null) {
return;
}
StringTokenizer st = new StringTokenizer(path, File.pathSeparator);
while (st.hasMoreTokens()) {
String entry = st.nextToken();
i... | java | private void addWorkListItemsForClasspath(LinkedList<WorkListItem> workList, String path) {
if (path == null) {
return;
}
StringTokenizer st = new StringTokenizer(path, File.pathSeparator);
while (st.hasMoreTokens()) {
String entry = st.nextToken();
i... | [
"private",
"void",
"addWorkListItemsForClasspath",
"(",
"LinkedList",
"<",
"WorkListItem",
">",
"workList",
",",
"String",
"path",
")",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"{",
"return",
";",
"}",
"StringTokenizer",
"st",
"=",
"new",
"StringTokenizer",
... | Add worklist items from given system classpath.
@param workList
the worklist
@param path
a system classpath | [
"Add",
"worklist",
"items",
"from",
"given",
"system",
"classpath",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java#L519-L533 |
60,028 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java | ClassPathBuilder.addWorkListItemsForExtDir | private void addWorkListItemsForExtDir(LinkedList<WorkListItem> workList, String extDir) {
File dir = new File(extDir);
File[] fileList = dir.listFiles((FileFilter) pathname -> {
String path = pathname.getPath();
boolean isArchive = Archive.isArchiveFileName(path);
re... | java | private void addWorkListItemsForExtDir(LinkedList<WorkListItem> workList, String extDir) {
File dir = new File(extDir);
File[] fileList = dir.listFiles((FileFilter) pathname -> {
String path = pathname.getPath();
boolean isArchive = Archive.isArchiveFileName(path);
re... | [
"private",
"void",
"addWorkListItemsForExtDir",
"(",
"LinkedList",
"<",
"WorkListItem",
">",
"workList",
",",
"String",
"extDir",
")",
"{",
"File",
"dir",
"=",
"new",
"File",
"(",
"extDir",
")",
";",
"File",
"[",
"]",
"fileList",
"=",
"dir",
".",
"listFile... | Add worklist items from given extensions directory.
@param workList
the worklist
@param extDir
an extensions directory | [
"Add",
"worklist",
"items",
"from",
"given",
"extensions",
"directory",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java#L543-L558 |
60,029 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java | ClassPathBuilder.parseClassName | private void parseClassName(ICodeBaseEntry entry) {
DataInputStream in = null;
try {
InputStream resourceIn = entry.openResource();
if (resourceIn == null) {
throw new NullPointerException("Got null resource");
}
in = new DataInputStream(re... | java | private void parseClassName(ICodeBaseEntry entry) {
DataInputStream in = null;
try {
InputStream resourceIn = entry.openResource();
if (resourceIn == null) {
throw new NullPointerException("Got null resource");
}
in = new DataInputStream(re... | [
"private",
"void",
"parseClassName",
"(",
"ICodeBaseEntry",
"entry",
")",
"{",
"DataInputStream",
"in",
"=",
"null",
";",
"try",
"{",
"InputStream",
"resourceIn",
"=",
"entry",
".",
"openResource",
"(",
")",
";",
"if",
"(",
"resourceIn",
"==",
"null",
")",
... | Attempt to parse data of given resource in order to divine the real name
of the class contained in the resource.
@param entry
the resource | [
"Attempt",
"to",
"parse",
"data",
"of",
"given",
"resource",
"in",
"order",
"to",
"divine",
"the",
"real",
"name",
"of",
"the",
"class",
"contained",
"in",
"the",
"resource",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java#L723-L746 |
60,030 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java | ClassPathBuilder.scanJarManifestForClassPathEntries | private void scanJarManifestForClassPathEntries(LinkedList<WorkListItem> workList, ICodeBase codeBase) throws IOException {
// See if this codebase has a jar manifest
ICodeBaseEntry manifestEntry = codeBase.lookupResource("META-INF/MANIFEST.MF");
if (manifestEntry == null) {
// Do no... | java | private void scanJarManifestForClassPathEntries(LinkedList<WorkListItem> workList, ICodeBase codeBase) throws IOException {
// See if this codebase has a jar manifest
ICodeBaseEntry manifestEntry = codeBase.lookupResource("META-INF/MANIFEST.MF");
if (manifestEntry == null) {
// Do no... | [
"private",
"void",
"scanJarManifestForClassPathEntries",
"(",
"LinkedList",
"<",
"WorkListItem",
">",
"workList",
",",
"ICodeBase",
"codeBase",
")",
"throws",
"IOException",
"{",
"// See if this codebase has a jar manifest",
"ICodeBaseEntry",
"manifestEntry",
"=",
"codeBase",... | Check a codebase for a Jar manifest to examine for Class-Path entries.
@param workList
the worklist
@param codeBase
the codebase for examine for a Jar manifest
@throws IOException | [
"Check",
"a",
"codebase",
"for",
"a",
"Jar",
"manifest",
"to",
"examine",
"for",
"Class",
"-",
"Path",
"entries",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java#L757-L792 |
60,031 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ResourceCollection.java | ResourceCollection.addCreatedResource | public void addCreatedResource(Location location, Resource resource) {
resourceList.add(resource);
locationToResourceMap.put(location, resource);
} | java | public void addCreatedResource(Location location, Resource resource) {
resourceList.add(resource);
locationToResourceMap.put(location, resource);
} | [
"public",
"void",
"addCreatedResource",
"(",
"Location",
"location",
",",
"Resource",
"resource",
")",
"{",
"resourceList",
".",
"add",
"(",
"resource",
")",
";",
"locationToResourceMap",
".",
"put",
"(",
"location",
",",
"resource",
")",
";",
"}"
] | Add a resource created within the analyzed method.
@param location
the location
@param resource
the resource created at that location | [
"Add",
"a",
"resource",
"created",
"within",
"the",
"analyzed",
"method",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ResourceCollection.java#L77-L80 |
60,032 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/properties/DetectorConfigurationTab.java | DetectorConfigurationTab.syncUserPreferencesWithTable | protected void syncUserPreferencesWithTable() {
TableItem[] itemList = availableFactoriesTableViewer.getTable().getItems();
UserPreferences currentProps = getCurrentProps();
for (int i = 0; i < itemList.length; i++) {
DetectorFactory factory = (DetectorFactory) itemList[i].getData();... | java | protected void syncUserPreferencesWithTable() {
TableItem[] itemList = availableFactoriesTableViewer.getTable().getItems();
UserPreferences currentProps = getCurrentProps();
for (int i = 0; i < itemList.length; i++) {
DetectorFactory factory = (DetectorFactory) itemList[i].getData();... | [
"protected",
"void",
"syncUserPreferencesWithTable",
"(",
")",
"{",
"TableItem",
"[",
"]",
"itemList",
"=",
"availableFactoriesTableViewer",
".",
"getTable",
"(",
")",
".",
"getItems",
"(",
")",
";",
"UserPreferences",
"currentProps",
"=",
"getCurrentProps",
"(",
... | Disables all unchecked detector factories and enables checked factory
detectors, leaving those not in the table unmodified. | [
"Disables",
"all",
"unchecked",
"detector",
"factories",
"and",
"enables",
"checked",
"factory",
"detectors",
"leaving",
"those",
"not",
"in",
"the",
"table",
"unmodified",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/properties/DetectorConfigurationTab.java#L513-L521 |
60,033 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/properties/DetectorConfigurationTab.java | DetectorConfigurationTab.createDetectorsTableViewer | private Table createDetectorsTableViewer(Composite parent, IProject project) {
final BugPatternTableSorter sorter = new BugPatternTableSorter(this);
int tableStyle = SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION | SWT.CHECK;
availableFactoriesTableViewer = CheckboxT... | java | private Table createDetectorsTableViewer(Composite parent, IProject project) {
final BugPatternTableSorter sorter = new BugPatternTableSorter(this);
int tableStyle = SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION | SWT.CHECK;
availableFactoriesTableViewer = CheckboxT... | [
"private",
"Table",
"createDetectorsTableViewer",
"(",
"Composite",
"parent",
",",
"IProject",
"project",
")",
"{",
"final",
"BugPatternTableSorter",
"sorter",
"=",
"new",
"BugPatternTableSorter",
"(",
"this",
")",
";",
"int",
"tableStyle",
"=",
"SWT",
".",
"BORDE... | Build rule table viewer | [
"Build",
"rule",
"table",
"viewer"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/properties/DetectorConfigurationTab.java#L550-L606 |
60,034 | spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/properties/DetectorConfigurationTab.java | DetectorConfigurationTab.populateAvailableRulesTable | private void populateAvailableRulesTable(IProject project) {
List<DetectorFactory> allAvailableList = new ArrayList<>();
factoriesToBugAbbrev = new HashMap<>();
Iterator<DetectorFactory> iterator = DetectorFactoryCollection.instance().factoryIterator();
while (iterator.hasNext()) {
... | java | private void populateAvailableRulesTable(IProject project) {
List<DetectorFactory> allAvailableList = new ArrayList<>();
factoriesToBugAbbrev = new HashMap<>();
Iterator<DetectorFactory> iterator = DetectorFactoryCollection.instance().factoryIterator();
while (iterator.hasNext()) {
... | [
"private",
"void",
"populateAvailableRulesTable",
"(",
"IProject",
"project",
")",
"{",
"List",
"<",
"DetectorFactory",
">",
"allAvailableList",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"factoriesToBugAbbrev",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"... | Populate the rule table | [
"Populate",
"the",
"rule",
"table"
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/properties/DetectorConfigurationTab.java#L643-L669 |
60,035 | spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/ReturnPathType.java | ReturnPathType.mergeWith | public void mergeWith(ReturnPathType fact) {
if (fact.isTop()) {
// other fact is top: no change to this one
return;
} else if (this.isTop()) {
// this fact is top: copy other fact
this.copyFrom(fact);
} else {
// neither fact is top: a... | java | public void mergeWith(ReturnPathType fact) {
if (fact.isTop()) {
// other fact is top: no change to this one
return;
} else if (this.isTop()) {
// this fact is top: copy other fact
this.copyFrom(fact);
} else {
// neither fact is top: a... | [
"public",
"void",
"mergeWith",
"(",
"ReturnPathType",
"fact",
")",
"{",
"if",
"(",
"fact",
".",
"isTop",
"(",
")",
")",
"{",
"// other fact is top: no change to this one",
"return",
";",
"}",
"else",
"if",
"(",
"this",
".",
"isTop",
"(",
")",
")",
"{",
"... | Merge this fact with given fact.
@param fact
another dataflow fact | [
"Merge",
"this",
"fact",
"with",
"given",
"fact",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/npe/ReturnPathType.java#L103-L118 |
60,036 | spotbugs/spotbugs | spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/OSXAdapter.java | OSXAdapter.handleAbout | @Override
public void handleAbout(ApplicationEvent ae) {
if (mainApp != null) {
ae.setHandled(true);
// We need to invoke modal About Dialog asynchronously
// otherwise the Application queue is locked for the duration
// of the about Dialog, which results in a... | java | @Override
public void handleAbout(ApplicationEvent ae) {
if (mainApp != null) {
ae.setHandled(true);
// We need to invoke modal About Dialog asynchronously
// otherwise the Application queue is locked for the duration
// of the about Dialog, which results in a... | [
"@",
"Override",
"public",
"void",
"handleAbout",
"(",
"ApplicationEvent",
"ae",
")",
"{",
"if",
"(",
"mainApp",
"!=",
"null",
")",
"{",
"ae",
".",
"setHandled",
"(",
"true",
")",
";",
"// We need to invoke modal About Dialog asynchronously",
"// otherwise the Appli... | over from another platform. | [
"over",
"from",
"another",
"platform",
"."
] | f6365c6eea6515035bded38efa4a7c8b46ccf28c | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/OSXAdapter.java#L50-L63 |
60,037 | Polidea/RxAndroidBle | rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/connection/LoggingIllegalOperationHandler.java | LoggingIllegalOperationHandler.handleMismatchData | @Override
public BleIllegalOperationException handleMismatchData(BluetoothGattCharacteristic characteristic, int neededProperties) {
RxBleLog.w(messageCreator.createMismatchMessage(characteristic, neededProperties));
return null;
} | java | @Override
public BleIllegalOperationException handleMismatchData(BluetoothGattCharacteristic characteristic, int neededProperties) {
RxBleLog.w(messageCreator.createMismatchMessage(characteristic, neededProperties));
return null;
} | [
"@",
"Override",
"public",
"BleIllegalOperationException",
"handleMismatchData",
"(",
"BluetoothGattCharacteristic",
"characteristic",
",",
"int",
"neededProperties",
")",
"{",
"RxBleLog",
".",
"w",
"(",
"messageCreator",
".",
"createMismatchMessage",
"(",
"characteristic",... | This method logs a warning.
@param characteristic the characteristic upon which the operation was requested
@param neededProperties bitmask of properties needed by the operation | [
"This",
"method",
"logs",
"a",
"warning",
"."
] | c6e4a9753c834d710e255306bb290e9244cdbc10 | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/connection/LoggingIllegalOperationHandler.java#L26-L30 |
60,038 | Polidea/RxAndroidBle | sample/src/main/java/com/polidea/rxandroidble2/sample/SampleApplication.java | SampleApplication.getRxBleClient | public static RxBleClient getRxBleClient(Context context) {
SampleApplication application = (SampleApplication) context.getApplicationContext();
return application.rxBleClient;
} | java | public static RxBleClient getRxBleClient(Context context) {
SampleApplication application = (SampleApplication) context.getApplicationContext();
return application.rxBleClient;
} | [
"public",
"static",
"RxBleClient",
"getRxBleClient",
"(",
"Context",
"context",
")",
"{",
"SampleApplication",
"application",
"=",
"(",
"SampleApplication",
")",
"context",
".",
"getApplicationContext",
"(",
")",
";",
"return",
"application",
".",
"rxBleClient",
";"... | In practise you will use some kind of dependency injection pattern. | [
"In",
"practise",
"you",
"will",
"use",
"some",
"kind",
"of",
"dependency",
"injection",
"pattern",
"."
] | c6e4a9753c834d710e255306bb290e9244cdbc10 | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/sample/src/main/java/com/polidea/rxandroidble2/sample/SampleApplication.java#L21-L24 |
60,039 | Polidea/RxAndroidBle | rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/connection/IllegalOperationChecker.java | IllegalOperationChecker.checkAnyPropertyMatches | public Completable checkAnyPropertyMatches(final BluetoothGattCharacteristic characteristic,
final @BluetoothGattCharacteristicProperty int neededProperties) {
return Completable.fromAction(new Action() {
public void run() {
final int ch... | java | public Completable checkAnyPropertyMatches(final BluetoothGattCharacteristic characteristic,
final @BluetoothGattCharacteristicProperty int neededProperties) {
return Completable.fromAction(new Action() {
public void run() {
final int ch... | [
"public",
"Completable",
"checkAnyPropertyMatches",
"(",
"final",
"BluetoothGattCharacteristic",
"characteristic",
",",
"final",
"@",
"BluetoothGattCharacteristicProperty",
"int",
"neededProperties",
")",
"{",
"return",
"Completable",
".",
"fromAction",
"(",
"new",
"Action"... | This method checks whether the supplied characteristic possesses properties supporting the requested kind of operation, specified by
the supplied bitmask.
Emits {@link BleIllegalOperationException} if there was no match between supported and necessary properties of characteristic and
check has not been suppressed
@pa... | [
"This",
"method",
"checks",
"whether",
"the",
"supplied",
"characteristic",
"possesses",
"properties",
"supporting",
"the",
"requested",
"kind",
"of",
"operation",
"specified",
"by",
"the",
"supplied",
"bitmask",
"."
] | c6e4a9753c834d710e255306bb290e9244cdbc10 | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/connection/IllegalOperationChecker.java#L36-L50 |
60,040 | Polidea/RxAndroidBle | sample/src/main/java/com/polidea/rxandroidble2/sample/util/ScanExceptionHandler.java | ScanExceptionHandler.handleException | public static void handleException(final Activity context, final BleScanException exception) {
final String text;
final int reason = exception.getReason();
// Special case, as there might or might not be a retry date suggestion
if (reason == BleScanException.UNDOCUMENTED_SCAN_THROTTLE) ... | java | public static void handleException(final Activity context, final BleScanException exception) {
final String text;
final int reason = exception.getReason();
// Special case, as there might or might not be a retry date suggestion
if (reason == BleScanException.UNDOCUMENTED_SCAN_THROTTLE) ... | [
"public",
"static",
"void",
"handleException",
"(",
"final",
"Activity",
"context",
",",
"final",
"BleScanException",
"exception",
")",
"{",
"final",
"String",
"text",
";",
"final",
"int",
"reason",
"=",
"exception",
".",
"getReason",
"(",
")",
";",
"// Specia... | Show toast with error message appropriate to exception reason.
@param context current Activity context
@param exception BleScanException to show error message for | [
"Show",
"toast",
"with",
"error",
"message",
"appropriate",
"to",
"exception",
"reason",
"."
] | c6e4a9753c834d710e255306bb290e9244cdbc10 | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/sample/src/main/java/com/polidea/rxandroidble2/sample/util/ScanExceptionHandler.java#L63-L84 |
60,041 | Polidea/RxAndroidBle | rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/operations/ConnectOperation.java | ConnectOperation.getConnectedBluetoothGatt | @NonNull
private Single<BluetoothGatt> getConnectedBluetoothGatt() {
// start connecting the BluetoothGatt
// note: Due to different Android BLE stack implementations it is not certain whether `connectGatt()` or `BluetoothGattCallback`
// will emit BluetoothGatt first
return Single.c... | java | @NonNull
private Single<BluetoothGatt> getConnectedBluetoothGatt() {
// start connecting the BluetoothGatt
// note: Due to different Android BLE stack implementations it is not certain whether `connectGatt()` or `BluetoothGattCallback`
// will emit BluetoothGatt first
return Single.c... | [
"@",
"NonNull",
"private",
"Single",
"<",
"BluetoothGatt",
">",
"getConnectedBluetoothGatt",
"(",
")",
"{",
"// start connecting the BluetoothGatt",
"// note: Due to different Android BLE stack implementations it is not certain whether `connectGatt()` or `BluetoothGattCallback`",
"// will ... | Emits BluetoothGatt and completes after connection is established.
@return BluetoothGatt after connection reaches {@link com.polidea.rxandroidble2.RxBleConnection.RxBleConnectionState#CONNECTED}
state.
@throws com.polidea.rxandroidble2.exceptions.BleDisconnectedException if connection was disconnected/failed before
it... | [
"Emits",
"BluetoothGatt",
"and",
"completes",
"after",
"connection",
"is",
"established",
"."
] | c6e4a9753c834d710e255306bb290e9244cdbc10 | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/operations/ConnectOperation.java#L120-L165 |
60,042 | Polidea/RxAndroidBle | rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/scan/ScanSettingsEmulator.java | ScanSettingsEmulator.repeatedWindowTransformer | private ObservableTransformer<RxBleInternalScanResult, RxBleInternalScanResult> repeatedWindowTransformer(
@IntRange(from = 0, to = 4999) final int windowInMillis
) {
final long repeatCycleTimeInMillis = TimeUnit.SECONDS.toMillis(5);
final long delayToNextWindow = Math.max(repeatCycleTim... | java | private ObservableTransformer<RxBleInternalScanResult, RxBleInternalScanResult> repeatedWindowTransformer(
@IntRange(from = 0, to = 4999) final int windowInMillis
) {
final long repeatCycleTimeInMillis = TimeUnit.SECONDS.toMillis(5);
final long delayToNextWindow = Math.max(repeatCycleTim... | [
"private",
"ObservableTransformer",
"<",
"RxBleInternalScanResult",
",",
"RxBleInternalScanResult",
">",
"repeatedWindowTransformer",
"(",
"@",
"IntRange",
"(",
"from",
"=",
"0",
",",
"to",
"=",
"4999",
")",
"final",
"int",
"windowInMillis",
")",
"{",
"final",
"lo... | A convenience method for running a scan for a period of time and repeat in five seconds intervals.
@param windowInMillis window for which the observable should be active
@return Observable.Transformer that will take the original observable for specific time and repeat subscription after 5 seconds | [
"A",
"convenience",
"method",
"for",
"running",
"a",
"scan",
"for",
"a",
"period",
"of",
"time",
"and",
"repeat",
"in",
"five",
"seconds",
"intervals",
"."
] | c6e4a9753c834d710e255306bb290e9244cdbc10 | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/scan/ScanSettingsEmulator.java#L104-L122 |
60,043 | Polidea/RxAndroidBle | rxandroidble/src/main/java/com/polidea/rxandroidble2/scan/ScanFilter.java | ScanFilter.matchesServiceUuids | private boolean matchesServiceUuids(ParcelUuid uuid, ParcelUuid parcelUuidMask,
List<ParcelUuid> uuids) {
if (uuid == null) {
return true;
}
if (uuids == null) {
return false;
}
for (ParcelUuid parcelUuid : uuids) {... | java | private boolean matchesServiceUuids(ParcelUuid uuid, ParcelUuid parcelUuidMask,
List<ParcelUuid> uuids) {
if (uuid == null) {
return true;
}
if (uuids == null) {
return false;
}
for (ParcelUuid parcelUuid : uuids) {... | [
"private",
"boolean",
"matchesServiceUuids",
"(",
"ParcelUuid",
"uuid",
",",
"ParcelUuid",
"parcelUuidMask",
",",
"List",
"<",
"ParcelUuid",
">",
"uuids",
")",
"{",
"if",
"(",
"uuid",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"uuids",
... | Check if the uuid pattern is contained in a list of parcel uuids. | [
"Check",
"if",
"the",
"uuid",
"pattern",
"is",
"contained",
"in",
"a",
"list",
"of",
"parcel",
"uuids",
"."
] | c6e4a9753c834d710e255306bb290e9244cdbc10 | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/rxandroidble/src/main/java/com/polidea/rxandroidble2/scan/ScanFilter.java#L314-L330 |
60,044 | Polidea/RxAndroidBle | rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/util/CheckerLocationPermission.java | CheckerLocationPermission.isPermissionGranted | private boolean isPermissionGranted(String permission) {
if (permission == null) {
throw new IllegalArgumentException("permission is null");
}
return context.checkPermission(permission, android.os.Process.myPid(), Process.myUid()) == PackageManager.PERMISSION_GRANTED;
} | java | private boolean isPermissionGranted(String permission) {
if (permission == null) {
throw new IllegalArgumentException("permission is null");
}
return context.checkPermission(permission, android.os.Process.myPid(), Process.myUid()) == PackageManager.PERMISSION_GRANTED;
} | [
"private",
"boolean",
"isPermissionGranted",
"(",
"String",
"permission",
")",
"{",
"if",
"(",
"permission",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"permission is null\"",
")",
";",
"}",
"return",
"context",
".",
"checkPermissio... | Copied from android.support.v4.content.ContextCompat for backwards compatibility
@param permission the permission to check
@return true is granted | [
"Copied",
"from",
"android",
".",
"support",
".",
"v4",
".",
"content",
".",
"ContextCompat",
"for",
"backwards",
"compatibility"
] | c6e4a9753c834d710e255306bb290e9244cdbc10 | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/util/CheckerLocationPermission.java#L30-L36 |
60,045 | Polidea/RxAndroidBle | rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/util/UUIDUtil.java | UUIDUtil.parseServiceUuid | private static int parseServiceUuid(byte[] scanRecord, int currentPos, int dataLength,
int uuidLength, List<ParcelUuid> serviceUuids) {
while (dataLength > 0) {
byte[] uuidBytes = extractBytes(scanRecord, currentPos,
uuidLength);
... | java | private static int parseServiceUuid(byte[] scanRecord, int currentPos, int dataLength,
int uuidLength, List<ParcelUuid> serviceUuids) {
while (dataLength > 0) {
byte[] uuidBytes = extractBytes(scanRecord, currentPos,
uuidLength);
... | [
"private",
"static",
"int",
"parseServiceUuid",
"(",
"byte",
"[",
"]",
"scanRecord",
",",
"int",
"currentPos",
",",
"int",
"dataLength",
",",
"int",
"uuidLength",
",",
"List",
"<",
"ParcelUuid",
">",
"serviceUuids",
")",
"{",
"while",
"(",
"dataLength",
">",... | Parse service UUIDs. | [
"Parse",
"service",
"UUIDs",
"."
] | c6e4a9753c834d710e255306bb290e9244cdbc10 | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/util/UUIDUtil.java#L248-L258 |
60,046 | Polidea/RxAndroidBle | rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/util/UUIDUtil.java | UUIDUtil.extractBytes | private static byte[] extractBytes(byte[] scanRecord, int start, int length) {
byte[] bytes = new byte[length];
System.arraycopy(scanRecord, start, bytes, 0, length);
return bytes;
} | java | private static byte[] extractBytes(byte[] scanRecord, int start, int length) {
byte[] bytes = new byte[length];
System.arraycopy(scanRecord, start, bytes, 0, length);
return bytes;
} | [
"private",
"static",
"byte",
"[",
"]",
"extractBytes",
"(",
"byte",
"[",
"]",
"scanRecord",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"new",
"byte",
"[",
"length",
"]",
";",
"System",
".",
"arraycopy",
"(",
... | Helper method to extract bytes from byte array. | [
"Helper",
"method",
"to",
"extract",
"bytes",
"from",
"byte",
"array",
"."
] | c6e4a9753c834d710e255306bb290e9244cdbc10 | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/util/UUIDUtil.java#L261-L265 |
60,047 | Polidea/RxAndroidBle | rxandroidble/src/main/java/com/polidea/rxandroidble2/helpers/ValueInterpreter.java | ValueInterpreter.unsignedBytesToInt | private static int unsignedBytesToInt(byte b0, byte b1, byte b2, byte b3) {
return (unsignedByteToInt(b0) + (unsignedByteToInt(b1) << 8))
+ (unsignedByteToInt(b2) << 16) + (unsignedByteToInt(b3) << 24);
} | java | private static int unsignedBytesToInt(byte b0, byte b1, byte b2, byte b3) {
return (unsignedByteToInt(b0) + (unsignedByteToInt(b1) << 8))
+ (unsignedByteToInt(b2) << 16) + (unsignedByteToInt(b3) << 24);
} | [
"private",
"static",
"int",
"unsignedBytesToInt",
"(",
"byte",
"b0",
",",
"byte",
"b1",
",",
"byte",
"b2",
",",
"byte",
"b3",
")",
"{",
"return",
"(",
"unsignedByteToInt",
"(",
"b0",
")",
"+",
"(",
"unsignedByteToInt",
"(",
"b1",
")",
"<<",
"8",
")",
... | Convert signed bytes to a 32-bit unsigned int. | [
"Convert",
"signed",
"bytes",
"to",
"a",
"32",
"-",
"bit",
"unsigned",
"int",
"."
] | c6e4a9753c834d710e255306bb290e9244cdbc10 | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/rxandroidble/src/main/java/com/polidea/rxandroidble2/helpers/ValueInterpreter.java#L199-L202 |
60,048 | Polidea/RxAndroidBle | rxandroidble/src/main/java/com/polidea/rxandroidble2/helpers/ValueInterpreter.java | ValueInterpreter.bytesToFloat | private static float bytesToFloat(byte b0, byte b1) {
int mantissa = unsignedToSigned(unsignedByteToInt(b0)
+ ((unsignedByteToInt(b1) & 0x0F) << 8), 12);
int exponent = unsignedToSigned(unsignedByteToInt(b1) >> 4, 4);
return (float) (mantissa * Math.pow(10, exponent));
} | java | private static float bytesToFloat(byte b0, byte b1) {
int mantissa = unsignedToSigned(unsignedByteToInt(b0)
+ ((unsignedByteToInt(b1) & 0x0F) << 8), 12);
int exponent = unsignedToSigned(unsignedByteToInt(b1) >> 4, 4);
return (float) (mantissa * Math.pow(10, exponent));
} | [
"private",
"static",
"float",
"bytesToFloat",
"(",
"byte",
"b0",
",",
"byte",
"b1",
")",
"{",
"int",
"mantissa",
"=",
"unsignedToSigned",
"(",
"unsignedByteToInt",
"(",
"b0",
")",
"+",
"(",
"(",
"unsignedByteToInt",
"(",
"b1",
")",
"&",
"0x0F",
")",
"<<"... | Convert signed bytes to a 16-bit short float value. | [
"Convert",
"signed",
"bytes",
"to",
"a",
"16",
"-",
"bit",
"short",
"float",
"value",
"."
] | c6e4a9753c834d710e255306bb290e9244cdbc10 | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/rxandroidble/src/main/java/com/polidea/rxandroidble2/helpers/ValueInterpreter.java#L207-L212 |
60,049 | Polidea/RxAndroidBle | rxandroidble/src/main/java/com/polidea/rxandroidble2/helpers/ValueInterpreter.java | ValueInterpreter.bytesToFloat | private static float bytesToFloat(byte b0, byte b1, byte b2, byte b3) {
int mantissa = unsignedToSigned(unsignedByteToInt(b0)
+ (unsignedByteToInt(b1) << 8)
+ (unsignedByteToInt(b2) << 16), 24);
return (float) (mantissa * Math.pow(10, b3));
} | java | private static float bytesToFloat(byte b0, byte b1, byte b2, byte b3) {
int mantissa = unsignedToSigned(unsignedByteToInt(b0)
+ (unsignedByteToInt(b1) << 8)
+ (unsignedByteToInt(b2) << 16), 24);
return (float) (mantissa * Math.pow(10, b3));
} | [
"private",
"static",
"float",
"bytesToFloat",
"(",
"byte",
"b0",
",",
"byte",
"b1",
",",
"byte",
"b2",
",",
"byte",
"b3",
")",
"{",
"int",
"mantissa",
"=",
"unsignedToSigned",
"(",
"unsignedByteToInt",
"(",
"b0",
")",
"+",
"(",
"unsignedByteToInt",
"(",
... | Convert signed bytes to a 32-bit short float value. | [
"Convert",
"signed",
"bytes",
"to",
"a",
"32",
"-",
"bit",
"short",
"float",
"value",
"."
] | c6e4a9753c834d710e255306bb290e9244cdbc10 | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/rxandroidble/src/main/java/com/polidea/rxandroidble2/helpers/ValueInterpreter.java#L217-L222 |
60,050 | Polidea/RxAndroidBle | rxandroidble/src/main/java/com/polidea/rxandroidble2/helpers/ValueInterpreter.java | ValueInterpreter.unsignedToSigned | private static int unsignedToSigned(int unsigned, int size) {
if ((unsigned & (1 << size - 1)) != 0) {
unsigned = -1 * ((1 << size - 1) - (unsigned & ((1 << size - 1) - 1)));
}
return unsigned;
} | java | private static int unsignedToSigned(int unsigned, int size) {
if ((unsigned & (1 << size - 1)) != 0) {
unsigned = -1 * ((1 << size - 1) - (unsigned & ((1 << size - 1) - 1)));
}
return unsigned;
} | [
"private",
"static",
"int",
"unsignedToSigned",
"(",
"int",
"unsigned",
",",
"int",
"size",
")",
"{",
"if",
"(",
"(",
"unsigned",
"&",
"(",
"1",
"<<",
"size",
"-",
"1",
")",
")",
"!=",
"0",
")",
"{",
"unsigned",
"=",
"-",
"1",
"*",
"(",
"(",
"1... | Convert an unsigned integer value to a two's-complement encoded
signed value. | [
"Convert",
"an",
"unsigned",
"integer",
"value",
"to",
"a",
"two",
"s",
"-",
"complement",
"encoded",
"signed",
"value",
"."
] | c6e4a9753c834d710e255306bb290e9244cdbc10 | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/rxandroidble/src/main/java/com/polidea/rxandroidble2/helpers/ValueInterpreter.java#L228-L233 |
60,051 | Polidea/RxAndroidBle | sample/src/main/java/com/polidea/rxandroidble2/sample/example4_characteristic/advanced/Presenter.java | Presenter.repeatAfterCompleted | @NonNull
private static <T> ObservableTransformer<T, T> repeatAfterCompleted() {
return observable -> observable.repeatWhen(completedNotification -> completedNotification);
} | java | @NonNull
private static <T> ObservableTransformer<T, T> repeatAfterCompleted() {
return observable -> observable.repeatWhen(completedNotification -> completedNotification);
} | [
"@",
"NonNull",
"private",
"static",
"<",
"T",
">",
"ObservableTransformer",
"<",
"T",
",",
"T",
">",
"repeatAfterCompleted",
"(",
")",
"{",
"return",
"observable",
"->",
"observable",
".",
"repeatWhen",
"(",
"completedNotification",
"->",
"completedNotification",... | A convenience function creating a transformer that will repeat the source observable whenever it will complete
@param <T> the type of the transformed observable
@return transformer that will emit observable that will never complete (source will be subscribed again) | [
"A",
"convenience",
"function",
"creating",
"a",
"transformer",
"that",
"will",
"repeat",
"the",
"source",
"observable",
"whenever",
"it",
"will",
"complete"
] | c6e4a9753c834d710e255306bb290e9244cdbc10 | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/sample/src/main/java/com/polidea/rxandroidble2/sample/example4_characteristic/advanced/Presenter.java#L261-L264 |
60,052 | Polidea/RxAndroidBle | rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/RxBleLog.java | RxBleLog.updateLogOptions | public static void updateLogOptions(LogOptions logOptions) {
LoggerSetup oldLoggerSetup = RxBleLog.loggerSetup;
LoggerSetup newLoggerSetup = oldLoggerSetup.merge(logOptions);
d("Received new options (%s) and merged with old setup: %s. New setup: %s", logOptions, oldLoggerSetup, newLoggerSetup);
... | java | public static void updateLogOptions(LogOptions logOptions) {
LoggerSetup oldLoggerSetup = RxBleLog.loggerSetup;
LoggerSetup newLoggerSetup = oldLoggerSetup.merge(logOptions);
d("Received new options (%s) and merged with old setup: %s. New setup: %s", logOptions, oldLoggerSetup, newLoggerSetup);
... | [
"public",
"static",
"void",
"updateLogOptions",
"(",
"LogOptions",
"logOptions",
")",
"{",
"LoggerSetup",
"oldLoggerSetup",
"=",
"RxBleLog",
".",
"loggerSetup",
";",
"LoggerSetup",
"newLoggerSetup",
"=",
"oldLoggerSetup",
".",
"merge",
"(",
"logOptions",
")",
";",
... | Method to update current logger setup with new LogOptions. Only set options will be updated. Options that were not set or set to null
on the LogOptions will not update the current setup leaving the previous values untouched.
@param logOptions the new log options | [
"Method",
"to",
"update",
"current",
"logger",
"setup",
"with",
"new",
"LogOptions",
".",
"Only",
"set",
"options",
"will",
"be",
"updated",
".",
"Options",
"that",
"were",
"not",
"set",
"or",
"set",
"to",
"null",
"on",
"the",
"LogOptions",
"will",
"not",
... | c6e4a9753c834d710e255306bb290e9244cdbc10 | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/RxBleLog.java#L130-L135 |
60,053 | Polidea/RxAndroidBle | sample/src/main/java/com/polidea/rxandroidble2/sample/example4_characteristic/CharacteristicOperationExampleActivity.java | CharacteristicOperationExampleActivity.updateUI | private void updateUI(BluetoothGattCharacteristic characteristic) {
connectButton.setText(characteristic != null ? R.string.disconnect : R.string.connect);
readButton.setEnabled(hasProperty(characteristic, BluetoothGattCharacteristic.PROPERTY_READ));
writeButton.setEnabled(hasProperty(characteri... | java | private void updateUI(BluetoothGattCharacteristic characteristic) {
connectButton.setText(characteristic != null ? R.string.disconnect : R.string.connect);
readButton.setEnabled(hasProperty(characteristic, BluetoothGattCharacteristic.PROPERTY_READ));
writeButton.setEnabled(hasProperty(characteri... | [
"private",
"void",
"updateUI",
"(",
"BluetoothGattCharacteristic",
"characteristic",
")",
"{",
"connectButton",
".",
"setText",
"(",
"characteristic",
"!=",
"null",
"?",
"R",
".",
"string",
".",
"disconnect",
":",
"R",
".",
"string",
".",
"connect",
")",
";",
... | This method updates the UI to a proper state.
@param characteristic a nullable {@link BluetoothGattCharacteristic}. If it is null then UI is assuming a disconnected state. | [
"This",
"method",
"updates",
"the",
"UI",
"to",
"a",
"proper",
"state",
"."
] | c6e4a9753c834d710e255306bb290e9244cdbc10 | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/sample/src/main/java/com/polidea/rxandroidble2/sample/example4_characteristic/CharacteristicOperationExampleActivity.java#L209-L214 |
60,054 | Polidea/RxAndroidBle | rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/util/ClientStateObservable.java | ClientStateObservable.checkPermissionUntilGranted | @NonNull
private static Single<Boolean> checkPermissionUntilGranted(
final LocationServicesStatus locationServicesStatus,
Scheduler timerScheduler
) {
return Observable.interval(0, 1L, TimeUnit.SECONDS, timerScheduler)
.takeWhile(new Predicate<Long>() {
... | java | @NonNull
private static Single<Boolean> checkPermissionUntilGranted(
final LocationServicesStatus locationServicesStatus,
Scheduler timerScheduler
) {
return Observable.interval(0, 1L, TimeUnit.SECONDS, timerScheduler)
.takeWhile(new Predicate<Long>() {
... | [
"@",
"NonNull",
"private",
"static",
"Single",
"<",
"Boolean",
">",
"checkPermissionUntilGranted",
"(",
"final",
"LocationServicesStatus",
"locationServicesStatus",
",",
"Scheduler",
"timerScheduler",
")",
"{",
"return",
"Observable",
".",
"interval",
"(",
"0",
",",
... | Observable that emits `true` if the permission was granted on the time of subscription
@param locationServicesStatus the LocationServicesStatus
@param timerScheduler the Scheduler
@return the observable | [
"Observable",
"that",
"emits",
"true",
"if",
"the",
"permission",
"was",
"granted",
"on",
"the",
"time",
"of",
"subscription"
] | c6e4a9753c834d710e255306bb290e9244cdbc10 | https://github.com/Polidea/RxAndroidBle/blob/c6e4a9753c834d710e255306bb290e9244cdbc10/rxandroidble/src/main/java/com/polidea/rxandroidble2/internal/util/ClientStateObservable.java#L59-L79 |
60,055 | chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyLayoutInflater.java | CalligraphyLayoutInflater.onCreateView | @Override
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
protected View onCreateView(View parent, String name, AttributeSet attrs) throws ClassNotFoundException {
return mCalligraphyFactory.onViewCreated(super.onCreateView(parent, name, attrs),
getContext(), attrs);
} | java | @Override
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
protected View onCreateView(View parent, String name, AttributeSet attrs) throws ClassNotFoundException {
return mCalligraphyFactory.onViewCreated(super.onCreateView(parent, name, attrs),
getContext(), attrs);
} | [
"@",
"Override",
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"HONEYCOMB",
")",
"protected",
"View",
"onCreateView",
"(",
"View",
"parent",
",",
"String",
"name",
",",
"AttributeSet",
"attrs",
")",
"throws",
"ClassNotFoundException",
"{",
"return",... | The LayoutInflater onCreateView is the fourth port of call for LayoutInflation.
BUT only for none CustomViews. | [
"The",
"LayoutInflater",
"onCreateView",
"is",
"the",
"fourth",
"port",
"of",
"call",
"for",
"LayoutInflation",
".",
"BUT",
"only",
"for",
"none",
"CustomViews",
"."
] | 085e441954d787bd4ef31f245afe5f2f2a311ea5 | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyLayoutInflater.java#L145-L150 |
60,056 | chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java | CalligraphyUtils.applyTypefaceSpan | public static CharSequence applyTypefaceSpan(CharSequence s, Typeface typeface) {
if (s != null && s.length() > 0) {
if (!(s instanceof Spannable)) {
s = new SpannableString(s);
}
((Spannable) s).setSpan(TypefaceUtils.getSpan(typeface), 0, s.length(), Spanned.... | java | public static CharSequence applyTypefaceSpan(CharSequence s, Typeface typeface) {
if (s != null && s.length() > 0) {
if (!(s instanceof Spannable)) {
s = new SpannableString(s);
}
((Spannable) s).setSpan(TypefaceUtils.getSpan(typeface), 0, s.length(), Spanned.... | [
"public",
"static",
"CharSequence",
"applyTypefaceSpan",
"(",
"CharSequence",
"s",
",",
"Typeface",
"typeface",
")",
"{",
"if",
"(",
"s",
"!=",
"null",
"&&",
"s",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"if",
"(",
"!",
"(",
"s",
"instanceof",
"S... | Applies a custom typeface span to the text.
@param s text to apply it too.
@param typeface typeface to apply.
@return Either the passed in Object or new Spannable with the typeface span applied. | [
"Applies",
"a",
"custom",
"typeface",
"span",
"to",
"the",
"text",
"."
] | 085e441954d787bd4ef31f245afe5f2f2a311ea5 | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java#L34-L42 |
60,057 | chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java | CalligraphyUtils.applyFontToTextView | public static boolean applyFontToTextView(final TextView textView, final Typeface typeface, boolean deferred) {
if (textView == null || typeface == null) return false;
textView.setPaintFlags(textView.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
textView.setTypeface(typefa... | java | public static boolean applyFontToTextView(final TextView textView, final Typeface typeface, boolean deferred) {
if (textView == null || typeface == null) return false;
textView.setPaintFlags(textView.getPaintFlags() | Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG);
textView.setTypeface(typefa... | [
"public",
"static",
"boolean",
"applyFontToTextView",
"(",
"final",
"TextView",
"textView",
",",
"final",
"Typeface",
"typeface",
",",
"boolean",
"deferred",
")",
"{",
"if",
"(",
"textView",
"==",
"null",
"||",
"typeface",
"==",
"null",
")",
"return",
"false",... | Applies a Typeface to a TextView, if deferred,its recommend you don't call this multiple
times, as this adds a TextWatcher.
Deferring should really only be used on tricky views which get Typeface set by the system at
weird times.
@param textView Not null, TextView or child of.
@param typeface Not null, Typeface to ap... | [
"Applies",
"a",
"Typeface",
"to",
"a",
"TextView",
"if",
"deferred",
"its",
"recommend",
"you",
"don",
"t",
"call",
"this",
"multiple",
"times",
"as",
"this",
"adds",
"a",
"TextWatcher",
"."
] | 085e441954d787bd4ef31f245afe5f2f2a311ea5 | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java#L74-L96 |
60,058 | chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java | CalligraphyUtils.pullFontPathFromView | static String pullFontPathFromView(Context context, AttributeSet attrs, int[] attributeId) {
if (attributeId == null || attrs == null)
return null;
final String attributeName;
try {
attributeName = context.getResources().getResourceEntryName(attributeId[0]);
} ca... | java | static String pullFontPathFromView(Context context, AttributeSet attrs, int[] attributeId) {
if (attributeId == null || attrs == null)
return null;
final String attributeName;
try {
attributeName = context.getResources().getResourceEntryName(attributeId[0]);
} ca... | [
"static",
"String",
"pullFontPathFromView",
"(",
"Context",
"context",
",",
"AttributeSet",
"attrs",
",",
"int",
"[",
"]",
"attributeId",
")",
"{",
"if",
"(",
"attributeId",
"==",
"null",
"||",
"attrs",
"==",
"null",
")",
"return",
"null",
";",
"final",
"S... | Tries to pull the Custom Attribute directly from the TextView.
@param context Activity Context
@param attrs View Attributes
@param attributeId if -1 returns null.
@return null if attribute is not defined or added to View | [
"Tries",
"to",
"pull",
"the",
"Custom",
"Attribute",
"directly",
"from",
"the",
"TextView",
"."
] | 085e441954d787bd4ef31f245afe5f2f2a311ea5 | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java#L157-L173 |
60,059 | chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java | CalligraphyUtils.pullFontPathFromStyle | static String pullFontPathFromStyle(Context context, AttributeSet attrs, int[] attributeId) {
if (attributeId == null || attrs == null)
return null;
final TypedArray typedArray = context.obtainStyledAttributes(attrs, attributeId);
if (typedArray != null) {
try {
... | java | static String pullFontPathFromStyle(Context context, AttributeSet attrs, int[] attributeId) {
if (attributeId == null || attrs == null)
return null;
final TypedArray typedArray = context.obtainStyledAttributes(attrs, attributeId);
if (typedArray != null) {
try {
... | [
"static",
"String",
"pullFontPathFromStyle",
"(",
"Context",
"context",
",",
"AttributeSet",
"attrs",
",",
"int",
"[",
"]",
"attributeId",
")",
"{",
"if",
"(",
"attributeId",
"==",
"null",
"||",
"attrs",
"==",
"null",
")",
"return",
"null",
";",
"final",
"... | Tries to pull the Font Path from the View Style as this is the next decendent after being
defined in the View's xml.
@param context Activity Activity Context
@param attrs View Attributes
@param attributeId if -1 returns null.
@return null if attribute is not defined or found in the Style | [
"Tries",
"to",
"pull",
"the",
"Font",
"Path",
"from",
"the",
"View",
"Style",
"as",
"this",
"is",
"the",
"next",
"decendent",
"after",
"being",
"defined",
"in",
"the",
"View",
"s",
"xml",
"."
] | 085e441954d787bd4ef31f245afe5f2f2a311ea5 | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java#L184-L202 |
60,060 | chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java | CalligraphyUtils.pullFontPathFromTextAppearance | static String pullFontPathFromTextAppearance(final Context context, AttributeSet attrs, int[] attributeId) {
if (attributeId == null || attrs == null) {
return null;
}
int textAppearanceId = -1;
final TypedArray typedArrayAttr = context.obtainStyledAttributes(attrs, ANDROID_... | java | static String pullFontPathFromTextAppearance(final Context context, AttributeSet attrs, int[] attributeId) {
if (attributeId == null || attrs == null) {
return null;
}
int textAppearanceId = -1;
final TypedArray typedArrayAttr = context.obtainStyledAttributes(attrs, ANDROID_... | [
"static",
"String",
"pullFontPathFromTextAppearance",
"(",
"final",
"Context",
"context",
",",
"AttributeSet",
"attrs",
",",
"int",
"[",
"]",
"attributeId",
")",
"{",
"if",
"(",
"attributeId",
"==",
"null",
"||",
"attrs",
"==",
"null",
")",
"{",
"return",
"n... | Tries to pull the Font Path from the Text Appearance.
@param context Activity Context
@param attrs View Attributes
@param attributeId if -1 returns null.
@return returns null if attribute is not defined or if no TextAppearance is found. | [
"Tries",
"to",
"pull",
"the",
"Font",
"Path",
"from",
"the",
"Text",
"Appearance",
"."
] | 085e441954d787bd4ef31f245afe5f2f2a311ea5 | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java#L212-L242 |
60,061 | chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java | CalligraphyUtils.canCheckForV7Toolbar | static boolean canCheckForV7Toolbar() {
if (sToolbarCheck == null) {
try {
Class.forName("android.support.v7.widget.Toolbar");
sToolbarCheck = Boolean.TRUE;
} catch (ClassNotFoundException e) {
sToolbarCheck = Boolean.FALSE;
}
... | java | static boolean canCheckForV7Toolbar() {
if (sToolbarCheck == null) {
try {
Class.forName("android.support.v7.widget.Toolbar");
sToolbarCheck = Boolean.TRUE;
} catch (ClassNotFoundException e) {
sToolbarCheck = Boolean.FALSE;
}
... | [
"static",
"boolean",
"canCheckForV7Toolbar",
"(",
")",
"{",
"if",
"(",
"sToolbarCheck",
"==",
"null",
")",
"{",
"try",
"{",
"Class",
".",
"forName",
"(",
"\"android.support.v7.widget.Toolbar\"",
")",
";",
"sToolbarCheck",
"=",
"Boolean",
".",
"TRUE",
";",
"}",... | See if the user has added appcompat-v7, this is done at runtime, so we only check once.
@return true if the v7.Toolbar is on the classpath | [
"See",
"if",
"the",
"user",
"has",
"added",
"appcompat",
"-",
"v7",
"this",
"is",
"done",
"at",
"runtime",
"so",
"we",
"only",
"check",
"once",
"."
] | 085e441954d787bd4ef31f245afe5f2f2a311ea5 | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java#L323-L333 |
60,062 | chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java | CalligraphyUtils.canAddV7AppCompatViews | static boolean canAddV7AppCompatViews() {
if (sAppCompatViewCheck == null) {
try {
Class.forName("android.support.v7.widget.AppCompatTextView");
sAppCompatViewCheck = Boolean.TRUE;
} catch (ClassNotFoundException e) {
sAppCompatViewCheck = ... | java | static boolean canAddV7AppCompatViews() {
if (sAppCompatViewCheck == null) {
try {
Class.forName("android.support.v7.widget.AppCompatTextView");
sAppCompatViewCheck = Boolean.TRUE;
} catch (ClassNotFoundException e) {
sAppCompatViewCheck = ... | [
"static",
"boolean",
"canAddV7AppCompatViews",
"(",
")",
"{",
"if",
"(",
"sAppCompatViewCheck",
"==",
"null",
")",
"{",
"try",
"{",
"Class",
".",
"forName",
"(",
"\"android.support.v7.widget.AppCompatTextView\"",
")",
";",
"sAppCompatViewCheck",
"=",
"Boolean",
".",... | See if the user has added appcompat-v7 with AppCompatViews
@return true if AppcompatTextView is on the classpath | [
"See",
"if",
"the",
"user",
"has",
"added",
"appcompat",
"-",
"v7",
"with",
"AppCompatViews"
] | 085e441954d787bd4ef31f245afe5f2f2a311ea5 | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyUtils.java#L340-L350 |
60,063 | chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyConfig.java | CalligraphyConfig.addAppCompatViews | private static void addAppCompatViews() {
DEFAULT_STYLES.put(android.support.v7.widget.AppCompatTextView.class, android.R.attr.textViewStyle);
DEFAULT_STYLES.put(android.support.v7.widget.AppCompatButton.class, android.R.attr.buttonStyle);
DEFAULT_STYLES.put(android.support.v7.widget.AppCompatEd... | java | private static void addAppCompatViews() {
DEFAULT_STYLES.put(android.support.v7.widget.AppCompatTextView.class, android.R.attr.textViewStyle);
DEFAULT_STYLES.put(android.support.v7.widget.AppCompatButton.class, android.R.attr.buttonStyle);
DEFAULT_STYLES.put(android.support.v7.widget.AppCompatEd... | [
"private",
"static",
"void",
"addAppCompatViews",
"(",
")",
"{",
"DEFAULT_STYLES",
".",
"put",
"(",
"android",
".",
"support",
".",
"v7",
".",
"widget",
".",
"AppCompatTextView",
".",
"class",
",",
"android",
".",
"R",
".",
"attr",
".",
"textViewStyle",
")... | AppCompat will inflate special versions of views for Material tinting etc,
this adds those classes to the style lookup map | [
"AppCompat",
"will",
"inflate",
"special",
"versions",
"of",
"views",
"for",
"Material",
"tinting",
"etc",
"this",
"adds",
"those",
"classes",
"to",
"the",
"style",
"lookup",
"map"
] | 085e441954d787bd4ef31f245afe5f2f2a311ea5 | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyConfig.java#L53-L62 |
60,064 | chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyContextWrapper.java | CalligraphyContextWrapper.get | static CalligraphyActivityFactory get(Activity activity) {
if (!(activity.getLayoutInflater() instanceof CalligraphyLayoutInflater)) {
throw new RuntimeException("This activity does not wrap the Base Context! See CalligraphyContextWrapper.wrap(Context)");
}
return (CalligraphyActivit... | java | static CalligraphyActivityFactory get(Activity activity) {
if (!(activity.getLayoutInflater() instanceof CalligraphyLayoutInflater)) {
throw new RuntimeException("This activity does not wrap the Base Context! See CalligraphyContextWrapper.wrap(Context)");
}
return (CalligraphyActivit... | [
"static",
"CalligraphyActivityFactory",
"get",
"(",
"Activity",
"activity",
")",
"{",
"if",
"(",
"!",
"(",
"activity",
".",
"getLayoutInflater",
"(",
")",
"instanceof",
"CalligraphyLayoutInflater",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"This ac... | Get the Calligraphy Activity Fragment Instance to allow callbacks for when views are created.
@param activity The activity the original that the ContextWrapper was attached too.
@return Interface allowing you to call onActivityViewCreated | [
"Get",
"the",
"Calligraphy",
"Activity",
"Fragment",
"Instance",
"to",
"allow",
"callbacks",
"for",
"when",
"views",
"are",
"created",
"."
] | 085e441954d787bd4ef31f245afe5f2f2a311ea5 | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyContextWrapper.java#L68-L73 |
60,065 | chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyFactory.java | CalligraphyFactory.getStyleForTextView | protected static int[] getStyleForTextView(TextView view) {
final int[] styleIds = new int[]{-1, -1};
// Try to find the specific actionbar styles
if (isActionBarTitle(view)) {
styleIds[0] = android.R.attr.actionBarStyle;
styleIds[1] = android.R.attr.titleTextStyle;
... | java | protected static int[] getStyleForTextView(TextView view) {
final int[] styleIds = new int[]{-1, -1};
// Try to find the specific actionbar styles
if (isActionBarTitle(view)) {
styleIds[0] = android.R.attr.actionBarStyle;
styleIds[1] = android.R.attr.titleTextStyle;
... | [
"protected",
"static",
"int",
"[",
"]",
"getStyleForTextView",
"(",
"TextView",
"view",
")",
"{",
"final",
"int",
"[",
"]",
"styleIds",
"=",
"new",
"int",
"[",
"]",
"{",
"-",
"1",
",",
"-",
"1",
"}",
";",
"// Try to find the specific actionbar styles",
"if... | Some styles are in sub styles, such as actionBarTextStyle etc..
@param view view to check.
@return 2 element array, default to -1 unless a style has been found. | [
"Some",
"styles",
"are",
"in",
"sub",
"styles",
"such",
"as",
"actionBarTextStyle",
"etc",
".."
] | 085e441954d787bd4ef31f245afe5f2f2a311ea5 | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyFactory.java#L25-L42 |
60,066 | chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyFactory.java | CalligraphyFactory.matchesResourceIdName | protected static boolean matchesResourceIdName(View view, String matches) {
if (view.getId() == View.NO_ID) return false;
final String resourceEntryName = view.getResources().getResourceEntryName(view.getId());
return resourceEntryName.equalsIgnoreCase(matches);
} | java | protected static boolean matchesResourceIdName(View view, String matches) {
if (view.getId() == View.NO_ID) return false;
final String resourceEntryName = view.getResources().getResourceEntryName(view.getId());
return resourceEntryName.equalsIgnoreCase(matches);
} | [
"protected",
"static",
"boolean",
"matchesResourceIdName",
"(",
"View",
"view",
",",
"String",
"matches",
")",
"{",
"if",
"(",
"view",
".",
"getId",
"(",
")",
"==",
"View",
".",
"NO_ID",
")",
"return",
"false",
";",
"final",
"String",
"resourceEntryName",
... | Use to match a view against a potential view id. Such as ActionBar title etc.
@param view not null view you want to see has resource matching name.
@param matches not null resource name to match against. Its not case sensitive.
@return true if matches false otherwise. | [
"Use",
"to",
"match",
"a",
"view",
"against",
"a",
"potential",
"view",
"id",
".",
"Such",
"as",
"ActionBar",
"title",
"etc",
"."
] | 085e441954d787bd4ef31f245afe5f2f2a311ea5 | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyFactory.java#L87-L91 |
60,067 | chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyFactory.java | CalligraphyFactory.onViewCreated | public View onViewCreated(View view, Context context, AttributeSet attrs) {
if (view != null && view.getTag(R.id.calligraphy_tag_id) != Boolean.TRUE) {
onViewCreatedInternal(view, context, attrs);
view.setTag(R.id.calligraphy_tag_id, Boolean.TRUE);
}
return view;
} | java | public View onViewCreated(View view, Context context, AttributeSet attrs) {
if (view != null && view.getTag(R.id.calligraphy_tag_id) != Boolean.TRUE) {
onViewCreatedInternal(view, context, attrs);
view.setTag(R.id.calligraphy_tag_id, Boolean.TRUE);
}
return view;
} | [
"public",
"View",
"onViewCreated",
"(",
"View",
"view",
",",
"Context",
"context",
",",
"AttributeSet",
"attrs",
")",
"{",
"if",
"(",
"view",
"!=",
"null",
"&&",
"view",
".",
"getTag",
"(",
"R",
".",
"id",
".",
"calligraphy_tag_id",
")",
"!=",
"Boolean",... | Handle the created view
@param view nullable.
@param context shouldn't be null.
@param attrs shouldn't be null.
@return null if null is passed in. | [
"Handle",
"the",
"created",
"view"
] | 085e441954d787bd4ef31f245afe5f2f2a311ea5 | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyFactory.java#L108-L114 |
60,068 | chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyFactory.java | CalligraphyFactory.resolveFontPath | private String resolveFontPath(Context context, AttributeSet attrs) {
// Try view xml attributes
String textViewFont = CalligraphyUtils.pullFontPathFromView(context, attrs, mAttributeId);
// Try view style attributes
if (TextUtils.isEmpty(textViewFont)) {
textViewFont = Call... | java | private String resolveFontPath(Context context, AttributeSet attrs) {
// Try view xml attributes
String textViewFont = CalligraphyUtils.pullFontPathFromView(context, attrs, mAttributeId);
// Try view style attributes
if (TextUtils.isEmpty(textViewFont)) {
textViewFont = Call... | [
"private",
"String",
"resolveFontPath",
"(",
"Context",
"context",
",",
"AttributeSet",
"attrs",
")",
"{",
"// Try view xml attributes",
"String",
"textViewFont",
"=",
"CalligraphyUtils",
".",
"pullFontPathFromView",
"(",
"context",
",",
"attrs",
",",
"mAttributeId",
... | Resolving font path from xml attrs, style attrs or text appearance | [
"Resolving",
"font",
"path",
"from",
"xml",
"attrs",
"style",
"attrs",
"or",
"text",
"appearance"
] | 085e441954d787bd4ef31f245afe5f2f2a311ea5 | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyFactory.java#L181-L196 |
60,069 | chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyFactory.java | CalligraphyFactory.applyFontToToolbar | private void applyFontToToolbar(final Toolbar view) {
final CharSequence previousTitle = view.getTitle();
final CharSequence previousSubtitle = view.getSubtitle();
// The toolbar inflates both the title and the subtitle views lazily but luckily they do it
// synchronously when you set a ... | java | private void applyFontToToolbar(final Toolbar view) {
final CharSequence previousTitle = view.getTitle();
final CharSequence previousSubtitle = view.getSubtitle();
// The toolbar inflates both the title and the subtitle views lazily but luckily they do it
// synchronously when you set a ... | [
"private",
"void",
"applyFontToToolbar",
"(",
"final",
"Toolbar",
"view",
")",
"{",
"final",
"CharSequence",
"previousTitle",
"=",
"view",
".",
"getTitle",
"(",
")",
";",
"final",
"CharSequence",
"previousSubtitle",
"=",
"view",
".",
"getSubtitle",
"(",
")",
"... | Will forcibly set text on the views then remove ones that didn't have copy.
@param view toolbar view. | [
"Will",
"forcibly",
"set",
"text",
"on",
"the",
"views",
"then",
"remove",
"ones",
"that",
"didn",
"t",
"have",
"copy",
"."
] | 085e441954d787bd4ef31f245afe5f2f2a311ea5 | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/CalligraphyFactory.java#L203-L220 |
60,070 | chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/TypefaceUtils.java | TypefaceUtils.load | public static Typeface load(final AssetManager assetManager, final String filePath) {
synchronized (sCachedFonts) {
try {
if (!sCachedFonts.containsKey(filePath)) {
final Typeface typeface = Typeface.createFromAsset(assetManager, filePath);
sCa... | java | public static Typeface load(final AssetManager assetManager, final String filePath) {
synchronized (sCachedFonts) {
try {
if (!sCachedFonts.containsKey(filePath)) {
final Typeface typeface = Typeface.createFromAsset(assetManager, filePath);
sCa... | [
"public",
"static",
"Typeface",
"load",
"(",
"final",
"AssetManager",
"assetManager",
",",
"final",
"String",
"filePath",
")",
"{",
"synchronized",
"(",
"sCachedFonts",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"sCachedFonts",
".",
"containsKey",
"(",
"filePath",
... | A helper loading a custom font.
@param assetManager App's asset manager.
@param filePath The path of the file.
@return Return {@link android.graphics.Typeface} or null if the path is invalid. | [
"A",
"helper",
"loading",
"a",
"custom",
"font",
"."
] | 085e441954d787bd4ef31f245afe5f2f2a311ea5 | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/TypefaceUtils.java#L31-L46 |
60,071 | chrisjenx/Calligraphy | calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/TypefaceUtils.java | TypefaceUtils.getSpan | public static CalligraphyTypefaceSpan getSpan(final Typeface typeface) {
if (typeface == null) return null;
synchronized (sCachedSpans) {
if (!sCachedSpans.containsKey(typeface)) {
final CalligraphyTypefaceSpan span = new CalligraphyTypefaceSpan(typeface);
sCa... | java | public static CalligraphyTypefaceSpan getSpan(final Typeface typeface) {
if (typeface == null) return null;
synchronized (sCachedSpans) {
if (!sCachedSpans.containsKey(typeface)) {
final CalligraphyTypefaceSpan span = new CalligraphyTypefaceSpan(typeface);
sCa... | [
"public",
"static",
"CalligraphyTypefaceSpan",
"getSpan",
"(",
"final",
"Typeface",
"typeface",
")",
"{",
"if",
"(",
"typeface",
"==",
"null",
")",
"return",
"null",
";",
"synchronized",
"(",
"sCachedSpans",
")",
"{",
"if",
"(",
"!",
"sCachedSpans",
".",
"co... | A helper loading custom spans so we don't have to keep creating hundreds of spans.
@param typeface not null typeface
@return will return null of typeface passed in is null. | [
"A",
"helper",
"loading",
"custom",
"spans",
"so",
"we",
"don",
"t",
"have",
"to",
"keep",
"creating",
"hundreds",
"of",
"spans",
"."
] | 085e441954d787bd4ef31f245afe5f2f2a311ea5 | https://github.com/chrisjenx/Calligraphy/blob/085e441954d787bd4ef31f245afe5f2f2a311ea5/calligraphy/src/main/java/uk/co/chrisjenx/calligraphy/TypefaceUtils.java#L54-L64 |
60,072 | crossoverJie/distributed-redis-tool | src/main/java/com/crossoverjie/distributed/util/ScriptUtil.java | ScriptUtil.getScript | public static String getScript(String path) {
StringBuilder sb = new StringBuilder();
InputStream stream = ScriptUtil.class.getClassLoader().getResourceAsStream(path);
try (BufferedReader br = new BufferedReader(new InputStreamReader(stream))){
String str;
while ((str =... | java | public static String getScript(String path) {
StringBuilder sb = new StringBuilder();
InputStream stream = ScriptUtil.class.getClassLoader().getResourceAsStream(path);
try (BufferedReader br = new BufferedReader(new InputStreamReader(stream))){
String str;
while ((str =... | [
"public",
"static",
"String",
"getScript",
"(",
"String",
"path",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"InputStream",
"stream",
"=",
"ScriptUtil",
".",
"class",
".",
"getClassLoader",
"(",
")",
".",
"getResourceAsStream"... | return lua script String
@param path
@return | [
"return",
"lua",
"script",
"String"
] | 57169feaccb6a56ab8821fa34e8e15954bb7b3b9 | https://github.com/crossoverJie/distributed-redis-tool/blob/57169feaccb6a56ab8821fa34e8e15954bb7b3b9/src/main/java/com/crossoverjie/distributed/util/ScriptUtil.java#L20-L35 |
60,073 | crossoverJie/distributed-redis-tool | src/main/java/com/crossoverjie/distributed/lock/RedisLock.java | RedisLock.getConnection | private Object getConnection() {
Object connection ;
if (type == RedisToolsConstant.SINGLE){
RedisConnection redisConnection = jedisConnectionFactory.getConnection();
connection = redisConnection.getNativeConnection();
}else {
RedisClusterConnection clusterCon... | java | private Object getConnection() {
Object connection ;
if (type == RedisToolsConstant.SINGLE){
RedisConnection redisConnection = jedisConnectionFactory.getConnection();
connection = redisConnection.getNativeConnection();
}else {
RedisClusterConnection clusterCon... | [
"private",
"Object",
"getConnection",
"(",
")",
"{",
"Object",
"connection",
";",
"if",
"(",
"type",
"==",
"RedisToolsConstant",
".",
"SINGLE",
")",
"{",
"RedisConnection",
"redisConnection",
"=",
"jedisConnectionFactory",
".",
"getConnection",
"(",
")",
";",
"c... | get Redis connection
@return | [
"get",
"Redis",
"connection"
] | 57169feaccb6a56ab8821fa34e8e15954bb7b3b9 | https://github.com/crossoverJie/distributed-redis-tool/blob/57169feaccb6a56ab8821fa34e8e15954bb7b3b9/src/main/java/com/crossoverjie/distributed/lock/RedisLock.java#L64-L74 |
60,074 | crossoverJie/distributed-redis-tool | src/main/java/com/crossoverjie/distributed/lock/RedisLock.java | RedisLock.tryLock | public boolean tryLock(String key, String request) {
//get connection
Object connection = getConnection();
String result ;
if (connection instanceof Jedis){
result = ((Jedis) connection).set(lockPrefix + key, request, SET_IF_NOT_EXIST, SET_WITH_EXPIRE_TIME, 10 * TIME);
... | java | public boolean tryLock(String key, String request) {
//get connection
Object connection = getConnection();
String result ;
if (connection instanceof Jedis){
result = ((Jedis) connection).set(lockPrefix + key, request, SET_IF_NOT_EXIST, SET_WITH_EXPIRE_TIME, 10 * TIME);
... | [
"public",
"boolean",
"tryLock",
"(",
"String",
"key",
",",
"String",
"request",
")",
"{",
"//get connection",
"Object",
"connection",
"=",
"getConnection",
"(",
")",
";",
"String",
"result",
";",
"if",
"(",
"connection",
"instanceof",
"Jedis",
")",
"{",
"res... | Non-blocking lock
@param key lock business type
@param request value
@return true lock success
false lock fail | [
"Non",
"-",
"blocking",
"lock"
] | 57169feaccb6a56ab8821fa34e8e15954bb7b3b9 | https://github.com/crossoverJie/distributed-redis-tool/blob/57169feaccb6a56ab8821fa34e8e15954bb7b3b9/src/main/java/com/crossoverjie/distributed/lock/RedisLock.java#L84-L101 |
60,075 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/ErrorHandler.java | ErrorHandler.error | public void error(final String msg)
{
errors++;
if (!suppressOutput)
{
out.println("ERROR: " + msg);
}
if (stopOnError)
{
throw new IllegalArgumentException(msg);
}
} | java | public void error(final String msg)
{
errors++;
if (!suppressOutput)
{
out.println("ERROR: " + msg);
}
if (stopOnError)
{
throw new IllegalArgumentException(msg);
}
} | [
"public",
"void",
"error",
"(",
"final",
"String",
"msg",
")",
"{",
"errors",
"++",
";",
"if",
"(",
"!",
"suppressOutput",
")",
"{",
"out",
".",
"println",
"(",
"\"ERROR: \"",
"+",
"msg",
")",
";",
"}",
"if",
"(",
"stopOnError",
")",
"{",
"throw",
... | Record a message signifying an error condition.
@param msg signifying an error. | [
"Record",
"a",
"message",
"signifying",
"an",
"error",
"condition",
"."
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/ErrorHandler.java#L61-L74 |
60,076 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/ErrorHandler.java | ErrorHandler.warning | public void warning(final String msg)
{
warnings++;
if (!suppressOutput)
{
out.println("WARNING: " + msg);
}
if (warningsFatal && stopOnError)
{
throw new IllegalArgumentException(msg);
}
} | java | public void warning(final String msg)
{
warnings++;
if (!suppressOutput)
{
out.println("WARNING: " + msg);
}
if (warningsFatal && stopOnError)
{
throw new IllegalArgumentException(msg);
}
} | [
"public",
"void",
"warning",
"(",
"final",
"String",
"msg",
")",
"{",
"warnings",
"++",
";",
"if",
"(",
"!",
"suppressOutput",
")",
"{",
"out",
".",
"println",
"(",
"\"WARNING: \"",
"+",
"msg",
")",
";",
"}",
"if",
"(",
"warningsFatal",
"&&",
"stopOnEr... | Record a message signifying an warning condition.
@param msg signifying an warning. | [
"Record",
"a",
"message",
"signifying",
"an",
"warning",
"condition",
"."
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/ErrorHandler.java#L81-L94 |
60,077 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/cpp/CppUtil.java | CppUtil.formatByteOrderEncoding | public static String formatByteOrderEncoding(final ByteOrder byteOrder, final PrimitiveType primitiveType)
{
switch (primitiveType.size())
{
case 2:
return "SBE_" + byteOrder + "_ENCODE_16";
case 4:
return "SBE_" + byteOrder + "_ENCODE_32";
... | java | public static String formatByteOrderEncoding(final ByteOrder byteOrder, final PrimitiveType primitiveType)
{
switch (primitiveType.size())
{
case 2:
return "SBE_" + byteOrder + "_ENCODE_16";
case 4:
return "SBE_" + byteOrder + "_ENCODE_32";
... | [
"public",
"static",
"String",
"formatByteOrderEncoding",
"(",
"final",
"ByteOrder",
"byteOrder",
",",
"final",
"PrimitiveType",
"primitiveType",
")",
"{",
"switch",
"(",
"primitiveType",
".",
"size",
"(",
")",
")",
"{",
"case",
"2",
":",
"return",
"\"SBE_\"",
... | Return the Cpp98 formatted byte order encoding string to use for a given byte order and primitiveType
@param byteOrder of the {@link uk.co.real_logic.sbe.ir.Token}
@param primitiveType of the {@link uk.co.real_logic.sbe.ir.Token}
@return the string formatted as the byte ordering encoding | [
"Return",
"the",
"Cpp98",
"formatted",
"byte",
"order",
"encoding",
"string",
"to",
"use",
"for",
"a",
"given",
"byte",
"order",
"and",
"primitiveType"
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/cpp/CppUtil.java#L125-L141 |
60,078 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/golang/GolangUtil.java | GolangUtil.formatPropertyName | public static String formatPropertyName(final String value)
{
String formattedValue = toUpperFirstChar(value);
if (ValidationUtil.isGolangKeyword(formattedValue))
{
final String keywordAppendToken = System.getProperty(SbeTool.KEYWORD_APPEND_TOKEN);
if (null == keywor... | java | public static String formatPropertyName(final String value)
{
String formattedValue = toUpperFirstChar(value);
if (ValidationUtil.isGolangKeyword(formattedValue))
{
final String keywordAppendToken = System.getProperty(SbeTool.KEYWORD_APPEND_TOKEN);
if (null == keywor... | [
"public",
"static",
"String",
"formatPropertyName",
"(",
"final",
"String",
"value",
")",
"{",
"String",
"formattedValue",
"=",
"toUpperFirstChar",
"(",
"value",
")",
";",
"if",
"(",
"ValidationUtil",
".",
"isGolangKeyword",
"(",
"formattedValue",
")",
")",
"{",... | Format a String as a property name.
@param value to be formatted.
@return the string formatted as a property name. | [
"Format",
"a",
"String",
"as",
"a",
"property",
"name",
"."
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/golang/GolangUtil.java#L115-L133 |
60,079 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/PrimitiveValue.java | PrimitiveValue.parse | public static PrimitiveValue parse(
final String value, final int length, final String characterEncoding)
{
if (value.length() > length)
{
throw new IllegalStateException("value.length=" + value.length() + " greater than length=" + length);
}
byte[] bytes = value... | java | public static PrimitiveValue parse(
final String value, final int length, final String characterEncoding)
{
if (value.length() > length)
{
throw new IllegalStateException("value.length=" + value.length() + " greater than length=" + length);
}
byte[] bytes = value... | [
"public",
"static",
"PrimitiveValue",
"parse",
"(",
"final",
"String",
"value",
",",
"final",
"int",
"length",
",",
"final",
"String",
"characterEncoding",
")",
"{",
"if",
"(",
"value",
".",
"length",
"(",
")",
">",
"length",
")",
"{",
"throw",
"new",
"I... | Parse constant value string and set representation based on type, length, and characterEncoding
@param value expressed as a String
@param length of the type
@param characterEncoding of the String
@return a new {@link PrimitiveValue} for the value.
@throws IllegalArgumentException if parsing malf... | [
"Parse",
"constant",
"value",
"string",
"and",
"set",
"representation",
"based",
"on",
"type",
"length",
"and",
"characterEncoding"
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/PrimitiveValue.java#L271-L286 |
60,080 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/PrimitiveValue.java | PrimitiveValue.byteArrayValue | public byte[] byteArrayValue(final PrimitiveType type)
{
if (representation == Representation.BYTE_ARRAY)
{
return byteArrayValue;
}
else if (representation == Representation.LONG && size == 1 && type == PrimitiveType.CHAR)
{
byteArrayValueForLong[0] =... | java | public byte[] byteArrayValue(final PrimitiveType type)
{
if (representation == Representation.BYTE_ARRAY)
{
return byteArrayValue;
}
else if (representation == Representation.LONG && size == 1 && type == PrimitiveType.CHAR)
{
byteArrayValueForLong[0] =... | [
"public",
"byte",
"[",
"]",
"byteArrayValue",
"(",
"final",
"PrimitiveType",
"type",
")",
"{",
"if",
"(",
"representation",
"==",
"Representation",
".",
"BYTE_ARRAY",
")",
"{",
"return",
"byteArrayValue",
";",
"}",
"else",
"if",
"(",
"representation",
"==",
... | Return byte array value for this PrimitiveValue given a particular type
@param type of this value
@return value expressed as a byte array
@throws IllegalStateException if not a byte array value representation | [
"Return",
"byte",
"array",
"value",
"for",
"this",
"PrimitiveValue",
"given",
"a",
"particular",
"type"
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/PrimitiveValue.java#L346-L359 |
60,081 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaUtil.java | JavaUtil.append | public static void append(final StringBuilder builder, final String indent, final String line)
{
builder.append(indent).append(line).append('\n');
} | java | public static void append(final StringBuilder builder, final String indent, final String line)
{
builder.append(indent).append(line).append('\n');
} | [
"public",
"static",
"void",
"append",
"(",
"final",
"StringBuilder",
"builder",
",",
"final",
"String",
"indent",
",",
"final",
"String",
"line",
")",
"{",
"builder",
".",
"append",
"(",
"indent",
")",
".",
"append",
"(",
"line",
")",
".",
"append",
"(",... | Shortcut to append a line of generated code
@param builder string builder to which to append the line
@param indent current text indentation
@param line line to be appended | [
"Shortcut",
"to",
"append",
"a",
"line",
"of",
"generated",
"code"
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaUtil.java#L178-L181 |
60,082 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaUtil.java | JavaUtil.generateTypeJavadoc | public static String generateTypeJavadoc(final String indent, final Token typeToken)
{
final String description = typeToken.description();
if (null == description || description.isEmpty())
{
return "";
}
return
indent + "/**\n" +
indent + ... | java | public static String generateTypeJavadoc(final String indent, final Token typeToken)
{
final String description = typeToken.description();
if (null == description || description.isEmpty())
{
return "";
}
return
indent + "/**\n" +
indent + ... | [
"public",
"static",
"String",
"generateTypeJavadoc",
"(",
"final",
"String",
"indent",
",",
"final",
"Token",
"typeToken",
")",
"{",
"final",
"String",
"description",
"=",
"typeToken",
".",
"description",
"(",
")",
";",
"if",
"(",
"null",
"==",
"description",
... | Generate the Javadoc comment header for a type.
@param indent level for the comment.
@param typeToken for the type.
@return a string representation of the Javadoc comment. | [
"Generate",
"the",
"Javadoc",
"comment",
"header",
"for",
"a",
"type",
"."
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaUtil.java#L259-L271 |
60,083 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaUtil.java | JavaUtil.generateOptionEncodeJavadoc | public static String generateOptionEncodeJavadoc(final String indent, final Token optionToken)
{
final String description = optionToken.description();
if (null == description || description.isEmpty())
{
return "";
}
return
indent + "/**\n" +
... | java | public static String generateOptionEncodeJavadoc(final String indent, final Token optionToken)
{
final String description = optionToken.description();
if (null == description || description.isEmpty())
{
return "";
}
return
indent + "/**\n" +
... | [
"public",
"static",
"String",
"generateOptionEncodeJavadoc",
"(",
"final",
"String",
"indent",
",",
"final",
"Token",
"optionToken",
")",
"{",
"final",
"String",
"description",
"=",
"optionToken",
".",
"description",
"(",
")",
";",
"if",
"(",
"null",
"==",
"de... | Generate the Javadoc comment header for a bitset choice option encode method.
@param indent level for the comment.
@param optionToken for the type.
@return a string representation of the Javadoc comment. | [
"Generate",
"the",
"Javadoc",
"comment",
"header",
"for",
"a",
"bitset",
"choice",
"option",
"encode",
"method",
"."
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaUtil.java#L303-L317 |
60,084 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaUtil.java | JavaUtil.generateFlyweightPropertyJavadoc | public static String generateFlyweightPropertyJavadoc(
final String indent, final Token propertyToken, final String typeName)
{
final String description = propertyToken.description();
if (null == description || description.isEmpty())
{
return "";
}
return... | java | public static String generateFlyweightPropertyJavadoc(
final String indent, final Token propertyToken, final String typeName)
{
final String description = propertyToken.description();
if (null == description || description.isEmpty())
{
return "";
}
return... | [
"public",
"static",
"String",
"generateFlyweightPropertyJavadoc",
"(",
"final",
"String",
"indent",
",",
"final",
"Token",
"propertyToken",
",",
"final",
"String",
"typeName",
")",
"{",
"final",
"String",
"description",
"=",
"propertyToken",
".",
"description",
"(",... | Generate the Javadoc comment header for flyweight property.
@param indent level for the comment.
@param propertyToken for the property name.
@param typeName for the property type.
@return a string representation of the Javadoc comment. | [
"Generate",
"the",
"Javadoc",
"comment",
"header",
"for",
"flyweight",
"property",
"."
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaUtil.java#L327-L342 |
60,085 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java | XmlSchemaParser.findMessages | public static Map<Long, Message> findMessages(
final Document document, final XPath xPath, final Map<String, Type> typeByNameMap) throws Exception
{
final Map<Long, Message> messageByIdMap = new HashMap<>();
final ObjectHashSet<String> distinctNames = new ObjectHashSet<>();
forEach(... | java | public static Map<Long, Message> findMessages(
final Document document, final XPath xPath, final Map<String, Type> typeByNameMap) throws Exception
{
final Map<Long, Message> messageByIdMap = new HashMap<>();
final ObjectHashSet<String> distinctNames = new ObjectHashSet<>();
forEach(... | [
"public",
"static",
"Map",
"<",
"Long",
",",
"Message",
">",
"findMessages",
"(",
"final",
"Document",
"document",
",",
"final",
"XPath",
"xPath",
",",
"final",
"Map",
"<",
"String",
",",
"Type",
">",
"typeByNameMap",
")",
"throws",
"Exception",
"{",
"fina... | Scan XML for all message definitions and save in map
@param document for the XML parsing
@param xPath for XPath expression reuse
@param typeByNameMap to use for Type objects
@return {@link java.util.Map} of schemaId to Message
@throws Exception on parsing error. | [
"Scan",
"XML",
"for",
"all",
"message",
"definitions",
"and",
"save",
"in",
"map"
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java#L220-L230 |
60,086 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java | XmlSchemaParser.handleError | public static void handleError(final Node node, final String msg)
{
final ErrorHandler handler = (ErrorHandler)node.getOwnerDocument().getUserData(ERROR_HANDLER_KEY);
if (handler == null)
{
throw new IllegalStateException("ERROR: " + formatLocationInfo(node) + msg);
}
... | java | public static void handleError(final Node node, final String msg)
{
final ErrorHandler handler = (ErrorHandler)node.getOwnerDocument().getUserData(ERROR_HANDLER_KEY);
if (handler == null)
{
throw new IllegalStateException("ERROR: " + formatLocationInfo(node) + msg);
}
... | [
"public",
"static",
"void",
"handleError",
"(",
"final",
"Node",
"node",
",",
"final",
"String",
"msg",
")",
"{",
"final",
"ErrorHandler",
"handler",
"=",
"(",
"ErrorHandler",
")",
"node",
".",
"getOwnerDocument",
"(",
")",
".",
"getUserData",
"(",
"ERROR_HA... | Handle an error condition as consequence of parsing.
@param node that is the context of the warning.
@param msg associated with the error. | [
"Handle",
"an",
"error",
"condition",
"as",
"consequence",
"of",
"parsing",
"."
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java#L238-L250 |
60,087 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java | XmlSchemaParser.handleWarning | public static void handleWarning(final Node node, final String msg)
{
final ErrorHandler handler = (ErrorHandler)node.getOwnerDocument().getUserData(ERROR_HANDLER_KEY);
if (handler == null)
{
throw new IllegalStateException("WARNING: " + formatLocationInfo(node) + msg);
... | java | public static void handleWarning(final Node node, final String msg)
{
final ErrorHandler handler = (ErrorHandler)node.getOwnerDocument().getUserData(ERROR_HANDLER_KEY);
if (handler == null)
{
throw new IllegalStateException("WARNING: " + formatLocationInfo(node) + msg);
... | [
"public",
"static",
"void",
"handleWarning",
"(",
"final",
"Node",
"node",
",",
"final",
"String",
"msg",
")",
"{",
"final",
"ErrorHandler",
"handler",
"=",
"(",
"ErrorHandler",
")",
"node",
".",
"getOwnerDocument",
"(",
")",
".",
"getUserData",
"(",
"ERROR_... | Handle a warning condition as a consequence of parsing.
@param node as the context for the warning.
@param msg associated with the warning. | [
"Handle",
"a",
"warning",
"condition",
"as",
"a",
"consequence",
"of",
"parsing",
"."
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java#L258-L270 |
60,088 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java | XmlSchemaParser.getAttributeValue | public static String getAttributeValue(final Node elementNode, final String attrName)
{
final Node attrNode = elementNode.getAttributes().getNamedItemNS(null, attrName);
if (attrNode == null || "".equals(attrNode.getNodeValue()))
{
throw new IllegalStateException(
... | java | public static String getAttributeValue(final Node elementNode, final String attrName)
{
final Node attrNode = elementNode.getAttributes().getNamedItemNS(null, attrName);
if (attrNode == null || "".equals(attrNode.getNodeValue()))
{
throw new IllegalStateException(
... | [
"public",
"static",
"String",
"getAttributeValue",
"(",
"final",
"Node",
"elementNode",
",",
"final",
"String",
"attrName",
")",
"{",
"final",
"Node",
"attrNode",
"=",
"elementNode",
".",
"getAttributes",
"(",
")",
".",
"getNamedItemNS",
"(",
"null",
",",
"att... | Helper function that throws an exception when the attribute is not set.
@param elementNode that should have the attribute
@param attrName that is to be looked up
@return value of the attribute
@throws IllegalArgumentException if the attribute is not present | [
"Helper",
"function",
"that",
"throws",
"an",
"exception",
"when",
"the",
"attribute",
"is",
"not",
"set",
"."
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java#L280-L291 |
60,089 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java | XmlSchemaParser.getAttributeValue | public static String getAttributeValue(final Node elementNode, final String attrName, final String defValue)
{
final Node attrNode = elementNode.getAttributes().getNamedItemNS(null, attrName);
if (attrNode == null)
{
return defValue;
}
return attrNode.getNodeVal... | java | public static String getAttributeValue(final Node elementNode, final String attrName, final String defValue)
{
final Node attrNode = elementNode.getAttributes().getNamedItemNS(null, attrName);
if (attrNode == null)
{
return defValue;
}
return attrNode.getNodeVal... | [
"public",
"static",
"String",
"getAttributeValue",
"(",
"final",
"Node",
"elementNode",
",",
"final",
"String",
"attrName",
",",
"final",
"String",
"defValue",
")",
"{",
"final",
"Node",
"attrNode",
"=",
"elementNode",
".",
"getAttributes",
"(",
")",
".",
"get... | Helper function that uses a default value when value not set.
@param elementNode that should have the attribute
@param attrName that is to be looked up
@param defValue String to return if not set
@return value of the attribute or defValue | [
"Helper",
"function",
"that",
"uses",
"a",
"default",
"value",
"when",
"value",
"not",
"set",
"."
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java#L301-L311 |
60,090 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java | XmlSchemaParser.checkForValidName | public static void checkForValidName(final Node node, final String name)
{
if (!ValidationUtil.isSbeCppName(name))
{
handleWarning(node, "name is not valid for C++: " + name);
}
if (!ValidationUtil.isSbeJavaName(name))
{
handleWarning(node, "name is n... | java | public static void checkForValidName(final Node node, final String name)
{
if (!ValidationUtil.isSbeCppName(name))
{
handleWarning(node, "name is not valid for C++: " + name);
}
if (!ValidationUtil.isSbeJavaName(name))
{
handleWarning(node, "name is n... | [
"public",
"static",
"void",
"checkForValidName",
"(",
"final",
"Node",
"node",
",",
"final",
"String",
"name",
")",
"{",
"if",
"(",
"!",
"ValidationUtil",
".",
"isSbeCppName",
"(",
"name",
")",
")",
"{",
"handleWarning",
"(",
"node",
",",
"\"name is not vali... | Check name against validity for C++ and Java naming. Warning if not valid.
@param node to have the name checked.
@param name of the node to be checked. | [
"Check",
"name",
"against",
"validity",
"for",
"C",
"++",
"and",
"Java",
"naming",
".",
"Warning",
"if",
"not",
"valid",
"."
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/XmlSchemaParser.java#L363-L384 |
60,091 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/golang/GolangGenerator.java | GolangGenerator.generateFieldEncodeDecode | private int generateFieldEncodeDecode(
final List<Token> tokens,
final char varName,
final int currentOffset,
final StringBuilder encode,
final StringBuilder decode,
final StringBuilder rc,
final StringBuilder init)
{
final Token signalToken = tokens.g... | java | private int generateFieldEncodeDecode(
final List<Token> tokens,
final char varName,
final int currentOffset,
final StringBuilder encode,
final StringBuilder decode,
final StringBuilder rc,
final StringBuilder init)
{
final Token signalToken = tokens.g... | [
"private",
"int",
"generateFieldEncodeDecode",
"(",
"final",
"List",
"<",
"Token",
">",
"tokens",
",",
"final",
"char",
"varName",
",",
"final",
"int",
"currentOffset",
",",
"final",
"StringBuilder",
"encode",
",",
"final",
"StringBuilder",
"decode",
",",
"final... | Returns how many extra tokens to skip over | [
"Returns",
"how",
"many",
"extra",
"tokens",
"to",
"skip",
"over"
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/golang/GolangGenerator.java#L980-L1072 |
60,092 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/golang/GolangGenerator.java | GolangGenerator.generateGroupProperties | private void generateGroupProperties(
final StringBuilder sb,
final List<Token> tokens,
final String prefix)
{
for (int i = 0, size = tokens.size(); i < size; i++)
{
final Token token = tokens.get(i);
if (token.signal() == Signal.BEGIN_GROUP)
... | java | private void generateGroupProperties(
final StringBuilder sb,
final List<Token> tokens,
final String prefix)
{
for (int i = 0, size = tokens.size(); i < size; i++)
{
final Token token = tokens.get(i);
if (token.signal() == Signal.BEGIN_GROUP)
... | [
"private",
"void",
"generateGroupProperties",
"(",
"final",
"StringBuilder",
"sb",
",",
"final",
"List",
"<",
"Token",
">",
"tokens",
",",
"final",
"String",
"prefix",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"size",
"=",
"tokens",
".",
"size",
... | Recursively traverse groups to create the group properties | [
"Recursively",
"traverse",
"groups",
"to",
"create",
"the",
"group",
"properties"
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/golang/GolangGenerator.java#L1284-L1308 |
60,093 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/golang/GolangGenerator.java | GolangGenerator.generateExtensibilityMethods | private void generateExtensibilityMethods(
final StringBuilder sb,
final String typeName,
final Token token)
{
sb.append(String.format(
"\nfunc (*%1$s) SbeBlockLength() (blockLength uint) {\n" +
"\treturn %2$s\n" +
"}\n" +
"\nfunc (*%1$... | java | private void generateExtensibilityMethods(
final StringBuilder sb,
final String typeName,
final Token token)
{
sb.append(String.format(
"\nfunc (*%1$s) SbeBlockLength() (blockLength uint) {\n" +
"\treturn %2$s\n" +
"}\n" +
"\nfunc (*%1$... | [
"private",
"void",
"generateExtensibilityMethods",
"(",
"final",
"StringBuilder",
"sb",
",",
"final",
"String",
"typeName",
",",
"final",
"Token",
"token",
")",
"{",
"sb",
".",
"append",
"(",
"String",
".",
"format",
"(",
"\"\\nfunc (*%1$s) SbeBlockLength() (blockLe... | of block length and version to check for extensions | [
"of",
"block",
"length",
"and",
"version",
"to",
"check",
"for",
"extensions"
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/golang/GolangGenerator.java#L2067-L2083 |
60,094 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/c/CUtil.java | CUtil.formatScopedName | public static String formatScopedName(final CharSequence[] scope, final String value)
{
return String.join("_", scope).toLowerCase() + "_" + formatName(value);
} | java | public static String formatScopedName(final CharSequence[] scope, final String value)
{
return String.join("_", scope).toLowerCase() + "_" + formatName(value);
} | [
"public",
"static",
"String",
"formatScopedName",
"(",
"final",
"CharSequence",
"[",
"]",
"scope",
",",
"final",
"String",
"value",
")",
"{",
"return",
"String",
".",
"join",
"(",
"\"_\"",
",",
"scope",
")",
".",
"toLowerCase",
"(",
")",
"+",
"\"_\"",
"+... | Format a String as a struct name prepended with a scope.
@param scope to be prepended.
@param value to be formatted.
@return the string formatted as a struct name. | [
"Format",
"a",
"String",
"as",
"a",
"struct",
"name",
"prepended",
"with",
"a",
"scope",
"."
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/c/CUtil.java#L125-L128 |
60,095 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/SbeTool.java | SbeTool.main | public static void main(final String[] args) throws Exception
{
if (args.length == 0)
{
System.err.format("Usage: %s <filenames>...%n", SbeTool.class.getName());
System.exit(-1);
}
for (final String fileName : args)
{
final Ir ir;
... | java | public static void main(final String[] args) throws Exception
{
if (args.length == 0)
{
System.err.format("Usage: %s <filenames>...%n", SbeTool.class.getName());
System.exit(-1);
}
for (final String fileName : args)
{
final Ir ir;
... | [
"public",
"static",
"void",
"main",
"(",
"final",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"if",
"(",
"args",
".",
"length",
"==",
"0",
")",
"{",
"System",
".",
"err",
".",
"format",
"(",
"\"Usage: %s <filenames>...%n\"",
",",
"SbeToo... | Main entry point for the SBE Tool.
@param args command line arguments. A single filename is expected.
@throws Exception if an error occurs during process of the message schema. | [
"Main",
"entry",
"point",
"for",
"the",
"SBE",
"Tool",
"."
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/SbeTool.java#L188-L242 |
60,096 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/SbeTool.java | SbeTool.validateAgainstSchema | public static void validateAgainstSchema(final String sbeSchemaFilename, final String xsdFilename)
throws Exception
{
final ParserOptions.Builder optionsBuilder = ParserOptions.builder()
.xsdFilename(System.getProperty(VALIDATION_XSD))
.xIncludeAware(Boolean.parseBoolean(Syst... | java | public static void validateAgainstSchema(final String sbeSchemaFilename, final String xsdFilename)
throws Exception
{
final ParserOptions.Builder optionsBuilder = ParserOptions.builder()
.xsdFilename(System.getProperty(VALIDATION_XSD))
.xIncludeAware(Boolean.parseBoolean(Syst... | [
"public",
"static",
"void",
"validateAgainstSchema",
"(",
"final",
"String",
"sbeSchemaFilename",
",",
"final",
"String",
"xsdFilename",
")",
"throws",
"Exception",
"{",
"final",
"ParserOptions",
".",
"Builder",
"optionsBuilder",
"=",
"ParserOptions",
".",
"builder",
... | Validate the SBE Schema against the XSD.
@param sbeSchemaFilename to be validated.
@param xsdFilename XSD against which to validate.
@throws Exception if an error occurs while validating. | [
"Validate",
"the",
"SBE",
"Schema",
"against",
"the",
"XSD",
"."
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/SbeTool.java#L251-L272 |
60,097 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/SbeTool.java | SbeTool.generate | public static void generate(final Ir ir, final String outputDirName, final String targetLanguage)
throws Exception
{
final TargetCodeGenerator targetCodeGenerator = TargetCodeGeneratorLoader.get(targetLanguage);
final CodeGenerator codeGenerator = targetCodeGenerator.newInstance(ir, outputDi... | java | public static void generate(final Ir ir, final String outputDirName, final String targetLanguage)
throws Exception
{
final TargetCodeGenerator targetCodeGenerator = TargetCodeGeneratorLoader.get(targetLanguage);
final CodeGenerator codeGenerator = targetCodeGenerator.newInstance(ir, outputDi... | [
"public",
"static",
"void",
"generate",
"(",
"final",
"Ir",
"ir",
",",
"final",
"String",
"outputDirName",
",",
"final",
"String",
"targetLanguage",
")",
"throws",
"Exception",
"{",
"final",
"TargetCodeGenerator",
"targetCodeGenerator",
"=",
"TargetCodeGeneratorLoader... | Generate SBE encoding and decoding stubs for a target language.
@param ir for the parsed specification.
@param outputDirName directory into which code will be generated.
@param targetLanguage for the generated code.
@throws Exception if an error occurs while generating the code. | [
"Generate",
"SBE",
"encoding",
"and",
"decoding",
"stubs",
"for",
"a",
"target",
"language",
"."
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/SbeTool.java#L312-L319 |
60,098 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/CompositeType.java | CompositeType.makeDataFieldCompositeType | public void makeDataFieldCompositeType()
{
final EncodedDataType edt = (EncodedDataType)containedTypeByNameMap.get("varData");
if (edt != null)
{
edt.variableLength(true);
}
} | java | public void makeDataFieldCompositeType()
{
final EncodedDataType edt = (EncodedDataType)containedTypeByNameMap.get("varData");
if (edt != null)
{
edt.variableLength(true);
}
} | [
"public",
"void",
"makeDataFieldCompositeType",
"(",
")",
"{",
"final",
"EncodedDataType",
"edt",
"=",
"(",
"EncodedDataType",
")",
"containedTypeByNameMap",
".",
"get",
"(",
"\"varData\"",
")",
";",
"if",
"(",
"edt",
"!=",
"null",
")",
"{",
"edt",
".",
"var... | Make this composite type, if it has a varData member, variable length
by making the EncodedDataType with the name "varData" be variable length. | [
"Make",
"this",
"composite",
"type",
"if",
"it",
"has",
"a",
"varData",
"member",
"variable",
"length",
"by",
"making",
"the",
"EncodedDataType",
"with",
"the",
"name",
"varData",
"be",
"variable",
"length",
"."
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/CompositeType.java#L146-L153 |
60,099 | real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/CompositeType.java | CompositeType.checkForWellFormedGroupSizeEncoding | public void checkForWellFormedGroupSizeEncoding(final Node node)
{
final EncodedDataType blockLengthType = (EncodedDataType)containedTypeByNameMap.get("blockLength");
final EncodedDataType numInGroupType = (EncodedDataType)containedTypeByNameMap.get("numInGroup");
if (blockLengthType == nul... | java | public void checkForWellFormedGroupSizeEncoding(final Node node)
{
final EncodedDataType blockLengthType = (EncodedDataType)containedTypeByNameMap.get("blockLength");
final EncodedDataType numInGroupType = (EncodedDataType)containedTypeByNameMap.get("numInGroup");
if (blockLengthType == nul... | [
"public",
"void",
"checkForWellFormedGroupSizeEncoding",
"(",
"final",
"Node",
"node",
")",
"{",
"final",
"EncodedDataType",
"blockLengthType",
"=",
"(",
"EncodedDataType",
")",
"containedTypeByNameMap",
".",
"get",
"(",
"\"blockLength\"",
")",
";",
"final",
"EncodedD... | Check the composite for being a well formed group encodedLength encoding. This means
that there are the fields "blockLength" and "numInGroup" present.
@param node of the XML for this composite | [
"Check",
"the",
"composite",
"for",
"being",
"a",
"well",
"formed",
"group",
"encodedLength",
"encoding",
".",
"This",
"means",
"that",
"there",
"are",
"the",
"fields",
"blockLength",
"and",
"numInGroup",
"present",
"."
] | 9a7be490c86d98f0e430e4189bc6c8c4fbef658b | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/CompositeType.java#L161-L227 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.