id
stringlengths
7
14
text
stringlengths
1
106k
2562751_9
public static AztecCode encode(byte[] data) { return encode(data, DEFAULT_EC_PERCENT, DEFAULT_AZTEC_LAYERS); }
2572668_0
@Override public Set<User> searchUsers(UserSearchCriteria criteria) { final Set<User> users = this.listUsers(); final Set<User> filteredUsers = this.filterListInMemeory(users, criteria); logger.debug("filteredUsers({}): {}", criteria, filteredUsers); return filteredUsers; }
2572668_1
@Override public Set<String> listUserIds() { final Set<String> userIds = this.userDao.listUserIds(); logger.debug("listUserIds: {}", userIds); return userIds; }
2572668_2
@Override public Set<User> listUsers() { final Set<User> users = this.userDao.listUsers(); logger.debug("listUsers: {}", users); return users; }
2572668_3
@Override public void createUser(String userId) { if (this.userExists(userId)) { this.getLogger().warn("Not creating user " + userId + " they already exist"); return; } final String passwordToken = MD5Crypt.createRandomSalt(16); final String encryptedPassword = MD5Crypt.apacheCrypt(...
2573331_0
private List<String> getGoMappings(Model aUpModel) { List<String> returnMe = new ArrayList(); QueryExecution ex = QueryExecutionFactory.create( "SELECT ?z WHERE{_:x <http://purl.uniprot.org/core/classifiedWith> ?z}", aUpModel); ResultSet rs = ex.execSelect(); while (rs.hasNext()) { QuerySolution sol = rs.next(...
2573331_1
private List<String> getUniprotMappings(Model aUpModel) { QueryExecution ex = QueryExecutionFactory .create("SELECT ?x WHERE{?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://purl.uniprot.org/core/Protein>}", aUpModel); ResultSet rs = ex.execSelect(); List<String> returnMe = new ArrayList<String>(...
2573331_2
public Map<String, Double> getClassCounts(Model model) { QueryExecution execution = QueryExecutionFactory .create("select ?c ?i where { ?i <" + RDF.type + "> ?c }", model); ResultSet result = execution.execSelect(); Map<String, Double> stats = new HashMap<String, Double>(); while (result.hasNext()) { QuerySolu...
2573331_3
public static void main(String[] args) { Options options = createOptions(); CommandLineParser parser = createCliParser(); try { CommandLine cmd = parser.parse(options, args); if (cmd.hasOption("help")) { printUsage(); } Map<String, Double> stats = null; if (cmd.hasOption("stats")) { stats = new HashM...
2576064_0
@Override public Future<ICisOwned> createCis(String cisName, String cisType, Hashtable<String, MembershipCriteria> cisCriteria, String description) { String pPolicy = "<RequestPolicy></RequestPolicy>"; ICisOwned i = this.localCreateCis(cisName, cisType, description,cisCriteria ,pPolicy); return new AsyncResult...
2576064_1
@Override public boolean deleteCis(String cisId) { // TODO Auto-generated method stub return this.deleteOwnedCis(cisId); }
2576064_2
@Override public List<ICis> searchCisByName(String name){ // add subscribed CIS to the list to be returned List<ICis> l = new ArrayList<ICis>(); Iterator<Cis> it = getOwnedCISs().iterator(); while(it.hasNext()){ Cis element = it.next(); if(element.getName().contains(name)) l.add(element); } Iter...
2576064_3
@Override public List<ICisOwned> searchCisByMember(IIdentity css) throws InterruptedException, ExecutionException{ List<ICisOwned> l = new ArrayList<ICisOwned>(); for (ICisOwned temp : this.ownedCISs) { if(temp.getMemberList().contains(new CisParticipant(css.getBareJid()))) l.add(temp); } return l; }
2576064_4
public static void assertion(boolean condition) { if (!condition) { throw new AssertionException(); } }
2576064_5
public static void assertion(boolean condition) { if (!condition) { throw new AssertionException(); } }
2576064_6
public static void assertion(boolean condition) { if (!condition) { throw new AssertionException(); } }
2576064_7
public static void assertion(boolean condition) { if (!condition) { throw new AssertionException(); } }
2576064_8
public static void invariant(boolean condition) { if (!condition) { throw new InvariantException(); } }
2576064_9
public static void invariant(boolean condition) { if (!condition) { throw new InvariantException(); } }
2576181_0
public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if(request.getParameter(SERVICE_PARAMETER) == null) { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Request Parameter 'service' is required."); return; } User ...
2576181_1
public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if(request.getParameter(SERVICE_PARAMETER) == null) { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Request Parameter 'service' is required."); return; } User ...
2576181_2
public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if(request.getParameter(SERVICE_PARAMETER) == null) { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Request Parameter 'service' is required."); return; } User ...
2576181_3
public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if(request.getParameter(SERVICE_PARAMETER) == null) { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Request Parameter 'service' is required."); return; } User ...
2576181_4
public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if(request.getParameter(SERVICE_PARAMETER) == null) { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Request Parameter 'service' is required."); return; } User ...
2576181_5
@Override public void addCookie(Cookie cookie) { super.addCookie(cookie); entry.addCookie(WebEntryUtils.toEntry(cookie)); }
2576181_6
@Override public void sendError(int sc) throws IOException { super.sendError(sc); entry.setStatus(sc); }
2576181_7
@Override public void sendError(int sc) throws IOException { super.sendError(sc); entry.setStatus(sc); }
2576181_8
@Override public void setStatus(int sc) { super.setStatus(sc); entry.setStatus(sc); }
2576181_9
@Override public void setStatus(int sc) { super.setStatus(sc); entry.setStatus(sc); }
2580771_0
@Override public Iterator<V> iterator() { return strict ? new StrictCacheValuesIterator<K, V>( keysIterator, cacheService ) : new NonStrictCacheValuesIterator<K, V>( keysIterator, cacheService ); }
2580771_1
@Override public V put( K key, V value ) { synchronized ( this ) { if ( state == State.LIVE ) { stats.inserts.incrementAndGet(); } inserts++; cacheService.put( key, value ); return value; } }
2580771_2
@Override protected void doGet( HttpServletRequest req, HttpServletResponse resp ) throws ServletException, IOException { // url format = /cache/key so get the key from path String path = req.getPathInfo(); String servletPath = req.getServletPath(); String key = retrieveKeyFromPath( path ); if (...
2580771_3
@Override protected void doGet( HttpServletRequest req, HttpServletResponse resp ) throws ServletException, IOException { // url format = /cache/key so get the key from path String path = req.getPathInfo(); String servletPath = req.getServletPath(); String key = retrieveKeyFromPath( path ); if (...
2588654_0
public String getUsername(Network network, String nick) { return authHandlers.get(network) .getUsername(nick); }
2588654_1
protected boolean updatePeakForChannel(Network network, Channel channel) { try { int storedCount = getCount(network, channel); int numberCurrentlyOnChannel = channel.getNicks().size(); if (storedCount < numberCurrentlyOnChannel) { peaks.put(channelIdentifier(network, channel), ""...
2588654_2
protected static String findMenuItems(String html) { Document doc = Jsoup.parse(html); String menu = ""; Element ul = doc.select("ul").first(); // This is the case for a normal menu. if (ul != null) { for (Element li : ul.children()) { menu += li.select(".food").text() + " " + li...
2588654_3
protected static String findMenuItems(String html) { Document doc = Jsoup.parse(html); String menu = ""; Element ul = doc.select("ul").first(); // This is the case for a normal menu. if (ul != null) { for (Element li : ul.children()) { menu += li.select(".food").text() + " " + li...
2588654_4
protected String serializeFlags(Set<Flag> flags) { String result = ""; for (Flag f : flags) { if (f == Flag.ANYONE) { continue; } result += f; } return result; }
2588654_5
protected Set<Flag> deserializeFlags(String flags) { Set<Flag> result = new HashSet<Flag>(); if (flags != null) { for (char c : flags.toCharArray()) { try { Flag f = Flag.valueOf("" + c); result.add(f); } catch (IllegalArgumentException e) { ...
2588654_6
protected Set<Flag> updateFlags(Set<Flag> currentFlags, String flagsDelta) { char action = '.'; Flag currentFlag; Set<Flag> updatedFlags = new HashSet<Flag>(); updatedFlags.addAll(currentFlags); for (Character c : flagsDelta.toCharArray()) { currentFlag = null; switch (c) { ...
2588654_7
protected ResponseKarmaFind findKarmaChange(PrivMsgEvent e) { Matcher matcher = karmaPattern.matcher(e.getMessage()); if (matcher.find()) { String nick = matcher.group(1); if (nick != null) { if (nick.equals(e.getSender())) { return new ResponseKarmaFind(nick, nick, -...
2588654_8
protected ResponseKarmaFind findKarmaChange(PrivMsgEvent e) { Matcher matcher = karmaPattern.matcher(e.getMessage()); if (matcher.find()) { String nick = matcher.group(1); if (nick != null) { if (nick.equals(e.getSender())) { return new ResponseKarmaFind(nick, nick, -...
2588654_9
protected ResponseKarmaFind findKarmaChange(PrivMsgEvent e) { Matcher matcher = karmaPattern.matcher(e.getMessage()); if (matcher.find()) { String nick = matcher.group(1); if (nick != null) { if (nick.equals(e.getSender())) { return new ResponseKarmaFind(nick, nick, -...
2611961_0
public static String estimateAge(String birthdate) throws ParseException { Date date = RegistrationUtils.parseDate(birthdate); return PatientUtils.estimateAge(date); }
2613332_0
public HtmlPage selectAction(Action action) { try { List<WebElement> buttons = drone.findAll(By.cssSelector(".button-group span span button")); for (WebElement button : buttons) { if (action.name().equals(button.getText())) { button.click(); ...
2613332_1
public String getTitle() { try { return drone.findAndWait(By.cssSelector("div[class='yui-module yui-overlay yui-panel']>div[id='prompt_h']")).getText(); } catch (TimeoutException toe) { throw new PageOperationException("Not visible Element: Remove user from Goup", toe); } }
2613332_2
@SuppressWarnings("unchecked") @Override public AdhocAnalyzerPage render() { return render(new RenderTime(maxPageLoadingTime)); }
2613332_3
public List<TrashCanItem> getTrashCanItemForContent(TrashCanValues trashCanFileType, String contentName, String contentPath) throws PageOperationException { List<TrashCanItem> trashCanItemList = getTrashCanItems(); List<TrashCanItem> item = Collections.emptyList(); if (!trashCanItemList.isEmpty()) { ...
2613332_4
public List<TrashCanItem> getTrashCanItemForContent(TrashCanValues trashCanFileType, String contentName, String contentPath) throws PageOperationException { List<TrashCanItem> trashCanItemList = getTrashCanItems(); List<TrashCanItem> item = Collections.emptyList(); if (!trashCanItemList.isEmpty()) { ...
2613332_5
public List<UserSiteItem> getSites() { List<UserSiteItem> sites = new ArrayList<>(); try { List<WebElement> elements = drone.findAndWaitForElements(SITES_LIST); for (WebElement el : elements) { UserSiteItem site = new UserSiteItem(el, drone); sites.add(site); ...
2613332_6
public UserSiteItem getSite(String siteName) { List<UserSiteItem> sites = getSites(); for (UserSiteItem site : sites) { if (site.getSiteName().equals(siteName)) { return site; } } throw new PageOperationException("Unable to find site: " + siteName); }
2613332_7
@SuppressWarnings("unchecked") @Override public UserSitesPage render(RenderTime timer) { while (true) { timer.start(); synchronized (this) { try { this.wait(100L); } catch (InterruptedException e) { }...
2613332_8
public boolean isOkButtonDisplayed() { try { return drone.find(OK_BUTTON).isDisplayed(); } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("OK button not Present", e); } } return false; }
2613332_9
public boolean isCancelButtonDisplayed() { try { return drone.find(CANCEL_BUTTON).isDisplayed(); } catch (NoSuchElementException e) { if (logger.isTraceEnabled()) { logger.trace("Cancel button not Present", e); } } return false; }
2614085_0
@Override public String toString() { final StringBuilder url = new StringBuilder(); // Add protocol://host:port if they are set if (this.host != null) { url.append(this.protocol).append("://").append(this.host); if (this.port != null) { url.append(":").append(this.port); ...
2614085_1
@Override public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Map<?, ?>)) return false; Map<?, ?> m = (Map<?, ?>) o; if (m.size() != size()) return false; try { Iterator<Entry<String, String[]>> i = entrySet().iterator(); while (i.hasNext()) { ...
2614085_2
@Required public void setServerRegex(String serverRegex) { Validate.notBlank(serverRegex); this.serverRegex = serverRegex; this.pattern = Pattern.compile(this.serverRegex); }
2614085_3
public void setProfile(String profile) { Validate.notBlank(profile); this.profile = profile; }
2614085_4
@Override public String getProfileFname(IPerson person, HttpServletRequest request) { Validate.notNull(person, "Cannot get profile fname for a null person."); Validate.notNull(request, "Cannot get profile fname for a null request."); String userName = person.getUserName(); final String userServerName = ...
2614085_5
@Override public String getProfileFname(IPerson person, HttpServletRequest request) { Validate.notNull(person, "Cannot get profile fname for a null person."); Validate.notNull(request, "Cannot get profile fname for a null request."); String userName = person.getUserName(); final String userServerName = ...
2614085_6
@Override public String getProfileFname(IPerson person, HttpServletRequest request) { Validate.notNull(person, "Cannot get profile fname for a null person."); Validate.notNull(request, "Cannot get profile fname for a null request."); String userName = person.getUserName(); final String userServerName = ...
2614085_7
@Override public String getProfileFname(IPerson person, HttpServletRequest request) { Validate.notNull(person, "Cannot get profile fname for a null person."); Validate.notNull(request, "Cannot get profile fname for a null request."); final String userName = person.getUserName(); Validate.notNull(userNam...
2614085_8
@Override public String getProfileFname(IPerson person, HttpServletRequest request) { Validate.notNull(person, "Cannot get profile fname for a null person."); Validate.notNull(request, "Cannot get profile fname for a null request."); final String userName = person.getUserName(); Validate.notNull(userNam...
2614085_9
@Override public String getProfileFname(IPerson person, HttpServletRequest request) { Validate.notNull(person, "Cannot get profile fname for a null person."); Validate.notNull(request, "Cannot get profile fname for a null request."); final String userName = person.getUserName(); Validate.notNull(userNam...
2618757_0
public Map<String, Schema> getNamedMappings() { ensureInit(); return nameToSchemaMappings; }
2618757_1
public Map<String, Schema> getNamedMappings() { ensureInit(); return nameToSchemaMappings; }
2618757_2
@Override public Set<String> getAvailableNamespaces() { ensureInit(); return namespacesUnmodified; }
2618757_3
public Map<String, String> getToolingParameters(String namespaceURI) { ensureInit(); return toolingParameters.get(trimToNull(namespaceURI)); }
2618757_4
public Map<String, Schema> getNamedMappings() { ensureInit(); return nameToSchemaMappings; }
2618757_5
public Map<String, String> getUriToNameMappings() { ensureInit(); return uriToNameMappings; }
2622727_0
public static HttpRequest get(final CharSequence url) throws HttpRequestException { return new HttpRequest(url, METHOD_GET); }
2622727_1
public static HttpRequest delete(final CharSequence url) throws HttpRequestException { return new HttpRequest(url, METHOD_DELETE); }
2622727_2
public long dateHeader(final String name) throws HttpRequestException { return dateHeader(name, -1L); }
2622727_3
public HttpRequest headers(final Map<String, String> headers) { if (!headers.isEmpty()) for (Entry<String, String> header : headers.entrySet()) header(header); return this; }
2622727_4
public HttpRequest acceptJson() { return accept(CONTENT_TYPE_JSON); }
2622727_5
public static String append(final CharSequence url, final Map<?, ?> params) { final String baseUrl = url.toString(); if (params == null || params.isEmpty()) return baseUrl; final StringBuilder result = new StringBuilder(baseUrl); addPathSeparator(baseUrl, result); addParamPrefix(baseUrl, result); Entry<...
2622727_6
public static String append(final CharSequence url, final Map<?, ?> params) { final String baseUrl = url.toString(); if (params == null || params.isEmpty()) return baseUrl; final StringBuilder result = new StringBuilder(baseUrl); addPathSeparator(baseUrl, result); addParamPrefix(baseUrl, result); Entry<...
2622727_7
public static String append(final CharSequence url, final Map<?, ?> params) { final String baseUrl = url.toString(); if (params == null || params.isEmpty()) return baseUrl; final StringBuilder result = new StringBuilder(baseUrl); addPathSeparator(baseUrl, result); addParamPrefix(baseUrl, result); Entry<...
2622727_8
public static String append(final CharSequence url, final Map<?, ?> params) { final String baseUrl = url.toString(); if (params == null || params.isEmpty()) return baseUrl; final StringBuilder result = new StringBuilder(baseUrl); addPathSeparator(baseUrl, result); addParamPrefix(baseUrl, result); Entry<...
2622727_9
public static String append(final CharSequence url, final Map<?, ?> params) { final String baseUrl = url.toString(); if (params == null || params.isEmpty()) return baseUrl; final StringBuilder result = new StringBuilder(baseUrl); addPathSeparator(baseUrl, result); addParamPrefix(baseUrl, result); Entry<...
2622978_0
public static List<String> extractNonExistingColumns(final Collection<String> expectedColumns, final Collection<String> actualColumns) { final List<String> columnsNotSpecifiedInExpectedDataSet = new ArrayList<String>(); for (String column : expectedColumns) { if (!actualColumns.contains(column.toLow...
2622978_1
public Map<String, Object> map(DBUnitConfiguration configuration) { final Map<String, Object> convertedProperties = new HashMap<String, Object>(); mapProperties(configuration, convertedProperties); mapFeatures(configuration, convertedProperties); return convertedProperties; }
2622978_2
public Map<String, Object> map(DBUnitConfiguration configuration) { final Map<String, Object> convertedProperties = new HashMap<String, Object>(); mapProperties(configuration, convertedProperties); mapFeatures(configuration, convertedProperties); return convertedProperties; }
2622978_3
public Map<String, Object> map(DBUnitConfiguration configuration) { final Map<String, Object> convertedProperties = new HashMap<String, Object>(); mapProperties(configuration, convertedProperties); mapFeatures(configuration, convertedProperties); return convertedProperties; }
2622978_4
public Map<String, Object> map(DBUnitConfiguration configuration) { final Map<String, Object> convertedProperties = new HashMap<String, Object>(); mapProperties(configuration, convertedProperties); mapFeatures(configuration, convertedProperties); return convertedProperties; }
2622978_5
@Override public String createFileName(Class<?> testClass, Method testMethod) { return "expected-" + dataSetFileNamingStrategy.createFileName(testClass, testMethod); }
2622978_6
@Override public String getFileExtension() { return dataSetFileNamingStrategy.getFileExtension(); }
2622978_7
public String resolveDtdLocation(final String xmlFile) { final InputStream xmlStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(xmlFile); try { final DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); builder.setEntityResolver(new Entit...
2622978_8
public String resolveDtdLocationFullPath(final String xml) { final String dtd = resolveDtdLocation(xml); if (dtd == null) { return null; } final String path = xml.substring(0, xml.lastIndexOf('/')); return path + '/' + dtd; }
2622978_9
public String resolveDtdLocation(final String xmlFile) { final InputStream xmlStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(xmlFile); try { final DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); builder.setEntityResolver(new Entit...
2624179_0
@Action void registerConnector( @Nonnull final Connector connector ) { if ( Replicant.shouldCheckInvariants() ) { invariant( () -> _connectors.stream() .noneMatch( e -> e.getConnector().getSchema().getId() == connector.getSchema().getId() ), () -> "Replicant-0015: Invoked registe...
2624179_1
void deregisterConnector( @Nonnull final Connector connector ) { getConnectorsObservableValue().preReportChanged(); detachConnector( connector ); getConnectorsObservableValue().reportChanged(); }
2624179_2
@Nonnull Connector getConnector( final int schemaId ) { return getConnectorEntryBySchemaId( schemaId ).getConnector(); }
2624179_3
@Action void activate() { setActive( true ); }
2624179_4
@Action void deactivate() { setActive( false ); }
2624179_5
@Nonnull public EntityChangeBroker getChangeBroker() { if ( Replicant.shouldCheckApiInvariants() ) { apiInvariant( Replicant::isChangeBrokerEnabled, () -> "Replicant-0042: Attempting to get the ChangeBroker but the change broker is not enabled." ); } assert null != _changeBroker; return ...
2624179_6
@Nonnull public EntityChangeEmitter getChangeEmitter() { return getChangeBroker().getEmitter(); }
2624179_7
@Nonnull public Spy getSpy() { if ( Replicant.shouldCheckApiInvariants() ) { apiInvariant( Replicant::areSpiesEnabled, () -> "Replicant-0021: Attempting to get Spy but spies are not enabled." ); } assert null != _spy; return _spy; }
2624179_8
@Nonnull public ApplicationEventBroker getEventBroker() { if ( Replicant.shouldCheckApiInvariants() ) { apiInvariant( Replicant::areEventsEnabled, () -> "Replicant-0092: Attempting to get ApplicationEventBroker but events are not enabled." ); } assert null != _eventBroker; return _eventB...
2624179_9
public void setConnectorRequired( final int schemaId, final boolean required ) { getRuntime().setConnectorRequired( schemaId, required ); }