id
stringlengths
7
14
text
stringlengths
1
106k
1163806_8
public Map<String, String> parse(final String string) throws IOException { return parse(new BufferedReader(new StringReader(string))); }
1163806_9
public Map<String, String> parse(final String string) throws IOException { return parse(new BufferedReader(new StringReader(string))); }
1164965_0
public List<PathParameter> parse(final URL url) { List<PathParameter> result = new ArrayList<PathParameter>(); String inboundUrl = url.toURL(); if (this.matches(url)) { Iterator<Segment> iter = pathSegments.iterator(); while (iter.hasNext()) { Segment segment = iter.next(); ...
1164965_1
public List<PathParameter> parse(final URL url) { List<PathParameter> result = new ArrayList<PathParameter>(); String inboundUrl = url.toURL(); if (this.matches(url)) { Iterator<Segment> iter = pathSegments.iterator(); while (iter.hasNext()) { Segment segment = iter.next(); ...
1164965_2
public List<PathParameter> parse(final URL url) { List<PathParameter> result = new ArrayList<PathParameter>(); String inboundUrl = url.toURL(); if (this.matches(url)) { Iterator<Segment> iter = pathSegments.iterator(); while (iter.hasNext()) { Segment segment = iter.next(); ...
1164965_3
public boolean matches(final URL target) { if (elPattern) { return urlElPattern.matcher(target.toURL()).matches(); } else { return urlPattern.toURL().equals(target.toURL()); } }
1164965_4
public boolean matches(final URL target) { if (elPattern) { return urlElPattern.matcher(target.toURL()).matches(); } else { return urlPattern.toURL().equals(target.toURL()); } }
1164965_5
public boolean matches(final URL target) { if (elPattern) { return urlElPattern.matcher(target.toURL()).matches(); } else { return urlPattern.toURL().equals(target.toURL()); } }
1164965_6
public boolean matches(final URL target) { if (elPattern) { return urlElPattern.matcher(target.toURL()).matches(); } else { return urlPattern.toURL().equals(target.toURL()); } }
1164965_7
public boolean matches(final URL target) { if (elPattern) { return urlElPattern.matcher(target.toURL()).matches(); } else { return urlPattern.toURL().equals(target.toURL()); } }
1164965_8
public List<PathParameter> parse(final URL url) { List<PathParameter> result = new ArrayList<PathParameter>(); String inboundUrl = url.toURL(); if (this.matches(url)) { Iterator<Segment> iter = pathSegments.iterator(); while (iter.hasNext()) { Segment segment = iter.next(); ...
1164965_9
public List<PathParameter> parse(final URL url) { List<PathParameter> result = new ArrayList<PathParameter>(); String inboundUrl = url.toURL(); if (this.matches(url)) { Iterator<Segment> iter = pathSegments.iterator(); while (iter.hasNext()) { Segment segment = iter.next(); ...
116547_10
public static Locale localeFor(String isoString) { String[] languageAndCountry = isoString.split("-"); if (languageAndCountry.length == 1) { return new Locale(isoString); } else { return new Locale(languageAndCountry[0], languageAndCountry[1]); } }
116547_11
public static Locale localeFor(String isoString) { String[] languageAndCountry = isoString.split("-"); if (languageAndCountry.length == 1) { return new Locale(isoString); } else { return new Locale(languageAndCountry[0], languageAndCountry[1]); } }
116547_12
public static Locale localeFor(String isoString) { String[] languageAndCountry = isoString.split("-"); if (languageAndCountry.length == 1) { return new Locale(isoString); } else { return new Locale(languageAndCountry[0], languageAndCountry[1]); } }
116547_13
public static Locale localeFor(String isoString) { String[] languageAndCountry = isoString.split("-"); if (languageAndCountry.length == 1) { return new Locale(isoString); } else { return new Locale(languageAndCountry[0], languageAndCountry[1]); } }
116547_14
public static Locale localeFor(String isoString) { String[] languageAndCountry = isoString.split("-"); if (languageAndCountry.length == 1) { return new Locale(isoString); } else { return new Locale(languageAndCountry[0], languageAndCountry[1]); } }
1165813_0
public static String extract(final String pem, final String passPhrase) throws IOException { final Object priv = PEMDecoder.decode(pem.toCharArray(), passPhrase); if (priv instanceof RSAPrivateKey) { return "ssh-rsa " + DatatypeConverter.printBase64Binary(RSASHA1Verify.encodeSSHRSAPublicKey(((RSAPrivate...
1165813_1
public static String extract(final String pem, final String passPhrase) throws IOException { final Object priv = PEMDecoder.decode(pem.toCharArray(), passPhrase); if (priv instanceof RSAPrivateKey) { return "ssh-rsa " + DatatypeConverter.printBase64Binary(RSASHA1Verify.encodeSSHRSAPublicKey(((RSAPrivate...
1165813_2
public static String extract(final String pem, final String passPhrase) throws IOException { final Object priv = PEMDecoder.decode(pem.toCharArray(), passPhrase); if (priv instanceof RSAPrivateKey) { return "ssh-rsa " + DatatypeConverter.printBase64Binary(RSASHA1Verify.encodeSSHRSAPublicKey(((RSAPrivate...
1165813_3
public static String extract(final String pem, final String passPhrase) throws IOException { final Object priv = PEMDecoder.decode(pem.toCharArray(), passPhrase); if (priv instanceof RSAPrivateKey) { return "ssh-rsa " + DatatypeConverter.printBase64Binary(RSASHA1Verify.encodeSSHRSAPublicKey(((RSAPrivate...
1165813_4
public static String extract(final String pem, final String passPhrase) throws IOException { final Object priv = PEMDecoder.decode(pem.toCharArray(), passPhrase); if (priv instanceof RSAPrivateKey) { return "ssh-rsa " + DatatypeConverter.printBase64Binary(RSASHA1Verify.encodeSSHRSAPublicKey(((RSAPrivate...
1165813_5
public static String extract(final String pem, final String passPhrase) throws IOException { final Object priv = PEMDecoder.decode(pem.toCharArray(), passPhrase); if (priv instanceof RSAPrivateKey) { return "ssh-rsa " + DatatypeConverter.printBase64Binary(RSASHA1Verify.encodeSSHRSAPublicKey(((RSAPrivate...
1165813_6
public Void apply(Iterable<RunningNode> runningNode) { Builder<String, String> cloudNodesToSuspendBuilder = ImmutableMultimap.<String, String>builder(); Builder<String, String> cloudNodesToDestroyBuilder = ImmutableMultimap.<String, String>builder(); for (RunningNode cloudTemplateNode : runningNode) { ...
1165813_7
public Void apply(Iterable<RunningNode> runningNode) { Builder<String, String> cloudNodesToSuspendBuilder = ImmutableMultimap.<String, String>builder(); Builder<String, String> cloudNodesToDestroyBuilder = ImmutableMultimap.<String, String>builder(); for (RunningNode cloudTemplateNode : runningNode) { ...
1165813_8
public Void apply(Iterable<RunningNode> runningNode) { Builder<String, String> cloudNodesToSuspendBuilder = ImmutableMultimap.<String, String>builder(); Builder<String, String> cloudNodesToDestroyBuilder = ImmutableMultimap.<String, String>builder(); for (RunningNode cloudTemplateNode : runningNode) { ...
1165813_9
static JCloudsCloud getByName(String name) { return (JCloudsCloud) Jenkins.getInstance().clouds.getByName(name); }
1167439_0
public void process(final MessageExchange messageExchange) throws Exception { final ContinuationData data = continuations.remove(messageExchange.getExchangeId()); if (data == null) { logger.error("Unexpected MessageExchange received: {}", messageExchange); } else { binding.runWithCamelContex...
1167439_1
public static ObjectName register(MBeanServer server, ObjectName name, Object object) throws JBIException { if (server == null) { throw new JBIException("MBeanServer is null when registering MBean " + name); } try { // unregister a previously existing MBean first doUnregister(server,...
1167439_2
public static void unregister(MBeanServer server, ObjectName name) throws JBIException { if (name != null) { if (server == null) { throw new JBIException("MBeanServer is null when registering MBean " + name); } try { doUnregister(server, name); } catch (JMExce...
1169309_0
@Override protected Localizable createDescription(final AnnotationProvider result) { if (result.getNumberOfAnnotations() == 0) { return Messages._FindBugs_ResultAction_HealthReportNoItem(); } else if (result.getNumberOfAnnotations() == 1) { return Messages._FindBugs_ResultAction_HealthReport...
1169309_1
public List<Pattern> parse(final InputStream file) throws IOException, SAXException { SecureDigester digester = new SecureDigester(FindBugsMessages.class); List<Pattern> patterns = new ArrayList<Pattern>(); digester.push(patterns); String startPattern = "*/BugPattern"; digester.addObjectCreate(start...
1169309_2
List<XmlBugInstance> preParse(final InputStream file) throws SAXException, IOException { SecureDigester digester = new SecureDigester(FindBugsParser.class); String rootXPath = "BugCollection/BugInstance"; digester.addObjectCreate(rootXPath, XmlBugInstance.class); digester.addSetProperties(rootXPath); ...
1169309_3
public static boolean isFindBugs2x(final MojoExecution mojoExecution) { try { String[] versions = StringUtils.split(mojoExecution.getVersion(), "."); if (versions.length > 1) { int major = Integer.parseInt(versions[0]); int minor = Integer.parseInt(versions[1]); r...
1169697_2
public void backoff() { retryTime = Clock.unixTime() + sleepIncrement; sleepIncrement *= 2; backoffCount++; }
1169697_4
public FixedRetryPolicy(int numRetries) { this.numRetries = numRetries; }
1169697_5
public static SourceBuilder builder() { return new SourceBuilder() { @Override public EventSource build(String... argv) { // accept 0 or 1 argument. Preconditions.checkArgument(argv.length <= 1, "usage: collectorSource[(port={" + FlumeConfiguration.COLLECTOR_EVENT_PORT + "}...
1169697_6
public CollectorSource(int port) { this.src = new ThriftEventSource(port); this.port = port; }
1169697_7
public static SinkBuilder builder() { return new SinkBuilder() { @Override public EventSink build(Context context, String... argv) { Preconditions.checkArgument(argv.length <= 3 && argv.length >= 2, "usage: collectorSink[(dfsdir,path[,rollmillis])]"); String logdir = FlumeConfiguration.g...
1169697_8
synchronized public void start() { FlumeConfiguration conf = FlumeConfiguration.get(); ReportManager.get().add(vmInfo); ReportManager.get().add(sysInfo); ReportManager.get().add(this); if (startHttp) { try { String webPath = getWebPath(conf); boolean findport = FlumeConfiguration.get().getNode...
1169697_9
public static void loadOutputFormatPlugins() { String outputFormatPluginClasses = FlumeConfiguration.get().get( FlumeConfiguration.OUTPUT_FORMAT_PLUGIN_CLASSES, ""); String[] classes = outputFormatPluginClasses.split(",\\s*"); for (String className : classes) { try { Class<?> cls = Class.forName(c...
1171506_0
public void subscribe(Class<? extends Subscriber> subscriber) { try { monitor.lock(); if (subscriber.isAnnotationPresent(InterestedEvent.class)) { InterestedEvent ann = subscriber.getAnnotation(InterestedEvent.class); for (Class<? extends Event> interestedEvent : ann.events()) { if (!subscribers.contains...
1171506_1
@SuppressWarnings("unchecked") public void publish(Event event) { try { monitor.lock(); if (subscribers.containsKey(event.getClass())) { eventPublisher.publish((LinkedList<Class<? extends Subscriber>>) subscribers.get(event.getClass()).clone(), event); } } finally { monitor.unlock(); } }
1176274_0
boolean hasPlayerMoved() { final double MAX_MOVE_TOLERANCE = 1.5; return distance3D(player.getLocation(), originalLocation) > MAX_MOVE_TOLERANCE; }
1176274_1
boolean hasPlayerMoved() { final double MAX_MOVE_TOLERANCE = 1.5; return distance3D(player.getLocation(), originalLocation) > MAX_MOVE_TOLERANCE; }
1176274_2
boolean hasPlayerMoved() { final double MAX_MOVE_TOLERANCE = 1.5; return distance3D(player.getLocation(), originalLocation) > MAX_MOVE_TOLERANCE; }
1176274_3
boolean hasPlayerTakenDamage() { final double MAX_DAMAGE_TOLERANCE = 2; return Math.abs(originalHealth - player.getHealth()) > MAX_DAMAGE_TOLERANCE; }
1176274_4
boolean hasPlayerTakenDamage() { final double MAX_DAMAGE_TOLERANCE = 2; return Math.abs(originalHealth - player.getHealth()) > MAX_DAMAGE_TOLERANCE; }
1176274_5
boolean hasPlayerTakenDamage() { final double MAX_DAMAGE_TOLERANCE = 2; return Math.abs(originalHealth - player.getHealth()) > MAX_DAMAGE_TOLERANCE; }
1181284_0
public DownloadableResource getDownloadableResource(final String url, final Map<String, String> queryParams) { try { if (SuperBatchPluginResource.matches(url)) { return locateSuperBatchPluginResource(SuperBatchPluginResource.parse(url, queryParams)); } if (SuperBatchSubResource.m...
1181284_1
public DownloadableResource getDownloadableResource(final String url, final Map<String, String> queryParams) { try { if (SuperBatchPluginResource.matches(url)) { return locateSuperBatchPluginResource(SuperBatchPluginResource.parse(url, queryParams)); } if (SuperBatchSubResource.m...
1181284_2
public DownloadableResource getDownloadableResource(final String url, final Map<String, String> queryParams) { try { if (SuperBatchPluginResource.matches(url)) { return locateSuperBatchPluginResource(SuperBatchPluginResource.parse(url, queryParams)); } if (SuperBatchSubResource.m...
1181284_3
public DownloadableResource getDownloadableResource(final String url, final Map<String, String> queryParams) { try { if (SuperBatchPluginResource.matches(url)) { return locateSuperBatchPluginResource(SuperBatchPluginResource.parse(url, queryParams)); } if (SuperBatchSubResource.m...
1181284_4
public DownloadableResource getDownloadableResource(final String url, final Map<String, String> queryParams) { try { if (SuperBatchPluginResource.matches(url)) { return locateSuperBatchPluginResource(SuperBatchPluginResource.parse(url, queryParams)); } if (SuperBatchSubResource.m...
1181284_5
public DownloadableResource getDownloadableResource(final String url, final Map<String, String> queryParams) { try { if (SuperBatchPluginResource.matches(url)) { return locateSuperBatchPluginResource(SuperBatchPluginResource.parse(url, queryParams)); } if (SuperBatchSubResource.m...
1181284_6
public DownloadableResource getDownloadableResource(final String url, final Map<String, String> queryParams) { try { if (SuperBatchPluginResource.matches(url)) { return locateSuperBatchPluginResource(SuperBatchPluginResource.parse(url, queryParams)); } if (SuperBatchSubResource.m...
1181284_7
public List<PluginResource> getPluginResources(final String moduleCompleteKey) { final ModuleDescriptor<?> moduleDescriptor = pluginAccessor.getEnabledPluginModule(moduleCompleteKey); if ((moduleDescriptor == null) || !(moduleDescriptor instanceof WebResourceModuleDescriptor)) { log.error("Error loading...
1181284_8
public List<PluginResource> getPluginResources(final String moduleCompleteKey) { final ModuleDescriptor<?> moduleDescriptor = pluginAccessor.getEnabledPluginModule(moduleCompleteKey); if ((moduleDescriptor == null) || !(moduleDescriptor instanceof WebResourceModuleDescriptor)) { log.error("Error loading...
1181284_9
public List<PluginResource> getPluginResources(final String moduleCompleteKey) { final ModuleDescriptor<?> moduleDescriptor = pluginAccessor.getEnabledPluginModule(moduleCompleteKey); if ((moduleDescriptor == null) || !(moduleDescriptor instanceof WebResourceModuleDescriptor)) { log.error("Error loading...
1184582_0
protected long allocate(long startTime, long duration) { performedWork += duration; return rangeChain.allocateWork(startTime, duration); }
1184582_1
protected long allocate(long startTime, long duration) { performedWork += duration; return rangeChain.allocateWork(startTime, duration); }
1184582_2
public String getOutput() { return output; }
1184582_3
public Map<String, DeclaredType> getTypes() { return types; }
1184582_4
public List<Rule> getRules() { return rules; }
1184582_5
public String parseOutput(String right) { return parseOutput(null, right); }
1184582_6
public String parseOutput(String right) { return parseOutput(null, right); }
1184582_7
public String parseOutput(String right) { return parseOutput(null, right); }
1184582_8
public String parseOutput(String right) { return parseOutput(null, right); }
1184582_9
public String getGetter(String text) { String[] parts = text.split(VARIABLE_SEPARATOR); if (parts.length == 0) { return ""; } if (parts.length == 1) { return getGetter(text + "." + types.get(text).getValue()); } StringBuffer getter = new StringBuffer(parts[0]); for (int i = 1...
1193862_0
public File getXMLDefinitionFile() { Writer writer = null; File xmlFile = new File(project.getFileSystem().getSonarWorkingDirectory(), CONFIGURATON_FILE); try { writer = new OutputStreamWriter(new FileOutputStream(xmlFile, false), CharEncoding.UTF_8); exporter.exportProfile(profile, writer...
1193862_1
public RulesProfile createProfile(ValidationMessages messages) { return xmlProfileParser.parseResource(getClass().getClassLoader(), "org/sonar/plugins/ideainspections/profile-sun-conventions.xml", messages); }
1193862_2
public List getExtensions() { return Arrays.asList(IdeaSensor.class, IdeaConfiguration.class, IdeaExecutor.class, IdeaAuditListener.class, IdeaProfileExporter.class, IdeaImporter.class, ...
1193862_3
public RulesProfile createProfile(ValidationMessages messages) { return xmlProfileParser.parseResource(getClass().getClassLoader(), "org/sonar/plugins/ideainspections/profile-sonar-way.xml", messages); }
1193862_4
public Collection<Violation> getViolations() { return violations; }
1193862_5
@Override public RulesProfile createProfile(ValidationMessages validationMessages) { RulesProfile profile = sonarWay.createProfile(validationMessages); profile.setName(RulesProfile.SONAR_WAY_FINDBUGS_NAME); return profile; }
1193862_6
public void exportProfile(RulesProfile profile, Writer writer) { try { appendXmlHeader(writer); SortedMap<String, Rule> defaultRules = new TreeMap<String, Rule>(DefaultRules.get()); for (ActiveRule activeRule : profile.getActiveRulesByRepository(REPOSITORY_KEY)) { final Rule ...
1193862_7
public void exportProfile(RulesProfile profile, Writer writer) { try { appendXmlHeader(writer); SortedMap<String, Rule> defaultRules = new TreeMap<String, Rule>(DefaultRules.get()); for (ActiveRule activeRule : profile.getActiveRulesByRepository(REPOSITORY_KEY)) { final Rule ...
1193862_8
public void exportProfile(RulesProfile profile, Writer writer) { try { appendXmlHeader(writer); SortedMap<String, Rule> defaultRules = new TreeMap<String, Rule>(DefaultRules.get()); for (ActiveRule activeRule : profile.getActiveRulesByRepository(REPOSITORY_KEY)) { final Rule ...
1193862_9
public void exportProfile(RulesProfile profile, Writer writer) { try { appendXmlHeader(writer); SortedMap<String, Rule> defaultRules = new TreeMap<String, Rule>(DefaultRules.get()); for (ActiveRule activeRule : profile.getActiveRulesByRepository(REPOSITORY_KEY)) { final Rule ...
1194243_0
public static void removeEntities(Reader reader, Writer writer) throws IOException { int curChar = -1; StringBuffer ent = null; if (reader == null) { throw new IllegalArgumentException("null reader arg"); } else if (writer == null) { throw new IllegalArgumentException("null write...
1194243_1
public static void removeEntities(Reader reader, Writer writer) throws IOException { int curChar = -1; StringBuffer ent = null; if (reader == null) { throw new IllegalArgumentException("null reader arg"); } else if (writer == null) { throw new IllegalArgumentException("null write...
1194243_2
public static void removeEntities(Reader reader, Writer writer) throws IOException { int curChar = -1; StringBuffer ent = null; if (reader == null) { throw new IllegalArgumentException("null reader arg"); } else if (writer == null) { throw new IllegalArgumentException("null write...
1194243_3
public static void removeEntities(Reader reader, Writer writer) throws IOException { int curChar = -1; StringBuffer ent = null; if (reader == null) { throw new IllegalArgumentException("null reader arg"); } else if (writer == null) { throw new IllegalArgumentException("null write...
1194243_4
public static void removeEntities(Reader reader, Writer writer) throws IOException { int curChar = -1; StringBuffer ent = null; if (reader == null) { throw new IllegalArgumentException("null reader arg"); } else if (writer == null) { throw new IllegalArgumentException("null write...
1194243_5
public static void removeEntities(Reader reader, Writer writer) throws IOException { int curChar = -1; StringBuffer ent = null; if (reader == null) { throw new IllegalArgumentException("null reader arg"); } else if (writer == null) { throw new IllegalArgumentException("null write...
1194243_6
public static void removeEntities(Reader reader, Writer writer) throws IOException { int curChar = -1; StringBuffer ent = null; if (reader == null) { throw new IllegalArgumentException("null reader arg"); } else if (writer == null) { throw new IllegalArgumentException("null write...
1194243_7
public static void removeEntities(Reader reader, Writer writer) throws IOException { int curChar = -1; StringBuffer ent = null; if (reader == null) { throw new IllegalArgumentException("null reader arg"); } else if (writer == null) { throw new IllegalArgumentException("null write...
1194243_8
public static void removeEntities(Reader reader, Writer writer) throws IOException { int curChar = -1; StringBuffer ent = null; if (reader == null) { throw new IllegalArgumentException("null reader arg"); } else if (writer == null) { throw new IllegalArgumentException("null write...
1194243_9
public static void removeEntities(Reader reader, Writer writer) throws IOException { int curChar = -1; StringBuffer ent = null; if (reader == null) { throw new IllegalArgumentException("null reader arg"); } else if (writer == null) { throw new IllegalArgumentException("null write...
1195109_0
public void setFullName(String fullName) { this.fullName = fullName; }
1204957_0
@SuppressWarnings("ConstantConditions") @Override public List<MovieInfo> parseMovieInfo(String content, int maxCount, int posterCount, int backdropCount) throws ParseException { // Minus if (posterCount < 0) { posterCount = Integer.MAX_VALUE; } if (backdropCount < 0) { backdropCount = In...
1205446_0
public static long calculateNotifTime(Long nowMillis, int hourToNotify) { DateTime now = new DateTime(nowMillis); DateTime timeToNotify = new DateTime(nowMillis); timeToNotify = timeToNotify.withHourOfDay(hourToNotify); if (timeToNotify.isBefore(now)) { timeToNotify = timeToNotify.plusDays(1); ...
1205842_0
@Override public List<String> getOperationsList() { Set<String> operationsList = new HashSet<String>(); for (OperationsDefinition def : this.definition) { if ((def.getTransitions() != null)) { for (DestinationDefinition destination : def.getTransitions()) { operationsList.add(destination.getAction()); } ...
1205842_1
@Override public List<String> getOperations(String state) { List<String> operationsList = new ArrayList<String>(); for (OperationsDefinition def : this.definition) { if (state.equals(def.getName())) { if ((def.getTransitions() != null)) { for (DestinationDefinition operations : def .getTransitions()) {...
1206855_0
@Override public String toString() { StringBuilder sb = new StringBuilder(); for (Resource r : resources) { if (sb.length() > 0) sb.append('\n'); sb.append(getURL(r).toString()); } return sb.toString(); }
1206855_1
public ProgressBar(String id, ProgressionModel model) { super(id, model); // add CSS to parent to render the CSS even if the progress bar is initially // invisible add(new Label("label", getLabelModel(model))); add(new Label("message", getMessageModel(model))); add(new WebMarkupContainer("bar").add(new AttributeM...
1206855_2
public void setFilter(Contact filter) { if (filter == null) { throw new IllegalArgumentException("Null value not allowed."); } this.filter = filter; }
1206855_3
@Override public Class<? extends Page> getHomePage() { return ListContactsPage.class; }
1206855_4
@Override protected Contact load() { return dao.load(id); }
1206855_5
protected static String format(String pattern, Date currentTime) { return new SimpleDateFormat(pattern,Locale.GERMAN).format(currentTime); }