id
stringlengths
7
14
text
stringlengths
1
37.2k
130720730_1
@RequestMapping("/able") public Person cacheable(@RequestBody Person person) { return personService.findOne(person); }
130728684_27
@Override public Mono<Void> deleteString(String applicationId, String serviceInstanceId, String descriptor) { return credHubOperations.credentials() .deleteByName(new SimpleCredentialName(applicationId, serviceInstanceId, descriptor)); }
130775855_1
@Override public void removeBeanDefinition(String beanName) { if (beanDefinitionMap.get(beanName) != null) { beanDefinitionMap.remove(beanName); } else { logger.warn("[Tiny-Spring] Remove BeanDefinition By Name -{} not Find BeanDefinition.", beanName); } }
130821838_0
void analyze(String html) { _analyze(html); }
130875206_1
@SuppressWarnings({ "rawtypes", "unchecked" }) public List<Map<String, Object>> getAll(){ Query query = entityManager.createNativeQuery("select id, code, name from user"); query.unwrap(SQLQuery.class).setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP); List rows = query.getResultList(); return...
130898702_15
public String filename(final TokenMatcher.State state) { return match(state, "filename"); }
130912988_0
public Expression getExpression() { return expression; }
131008831_23
@ReactMethod /** * @param timeout value of 0 results in no timeout */ public void sendRequest( String method, String url, final int requestId, ReadableArray headers, ReadableMap data, final String responseType, final boolean useIncrementalUpdates, int timeout, boolean withCredentia...
131024664_16
public static ThresholdSha256Condition constructMOfNCondition( final int thresholdM, int numSubCondtionsN, final List<Condition> subconditions ) { Objects.requireNonNull(subconditions, "subconditions must not be null!"); if (thresholdM < 0) { throw new IllegalArgumentException("Threshold must not be negati...
131061409_9
public static Position of(String contig, int pos, ImmutableMap<String, Integer> contigs) { return new AutoValue_Position(contig, pos, contigs); }
131063406_0
public static HashMap validate(String body) throws IOException { HashMap<String, Object> input; if ( body == null) { throw Exceptions.invalidInput; } // Parse the input try { input = objectMapper.readValue(body, HashMap.class); } catch (Exception e) { throw Exceptions.i...
131105127_23
public GENERATED_INSTANCE generate() { return generate(null); }
131139519_0
public Stat stat() { MDBX_stat rc = new MDBX_stat(); mdbx_env_stat(pointer(), rc, JNI.SIZEOF_STAT); return new Stat(rc); }
131202949_77
public DeleteDataTablesResponse deleteDatatable(String datatableName) throws ApiException { ApiResponse<DeleteDataTablesResponse> resp = deleteDatatableWithHttpInfo(datatableName); return resp.getData(); }
131246500_63
public static UZException getExceptionPlayback(String msg) { Exception exception = new Exception(UZException.ERR_24 + " " + msg); UZException uzException = new UZException(); uzException.setErrorCode(UZException.ERR_CODE_24); uzException.setException(exception); return uzException; }
131297762_0
public static Config parse(final InputStream stream) throws IOException, BadConfigException { return parse(new BufferedReader(new InputStreamReader(stream))); }
131336637_12
VariableNode variableNode() { consume("${"); char c = 0; StringBuilder varName = new StringBuilder(); Expression defaultExpr = null; LOOP: while ((c = la()) >= 0) { switch (c) { case 0: throw new IllegalArgumentException("Missing '}' " + varName); ...
131477673_6
@Bean public Server server(){ Server server = new Server(); if(server.getPort()==0){ int nonSecurePort = Integer.valueOf(propertyResolver.getProperty("server.port", propertyResolver.getProperty("port", "8080"))); server.setPort(nonSecurePort); } return server; }
131537435_0
protected R find(R e) { R parent = matches.get(e); if (parent == null) { return null; } if (!parent.equals(e)) { R tmp = find(parent); if (!parent.equals(tmp)) { parent = tmp; matches.put(e, parent); } } return parent; }
131561161_1
public static AkkaEngine provider() { AkkaEngine engine = null; // Double checked locking to initialize the weak reference the first time this method // is invoked. if (cachedEngine == null) { synchronized (mutex) { if (cachedEngine == null) { // We could just use the weak reference to get th...
131745127_9
public static LocalDate parseDate(String date) { if (date == null) { throw new IllegalArgumentException("Date must not be null."); } String datePattern = "[0-3]?[0-9]-[0-1]?[0-9]-[1-2][0-9]{3}"; if (!date.matches(datePattern)) { throw new IllegalArgumentException("Date " + date + " ...
131759992_13
public static <T> CompletionStage<T> asyncWhile( final Predicate<? super T> shouldContinue, final Function<? super T, ? extends CompletionStage<T>> fn, final T initialValue) { return TrampolineInternal.trampoline(shouldContinue, fn, initialValue); }
131884789_3
public static void start(Context context, String[] urls, Listener listener) { Prober prober = new GoProber(context); start(prober, urls, listener); }
131961644_2
public Optional<UserInfoVO> getUserInfoVOByUserId(String userId){ return Optional.ofNullable(userInfoMapper.getUserInfoVOByUserId(userId)); }
131964676_7
public static File fallback(File currentDir){ while(!currentDir.exists() && currentDir.getParentFile() != null){ currentDir = currentDir.getParentFile(); } return currentDir; }
132082566_27
public void open() throws DbException, NoSuchElementException, TransactionAbortedException { // some code goes here super.open(); left.open(); right.open(); if(p.getOperator().equals(Predicate.Op.EQUALS)) { joinReuslt=HashJoin(); }else{ joinReuslt=NestedLoopJoin(); ...
132126497_30
@Override public ValidationResults validate(Rule rule) { ValidationResults results = new ValidationResults(); checkEmptyOrNullNames(rule, results); checkName(rule, results); checkUniquenessOfAttributes(rule, results); checkDates(rule, results); return results; }
132161673_0
public void setEnableSSL(boolean enableSSL) { this.enableSSL = enableSSL; }
132171799_1
@RequestMapping(value = "/get",method = RequestMethod.GET) public Object get(@RequestParam("id") String id) { Book result = bookService.get(id); JsonResponse response = new JsonResponse(); response.setStatus(true); response.setData(result); return response; }
132241610_0
public Object handleRequest(final Object input, final Context context) { Map<String, String> headers = new HashMap<>(); headers.put("Content-Type", "application/json"); headers.put("X-Custom-Header", "application/json"); try { final String pageContents = this.getPageContents("https://checkip.ama...
132248956_0
public static <T> Class<T> getTypeClassFromParadigm(final RxBus.Callback<T> callback) { if (callback == null) return null; Type[] genericInterfaces = callback.getClass().getGenericInterfaces(); Type type; if (genericInterfaces.length == 1) { type = genericInterfaces[0]; } else { type...
132370832_55
public static boolean match( String fixedOp, String varOp, Parameter.Operator op, Parameter.ParameterDataType type) { // If fixedOp == null, varOp can match only if null and operator is EQ, or the opposite. if (fixedOp == null) { return (Parameter.Operator.EQ.equals(op) && varOp == null) || ((!Param...
132376292_19
public void processAuthRequest(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { try { if(isRequestFilteringDisabled()) { log.debug("Plugin filters are disabled or not configured yet, bypassing auth process"); chain.doFilter(request, response); ...
132562896_2
public String buildRedirectUri(String referer, String targetPath) { if(isInvalidTargetPath(targetPath)) { throw new BadTargetPathException("Illegal target_path"); } return UriComponentsBuilder.fromUriString(referer) .replacePath(targetPath) .build() .toString(); ...
132573384_9
public void publishSong(final Song song) { songsRepository.storeSong(song); publicationNotifier.onSongPublished(song); }
132587382_43
public static synchronized Partner get(Context context) { if (!sSearched) { PackageManager pm = context.getPackageManager(); final Intent intent = new Intent(ACTION_PARTNER_CUSTOMIZATION); List<ResolveInfo> receivers; if (VERSION.SDK_INT >= VERSION_CODES.N) { receivers = ...
132600378_21
public static boolean isEndMatchWithInlineCommentedCDATA(String trimmedContent) { if (trimmedContent.endsWith(CDATA_SIMPLE_END)) { int offset = trimmedContent.length()- 4; while (trimmedContent.charAt(offset) <= ' ' && trimmedContent.charAt(offset) != '\n') { ...
132609722_1
public static RelyingPartyIdentityBuilder.MandatoryStages builder() { return new RelyingPartyIdentityBuilder.MandatoryStages(); }
132620967_162
public static String stringProperty(Configuration conf, Property property) { return conf.get(property.key(), (String) property.defaultValue()); }
132733058_1
@Override public String toString() { if (document.getFxomRoot() == null) { return I18N.getString("skeleton.empty"); } else { construct(); StringBuilder code = new StringBuilder(); code.append(header); code.append(packageLine); for (String importStatement : impor...
132811956_1179
@Override protected ClientOlapUnit resourceSpecificFieldsToClient(ClientOlapUnit client, OlapUnit serverObject, ToClientConversionOptions options) { client.setMdxQuery(serverObject.getMdxQuery()); final ClientReferenciableOlapConnection clientOlapConnection = resourceReferenceConverterProvider ...
132873186_1
static boolean endsWith(String str, int len, int hashCode) { if (str.length() < len) return false; return str.substring(str.length() - len).hashCode() == hashCode; }
132938098_42
public static String truncate(String input, int length) { if (input != null) { if (input.length() > length) { return input.substring(0, length); } else { return input; } } else { return null; } }
132952801_3
public <T> GraphQLResponseEntity<T> mutate(GraphQLRequestEntity requestEntity, Class<T> responseClass) throws GraphQLException { return execute(GraphQLMethod.MUTATE, requestEntity, responseClass); }
133016017_1
void pull(String elementId, Queue<Item> queue, CompletableFuture resultFuture, int count) { dbClient.getNextAfterId(elementId) .thenAccept(item -> { if (isValid(item)) { queue.offer(item); if (queue.size() == count) { resultFuture.complete(queue); ...
133022875_117
@Override public Double compute() { return sum; }
133025905_1
protected String getIndexName(Metadata md) { String crawlId = md.getFirstValue("n52.crawl.id"); return indexName.replace("*", crawlId.toLowerCase()); }
133030793_0
@SuppressWarnings("unchecked") public void registerCandidates(Class<?> candidateType, Set candidates) { Collection existed = this.candidatesByType.get(candidateType); if (existed == null) { this.candidatesByType.put(candidateType, candidates); } else { existed.addAll(candidates); } }
133047162_129
public Optional<String> header(final String name) { if ( name == null ) { throw new NullPointerException("null name"); } return headers(name).stream().findFirst(); }
133134007_2489
public List<Pair> parameterToPairs(String collectionFormat, String name, Object value){ List<Pair> params = new ArrayList<Pair>(); // preconditions if (name == null || name.isEmpty() || value == null) return params; Collection valueCollection; if (value instanceof Collection) { valueCollection = (Collec...
133145968_1
public boolean isOverrides(MembershipRecord r0) { if (r0 == null) { return isAlive() || isLeaving(); } if (!Objects.equals(member.id(), r0.member.id())) { throw new IllegalArgumentException("Can't compare records for different members"); } if (this.equals(r0)) { return false; } if (r0.isDead()...
133151090_2
public boolean hasEventHandler(Class eventHandlerClass) { Optional<IEventHandler> eventHandler = getEventHandlers().stream().filter(h -> h.getClass().getName().equalsIgnoreCase(eventHandlerClass.getName())).findFirst(); return eventHandler.isPresent(); }
133386452_9
public static String createHotspotInfo(String ssid, int port, String password) throws JSONException { JSONObject hotspotQRCode = new JSONObject(); hotspotQRCode.put(SSID, ssid); hotspotQRCode.put(PORT, port); if (password == null) { hotspotQRCode.put(PROTECTED, false); } else { hots...
133447770_225
@Override public PlaybackParameters setPlaybackParameters(PlaybackParameters playbackParameters) { if (rendererClock != null) { playbackParameters = rendererClock.setPlaybackParameters(playbackParameters); } standaloneMediaClock.setPlaybackParameters(playbackParameters); listener.onPlaybackParametersChanged...
133448635_2
protected static HashMap<String, String> mapSimpleTable( String rawPacket, String[] colNames, String[] mapNames) { HashMap<String, String> colMap = new HashMap<>(); String[] lines = rawPacket.split("\n"); int headerLine = 0; if (lines.length >= headerLine + 2) { String header = lines[headerLine].trim();...
133571699_1
public String toModuleCanvas(Module module) { return toModuleCanvas(module, "{javadocBase}"); }
133662794_5
public static List<String> coverBoundingBox(String geometryWKT, int length) { List<String> list = new ArrayList<>(); Geometry geometry; try { geometry = reader.read(geometryWKT); // returns the bounding box Envelope e = geometry.getEnvelopeInternal(); Coverage c = GeoHash.coverBoundingBox(e.getMaxY(), e.get...
133665895_1
public PowsyblTextLogo() { super(PowsyblTextLogo.class.getResourceAsStream("/images/logo_lfe_powsybl.svg"), 130, 46, 369, 69); }
133752946_16
@Override public Boolean removeMsInst(Long instId) { String key = String.valueOf(instId); TacInst tacInst = hashOperations.get(getMainKey(), key); if (tacInst != null) { hashOperations.delete(getMainKey() + tacInst.getMsCode(), key); } hashOperations.delete(getMainKey(), key); return t...
133753413_102
public InjectSetter(Inject inject) { this.inject = inject; }
133849229_5
@Override public boolean isSearchPlatformConfiguration(String indexName, File file) { return file.isFile() && file.getName().equals("index-shape.json"); }
133914124_29
@Override public boolean ping() { String ping = jedis.ping(); return !Strings.isNullOrEmpty(ping) && Objects.equals(ping.toUpperCase(), PONG); }
134072135_34
public void stop () { for (NetServer server : servers) { //shutdown tcp server server.close(); } }
134143184_310
public void replaceAnchor(byte[] anchorBytes) throws InvalidAnchorInstanceException, AnchorUploadException, MalformedAnchorException, ConfigurationDownloadException, ConfigurationVerifier.ConfigurationVerificationException { uploadAnchor(anchorBytes, true); }
134160731_57
@Override public ConfigValue getValue(final ConfigSourceInterceptorContext context, final String name) { return getValue(context, name, 1); }
134213856_1
public static JSONObject getCredential(TreeMap<String, Object> config) throws IOException { TreeMap<String, Object> params = new TreeMap<String, Object>(); Parameters parameters = new Parameters(); parameters.parse(config); if(parameters.secretId == null) throw new IllegalArgumentException("secretId is...
134236467_376
public static void marshalMasked(Config object, OutputStream outputStream) { XmlProcessingCallback.execute( () -> { Marshaller marshaller = MarshallerBuilder.create().withXmlMediaType().withoutBeanValidation().build(); String xmlData; ...
134287037_0
public <T extends DiagramElement> Optional<T> findDiagramElement(EObject semanticElement, Class<T> clazz) { return findDiagramElement(semanticElement).map(elem -> safeCast(elem, clazz)); }
134362666_15
public void putTTL(String key, String mkey, byte[] value, int ttl) throws KitDBException { byte[] mkey_b = mkey.getBytes(charset); checkTxStart(); try (CloseLock ignored = checkClose()) { byte[] key_b = getKey(key); LockEntity lockEntity = lock(key); try { start(); ...
134390462_249
@Override public AudioInputStream getAudioStream() { return this.audioStream; }
134450682_60
public static void annotate( ClassPathBuilder classPathBuilder, ClassPathResult rootResult, Iterable<LinkageProblem> linkageProblems) throws IOException { checkNotNull(classPathBuilder); checkNotNull(rootResult); checkNotNull(linkageProblems); Map<Artifact, ClassPathResult> cache = new HashMap<...
134457882_12
public static String byte2hex(byte[] byteArray) { StringBuilder sb = new StringBuilder(); for (byte b : byteArray) { sb.append(String.format("%02X", b)); } return sb.toString(); }
134469679_364
public static void putFromJson(final String json, final Record record) { final JsonObject jsonObject = gson.fromJson(json, JsonObject.class); // JSON data from CCL is presumed to be all upper-case final String recordNameUpper = record.getName().toUpperCase(Locale.getDefault()); if (!jsonObject.has(recor...
134503849_73
public TransactionCompletion sendFiles() throws IOException { Transaction transaction = siteToSiteClient.createTransaction(TransferDirection.SEND); try { DataPacketDto.getDataPacketStream(input).forEachOrdered(d -> { try { transaction.send(d); } catch (IOException...
134537813_83
@Override public CompletableFuture<Object> getVar(String name) { return sendWithGenericResponse( prepareMessage(GET_VAR).addArgument(name) ); }
134601948_44
public static void verifyChain( @NonNull final List<X509Certificate> chain, @NonNull final BundleSource<X509Bundle> x509BundleSource) throws CertificateException, BundleNotFoundException { val trustDomain = CertificateUtils.getTrustDomain(chain); val x509Bundle = x509BundleSource.getBun...
134685359_4
public String format(String source) { return format(source, null); }
134724121_6
static String buildNonBooleanOutcomeMessage(Object outcome, String expression) { return "Expression " + expression + " should evaluate to boolean but evaluated to " + (outcome == null? " null" : (outcome.getClass() + " " + outcome)); }
134827539_27
public void onServicesDiscovered(BluetoothGatt gatt, int status) { if (loggingEnabled) { final String methodName = "onServicesDiscovered()"; int index = 1; int max = 3; logDeviceInfo(gatt, methodName, index++, max); logGattStatus(status, met...
134843777_1
public boolean removeImagesAlphaChannel(PDDocument document) { this.document = document; imagesWereChanged = false; try { removeImagesAlphaChannelUnsafe(); return imagesWereChanged; } catch (Exception e) { return false; } }
134900749_22
@Override public StringBuilder exportOneMetric(MetricRegistry.Type scope, MetricID metricID) { alreadyExportedNames.set(new HashSet<>()); MetricRegistry registry = MetricRegistries.get(scope); Map<MetricID, Metric> metricMap = registry.getMetrics(); Metric m = metricMap.get(metricID); Map<MetricID...
134901201_9
public boolean accepts(DotName className) { final boolean accept; final MatchHandler match = new MatchHandler(className); if (match.isQualifiedNameExcluded()) { /* * A FQCN or pattern that *fully* matched the FQCN was given in * `mp.openapi.scan.exclude.classes`. */ ...
134973177_0
@Nullable public static String compressText(String text) { String repeatedSequence = ""; int maxRepeat = 0; String[] split = text.split("\n"); for (String s1 : split) { int repeat = 0; for (String s2 : split) { if (!"".equals(s2.trim()) && s1.trim().equals(s2.trim())) { ...
135031416_5
public static byte[] child(byte[] xprv, String[] hpaths) throws NoSuchAlgorithmException, InvalidKeyException { byte[][] paths = new byte[][]{ Hex.decode(hpaths[0]), Hex.decode(hpaths[1]) }; byte[] res = xprv; for (int i = 0; i < hpaths.length; i++) { byte[] xpub = Derive...
135151675_7
public String createAccessToken(Authentication authentication) { String principal = (String) authentication.getPrincipal(); if (StringUtils.isBlank(principal)) { throw new IllegalStateException("Authentication principle can not be null or empty."); } String[] orgTenantUsername = principal.spl...
135174794_16
@Override public void execute(SensorContext sensorContext) { DurationStatistics statistics = new DurationStatistics(sensorContext.config()); FileSystem fileSystem = sensorContext.fileSystem(); FilePredicate mainFilePredicate = fileSystem.predicates().and( fileSystem.predicates().hasLanguage(language.getKey())...
135205277_5
public synchronized void subscribe(String name, DispatchChannel dispatchChannel) { Optional<DispatchChannel> previous = Optional.fromNullable(subscriptions.get(name)); subscriptions.put(name, dispatchChannel); try { pubSubConnection.subscribe(name); } catch (IOException e) { logger.warn("Subscription e...
135256100_4
@Override public void execute(SensorContext context) { reportOldNodeProperty(context); List<InputFile> inputFiles = getInputFiles(context); if (inputFiles.isEmpty()) { LOG.info("No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped."); return; } File configFile = null; ...
135262635_18
public static BooleanExpression toPredicate(final String rsqlQuery, final Path qClazz) { return toPredicate(rsqlQuery, qClazz, null); }
135270285_2
public static BufferedWriter asBufferedWriter(String fileName) throws IOException { Validate.notBlank(fileName, "filename is blank"); return Files.newBufferedWriter(getPath(fileName), Charsets.UTF_8); }
135281926_4
public Admin getAdminById(Integer adminId) { AdminExample adminExample = new AdminExample(); adminExample.or().andIdEqualTo(adminId); List<Admin> adminList = adminMapper.selectByExample(adminExample); if (adminList != null && adminList.size()>0) return adminList.get(0); return null; }
135289655_1
public void send(){ String context = "Hi i am message all"; System.out.println("Sender: " + context); this.rabbitTemplate.convertAndSend("topicExchange", "topic.1", context); }
135332674_4
public synchronized void decryptSaved(CapillaryHandler handler, Object extra) { List<byte[]> ciphertexts = ciphertextStorage.get(); ciphertextStorage.clear(); for (byte[] data : ciphertexts) { decrypt(data, handler, extra); } }
135337255_5
public SortedSet<WorkingOrder> findMatches(WorkingOrder order) { // Matching only compares price on the opposite side, not entry time MatchingOrderDecorator compare = new MatchingOrderDecorator(order, order.getSource()); SortedSet<WorkingOrder> matches = null; switch (order.getSide()) { case Buy: matc...
135373704_0
@Override public Object getProxy() { Enhancer enhancer = new Enhancer(); enhancer.setSuperclass(advised.getTargetSource().getTargetClass()); enhancer.setInterfaces(advised.getTargetSource().getInterfaces()); enhancer.setCallback(new DynamicAdvisedInterceptor(advised)); Object enhanced = enhancer.cre...
135401010_56
@Override public <T> T create(Class<T> type) { return create(type, null, null); }
135418301_0
public static HashMap<String, Integer> parseJ48(String treeResult) { HashMap<String, Integer> hm = new HashMap<String, Integer>(); //Split the string at each new line char (Regex to take into account different line end chars depending on OS) String[] lines = treeResult.split("\\r\\n?|\\n"); //loop thru...
135513706_41
public List<ProgressionType> getProgressionTypes(QueueItem queueItem) { List<ProgressionType> progressionTypes = new ArrayList<ProgressionType>(); for (ProgressionUnit progressionUnit : queueItem.getProgression().getStructure()) { if (!progressionTypes.contains(progressionUnit.getType())) { ...
135566897_8
;
135579677_293
@Override public boolean equals(Object objectToCompare) { if (this == objectToCompare) { return true; } if (!(objectToCompare instanceof BooleanResponse)) { return false; } if (!super.equals(objectToCompare)) { return false; } BooleanResponse t...