id
stringlengths
7
14
text
stringlengths
1
106k
88960_36
public String format(JSLintResult result) { StringBuilder sb = new StringBuilder("<file"); sb.append(attr("name", result.getName())); sb.append(">\n"); for (Issue issue : result.getIssues()) { sb.append("<error"); sb.append(attr("line", Integer.toString(issue.getLine()))); sb.app...
88960_37
public String format(JSLintResult result) { // TODO use a proper serializer StringBuilder sb = new StringBuilder("<testsuite"); List<Issue> issues = result.getIssues(); String testFailures = issues.isEmpty() ? "0" : "1"; sb.append(attr("failures", testFailures)); sb.append(attr("time", formatTim...
88960_38
public String format(JSLintResult result) { // TODO use a proper serializer StringBuilder sb = new StringBuilder("<testsuite"); List<Issue> issues = result.getIssues(); String testFailures = issues.isEmpty() ? "0" : "1"; sb.append(attr("failures", testFailures)); sb.append(attr("time", formatTim...
88960_39
public String format(JSLintResult result) { // TODO use a proper serializer StringBuilder sb = new StringBuilder("<testsuite"); List<Issue> issues = result.getIssues(); String testFailures = issues.isEmpty() ? "0" : "1"; sb.append(attr("failures", testFailures)); sb.append(attr("time", formatTim...
88960_40
public String format(JSLintResult result) { // TODO use a proper serializer StringBuilder sb = new StringBuilder("<testsuite"); List<Issue> issues = result.getIssues(); String testFailures = issues.isEmpty() ? "0" : "1"; sb.append(attr("failures", testFailures)); sb.append(attr("time", formatTim...
88960_41
protected String escape(String str) { if (str == null) return ""; return str.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;"); }
88960_42
protected String escape(String str) { if (str == null) return ""; return str.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;"); }
88960_43
protected String attr(String key, String value) { if (key == null) throw new IllegalArgumentException("key cannot be null"); if (value == null) { value = ""; } StringBuilder sb = new StringBuilder(' '); sb.append(' '); sb.append(escapeAttr(key)); sb.append("='"); sb.appen...
88960_44
protected String attr(String key, String value) { if (key == null) throw new IllegalArgumentException("key cannot be null"); if (value == null) { value = ""; } StringBuilder sb = new StringBuilder(' '); sb.append(' '); sb.append(escapeAttr(key)); sb.append("='"); sb.appen...
88960_45
protected String attr(String key, String value) { if (key == null) throw new IllegalArgumentException("key cannot be null"); if (value == null) { value = ""; } StringBuilder sb = new StringBuilder(' '); sb.append(' '); sb.append(escapeAttr(key)); sb.append("='"); sb.appen...
88960_46
protected String attr(String key, String value) { if (key == null) throw new IllegalArgumentException("key cannot be null"); if (value == null) { value = ""; } StringBuilder sb = new StringBuilder(' '); sb.append(' '); sb.append(escapeAttr(key)); sb.append("='"); sb.appen...
88960_47
public String format(JSLintResult result) { StringBuilder sb = new StringBuilder(); for (Issue issue : result.getIssues()) { sb.append(outputOneIssue(issue)); } return sb.toString(); }
88960_48
public String footer() { return null; }
88960_49
public String header() { return null; }
88960_50
public String format(JSLintResult result) { StringBuilder sb = new StringBuilder(); for (Issue issue : result.getIssues()) { sb.append(outputOneIssue(issue)); } return sb.toString(); }
88960_51
public String format(JSLintResult result) { StringBuilder sb = new StringBuilder(); for (Issue issue : result.getIssues()) { sb.append(outputOneIssue(issue)); } return sb.toString(); }
88960_52
public String format(JSLintResult result) { StringBuilder sb = new StringBuilder(); for (Issue issue : result.getIssues()) { sb.append(outputOneIssue(issue)); } return sb.toString(); }
88960_53
@Override public String footer() { return "</body></html>"; }
88960_54
@Override public String header() { return "<html><head></head><body>"; }
88960_55
public String format(JSLintResult result) { String name = result.getName(); StringBuilder sb = new StringBuilder(); sb.append("<div class='file'>"); sb.append("<h1"); sb.append(attr("id", name)); sb.append(">"); sb.append(escape(name)); sb.append("</h1>"); sb.append(result.getReport(...
88960_56
public String format(JSLintResult result) { String name = result.getName(); StringBuilder sb = new StringBuilder(); sb.append("<div class='file'>"); sb.append("<h1"); sb.append(attr("id", name)); sb.append(">"); sb.append(escape(name)); sb.append("</h1>"); sb.append(result.getReport(...
88960_57
public <T> T parse(Class<T> clazz, String value) { try { Method method = clazz.getMethod("valueOf", String.class); // There's no contract for this, but in the cases we need it for, it // should work. @SuppressWarnings("unchecked") T rv = (T) method.invoke(null, value); ...
88960_58
public <T> T parse(Class<T> clazz, String value) { try { Method method = clazz.getMethod("valueOf", String.class); // There's no contract for this, but in the cases we need it for, it // should work. @SuppressWarnings("unchecked") T rv = (T) method.invoke(null, value); ...
88960_59
public <T> T parse(Class<T> clazz, String value) { try { Method method = clazz.getMethod("valueOf", String.class); // There's no contract for this, but in the cases we need it for, it // should work. @SuppressWarnings("unchecked") T rv = (T) method.invoke(null, value); ...
88960_60
public <T> T parse(Class<T> clazz, String value) { try { Method method = clazz.getMethod("valueOf", String.class); // There's no contract for this, but in the cases we need it for, it // should work. @SuppressWarnings("unchecked") T rv = (T) method.invoke(null, value); ...
88960_61
public <T> T parse(Class<T> clazz, String value) { try { Method method = clazz.getMethod("valueOf", String.class); // There's no contract for this, but in the cases we need it for, it // should work. @SuppressWarnings("unchecked") T rv = (T) method.invoke(null, value); ...
88960_62
@Override public String toString() { return getSystemId() + ":" + getLine() + ":" + getCharacter() + ":" + getReason(); }
88960_63
static boolean booleanValue(String name, Scriptable scope) { Object val = scope.get(name, scope); if (val == UniqueTag.NOT_FOUND) { return false; } else { return Context.toBoolean(val); } }
88960_64
static boolean booleanValue(String name, Scriptable scope) { Object val = scope.get(name, scope); if (val == UniqueTag.NOT_FOUND) { return false; } else { return Context.toBoolean(val); } }
88960_65
static boolean booleanValue(String name, Scriptable scope) { Object val = scope.get(name, scope); if (val == UniqueTag.NOT_FOUND) { return false; } else { return Context.toBoolean(val); } }
88960_66
static int intValue(String name, Scriptable scope) { if (scope == null) { return 0; } Object o = scope.get(name, scope); return o == Scriptable.NOT_FOUND ? 0 : (int) Context.toNumber(o); }
88960_67
static int intValue(String name, Scriptable scope) { if (scope == null) { return 0; } Object o = scope.get(name, scope); return o == Scriptable.NOT_FOUND ? 0 : (int) Context.toNumber(o); }
88960_68
static int intValue(String name, Scriptable scope) { if (scope == null) { return 0; } Object o = scope.get(name, scope); return o == Scriptable.NOT_FOUND ? 0 : (int) Context.toNumber(o); }
88960_69
static int intValue(String name, Scriptable scope) { if (scope == null) { return 0; } Object o = scope.get(name, scope); return o == Scriptable.NOT_FOUND ? 0 : (int) Context.toNumber(o); }
88960_70
static Object javaToJS(Object o, Scriptable scope) { Class<?> cls = o.getClass(); if (cls.isArray()) { return new NativeArray((Object[]) o); } else { return Context.javaToJS(o, scope); } }
88960_71
static <T> List<T> listValue(String name, Scriptable scope, Converter<T> c) { Object val = scope.get(name, scope); if (val == UniqueTag.NOT_FOUND || val instanceof Undefined) { return new ArrayList<T>(); } Scriptable ary = (Scriptable) val; int count = intValue("length", ary); List<T> li...
88960_72
static <T> List<T> listValueOfType(String name, Class<T> class1, Scriptable scope) { return listValue(name, scope, new Converter<T>() { public T convert(Object obj) { @SuppressWarnings("unchecked") T value = (T) obj; return value; } }); }
88960_73
static <T> List<T> listValueOfType(String name, Class<T> class1, Scriptable scope) { return listValue(name, scope, new Converter<T>() { public T convert(Object obj) { @SuppressWarnings("unchecked") T value = (T) obj; return value; } }); }
88960_74
static <T> List<T> listValueOfType(String name, Class<T> class1, Scriptable scope) { return listValue(name, scope, new Converter<T>() { public T convert(Object obj) { @SuppressWarnings("unchecked") T value = (T) obj; return value; } }); }
88960_75
static <T> List<T> listValueOfType(String name, Class<T> class1, Scriptable scope) { return listValue(name, scope, new Converter<T>() { public T convert(Object obj) { @SuppressWarnings("unchecked") T value = (T) obj; return value; } }); }
88960_76
static <T> List<T> listValue(String name, Scriptable scope, Converter<T> c) { Object val = scope.get(name, scope); if (val == UniqueTag.NOT_FOUND || val instanceof Undefined) { return new ArrayList<T>(); } Scriptable ary = (Scriptable) val; int count = intValue("length", ary); List<T> li...
88960_77
static String readerToString(Reader reader) throws IOException { StringBuffer sb = new StringBuffer(); int c; while ((c = reader.read()) != -1) { sb.append((char) c); } return sb.toString(); }
88960_78
static String stringValue(String name, Scriptable scope) { if (scope == null) { return null; } Object o = scope.get(name, scope); return o instanceof String ? (String) o : null; }
88960_79
static String stringValue(String name, Scriptable scope) { if (scope == null) { return null; } Object o = scope.get(name, scope); return o instanceof String ? (String) o : null; }
88960_80
static String stringValue(String name, Scriptable scope) { if (scope == null) { return null; } Object o = scope.get(name, scope); return o instanceof String ? (String) o : null; }
88960_81
static String stringValue(String name, Scriptable scope) { if (scope == null) { return null; } Object o = scope.get(name, scope); return o instanceof String ? (String) o : null; }
88960_82
public final synchronized UnicodeBomInputStream skipBOM() throws IOException { if (!skipped) { skip(bom.bytes.length); skipped = true; } return this; }
88960_83
public final synchronized UnicodeBomInputStream skipBOM() throws IOException { if (!skipped) { skip(bom.bytes.length); skipped = true; } return this; }
88960_84
public JSLint fromClasspathResource(String resource) throws IOException { return fromClasspathResource(resource, UTF8); }
88960_85
public JSLint fromDefault() { try { return fromClasspathResource(JSLINT_FILE); } catch (IOException e) { // We wrap and rethrow, as there's nothing a caller can do in this // case. throw new RuntimeException(e); } }
88960_86
public JSLint fromFile(File f) throws IOException { return fromFile(f, UTF8); }
88960_87
@NeedsContext public JSLint fromReader(Reader reader, String name) throws IOException { try { Context cx = contextFactory.enterContext(); ScriptableObject scope = cx.initStandardObjects(); cx.evaluateReader(scope, reader, name, 1, null); Function lintFunc = (Function) scope.get("JSLI...
88960_88
public JSLint fromDefault() { try { return fromClasspathResource(JSLINT_FILE); } catch (IOException e) { // We wrap and rethrow, as there's nothing a caller can do in this // case. throw new RuntimeException(e); } }
88960_89
public static String[] valueOf(String str) { return str.split("\\s*,\\s*"); }
88960_90
public Charset convert(String value) { try { return Charset.forName(value); } catch (IllegalCharsetNameException e) { throw new ParameterException("unknown encoding '" + value + "'"); } catch (UnsupportedCharsetException e) { throw new ParameterException("unknown encoding '" + value ...
88960_91
public Charset convert(String value) { try { return Charset.forName(value); } catch (IllegalCharsetNameException e) { throw new ParameterException("unknown encoding '" + value + "'"); } catch (UnsupportedCharsetException e) { throw new ParameterException("unknown encoding '" + value ...
88960_92
public Charset convert(String value) { try { return Charset.forName(value); } catch (IllegalCharsetNameException e) { throw new ParameterException("unknown encoding '" + value + "'"); } catch (UnsupportedCharsetException e) { throw new ParameterException("unknown encoding '" + value ...
88960_93
private void version() { // TODO: display jslint4java version as well. if (lint == null) { lint = lintBuilder.fromDefault(); } info("using jslint version " + lint.getEdition()); throw new DieException(null, 0); }
88960_94
@Override public String toString() { return String.format("function %s()", getName()); }
889932_0
@Override public T onCompleted(com.ning.http.client.Response ningResponse) { try { final Map<String, String> headersMap = new HashMap<>(); for (Map.Entry<String, List<String>> header : ningResponse.getHeaders().entrySet()) { final StringBuilder value = new StringBuilder(); fo...
889932_1
@Override public T onCompleted(com.ning.http.client.Response ningResponse) { try { final Map<String, String> headersMap = new HashMap<>(); for (Map.Entry<String, List<String>> header : ningResponse.getHeaders().entrySet()) { final StringBuilder value = new StringBuilder(); fo...
889932_2
@Override public void generateError(String rawResponse) throws IOException { final JsonNode errorNode = OAuth2AccessTokenJsonExtractor.OBJECT_MAPPER.readTree(rawResponse) .get("errors").get(0); OAuth2Error errorCode; try { errorCode = OAuth2Error.parseFrom(extractRequiredParameter(errorN...
889932_3
@Override public void onResponse(Call call, okhttp3.Response okHttpResponse) { try { final Response response = OkHttpHttpClient.convertResponse(okHttpResponse); try { @SuppressWarnings("unchecked") final T t = converter == null ? (T) response : converter.convert(response); ...
889932_4
@Override public void onResponse(Call call, okhttp3.Response okHttpResponse) { try { final Response response = OkHttpHttpClient.convertResponse(okHttpResponse); try { @SuppressWarnings("unchecked") final T t = converter == null ? (T) response : converter.convert(response); ...
889932_5
@Override public void onResponse(Call call, okhttp3.Response okHttpResponse) { try { final Response response = OkHttpHttpClient.convertResponse(okHttpResponse); try { @SuppressWarnings("unchecked") final T t = converter == null ? (T) response : converter.convert(response); ...
889932_6
@Override public void onFailure(Call call, IOException exception) { try { okHttpFuture.setException(exception); if (callback != null) { callback.onThrowable(exception); } } finally { okHttpFuture.finish(); } }
889932_7
@Override public String getSignatureMethod() { return METHOD; }
889932_8
@Override public String getSignature(String baseString, String apiSecret, String tokenSecret) { try { Preconditions.checkEmptyString(baseString, "Base string cant be null or empty string"); Preconditions.checkEmptyString(apiSecret, "Api secret cant be null or empty string"); return doSign(ba...
889932_9
@Override public String getSignature(String baseString, String apiSecret, String tokenSecret) { try { Preconditions.checkEmptyString(baseString, "Base string cant be null or empty string"); Preconditions.checkEmptyString(apiSecret, "Api secret cant be null or empty string"); return doSign(ba...
892275_0
public static Java8OptionalConverterFactory create() { return new Java8OptionalConverterFactory(); }
892275_1
public static JaxbConverterFactory create() { return new JaxbConverterFactory(null); }
892275_2
public MoshiConverterFactory asLenient() { return new MoshiConverterFactory(moshi, true, failOnUnknown, serializeNulls); }
892275_3
public MoshiConverterFactory failOnUnknown() { return new MoshiConverterFactory(moshi, lenient, true, serializeNulls); }
892275_4
public static GuavaOptionalConverterFactory create() { return new GuavaOptionalConverterFactory(); }
892275_5
@SuppressWarnings("ConstantConditions") // Guarding public API nullability. public static RxJava3CallAdapterFactory createWithScheduler(Scheduler scheduler) { if (scheduler == null) throw new NullPointerException("scheduler == null"); return new RxJava3CallAdapterFactory(scheduler, false); }
892275_6
@Override public @Nullable CallAdapter<?, ?> get( Type returnType, Annotation[] annotations, Retrofit retrofit) { Class<?> rawType = getRawType(returnType); if (rawType == Completable.class) { // Completable is not parameterized (which is what the rest of this method deals with) so it // can only be cre...
892275_7
@Override public @Nullable CallAdapter<?, ?> get( Type returnType, Annotation[] annotations, Retrofit retrofit) { Class<?> rawType = getRawType(returnType); if (rawType == Completable.class) { // Completable is not parameterized (which is what the rest of this method deals with) so it // can only be cre...
892275_8
@Override public @Nullable CallAdapter<?, ?> get( Type returnType, Annotation[] annotations, Retrofit retrofit) { Class<?> rawType = getRawType(returnType); if (rawType == Completable.class) { // Completable is not parameterized (which is what the rest of this method deals with) so it // can only be cre...
892275_9
@Override public @Nullable CallAdapter<?, ?> get( Type returnType, Annotation[] annotations, Retrofit retrofit) { Class<?> rawType = getRawType(returnType); if (rawType == Completable.class) { // Completable is not parameterized (which is what the rest of this method deals with) so it // can only be cre...
899555_0
static Collection<String> elemental2ElementTags(final MetaClass type) { final Collection<String> customElementTags = customElementTags(type); if (!customElementTags.isEmpty()) { return customElementTags; } return Elemental2TagMapping.getTags(type.asClass()); }
899555_1
static Collection<String> elemental2ElementTags(final MetaClass type) { final Collection<String> customElementTags = customElementTags(type); if (!customElementTags.isEmpty()) { return customElementTags; } return Elemental2TagMapping.getTags(type.asClass()); }
899555_2
static Collection<String> elemental2ElementTags(final MetaClass type) { final Collection<String> customElementTags = customElementTags(type); if (!customElementTags.isEmpty()) { return customElementTags; } return Elemental2TagMapping.getTags(type.asClass()); }
899555_3
static Collection<String> elemental2ElementTags(final MetaClass type) { final Collection<String> customElementTags = customElementTags(type); if (!customElementTags.isEmpty()) { return customElementTags; } return Elemental2TagMapping.getTags(type.asClass()); }
899555_4
static Collection<String> elemental2ElementTags(final MetaClass type) { final Collection<String> customElementTags = customElementTags(type); if (!customElementTags.isEmpty()) { return customElementTags; } return Elemental2TagMapping.getTags(type.asClass()); }
899555_5
static Collection<String> elemental2ElementTags(final MetaClass type) { final Collection<String> customElementTags = customElementTags(type); if (!customElementTags.isEmpty()) { return customElementTags; } return Elemental2TagMapping.getTags(type.asClass()); }
899555_6
static Collection<String> getTags(final Class<?> elemental2ElementClass) { if (elemental2ElementClass == null || Element.class.equals(elemental2ElementClass)) { return Collections.emptyList(); } final Collection<String> tags = TAG_NAMES_BY_DOM_INTERFACE.get(elemental2ElementClass); if (tags.isEmpty()) { ...
899555_7
@Override public void generateDecorator(final Decorable decorable, final FactoryController controller) { final MetaClass declaringClass = decorable.getDecorableDeclaringType(); final Templated anno = (Templated) decorable.getAnnotation(); final Class<?> templateProvider = anno.provider(); final boolean customPr...
899555_8
public static String getLocaleFromBundlePath(final String bundlePath) { final Matcher matcher = LOCALE_IN_FILENAME_PATTERN.matcher(bundlePath); if (matcher != null && matcher.matches()) { final StringBuilder locale = new StringBuilder(); final String lang = matcher.group(2); if (lang != null) loca...
899555_9
@SuppressWarnings({ "rawtypes", "unchecked" }) protected static Set<String> recordBundleKeys(final Map<String, Set<String>> discoveredI18nMap, final String locale, final String bundlePath) { InputStream is = null; final Set<String> duplicates = new HashSet<>(); try { final Set<String> keys = discoveredI18nMap...
901534_0
@Override public XmlModel loadModel(InputStream xmlStream) throws ModelException { if (xmlStream == null) { throw new ModelException("XML model is not valid [null]."); } try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuild...
901534_1
@Override public UmlModel loadModel(File modelFile) throws UmlModelException { if (modelFile == null) { return new UmlModel(UmlModelProducer.getInstance().createUmlModel(null)); } try { Model model = getUmlRootModel(modelFile); UmlModel umlModel = new UmlModel(model); return ...
904044_0
public synchronized XPathRecordReader addField(String name, String xpath, boolean multiValued) { addField0(xpath, name, multiValued, false, 0); return this; }
904044_1
;
904044_2
;
904044_3
;
904044_4
;
904044_5
;
904044_6
;
904044_7
;
904044_8
;