method2testcases stringlengths 118 6.63k |
|---|
### Question:
Crosshair implements Serializable { public StrokeType getStyle() { return this.style; } Crosshair setStyle(StrokeType style); StrokeType getStyle(); Crosshair setWidth(float width); Float getWidth(); Crosshair setColor(Object color); Color getColor(); @Override Object clone(); }### Answer:
@Test public ... |
### Question:
Area extends BasedXYGraphics { public Integer getInterpolation() { return this.interpolation; } void setInterpolation(Integer interpolation); Integer getInterpolation(); }### Answer:
@Test public void createAreaByEmptyConstructor_hasInterpolationIsNull() { Area area = new Area(); Assertions.assertThat(a... |
### Question:
Area extends BasedXYGraphics { public void setInterpolation(Integer interpolation) { if (interpolation.intValue() < 0 || interpolation.intValue() > 1) { throw new IllegalArgumentException( "Area interpolation is limited to 0, 1"); } this.interpolation = interpolation; } void setInterpolation(Integer inte... |
### Question:
Text implements Serializable, Cloneable { public int getSize() { return size; } Number getX(); void setX(Object x); Number getY(); void setY(Number y); Boolean getShowPointer(); void setShowPointer(boolean showPointer); String getText(); void setText(String text); Double getPointerAngle(); void setPointe... |
### Question:
Stems extends BasedXYGraphics { public void setStyle(Object style) { if (style instanceof StrokeType) { this.baseStyle = (StrokeType) style; } else if (style instanceof List) { @SuppressWarnings("unchecked") List<StrokeType> ss = (List<StrokeType>) style; setStyles(ss); } else { throw new IllegalArgumentE... |
### Question:
Line extends XYGraphics { public StrokeType getStyle() { return this.style; } Line(); Line(List<Number> ys); Line(List<Object> xs, List<Number> ys); void setWidth(Float width); Float getWidth(); void setStyle(StrokeType style); StrokeType getStyle(); void setInterpolation(Integer interpolation); Integer... |
### Question:
TimePlot extends XYChart implements InternalCommWidget, InternalPlot { public XYChart setXBound(Date lower, Date upper) { setXBound((double) lower.getTime(), (double) upper.getTime()); return this; } TimePlot(); @Override String getModelNameValue(); @Override String getViewNameValue(); @Override Comm getC... |
### Question:
Histogram extends AbstractChart implements InternalCommWidget, InternalPlot { public DisplayMode getDisplayMode() { return displayMode; } Histogram(); @Override String getModelNameValue(); @Override String getViewNameValue(); @Override Comm getComm(); @Override void close(); Integer getRangeMin(); void se... |
### Question:
GradientColorProvider extends ColorProvider { @Override public Color getColor(TreeMapNode node) { double value = getValue(node); float result = (float) ((value - minValue) / (maxValue - minValue)); return ColorUtils.interpolateColor(start, end, result); } GradientColorProvider(TreeMap treeMap, Color start... |
### Question:
RandomColorProvider extends ColorProvider { @Override public Color getColor(TreeMapNode node) { Object value; if (groupByParent && node.getParent() instanceof TreeMapNode){ value = ((TreeMapNode) node.getParent()).getLabel(); }else{ value = getValue(node); } if (!this.mapping.containsKey(value)) { mapping... |
### Question:
ColorUtils { public static Color interpolateColor(final java.awt.Color COLOR1, final java.awt.Color COLOR2, float fraction) { final float INT_TO_FLOAT_CONST = 1f / 255f; fraction = Math.min(fraction, 1f); fraction = Math.max(fraction, 0f); final float RED1 = COLOR1.getRed() * INT_TO_FLOAT_CONST; final flo... |
### Question:
RadioButtons extends SingleSelectionWidget { public RadioButtons() { super(); openComm(); } RadioButtons(); @Override String getModelNameValue(); @Override String getViewNameValue(); static String VIEW_NAME_VALUE; static String MODEL_NAME_VALUE; }### Answer:
@Test public void shouldSendCommMsgWhenValueCha... |
### Question:
Select extends SingleSelectionWidget { public Select() { super(); openComm(); } Select(); @Override String getModelNameValue(); @Override String getViewNameValue(); static String VIEW_NAME_VALUE; static String MODEL_NAME_VALUE; }### Answer:
@Test public void shouldSendCommMsgWhenValueChange() throws Excep... |
### Question:
Dropdown extends SingleSelectionWidget { public Dropdown() { super(); openComm(); } Dropdown(); @Override String getModelNameValue(); @Override String getViewNameValue(); static final String VIEW_NAME_VALUE; static final String MODEL_NAME_VALUE; }### Answer:
@Test public void shouldSendCommMsgWhenValueCha... |
### Question:
SelectMultipleSingle extends SingleSelectionWidget { public SelectMultipleSingle() { super(); openComm(); } SelectMultipleSingle(); @Override String getModelNameValue(); @Override String getViewNameValue(); static String VIEW_NAME_VALUE; static String MODEL_NAME_VALUE; }### Answer:
@Test public void shoul... |
### Question:
DatePicker extends ValueWidget<String> { public void setShowTime(final Boolean showTime) { this.showTime = showTime; sendUpdate(SHOW_TIME, showTime); } DatePicker(); @Override void updateValue(Object value); @Override String getValueFromObject(Object input); @Override String getModelNameValue(); @Override... |
### Question:
ColorPicker extends ValueWidget<String> { public ColorPicker() { super(); openComm(); } ColorPicker(); @Override String getValueFromObject(Object input); Boolean getConcise(); void setConcise(Boolean concise); @Override String getModelNameValue(); @Override String getViewNameValue(); static final String V... |
### Question:
Checkbox extends BoolWidget { public Checkbox() { super(); openComm(); } Checkbox(); @Override String getModelNameValue(); @Override String getViewNameValue(); static String VIEW_NAME_VALUE; static String MODEL_NAME_VALUE; }### Answer:
@Test public void shouldSendCommMsgWhenValueChange() throws Exception ... |
### Question:
ToggleButton extends BoolWidget { public ToggleButton() { super(); openComm(); } ToggleButton(); String getTooltip(); void setTooltip(String tooltip); @Override String getModelNameValue(); @Override String getViewNameValue(); static String VIEW_NAME_VALUE; static String MODEL_NAME_VALUE; static final Stri... |
### Question:
HTML extends StringWidget { public HTML() { super(); openComm(); } HTML(); @Override String getModelNameValue(); @Override String getViewNameValue(); static final String VIEW_NAME_VALUE; static final String MODEL_NAME_VALUE; }### Answer:
@Test public void shouldSendCommMsgWhenValueChange() throws Exceptio... |
### Question:
Label extends StringWidget { public Label() { super(); openComm(); } Label(); @Override String getModelNameValue(); @Override String getViewNameValue(); static final String VIEW_NAME_VALUE; static final String MODEL_NAME_VALUE; }### Answer:
@Test public void shouldSendCommMsgWhenValueChange() throws Excep... |
### Question:
Textarea extends StringWidget { public Textarea() { super(); openComm(); } Textarea(); @Override String getModelNameValue(); @Override String getViewNameValue(); static final String VIEW_NAME_VALUE; static final String MODEL_NAME_VALUE; }### Answer:
@Test public void shouldSendCommMsgWhenValueChange() thr... |
### Question:
Text extends StringWidget { public Text() { super(); openComm(); } Text(); @Override String getModelNameValue(); @Override String getViewNameValue(); static final String VIEW_NAME_VALUE; static final String MODEL_NAME_VALUE; }### Answer:
@Test public void shouldSendCommMsgWhenValueChange() throws Exceptio... |
### Question:
FloatSlider extends BoundedFloatWidget { public FloatSlider() { super(); openComm(); } FloatSlider(); String getOrientation(); void setOrientation(String orientation); String getSlider_color(); void setSlider_color(String slider_color); Boolean getReadOut(); void setReadOut(Object readOut); Boolean getCon... |
### Question:
IntSlider extends BoundedIntWidget { public IntSlider() { super(); openComm(); } IntSlider(); String getOrientation(); void setOrientation(String orientation); String getSlider_color(); void setSlider_color(String slider_color); Boolean getReadOut(); void setReadOut(Object readOut); Boolean getContinuous_... |
### Question:
ValueWidget extends DOMWidget { public Integer getInteger(Object input) { Integer ret = 0; if (input != null) { if (input instanceof Double) { ret = ((Double) input).intValue(); } else if (input instanceof Integer) { ret = (Integer) input; } else if (input instanceof String) { try { ret = Integer.parseInt... |
### Question:
ValueWidget extends DOMWidget { public Double getDouble(Object input) { Double ret = 0D; if (input != null) { if (input instanceof Integer) { ret = ((Integer) input).doubleValue(); } else if (input instanceof Double) { ret = (Double) input; } else if (input instanceof String) { try { ret = Double.parseDou... |
### Question:
ValueWidget extends DOMWidget { protected Integer[] getArrayOfInteger(Object input, Integer lowerDefault, Integer upperDefault) { Integer[] ret = new Integer[2]; ret[0] = lowerDefault; ret[1] = upperDefault; if (input != null) { if (input instanceof Object[]) { Object[] array = (Object[]) input; if (array... |
### Question:
JavaEvaluator implements Evaluator { @Override public void evaluate(SimpleEvaluationObject seo, String code) { jobQueue.add(new jobDescriptor(code,seo)); syncObject.release(); } JavaEvaluator(String id, String sId); @Override void startWorker(); String getShellId(); void killAllThreads(); void cancelExecu... |
### Question:
ValueWidget extends DOMWidget { protected Double[] getArrayOfDouble(Object input, Double lowerDefault, Double upperDefault) { Double[] ret = new Double[2]; ret[0] = lowerDefault; ret[1] = upperDefault; if (input != null) { if (input instanceof Object[]) { Object[] array = (Object[]) input; if (array.lengt... |
### Question:
ValueWidget extends DOMWidget { public String getString(Object input) { String ret = ""; if (input != null) { if (input instanceof String) { ret = (String) input; } else if (input instanceof byte[]) { ret = new String((byte[]) input); } else { ret = input.toString(); } } return ret; } T getValue(); void ... |
### Question:
ValueWidget extends DOMWidget { public String[] getStringArray(Object input) { List<String> ret = new ArrayList<>(); if (input != null) { if (input instanceof Object[]) { Object[] array = (Object[]) input; for (Object o : array) { ret.add(getString(o)); } }else if(input instanceof Collection<?>){ Collecti... |
### Question:
MorphiaUtils { public static List<String> getApplicationPackageName(final ApplicationContext applicationContext) { Set<String> candidateClasses = new HashSet<>(); candidateClasses.addAll(Arrays.asList(applicationContext.getBeanNamesForAnnotation(SpringBootApplication.class))); candidateClasses.addAll(Arra... |
### Question:
MorphiaUtils { public static Set<Class<?>> getClasses(final String packageName) { Reflections reflections = new Reflections(packageName); return reflections.getTypesAnnotatedWith(Entity.class); } static List<String> getApplicationPackageName(final ApplicationContext applicationContext); static Set<Class<... |
### Question:
Fruit { public <T> T fromHtml(String html, Class<T> classOfT) { return fromHtml(html, (Type) classOfT); } Fruit(); T fromHtml(String html, Class<T> classOfT); T fromHtml(String html, Type typeOfT); T fromHtml(File file, String charsetName, String baseUri, Class<T> classOfT); @SuppressWarnings("unchecked")... |
### Question:
NoticesXmlParser { public static Notices parse(final InputStream inputStream) throws Exception { try { final XmlPullParser parser = Xml.newPullParser(); parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false); parser.setInput(inputStream, null); parser.nextTag(); return parse(parser); } finally... |
### Question:
LicenseResolver { public static void registerLicense(final License license) { sLicenses.put(license.getName(), license); } private LicenseResolver(); static void registerLicense(final License license); static License read(final String license); }### Answer:
@Test public void testRegisterLicense() throws... |
### Question:
LicenseResolver { public static License read(final String license) { final String trimmedLicense = license.trim(); if (sLicenses.containsKey(trimmedLicense)) { return sLicenses.get(trimmedLicense); } else { throw new IllegalStateException(String.format("no such license available: %s, did you forget to reg... |
### Question:
XPathRecordReader { public synchronized XPathRecordReader addField(String name, String xpath, boolean multiValued) { addField0(xpath, name, multiValued, false, 0); return this; } XPathRecordReader(String forEachXpath); synchronized XPathRecordReader addField(String name, String xpath, boolean multiValued)... |
### Question:
EvaluatorBag { public static Evaluator getSqlEscapingEvaluator() { return new Evaluator() { public String evaluate(String expression, Context context) { List l = parseParams(expression, context.getVariableResolver()); if (l.size() != 1) { throw new DataImportHandlerException(SEVERE, "'escapeSql' must have... |
### Question:
EvaluatorBag { public static Evaluator getUrlEvaluator() { return new Evaluator() { public String evaluate(String expression, Context context) { List l = parseParams(expression, context.getVariableResolver()); if (l.size() != 1) { throw new DataImportHandlerException(SEVERE, "'encodeUrl' must have at leas... |
### Question:
EvaluatorBag { public static List parseParams(String expression, VariableResolver vr) { List result = new ArrayList(); expression = expression.trim(); String[] ss = expression.split(","); for (int i = 0; i < ss.length; i++) { ss[i] = ss[i].trim(); if (ss[i].startsWith("'")) { StringBuilder sb = new String... |
### Question:
EvaluatorBag { static Map<String, Object> getFunctionsNamespace(final List<Map<String, String>> fn, DocBuilder docBuilder) { final Map<String, Evaluator> evaluators = new HashMap<String, Evaluator>(); evaluators.put(DATE_FORMAT_EVALUATOR, getDateFormatEvaluator()); evaluators.put(SQL_ESCAPE_EVALUATOR, get... |
### Question:
DateFormatTransformer extends Transformer { @SuppressWarnings("unchecked") public Object transformRow(Map<String, Object> aRow, Context context) { for (Map<String, String> map : context.getAllEntityFields()) { Locale locale = Locale.getDefault(); String customLocale = map.get("locale"); if(customLocale !=... |
### Question:
DocBuilder { @SuppressWarnings("unchecked") static Class loadClass(String name, SolrCore core) throws ClassNotFoundException { try { return core != null ? core.getResourceLoader().findClass(name) : Class.forName(name); } catch (Exception e) { try { String n = DocBuilder.class.getPackage().getName() + "." ... |
### Question:
VariableResolver { public abstract Object resolve(String name); abstract Object resolve(String name); abstract String replaceTokens(String template); }### Answer:
@Test public void testSimpleNamespace() { VariableResolverImpl vri = new VariableResolverImpl(); Map<String, Object> ns = new HashMap<String,... |
### Question:
EntityProcessorBase extends EntityProcessor { public void init(Context context) { rowIterator = null; this.context = context; if (isFirstInit) { firstInit(context); } query = null; } void init(Context context); Map<String, Object> nextModifiedRowKey(); Map<String, Object> nextDeletedRowKey(); Map<String,... |
### Question:
DataConfig { public void readFromXml(Element e) { List<Element> n = getChildNodes(e, "document"); if (n.isEmpty()) { throw new DataImportHandlerException(SEVERE, "DataImportHandler " + "configuration file must have one <document> node."); } document = new Document(n.get(0)); n = getChildNodes(e, SCRIPT); ... |
### Question:
TemplateTransformer extends Transformer { @SuppressWarnings("unchecked") public Object transformRow(Map<String, Object> row, Context context) { VariableResolverImpl resolver = (VariableResolverImpl) context .getVariableResolver(); for (Map<String, String> map : context.getAllEntityFields()) { String expr ... |
### Question:
MetaLocale implements CLDR.Locale, Comparable<MetaLocale> { private int compare(String a, String b) { if (a != null && b != null) { return a.compareTo(b); } if (a == null) { if (b == null) { return 0; } return -1; } return 1; } MetaLocale(); MetaLocale(String language, String script, String territory, St... |
### Question:
MetaLocale implements CLDR.Locale, Comparable<MetaLocale> { @Override public boolean equals(Object obj) { if (obj instanceof MetaLocale) { MetaLocale other = (MetaLocale) obj; return Arrays.equals(fields, other.fields); } return false; } MetaLocale(); MetaLocale(String language, String script, String ter... |
### Question:
UnitFactorMap { public UnitCategory getUnitCategory() { return category; } UnitFactorMap(UnitCategory category); private UnitFactorMap(UnitCategory category, Map<Unit, Map<Unit, UnitFactor>> factors); UnitCategory getUnitCategory(); UnitValue convert(UnitValue value, Unit to); UnitValue convert(UnitValue... |
### Question:
UnitFactorMap { public void sortUnits(Unit[] units) { Arrays.sort(units, (a, b) -> { Integer ia = unitOrder.get(a); Integer ib = unitOrder.get(b); if (ia == null) { return 1; } if (ib == null) { return -1; } return Integer.compare(ia, ib); }); } UnitFactorMap(UnitCategory category); private UnitFactorMap... |
### Question:
UnitFactorMap { public String dump(Unit unit) { StringBuilder buf = new StringBuilder(); buf.append(unit).append(":\n"); Map<Unit, UnitFactor> map = factors.get(unit); for (Unit base : map.keySet()) { UnitFactor factor = map.get(base); buf.append(" ").append(factor).append(" "); buf.append(factor.rational... |
### Question:
UnitFactorSet { public List<UnitValue> factors() { return factors; } UnitFactorSet(Unit base, UnitFactorMap factorMap, Unit...units); UnitFactorSet(UnitFactorMap factorMap, Unit...units); private UnitFactorSet(Unit unitBase, boolean forceBase, UnitFactorMap factorMap, Unit...units); Unit base(); List<Un... |
### Question:
DigitBuffer implements CharSequence { @Override public DigitBuffer subSequence(int start, int end) { start = clamp(start, 0, size - 1); end = clamp(end, start, size - 1); int sz = end - start; char[] newbuf = new char[16 + sz]; System.arraycopy(buf, start, newbuf, 0, sz); return new DigitBuffer(newbuf, sz... |
### Question:
NumberFormattingUtils { public static int integerDigits(BigDecimal n) { return n.precision() - n.scale(); } static int integerDigits(BigDecimal n); static BigDecimal setup(
BigDecimal n, // number to be formatted
NumberRoundMode roundMode, // rounding mode
Num... |
### Question:
NumberFormattingUtils { public static BigDecimal setup( BigDecimal n, NumberRoundMode roundMode, NumberFormatMode formatMode, int minIntDigits, int maxFracDigits, int minFracDigits, int maxSigDigits, int minSigDigits) { RoundingMode mode = roundMode.toRoundingMode(); boolean useSignificant = formatMode ==... |
### Question:
MetaLocale implements CLDR.Locale, Comparable<MetaLocale> { public String variant() { return getField(VARIANT, ""); } MetaLocale(); MetaLocale(String language, String script, String territory, String variant); protected MetaLocale(MetaLocale other); String language(); String script(); String territory()... |
### Question:
NumberPattern { public Format format() { return format == null ? DEFAULT_FORMAT : format; } protected NumberPattern(String pattern, List<Node> parsed, Format format); String pattern(); List<Node> parsed(); Format format(); String render(); @Override boolean equals(Object obj); @Override String toString()... |
### Question:
DateTimePatternParser { public List<Node> parse(String raw) { StringBuilder buf = new StringBuilder(); char field = '\0'; int width = 0; boolean inquote = false; int length = raw.length(); int i = 0; List<Node> nodes = new ArrayList<>(); while (i < length) { char ch = raw.charAt(i); if (inquote) { if (ch ... |
### Question:
LanguageResolver { protected MetaLocale addLikelySubtags(MetaLocale src) { MetaLocale dst = src.copy(); if (src.hasAll()) { return dst; } MetaLocale temp = src.copy(); temp.setVariant(null); for (int flags : MATCH_ORDER) { set(src, temp, flags); MetaLocale match = likelySubtagsMap.get(temp); if (match != ... |
### Question:
LanguageMatcher { public Match match(String desiredRaw) { return matchImpl(parse(desiredRaw), DEFAULT_THRESHOLD); } LanguageMatcher(String supportedLocales); LanguageMatcher(List<String> supportedLocales); Match match(String desiredRaw); Match match(String desiredRaw, int threshold); Match match(List<Str... |
### Question:
LanguageMatcher { public List<Match> matches(String desiredRaw) { return matchesImpl(parse(desiredRaw), DEFAULT_THRESHOLD); } LanguageMatcher(String supportedLocales); LanguageMatcher(List<String> supportedLocales); Match match(String desiredRaw); Match match(String desiredRaw, int threshold); Match matc... |
### Question:
FileInfosPresenter implements FileInfosContract.Presenter { @Override public void loadFileInfos() { mFileInfosRepository .listFileInfos(mDirectory) .observeOn(mSchedulerProvider.ui()) .subscribe(new Action1<List<FileInfo>>() { @Override public void call(List<FileInfo> fileInfos) { if (fileInfos.isEmpty())... |
### Question:
UserServiceImpl implements UserService { @Override public void create(User user) { User existing = userRepository.findByUsername(user.getUsername()); Assert.isNull(existing, "user already exist: " + user.getUsername()); String hash = encoder.encode(user.getPassword()); user.setPassword(hash); user.setEnab... |
### Question:
MysqlUserDetailsService implements UserDetailsService { @Override public UserDetails loadUserByUsername(String s) throws UsernameNotFoundException { User user = userRepository.findByUsername(s); log.info("user is found! -> " + user.getUsername()); if (user == null) { log.info("user is not found!"); throw ... |
### Question:
AccountServiceImpl implements AccountService { @Override public Account findByUserName(String username) { Assert.hasLength(username); return repository.findByUsername(username); } @Override Account findByUserName(String username); @Override Account findByEmail(String email); @Override Account create(User... |
### Question:
AccountServiceImpl implements AccountService { @Override public Account findByEmail(String email) { Assert.hasLength(email); return repository.findByEmail(email); } @Override Account findByUserName(String username); @Override Account findByEmail(String email); @Override Account create(User user); @Overri... |
### Question:
BigFontGenerator { public String convert(String text, int position) { HashMap<Character, String> hashMap = fonts.get(position); ArrayList<String> chars = new ArrayList<>(); for (int i = 0; i < text.length(); i++) { String s = hashMap.get(Character.toUpperCase(text.charAt(i))); if (s == null) { throw new U... |
### Question:
JavacTaskImpl extends JavacTask { public Boolean call() { if (!used.getAndSet(true)) { initContext(); notYetEntered = new HashMap<JavaFileObject, JCCompilationUnit>(); compilerMain.setAPIMode(true); result = compilerMain.compile(args, context, fileObjects, processors); cleanup(); return result == 0; } els... |
### Question:
Main { public static void main(String[] args) throws Exception { if (args.length > 0 && args[0].equals("-Xjdb")) { String[] newargs = new String[args.length + 2]; Class<?> c = Class.forName("com.sun.tools.example.debug.tty.TTY"); Method method = c.getDeclaredMethod("main", new Class<?>[] { args.getClass()... |
### Question:
Launcher { public static void main(String... args) { JavaCompiler javac = ToolProvider.getSystemJavaCompiler(); JFileChooser fileChooser; Preferences prefs = Preferences.userNodeForPackage(Launcher.class); if (args.length > 0) fileChooser = new JFileChooser(args[0]); else { String fileName = prefs.get("re... |
### Question:
Main { public static int compile(String[] args) { com.sun.tools.javac.main.Main compiler = new com.sun.tools.javac.main.Main("javac"); return compiler.compile(args); } static void main(String[] args); static int compile(String[] args); static int compile(String[] args, PrintWriter out); }### Answer:
@Te... |
### Question:
Parser { public MavenRepositoryURL getRepositoryURL() { return m_repositoryURL; } Parser( final String path ); MavenRepositoryURL getRepositoryURL(); String getGroup(); String getArtifact(); String getVersion(); String getType(); String getClassifier(); String getArtifactPath(); String getArtifactPath( fi... |
### Question:
Parser { public String getResourceName() { return m_resourceName; } Parser( final String path ); String getResourceName(); }### Answer:
@Test public void getResourceNameWithContainingSlash() throws MalformedURLException { assertEquals( "Resource name", "somewhere/resource", new Parser( "somewhere/resourc... |
### Question:
AbstractConnection extends URLConnection { protected static boolean checkJarIsLegal(String name) { boolean isMatched = false; for (Pattern pattern : blacklist) { isMatched = pattern.matcher(name).find(); if (isMatched) { break; } } return !isMatched; } protected AbstractConnection( final URL url,
... |
### Question:
Parser { public URL getWrappedJarURL() { return m_wrappedJarURL; } Parser( final String path, final boolean certificateCheck ); URL getWrappedJarURL(); Properties getWrappingProperties(); OverwriteMode getOverwriteMode(); }### Answer:
@Test public void validWrappedJarURL() throws MalformedURLException { ... |
### Question:
ConfigurationImpl extends PropertyStore implements Configuration { public Boolean getCertificateCheck() { if( !contains( ServiceConstants.PROPERTY_CERTIFICATE_CHECK ) ) { return set( ServiceConstants.PROPERTY_CERTIFICATE_CHECK, Boolean.valueOf( m_propertyResolver.get( ServiceConstants.PROPERTY_CERTIFICATE... |
### Question:
Connection extends URLConnection { @Override public InputStream getInputStream() throws IOException { return new BundleBuilder( m_parser.getOptions(), new ResourceWriter( new FileTailImpl( m_parser.getDirectory(), m_parser.getTailExpr() ) .getParentOfTail() ) ).build(); } Connection( URL url, Configuratio... |
### Question:
Parser { public File getDirectory() { return m_directory; } Parser( String url ); File getDirectory(); Properties getOptions(); String getTailExpr(); }### Answer:
@Test public void parseValidURL() throws IOException { File f = new File( System.getProperty( "java.io.tmpdir" ) ); assertEquals( f.getCanonic... |
### Question:
Parser { public Properties getOptions() { return m_options; } Parser( String url ); File getDirectory(); Properties getOptions(); String getTailExpr(); }### Answer:
@Test public void parseWithMoreParams() throws IOException, URISyntaxException { Parser parser = new Parser( "http:." + "$a=1&b=2" ); assert... |
### Question:
Parser { public String getSnapshotPath( final String version, final String timestamp, final String buildnumber ) { return new StringBuilder() .append( m_group.replaceAll( GROUP_SEPARATOR, FILE_SEPARATOR ) ) .append( FILE_SEPARATOR ) .append( m_artifact ) .append( FILE_SEPARATOR ) .append( version ) .appen... |
### Question:
Parser { public String getArtifactPath() { return getArtifactPath( m_version ); } Parser( final String path ); MavenRepositoryURL getRepositoryURL(); String getGroup(); String getArtifact(); String getVersion(); String getType(); String getClassifier(); String getArtifactPath(); String getArtifactPath( fi... |
### Question:
Parser { public String getVersionMetadataPath( final String version ) { return new StringBuilder() .append( m_group.replaceAll( GROUP_SEPARATOR, FILE_SEPARATOR ) ) .append( FILE_SEPARATOR ) .append( m_artifact ) .append( FILE_SEPARATOR ) .append( version ) .append( FILE_SEPARATOR ) .append( METADATA_FILE ... |
### Question:
Parser { public String getArtifactMetdataPath() { return new StringBuilder() .append( m_group.replaceAll( GROUP_SEPARATOR, FILE_SEPARATOR ) ) .append( FILE_SEPARATOR ) .append( m_artifact ) .append( FILE_SEPARATOR ) .append( METADATA_FILE ) .toString(); } Parser( final String path ); MavenRepositoryURL ge... |
### Question:
Parser { public String getArtifactLocalMetdataPath() { return new StringBuilder() .append( m_group.replaceAll( GROUP_SEPARATOR, FILE_SEPARATOR ) ) .append( FILE_SEPARATOR ) .append( m_artifact ) .append( FILE_SEPARATOR ) .append( METADATA_FILE_LOCAL ) .toString(); } Parser( final String path ); MavenRepos... |
### Question:
Connection extends URLConnection { public InputStream getInputStream() throws IOException { connect(); InputStream is; if( url.getAuthority() != null ) { is = getFromSpecificBundle(); } else { is = getFromClasspath(); if( is == null ) { is = getFromInstalledBundles(); } } if( is == null ) { throw new IOEx... |
### Question:
MatrixUtils { public static double[] slicedSimilarity(double[][] matrix, double[] vector, int sliceSize) { int size = matrix.length; double[] result = new double[size]; for (int i = 0; i < size; i = i + sliceSize) { int end = i + sliceSize; if (end > size) { end = size; } double[][] m = Arrays.copyOfRange... |
### Question:
RelevanceModel { public static Dataset concat(Dataset d1, Dataset d2) { double[][] X = concat(d1.getX(), d2.getX()); double[] y = concat(d1.getY(), d2.getY()); return new Dataset(X, y); } static void main(String[] args); static Dataset concat(Dataset d1, Dataset d2); static double[] concat(double[] y1, d... |
### Question:
NerGroup { public static List<String> groupNer(List<Word> tokens) { if (tokens.isEmpty()) { return Collections.emptyList(); } String prevNer = "O"; List<List<Word>> groups = new ArrayList<>(); List<Word> group = new ArrayList<>(); for (Word w : tokens) { String ner = w.getNer(); if (prevNer.equals(ner) &&... |
### Question:
DefaultJavaRunner implements StoppableJavaRunner { static String getJavaExecutable( final String javaHome ) throws PlatformException { if( javaHome == null ) { throw new PlatformException( "JAVA_HOME is not set." ); } return javaHome + "/bin/java"; } DefaultJavaRunner(); DefaultJavaRunner( boolean wait )... |
### Question:
ConciergePlatformBuilder implements PlatformBuilder { public String[] getArguments( final PlatformContext context ) { return null; } ConciergePlatformBuilder( final BundleContext bundleContext, final String version ); void prepare( final PlatformContext context ); String getMainClassName(); String[] getAr... |
### Question:
ConciergePlatformBuilder implements PlatformBuilder { public String[] getVMOptions( final PlatformContext context ) { NullArgumentException.validateNotNull( context, "Platform context" ); final Collection<String> vmOptions = new ArrayList<String>(); final File workingDirectory = context.getWorkingDirector... |
### Question:
KnopflerfishPlatformBuilderF300 implements PlatformBuilder { public String getMainClassName() { return MAIN_CLASS_NAME; } KnopflerfishPlatformBuilderF300( final BundleContext bundleContext, final String version ); void prepare( final PlatformContext context ); String getMainClassName(); String[] getArgume... |
### Question:
KnopflerfishPlatformBuilderF300 implements PlatformBuilder { public String getRequiredProfile( final PlatformContext context ) { final Boolean console = context.getConfiguration().startConsole(); if( console == null || !console ) { return null; } else { return CONSOLE_PROFILE; } } KnopflerfishPlatformBuil... |
### Question:
KnopflerfishPlatformBuilderF300 implements PlatformBuilder { public String[] getArguments( final PlatformContext context ) { NullArgumentException.validateNotNull( context, "Platform context" ); return new String[]{ "-xargs", context.getFilePathStrategy().normalizeAsUrl( new File( new File( context.getWor... |
### Question:
KnopflerfishPlatformBuilderF300 implements PlatformBuilder { public String[] getVMOptions( final PlatformContext context ) { NullArgumentException.validateNotNull( context, "Platform context" ); final Collection<String> vmOptions = new ArrayList<String>(); final File workingDirectory = context.getWorkingD... |
### Question:
CommandLineImpl implements CommandLine { public String getOption( final String key ) { final List<String> values = m_options.get( key ); return values == null || values.size() == 0 ? null : values.get( 0 ); } CommandLineImpl( final String... args ); String getOption( final String key ); String[] getMultip... |
### Question:
CommandLineImpl implements CommandLine { public String[] getMultipleOption( final String key ) { final List<String> values = m_options.get( key ); return values == null || values.size() == 0 ? new String[0] : values.toArray( new String[values.size()] ); } CommandLineImpl( final String... args ); String ge... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.