repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
grails/gorm-hibernate5
grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java
AbstractHibernateCriteriaBuilder.sizeEq
public org.grails.datastore.mapping.query.api.Criteria sizeEq(String propertyName, int size) { if (!validateSimpleExpression()) { throwRuntimeException(new IllegalArgumentException("Call to [sizeEq] with propertyName [" + propertyName + "] and size [" + size + "] not allowed here...
java
public org.grails.datastore.mapping.query.api.Criteria sizeEq(String propertyName, int size) { if (!validateSimpleExpression()) { throwRuntimeException(new IllegalArgumentException("Call to [sizeEq] with propertyName [" + propertyName + "] and size [" + size + "] not allowed here...
[ "public", "org", ".", "grails", ".", "datastore", ".", "mapping", ".", "query", ".", "api", ".", "Criteria", "sizeEq", "(", "String", "propertyName", ",", "int", "size", ")", "{", "if", "(", "!", "validateSimpleExpression", "(", ")", ")", "{", "throwRunt...
Creates a Criterion that contrains a collection property by size @param propertyName The property name @param size The size to constrain by @return A Criterion instance
[ "Creates", "a", "Criterion", "that", "contrains", "a", "collection", "property", "by", "size" ]
0ebb80cd769ef2bea955723d4543828a3e9542ef
https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java#L1414-L1423
train
grails/gorm-hibernate5
grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java
AbstractHibernateCriteriaBuilder.between
public org.grails.datastore.mapping.query.api.Criteria between(String propertyName, Object lo, Object hi) { if (!validateSimpleExpression()) { throwRuntimeException(new IllegalArgumentException("Call to [between] with propertyName [" + propertyName + "] not allowed here.")); ...
java
public org.grails.datastore.mapping.query.api.Criteria between(String propertyName, Object lo, Object hi) { if (!validateSimpleExpression()) { throwRuntimeException(new IllegalArgumentException("Call to [between] with propertyName [" + propertyName + "] not allowed here.")); ...
[ "public", "org", ".", "grails", ".", "datastore", ".", "mapping", ".", "query", ".", "api", ".", "Criteria", "between", "(", "String", "propertyName", ",", "Object", "lo", ",", "Object", "hi", ")", "{", "if", "(", "!", "validateSimpleExpression", "(", ")...
Creates a "between" Criterion based on the property name and specified lo and hi values @param propertyName The property name @param lo The low value @param hi The high value @return A Criterion instance
[ "Creates", "a", "between", "Criterion", "based", "on", "the", "property", "name", "and", "specified", "lo", "and", "hi", "values" ]
0ebb80cd769ef2bea955723d4543828a3e9542ef
https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java#L1549-L1558
train
grails/gorm-hibernate5
grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java
AbstractHibernateCriteriaBuilder.addToCriteria
protected Criterion addToCriteria(Criterion c) { if (!logicalExpressionStack.isEmpty()) { logicalExpressionStack.get(logicalExpressionStack.size() - 1).args.add(c); } else { criteria.add(c); } return c; }
java
protected Criterion addToCriteria(Criterion c) { if (!logicalExpressionStack.isEmpty()) { logicalExpressionStack.get(logicalExpressionStack.size() - 1).args.add(c); } else { criteria.add(c); } return c; }
[ "protected", "Criterion", "addToCriteria", "(", "Criterion", "c", ")", "{", "if", "(", "!", "logicalExpressionStack", ".", "isEmpty", "(", ")", ")", "{", "logicalExpressionStack", ".", "get", "(", "logicalExpressionStack", ".", "size", "(", ")", "-", "1", ")...
adds and returns the given criterion to the currently active criteria set. this might be either the root criteria or a currently open LogicalExpression.
[ "adds", "and", "returns", "the", "given", "criterion", "to", "the", "currently", "active", "criteria", "set", ".", "this", "might", "be", "either", "the", "root", "criteria", "or", "a", "currently", "open", "LogicalExpression", "." ]
0ebb80cd769ef2bea955723d4543828a3e9542ef
https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java#L1925-L1933
train
grails/gorm-hibernate5
grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/GrailsHibernateTemplate.java
GrailsHibernateTemplate.createSessionProxy
protected Session createSessionProxy(Session session) { Class<?>[] sessionIfcs; Class<?> mainIfc = Session.class; if (session instanceof EventSource) { sessionIfcs = new Class[]{mainIfc, EventSource.class}; } else if (session instanceof SessionImplementor) { sessi...
java
protected Session createSessionProxy(Session session) { Class<?>[] sessionIfcs; Class<?> mainIfc = Session.class; if (session instanceof EventSource) { sessionIfcs = new Class[]{mainIfc, EventSource.class}; } else if (session instanceof SessionImplementor) { sessi...
[ "protected", "Session", "createSessionProxy", "(", "Session", "session", ")", "{", "Class", "<", "?", ">", "[", "]", "sessionIfcs", ";", "Class", "<", "?", ">", "mainIfc", "=", "Session", ".", "class", ";", "if", "(", "session", "instanceof", "EventSource"...
Create a close-suppressing proxy for the given Hibernate Session. The proxy also prepares returned Query and Criteria objects. @param session the Hibernate Session to create a proxy for @return the Session proxy @see org.hibernate.Session#close() @see #prepareQuery @see #prepareCriteria
[ "Create", "a", "close", "-", "suppressing", "proxy", "for", "the", "given", "Hibernate", "Session", ".", "The", "proxy", "also", "prepares", "returned", "Query", "and", "Criteria", "objects", "." ]
0ebb80cd769ef2bea955723d4543828a3e9542ef
https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/GrailsHibernateTemplate.java#L349-L361
train
grails/gorm-hibernate5
grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/GrailsHibernateTemplate.java
GrailsHibernateTemplate.applyFlushMode
protected FlushMode applyFlushMode(Session session, boolean existingTransaction) { if(isApplyFlushModeOnlyToNonExistingTransactions() && existingTransaction) { return null; } if (getFlushMode() == FLUSH_NEVER) { if (existingTransaction) { FlushMode previo...
java
protected FlushMode applyFlushMode(Session session, boolean existingTransaction) { if(isApplyFlushModeOnlyToNonExistingTransactions() && existingTransaction) { return null; } if (getFlushMode() == FLUSH_NEVER) { if (existingTransaction) { FlushMode previo...
[ "protected", "FlushMode", "applyFlushMode", "(", "Session", "session", ",", "boolean", "existingTransaction", ")", "{", "if", "(", "isApplyFlushModeOnlyToNonExistingTransactions", "(", ")", "&&", "existingTransaction", ")", "{", "return", "null", ";", "}", "if", "("...
Apply the flush mode that's been specified for this accessor to the given Session. @param session the current Hibernate Session @param existingTransaction if executing within an existing transaction @return the previous flush mode to restore after the operation, or <code>null</code> if none @see #setFlushM...
[ "Apply", "the", "flush", "mode", "that", "s", "been", "specified", "for", "this", "accessor", "to", "the", "given", "Session", "." ]
0ebb80cd769ef2bea955723d4543828a3e9542ef
https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/GrailsHibernateTemplate.java#L653-L700
train
skyscreamer/JSONassert
src/main/java/org/skyscreamer/jsonassert/JSONCompare.java
JSONCompare.compareJSON
public static JSONCompareResult compareJSON(String expectedStr, String actualStr, JSONComparator comparator) throws JSONException { Object expected = JSONParser.parseJSON(expectedStr); Object actual = JSONParser.parseJSON(actualStr); if ((expected instanceof JSONObject) && (actual in...
java
public static JSONCompareResult compareJSON(String expectedStr, String actualStr, JSONComparator comparator) throws JSONException { Object expected = JSONParser.parseJSON(expectedStr); Object actual = JSONParser.parseJSON(actualStr); if ((expected instanceof JSONObject) && (actual in...
[ "public", "static", "JSONCompareResult", "compareJSON", "(", "String", "expectedStr", ",", "String", "actualStr", ",", "JSONComparator", "comparator", ")", "throws", "JSONException", "{", "Object", "expected", "=", "JSONParser", ".", "parseJSON", "(", "expectedStr", ...
Compares JSON string provided to the expected JSON string using provided comparator, and returns the results of the comparison. @param expectedStr Expected JSON string @param actualStr JSON string to compare @param comparator Comparator to use @return result of the comparison @throws JSONException JSON parsing error @t...
[ "Compares", "JSON", "string", "provided", "to", "the", "expected", "JSON", "string", "using", "provided", "comparator", "and", "returns", "the", "results", "of", "the", "comparison", "." ]
830efcf546d07f955d8a213cc5c8a1db34d78f04
https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/JSONCompare.java#L47-L66
train
skyscreamer/JSONassert
src/main/java/org/skyscreamer/jsonassert/JSONCompare.java
JSONCompare.compareJSON
public static JSONCompareResult compareJSON(String expectedStr, String actualStr, JSONCompareMode mode) throws JSONException { return compareJSON(expectedStr, actualStr, getComparatorForMode(mode)); }
java
public static JSONCompareResult compareJSON(String expectedStr, String actualStr, JSONCompareMode mode) throws JSONException { return compareJSON(expectedStr, actualStr, getComparatorForMode(mode)); }
[ "public", "static", "JSONCompareResult", "compareJSON", "(", "String", "expectedStr", ",", "String", "actualStr", ",", "JSONCompareMode", "mode", ")", "throws", "JSONException", "{", "return", "compareJSON", "(", "expectedStr", ",", "actualStr", ",", "getComparatorFor...
Compares JSON string provided to the expected JSON string, and returns the results of the comparison. @param expectedStr Expected JSON string @param actualStr JSON string to compare @param mode Defines comparison behavior @return result of the comparison @throws JSONException JSON parsing error
[ "Compares", "JSON", "string", "provided", "to", "the", "expected", "JSON", "string", "and", "returns", "the", "results", "of", "the", "comparison", "." ]
830efcf546d07f955d8a213cc5c8a1db34d78f04
https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/JSONCompare.java#L123-L126
train
skyscreamer/JSONassert
src/main/java/org/skyscreamer/jsonassert/Customization.java
Customization.matches
public boolean matches(String prefix, Object actual, Object expected, JSONCompareResult result) throws ValueMatcherException { if (comparator instanceof LocationAwareValueMatcher) { return ((LocationAwareValueMatcher<Object>)comparator).equal(prefix, actual, expected, result); } return comparator.equal(actu...
java
public boolean matches(String prefix, Object actual, Object expected, JSONCompareResult result) throws ValueMatcherException { if (comparator instanceof LocationAwareValueMatcher) { return ((LocationAwareValueMatcher<Object>)comparator).equal(prefix, actual, expected, result); } return comparator.equal(actu...
[ "public", "boolean", "matches", "(", "String", "prefix", ",", "Object", "actual", ",", "Object", "expected", ",", "JSONCompareResult", "result", ")", "throws", "ValueMatcherException", "{", "if", "(", "comparator", "instanceof", "LocationAwareValueMatcher", ")", "{"...
Return true if actual value matches expected value using this Customization's comparator. The equal method used for comparison depends on type of comparator. @param prefix JSON path of the JSON item being tested (only used if comparator is a LocationAwareValueMatcher) @param actual JSON value being tested @param expec...
[ "Return", "true", "if", "actual", "value", "matches", "expected", "value", "using", "this", "Customization", "s", "comparator", ".", "The", "equal", "method", "used", "for", "comparison", "depends", "on", "type", "of", "comparator", "." ]
830efcf546d07f955d8a213cc5c8a1db34d78f04
https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/Customization.java#L144-L150
train
skyscreamer/JSONassert
src/main/java/org/skyscreamer/jsonassert/comparator/ArraySizeComparator.java
ArraySizeComparator.compareJSONArray
@Override public void compareJSONArray(String prefix, JSONArray expected, JSONArray actual, JSONCompareResult result) throws JSONException { String arrayPrefix = prefix + "[]"; if (expected.length() < 1 || expected.length() > 2) { result.fail(MessageFormat .format("{0}: invalid expectation: expected arr...
java
@Override public void compareJSONArray(String prefix, JSONArray expected, JSONArray actual, JSONCompareResult result) throws JSONException { String arrayPrefix = prefix + "[]"; if (expected.length() < 1 || expected.length() > 2) { result.fail(MessageFormat .format("{0}: invalid expectation: expected arr...
[ "@", "Override", "public", "void", "compareJSONArray", "(", "String", "prefix", ",", "JSONArray", "expected", ",", "JSONArray", "actual", ",", "JSONCompareResult", "result", ")", "throws", "JSONException", "{", "String", "arrayPrefix", "=", "prefix", "+", "\"[]\""...
Expected array should consist of either 1 or 2 integer values that define maximum and minimum valid lengths of the actual array. If expected array contains a single integer value, then the actual array must contain exactly that number of elements.
[ "Expected", "array", "should", "consist", "of", "either", "1", "or", "2", "integer", "values", "that", "define", "maximum", "and", "minimum", "valid", "lengths", "of", "the", "actual", "array", ".", "If", "expected", "array", "contains", "a", "single", "inte...
830efcf546d07f955d8a213cc5c8a1db34d78f04
https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/comparator/ArraySizeComparator.java#L70-L119
train
skyscreamer/JSONassert
src/main/java/org/skyscreamer/jsonassert/comparator/AbstractComparator.java
AbstractComparator.compareJSON
@Override public final JSONCompareResult compareJSON(JSONArray expected, JSONArray actual) throws JSONException { JSONCompareResult result = new JSONCompareResult(); compareJSONArray("", expected, actual, result); return result; }
java
@Override public final JSONCompareResult compareJSON(JSONArray expected, JSONArray actual) throws JSONException { JSONCompareResult result = new JSONCompareResult(); compareJSONArray("", expected, actual, result); return result; }
[ "@", "Override", "public", "final", "JSONCompareResult", "compareJSON", "(", "JSONArray", "expected", ",", "JSONArray", "actual", ")", "throws", "JSONException", "{", "JSONCompareResult", "result", "=", "new", "JSONCompareResult", "(", ")", ";", "compareJSONArray", ...
Compares JSONArray provided to the expected JSONArray, and returns the results of the comparison. @param expected Expected JSONArray @param actual JSONArray to compare @throws JSONException JSON parsing error
[ "Compares", "JSONArray", "provided", "to", "the", "expected", "JSONArray", "and", "returns", "the", "results", "of", "the", "comparison", "." ]
830efcf546d07f955d8a213cc5c8a1db34d78f04
https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/comparator/AbstractComparator.java#L53-L58
train
skyscreamer/JSONassert
src/main/java/org/skyscreamer/jsonassert/comparator/AbstractComparator.java
AbstractComparator.recursivelyCompareJSONArray
protected void recursivelyCompareJSONArray(String key, JSONArray expected, JSONArray actual, JSONCompareResult result) throws JSONException { Set<Integer> matched = new HashSet<Integer>(); for (int i = 0; i < expected.length(); ++i) { Object exp...
java
protected void recursivelyCompareJSONArray(String key, JSONArray expected, JSONArray actual, JSONCompareResult result) throws JSONException { Set<Integer> matched = new HashSet<Integer>(); for (int i = 0; i < expected.length(); ++i) { Object exp...
[ "protected", "void", "recursivelyCompareJSONArray", "(", "String", "key", ",", "JSONArray", "expected", ",", "JSONArray", "actual", ",", "JSONCompareResult", "result", ")", "throws", "JSONException", "{", "Set", "<", "Integer", ">", "matched", "=", "new", "HashSet...
easy way to uniquely identify each element.
[ "easy", "way", "to", "uniquely", "identify", "each", "element", "." ]
830efcf546d07f955d8a213cc5c8a1db34d78f04
https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/comparator/AbstractComparator.java#L137-L171
train
skyscreamer/JSONassert
src/main/java/org/skyscreamer/jsonassert/JSONCompareResult.java
JSONCompareResult.missing
public JSONCompareResult missing(String field, Object expected) { _fieldMissing.add(new FieldComparisonFailure(field, expected, null)); fail(formatMissing(field, expected)); return this; }
java
public JSONCompareResult missing(String field, Object expected) { _fieldMissing.add(new FieldComparisonFailure(field, expected, null)); fail(formatMissing(field, expected)); return this; }
[ "public", "JSONCompareResult", "missing", "(", "String", "field", ",", "Object", "expected", ")", "{", "_fieldMissing", ".", "add", "(", "new", "FieldComparisonFailure", "(", "field", ",", "expected", ",", "null", ")", ")", ";", "fail", "(", "formatMissing", ...
Identify the missing field @param field missing field @param expected expected result @return result of comparison
[ "Identify", "the", "missing", "field" ]
830efcf546d07f955d8a213cc5c8a1db34d78f04
https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/JSONCompareResult.java#L210-L214
train
skyscreamer/JSONassert
src/main/java/org/skyscreamer/jsonassert/JSONCompareResult.java
JSONCompareResult.unexpected
public JSONCompareResult unexpected(String field, Object actual) { _fieldUnexpected.add(new FieldComparisonFailure(field, null, actual)); fail(formatUnexpected(field, actual)); return this; }
java
public JSONCompareResult unexpected(String field, Object actual) { _fieldUnexpected.add(new FieldComparisonFailure(field, null, actual)); fail(formatUnexpected(field, actual)); return this; }
[ "public", "JSONCompareResult", "unexpected", "(", "String", "field", ",", "Object", "actual", ")", "{", "_fieldUnexpected", ".", "add", "(", "new", "FieldComparisonFailure", "(", "field", ",", "null", ",", "actual", ")", ")", ";", "fail", "(", "formatUnexpecte...
Identify unexpected field @param field unexpected field @param actual actual result @return result of comparison
[ "Identify", "unexpected", "field" ]
830efcf546d07f955d8a213cc5c8a1db34d78f04
https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/JSONCompareResult.java#L229-L233
train
skyscreamer/JSONassert
src/main/java/org/skyscreamer/jsonassert/comparator/JSONCompareUtil.java
JSONCompareUtil.allSimpleValues
public static boolean allSimpleValues(JSONArray array) throws JSONException { for (int i = 0; i < array.length(); ++i) { if (!isSimpleValue(array.get(i))) { return false; } } return true; }
java
public static boolean allSimpleValues(JSONArray array) throws JSONException { for (int i = 0; i < array.length(); ++i) { if (!isSimpleValue(array.get(i))) { return false; } } return true; }
[ "public", "static", "boolean", "allSimpleValues", "(", "JSONArray", "array", ")", "throws", "JSONException", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "array", ".", "length", "(", ")", ";", "++", "i", ")", "{", "if", "(", "!", "isSimpleVa...
Returns whether all of the elements in the given array are simple values. @param array the JSON array to iterate through on @return true if all the elements in {@code array} are simple values @throws JSONException JSON parsing error @see #isSimpleValue(Object)
[ "Returns", "whether", "all", "of", "the", "elements", "in", "the", "given", "array", "are", "simple", "values", "." ]
830efcf546d07f955d8a213cc5c8a1db34d78f04
https://github.com/skyscreamer/JSONassert/blob/830efcf546d07f955d8a213cc5c8a1db34d78f04/src/main/java/org/skyscreamer/jsonassert/comparator/JSONCompareUtil.java#L137-L144
train
jpardogo/GoogleProgressBar
example/src/main/java/com/jpardogo/android/googleprogressbar/calendarstock/ColorStateDrawable.java
ColorStateDrawable.getPressedColor
private int getPressedColor(int color) { float[] hsv = new float[3]; Color.colorToHSV(color, hsv); hsv[2] = hsv[2] * PRESSED_STATE_MULTIPLIER; return Color.HSVToColor(hsv); }
java
private int getPressedColor(int color) { float[] hsv = new float[3]; Color.colorToHSV(color, hsv); hsv[2] = hsv[2] * PRESSED_STATE_MULTIPLIER; return Color.HSVToColor(hsv); }
[ "private", "int", "getPressedColor", "(", "int", "color", ")", "{", "float", "[", "]", "hsv", "=", "new", "float", "[", "3", "]", ";", "Color", ".", "colorToHSV", "(", "color", ",", "hsv", ")", ";", "hsv", "[", "2", "]", "=", "hsv", "[", "2", "...
Given a particular color, adjusts its value by a multiplier.
[ "Given", "a", "particular", "color", "adjusts", "its", "value", "by", "a", "multiplier", "." ]
c90bff19179335298ebccea5f4621dd887c55ef1
https://github.com/jpardogo/GoogleProgressBar/blob/c90bff19179335298ebccea5f4621dd887c55ef1/example/src/main/java/com/jpardogo/android/googleprogressbar/calendarstock/ColorStateDrawable.java#L65-L70
train
jpardogo/GoogleProgressBar
example/src/main/java/com/jpardogo/android/googleprogressbar/calendarstock/ColorPickerPalette.java
ColorPickerPalette.drawPalette
public void drawPalette(int[] colors, int selectedColor) { if (colors == null) { return; } this.removeAllViews(); int tableElements = 0; int rowElements = 0; int rowNumber = 0; // Fills the table with swatches based on the array of colors. Ta...
java
public void drawPalette(int[] colors, int selectedColor) { if (colors == null) { return; } this.removeAllViews(); int tableElements = 0; int rowElements = 0; int rowNumber = 0; // Fills the table with swatches based on the array of colors. Ta...
[ "public", "void", "drawPalette", "(", "int", "[", "]", "colors", ",", "int", "selectedColor", ")", "{", "if", "(", "colors", "==", "null", ")", "{", "return", ";", "}", "this", ".", "removeAllViews", "(", ")", ";", "int", "tableElements", "=", "0", "...
Adds swatches to table in a serpentine format.
[ "Adds", "swatches", "to", "table", "in", "a", "serpentine", "format", "." ]
c90bff19179335298ebccea5f4621dd887c55ef1
https://github.com/jpardogo/GoogleProgressBar/blob/c90bff19179335298ebccea5f4621dd887c55ef1/example/src/main/java/com/jpardogo/android/googleprogressbar/calendarstock/ColorPickerPalette.java#L90-L127
train
jpardogo/GoogleProgressBar
example/src/main/java/com/jpardogo/android/googleprogressbar/calendarstock/ColorPickerPalette.java
ColorPickerPalette.createBlankSpace
private ImageView createBlankSpace() { ImageView view = new ImageView(getContext()); TableRow.LayoutParams params = new TableRow.LayoutParams(mSwatchLength, mSwatchLength); params.setMargins(mMarginSize, mMarginSize, mMarginSize, mMarginSize); view.setLayoutParams(params); return...
java
private ImageView createBlankSpace() { ImageView view = new ImageView(getContext()); TableRow.LayoutParams params = new TableRow.LayoutParams(mSwatchLength, mSwatchLength); params.setMargins(mMarginSize, mMarginSize, mMarginSize, mMarginSize); view.setLayoutParams(params); return...
[ "private", "ImageView", "createBlankSpace", "(", ")", "{", "ImageView", "view", "=", "new", "ImageView", "(", "getContext", "(", ")", ")", ";", "TableRow", ".", "LayoutParams", "params", "=", "new", "TableRow", ".", "LayoutParams", "(", "mSwatchLength", ",", ...
Creates a blank space to fill the row.
[ "Creates", "a", "blank", "space", "to", "fill", "the", "row", "." ]
c90bff19179335298ebccea5f4621dd887c55ef1
https://github.com/jpardogo/GoogleProgressBar/blob/c90bff19179335298ebccea5f4621dd887c55ef1/example/src/main/java/com/jpardogo/android/googleprogressbar/calendarstock/ColorPickerPalette.java#L171-L177
train
jpardogo/GoogleProgressBar
example/src/main/java/com/jpardogo/android/googleprogressbar/calendarstock/ColorPickerPalette.java
ColorPickerPalette.createColorSwatch
private ColorPickerSwatch createColorSwatch(int color, int selectedColor) { ColorPickerSwatch view = new ColorPickerSwatch(getContext(), color, color == selectedColor, mOnColorSelectedListener); TableRow.LayoutParams params = new TableRow.LayoutParams(mSwatchLength, mSwatchLength); ...
java
private ColorPickerSwatch createColorSwatch(int color, int selectedColor) { ColorPickerSwatch view = new ColorPickerSwatch(getContext(), color, color == selectedColor, mOnColorSelectedListener); TableRow.LayoutParams params = new TableRow.LayoutParams(mSwatchLength, mSwatchLength); ...
[ "private", "ColorPickerSwatch", "createColorSwatch", "(", "int", "color", ",", "int", "selectedColor", ")", "{", "ColorPickerSwatch", "view", "=", "new", "ColorPickerSwatch", "(", "getContext", "(", ")", ",", "color", ",", "color", "==", "selectedColor", ",", "m...
Creates a color swatch.
[ "Creates", "a", "color", "swatch", "." ]
c90bff19179335298ebccea5f4621dd887c55ef1
https://github.com/jpardogo/GoogleProgressBar/blob/c90bff19179335298ebccea5f4621dd887c55ef1/example/src/main/java/com/jpardogo/android/googleprogressbar/calendarstock/ColorPickerPalette.java#L182-L189
train
temyers/cucumber-jvm-parallel-plugin
src/main/java/com/github/timm/cucumber/generate/CucumberITGeneratorFactory.java
CucumberITGeneratorFactory.create
public CucumberITGenerator create(final ParallelScheme parallelScheme) throws MojoExecutionException { if (ParallelScheme.FEATURE.equals(parallelScheme)) { return createFileGeneratorByFeature(); } else { return createFileGeneratorByScenario(); } }
java
public CucumberITGenerator create(final ParallelScheme parallelScheme) throws MojoExecutionException { if (ParallelScheme.FEATURE.equals(parallelScheme)) { return createFileGeneratorByFeature(); } else { return createFileGeneratorByScenario(); } }
[ "public", "CucumberITGenerator", "create", "(", "final", "ParallelScheme", "parallelScheme", ")", "throws", "MojoExecutionException", "{", "if", "(", "ParallelScheme", ".", "FEATURE", ".", "equals", "(", "parallelScheme", ")", ")", "{", "return", "createFileGeneratorB...
Create a CucumberITGenerator based on the given parallel scheme. @param parallelScheme The scheme to use @return CucumberITGenerator @throws MojoExecutionException
[ "Create", "a", "CucumberITGenerator", "based", "on", "the", "given", "parallel", "scheme", "." ]
931628fc1e2822be667ec216e10e706993974aa4
https://github.com/temyers/cucumber-jvm-parallel-plugin/blob/931628fc1e2822be667ec216e10e706993974aa4/src/main/java/com/github/timm/cucumber/generate/CucumberITGeneratorFactory.java#L32-L39
train
temyers/cucumber-jvm-parallel-plugin
src/main/java/com/github/timm/cucumber/generate/CucumberITGeneratorByFeature.java
CucumberITGeneratorByFeature.createPluginStrings
private List<String> createPluginStrings() { final List<String> formatList = new ArrayList<String>(); for (final Plugin plugin : overriddenParameters.getPlugins()) { formatList.add(plugin.asPluginString(fileCounter)); } return formatList; }
java
private List<String> createPluginStrings() { final List<String> formatList = new ArrayList<String>(); for (final Plugin plugin : overriddenParameters.getPlugins()) { formatList.add(plugin.asPluginString(fileCounter)); } return formatList; }
[ "private", "List", "<", "String", ">", "createPluginStrings", "(", ")", "{", "final", "List", "<", "String", ">", "formatList", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "for", "(", "final", "Plugin", "plugin", ":", "overriddenParameters"...
Create the format string used for the output.
[ "Create", "the", "format", "string", "used", "for", "the", "output", "." ]
931628fc1e2822be667ec216e10e706993974aa4
https://github.com/temyers/cucumber-jvm-parallel-plugin/blob/931628fc1e2822be667ec216e10e706993974aa4/src/main/java/com/github/timm/cucumber/generate/CucumberITGeneratorByFeature.java#L207-L213
train
temyers/cucumber-jvm-parallel-plugin
src/main/java/com/github/timm/cucumber/generate/CucumberITGeneratorByScenario.java
CucumberITGeneratorByScenario.generateCucumberITFiles
public void generateCucumberITFiles(final File outputDirectory, final Collection<File> featureFiles) throws MojoExecutionException { Parser<GherkinDocument> parser = new Parser<GherkinDocument>(new AstBuilder()); TagPredicate tagPredicate = new TagPredicate(overri...
java
public void generateCucumberITFiles(final File outputDirectory, final Collection<File> featureFiles) throws MojoExecutionException { Parser<GherkinDocument> parser = new Parser<GherkinDocument>(new AstBuilder()); TagPredicate tagPredicate = new TagPredicate(overri...
[ "public", "void", "generateCucumberITFiles", "(", "final", "File", "outputDirectory", ",", "final", "Collection", "<", "File", ">", "featureFiles", ")", "throws", "MojoExecutionException", "{", "Parser", "<", "GherkinDocument", ">", "parser", "=", "new", "Parser", ...
Generates a Cucumber runner for each scenario, or example in a scenario outline. @param outputDirectory the output directory to place generated files @param featureFiles The feature files to create runners for @throws MojoExecutionException if something goes wrong
[ "Generates", "a", "Cucumber", "runner", "for", "each", "scenario", "or", "example", "in", "a", "scenario", "outline", "." ]
931628fc1e2822be667ec216e10e706993974aa4
https://github.com/temyers/cucumber-jvm-parallel-plugin/blob/931628fc1e2822be667ec216e10e706993974aa4/src/main/java/com/github/timm/cucumber/generate/CucumberITGeneratorByScenario.java#L100-L142
train
temyers/cucumber-jvm-parallel-plugin
src/main/java/com/github/timm/cucumber/generate/name/FeatureFileClassNamingScheme.java
FeatureFileClassNamingScheme.generate
public String generate(final String featureFileName) { String fileNameWithNoExtension = FilenameUtils.removeExtension(featureFileName); fileNameWithNoExtension = fileNameWithNoExtension.replaceAll("_", "-"); fileNameWithNoExtension = fileNameWithNoExtension.replaceAll(" ", ""); fileName...
java
public String generate(final String featureFileName) { String fileNameWithNoExtension = FilenameUtils.removeExtension(featureFileName); fileNameWithNoExtension = fileNameWithNoExtension.replaceAll("_", "-"); fileNameWithNoExtension = fileNameWithNoExtension.replaceAll(" ", ""); fileName...
[ "public", "String", "generate", "(", "final", "String", "featureFileName", ")", "{", "String", "fileNameWithNoExtension", "=", "FilenameUtils", ".", "removeExtension", "(", "featureFileName", ")", ";", "fileNameWithNoExtension", "=", "fileNameWithNoExtension", ".", "rep...
Generate a class name based on the supplied feature file.
[ "Generate", "a", "class", "name", "based", "on", "the", "supplied", "feature", "file", "." ]
931628fc1e2822be667ec216e10e706993974aa4
https://github.com/temyers/cucumber-jvm-parallel-plugin/blob/931628fc1e2822be667ec216e10e706993974aa4/src/main/java/com/github/timm/cucumber/generate/name/FeatureFileClassNamingScheme.java#L30-L47
train
temyers/cucumber-jvm-parallel-plugin
src/main/java/com/github/timm/cucumber/generate/name/PatternNamingScheme.java
PatternNamingScheme.generate
public String generate(final String featureFileName) { String className = pattern.replace("{f}", featureFileNamingScheme.generate(featureFileName)); int number = counter.next(); className = replaceAll( COUNTER_PATTERN, className, number); className = replaceAll(...
java
public String generate(final String featureFileName) { String className = pattern.replace("{f}", featureFileNamingScheme.generate(featureFileName)); int number = counter.next(); className = replaceAll( COUNTER_PATTERN, className, number); className = replaceAll(...
[ "public", "String", "generate", "(", "final", "String", "featureFileName", ")", "{", "String", "className", "=", "pattern", ".", "replace", "(", "\"{f}\"", ",", "featureFileNamingScheme", ".", "generate", "(", "featureFileName", ")", ")", ";", "int", "number", ...
Generate a class name using the required pattern and feature file. @param featureFileName The feature file to generate a class name for @return A class name based on the required pattern.
[ "Generate", "a", "class", "name", "using", "the", "required", "pattern", "and", "feature", "file", "." ]
931628fc1e2822be667ec216e10e706993974aa4
https://github.com/temyers/cucumber-jvm-parallel-plugin/blob/931628fc1e2822be667ec216e10e706993974aa4/src/main/java/com/github/timm/cucumber/generate/name/PatternNamingScheme.java#L56-L65
train
temyers/cucumber-jvm-parallel-plugin
src/main/java/com/github/timm/cucumber/generate/GenerateRunnersMojo.java
GenerateRunnersMojo.execute
public void execute() throws MojoExecutionException { if (!featuresDirectory.exists()) { throw new MojoExecutionException("Features directory does not exist"); } final Collection<File> featureFiles = listFiles(featuresDirectory, new String[] {"feature"}, true); final List<F...
java
public void execute() throws MojoExecutionException { if (!featuresDirectory.exists()) { throw new MojoExecutionException("Features directory does not exist"); } final Collection<File> featureFiles = listFiles(featuresDirectory, new String[] {"feature"}, true); final List<F...
[ "public", "void", "execute", "(", ")", "throws", "MojoExecutionException", "{", "if", "(", "!", "featuresDirectory", ".", "exists", "(", ")", ")", "{", "throw", "new", "MojoExecutionException", "(", "\"Features directory does not exist\"", ")", ";", "}", "final", ...
Called by Maven to run this mojo after parameters have been injected.
[ "Called", "by", "Maven", "to", "run", "this", "mojo", "after", "parameters", "have", "been", "injected", "." ]
931628fc1e2822be667ec216e10e706993974aa4
https://github.com/temyers/cucumber-jvm-parallel-plugin/blob/931628fc1e2822be667ec216e10e706993974aa4/src/main/java/com/github/timm/cucumber/generate/GenerateRunnersMojo.java#L190-L216
train
temyers/cucumber-jvm-parallel-plugin
src/main/java/com/github/timm/cucumber/generate/GenerateRunnersMojo.java
GenerateRunnersMojo.overrideParametersWithCucumberOptions
private OverriddenCucumberOptionsParameters overrideParametersWithCucumberOptions() throws MojoExecutionException { try { final OverriddenCucumberOptionsParameters overriddenParameters = new OverriddenCucumberOptionsParameters() .setTags(tags) ...
java
private OverriddenCucumberOptionsParameters overrideParametersWithCucumberOptions() throws MojoExecutionException { try { final OverriddenCucumberOptionsParameters overriddenParameters = new OverriddenCucumberOptionsParameters() .setTags(tags) ...
[ "private", "OverriddenCucumberOptionsParameters", "overrideParametersWithCucumberOptions", "(", ")", "throws", "MojoExecutionException", "{", "try", "{", "final", "OverriddenCucumberOptionsParameters", "overriddenParameters", "=", "new", "OverriddenCucumberOptionsParameters", "(", ...
Overrides the parameters with cucumber.options if they have been specified. Plugins have somewhat limited support.
[ "Overrides", "the", "parameters", "with", "cucumber", ".", "options", "if", "they", "have", "been", "specified", ".", "Plugins", "have", "somewhat", "limited", "support", "." ]
931628fc1e2822be667ec216e10e706993974aa4
https://github.com/temyers/cucumber-jvm-parallel-plugin/blob/931628fc1e2822be667ec216e10e706993974aa4/src/main/java/com/github/timm/cucumber/generate/GenerateRunnersMojo.java#L238-L264
train
onepf/OpenIAB
library/src/main/java/org/onepf/oms/OpenIabHelper.java
OpenIabHelper.startSetup
public void startSetup(@NotNull final OnIabSetupFinishedListener listener) { if (options != null) { Logger.d("startSetup() options = ", options); } //noinspection ConstantConditions if (listener == null) { throw new IllegalArgumentException("Setup listener must be...
java
public void startSetup(@NotNull final OnIabSetupFinishedListener listener) { if (options != null) { Logger.d("startSetup() options = ", options); } //noinspection ConstantConditions if (listener == null) { throw new IllegalArgumentException("Setup listener must be...
[ "public", "void", "startSetup", "(", "@", "NotNull", "final", "OnIabSetupFinishedListener", "listener", ")", "{", "if", "(", "options", "!=", "null", ")", "{", "Logger", ".", "d", "(", "\"startSetup() options = \"", ",", "options", ")", ";", "}", "//noinspecti...
Discovers all available stores and selects the best billing service. Should be called from the UI thread @param listener The listener to call when setup is completed
[ "Discovers", "all", "available", "stores", "and", "selects", "the", "best", "billing", "service", ".", "Should", "be", "called", "from", "the", "UI", "thread" ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/OpenIabHelper.java#L472-L552
train
onepf/OpenIAB
library/src/main/java/org/onepf/oms/OpenIabHelper.java
OpenIabHelper.discoverOpenStores
public @Nullable List<Appstore> discoverOpenStores() { if (Utils.uiThread()) { throw new IllegalStateException("Must not be called from UI thread"); } final List<Appstore> openAppstores = new ArrayList<Appstore>(); final CountDownLatch countDownLatch = new CountDownL...
java
public @Nullable List<Appstore> discoverOpenStores() { if (Utils.uiThread()) { throw new IllegalStateException("Must not be called from UI thread"); } final List<Appstore> openAppstores = new ArrayList<Appstore>(); final CountDownLatch countDownLatch = new CountDownL...
[ "public", "@", "Nullable", "List", "<", "Appstore", ">", "discoverOpenStores", "(", ")", "{", "if", "(", "Utils", ".", "uiThread", "(", ")", ")", "{", "throw", "new", "IllegalStateException", "(", "\"Must not be called from UI thread\"", ")", ";", "}", "final"...
Discovers a list of all available Open Stores. @return a list of all available Open Stores.
[ "Discovers", "a", "list", "of", "all", "available", "Open", "Stores", "." ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/OpenIabHelper.java#L965-L987
train
onepf/OpenIAB
library/src/main/java/org/onepf/oms/OpenIabHelper.java
OpenIabHelper.discoverOpenStores
public void discoverOpenStores(@NotNull final OpenStoresDiscoveredListener listener) { final List<ServiceInfo> serviceInfos = queryOpenStoreServices(); final Queue<Intent> bindServiceIntents = new LinkedList<Intent>(); for (final ServiceInfo serviceInfo : serviceInfos) { bindServiceI...
java
public void discoverOpenStores(@NotNull final OpenStoresDiscoveredListener listener) { final List<ServiceInfo> serviceInfos = queryOpenStoreServices(); final Queue<Intent> bindServiceIntents = new LinkedList<Intent>(); for (final ServiceInfo serviceInfo : serviceInfos) { bindServiceI...
[ "public", "void", "discoverOpenStores", "(", "@", "NotNull", "final", "OpenStoresDiscoveredListener", "listener", ")", "{", "final", "List", "<", "ServiceInfo", ">", "serviceInfos", "=", "queryOpenStoreServices", "(", ")", ";", "final", "Queue", "<", "Intent", ">"...
Discovers Open Stores. @param listener The callback to handle the result with a list of Open Stores
[ "Discovers", "Open", "Stores", "." ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/OpenIabHelper.java#L994-L1002
train
onepf/OpenIAB
library/src/main/java/org/onepf/oms/OpenIabHelper.java
OpenIabHelper.queryInventoryAsync
public void queryInventoryAsync(final boolean querySkuDetails, @Nullable final List<String> moreItemSkus, @Nullable final List<String> moreSubsSkus, @NotNull final IabHelper.QueryInventoryFinishedListener listene...
java
public void queryInventoryAsync(final boolean querySkuDetails, @Nullable final List<String> moreItemSkus, @Nullable final List<String> moreSubsSkus, @NotNull final IabHelper.QueryInventoryFinishedListener listene...
[ "public", "void", "queryInventoryAsync", "(", "final", "boolean", "querySkuDetails", ",", "@", "Nullable", "final", "List", "<", "String", ">", "moreItemSkus", ",", "@", "Nullable", "final", "List", "<", "String", ">", "moreSubsSkus", ",", "@", "NotNull", "fin...
Queries the inventory. This will query all owned items from the server, as well as information on additional skus, if specified. This method may block or take long to execute. @param querySkuDetails if true, SKU details (price, description, etc) will be queried as well as purchase information. @param moreItemSkus a...
[ "Queries", "the", "inventory", ".", "This", "will", "query", "all", "owned", "items", "from", "the", "server", "as", "well", "as", "information", "on", "additional", "skus", "if", "specified", ".", "This", "method", "may", "block", "or", "take", "long", "t...
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/OpenIabHelper.java#L1437-L1469
train
onepf/OpenIAB
library/src/main/java/org/onepf/oms/OpenIabHelper.java
OpenIabHelper.checkSetupDone
void checkSetupDone(String operation) { if (!setupSuccessful()) { String stateToString = setupStateToString(setupState); Logger.e("Illegal state for operation (", operation, "): ", stateToString); throw new IllegalStateException(stateToString + " Can't perform operation: " + ...
java
void checkSetupDone(String operation) { if (!setupSuccessful()) { String stateToString = setupStateToString(setupState); Logger.e("Illegal state for operation (", operation, "): ", stateToString); throw new IllegalStateException(stateToString + " Can't perform operation: " + ...
[ "void", "checkSetupDone", "(", "String", "operation", ")", "{", "if", "(", "!", "setupSuccessful", "(", ")", ")", "{", "String", "stateToString", "=", "setupStateToString", "(", "setupState", ")", ";", "Logger", ".", "e", "(", "\"Illegal state for operation (\""...
Checks that setup was done; if not, throws an exception.
[ "Checks", "that", "setup", "was", "done", ";", "if", "not", "throws", "an", "exception", "." ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/OpenIabHelper.java#L1541-L1547
train
onepf/OpenIAB
library/src/main/java/org/onepf/oms/SkuManager.java
SkuManager.getAllStoreSkus
@Nullable public List<String> getAllStoreSkus(@NotNull final String appstoreName) { if (TextUtils.isEmpty(appstoreName)) { throw SkuMappingException.newInstance(SkuMappingException.REASON_STORE_NAME); } Map<String, String> skuMap = sku2storeSkuMappings.get(appstoreName); ...
java
@Nullable public List<String> getAllStoreSkus(@NotNull final String appstoreName) { if (TextUtils.isEmpty(appstoreName)) { throw SkuMappingException.newInstance(SkuMappingException.REASON_STORE_NAME); } Map<String, String> skuMap = sku2storeSkuMappings.get(appstoreName); ...
[ "@", "Nullable", "public", "List", "<", "String", ">", "getAllStoreSkus", "(", "@", "NotNull", "final", "String", "appstoreName", ")", "{", "if", "(", "TextUtils", ".", "isEmpty", "(", "appstoreName", ")", ")", "{", "throw", "SkuMappingException", ".", "newI...
Returns a list of SKU for a store. @param appstoreName The app store name. @return list of SKU that mapped to the store. Null if the store has no mapped SKUs. @throws java.lang.IllegalArgumentException If the store name is null or empty. @see #mapSku(String, String, String)
[ "Returns", "a", "list", "of", "SKU", "for", "a", "store", "." ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/SkuManager.java#L205-L214
train
onepf/OpenIAB
samples/trivialdrive/src/main/java/org/onepf/sample/trivialdrive/MainActivity.java
MainActivity.onBuyGasButtonClicked
public void onBuyGasButtonClicked(View arg0) { Log.d(TAG, "Buy gas button clicked."); if (mSubscribedToInfiniteGas) { complain("No need! You're subscribed to infinite gas. Isn't that awesome?"); return; } if (mTank >= TANK_MAX) { complain("Your tank ...
java
public void onBuyGasButtonClicked(View arg0) { Log.d(TAG, "Buy gas button clicked."); if (mSubscribedToInfiniteGas) { complain("No need! You're subscribed to infinite gas. Isn't that awesome?"); return; } if (mTank >= TANK_MAX) { complain("Your tank ...
[ "public", "void", "onBuyGasButtonClicked", "(", "View", "arg0", ")", "{", "Log", ".", "d", "(", "TAG", ",", "\"Buy gas button clicked.\"", ")", ";", "if", "(", "mSubscribedToInfiniteGas", ")", "{", "complain", "(", "\"No need! You're subscribed to infinite gas. Isn't ...
User clicked the "Buy Gas" button
[ "User", "clicked", "the", "Buy", "Gas", "button" ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/samples/trivialdrive/src/main/java/org/onepf/sample/trivialdrive/MainActivity.java#L233-L266
train
onepf/OpenIAB
samples/trivialdrive/src/main/java/org/onepf/sample/trivialdrive/MainActivity.java
MainActivity.onUpgradeAppButtonClicked
public void onUpgradeAppButtonClicked(View arg0) { Log.d(TAG, "Upgrade button clicked; launching purchase flow for upgrade."); if (setupDone == null) { complain("Billing Setup is not completed yet"); return; } if (!setupDone) { complain("Billing Setu...
java
public void onUpgradeAppButtonClicked(View arg0) { Log.d(TAG, "Upgrade button clicked; launching purchase flow for upgrade."); if (setupDone == null) { complain("Billing Setup is not completed yet"); return; } if (!setupDone) { complain("Billing Setu...
[ "public", "void", "onUpgradeAppButtonClicked", "(", "View", "arg0", ")", "{", "Log", ".", "d", "(", "TAG", ",", "\"Upgrade button clicked; launching purchase flow for upgrade.\"", ")", ";", "if", "(", "setupDone", "==", "null", ")", "{", "complain", "(", "\"Billin...
User clicked the "Upgrade to Premium" button.
[ "User", "clicked", "the", "Upgrade", "to", "Premium", "button", "." ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/samples/trivialdrive/src/main/java/org/onepf/sample/trivialdrive/MainActivity.java#L269-L291
train
onepf/OpenIAB
samples/trivialdrive/src/main/java/org/onepf/sample/trivialdrive/MainActivity.java
MainActivity.onInfiniteGasButtonClicked
public void onInfiniteGasButtonClicked(View arg0) { if (setupDone == null) { complain("Billing Setup is not completed yet"); return; } if (!setupDone) { complain("Billing Setup failed"); return; } if (!mHelper.subscriptionsSupport...
java
public void onInfiniteGasButtonClicked(View arg0) { if (setupDone == null) { complain("Billing Setup is not completed yet"); return; } if (!setupDone) { complain("Billing Setup failed"); return; } if (!mHelper.subscriptionsSupport...
[ "public", "void", "onInfiniteGasButtonClicked", "(", "View", "arg0", ")", "{", "if", "(", "setupDone", "==", "null", ")", "{", "complain", "(", "\"Billing Setup is not completed yet\"", ")", ";", "return", ";", "}", "if", "(", "!", "setupDone", ")", "{", "co...
flow for subscription.
[ "flow", "for", "subscription", "." ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/samples/trivialdrive/src/main/java/org/onepf/sample/trivialdrive/MainActivity.java#L295-L321
train
onepf/OpenIAB
samples/trivialdrive/src/main/java/org/onepf/sample/trivialdrive/MainActivity.java
MainActivity.onDriveButtonClicked
public void onDriveButtonClicked(View arg0) { Log.d(TAG, "Drive button clicked."); if (!mSubscribedToInfiniteGas && mTank <= 0) alert(R.string.out_of_gas_msg); else { if (!mSubscribedToInfiniteGas) --mTank; saveData(); alert(R.string.spent_gas_msg)...
java
public void onDriveButtonClicked(View arg0) { Log.d(TAG, "Drive button clicked."); if (!mSubscribedToInfiniteGas && mTank <= 0) alert(R.string.out_of_gas_msg); else { if (!mSubscribedToInfiniteGas) --mTank; saveData(); alert(R.string.spent_gas_msg)...
[ "public", "void", "onDriveButtonClicked", "(", "View", "arg0", ")", "{", "Log", ".", "d", "(", "TAG", ",", "\"Drive button clicked.\"", ")", ";", "if", "(", "!", "mSubscribedToInfiniteGas", "&&", "mTank", "<=", "0", ")", "alert", "(", "R", ".", "string", ...
Drive button clicked. Burn gas!
[ "Drive", "button", "clicked", ".", "Burn", "gas!" ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/samples/trivialdrive/src/main/java/org/onepf/sample/trivialdrive/MainActivity.java#L441-L452
train
onepf/OpenIAB
samples/trivialdrive/src/main/java/org/onepf/sample/trivialdrive/MainActivity.java
MainActivity.onDestroy
@Override public void onDestroy() { super.onDestroy(); // very important: Log.d(TAG, "Destroying helper."); if (mHelper != null) mHelper.dispose(); mHelper = null; }
java
@Override public void onDestroy() { super.onDestroy(); // very important: Log.d(TAG, "Destroying helper."); if (mHelper != null) mHelper.dispose(); mHelper = null; }
[ "@", "Override", "public", "void", "onDestroy", "(", ")", "{", "super", ".", "onDestroy", "(", ")", ";", "// very important:", "Log", ".", "d", "(", "TAG", ",", "\"Destroying helper.\"", ")", ";", "if", "(", "mHelper", "!=", "null", ")", "mHelper", ".", ...
We're being destroyed. It's important to dispose of the helper here!
[ "We", "re", "being", "destroyed", ".", "It", "s", "important", "to", "dispose", "of", "the", "helper", "here!" ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/samples/trivialdrive/src/main/java/org/onepf/sample/trivialdrive/MainActivity.java#L455-L463
train
onepf/OpenIAB
samples/trivialdrive/src/main/java/org/onepf/sample/trivialdrive/MainActivity.java
MainActivity.updateUi
public void updateUi() { // update the car color to reflect premium status or lack thereof ((ImageView) findViewById(R.id.free_or_premium)).setImageResource(mIsPremium ? R.drawable.premium : R.drawable.free); // "Upgrade" button is only visible if the user is not premium findViewById(R....
java
public void updateUi() { // update the car color to reflect premium status or lack thereof ((ImageView) findViewById(R.id.free_or_premium)).setImageResource(mIsPremium ? R.drawable.premium : R.drawable.free); // "Upgrade" button is only visible if the user is not premium findViewById(R....
[ "public", "void", "updateUi", "(", ")", "{", "// update the car color to reflect premium status or lack thereof", "(", "(", "ImageView", ")", "findViewById", "(", "R", ".", "id", ".", "free_or_premium", ")", ")", ".", "setImageResource", "(", "mIsPremium", "?", "R",...
updates UI to reflect model
[ "updates", "UI", "to", "reflect", "model" ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/samples/trivialdrive/src/main/java/org/onepf/sample/trivialdrive/MainActivity.java#L466-L484
train
onepf/OpenIAB
samples/trivialdrive/src/main/java/org/onepf/sample/trivialdrive/MainActivity.java
MainActivity.setWaitScreen
void setWaitScreen(boolean set) { findViewById(R.id.screen_main).setVisibility(set ? View.GONE : View.VISIBLE); findViewById(R.id.screen_wait).setVisibility(set ? View.VISIBLE : View.GONE); }
java
void setWaitScreen(boolean set) { findViewById(R.id.screen_main).setVisibility(set ? View.GONE : View.VISIBLE); findViewById(R.id.screen_wait).setVisibility(set ? View.VISIBLE : View.GONE); }
[ "void", "setWaitScreen", "(", "boolean", "set", ")", "{", "findViewById", "(", "R", ".", "id", ".", "screen_main", ")", ".", "setVisibility", "(", "set", "?", "View", ".", "GONE", ":", "View", ".", "VISIBLE", ")", ";", "findViewById", "(", "R", ".", ...
Enables or disables the "please wait" screen.
[ "Enables", "or", "disables", "the", "please", "wait", "screen", "." ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/samples/trivialdrive/src/main/java/org/onepf/sample/trivialdrive/MainActivity.java#L487-L490
train
onepf/OpenIAB
library/src/main/java/org/onepf/oms/appstore/googleUtils/Inventory.java
Inventory.getAllOwnedSkus
@NotNull public List<String> getAllOwnedSkus(String itemType) { List<String> result = new ArrayList<String>(); for (Purchase p : mPurchaseMap.values()) { if (p.getItemType().equals(itemType)) result.add(p.getSku()); } return result; }
java
@NotNull public List<String> getAllOwnedSkus(String itemType) { List<String> result = new ArrayList<String>(); for (Purchase p : mPurchaseMap.values()) { if (p.getItemType().equals(itemType)) result.add(p.getSku()); } return result; }
[ "@", "NotNull", "public", "List", "<", "String", ">", "getAllOwnedSkus", "(", "String", "itemType", ")", "{", "List", "<", "String", ">", "result", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "for", "(", "Purchase", "p", ":", "mPurchase...
Returns a list of all owned product IDs of a given type
[ "Returns", "a", "list", "of", "all", "owned", "product", "IDs", "of", "a", "given", "type" ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/appstore/googleUtils/Inventory.java#L89-L96
train
onepf/OpenIAB
library/src/main/java/org/onepf/oms/util/Utils.java
Utils.packageInstalled
public static boolean packageInstalled(@NotNull final Context context, @NotNull final String packageName) { final PackageManager packageManager = context.getPackageManager(); boolean result = false; try { packageManager.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES); ...
java
public static boolean packageInstalled(@NotNull final Context context, @NotNull final String packageName) { final PackageManager packageManager = context.getPackageManager(); boolean result = false; try { packageManager.getPackageInfo(packageName, PackageManager.GET_ACTIVITIES); ...
[ "public", "static", "boolean", "packageInstalled", "(", "@", "NotNull", "final", "Context", "context", ",", "@", "NotNull", "final", "String", "packageName", ")", "{", "final", "PackageManager", "packageManager", "=", "context", ".", "getPackageManager", "(", ")",...
Checks if an application is installed. @return true if the current thread it the UI thread.
[ "Checks", "if", "an", "application", "is", "installed", "." ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/util/Utils.java#L53-L63
train
onepf/OpenIAB
library/src/main/java/org/onepf/oms/util/Utils.java
Utils.isPackageInstaller
public static boolean isPackageInstaller(@NotNull final Context context, final String packageName) { final PackageManager packageManager = context.getPackageManager(); final String installerPackageName = packageManager.getInstallerPackageName(context.getPackageName()); boolean isPackageInstaller...
java
public static boolean isPackageInstaller(@NotNull final Context context, final String packageName) { final PackageManager packageManager = context.getPackageManager(); final String installerPackageName = packageManager.getInstallerPackageName(context.getPackageName()); boolean isPackageInstaller...
[ "public", "static", "boolean", "isPackageInstaller", "(", "@", "NotNull", "final", "Context", "context", ",", "final", "String", "packageName", ")", "{", "final", "PackageManager", "packageManager", "=", "context", ".", "getPackageManager", "(", ")", ";", "final",...
Checks if an application with the passed name is the installer of the calling app. @param packageName The package name of the tested application. @return true if the application with the passed package is the installer.
[ "Checks", "if", "an", "application", "with", "the", "passed", "name", "is", "the", "installer", "of", "the", "calling", "app", "." ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/util/Utils.java#L71-L77
train
onepf/OpenIAB
library/src/main/java/org/onepf/oms/appstore/FortumoStore.java
FortumoStore.isNookDevice
private static boolean isNookDevice() { String brand = Build.BRAND; String manufacturer = System.getProperty("ro.nook.manufacturer"); return ((brand != null && brand.equalsIgnoreCase("nook")) || manufacturer != null && manufacturer.equalsIgnoreCase("nook")); }
java
private static boolean isNookDevice() { String brand = Build.BRAND; String manufacturer = System.getProperty("ro.nook.manufacturer"); return ((brand != null && brand.equalsIgnoreCase("nook")) || manufacturer != null && manufacturer.equalsIgnoreCase("nook")); }
[ "private", "static", "boolean", "isNookDevice", "(", ")", "{", "String", "brand", "=", "Build", ".", "BRAND", ";", "String", "manufacturer", "=", "System", ".", "getProperty", "(", "\"ro.nook.manufacturer\"", ")", ";", "return", "(", "(", "brand", "!=", "nul...
todo check for different devices
[ "todo", "check", "for", "different", "devices" ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/appstore/FortumoStore.java#L104-L109
train
onepf/OpenIAB
library/src/main/java/org/onepf/oms/appstore/NokiaStore.java
NokiaStore.isPackageInstaller
@Override public boolean isPackageInstaller(final String packageName) { Logger.d("sPackageInstaller: packageName = ", packageName); final PackageManager packageManager = context.getPackageManager(); final String installerPackageName = packageManager.getInstallerPackageName(packageName); ...
java
@Override public boolean isPackageInstaller(final String packageName) { Logger.d("sPackageInstaller: packageName = ", packageName); final PackageManager packageManager = context.getPackageManager(); final String installerPackageName = packageManager.getInstallerPackageName(packageName); ...
[ "@", "Override", "public", "boolean", "isPackageInstaller", "(", "final", "String", "packageName", ")", "{", "Logger", ".", "d", "(", "\"sPackageInstaller: packageName = \"", ",", "packageName", ")", ";", "final", "PackageManager", "packageManager", "=", "context", ...
Returns true only if actual installer for specified app
[ "Returns", "true", "only", "if", "actual", "installer", "for", "specified", "app" ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/appstore/NokiaStore.java#L84-L94
train
onepf/OpenIAB
library/src/main/java/org/onepf/oms/appstore/NokiaStore.java
NokiaStore.verifyFingreprint
private boolean verifyFingreprint() { try { PackageInfo info = context .getPackageManager() .getPackageInfo(NOKIA_INSTALLER, PackageManager.GET_SIGNATURES); if (info.signatures.length == 1) { byte[] cert = info.signatures[0].toByt...
java
private boolean verifyFingreprint() { try { PackageInfo info = context .getPackageManager() .getPackageInfo(NOKIA_INSTALLER, PackageManager.GET_SIGNATURES); if (info.signatures.length == 1) { byte[] cert = info.signatures[0].toByt...
[ "private", "boolean", "verifyFingreprint", "(", ")", "{", "try", "{", "PackageInfo", "info", "=", "context", ".", "getPackageManager", "(", ")", ".", "getPackageInfo", "(", "NOKIA_INSTALLER", ",", "PackageManager", ".", "GET_SIGNATURES", ")", ";", "if", "(", "...
Checks SHA1 fingerprint of the enabler @return true if signature matches, false if package is not found or signature does not match.
[ "Checks", "SHA1", "fingerprint", "of", "the", "enabler" ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/appstore/NokiaStore.java#L121-L146
train
onepf/OpenIAB
library/src/main/java/org/onepf/oms/util/Logger.java
Logger.setLogTag
public static void setLogTag(final String logTag) { Logger.logTag = TextUtils.isEmpty(logTag) ? LOG_TAG : logTag; }
java
public static void setLogTag(final String logTag) { Logger.logTag = TextUtils.isEmpty(logTag) ? LOG_TAG : logTag; }
[ "public", "static", "void", "setLogTag", "(", "final", "String", "logTag", ")", "{", "Logger", ".", "logTag", "=", "TextUtils", ".", "isEmpty", "(", "logTag", ")", "?", "LOG_TAG", ":", "logTag", ";", "}" ]
Sets the log tag. @param logTag The new tag value.
[ "Sets", "the", "log", "tag", "." ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/util/Logger.java#L72-L74
train
onepf/OpenIAB
library/src/main/java/org/onepf/oms/appstore/googleUtils/IabHelper.java
IabHelper.startSetupIabAsync
private void startSetupIabAsync(final String packageName, final OnIabSetupFinishedListener listener) { new Thread(new Runnable() { @Override public void run() { try { Logger.d("Checking for in-app billing 3 support."); // check for in-app bill...
java
private void startSetupIabAsync(final String packageName, final OnIabSetupFinishedListener listener) { new Thread(new Runnable() { @Override public void run() { try { Logger.d("Checking for in-app billing 3 support."); // check for in-app bill...
[ "private", "void", "startSetupIabAsync", "(", "final", "String", "packageName", ",", "final", "OnIabSetupFinishedListener", "listener", ")", "{", "new", "Thread", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", ...
Performs Iab setup with the mService object which must be properly connected before calling this method.
[ "Performs", "Iab", "setup", "with", "the", "mService", "object", "which", "must", "be", "properly", "connected", "before", "calling", "this", "method", "." ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/appstore/googleUtils/IabHelper.java#L267-L310
train
onepf/OpenIAB
library/src/main/java/org/onepf/oms/appstore/googleUtils/IabHelper.java
IabHelper.getServiceIntent
protected Intent getServiceIntent() { final Intent intent = new Intent(GooglePlay.VENDING_ACTION); intent.setPackage(GooglePlay.ANDROID_INSTALLER); return intent; }
java
protected Intent getServiceIntent() { final Intent intent = new Intent(GooglePlay.VENDING_ACTION); intent.setPackage(GooglePlay.ANDROID_INSTALLER); return intent; }
[ "protected", "Intent", "getServiceIntent", "(", ")", "{", "final", "Intent", "intent", "=", "new", "Intent", "(", "GooglePlay", ".", "VENDING_ACTION", ")", ";", "intent", ".", "setPackage", "(", "GooglePlay", ".", "ANDROID_INSTALLER", ")", ";", "return", "inte...
IabHelper code is shared between OpenStore and Google Play, but services has different names
[ "IabHelper", "code", "is", "shared", "between", "OpenStore", "and", "Google", "Play", "but", "services", "has", "different", "names" ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/appstore/googleUtils/IabHelper.java#L315-L319
train
onepf/OpenIAB
library/src/main/java/org/onepf/oms/appstore/googleUtils/IabHelper.java
IabHelper.getResponseDesc
public static String getResponseDesc(int code) { String[] iab_msgs = ("0:OK/1:User Canceled/2:Unknown/" + "3:Billing Unavailable/4:Item unavailable/" + "5:Developer Error/6:Error/7:Item Already Owned/" + "8:Item not owned").split("/"); String[] iabhelper_m...
java
public static String getResponseDesc(int code) { String[] iab_msgs = ("0:OK/1:User Canceled/2:Unknown/" + "3:Billing Unavailable/4:Item unavailable/" + "5:Developer Error/6:Error/7:Item Already Owned/" + "8:Item not owned").split("/"); String[] iabhelper_m...
[ "public", "static", "String", "getResponseDesc", "(", "int", "code", ")", "{", "String", "[", "]", "iab_msgs", "=", "(", "\"0:OK/1:User Canceled/2:Unknown/\"", "+", "\"3:Billing Unavailable/4:Item unavailable/\"", "+", "\"5:Developer Error/6:Error/7:Item Already Owned/\"", "+...
Returns a human-readable description for the given response code. @param code The response code @return A human-readable string explaining the result code. It also includes the result code numerically.
[ "Returns", "a", "human", "-", "readable", "description", "for", "the", "given", "response", "code", "." ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/appstore/googleUtils/IabHelper.java#L814-L839
train
onepf/OpenIAB
library/src/main/java/org/onepf/oms/appstore/nokiaUtils/NokiaStoreHelper.java
NokiaStoreHelper.processPurchaseSuccess
private void processPurchaseSuccess(final String purchaseData) { Logger.i("NokiaStoreHelper.processPurchaseSuccess"); Logger.d("purchaseData = ", purchaseData); Purchase purchase; try { final JSONObject obj = new JSONObject(purchaseData); final String sku = SkuM...
java
private void processPurchaseSuccess(final String purchaseData) { Logger.i("NokiaStoreHelper.processPurchaseSuccess"); Logger.d("purchaseData = ", purchaseData); Purchase purchase; try { final JSONObject obj = new JSONObject(purchaseData); final String sku = SkuM...
[ "private", "void", "processPurchaseSuccess", "(", "final", "String", "purchaseData", ")", "{", "Logger", ".", "i", "(", "\"NokiaStoreHelper.processPurchaseSuccess\"", ")", ";", "Logger", ".", "d", "(", "\"purchaseData = \"", ",", "purchaseData", ")", ";", "Purchase"...
Called if purchase has been successful @param purchaseData Response code for IabResult
[ "Called", "if", "purchase", "has", "been", "successful" ]
90552d53c5303b322940d96a0c4b7cb797d78760
https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/appstore/nokiaUtils/NokiaStoreHelper.java#L344-L380
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/gcc/cross/sparc_sun_solaris2/GccProcessor.java
GccProcessor.convertCygwinFilenames
public static void convertCygwinFilenames(final String[] names) { if (names == null) { throw new NullPointerException("names"); } final File gccDir = CUtil.getExecutableLocation(GccCCompiler.CMD_PREFIX + "gcc.exe"); if (gccDir != null) { final String prefix = gccDir.getAbsolutePath() + "/.."...
java
public static void convertCygwinFilenames(final String[] names) { if (names == null) { throw new NullPointerException("names"); } final File gccDir = CUtil.getExecutableLocation(GccCCompiler.CMD_PREFIX + "gcc.exe"); if (gccDir != null) { final String prefix = gccDir.getAbsolutePath() + "/.."...
[ "public", "static", "void", "convertCygwinFilenames", "(", "final", "String", "[", "]", "names", ")", "{", "if", "(", "names", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"names\"", ")", ";", "}", "final", "File", "gccDir", "=", ...
Converts absolute Cygwin file or directory names to the corresponding Win32 name. @param names array of names, some elements may be null, will be changed in place.
[ "Converts", "absolute", "Cygwin", "file", "or", "directory", "names", "to", "the", "corresponding", "Win32", "name", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/gcc/cross/sparc_sun_solaris2/GccProcessor.java#L64-L82
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/gcc/cross/sparc_sun_solaris2/GccProcessor.java
GccProcessor.getSpecs
public static String[] getSpecs() { if (specs == null) { final File gccParent = CUtil.getExecutableLocation(GccCCompiler.CMD_PREFIX + "gcc.exe"); if (gccParent != null) { // // build a relative path like // ../lib/gcc-lib/i686-pc-cygwin/2.95.3-5/specs // // ...
java
public static String[] getSpecs() { if (specs == null) { final File gccParent = CUtil.getExecutableLocation(GccCCompiler.CMD_PREFIX + "gcc.exe"); if (gccParent != null) { // // build a relative path like // ../lib/gcc-lib/i686-pc-cygwin/2.95.3-5/specs // // ...
[ "public", "static", "String", "[", "]", "getSpecs", "(", ")", "{", "if", "(", "specs", "==", "null", ")", "{", "final", "File", "gccParent", "=", "CUtil", ".", "getExecutableLocation", "(", "GccCCompiler", ".", "CMD_PREFIX", "+", "\"gcc.exe\"", ")", ";", ...
Returns the contents of the gcc specs file. The implementation locates gcc.exe in the executable path and then builds a relative path name from the results of -dumpmachine and -dumpversion. Attempts to use gcc -dumpspecs to provide this information resulted in stalling on the Execute.run @return contents of the specs...
[ "Returns", "the", "contents", "of", "the", "gcc", "specs", "file", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/gcc/cross/sparc_sun_solaris2/GccProcessor.java#L136-L176
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/CUtil.java
CUtil.addAll
public static void addAll(final Vector dest, final Object[] src) { if (src == null) { return; } for (final Object element : src) { dest.addElement(element); } }
java
public static void addAll(final Vector dest, final Object[] src) { if (src == null) { return; } for (final Object element : src) { dest.addElement(element); } }
[ "public", "static", "void", "addAll", "(", "final", "Vector", "dest", ",", "final", "Object", "[", "]", "src", ")", "{", "if", "(", "src", "==", "null", ")", "{", "return", ";", "}", "for", "(", "final", "Object", "element", ":", "src", ")", "{", ...
Adds the elements of the array to the given vector
[ "Adds", "the", "elements", "of", "the", "array", "to", "the", "given", "vector" ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/CUtil.java#L73-L80
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/CUtil.java
CUtil.checkDirectoryArray
public static int checkDirectoryArray(final String[] names) { int count = 0; for (int i = 0; i < names.length; i++) { if (names[i] != null) { final File dir = new File(names[i]); if (dir.exists() && dir.isDirectory()) { count++; } else { names[i] = null; ...
java
public static int checkDirectoryArray(final String[] names) { int count = 0; for (int i = 0; i < names.length; i++) { if (names[i] != null) { final File dir = new File(names[i]); if (dir.exists() && dir.isDirectory()) { count++; } else { names[i] = null; ...
[ "public", "static", "int", "checkDirectoryArray", "(", "final", "String", "[", "]", "names", ")", "{", "int", "count", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "names", ".", "length", ";", "i", "++", ")", "{", "if", "(", ...
Checks a array of names for non existent or non directory entries and nulls them out. @return Count of non-null elements
[ "Checks", "a", "array", "of", "names", "for", "non", "existent", "or", "non", "directory", "entries", "and", "nulls", "them", "out", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/CUtil.java#L88-L101
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/CUtil.java
CUtil.getBasename
public static String getBasename(final File file) { final String path = file.getPath(); // Remove the extension String basename = file.getName(); final int pos = basename.lastIndexOf('.'); if (pos != -1) { basename = basename.substring(0, pos); } return basename; }
java
public static String getBasename(final File file) { final String path = file.getPath(); // Remove the extension String basename = file.getName(); final int pos = basename.lastIndexOf('.'); if (pos != -1) { basename = basename.substring(0, pos); } return basename; }
[ "public", "static", "String", "getBasename", "(", "final", "File", "file", ")", "{", "final", "String", "path", "=", "file", ".", "getPath", "(", ")", ";", "// Remove the extension", "String", "basename", "=", "file", ".", "getName", "(", ")", ";", "final"...
Extracts the basename of a file, removing the extension, if present
[ "Extracts", "the", "basename", "of", "a", "file", "removing", "the", "extension", "if", "present" ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/CUtil.java#L106-L115
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/CUtil.java
CUtil.getExecutableLocation
public static File getExecutableLocation(final String exeName) { // // must add current working directory to the // from of the path from the "path" environment variable final File currentDir = new File(System.getProperty("user.dir")); if (new File(currentDir, exeName).exists()) { return curre...
java
public static File getExecutableLocation(final String exeName) { // // must add current working directory to the // from of the path from the "path" environment variable final File currentDir = new File(System.getProperty("user.dir")); if (new File(currentDir, exeName).exists()) { return curre...
[ "public", "static", "File", "getExecutableLocation", "(", "final", "String", "exeName", ")", "{", "//", "// must add current working directory to the", "// from of the path from the \"path\" environment variable", "final", "File", "currentDir", "=", "new", "File", "(", "Syste...
Gets the parent directory for the executable file name using the current directory and system executable path @param exeName Name of executable such as "cl.exe" @return parent directory or null if not located
[ "Gets", "the", "parent", "directory", "for", "the", "executable", "file", "name", "using", "the", "current", "directory", "and", "system", "executable", "path" ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/CUtil.java#L125-L140
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/CUtil.java
CUtil.getParentPath
public static String getParentPath(final String path) { final int pos = path.lastIndexOf(File.separator); if (pos <= 0) { return null; } return path.substring(0, pos); }
java
public static String getParentPath(final String path) { final int pos = path.lastIndexOf(File.separator); if (pos <= 0) { return null; } return path.substring(0, pos); }
[ "public", "static", "String", "getParentPath", "(", "final", "String", "path", ")", "{", "final", "int", "pos", "=", "path", ".", "lastIndexOf", "(", "File", ".", "separator", ")", ";", "if", "(", "pos", "<=", "0", ")", "{", "return", "null", ";", "}...
Extracts the parent of a file
[ "Extracts", "the", "parent", "of", "a", "file" ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/CUtil.java#L145-L151
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/CUtil.java
CUtil.getPathFromEnvironment
public static File[] getPathFromEnvironment(final String envVariable, final String delim) { // OS/4000 does not support the env command. if (System.getProperty("os.name").equals("OS/400")) { return new File[] {}; } final Vector osEnv = Execute.getProcEnvironment(); final String match = envVari...
java
public static File[] getPathFromEnvironment(final String envVariable, final String delim) { // OS/4000 does not support the env command. if (System.getProperty("os.name").equals("OS/400")) { return new File[] {}; } final Vector osEnv = Execute.getProcEnvironment(); final String match = envVari...
[ "public", "static", "File", "[", "]", "getPathFromEnvironment", "(", "final", "String", "envVariable", ",", "final", "String", "delim", ")", "{", "// OS/4000 does not support the env command.", "if", "(", "System", ".", "getProperty", "(", "\"os.name\"", ")", ".", ...
Returns an array of File for each existing directory in the specified environment variable @param envVariable environment variable name such as "LIB" or "INCLUDE" @param delim delimitor used to separate parts of the path, typically ";" or ":" @return array of File's for each part that is an existing directory
[ "Returns", "an", "array", "of", "File", "for", "each", "existing", "directory", "in", "the", "specified", "environment", "variable" ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/CUtil.java#L164-L183
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/CUtil.java
CUtil.isSystemPath
public static boolean isSystemPath(final File source) { final String lcPath = source.getAbsolutePath().toLowerCase(java.util.Locale.US); return lcPath.contains("platformsdk") || lcPath.contains("windows kits") || lcPath.contains("microsoft") || Objects.equals(lcPath, "/usr/include") || Objects.e...
java
public static boolean isSystemPath(final File source) { final String lcPath = source.getAbsolutePath().toLowerCase(java.util.Locale.US); return lcPath.contains("platformsdk") || lcPath.contains("windows kits") || lcPath.contains("microsoft") || Objects.equals(lcPath, "/usr/include") || Objects.e...
[ "public", "static", "boolean", "isSystemPath", "(", "final", "File", "source", ")", "{", "final", "String", "lcPath", "=", "source", ".", "getAbsolutePath", "(", ")", ".", "toLowerCase", "(", "java", ".", "util", ".", "Locale", ".", "US", ")", ";", "retu...
Determines if source file has a system path, that is part of the compiler or platform. @param source source, may not be null. @return true is source file appears to be system library and its path should be discarded.
[ "Determines", "if", "source", "file", "has", "a", "system", "path", "that", "is", "part", "of", "the", "compiler", "or", "platform", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/CUtil.java#L355-L361
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/CUtil.java
CUtil.sameList
public static boolean sameList(final Object[] a, final Object[] b) { if (a == null || b == null || a.length != b.length) { return false; } for (int i = 0; i < a.length; i++) { if (!a[i].equals(b[i])) { return false; } } return true; }
java
public static boolean sameList(final Object[] a, final Object[] b) { if (a == null || b == null || a.length != b.length) { return false; } for (int i = 0; i < a.length; i++) { if (!a[i].equals(b[i])) { return false; } } return true; }
[ "public", "static", "boolean", "sameList", "(", "final", "Object", "[", "]", "a", ",", "final", "Object", "[", "]", "b", ")", "{", "if", "(", "a", "==", "null", "||", "b", "==", "null", "||", "a", ".", "length", "!=", "b", ".", "length", ")", "...
Compares the contents of 2 arrays for equaliy.
[ "Compares", "the", "contents", "of", "2", "arrays", "for", "equaliy", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/CUtil.java#L432-L442
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/CUtil.java
CUtil.sameList
public static boolean sameList(final Vector v, final Object[] a) { if (v == null || a == null || v.size() != a.length) { return false; } for (int i = 0; i < a.length; i++) { final Object o = a[i]; if (!o.equals(v.elementAt(i))) { return false; } } return true; }
java
public static boolean sameList(final Vector v, final Object[] a) { if (v == null || a == null || v.size() != a.length) { return false; } for (int i = 0; i < a.length; i++) { final Object o = a[i]; if (!o.equals(v.elementAt(i))) { return false; } } return true; }
[ "public", "static", "boolean", "sameList", "(", "final", "Vector", "v", ",", "final", "Object", "[", "]", "a", ")", "{", "if", "(", "v", "==", "null", "||", "a", "==", "null", "||", "v", ".", "size", "(", ")", "!=", "a", ".", "length", ")", "{"...
Compares the contents of an array and a Vector for equality.
[ "Compares", "the", "contents", "of", "an", "array", "and", "a", "Vector", "for", "equality", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/CUtil.java#L447-L458
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/CUtil.java
CUtil.toArray
public static String[] toArray(final Vector src) { final String[] retval = new String[src.size()]; src.copyInto(retval); return retval; }
java
public static String[] toArray(final Vector src) { final String[] retval = new String[src.size()]; src.copyInto(retval); return retval; }
[ "public", "static", "String", "[", "]", "toArray", "(", "final", "Vector", "src", ")", "{", "final", "String", "[", "]", "retval", "=", "new", "String", "[", "src", ".", "size", "(", ")", "]", ";", "src", ".", "copyInto", "(", "retval", ")", ";", ...
Converts a vector to a string array.
[ "Converts", "a", "vector", "to", "a", "string", "array", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/CUtil.java#L496-L500
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/CUtil.java
CUtil.xmlAttribEncode
public static String xmlAttribEncode(final String attrValue) { final StringBuffer buf = new StringBuffer(attrValue); int quotePos; for (quotePos = -1; (quotePos = buf.indexOf("\"", quotePos + 1)) >= 0;) { buf.deleteCharAt(quotePos); buf.insert(quotePos, "&quot;"); quotePos += 5; } ...
java
public static String xmlAttribEncode(final String attrValue) { final StringBuffer buf = new StringBuffer(attrValue); int quotePos; for (quotePos = -1; (quotePos = buf.indexOf("\"", quotePos + 1)) >= 0;) { buf.deleteCharAt(quotePos); buf.insert(quotePos, "&quot;"); quotePos += 5; } ...
[ "public", "static", "String", "xmlAttribEncode", "(", "final", "String", "attrValue", ")", "{", "final", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", "attrValue", ")", ";", "int", "quotePos", ";", "for", "(", "quotePos", "=", "-", "1", ";", "(",...
Replaces any embedded quotes in the string so that the value can be placed in an attribute in an XML file @param attrValue value to be expressed @return equivalent attribute literal
[ "Replaces", "any", "embedded", "quotes", "in", "the", "string", "so", "that", "the", "value", "can", "be", "placed", "in", "an", "attribute", "in", "an", "XML", "file" ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/CUtil.java#L525-L548
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/apple/PropertyListSerialization.java
PropertyListSerialization.serialize
public static void serialize(final Map propertyList, final List comments, final File file) throws IOException, SAXException, TransformerConfigurationException { final SAXTransformerFactory sf = (SAXTransformerFactory) TransformerFactory.newInstance(); final TransformerHandler handler = sf.newTransformerHa...
java
public static void serialize(final Map propertyList, final List comments, final File file) throws IOException, SAXException, TransformerConfigurationException { final SAXTransformerFactory sf = (SAXTransformerFactory) TransformerFactory.newInstance(); final TransformerHandler handler = sf.newTransformerHa...
[ "public", "static", "void", "serialize", "(", "final", "Map", "propertyList", ",", "final", "List", "comments", ",", "final", "File", "file", ")", "throws", "IOException", ",", "SAXException", ",", "TransformerConfigurationException", "{", "final", "SAXTransformerFa...
Serializes a property list into a Cocoa XML Property List document. @param propertyList property list. @param file destination. @param comments comments to insert into document. @throws SAXException if exception during serialization. @throws TransformerConfigurationException if exception creating serializer.
[ "Serializes", "a", "property", "list", "into", "a", "Cocoa", "XML", "Property", "List", "document", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/apple/PropertyListSerialization.java#L59-L79
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/apple/PropertyListSerialization.java
PropertyListSerialization.serializeBoolean
private static void serializeBoolean(final Boolean val, final ContentHandler handler) throws SAXException { String tag = "false"; if (val.booleanValue()) { tag = "true"; } final AttributesImpl attributes = new AttributesImpl(); handler.startElement(null, tag, tag, attributes); handler.endE...
java
private static void serializeBoolean(final Boolean val, final ContentHandler handler) throws SAXException { String tag = "false"; if (val.booleanValue()) { tag = "true"; } final AttributesImpl attributes = new AttributesImpl(); handler.startElement(null, tag, tag, attributes); handler.endE...
[ "private", "static", "void", "serializeBoolean", "(", "final", "Boolean", "val", ",", "final", "ContentHandler", "handler", ")", "throws", "SAXException", "{", "String", "tag", "=", "\"false\"", ";", "if", "(", "val", ".", "booleanValue", "(", ")", ")", "{",...
Serialize a Boolean as a true or false element. @param val boolean to serialize. @param handler destination of serialization events. @throws SAXException if exception during serialization.
[ "Serialize", "a", "Boolean", "as", "a", "true", "or", "false", "element", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/apple/PropertyListSerialization.java#L91-L99
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/apple/PropertyListSerialization.java
PropertyListSerialization.serializeElement
private static void serializeElement(final String tag, final String content, final ContentHandler handler) throws SAXException { final AttributesImpl attributes = new AttributesImpl(); handler.startElement(null, tag, tag, attributes); handler.characters(content.toCharArray(), 0, content.length()); ...
java
private static void serializeElement(final String tag, final String content, final ContentHandler handler) throws SAXException { final AttributesImpl attributes = new AttributesImpl(); handler.startElement(null, tag, tag, attributes); handler.characters(content.toCharArray(), 0, content.length()); ...
[ "private", "static", "void", "serializeElement", "(", "final", "String", "tag", ",", "final", "String", "content", ",", "final", "ContentHandler", "handler", ")", "throws", "SAXException", "{", "final", "AttributesImpl", "attributes", "=", "new", "AttributesImpl", ...
Creates an element with the specified tag name and character content. @param tag tag name. @param content character content. @param handler destination of serialization events. @throws SAXException if exception during serialization.
[ "Creates", "an", "element", "with", "the", "specified", "tag", "name", "and", "character", "content", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/apple/PropertyListSerialization.java#L113-L119
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/apple/PropertyListSerialization.java
PropertyListSerialization.serializeInteger
private static void serializeInteger(final Number integer, final ContentHandler handler) throws SAXException { serializeElement("integer", String.valueOf(integer.longValue()), handler); }
java
private static void serializeInteger(final Number integer, final ContentHandler handler) throws SAXException { serializeElement("integer", String.valueOf(integer.longValue()), handler); }
[ "private", "static", "void", "serializeInteger", "(", "final", "Number", "integer", ",", "final", "ContentHandler", "handler", ")", "throws", "SAXException", "{", "serializeElement", "(", "\"integer\"", ",", "String", ".", "valueOf", "(", "integer", ".", "longValu...
Serialize a Number as an integer element. @param integer number to serialize. @param handler destination of serialization events. @throws SAXException if exception during serialization.
[ "Serialize", "a", "Number", "as", "an", "integer", "element", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/apple/PropertyListSerialization.java#L131-L133
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/apple/PropertyListSerialization.java
PropertyListSerialization.serializeList
private static void serializeList(final List list, final ContentHandler handler) throws SAXException { final AttributesImpl attributes = new AttributesImpl(); handler.startElement(null, "array", "array", attributes); for (final Object aList : list) { serializeObject(aList, handler); } handler....
java
private static void serializeList(final List list, final ContentHandler handler) throws SAXException { final AttributesImpl attributes = new AttributesImpl(); handler.startElement(null, "array", "array", attributes); for (final Object aList : list) { serializeObject(aList, handler); } handler....
[ "private", "static", "void", "serializeList", "(", "final", "List", "list", ",", "final", "ContentHandler", "handler", ")", "throws", "SAXException", "{", "final", "AttributesImpl", "attributes", "=", "new", "AttributesImpl", "(", ")", ";", "handler", ".", "star...
Serialize a list as an array element. @param list list to serialize. @param handler destination of serialization events. @throws SAXException if exception during serialization.
[ "Serialize", "a", "list", "as", "an", "array", "element", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/apple/PropertyListSerialization.java#L145-L152
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/apple/PropertyListSerialization.java
PropertyListSerialization.serializeMap
private static void serializeMap(final Map map, final ContentHandler handler) throws SAXException { final AttributesImpl attributes = new AttributesImpl(); handler.startElement(null, "dict", "dict", attributes); if (map.size() > 0) { // // need to output with sorted keys to maintain // re...
java
private static void serializeMap(final Map map, final ContentHandler handler) throws SAXException { final AttributesImpl attributes = new AttributesImpl(); handler.startElement(null, "dict", "dict", attributes); if (map.size() > 0) { // // need to output with sorted keys to maintain // re...
[ "private", "static", "void", "serializeMap", "(", "final", "Map", "map", ",", "final", "ContentHandler", "handler", ")", "throws", "SAXException", "{", "final", "AttributesImpl", "attributes", "=", "new", "AttributesImpl", "(", ")", ";", "handler", ".", "startEl...
Serialize a map as a dict element. @param map map to serialize. @param handler destination of serialization events. @throws SAXException if exception during serialization.
[ "Serialize", "a", "map", "as", "a", "dict", "element", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/apple/PropertyListSerialization.java#L164-L184
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/apple/PropertyListSerialization.java
PropertyListSerialization.serializeObject
private static void serializeObject(final Object obj, final ContentHandler handler) throws SAXException { if (obj instanceof Map) { serializeMap((Map) obj, handler); } else if (obj instanceof List) { serializeList((List) obj, handler); } else if (obj instanceof Number) { if (obj instanceof...
java
private static void serializeObject(final Object obj, final ContentHandler handler) throws SAXException { if (obj instanceof Map) { serializeMap((Map) obj, handler); } else if (obj instanceof List) { serializeList((List) obj, handler); } else if (obj instanceof Number) { if (obj instanceof...
[ "private", "static", "void", "serializeObject", "(", "final", "Object", "obj", ",", "final", "ContentHandler", "handler", ")", "throws", "SAXException", "{", "if", "(", "obj", "instanceof", "Map", ")", "{", "serializeMap", "(", "(", "Map", ")", "obj", ",", ...
Serialize an object using the best available element. @param obj object to serialize. @param handler destination of serialization events. @throws SAXException if exception during serialization.
[ "Serialize", "an", "object", "using", "the", "best", "available", "element", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/apple/PropertyListSerialization.java#L196-L212
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/apple/PropertyListSerialization.java
PropertyListSerialization.serializeReal
private static void serializeReal(final Number real, final ContentHandler handler) throws SAXException { serializeElement("real", String.valueOf(real.doubleValue()), handler); }
java
private static void serializeReal(final Number real, final ContentHandler handler) throws SAXException { serializeElement("real", String.valueOf(real.doubleValue()), handler); }
[ "private", "static", "void", "serializeReal", "(", "final", "Number", "real", ",", "final", "ContentHandler", "handler", ")", "throws", "SAXException", "{", "serializeElement", "(", "\"real\"", ",", "String", ".", "valueOf", "(", "real", ".", "doubleValue", "(",...
Serialize a Number as a real element. @param real number to serialize. @param handler destination of serialization events. @throws SAXException if exception during serialization.
[ "Serialize", "a", "Number", "as", "a", "real", "element", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/apple/PropertyListSerialization.java#L224-L226
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/compiler/AbstractCompiler.java
AbstractCompiler.canParse
protected boolean canParse(final File sourceFile) { final String sourceName = sourceFile.toString(); final int lastPeriod = sourceName.lastIndexOf('.'); if (lastPeriod >= 0 && lastPeriod == sourceName.length() - 4) { final String ext = sourceName.substring(lastPeriod).toUpperCase(); if (ext.equa...
java
protected boolean canParse(final File sourceFile) { final String sourceName = sourceFile.toString(); final int lastPeriod = sourceName.lastIndexOf('.'); if (lastPeriod >= 0 && lastPeriod == sourceName.length() - 4) { final String ext = sourceName.substring(lastPeriod).toUpperCase(); if (ext.equa...
[ "protected", "boolean", "canParse", "(", "final", "File", "sourceFile", ")", "{", "final", "String", "sourceName", "=", "sourceFile", ".", "toString", "(", ")", ";", "final", "int", "lastPeriod", "=", "sourceName", ".", "lastIndexOf", "(", "'", "'", ")", "...
Checks file name to see if parse should be attempted Default implementation returns false for files with extensions '.dll', 'tlb', '.res'
[ "Checks", "file", "name", "to", "see", "if", "parse", "should", "be", "attempted" ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/compiler/AbstractCompiler.java#L65-L75
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/compiler/AbstractCompiler.java
AbstractCompiler.parseIncludes
public final DependencyInfo parseIncludes(final CCTask task, final File source, final File[] includePath, final File[] sysIncludePath, final File[] envIncludePath, final File baseDir, final String includePathIdentifier) { // // if any of the include files can not be identified // change the sourceLast...
java
public final DependencyInfo parseIncludes(final CCTask task, final File source, final File[] includePath, final File[] sysIncludePath, final File[] envIncludePath, final File baseDir, final String includePathIdentifier) { // // if any of the include files can not be identified // change the sourceLast...
[ "public", "final", "DependencyInfo", "parseIncludes", "(", "final", "CCTask", "task", ",", "final", "File", "source", ",", "final", "File", "[", "]", "includePath", ",", "final", "File", "[", "]", "sysIncludePath", ",", "final", "File", "[", "]", "envInclude...
Returns dependency info for the specified source file @param task task for any diagnostic output @param source file to be parsed @param includePath include path to be used to resolve included files @param sysIncludePath sysinclude path from build file, files resolved using sysInclude path will not participate in depe...
[ "Returns", "dependency", "info", "for", "the", "specified", "source", "file" ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/compiler/AbstractCompiler.java#L135-L190
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.addAttribute
private static void addAttribute(final AttributesImpl attributes, final String attrName, final String attrValue) { if (attrName == null) { throw new IllegalArgumentException("attrName"); } if (attrValue != null) { attributes.addAttribute(null, attrName, attrName, "#PCDATA", attrValue); } }
java
private static void addAttribute(final AttributesImpl attributes, final String attrName, final String attrValue) { if (attrName == null) { throw new IllegalArgumentException("attrName"); } if (attrValue != null) { attributes.addAttribute(null, attrName, attrName, "#PCDATA", attrValue); } }
[ "private", "static", "void", "addAttribute", "(", "final", "AttributesImpl", "attributes", ",", "final", "String", "attrName", ",", "final", "String", "attrValue", ")", "{", "if", "(", "attrName", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException...
Adds an non-namespace-qualified attribute to attribute list. @param attributes list of attributes. @param attrName attribute name, may not be null. @param attrValue attribute value, if null attribute is not added.
[ "Adds", "an", "non", "-", "namespace", "-", "qualified", "attribute", "to", "attribute", "list", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L65-L72
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.getAdditionalDependencies
private String getAdditionalDependencies(final TargetInfo linkTarget, final List<DependencyDef> projectDependencies, final Map<String, TargetInfo> targets, final String basePath) { String dependencies = null; final File[] linkSources = linkTarget.getAllSources(); final StringBuffer buf = new StringBuf...
java
private String getAdditionalDependencies(final TargetInfo linkTarget, final List<DependencyDef> projectDependencies, final Map<String, TargetInfo> targets, final String basePath) { String dependencies = null; final File[] linkSources = linkTarget.getAllSources(); final StringBuffer buf = new StringBuf...
[ "private", "String", "getAdditionalDependencies", "(", "final", "TargetInfo", "linkTarget", ",", "final", "List", "<", "DependencyDef", ">", "projectDependencies", ",", "final", "Map", "<", "String", ",", "TargetInfo", ">", "targets", ",", "final", "String", "base...
Get value of AdditionalDependencies property. @param linkTarget link target. @param projectDependencies dependencies declared in project. @param targets all targets. @param basePath path to directory containing project file. @return value of AdditionalDependencies property.
[ "Get", "value", "of", "AdditionalDependencies", "property", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L127-L180
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.getAdditionalIncludeDirectories
private String getAdditionalIncludeDirectories(final String baseDir, final CommandLineCompilerConfiguration compilerConfig) { final File[] includePath = compilerConfig.getIncludePath(); final StringBuffer includeDirs = new StringBuffer(); // Darren Sargent Feb 10 2010 -- reverted to older code to ensu...
java
private String getAdditionalIncludeDirectories(final String baseDir, final CommandLineCompilerConfiguration compilerConfig) { final File[] includePath = compilerConfig.getIncludePath(); final StringBuffer includeDirs = new StringBuffer(); // Darren Sargent Feb 10 2010 -- reverted to older code to ensu...
[ "private", "String", "getAdditionalIncludeDirectories", "(", "final", "String", "baseDir", ",", "final", "CommandLineCompilerConfiguration", "compilerConfig", ")", "{", "final", "File", "[", "]", "includePath", "=", "compilerConfig", ".", "getIncludePath", "(", ")", "...
Get value of AdditionalIncludeDirectories property. @param compilerConfig compiler configuration. @param baseDir base for relative paths. @return value of AdditionalIncludeDirectories property.
[ "Get", "value", "of", "AdditionalIncludeDirectories", "property", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L191-L212
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.getBasicRuntimeChecks
private String getBasicRuntimeChecks(final CommandLineCompilerConfiguration compilerConfig) { String checks = "0"; final String[] args = compilerConfig.getPreArguments(); for (final String arg : args) { if ("/RTCs".equals(arg)) { checks = "1"; } if ("/RTCu".equals(arg)) { c...
java
private String getBasicRuntimeChecks(final CommandLineCompilerConfiguration compilerConfig) { String checks = "0"; final String[] args = compilerConfig.getPreArguments(); for (final String arg : args) { if ("/RTCs".equals(arg)) { checks = "1"; } if ("/RTCu".equals(arg)) { c...
[ "private", "String", "getBasicRuntimeChecks", "(", "final", "CommandLineCompilerConfiguration", "compilerConfig", ")", "{", "String", "checks", "=", "\"0\"", ";", "final", "String", "[", "]", "args", "=", "compilerConfig", ".", "getPreArguments", "(", ")", ";", "f...
Get value of BasicRuntimeChecks property. @param compilerConfig compiler configuration. @return value of BasicRuntimeChecks property.
[ "Get", "value", "of", "BasicRuntimeChecks", "property", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L248-L263
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.getCharacterSet
private String getCharacterSet(final CommandLineCompilerConfiguration compilerConfig) { final String[] args = compilerConfig.getPreArguments(); String charset = "0"; for (final String arg : args) { if ("/D_UNICODE".equals(arg) || "/DUNICODE".equals(arg)) { charset = "1"; } if ("/D_...
java
private String getCharacterSet(final CommandLineCompilerConfiguration compilerConfig) { final String[] args = compilerConfig.getPreArguments(); String charset = "0"; for (final String arg : args) { if ("/D_UNICODE".equals(arg) || "/DUNICODE".equals(arg)) { charset = "1"; } if ("/D_...
[ "private", "String", "getCharacterSet", "(", "final", "CommandLineCompilerConfiguration", "compilerConfig", ")", "{", "final", "String", "[", "]", "args", "=", "compilerConfig", ".", "getPreArguments", "(", ")", ";", "String", "charset", "=", "\"0\"", ";", "for", ...
Get character set for Windows API. @param compilerConfig compiler configuration, may not be null. @return "1" is TCHAR is unicode, "0" if TCHAR is multi-byte.
[ "Get", "character", "set", "for", "Windows", "API", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L272-L284
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.getConfigurationType
private String getConfigurationType(final CCTask task) { final String outputType = task.getOuttype(); String targtype = "2"; // Win32 (x86) Dynamic-Link Library"; if ("executable".equals(outputType)) { targtype = "1"; // "Win32 (x86) Console Application"; } else if ("static".equals(outputType)) { ...
java
private String getConfigurationType(final CCTask task) { final String outputType = task.getOuttype(); String targtype = "2"; // Win32 (x86) Dynamic-Link Library"; if ("executable".equals(outputType)) { targtype = "1"; // "Win32 (x86) Console Application"; } else if ("static".equals(outputType)) { ...
[ "private", "String", "getConfigurationType", "(", "final", "CCTask", "task", ")", "{", "final", "String", "outputType", "=", "task", ".", "getOuttype", "(", ")", ";", "String", "targtype", "=", "\"2\"", ";", "// Win32 (x86) Dynamic-Link Library\";", "if", "(", "...
Gets the configuration type. @param task cc task, may not be null. @return configuration type
[ "Gets", "the", "configuration", "type", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L293-L302
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.getDebugInformationFormat
private String getDebugInformationFormat(final CommandLineCompilerConfiguration compilerConfig) { String format = "0"; final String[] args = compilerConfig.getPreArguments(); for (final String arg : args) { if ("/Z7".equals(arg)) { format = "1"; } if ("/Zd".equals(arg)) { f...
java
private String getDebugInformationFormat(final CommandLineCompilerConfiguration compilerConfig) { String format = "0"; final String[] args = compilerConfig.getPreArguments(); for (final String arg : args) { if ("/Z7".equals(arg)) { format = "1"; } if ("/Zd".equals(arg)) { f...
[ "private", "String", "getDebugInformationFormat", "(", "final", "CommandLineCompilerConfiguration", "compilerConfig", ")", "{", "String", "format", "=", "\"0\"", ";", "final", "String", "[", "]", "args", "=", "compilerConfig", ".", "getPreArguments", "(", ")", ";", ...
Get value of DebugInformationFormat property. @param compilerConfig compiler configuration. @return value of DebugInformationFormat property.
[ "Get", "value", "of", "DebugInformationFormat", "property", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L311-L329
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.getDetect64BitPortabilityProblems
private String getDetect64BitPortabilityProblems(final CommandLineCompilerConfiguration compilerConfig) { String warn64 = null; final String[] args = compilerConfig.getPreArguments(); for (final String arg : args) { if ("/Wp64".equals(arg)) { warn64 = this.trueLiteral; } } return...
java
private String getDetect64BitPortabilityProblems(final CommandLineCompilerConfiguration compilerConfig) { String warn64 = null; final String[] args = compilerConfig.getPreArguments(); for (final String arg : args) { if ("/Wp64".equals(arg)) { warn64 = this.trueLiteral; } } return...
[ "private", "String", "getDetect64BitPortabilityProblems", "(", "final", "CommandLineCompilerConfiguration", "compilerConfig", ")", "{", "String", "warn64", "=", "null", ";", "final", "String", "[", "]", "args", "=", "compilerConfig", ".", "getPreArguments", "(", ")", ...
Get value of Detect64BitPortabilityProblems property. @param compilerConfig compiler configuration. @return value of Detect64BitPortabilityProblems property.
[ "Get", "value", "of", "Detect64BitPortabilityProblems", "property", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L338-L347
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.getLinkIncremental
private String getLinkIncremental(final CommandLineLinkerConfiguration linkerConfig) { String incremental = "0"; final String[] args = linkerConfig.getPreArguments(); for (final String arg : args) { if ("/INCREMENTAL:NO".equals(arg)) { incremental = "1"; } if ("/INCREMENTAL:YES".eq...
java
private String getLinkIncremental(final CommandLineLinkerConfiguration linkerConfig) { String incremental = "0"; final String[] args = linkerConfig.getPreArguments(); for (final String arg : args) { if ("/INCREMENTAL:NO".equals(arg)) { incremental = "1"; } if ("/INCREMENTAL:YES".eq...
[ "private", "String", "getLinkIncremental", "(", "final", "CommandLineLinkerConfiguration", "linkerConfig", ")", "{", "String", "incremental", "=", "\"0\"", ";", "final", "String", "[", "]", "args", "=", "linkerConfig", ".", "getPreArguments", "(", ")", ";", "for",...
Get value of LinkIncremental property. @param linkerConfig linker configuration. @return value of LinkIncremental property
[ "Get", "value", "of", "LinkIncremental", "property", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L356-L368
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.getOptimization
private String getOptimization(final CommandLineCompilerConfiguration compilerConfig) { final String[] args = compilerConfig.getPreArguments(); String opt = "0"; for (final String arg : args) { if ("/Od".equals(arg)) { opt = "0"; } if ("/O1".equals(arg)) { opt = "1"; ...
java
private String getOptimization(final CommandLineCompilerConfiguration compilerConfig) { final String[] args = compilerConfig.getPreArguments(); String opt = "0"; for (final String arg : args) { if ("/Od".equals(arg)) { opt = "0"; } if ("/O1".equals(arg)) { opt = "1"; ...
[ "private", "String", "getOptimization", "(", "final", "CommandLineCompilerConfiguration", "compilerConfig", ")", "{", "final", "String", "[", "]", "args", "=", "compilerConfig", ".", "getPreArguments", "(", ")", ";", "String", "opt", "=", "\"0\"", ";", "for", "(...
Get value of Optimization property. @param compilerConfig compiler configuration, may not be null. @return value of Optimization property.
[ "Get", "value", "of", "Optimization", "property", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L377-L395
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.getPrecompiledHeaderFile
private String getPrecompiledHeaderFile(final CommandLineCompilerConfiguration compilerConfig) { String pch = null; final String[] args = compilerConfig.getPreArguments(); for (final String arg : args) { if (arg.startsWith("/Fp")) { pch = arg.substring(3); } } return pch; }
java
private String getPrecompiledHeaderFile(final CommandLineCompilerConfiguration compilerConfig) { String pch = null; final String[] args = compilerConfig.getPreArguments(); for (final String arg : args) { if (arg.startsWith("/Fp")) { pch = arg.substring(3); } } return pch; }
[ "private", "String", "getPrecompiledHeaderFile", "(", "final", "CommandLineCompilerConfiguration", "compilerConfig", ")", "{", "String", "pch", "=", "null", ";", "final", "String", "[", "]", "args", "=", "compilerConfig", ".", "getPreArguments", "(", ")", ";", "fo...
Get value of PrecompiledHeaderFile property. @param compilerConfig compiler configuration. @return value of PrecompiledHeaderFile property.
[ "Get", "value", "of", "PrecompiledHeaderFile", "property", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L404-L413
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.getPreprocessorDefinitions
private String getPreprocessorDefinitions(final CommandLineCompilerConfiguration compilerConfig, final boolean isDebug) { final StringBuffer defines = new StringBuffer(); final String[] args = compilerConfig.getPreArguments(); for (final String arg : args) { if (arg.startsWith("/D")) { S...
java
private String getPreprocessorDefinitions(final CommandLineCompilerConfiguration compilerConfig, final boolean isDebug) { final StringBuffer defines = new StringBuffer(); final String[] args = compilerConfig.getPreArguments(); for (final String arg : args) { if (arg.startsWith("/D")) { S...
[ "private", "String", "getPreprocessorDefinitions", "(", "final", "CommandLineCompilerConfiguration", "compilerConfig", ",", "final", "boolean", "isDebug", ")", "{", "final", "StringBuffer", "defines", "=", "new", "StringBuffer", "(", ")", ";", "final", "String", "[", ...
Get value of PreprocessorDefinitions property. @param compilerConfig compiler configuration. @param isDebug true if generating debug configuration. @return value of PreprocessorDefinitions property.
[ "Get", "value", "of", "PreprocessorDefinitions", "property", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L424-L449
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.getRuntimeLibrary
private String getRuntimeLibrary(final CommandLineCompilerConfiguration compilerConfig, final boolean isDebug) { String rtl = null; final String[] args = compilerConfig.getPreArguments(); for (final String arg : args) { if (arg.startsWith("/MT")) { if (isDebug) { rtl = "1"; }...
java
private String getRuntimeLibrary(final CommandLineCompilerConfiguration compilerConfig, final boolean isDebug) { String rtl = null; final String[] args = compilerConfig.getPreArguments(); for (final String arg : args) { if (arg.startsWith("/MT")) { if (isDebug) { rtl = "1"; }...
[ "private", "String", "getRuntimeLibrary", "(", "final", "CommandLineCompilerConfiguration", "compilerConfig", ",", "final", "boolean", "isDebug", ")", "{", "String", "rtl", "=", "null", ";", "final", "String", "[", "]", "args", "=", "compilerConfig", ".", "getPreA...
Get value of RuntimeLibrary property. @param compilerConfig compiler configuration. @param isDebug true if generating debug configuration. @return value of RuntimeLibrary property.
[ "Get", "value", "of", "RuntimeLibrary", "property", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L460-L479
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.getSubsystem
private String getSubsystem(final CommandLineLinkerConfiguration linkerConfig) { String subsystem = "0"; final String[] args = linkerConfig.getPreArguments(); for (final String arg : args) { if ("/SUBSYSTEM:CONSOLE".equals(arg)) { subsystem = "1"; } if ("/SUBSYSTEM:WINDOWS".equals(...
java
private String getSubsystem(final CommandLineLinkerConfiguration linkerConfig) { String subsystem = "0"; final String[] args = linkerConfig.getPreArguments(); for (final String arg : args) { if ("/SUBSYSTEM:CONSOLE".equals(arg)) { subsystem = "1"; } if ("/SUBSYSTEM:WINDOWS".equals(...
[ "private", "String", "getSubsystem", "(", "final", "CommandLineLinkerConfiguration", "linkerConfig", ")", "{", "String", "subsystem", "=", "\"0\"", ";", "final", "String", "[", "]", "args", "=", "linkerConfig", ".", "getPreArguments", "(", ")", ";", "for", "(", ...
Get value of Subsystem property. @param linkerConfig linker configuration. @return value of Subsystem property
[ "Get", "value", "of", "Subsystem", "property", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L488-L503
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.getTargetMachine
private String getTargetMachine(final CommandLineLinkerConfiguration linkerConfig) { String subsystem = "0"; final String[] args = linkerConfig.getPreArguments(); for (final String arg : args) { if ("/MACHINE:X86".equals(arg)) { subsystem = "1"; } } return subsystem; }
java
private String getTargetMachine(final CommandLineLinkerConfiguration linkerConfig) { String subsystem = "0"; final String[] args = linkerConfig.getPreArguments(); for (final String arg : args) { if ("/MACHINE:X86".equals(arg)) { subsystem = "1"; } } return subsystem; }
[ "private", "String", "getTargetMachine", "(", "final", "CommandLineLinkerConfiguration", "linkerConfig", ")", "{", "String", "subsystem", "=", "\"0\"", ";", "final", "String", "[", "]", "args", "=", "linkerConfig", ".", "getPreArguments", "(", ")", ";", "for", "...
Get value of TargetMachine property. @param linkerConfig linker configuration. @return value of TargetMachine property
[ "Get", "value", "of", "TargetMachine", "property", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L512-L521
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.getUsePrecompiledHeader
private String getUsePrecompiledHeader(final CommandLineCompilerConfiguration compilerConfig) { String usePCH = "0"; final String[] args = compilerConfig.getPreArguments(); for (final String arg : args) { if ("/Yc".equals(arg)) { usePCH = "1"; } if ("/Yu".equals(arg)) { use...
java
private String getUsePrecompiledHeader(final CommandLineCompilerConfiguration compilerConfig) { String usePCH = "0"; final String[] args = compilerConfig.getPreArguments(); for (final String arg : args) { if ("/Yc".equals(arg)) { usePCH = "1"; } if ("/Yu".equals(arg)) { use...
[ "private", "String", "getUsePrecompiledHeader", "(", "final", "CommandLineCompilerConfiguration", "compilerConfig", ")", "{", "String", "usePCH", "=", "\"0\"", ";", "final", "String", "[", "]", "args", "=", "compilerConfig", ".", "getPreArguments", "(", ")", ";", ...
Get value of UsePrecompiledHeader property. @param compilerConfig compiler configuration. @return value of UsePrecompiledHeader property.
[ "Get", "value", "of", "UsePrecompiledHeader", "property", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L530-L542
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.getWarningLevel
private String getWarningLevel(final CommandLineCompilerConfiguration compilerConfig) { String warn = null; final String[] args = compilerConfig.getPreArguments(); for (final String arg : args) { if ("/W0".equals(arg)) { warn = "0"; } if ("/W1".equals(arg)) { warn = "1"; ...
java
private String getWarningLevel(final CommandLineCompilerConfiguration compilerConfig) { String warn = null; final String[] args = compilerConfig.getPreArguments(); for (final String arg : args) { if ("/W0".equals(arg)) { warn = "0"; } if ("/W1".equals(arg)) { warn = "1"; ...
[ "private", "String", "getWarningLevel", "(", "final", "CommandLineCompilerConfiguration", "compilerConfig", ")", "{", "String", "warn", "=", "null", ";", "final", "String", "[", "]", "args", "=", "compilerConfig", ".", "getPreArguments", "(", ")", ";", "for", "(...
Get value of WarningLevel property. @param compilerConfig compiler configuration. @return value of WarningLevel property.
[ "Get", "value", "of", "WarningLevel", "property", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L551-L574
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.isGroupMember
private boolean isGroupMember(final String filter, final File candidate) { final String fileName = candidate.getName(); final int lastDot = fileName.lastIndexOf('.'); if (lastDot >= 0 && lastDot < fileName.length() - 1) { final String extension = ";" + fileName.substring(lastDot + 1).toLowerCase() + "...
java
private boolean isGroupMember(final String filter, final File candidate) { final String fileName = candidate.getName(); final int lastDot = fileName.lastIndexOf('.'); if (lastDot >= 0 && lastDot < fileName.length() - 1) { final String extension = ";" + fileName.substring(lastDot + 1).toLowerCase() + "...
[ "private", "boolean", "isGroupMember", "(", "final", "String", "filter", ",", "final", "File", "candidate", ")", "{", "final", "String", "fileName", "=", "candidate", ".", "getName", "(", ")", ";", "final", "int", "lastDot", "=", "fileName", ".", "lastIndexO...
Returns true if the file has an extension that appears in the group filter. @param filter String group filter @param candidate File file @return boolean true if member of group
[ "Returns", "true", "if", "the", "file", "has", "an", "extension", "that", "appears", "in", "the", "group", "filter", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L586-L595
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.writeCompilerElement
private void writeCompilerElement(final ContentHandler content, final boolean isDebug, final String basePath, final CommandLineCompilerConfiguration compilerConfig) throws SAXException { final AttributesImpl attributes = new AttributesImpl(); addAttribute(attributes, "Name", "VCCLCompilerTool"); Strin...
java
private void writeCompilerElement(final ContentHandler content, final boolean isDebug, final String basePath, final CommandLineCompilerConfiguration compilerConfig) throws SAXException { final AttributesImpl attributes = new AttributesImpl(); addAttribute(attributes, "Name", "VCCLCompilerTool"); Strin...
[ "private", "void", "writeCompilerElement", "(", "final", "ContentHandler", "content", ",", "final", "boolean", "isDebug", ",", "final", "String", "basePath", ",", "final", "CommandLineCompilerConfiguration", "compilerConfig", ")", "throws", "SAXException", "{", "final",...
write the Compiler element. @param content serialization content handler. @param isDebug true if generating debug configuration. @param basePath base for relative file paths. @param compilerConfig compiler configuration. @throws SAXException thrown if error during serialization.
[ "write", "the", "Compiler", "element", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L611-L642
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.writeConfigurationStartTag
private void writeConfigurationStartTag(final ContentHandler content, final boolean isDebug, final CCTask task, final CommandLineCompilerConfiguration compilerConfig) throws SAXException { final AttributesImpl attributes = new AttributesImpl(); if (isDebug) { addAttribute(attributes, "Name", "Debug|...
java
private void writeConfigurationStartTag(final ContentHandler content, final boolean isDebug, final CCTask task, final CommandLineCompilerConfiguration compilerConfig) throws SAXException { final AttributesImpl attributes = new AttributesImpl(); if (isDebug) { addAttribute(attributes, "Name", "Debug|...
[ "private", "void", "writeConfigurationStartTag", "(", "final", "ContentHandler", "content", ",", "final", "boolean", "isDebug", ",", "final", "CCTask", "task", ",", "final", "CommandLineCompilerConfiguration", "compilerConfig", ")", "throws", "SAXException", "{", "final...
Write the start tag of the Configuration element. @param content serialization content handler. @param isDebug if true, write a debug configuration. @param task cc task. @param compilerConfig compiler configuration. @throws SAXException thrown if serialization error.
[ "Write", "the", "start", "tag", "of", "the", "Configuration", "element", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L658-L674
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.writeFilteredSources
private void writeFilteredSources(final String name, final String filter, final String basePath, final File[] sortedSources, final ContentHandler content) throws SAXException { final AttributesImpl filterAttrs = new AttributesImpl(); filterAttrs.addAttribute(null, "Name", "Name", "#PCDATA", name); fil...
java
private void writeFilteredSources(final String name, final String filter, final String basePath, final File[] sortedSources, final ContentHandler content) throws SAXException { final AttributesImpl filterAttrs = new AttributesImpl(); filterAttrs.addAttribute(null, "Name", "Name", "#PCDATA", name); fil...
[ "private", "void", "writeFilteredSources", "(", "final", "String", "name", ",", "final", "String", "filter", ",", "final", "String", "basePath", ",", "final", "File", "[", "]", "sortedSources", ",", "final", "ContentHandler", "content", ")", "throws", "SAXExcept...
Writes a cluster of source files to the project. @param name name of filter @param filter file extensions @param basePath base path for files @param sortedSources array of source files @param content generated project @throws SAXException if invalid content
[ "Writes", "a", "cluster", "of", "source", "files", "to", "the", "project", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L692-L712
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java
VisualStudioNETProjectWriter.writeLinkerElement
private void writeLinkerElement(final ContentHandler content, final boolean isDebug, final List<DependencyDef> dependencies, final String basePath, final TargetInfo linkTarget, final Map<String, TargetInfo> targets) throws SAXException { final AttributesImpl attributes = new AttributesImpl(); addAtt...
java
private void writeLinkerElement(final ContentHandler content, final boolean isDebug, final List<DependencyDef> dependencies, final String basePath, final TargetInfo linkTarget, final Map<String, TargetInfo> targets) throws SAXException { final AttributesImpl attributes = new AttributesImpl(); addAtt...
[ "private", "void", "writeLinkerElement", "(", "final", "ContentHandler", "content", ",", "final", "boolean", "isDebug", ",", "final", "List", "<", "DependencyDef", ">", "dependencies", ",", "final", "String", "basePath", ",", "final", "TargetInfo", "linkTarget", "...
Write Tool element for linker. @param content serialization content handler. @param isDebug true if generating debug configuration. @param dependencies project dependencies. @param basePath path to directory containing project file. @param linkTarget link target. @param targets all targets. @throws SAXException thrown...
[ "Write", "Tool", "element", "for", "linker", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/msvc/VisualStudioNETProjectWriter.java#L732-L756
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/arm/ADSCCompiler.java
ADSCCompiler.getIncludeDirSwitch
@Override protected String getIncludeDirSwitch(final String source) { final StringBuffer buf = new StringBuffer("-I"); quoteFile(buf, source); return buf.toString(); }
java
@Override protected String getIncludeDirSwitch(final String source) { final StringBuffer buf = new StringBuffer("-I"); quoteFile(buf, source); return buf.toString(); }
[ "@", "Override", "protected", "String", "getIncludeDirSwitch", "(", "final", "String", "source", ")", "{", "final", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", "\"-I\"", ")", ";", "quoteFile", "(", "buf", ",", "source", ")", ";", "return", "buf",...
Returns command line option to specify include directory
[ "Returns", "command", "line", "option", "to", "specify", "include", "directory" ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/arm/ADSCCompiler.java#L185-L190
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/NarUtil.java
NarUtil.getBcelClass
public static JavaClass getBcelClass(final String filename) throws IOException { final ClassParser parser = new ClassParser(filename); return parser.parse(); }
java
public static JavaClass getBcelClass(final String filename) throws IOException { final ClassParser parser = new ClassParser(filename); return parser.parse(); }
[ "public", "static", "JavaClass", "getBcelClass", "(", "final", "String", "filename", ")", "throws", "IOException", "{", "final", "ClassParser", "parser", "=", "new", "ClassParser", "(", "filename", ")", ";", "return", "parser", ".", "parse", "(", ")", ";", "...
Returns the Bcel Class corresponding to the given class filename @param filename the absolute file name of the class @return the Bcel Class. @throws IOException
[ "Returns", "the", "Bcel", "Class", "corresponding", "to", "the", "given", "class", "filename" ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/NarUtil.java#L292-L295
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/NarUtil.java
NarUtil.replace
public static String replace(final CharSequence target, final CharSequence replacement, final String string) { return Pattern.compile(quote(target.toString())/* * , Pattern.LITERAL jdk 1.4 */).matcher(string).rep...
java
public static String replace(final CharSequence target, final CharSequence replacement, final String string) { return Pattern.compile(quote(target.toString())/* * , Pattern.LITERAL jdk 1.4 */).matcher(string).rep...
[ "public", "static", "String", "replace", "(", "final", "CharSequence", "target", ",", "final", "CharSequence", "replacement", ",", "final", "String", "string", ")", "{", "return", "Pattern", ".", "compile", "(", "quote", "(", "target", ".", "toString", "(", ...
Replaces target with replacement in string. For jdk 1.4 compatiblity. @param target @param replacement @param string @return
[ "Replaces", "target", "with", "replacement", "in", "string", ".", "For", "jdk", "1", ".", "4", "compatiblity", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/NarUtil.java#L513-L518
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/gcc/cross/GccCCompiler.java
GccCCompiler.createParser
@Override protected Parser createParser(final File source) { if (source != null) { final String sourceName = source.getName(); final int lastDot = sourceName.lastIndexOf('.'); if (lastDot >= 0 && lastDot + 1 < sourceName.length()) { final char afterDot = sourceName.charAt(lastDot + 1); ...
java
@Override protected Parser createParser(final File source) { if (source != null) { final String sourceName = source.getName(); final int lastDot = sourceName.lastIndexOf('.'); if (lastDot >= 0 && lastDot + 1 < sourceName.length()) { final char afterDot = sourceName.charAt(lastDot + 1); ...
[ "@", "Override", "protected", "Parser", "createParser", "(", "final", "File", "source", ")", "{", "if", "(", "source", "!=", "null", ")", "{", "final", "String", "sourceName", "=", "source", ".", "getName", "(", ")", ";", "final", "int", "lastDot", "=", ...
Create parser to determine dependencies. Will create appropriate parser (C++, FORTRAN) based on file extension.
[ "Create", "parser", "to", "determine", "dependencies", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/gcc/cross/GccCCompiler.java#L163-L176
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/NarGnuConfigureMojo.java
NarGnuConfigureMojo.arraysToString
private static String arraysToString(final Object[] a) { if (a == null) { return "null"; } final int iMax = a.length - 1; if (iMax == -1) { return "[]"; } final StringBuilder b = new StringBuilder(); b.append('['); for (int i = 0;; i++) { b.append(String.valueOf(a[i]))...
java
private static String arraysToString(final Object[] a) { if (a == null) { return "null"; } final int iMax = a.length - 1; if (iMax == -1) { return "[]"; } final StringBuilder b = new StringBuilder(); b.append('['); for (int i = 0;; i++) { b.append(String.valueOf(a[i]))...
[ "private", "static", "String", "arraysToString", "(", "final", "Object", "[", "]", "a", ")", "{", "if", "(", "a", "==", "null", ")", "{", "return", "\"null\"", ";", "}", "final", "int", "iMax", "=", "a", ".", "length", "-", "1", ";", "if", "(", "...
JDK 1.4 compatibility
[ "JDK", "1", ".", "4", "compatibility" ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/NarGnuConfigureMojo.java#L48-L66
train
maven-nar/nar-maven-plugin
src/main/java/com/github/maven_nar/cpptasks/borland/BorlandLibrarian.java
BorlandLibrarian.quoteFilename
@Override protected String quoteFilename(final StringBuffer buf, final String filename) { buf.setLength(0); BorlandProcessor.quoteFile(buf, filename); return buf.toString(); }
java
@Override protected String quoteFilename(final StringBuffer buf, final String filename) { buf.setLength(0); BorlandProcessor.quoteFile(buf, filename); return buf.toString(); }
[ "@", "Override", "protected", "String", "quoteFilename", "(", "final", "StringBuffer", "buf", ",", "final", "String", "filename", ")", "{", "buf", ".", "setLength", "(", "0", ")", ";", "BorlandProcessor", ".", "quoteFile", "(", "buf", ",", "filename", ")", ...
Encloses problematic file names within quotes. @param buf string buffer @param filename source file name @return filename potentially enclosed in quotes.
[ "Encloses", "problematic", "file", "names", "within", "quotes", "." ]
3c622e2024296b4203431bbae3bde290a01dac00
https://github.com/maven-nar/nar-maven-plugin/blob/3c622e2024296b4203431bbae3bde290a01dac00/src/main/java/com/github/maven_nar/cpptasks/borland/BorlandLibrarian.java#L218-L223
train