idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
564,737 | public synchronized void start() {<NEW_LINE>if (!this.running.get()) {<NEW_LINE>this.proxyExecutor.execute(() -> {<NEW_LINE>ZMQ.Socket captureSocket = null;<NEW_LINE>if (this.exposeCaptureSocket) {<NEW_LINE>captureSocket = this.context.createSocket(SocketType.PUB);<NEW_LINE>}<NEW_LINE>try (ZMQ.Socket frontendSocket = this.context.createSocket(this.type.getFrontendSocketType());<NEW_LINE>ZMQ.Socket backendSocket = this.context.createSocket(this.type.getBackendSocketType());<NEW_LINE>ZMQ.Socket controlSocket = this.context.createSocket(SocketType.PAIR)) {<NEW_LINE>if (this.frontendSocketConfigurer != null) {<NEW_LINE>this.frontendSocketConfigurer.accept(frontendSocket);<NEW_LINE>}<NEW_LINE>if (this.backendSocketConfigurer != null) {<NEW_LINE>this.backendSocketConfigurer.accept(backendSocket);<NEW_LINE>}<NEW_LINE>// NOSONAR<NEW_LINE>this.frontendPort.set(bindSocket(frontendSocket, this<MASK><NEW_LINE>// NOSONAR<NEW_LINE>this.backendPort.set(bindSocket(backendSocket, this.backendPort.get()));<NEW_LINE>// NOSONAR<NEW_LINE>boolean bound = controlSocket.bind(this.controlAddress);<NEW_LINE>if (!bound) {<NEW_LINE>throw new IllegalArgumentException("Cannot bind ZeroMQ socket to address: " + this.controlAddress);<NEW_LINE>}<NEW_LINE>if (captureSocket != null) {<NEW_LINE>bound = captureSocket.bind(this.captureAddress);<NEW_LINE>if (!bound) {<NEW_LINE>throw new IllegalArgumentException("Cannot bind ZeroMQ socket to address: " + this.captureAddress);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.running.set(true);<NEW_LINE>ZMQ.proxy(frontendSocket, backendSocket, captureSocket, controlSocket);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>// NOSONAR<NEW_LINE>LOG.error("Cannot start ZeroMQ proxy from bean: " + this.beanName, ex);<NEW_LINE>} finally {<NEW_LINE>if (captureSocket != null) {<NEW_LINE>captureSocket.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | .frontendPort.get())); |
694,192 | private SwaggerParseResult readContents(String swaggerAsString, List<AuthorizationValue> auth, ParseOptions options, String location) {<NEW_LINE>if (swaggerAsString == null || swaggerAsString.trim().isEmpty()) {<NEW_LINE>return SwaggerParseResult.ofError("Null or empty definition");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final ObjectMapper mapper = getRightMapper(swaggerAsString);<NEW_LINE>JsonNode rootNode;<NEW_LINE>final SwaggerParseResult deserializationUtilsResult = new SwaggerParseResult();<NEW_LINE>if (options != null && options.isLegacyYamlDeserialization()) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>rootNode = DeserializationUtils.deserializeIntoTree(swaggerAsString, location, options, deserializationUtilsResult);<NEW_LINE>} catch (Exception e) {<NEW_LINE>rootNode = mapper.readTree(swaggerAsString);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SwaggerParseResult result;<NEW_LINE>if (options != null) {<NEW_LINE>result = parseJsonNode(location, rootNode, options);<NEW_LINE>} else {<NEW_LINE>result = parseJsonNode(location, rootNode);<NEW_LINE>}<NEW_LINE>if (result.getOpenAPI() != null) {<NEW_LINE>result = resolve(result, auth, options, location);<NEW_LINE>}<NEW_LINE>if (deserializationUtilsResult.getMessages() != null) {<NEW_LINE>for (String s : deserializationUtilsResult.getMessages()) {<NEW_LINE>result.message(getParseErrorMessage(s, location));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} catch (JsonProcessingException e) {<NEW_LINE>LOGGER.warn("Exception while parsing:", e);<NEW_LINE>final String message = getParseErrorMessage(e.getOriginalMessage(), location);<NEW_LINE>return SwaggerParseResult.ofError(message);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.warn("Exception while parsing:", e);<NEW_LINE>final String message = getParseErrorMessage(e.getMessage(), location);<NEW_LINE>return SwaggerParseResult.ofError(message);<NEW_LINE>}<NEW_LINE>} | rootNode = mapper.readTree(swaggerAsString); |
1,452,015 | private ObjectMapper createMapper(JsonFactory mapping, ClassLoader classLoader) {<NEW_LINE>ObjectMapper mapper = new ObjectMapper(mapping);<NEW_LINE>mapper.addMixIn(Config.class, ConfigMixIn.class);<NEW_LINE>mapper.addMixIn(ReferenceCodecProvider.class, ClassMixIn.class);<NEW_LINE>mapper.addMixIn(AddressResolverGroupFactory.class, ClassMixIn.class);<NEW_LINE>mapper.addMixIn(Codec.class, ClassMixIn.class);<NEW_LINE>mapper.addMixIn(RedissonNodeInitializer.class, ClassMixIn.class);<NEW_LINE>mapper.addMixIn(LoadBalancer.class, ClassMixIn.class);<NEW_LINE>mapper.addMixIn(NatMapper.class, ClassMixIn.class);<NEW_LINE>mapper.addMixIn(<MASK><NEW_LINE>mapper.addMixIn(NettyHook.class, ClassMixIn.class);<NEW_LINE>FilterProvider filterProvider = new SimpleFilterProvider().addFilter("classFilter", SimpleBeanPropertyFilter.filterOutAllExcept());<NEW_LINE>mapper.setFilterProvider(filterProvider);<NEW_LINE>mapper.setSerializationInclusion(Include.NON_NULL);<NEW_LINE>mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);<NEW_LINE>if (classLoader != null) {<NEW_LINE>TypeFactory tf = TypeFactory.defaultInstance().withClassLoader(classLoader);<NEW_LINE>mapper.setTypeFactory(tf);<NEW_LINE>}<NEW_LINE>return mapper;<NEW_LINE>} | NameMapper.class, ClassMixIn.class); |
1,291,055 | private void open(long position) {<NEW_LINE>File file;<NEW_LINE>FileOutputStream os = null;<NEW_LINE>FileChannel fileChannel = null;<NEW_LINE>try {<NEW_LINE>file = resource.getFile();<NEW_LINE>FileUtils.setUpOutputFile(file, restarted, false, overwriteOutput);<NEW_LINE>Assert.state(resource.exists(), "Output resource must exist");<NEW_LINE>os = new FileOutputStream(file, true);<NEW_LINE>fileChannel = os.getChannel();<NEW_LINE>channel = os.getChannel();<NEW_LINE>setPosition(position);<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>throw new DataAccessResourceFailureException("Unable to write to file resource: [" + resource + "]", ioe);<NEW_LINE>}<NEW_LINE>XMLOutputFactory outputFactory = createXmlOutputFactory();<NEW_LINE>if (outputFactory.isPropertySupported("com.ctc.wstx.automaticEndElements")) {<NEW_LINE>// If the current XMLOutputFactory implementation is supplied by<NEW_LINE>// Woodstox >= 3.2.9 we want to disable its<NEW_LINE>// automatic end element feature (see:<NEW_LINE>// https://jira.codehaus.org/browse/WSTX-165) per<NEW_LINE>// https://jira.spring.io/browse/BATCH-761).<NEW_LINE>outputFactory.setProperty("com.ctc.wstx.automaticEndElements", Boolean.FALSE);<NEW_LINE>}<NEW_LINE>if (outputFactory.isPropertySupported("com.ctc.wstx.outputValidateStructure")) {<NEW_LINE>// On restart we don't write the root element so we have to disable<NEW_LINE>// structural validation (see:<NEW_LINE>// https://jira.spring.io/browse/BATCH-1681).<NEW_LINE>outputFactory.<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final FileChannel channel = fileChannel;<NEW_LINE>if (transactional) {<NEW_LINE>TransactionAwareBufferedWriter writer = new TransactionAwareBufferedWriter(channel, new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>closeStream();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>writer.setEncoding(encoding);<NEW_LINE>writer.setForceSync(forceSync);<NEW_LINE>bufferedWriter = writer;<NEW_LINE>} else {<NEW_LINE>bufferedWriter = new BufferedWriter(new OutputStreamWriter(os, encoding));<NEW_LINE>}<NEW_LINE>delegateEventWriter = createXmlEventWriter(outputFactory, bufferedWriter);<NEW_LINE>eventWriter = new NoStartEndDocumentStreamWriter(delegateEventWriter);<NEW_LINE>initNamespaceContext(delegateEventWriter);<NEW_LINE>if (!restarted) {<NEW_LINE>startDocument(delegateEventWriter);<NEW_LINE>if (forceSync) {<NEW_LINE>channel.force(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (XMLStreamException xse) {<NEW_LINE>throw new DataAccessResourceFailureException("Unable to write to file resource: [" + resource + "]", xse);<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>throw new DataAccessResourceFailureException("Unable to write to file resource: [" + resource + "] with encoding=[" + encoding + "]", e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new DataAccessResourceFailureException("Unable to write to file resource: [" + resource + "]", e);<NEW_LINE>}<NEW_LINE>} | setProperty("com.ctc.wstx.outputValidateStructure", Boolean.FALSE); |
557,517 | public void addDnsARecord(String host, String address) throws IOException {<NEW_LINE>final String METHOD_NAME = "addDnsARecord";<NEW_LINE>Log.info(CAContainer.class, METHOD_NAME, "Adding DNS record for " + host + ":" + address);<NEW_LINE>try (CloseableHttpClient httpclient = HttpClients.createDefault()) {<NEW_LINE>String jsonString = "{\"host\":\"" + host + "\",\"addresses\":[\"" + address + "\"]}";<NEW_LINE>StringEntity requestEntity = new StringEntity(jsonString, ContentType.APPLICATION_JSON);<NEW_LINE>HttpPost httpPost = new <MASK><NEW_LINE>httpPost.setEntity(requestEntity);<NEW_LINE>try (final CloseableHttpResponse response = httpclient.execute(httpPost)) {<NEW_LINE>AcmeFatUtils.logHttpResponse(CAContainer.class, METHOD_NAME, httpPost, response);<NEW_LINE>StatusLine statusLine = response.getStatusLine();<NEW_LINE>if (statusLine.getStatusCode() != 200) {<NEW_LINE>throw new IOException(METHOD_NAME + ": Expected response 200, but received response: " + statusLine);<NEW_LINE>}<NEW_LINE>Log.info(CAContainer.class, METHOD_NAME, "DNS record update request was a success.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | HttpPost(getDnsManagementAddress() + "/add-a"); |
1,789,329 | public List<List<String>> groupAnagrams(String[] strs) {<NEW_LINE>List<List<String>> res = new ArrayList<>();<NEW_LINE>if (strs.length == 0)<NEW_LINE>return res;<NEW_LINE>Map<String, List<String>> map = new HashMap<>();<NEW_LINE>for (int i = 0; i < strs.length; i++) {<NEW_LINE>char[] strchar = strs[i].toCharArray();<NEW_LINE>Arrays.sort(strchar);<NEW_LINE>String keyStr = Arrays.toString(strchar);<NEW_LINE>if (!map.containsKey(keyStr)) {<NEW_LINE>map.put(keyStr, new ArrayList<String>(Arrays.asList(strs[i])));<NEW_LINE>} else {<NEW_LINE>map.get(keyStr).add(strs[i]);<NEW_LINE>map.put(keyStr<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, List<String>> entry : map.entrySet()) {<NEW_LINE>res.add(entry.getValue());<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} | , map.get(keyStr)); |
935,551 | private // view's center and scale according to the cropping rectangle.<NEW_LINE>void centerBasedOnHighlightView(HighlightView hv) {<NEW_LINE>Rect drawRect = hv.drawRect;<NEW_LINE>float width = drawRect.width();<NEW_LINE>float height = drawRect.height();<NEW_LINE>float thisWidth = getWidth();<NEW_LINE>float thisHeight = getHeight();<NEW_LINE>float z1 = thisWidth / width * .6F;<NEW_LINE>float z2 = thisHeight / height * .6F;<NEW_LINE>float zoom = Math.min(z1, z2);<NEW_LINE>zoom = zoom * this.getScale();<NEW_LINE>zoom = Math.max(1F, zoom);<NEW_LINE>if ((Math.abs(zoom - getScale()) / zoom) > .1) {<NEW_LINE>float[] coordinates = new float[] { hv.cropRect.centerX(), hv.cropRect.centerY() };<NEW_LINE><MASK><NEW_LINE>zoomTo(zoom, coordinates[0], coordinates[1], 300F);<NEW_LINE>}<NEW_LINE>ensureVisible(hv);<NEW_LINE>} | getUnrotatedMatrix().mapPoints(coordinates); |
1,751,986 | private Pulse decodePulses(BitReader _in) {<NEW_LINE>int[] pos = new int[4];<NEW_LINE>int[] amp = new int[4];<NEW_LINE>int numPulse = (int) _in.readNBit(2) + 1;<NEW_LINE>int pulseSwb = (int) _in.readNBit(6);<NEW_LINE>if (pulseSwb >= numSwb)<NEW_LINE>throw new RuntimeException("pulseSwb >= numSwb");<NEW_LINE>pos[0] = swbOffset[pulseSwb];<NEW_LINE>pos[0] += (int) _in.readNBit(5);<NEW_LINE>if (pos[0] > 1023)<NEW_LINE>throw new RuntimeException("pos[0] > 1023");<NEW_LINE>amp[0] = (int) _in.readNBit(4);<NEW_LINE>for (int i = 1; i < numPulse; i++) {<NEW_LINE>pos[i] = (int) _in.readNBit(5) + pos[i - 1];<NEW_LINE>if (pos[i] > 1023)<NEW_LINE>throw new RuntimeException("pos[" + i + "] > 1023");<NEW_LINE>amp[i] = (int) _in.readNBit(5);<NEW_LINE>}<NEW_LINE>return new <MASK><NEW_LINE>} | Pulse(numPulse, pos, amp); |
426,851 | public Optional<RuleMatch<T>> match(Request message) throws InvalidUriException {<NEW_LINE>final String method = message.method();<NEW_LINE>final String path = getPath(message);<NEW_LINE>if (method == null) {<NEW_LINE>LOG.warn("Invalid request for {} sent without method by service {}", message.uri(), message.service().orElse("<unknown>"));<NEW_LINE>throw new InvalidUriException();<NEW_LINE>}<NEW_LINE>if (path == null) {<NEW_LINE>// Problem already logged in detail upstream<NEW_LINE>throw new InvalidUriException();<NEW_LINE>}<NEW_LINE>final Router.Result<Rule<T>> result = router.result();<NEW_LINE>router.route(method, path, result);<NEW_LINE>if (!result.isSuccess()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final Rule<T> rule = result.target();<NEW_LINE>final ImmutableMap.Builder<String, String<MASK><NEW_LINE>for (int i = 0; i < result.params(); i++) {<NEW_LINE>pathArgs.put(result.paramName(i), readParameterValue(result, i));<NEW_LINE>}<NEW_LINE>return Optional.of(new RuleMatch<T>(rule, pathArgs.build()));<NEW_LINE>} | > pathArgs = ImmutableMap.builder(); |
1,703,119 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> <MASK><NEW_LINE>Business business = new Business(emc);<NEW_LINE>Statement statement = emc.flag(flag, Statement.class);<NEW_LINE>if (null == statement) {<NEW_LINE>throw new ExceptionEntityNotExist(flag, Statement.class);<NEW_LINE>}<NEW_LINE>Query query = emc.flag(statement.getQuery(), Query.class);<NEW_LINE>if (null == query) {<NEW_LINE>throw new ExceptionEntityNotExist(flag, Query.class);<NEW_LINE>}<NEW_LINE>if (!business.readable(effectivePerson, query)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, query);<NEW_LINE>}<NEW_LINE>if (!business.readable(effectivePerson, statement)) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, statement);<NEW_LINE>}<NEW_LINE>Wo wo = Wo.copier.copy(statement);<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | result = new ActionResult<>(); |
634,940 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>MageObject sourceObject = source.getSourceObject(game);<NEW_LINE>Permanent sourcePermanent = game.getPermanent(source.getSourceId());<NEW_LINE>Player newController = game.getPlayer(getTargetPointer()<MASK><NEW_LINE>if (newController != null && controller != null && sourceObject != null && sourceObject.equals(sourcePermanent)) {<NEW_LINE>sourcePermanent.untap(game);<NEW_LINE>game.informPlayers(newController.getLogName() + " untaps " + sourceObject.getIdName());<NEW_LINE>// remove old control effects of the same player<NEW_LINE>for (ContinuousEffect effect : game.getState().getContinuousEffects().getLayeredEffects(game)) {<NEW_LINE>if (effect instanceof GainControlTargetEffect) {<NEW_LINE>UUID checkId = (UUID) effect.getValue("KaronaFalseGodSourceId");<NEW_LINE>UUID controllerId = (UUID) effect.getValue("KaronaFalseGodControllerId");<NEW_LINE>if (source.getSourceId().equals(checkId) && newController.getId().equals(controllerId)) {<NEW_LINE>effect.discard();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, true, newController.getId());<NEW_LINE>effect.setValue("KaronaFalseGodSourceId", source.getSourceId());<NEW_LINE>effect.setValue("KaronaFalseGodControllerId", newController.getId());<NEW_LINE>effect.setTargetPointer(new FixedTarget(sourcePermanent.getId(), game));<NEW_LINE>effect.setText("and gains control of it");<NEW_LINE>game.addEffect(effect, source);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | .getFirst(game, source)); |
231,185 | public String sqlAD_getTranslatedColumns(String vendorName, String catalogName, String schemaName) {<NEW_LINE>// table name<NEW_LINE>String searchTableName = "AD_Column";<NEW_LINE>// column names<NEW_LINE>ArrayList<String> columnNames = new ArrayList<String>();<NEW_LINE>columnNames.add("t.ColumnName");<NEW_LINE>// aliases<NEW_LINE>ArrayList<String> aliasNames = null;<NEW_LINE>// joins<NEW_LINE>ArrayList<String> joinTypes = new ArrayList<String>();<NEW_LINE>joinTypes.add("INNER JOIN");<NEW_LINE>ArrayList<String> joinTables = new ArrayList<String>();<NEW_LINE>joinTables.add("AD_Table");<NEW_LINE>ArrayList<String> joinConditions = new ArrayList<String>();<NEW_LINE>joinConditions.add("t.AD_Table_ID = t0.AD_Table_ID");<NEW_LINE>// conditions<NEW_LINE>ArrayList<String> conditions = new ArrayList<String>();<NEW_LINE>conditions.add("t0.TableName LIKE ?");<NEW_LINE>conditions.add("t.IsTranslated = 'Y'");<NEW_LINE>conditions.add("t.IsActive = 'Y'");<NEW_LINE>// sort order<NEW_LINE>ArrayList<String> sortColumns <MASK><NEW_LINE>sortColumns.add("1");<NEW_LINE>// get SQL command<NEW_LINE>return sql_select(vendorName, catalogName, schemaName, searchTableName, null, columnNames, aliasNames, joinTypes, joinTables, null, joinConditions, conditions, sortColumns, false);<NEW_LINE>} | = new ArrayList<String>(); |
1,069,549 | public void write(org.apache.thrift.protocol.TProtocol prot, partition_configuration struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet optionals = new java.util.BitSet();<NEW_LINE>if (struct.isSetPid()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.isSetBallot()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.isSetMax_replica_count()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>if (struct.isSetPrimary()) {<NEW_LINE>optionals.set(3);<NEW_LINE>}<NEW_LINE>if (struct.isSetSecondaries()) {<NEW_LINE>optionals.set(4);<NEW_LINE>}<NEW_LINE>if (struct.isSetLast_drops()) {<NEW_LINE>optionals.set(5);<NEW_LINE>}<NEW_LINE>if (struct.isSetLast_committed_decree()) {<NEW_LINE>optionals.set(6);<NEW_LINE>}<NEW_LINE>oprot.writeBitSet(optionals, 7);<NEW_LINE>if (struct.isSetPid()) {<NEW_LINE>struct.pid.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetBallot()) {<NEW_LINE>oprot.writeI64(struct.ballot);<NEW_LINE>}<NEW_LINE>if (struct.isSetMax_replica_count()) {<NEW_LINE>oprot.writeI32(struct.max_replica_count);<NEW_LINE>}<NEW_LINE>if (struct.isSetPrimary()) {<NEW_LINE>struct.primary.write(oprot);<NEW_LINE>}<NEW_LINE>if (struct.isSetSecondaries()) {<NEW_LINE>{<NEW_LINE>oprot.writeI32(<MASK><NEW_LINE>for (rpc_address _iter8 : struct.secondaries) {<NEW_LINE>_iter8.write(oprot);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (struct.isSetLast_drops()) {<NEW_LINE>{<NEW_LINE>oprot.writeI32(struct.last_drops.size());<NEW_LINE>for (rpc_address _iter9 : struct.last_drops) {<NEW_LINE>_iter9.write(oprot);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (struct.isSetLast_committed_decree()) {<NEW_LINE>oprot.writeI64(struct.last_committed_decree);<NEW_LINE>}<NEW_LINE>} | struct.secondaries.size()); |
1,002,903 | public com.squareup.okhttp.Call throttlingPoliciesApplicationGetAsync(String accept, String ifNoneMatch, String ifModifiedSince, final ApiCallback<ApplicationThrottlePolicyList> callback) throws ApiException {<NEW_LINE>ProgressResponseBody.ProgressListener progressListener = null;<NEW_LINE>ProgressRequestBody.ProgressRequestListener progressRequestListener = null;<NEW_LINE>if (callback != null) {<NEW_LINE>progressListener = new ProgressResponseBody.ProgressListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void update(long bytesRead, long contentLength, boolean done) {<NEW_LINE>callback.<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {<NEW_LINE>callback.onUploadProgress(bytesWritten, contentLength, done);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>com.squareup.okhttp.Call call = throttlingPoliciesApplicationGetValidateBeforeCall(accept, ifNoneMatch, ifModifiedSince, progressListener, progressRequestListener);<NEW_LINE>Type localVarReturnType = new TypeToken<ApplicationThrottlePolicyList>() {<NEW_LINE>}.getType();<NEW_LINE>apiClient.executeAsync(call, localVarReturnType, callback);<NEW_LINE>return call;<NEW_LINE>} | onDownloadProgress(bytesRead, contentLength, done); |
356,452 | public void die(Exception ex) {<NEW_LINE>close.lock();<NEW_LINE>try {<NEW_LINE>if (!close.isSet()) {<NEW_LINE>log.error("Dying because - {}", ex.getMessage(), ex);<NEW_LINE>final SSHException causeOfDeath = SSHException.chainer.chain(ex);<NEW_LINE>disconnectListener.notifyDisconnect(causeOfDeath.getDisconnectReason(), causeOfDeath.getMessage());<NEW_LINE>ErrorDeliveryUtil.alertEvents(causeOfDeath, close, serviceAccept);<NEW_LINE>kexer.notifyError(causeOfDeath);<NEW_LINE>getService().notifyError(causeOfDeath);<NEW_LINE>setService(nullService);<NEW_LINE>{<NEW_LINE>// Perhaps can send disconnect packet to server<NEW_LINE>final <MASK><NEW_LINE>final boolean gotRequiredInfo = causeOfDeath.getDisconnectReason() != DisconnectReason.UNKNOWN;<NEW_LINE>if (didNotReceiveDisconnect && gotRequiredInfo)<NEW_LINE>sendDisconnect(causeOfDeath.getDisconnectReason(), causeOfDeath.getMessage());<NEW_LINE>}<NEW_LINE>finishOff();<NEW_LINE>close.set();<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>close.unlock();<NEW_LINE>}<NEW_LINE>} | boolean didNotReceiveDisconnect = msg != Message.DISCONNECT; |
1,199,180 | protected void init() {<NEW_LINE>codeViewerService = tool.getService(CodeViewerService.class);<NEW_LINE>goToService = tool.getService(GoToService.class);<NEW_LINE>FormatManager formatManager = codeViewerService.getFormatManager();<NEW_LINE>ServiceProvider diffServiceProvider = new DiffServiceProvider(formatManager.getServiceProvider(), this);<NEW_LINE>diffListingPanel = new ListingPanel(formatManager);<NEW_LINE>diffListingPanel.setProgramLocationListener(this);<NEW_LINE>diffListingPanel.setProgramSelectionListener(this);<NEW_LINE>diffListingPanel.getFieldPanel().addFieldMouseListener(new MyFieldMouseListener());<NEW_LINE>diffListingPanel.addMarginProvider(markerManager.getMarginProvider());<NEW_LINE>diffListingPanel.<MASK><NEW_LINE>diffNavigatable = new DiffNavigatable(this, codeViewerService.getNavigatable());<NEW_LINE>diffFieldNavigator = new FieldNavigator(diffServiceProvider, diffNavigatable);<NEW_LINE>diffListingPanel.addButtonPressedListener(diffFieldNavigator);<NEW_LINE>help.registerHelp(diffListingPanel, new HelpLocation("Diff", "Program_Differences"));<NEW_LINE>GoToService diffMarkerGoToService = diffServiceProvider.getService(GoToService.class);<NEW_LINE>markerManager.setGoToService(diffMarkerGoToService);<NEW_LINE>actionManager.setCodeViewerService(codeViewerService);<NEW_LINE>setupOptions();<NEW_LINE>execDiffFilter = new ProgramDiffFilter(ProgramDiffFilter.ALL_DIFFS);<NEW_LINE>isLimitedToSelection = false;<NEW_LINE>applySettingsMgr = new DiffApplySettingsOptionManager(this);<NEW_LINE>applyFilter = applySettingsMgr.getDefaultApplyFilter();<NEW_LINE>codeViewerService.setCoordinatedListingPanelListener(new CoordinatedListingPanelListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void activeProgramChanged(Program newActiveProgram) {<NEW_LINE>setActiveProgram(newActiveProgram);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean listingClosed() {<NEW_LINE>if (primaryProgram != null) {<NEW_LINE>closeProgram2();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | addOverviewProvider(markerManager.getOverviewProvider()); |
596,782 | public Void execute(CommandContext commandContext) {<NEW_LINE>if (appDefinitionId == null) {<NEW_LINE>throw new FlowableIllegalArgumentException("appDefinitionId is null");<NEW_LINE>}<NEW_LINE>if (variables == null) {<NEW_LINE>throw new FlowableIllegalArgumentException("variables is null");<NEW_LINE>}<NEW_LINE>if (variables.isEmpty()) {<NEW_LINE>throw new FlowableIllegalArgumentException("variables is empty");<NEW_LINE>}<NEW_LINE>VariableTypes variableTypes = CommandContextUtil.getAppEngineConfiguration().getVariableTypes();<NEW_LINE>VariableService variableService = CommandContextUtil.getVariableService(commandContext);<NEW_LINE>for (String variableName : variables.keySet()) {<NEW_LINE>Object variableValue = variables.get(variableName);<NEW_LINE>VariableType <MASK><NEW_LINE>VariableInstanceEntity variableInstance = variableService.createVariableInstance(variableName, type);<NEW_LINE>variableInstance.setScopeId(appDefinitionId);<NEW_LINE>variableInstance.setScopeType(ScopeTypes.APP);<NEW_LINE>variableInstance.setValue(variableValue);<NEW_LINE>variableService.updateVariableInstance(variableInstance);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | type = variableTypes.findVariableType(variableValue); |
357,788 | private ParseResult<IndexExpression> parseIndexExpressionWithLhsExpression(int startPosition, int endPosition) {<NEW_LINE>startPosition = trimLeftWhitespace(startPosition, endPosition);<NEW_LINE>endPosition = trimRightWhitespace(startPosition, endPosition);<NEW_LINE>List<Integer> bracketPositions = findCharacters(startPosition + 1, endPosition - 1, "[");<NEW_LINE>for (Integer bracketPosition : bracketPositions) {<NEW_LINE>ParseResult<Expression> <MASK><NEW_LINE>if (!leftSide.hasResult()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ParseResult<BracketSpecifier> rightSide = parseBracketSpecifier(bracketPosition, endPosition);<NEW_LINE>if (!rightSide.hasResult()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>return ParseResult.success(IndexExpression.indexExpression(leftSide.result(), rightSide.result()));<NEW_LINE>}<NEW_LINE>logError("index-expression with lhs-expression", "Invalid index-expression with lhs-expression", startPosition);<NEW_LINE>return ParseResult.error();<NEW_LINE>} | leftSide = parseExpression(startPosition, bracketPosition); |
1,834,238 | private static void createAndPutArchiveEntry(ArchiveType archiveType, ArchiveOutputStream archiveOutputStream, Path directoryToArchive, Path filePathToArchive) throws IOException {<NEW_LINE>switch(archiveType) {<NEW_LINE>case ZIP:<NEW_LINE>{<NEW_LINE>ZipArchiveEntry entry = new ZipArchiveEntry(filePathToArchive.toFile(), getRelativePathString(filePathToArchive, directoryToArchive));<NEW_LINE>entry.setUnixMode(getUnixMode(filePathToArchive));<NEW_LINE>final boolean isSymbolicLink = Files.isSymbolicLink(filePathToArchive);<NEW_LINE>if (isSymbolicLink) {<NEW_LINE>entry.setUnixMode(entry.getUnixMode() | ZIP_LINK_FLAG);<NEW_LINE>}<NEW_LINE>archiveOutputStream.putArchiveEntry(entry);<NEW_LINE>if (isSymbolicLink) {<NEW_LINE>archiveOutputStream.write(getRelativePathString(Files.readSymbolicLink(filePathToArchive), directoryToArchive).getBytes(StandardCharsets.UTF_8));<NEW_LINE>} else {<NEW_LINE>Files.copy(filePathToArchive, archiveOutputStream);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case TAR:<NEW_LINE>{<NEW_LINE>final boolean isSymbolicLink = Files.isSymbolicLink(filePathToArchive);<NEW_LINE>TarArchiveEntry entry;<NEW_LINE>if (isSymbolicLink) {<NEW_LINE>entry = new TarArchiveEntry(getRelativePathString(filePathToArchive, directoryToArchive), TarConstants.LF_SYMLINK);<NEW_LINE>entry.setLinkName(getRelativePathString(Files.readSymbolicLink(filePathToArchive), directoryToArchive));<NEW_LINE>} else {<NEW_LINE>entry = new TarArchiveEntry(filePathToArchive.toFile(), getRelativePathString(filePathToArchive, directoryToArchive));<NEW_LINE>}<NEW_LINE>entry<MASK><NEW_LINE>archiveOutputStream.putArchiveEntry(entry);<NEW_LINE>if (!isSymbolicLink) {<NEW_LINE>Files.copy(filePathToArchive, archiveOutputStream);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .setMode(getUnixMode(filePathToArchive)); |
1,230,987 | public boolean next() throws IOException {<NEW_LINE>if (this.pointsInBuffer == 0) {<NEW_LINE>if (countLeft >= 0) {<NEW_LINE>if (countLeft == 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (countLeft > maxPointOnHeap) {<NEW_LINE>in.readBytes(onHeapBuffer, <MASK><NEW_LINE>pointsInBuffer = maxPointOnHeap - 1;<NEW_LINE>countLeft -= maxPointOnHeap;<NEW_LINE>} else {<NEW_LINE>in.readBytes(onHeapBuffer, 0, (int) countLeft * config.bytesPerDoc);<NEW_LINE>pointsInBuffer = Math.toIntExact(countLeft - 1);<NEW_LINE>countLeft = 0;<NEW_LINE>}<NEW_LINE>this.offset = 0;<NEW_LINE>} catch (@SuppressWarnings("unused") EOFException eofe) {<NEW_LINE>assert countLeft == -1;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>this.pointsInBuffer--;<NEW_LINE>this.offset += config.bytesPerDoc;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | 0, maxPointOnHeap * config.bytesPerDoc); |
460,296 | private static void addAnonymousPolicies(RealmModel realm, String policyTypeKey) {<NEW_LINE>ComponentModel trustedHostModel = createModelInstance("Trusted Hosts", realm, TrustedHostClientRegistrationPolicyFactory.PROVIDER_ID, policyTypeKey);<NEW_LINE>// Not any trusted hosts by default<NEW_LINE>trustedHostModel.getConfig().put(TrustedHostClientRegistrationPolicyFactory.TRUSTED_HOSTS, Collections.emptyList());<NEW_LINE>trustedHostModel.getConfig().putSingle(TrustedHostClientRegistrationPolicyFactory.HOST_SENDING_REGISTRATION_REQUEST_MUST_MATCH, "true");<NEW_LINE>trustedHostModel.getConfig().putSingle(TrustedHostClientRegistrationPolicyFactory.CLIENT_URIS_MUST_MATCH, "true");<NEW_LINE>realm.addComponentModel(trustedHostModel);<NEW_LINE>ComponentModel consentRequiredModel = createModelInstance("Consent Required", <MASK><NEW_LINE>realm.addComponentModel(consentRequiredModel);<NEW_LINE>ComponentModel scopeModel = createModelInstance("Full Scope Disabled", realm, ScopeClientRegistrationPolicyFactory.PROVIDER_ID, policyTypeKey);<NEW_LINE>realm.addComponentModel(scopeModel);<NEW_LINE>ComponentModel maxClientsModel = createModelInstance("Max Clients Limit", realm, MaxClientsClientRegistrationPolicyFactory.PROVIDER_ID, policyTypeKey);<NEW_LINE>maxClientsModel.put(MaxClientsClientRegistrationPolicyFactory.MAX_CLIENTS, MaxClientsClientRegistrationPolicyFactory.DEFAULT_MAX_CLIENTS);<NEW_LINE>realm.addComponentModel(maxClientsModel);<NEW_LINE>addGenericPolicies(realm, policyTypeKey);<NEW_LINE>} | realm, ConsentRequiredClientRegistrationPolicyFactory.PROVIDER_ID, policyTypeKey); |
1,763,695 | public synchronized void threadDump(PrintWriter out) {<NEW_LINE>try {<NEW_LINE>if (jvm == null) {<NEW_LINE>jvm = new JVM(Integer.toString(SysJMX.getProcessPID()));<NEW_LINE>jvm.connect();<NEW_LINE>}<NEW_LINE>if (jvm.isConnected() == false)<NEW_LINE>return;<NEW_LINE>HotSpotVirtualMachine vm = (HotSpotVirtualMachine) jvm.getVM();<NEW_LINE>InputStream in = vm.remoteDataDump();<NEW_LINE>String line = null;<NEW_LINE>BufferedReader bin = null;<NEW_LINE>try {<NEW_LINE>bin = new <MASK><NEW_LINE>while (true) {<NEW_LINE>line = bin.readLine();<NEW_LINE>if (line == null)<NEW_LINE>break;<NEW_LINE>out.println(line);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>FileUtil.close(in);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>jvm = null;<NEW_LINE>e.printStackTrace();<NEW_LINE>sendAlert();<NEW_LINE>throw new RuntimeException(getJvmErrMsg());<NEW_LINE>}<NEW_LINE>} | BufferedReader(new InputStreamReader(in)); |
1,044,031 | protected RefactoringStatus doCheckFinalConditions(IProgressMonitor pm, CheckConditionsContext context) throws CoreException {<NEW_LINE>try {<NEW_LINE>// $NON-NLS-1$<NEW_LINE><MASK><NEW_LINE>pm.setTaskName(RefactoringCoreMessages.RenameFieldRefactoring_checking);<NEW_LINE>RefactoringStatus result = new RefactoringStatus();<NEW_LINE>result.merge(Checks.checkIfCuBroken(fField));<NEW_LINE>if (result.hasFatalError()) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>result.merge(checkNewElementName(getNewElementName()));<NEW_LINE>pm.worked(1);<NEW_LINE>result.merge(checkEnclosingHierarchy());<NEW_LINE>pm.worked(1);<NEW_LINE>result.merge(checkNestedHierarchy(fField.getDeclaringType()));<NEW_LINE>pm.worked(1);<NEW_LINE>if (fUpdateReferences) {<NEW_LINE>pm.setTaskName(RefactoringCoreMessages.RenameFieldRefactoring_searching);<NEW_LINE>fReferences = getReferences(new SubProgressMonitor(pm, 3), result);<NEW_LINE>pm.setTaskName(RefactoringCoreMessages.RenameFieldRefactoring_checking);<NEW_LINE>} else {<NEW_LINE>fReferences = new SearchResultGroup[0];<NEW_LINE>pm.worked(3);<NEW_LINE>}<NEW_LINE>if (fUpdateReferences) {<NEW_LINE>result.merge(analyzeAffectedCompilationUnits());<NEW_LINE>} else {<NEW_LINE>Checks.checkCompileErrorsInAffectedFile(result, fField.getResource());<NEW_LINE>}<NEW_LINE>if (getGetter() != null && fRenameGetter) {<NEW_LINE>result.merge(checkAccessor(new SubProgressMonitor(pm, 1), getGetter(), getNewGetterName()));<NEW_LINE>result.merge(Checks.checkIfConstructorName(getGetter(), getNewGetterName(), fField.getDeclaringType().getElementName()));<NEW_LINE>} else {<NEW_LINE>pm.worked(1);<NEW_LINE>}<NEW_LINE>if (getSetter() != null && fRenameSetter) {<NEW_LINE>result.merge(checkAccessor(new SubProgressMonitor(pm, 1), getSetter(), getNewSetterName()));<NEW_LINE>result.merge(Checks.checkIfConstructorName(getSetter(), getNewSetterName(), fField.getDeclaringType().getElementName()));<NEW_LINE>} else {<NEW_LINE>pm.worked(1);<NEW_LINE>}<NEW_LINE>result.merge(createChanges(new SubProgressMonitor(pm, 10)));<NEW_LINE>if (result.hasFatalError()) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} finally {<NEW_LINE>pm.done();<NEW_LINE>}<NEW_LINE>} | pm.beginTask("", 18); |
294,778 | public void onActivityResult(int requestCode, int resultCode, Intent data) {<NEW_LINE>mButtonClicked = 0;<NEW_LINE>if (requestCode == mFileSelectCode) {<NEW_LINE>if (resultCode == RESULT_OK) {<NEW_LINE>mTextFileUri = data.getData();<NEW_LINE>StringUtils.getInstance().showSnackbar(mActivity, R.string.text_file_selected);<NEW_LINE>String fileName = mFileUtils.getFileName(mTextFileUri);<NEW_LINE>if (fileName != null) {<NEW_LINE>if (fileName.endsWith(Constants.textExtension))<NEW_LINE>mFileExtension = Constants.textExtension;<NEW_LINE>else if (fileName.endsWith(Constants.docxExtension))<NEW_LINE>mFileExtension = Constants.docxExtension;<NEW_LINE>else if (fileName.endsWith(Constants.docExtension))<NEW_LINE>mFileExtension = Constants.docExtension;<NEW_LINE>else {<NEW_LINE>StringUtils.getInstance().showSnackbar(mActivity, R.string.extension_not_supported);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mFileNameWithType = mFileUtils.stripExtension(fileName) + getString(R.string.pdf_suffix);<NEW_LINE>mSelectFile.setText(getString(R.string.text_file_name) + fileName);<NEW_LINE>mCreateTextPdf.setEnabled(true);<NEW_LINE>mMorphButtonUtility.morphToSquare(mCreateTextPdf, mMorphButtonUtility.integer());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.<MASK><NEW_LINE>} | onActivityResult(requestCode, resultCode, data); |
1,672,295 | // GEN-FIRST:event_btnZoomOutActionPerformed<NEW_LINE>// GEN-FIRST:event_btnZoomOutActionPerformed<NEW_LINE>void // GEN-FIRST:event_btnZoomOutActionPerformed<NEW_LINE>btnZoomOutActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-HEADEREND:event_btnZoomOutActionPerformed<NEW_LINE>// Add your handling code here:<NEW_LINE>btnActualSize.setSelected(false);<NEW_LINE>btnFitPage.setSelected(false);<NEW_LINE>btnFitWidth.setSelected(false);<NEW_LINE>int newZoomInt = (int) (100 * getZoomRatio());<NEW_LINE>int index = Arrays.binarySearch(zooms, newZoomInt);<NEW_LINE>if (index > 0) {<NEW_LINE>viewerContext.setZoomRatio(zooms<MASK><NEW_LINE>} else if (index < -1) {<NEW_LINE>viewerContext.setZoomRatio(zooms[-index - 2] / 100f);<NEW_LINE>}<NEW_LINE>} | [index - 1] / 100f); |
1,422,638 | public static void checkAbbreviations() throws IOException {<NEW_LINE>LinkedHashSet<String> fromProper = new LinkedHashSet<>(TextIO.loadLinesFromResource("tr/proper-from-corpus.dict"));<NEW_LINE>LinkedHashSet<String> fromAbbrv = new LinkedHashSet<>(TextIO.loadLinesFromResource("tr/abbreviations.dict"));<NEW_LINE>Map<String, String> map = new HashMap<>();<NEW_LINE>putToMap(fromProper, map);<NEW_LINE>Map<String, String> mapAbbrv = new HashMap<>();<NEW_LINE>putToMap(fromAbbrv, mapAbbrv);<NEW_LINE>for (String s : mapAbbrv.keySet()) {<NEW_LINE>if (map.containsKey(s)) {<NEW_LINE>Log.info(s);<NEW_LINE>map.remove(s);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<String> vals = new ArrayList<>(map.values());<NEW_LINE><MASK><NEW_LINE>Files.write(Paths.get("zemberek.prop.sorted"), vals);<NEW_LINE>} | vals.sort(Turkish.STRING_COMPARATOR_ASC); |
599,687 | private boolean writeUserMethod(TreeLogger logger, JMethod userMethod, SourceWriter sw, ConstantDefinitions constantDefinitions, Map<String, String> originalConstantNameMapping, Map<String, String> substitutionMap, Map<JMethod, String> methodToClassName) throws UnableToCompleteException {<NEW_LINE>String className = getClassName(userMethod);<NEW_LINE>// method to access style class ?<NEW_LINE>if (substitutionMap.containsKey(className) && isReturnTypeString(userMethod.getReturnType().isClass())) {<NEW_LINE>methodToClassName.put(userMethod, substitutionMap.get(className));<NEW_LINE>return writeClassMethod(logger, userMethod, substitutionMap, sw);<NEW_LINE>}<NEW_LINE>// method to access constant value ?<NEW_LINE>CssDefinitionNode definitionNode;<NEW_LINE>String methodName = userMethod.getName();<NEW_LINE>if (originalConstantNameMapping.containsKey(methodName)) {<NEW_LINE>// method name maps a constant that has been renamed during the auto conversion<NEW_LINE>String constantName = originalConstantNameMapping.get(methodName);<NEW_LINE>definitionNode = constantDefinitions.getConstantDefinition(constantName);<NEW_LINE>} else {<NEW_LINE>definitionNode = constantDefinitions.getConstantDefinition(methodName);<NEW_LINE>if (definitionNode == null) {<NEW_LINE>// try with upper case<NEW_LINE>definitionNode = constantDefinitions<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (definitionNode != null) {<NEW_LINE>return writeDefMethod(definitionNode, logger, userMethod, sw);<NEW_LINE>}<NEW_LINE>if (substitutionMap.containsKey(className)) {<NEW_LINE>// method matched a class name but not a constant and the return type is not a string<NEW_LINE>logger.log(Type.ERROR, "The return type of the method [" + userMethod.getName() + "] must " + "be java.lang.String.");<NEW_LINE>throw new UnableToCompleteException();<NEW_LINE>}<NEW_LINE>// the method doesn't match a style class nor a constant<NEW_LINE>logger.log(Type.ERROR, "The following method [" + userMethod.getName() + "()] doesn't match a constant" + " nor a style class. You could fix that by adding ." + className + " {}");<NEW_LINE>return false;<NEW_LINE>} | .getConstantDefinition(toUpperCase(methodName)); |
1,405,309 | public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>builder.startObject(policy.getId());<NEW_LINE>builder.field(SnapshotLifecyclePolicyMetadata.VERSION.getPreferredName(), version);<NEW_LINE>builder.timeField(SnapshotLifecyclePolicyMetadata.MODIFIED_DATE_MILLIS.getPreferredName(), SnapshotLifecyclePolicyMetadata.MODIFIED_DATE.getPreferredName(), modifiedDate);<NEW_LINE>builder.field(SnapshotLifecyclePolicyMetadata.POLICY.getPreferredName(), policy);<NEW_LINE>if (lastSuccess != null) {<NEW_LINE>builder.field(SnapshotLifecyclePolicyMetadata.LAST_SUCCESS.getPreferredName(), lastSuccess);<NEW_LINE>}<NEW_LINE>if (lastFailure != null) {<NEW_LINE>builder.field(SnapshotLifecyclePolicyMetadata.LAST_FAILURE.getPreferredName(), lastFailure);<NEW_LINE>}<NEW_LINE>builder.timeField(SnapshotLifecyclePolicyMetadata.NEXT_EXECUTION_MILLIS.getPreferredName(), SnapshotLifecyclePolicyMetadata.NEXT_EXECUTION.getPreferredName(), policy.calculateNextExecution());<NEW_LINE>if (snapshotInProgress != null) {<NEW_LINE>builder.field(SNAPSHOT_IN_PROGRESS.getPreferredName(), snapshotInProgress);<NEW_LINE>}<NEW_LINE>builder.<MASK><NEW_LINE>this.policyStats.toXContent(builder, params);<NEW_LINE>builder.endObject();<NEW_LINE>builder.endObject();<NEW_LINE>return builder;<NEW_LINE>} | startObject(POLICY_STATS.getPreferredName()); |
736,023 | public boolean importData(TransferHandler.TransferSupport support) {<NEW_LINE>if (canImport(support)) {<NEW_LINE>try {<NEW_LINE>// Fetch the Transferable and its data<NEW_LINE>final <MASK><NEW_LINE>final Object data = trsf.getTransferData(DataFlavor.javaFileListFlavor);<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final List<File> fileList = (List<File>) data;<NEW_LINE>final int row = ((JTable.DropLocation) support.getDropLocation()).getRow();<NEW_LINE>// Process every file<NEW_LINE>for (File file : fileList) {<NEW_LINE>final Path path = file.toPath();<NEW_LINE>final String fileName = file.getName();<NEW_LINE>if (fileName.endsWith(OMR.BOOK_EXTENSION)) {<NEW_LINE>new DropBookTask(row, path).execute();<NEW_LINE>} else {<NEW_LINE>new DropImageTask(row, path).execute();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} catch (UnsupportedFlavorException ex) {<NEW_LINE>logger.warn("Unsupported flavor in drag & drop", ex);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>logger.warn("IO Exception in drag & drop", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | Transferable trsf = support.getTransferable(); |
939,839 | public final // JPA2.g:522:1: escape_character : ( '\\'.\\'' | STRING_LITERAL );<NEW_LINE>JPA2Parser.escape_character_return escape_character() throws RecognitionException {<NEW_LINE>JPA2Parser.escape_character_return retval = new JPA2Parser.escape_character_return();<NEW_LINE>retval.start = input.LT(1);<NEW_LINE>Object root_0 = null;<NEW_LINE>Token set615 = null;<NEW_LINE>Object set615_tree = null;<NEW_LINE>try {<NEW_LINE>// JPA2.g:523:5: ( '\\'.\\'' | STRING_LITERAL )<NEW_LINE>// JPA2.g:<NEW_LINE>{<NEW_LINE>root_0 = (Object) adaptor.nil();<NEW_LINE>set615 = input.LT(1);<NEW_LINE>if (input.LA(1) == STRING_LITERAL || input.LA(1) == TRIM_CHARACTER) {<NEW_LINE>input.consume();<NEW_LINE>if (state.backtracking == 0)<NEW_LINE>adaptor.addChild(root_0, (Object) adaptor.create(set615));<NEW_LINE>state.errorRecovery = false;<NEW_LINE>state.failed = false;<NEW_LINE>} else {<NEW_LINE>if (state.backtracking > 0) {<NEW_LINE>state.failed = true;<NEW_LINE>return retval;<NEW_LINE>}<NEW_LINE>MismatchedSetException mse <MASK><NEW_LINE>throw mse;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>retval.stop = input.LT(-1);<NEW_LINE>if (state.backtracking == 0) {<NEW_LINE>retval.tree = (Object) adaptor.rulePostProcessing(root_0);<NEW_LINE>adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>reportError(re);<NEW_LINE>recover(input, re);<NEW_LINE>retval.tree = (Object) adaptor.errorNode(input, retval.start, input.LT(-1), re);<NEW_LINE>} finally {<NEW_LINE>// do for sure before leaving<NEW_LINE>}<NEW_LINE>return retval;<NEW_LINE>} | = new MismatchedSetException(null, input); |
851,182 | public void run(Arguments arguments, Instrumentation instrumentation, Collection<AutoCloseable> objectsToCloseOnShutdown) {<NEW_LINE>if (arguments.isNoop()) {<NEW_LINE>LOGGER.info("Agent noop is true, do not run anything");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Reporter reporter = arguments.getReporter();<NEW_LINE>String processUuid = UUID.randomUUID().toString();<NEW_LINE>String appId = null;<NEW_LINE>String appIdVariable = arguments.getAppIdVariable();<NEW_LINE>if (appIdVariable != null && !appIdVariable.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (appId == null || appId.isEmpty()) {<NEW_LINE>appId = SparkUtils.probeAppId(arguments.getAppIdRegex());<NEW_LINE>}<NEW_LINE>if (!arguments.getDurationProfiling().isEmpty() || !arguments.getArgumentProfiling().isEmpty()) {<NEW_LINE>instrumentation.addTransformer(new JavaAgentFileTransformer(arguments.getDurationProfiling(), arguments.getArgumentProfiling()));<NEW_LINE>}<NEW_LINE>List<Profiler> profilers = createProfilers(reporter, arguments, processUuid, appId);<NEW_LINE>ProfilerGroup profilerGroup = startProfilers(profilers);<NEW_LINE>Thread shutdownHook = new Thread(new ShutdownHookRunner(profilerGroup.getPeriodicProfilers(), Arrays.asList(reporter), objectsToCloseOnShutdown));<NEW_LINE>Runtime.getRuntime().addShutdownHook(shutdownHook);<NEW_LINE>} | appId = System.getenv(appIdVariable); |
470,077 | public Boolean execute(CommandContext commandContext) {<NEW_LINE>AbstractEngineConfiguration engineConfiguration = commandContext.getEngineConfigurations().get(engineType);<NEW_LINE>PropertyEntityManager propertyEntityManager = engineConfiguration.getPropertyEntityManager();<NEW_LINE>PropertyEntity property = propertyEntityManager.findById(lockName);<NEW_LINE>if (property == null) {<NEW_LINE>property = propertyEntityManager.create();<NEW_LINE>property.setName(lockName);<NEW_LINE>// The format of the value is the current time in ISO8601 - hostName(hostAddress)<NEW_LINE>property.setValue(Instant.now().toString() + hostLockDescription);<NEW_LINE>propertyEntityManager.insert(property);<NEW_LINE>return true;<NEW_LINE>} else if (property.getValue() == null) {<NEW_LINE>property.setValue(Instant.now().toString() + hostLockDescription);<NEW_LINE>return true;<NEW_LINE>} else if (forceAcquireAfter != null) {<NEW_LINE>// If the lock is held longer than the force acquire duration we have to force the lock acquire<NEW_LINE>// e.g. if the lock was acquired at 17:00<NEW_LINE>// When the forceAcquireAfter is 10 minutes it means that the lock should be force acquired<NEW_LINE>// when the time is after 17:10, i.e. acquireLock + forceAcquire < now (17:10)<NEW_LINE><MASK><NEW_LINE>Instant lockAcquireTime = Instant.parse(value.substring(0, value.indexOf('Z') + 1));<NEW_LINE>if (lockAcquireTime.plus(forceAcquireAfter).isBefore(Instant.now())) {<NEW_LINE>property.setValue(Instant.now().toString() + hostLockDescription);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | String value = property.getValue(); |
1,835,712 | public static PrivateKey loadDecryptionKey(String keyString) throws GeneralSecurityException, IOException {<NEW_LINE>if (keyString.contains(PKCS_1_PEM_HEADER)) {<NEW_LINE>// OpenSSL / PKCS#1 Base64 PEM encoded file<NEW_LINE>keyString = keyString.replace(PKCS_1_PEM_HEADER, "");<NEW_LINE>keyString = keyString.replace(PKCS_1_PEM_FOOTER, "");<NEW_LINE>keyString = <MASK><NEW_LINE>keyString = keyString.replace("\r\n", "");<NEW_LINE>return readPkcs1PrivateKey(Base64.getDecoder().decode(keyString));<NEW_LINE>} else if (keyString.contains(PKCS_8_PEM_HEADER)) {<NEW_LINE>// PKCS#8 Base64 PEM encoded file<NEW_LINE>keyString = keyString.replace(PKCS_8_PEM_HEADER, "");<NEW_LINE>keyString = keyString.replace(PKCS_8_PEM_FOOTER, "");<NEW_LINE>keyString = keyString.replace("\n", "");<NEW_LINE>keyString = keyString.replace("\r\n", "");<NEW_LINE>return readPkcs8PrivateKey(Base64.getDecoder().decode(keyString));<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unexpected key format!");<NEW_LINE>}<NEW_LINE>} | keyString.replace("\n", ""); |
1,832,441 | public VersionInformation unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>VersionInformation versionInformation = new VersionInformation();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Arn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>versionInformation.setArn(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("CreationTimestamp", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>versionInformation.setCreationTimestamp(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Id", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>versionInformation.setId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Version", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>versionInformation.setVersion(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return versionInformation;<NEW_LINE>} | class).unmarshall(context)); |
1,200,743 | private HttpURLConnection redirectRetransmit(HttpURLConnection connection, Message message, CacheAndWriteOutputStream cachedStream) throws IOException {<NEW_LINE>// If we are not redirecting by policy, then we don't.<NEW_LINE>if (!getClient(message).isAutoRedirect()) {<NEW_LINE>return connection;<NEW_LINE>}<NEW_LINE>URL newURL = extractLocation(connection.getHeaderFields());<NEW_LINE>detectRedirectLoop(getConduitName(), connection.<MASK><NEW_LINE>if (newURL != null) {<NEW_LINE>new Headers(message).removeAuthorizationHeaders();<NEW_LINE>// If user configured this Conduit with preemptive authorization<NEW_LINE>// it is meant to make it to the end. (Too bad that information<NEW_LINE>// went to every URL along the way, but that's what the user<NEW_LINE>// wants!<NEW_LINE>// TODO: Make this issue a security release note.<NEW_LINE>setHeadersByAuthorizationPolicy(message, newURL);<NEW_LINE>connection.disconnect();<NEW_LINE>return retransmit(newURL, message, cachedStream);<NEW_LINE>}<NEW_LINE>return connection;<NEW_LINE>} | getURL(), newURL, message); |
1,276,585 | private Polygon bufferPolylinePath_(Polyline polyline, int ipath, boolean bfilter) {<NEW_LINE>assert (m_distance != 0);<NEW_LINE>generateCircleTemplate_();<NEW_LINE>MultiPath input_multi_path = polyline;<NEW_LINE>MultiPathImpl mp_impl = (MultiPathImpl) (input_multi_path._getImpl());<NEW_LINE>if (mp_impl.getPathSize(ipath) < 1)<NEW_LINE>return null;<NEW_LINE>if (isDegeneratePath_(mp_impl, ipath) && m_distance > 0) {<NEW_LINE>// if a path<NEW_LINE>// is<NEW_LINE>// degenerate<NEW_LINE>// (almost a<NEW_LINE>// point),<NEW_LINE>// then we<NEW_LINE>// can draw<NEW_LINE>// a circle<NEW_LINE>// instead<NEW_LINE>// of it as<NEW_LINE>// a buffer<NEW_LINE>// and<NEW_LINE>// nobody<NEW_LINE>// would<NEW_LINE>// notice :)<NEW_LINE>Point point = new Point();<NEW_LINE>mp_impl.getPointByVal(mp_impl.getPathStart(ipath), point);<NEW_LINE>Envelope2D env2D = new Envelope2D();<NEW_LINE>mp_impl.queryPathEnvelope2D(ipath, env2D);<NEW_LINE>point.setXY(env2D.getCenter());<NEW_LINE>return (Polygon) (bufferPoint_(point));<NEW_LINE>}<NEW_LINE>Polyline result_polyline = new Polyline(polyline.getDescription());<NEW_LINE>MultiPathImpl result_mp = <MASK><NEW_LINE>boolean b_closed = mp_impl.isClosedPathInXYPlane(ipath);<NEW_LINE>if (b_closed) {<NEW_LINE>bufferClosedPath_(input_multi_path, ipath, result_mp, bfilter, 1);<NEW_LINE>bufferClosedPath_(input_multi_path, ipath, result_mp, bfilter, -1);<NEW_LINE>} else {<NEW_LINE>Polyline tmpPoly = new Polyline(input_multi_path.getDescription());<NEW_LINE>tmpPoly.addPath(input_multi_path, ipath, false);<NEW_LINE>((MultiPathImpl) tmpPoly._getImpl()).addSegmentsFromPath((MultiPathImpl) input_multi_path._getImpl(), ipath, 0, input_multi_path.getSegmentCount(ipath), false);<NEW_LINE>bufferClosedPath_(tmpPoly, 0, result_mp, bfilter, 1);<NEW_LINE>}<NEW_LINE>return bufferCleanup_(result_polyline, false);<NEW_LINE>} | (MultiPathImpl) result_polyline._getImpl(); |
674,018 | public IHUQueryBuilder createHUsAvailableToIssueQuery(@NonNull final I_PP_Order_BOMLine ppOrderBomLine) {<NEW_LINE>final WarehouseId warehouseId = WarehouseId.ofRepoId(ppOrderBomLine.getM_Warehouse_ID());<NEW_LINE>final Set<WarehouseId> issueFromWarehouseIds = warehouseDAO.getWarehouseIdsOfSameGroup(warehouseId, WarehouseGroupAssignmentType.MANUFACTURING);<NEW_LINE>final AttributeSetInstanceId expectedASI = AttributeSetInstanceId.ofRepoIdOrNone(ppOrderBomLine.getM_AttributeSetInstance_ID());<NEW_LINE>final ImmutableAttributeSet storageRelevantAttributeSet = attributeSetInstanceBL.<MASK><NEW_LINE>return handlingUnitsDAO.createHUQueryBuilder().addOnlyWithProductId(ProductId.ofRepoId(ppOrderBomLine.getM_Product_ID())).addOnlyInWarehouseId(WarehouseId.ofRepoId(ppOrderBomLine.getM_Warehouse_ID())).addHUStatusToInclude(X_M_HU.HUSTATUS_Active).addOnlyWithAttributes(storageRelevantAttributeSet).setExcludeReserved().setOnlyTopLevelHUs().onlyNotLocked();<NEW_LINE>} | getImmutableAttributeSetById(expectedASI).filterOnlyStorageRelevantAttributes(); |
255,592 | static public double j1(double x) throws ArithmeticException {<NEW_LINE>double ax;<NEW_LINE>double y;<NEW_LINE>double ans1, ans2;<NEW_LINE>if ((ax = Math.abs(x)) < 8.0) {<NEW_LINE>y = x * x;<NEW_LINE>ans1 = x * (72362614232.0 + y * (-7895059235.0 + y * (242396853.1 + y * (-2972611.439 + y * (15704.48260 + y * (-30.16036606))))));<NEW_LINE>ans2 = 144725228442.0 + y * (2300535178.0 + y * (18583304.74 + y * (99447.43394 + y * (376.9991397 + y * 1.0))));<NEW_LINE>return ans1 / ans2;<NEW_LINE>} else {<NEW_LINE>double z = 8.0 / ax;<NEW_LINE>double xx = ax - 2.356194491;<NEW_LINE>y = z * z;<NEW_LINE>ans1 = 1.0 + y * (0.183105e-2 + y * (-0.3516396496e-4 + y * (0.2457520174e-5 + y <MASK><NEW_LINE>ans2 = 0.04687499995 + y * (-0.2002690873e-3 + y * (0.8449199096e-5 + y * (-0.88228987e-6 + y * 0.105787412e-6)));<NEW_LINE>double ans = Math.sqrt(0.636619772 / ax) * (Math.cos(xx) * ans1 - z * Math.sin(xx) * ans2);<NEW_LINE>if (x < 0.0)<NEW_LINE>ans = -ans;<NEW_LINE>return ans;<NEW_LINE>}<NEW_LINE>} | * (-0.240337019e-6)))); |
192,874 | // used only in flatten packages mode<NEW_LINE>@RequiredReadAction<NEW_LINE>public static void addAllSubpackages(List<AbstractTreeNode> container, PsiDirectory dir, ModuleFileIndex moduleFileIndex, ViewSettings viewSettings) {<NEW_LINE>final Project project = dir.getProject();<NEW_LINE>PsiDirectory[] subdirs = dir.getSubdirectories();<NEW_LINE>for (PsiDirectory subdir : subdirs) {<NEW_LINE>if (skipDirectory(subdir)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (moduleFileIndex != null) {<NEW_LINE>if (!moduleFileIndex.isInContent(subdir.getVirtualFile())) {<NEW_LINE>container.add(new PsiDirectoryNode(project, subdir, viewSettings));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (viewSettings.isHideEmptyMiddlePackages()) {<NEW_LINE>if (!isEmptyMiddleDirectory(subdir, false)) {<NEW_LINE>container.add(new PsiDirectoryNode(project, subdir, viewSettings));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>container.add(new PsiDirectoryNode(project, subdir, viewSettings));<NEW_LINE>}<NEW_LINE>addAllSubpackages(<MASK><NEW_LINE>}<NEW_LINE>} | container, subdir, moduleFileIndex, viewSettings); |
441,141 | final DeleteLFTagResult executeDeleteLFTag(DeleteLFTagRequest deleteLFTagRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteLFTagRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteLFTagRequest> request = null;<NEW_LINE>Response<DeleteLFTagResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteLFTagRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteLFTagRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "LakeFormation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteLFTag");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteLFTagResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteLFTagResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
266,698 | public <T> void visitCtFieldWrite(CtFieldWrite<T> ctFieldWrite) {<NEW_LINE>String fieldName = ctFieldWrite.getVariable().getSimpleName();<NEW_LINE>if (params.contains(fieldName) && ctFieldWrite.getTarget() == null) {<NEW_LINE>resultStack.push(new ParamNode(fieldName));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ElemNode result <MASK><NEW_LINE>if (params.contains(fieldName)) {<NEW_LINE>result.subPatterns.put("id", new ParamNode(fieldName));<NEW_LINE>} else {<NEW_LINE>result.subPatterns.put("id", new ValueNode(fieldName, ctFieldWrite.getVariable()));<NEW_LINE>}<NEW_LINE>if (ctFieldWrite.getTarget() != null) {<NEW_LINE>ctFieldWrite.getTarget().accept(this);<NEW_LINE>setTarget(result.subPatterns, resultStack.pop(), new ValueNode("none", null));<NEW_LINE>} else {<NEW_LINE>result.subPatterns.put("target", new ValueNode("none", null));<NEW_LINE>}<NEW_LINE>resultStack.push(result);<NEW_LINE>} | = new ElemNode(ctFieldWrite, "id-write"); |
1,832,372 | public JobParameter deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {<NEW_LINE>ObjectCodec oc = jsonParser.getCodec();<NEW_LINE>JsonNode node = oc.readTree(jsonParser);<NEW_LINE>final String value = node.get("value").asText();<NEW_LINE>final boolean identifying = node.get("identifying").asBoolean();<NEW_LINE>final String type = node.get("type").asText();<NEW_LINE>final JobParameter jobParameter;<NEW_LINE>if (!type.isEmpty() && !type.equalsIgnoreCase("STRING")) {<NEW_LINE>if ("DATE".equalsIgnoreCase(type)) {<NEW_LINE>// TODO: when upgraded to Java8 use java DateTime<NEW_LINE>jobParameter = new JobParameter(DateTime.parse(value<MASK><NEW_LINE>} else if ("DOUBLE".equalsIgnoreCase(type)) {<NEW_LINE>jobParameter = new JobParameter(Double.valueOf(value), identifying);<NEW_LINE>} else if ("LONG".equalsIgnoreCase(type)) {<NEW_LINE>jobParameter = new JobParameter(Long.valueOf(value), identifying);<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Unsupported JobParameter type: " + type);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>jobParameter = new JobParameter(value, identifying);<NEW_LINE>}<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("jobParameter - value: {} (type: {}, isIdentifying: {})", jobParameter.getValue(), jobParameter.getType().name(), jobParameter.isIdentifying());<NEW_LINE>}<NEW_LINE>return jobParameter;<NEW_LINE>} | ).toDate(), identifying); |
1,211,072 | Future<List<Path>> safeGlobUnsorted(String pattern, Globber.Operation globberOperation) throws BadGlobException {<NEW_LINE>// Forbidden patterns:<NEW_LINE>if (pattern.indexOf('?') != -1) {<NEW_LINE>throw new BadGlobException("glob pattern '" + pattern + "' contains forbidden '?' wildcard");<NEW_LINE>}<NEW_LINE>// Patterns forbidden by UnixGlob library:<NEW_LINE>String error = UnixGlob.checkPatternForError(pattern);<NEW_LINE>if (error != null) {<NEW_LINE>throw new BadGlobException(error + " (in glob pattern '" + pattern + "')");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return new UnixGlob.Builder(packageDirectory, syscallCache).addPattern(pattern).setPathDiscriminator(new GlobUnixPathDiscriminator(globberOperation)).<MASK><NEW_LINE>} catch (UnixGlob.BadPattern ex) {<NEW_LINE>throw new BadGlobException(ex.getMessage());<NEW_LINE>}<NEW_LINE>} | setExecutor(globExecutor).globAsync(); |
525,508 | protected static ExtractedInfo extractProvenanceInfo(Map<String, Provenance> map) {<NEW_LINE>Map<String, Provenance> configuredParameters = new HashMap<>(map);<NEW_LINE>String className = ObjectProvenance.checkAndExtractProvenance(configuredParameters, CLASS_NAME, StringProvenance.class, JsonDataSourceProvenance.class.getSimpleName()).getValue();<NEW_LINE>String hostTypeStringName = ObjectProvenance.checkAndExtractProvenance(configuredParameters, HOST_SHORT_NAME, StringProvenance.class, JsonDataSourceProvenance.class.getSimpleName()).getValue();<NEW_LINE>Map<String, PrimitiveProvenance<?>> <MASK><NEW_LINE>instanceParameters.put(FILE_MODIFIED_TIME, ObjectProvenance.checkAndExtractProvenance(configuredParameters, FILE_MODIFIED_TIME, DateTimeProvenance.class, JsonDataSourceProvenance.class.getSimpleName()));<NEW_LINE>instanceParameters.put(DATASOURCE_CREATION_TIME, ObjectProvenance.checkAndExtractProvenance(configuredParameters, DATASOURCE_CREATION_TIME, DateTimeProvenance.class, JsonDataSourceProvenance.class.getSimpleName()));<NEW_LINE>instanceParameters.put(RESOURCE_HASH, ObjectProvenance.checkAndExtractProvenance(configuredParameters, RESOURCE_HASH, HashProvenance.class, JsonDataSourceProvenance.class.getSimpleName()));<NEW_LINE>return new ExtractedInfo(className, hostTypeStringName, configuredParameters, instanceParameters);<NEW_LINE>} | instanceParameters = new HashMap<>(); |
1,291,769 | protected void initCoreTypes() {<NEW_LINE>if (JSweetDefTranslatorConfig.isJDKReplacementMode()) {<NEW_LINE>registerType("java.util.function.Function", TypeDeclaration.createExternalTypeDeclaration("Function"));<NEW_LINE>registerType("java.util.function.BiFunction", TypeDeclaration.createExternalTypeDeclaration("BiFunction"));<NEW_LINE>registerType("java.util.function.TriFunction", TypeDeclaration.createExternalTypeDeclaration("TriFunction"));<NEW_LINE>registerType("java.util.function.Supplier", TypeDeclaration.createExternalTypeDeclaration("Supplier"));<NEW_LINE>registerType("java.util.function.Consumer", TypeDeclaration.createExternalTypeDeclaration("Consumer"));<NEW_LINE>registerType("java.util.function.BiConsumer", TypeDeclaration.createExternalTypeDeclaration("BiConsumer"));<NEW_LINE>registerType("java.util.function.TriConsumer", TypeDeclaration.createExternalTypeDeclaration("TriConsumer"));<NEW_LINE>} else {<NEW_LINE>registerType("java.lang.Object", TypeDeclaration.createExternalTypeDeclaration("Object"));<NEW_LINE>registerType("java.lang.Boolean", TypeDeclaration.createExternalTypeDeclaration("Boolean"));<NEW_LINE>registerType("java.lang.String", TypeDeclaration.createExternalTypeDeclaration("String"));<NEW_LINE>registerType("java.util.function.Function", TypeDeclaration.createExternalTypeDeclaration("Function"));<NEW_LINE>registerType("java.util.function.BiFunction", TypeDeclaration.createExternalTypeDeclaration("BiFunction"));<NEW_LINE>registerType("jsweet.util.function.TriFunction", TypeDeclaration.createExternalTypeDeclaration("TriFunction"));<NEW_LINE>registerType("java.util.function.Supplier", TypeDeclaration.createExternalTypeDeclaration("Supplier"));<NEW_LINE>registerType("java.util.function.Consumer", TypeDeclaration.createExternalTypeDeclaration("Consumer"));<NEW_LINE>registerType("java.util.function.BiConsumer", TypeDeclaration.createExternalTypeDeclaration("BiConsumer"));<NEW_LINE>registerType("jsweet.util.function.TriConsumer", TypeDeclaration.createExternalTypeDeclaration("TriConsumer"));<NEW_LINE>}<NEW_LINE>registerType("java.lang.Double", TypeDeclaration.createExternalTypeDeclaration("Double"));<NEW_LINE>registerType("java.lang.Runnable", TypeDeclaration.createExternalTypeDeclaration("Runnable"));<NEW_LINE>registerType("java.lang.Void", TypeDeclaration.createExternalTypeDeclaration("Void"));<NEW_LINE>registerType("double", TypeDeclaration.createExternalTypeDeclaration("double"));<NEW_LINE>registerType("boolean", TypeDeclaration.createExternalTypeDeclaration("boolean"));<NEW_LINE>registerType("void"<MASK><NEW_LINE>registerType("any", TypeDeclaration.createExternalTypeDeclaration("any"));<NEW_LINE>registerType("string", TypeDeclaration.createExternalTypeDeclaration("string"));<NEW_LINE>registerType("number", TypeDeclaration.createExternalTypeDeclaration("number"));<NEW_LINE>registerType("symbol", TypeDeclaration.createExternalTypeDeclaration("symbol"));<NEW_LINE>registerType(JSweetDefTranslatorConfig.UNION_CLASS_NAME, TypeDeclaration.createExternalTypeDeclaration("interface", "Union"));<NEW_LINE>for (int i = 2; i <= 6; i++) {<NEW_LINE>registerType(JSweetDefTranslatorConfig.TUPLE_CLASSES_PACKAGE + "." + JSweetDefTranslatorConfig.TUPLE_CLASSES_PREFIX + i, TypeDeclaration.createExternalTypeDeclaration(JSweetDefTranslatorConfig.TUPLE_CLASSES_PREFIX + i));<NEW_LINE>}<NEW_LINE>} | , TypeDeclaration.createExternalTypeDeclaration("void")); |
1,454,029 | protected boolean processAnnotationsOnParameter(MethodMetadata data, Annotation[] annotations, int paramIndex) {<NEW_LINE>boolean isHttpAnnotation = false;<NEW_LINE>AnnotatedParameterProcessor.AnnotatedParameterContext context = new SimpleAnnotatedParameterContext(data, paramIndex);<NEW_LINE>Method method = processedMethods.get(data.configKey());<NEW_LINE>for (Annotation parameterAnnotation : annotations) {<NEW_LINE>AnnotatedParameterProcessor processor = annotatedArgumentProcessors.get(parameterAnnotation.annotationType());<NEW_LINE>if (processor != null) {<NEW_LINE>Annotation processParameterAnnotation;<NEW_LINE>// synthesize, handling @AliasFor, while falling back to parameter name on<NEW_LINE>// missing String #value():<NEW_LINE>processParameterAnnotation = synthesizeWithMethodParameterNameAsFallbackValue(parameterAnnotation, method, paramIndex);<NEW_LINE>isHttpAnnotation |= processor.processArgument(context, processParameterAnnotation, method);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!isMultipartFormData(data) && isHttpAnnotation && data.indexToExpander().get(paramIndex) == null) {<NEW_LINE>TypeDescriptor <MASK><NEW_LINE>if (conversionService.canConvert(typeDescriptor, STRING_TYPE_DESCRIPTOR)) {<NEW_LINE>Param.Expander expander = convertingExpanderFactory.getExpander(typeDescriptor);<NEW_LINE>if (expander != null) {<NEW_LINE>data.indexToExpander().put(paramIndex, expander);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return isHttpAnnotation;<NEW_LINE>} | typeDescriptor = createTypeDescriptor(method, paramIndex); |
1,600,950 | /*<NEW_LINE>* Constructs a shadow table for a data table in the information schema.<NEW_LINE>* Note: Shadow tables for interleaved tables are not interleaved to<NEW_LINE>* their shadow parent table.<NEW_LINE>*/<NEW_LINE>Table constructShadowTable(Ddl informationSchema, String dataTableName) {<NEW_LINE>// Create a new shadow table with the given prefix.<NEW_LINE>Table.Builder shadowTableBuilder = Table.builder();<NEW_LINE>String shadowTableName = shadowTablePrefix + dataTableName;<NEW_LINE>shadowTableBuilder.name(shadowTableName);<NEW_LINE>// Add key columns from the data table to the shadow table builder.<NEW_LINE>Table dataTable = informationSchema.table(dataTableName);<NEW_LINE>Set<String> primaryKeyColNames = dataTable.primaryKeys().stream().map(k -> k.name()).collect(Collectors.toSet());<NEW_LINE>List<Column> primaryKeyCols = dataTable.columns().stream().filter(col -> primaryKeyColNames.contains(col.name())).<MASK><NEW_LINE>for (Column col : primaryKeyCols) {<NEW_LINE>shadowTableBuilder.addColumn(col);<NEW_LINE>}<NEW_LINE>// Add primary key constraints.<NEW_LINE>for (IndexColumn keyColumn : dataTable.primaryKeys()) {<NEW_LINE>if (keyColumn.order() == IndexColumn.Order.ASC) {<NEW_LINE>shadowTableBuilder.primaryKey().asc(keyColumn.name()).end();<NEW_LINE>} else if (keyColumn.order() == IndexColumn.Order.DESC) {<NEW_LINE>shadowTableBuilder.primaryKey().desc(keyColumn.name()).end();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add extra column to track ChangeEventSequence information<NEW_LINE>addChangeEventSequenceColumns(shadowTableBuilder);<NEW_LINE>return shadowTableBuilder.build();<NEW_LINE>} | collect(Collectors.toList()); |
1,434,047 | public static void renderStars(VertexBuffer starVBO, PoseStack ms, Matrix4f projMat, float partialTicks, Runnable resetFog) {<NEW_LINE>FogRenderer.setupNoFog();<NEW_LINE>Minecraft mc = Minecraft.getInstance();<NEW_LINE>ShaderInstance shader = GameRenderer.getPositionShader();<NEW_LINE>float rain = 1.0F - mc.level.getRainLevel(partialTicks);<NEW_LINE>float celAng = mc.level.getTimeOfDay(partialTicks);<NEW_LINE>float effCelAng = celAng;<NEW_LINE>if (celAng > 0.5) {<NEW_LINE>effCelAng = 0.5F - (celAng - 0.5F);<NEW_LINE>}<NEW_LINE>float alpha = rain * Math.max(0.1F, effCelAng * 2);<NEW_LINE>float t = (ClientTickHandler.ticksInGame + partialTicks + 2000) * 0.005F;<NEW_LINE>ms.pushPose();<NEW_LINE>ms.pushPose();<NEW_LINE>ms.mulPose(Vector3f.YP<MASK><NEW_LINE>RenderSystem.setShaderColor(1F, 1F, 1F, alpha);<NEW_LINE>starVBO.drawWithShader(ms.last().pose(), projMat, shader);<NEW_LINE>ms.popPose();<NEW_LINE>ms.pushPose();<NEW_LINE>ms.mulPose(Vector3f.YP.rotationDegrees(t));<NEW_LINE>RenderSystem.setShaderColor(0.5F, 1F, 1F, alpha);<NEW_LINE>starVBO.drawWithShader(ms.last().pose(), projMat, shader);<NEW_LINE>ms.popPose();<NEW_LINE>ms.pushPose();<NEW_LINE>ms.mulPose(Vector3f.YP.rotationDegrees(t * 2));<NEW_LINE>RenderSystem.setShaderColor(1F, 0.75F, 0.75F, alpha);<NEW_LINE>starVBO.drawWithShader(ms.last().pose(), projMat, shader);<NEW_LINE>ms.popPose();<NEW_LINE>ms.pushPose();<NEW_LINE>ms.mulPose(Vector3f.ZP.rotationDegrees(t * 3));<NEW_LINE>RenderSystem.setShaderColor(1F, 1F, 1F, 0.25F * alpha);<NEW_LINE>starVBO.drawWithShader(ms.last().pose(), projMat, shader);<NEW_LINE>ms.popPose();<NEW_LINE>ms.pushPose();<NEW_LINE>ms.mulPose(Vector3f.ZP.rotationDegrees(t));<NEW_LINE>RenderSystem.setShaderColor(0.5F, 1F, 1F, 0.25F * alpha);<NEW_LINE>starVBO.drawWithShader(ms.last().pose(), projMat, shader);<NEW_LINE>ms.popPose();<NEW_LINE>ms.pushPose();<NEW_LINE>ms.mulPose(Vector3f.ZP.rotationDegrees(t * 2));<NEW_LINE>RenderSystem.setShaderColor(1F, 0.75F, 0.75F, 0.25F * alpha);<NEW_LINE>starVBO.drawWithShader(ms.last().pose(), projMat, shader);<NEW_LINE>ms.popPose();<NEW_LINE>ms.popPose();<NEW_LINE>resetFog.run();<NEW_LINE>} | .rotationDegrees(t * 3)); |
76,121 | public List<ShowTimeSeriesResult> showTimeseries(ShowTimeSeriesPlan plan, QueryContext context) throws MetadataException {<NEW_LINE>List<ShowTimeSeriesResult> result = new LinkedList<>();<NEW_LINE>int limit = plan.getLimit();<NEW_LINE>int offset = plan.getOffset();<NEW_LINE>if (plan.isOrderByHeat() && limit != 0) {<NEW_LINE>plan.setOffset(0);<NEW_LINE>plan.setLimit(offset + limit);<NEW_LINE>}<NEW_LINE>Pair<List<ShowTimeSeriesResult>, Integer> regionResult;<NEW_LINE>for (SchemaRegion schemaRegion : getInvolvedSchemaRegions(plan.getPath(), plan.isPrefixMatch())) {<NEW_LINE>if (limit != 0 && plan.getLimit() == 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>regionResult = schemaRegion.showTimeseries(plan, context);<NEW_LINE>result.addAll(regionResult.left);<NEW_LINE>if (limit != 0) {<NEW_LINE>plan.setLimit(plan.getLimit() - regionResult.left.size());<NEW_LINE>plan.setOffset(Math.max(plan.getOffset() - regionResult.right, 0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Stream<ShowTimeSeriesResult<MASK><NEW_LINE>if (plan.isOrderByHeat()) {<NEW_LINE>stream = stream.sorted(Comparator.comparingLong(ShowTimeSeriesResult::getLastTime).reversed().thenComparing(ShowResult::getName));<NEW_LINE>if (limit != 0) {<NEW_LINE>stream = stream.skip(offset).limit(limit);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// reset limit and offset with the initial value<NEW_LINE>plan.setLimit(limit);<NEW_LINE>plan.setOffset(offset);<NEW_LINE>return stream.collect(toList());<NEW_LINE>} | > stream = result.stream(); |
1,132,323 | public void basicParameterValidation(String name, String description, String namespace) throws AnnotationValidationException {<NEW_LINE>// Check if the @Extension name is empty.<NEW_LINE>if (name.isEmpty()) {<NEW_LINE>throw new AnnotationValidationException(MessageFormat.format<MASK><NEW_LINE>}<NEW_LINE>// Check if the @Extension description is empty.<NEW_LINE>if (description.isEmpty()) {<NEW_LINE>throw new AnnotationValidationException(MessageFormat.format("The @Extension -> description " + "annotated in class {0} is null or empty.", extensionClassFullName));<NEW_LINE>}<NEW_LINE>// Check if the @Extension namespace is empty.<NEW_LINE>if (namespace.isEmpty()) {<NEW_LINE>// The namespace cannot be null or empty as @Extension extends from namespace reserved super class.<NEW_LINE>throw new AnnotationValidationException(MessageFormat.format("The @Extension -> namespace cannot " + "be null or empty, annotated class {1} extends from namespace reserved super class {2}.", name, extensionClassFullName, AnnotationConstants.SOURCE_MAPPER_SUPER_CLASS));<NEW_LINE>} else {<NEW_LINE>// Check if namespace provided matches with the reserved namespace.<NEW_LINE>if (!namespace.equals(AnnotationConstants.SOURCE_MAPPER_NAMESPACE)) {<NEW_LINE>throw new AnnotationValidationException(MessageFormat.format("The @Extension -> namespace " + "provided {0} should be corrected as {1} annotated in class {2}.", namespace, AnnotationConstants.SOURCE_MAPPER_NAMESPACE, extensionClassFullName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ("The @Extension -> name " + " annotated in class {0} is null or empty.", extensionClassFullName)); |
1,328,107 | void refreshGatewayBundles(ShutdownHookManager shutdownHook) {<NEW_LINE>BundleContext systemContext = featureManager.bundleContext.getBundle(Constants.SYSTEM_BUNDLE_LOCATION).getBundleContext();<NEW_LINE>Set<Bundle> needsRefresh = new LinkedHashSet<Bundle>();<NEW_LINE>RegionDigraph digraph = featureManager.getDigraph();<NEW_LINE>for (Bundle b : systemContext.getBundles()) {<NEW_LINE>// Not sure this is a valid assumption on gateway BSN<NEW_LINE>String bsn = b.getSymbolicName();<NEW_LINE>if (bsn != null && bsn.startsWith("gateway.bundle.")) {<NEW_LINE>Region gatewayRegion = digraph.getRegion(b);<NEW_LINE>BundleWiring wiring = b.adapt(BundleWiring.class);<NEW_LINE>if (wiring != null) {<NEW_LINE>List<BundleWire> packageWires = <MASK><NEW_LINE>for (BundleWire packageWire : packageWires) {<NEW_LINE>if (!!!isPackageAccessible(gatewayRegion, packageWire.getCapability())) {<NEW_LINE>// no longer share the dynamic package we are wired to, need to refresh.<NEW_LINE>needsRefresh.add(b);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!!!needsRefresh.contains(b)) {<NEW_LINE>// now clear package misses; this is equinox specific<NEW_LINE>clearPackageMisses(wiring);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>refreshBundles(needsRefresh, shutdownHook);<NEW_LINE>} | wiring.getRequiredWires(PackageNamespace.PACKAGE_NAMESPACE); |
1,278,727 | public void draw(Graphics2D g2, DialPlot plot, Rectangle2D frame, Rectangle2D view) {<NEW_LINE>g2.setPaint(this.paint);<NEW_LINE>g2.setStroke(this.stroke);<NEW_LINE>Rectangle2D arcRect = DialPlot.rectangleByRadius(frame, <MASK><NEW_LINE>double value = plot.getValue(this.datasetIndex);<NEW_LINE>DialScale scale = plot.getScaleForDataset(this.datasetIndex);<NEW_LINE>double angle = scale.valueToAngle(value);<NEW_LINE>Arc2D arc = new Arc2D.Double(arcRect, angle, 0, Arc2D.OPEN);<NEW_LINE>Point2D pt = arc.getEndPoint();<NEW_LINE>Line2D line = new Line2D.Double(frame.getCenterX(), frame.getCenterY(), pt.getX(), pt.getY());<NEW_LINE>g2.draw(line);<NEW_LINE>} | this.radius, this.radius); |
809,858 | private static void packColumn(JTable table, int columnIndex) {<NEW_LINE>TableColumn tableColumn = table.getColumnModel().getColumn(columnIndex);<NEW_LINE>Object value = tableColumn.getHeaderValue();<NEW_LINE>TableCellRenderer columnRenderer = tableColumn.getHeaderRenderer();<NEW_LINE>if (columnRenderer == null) {<NEW_LINE>columnRenderer = table.getTableHeader().getDefaultRenderer();<NEW_LINE>}<NEW_LINE>Component c = columnRenderer.getTableCellRendererComponent(table, value, false, false, -1, columnIndex);<NEW_LINE>int width = c<MASK><NEW_LINE>int intercellSpacing = table.getIntercellSpacing().width;<NEW_LINE>for (int i = 0, n = table.getRowCount(); i < n; i++) {<NEW_LINE>TableCellRenderer cellRenderer = table.getCellRenderer(i, columnIndex);<NEW_LINE>value = table.getValueAt(i, columnIndex);<NEW_LINE>c = cellRenderer.getTableCellRendererComponent(table, value, false, false, i, columnIndex);<NEW_LINE>int w = c.getPreferredSize().width + intercellSpacing + 2;<NEW_LINE>if (w > width) {<NEW_LINE>width = w;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>table.getTableHeader().setResizingColumn(tableColumn);<NEW_LINE>tableColumn.setWidth(width);<NEW_LINE>tableColumn.setPreferredWidth(width);<NEW_LINE>} | .getPreferredSize().width + 6; |
182,162 | public static Stream<OrderBookUpdate> parseOrderBookUpdates(JsonNode json) {<NEW_LINE>if (!json.isArray()) {<NEW_LINE>throw new IllegalArgumentException("Array expected");<NEW_LINE>}<NEW_LINE>CurrencyPair pair = CoincheckPair.stringToPair(json.get(0).<MASK><NEW_LINE>JsonNode container = json.get(1);<NEW_LINE>if (container == null || container.isEmpty()) {<NEW_LINE>return Stream.empty();<NEW_LINE>}<NEW_LINE>if (!container.isObject()) {<NEW_LINE>throw new IllegalArgumentException("Object expected");<NEW_LINE>}<NEW_LINE>List<OrderBookUpdate> bids = parseOrderBookUpdates(Order.OrderType.BID, pair, container.get("bids"));<NEW_LINE>List<OrderBookUpdate> asks = parseOrderBookUpdates(Order.OrderType.ASK, pair, container.get("asks"));<NEW_LINE>return Stream.concat(bids.stream(), asks.stream());<NEW_LINE>} | asText()).getPair(); |
611,824 | public RestChannelConsumer prepareRequest(RestRequest restRequest, NodeClient client) throws IOException {<NEW_LINE>Integer ifVersion = null;<NEW_LINE>if (restRequest.hasParam("if_version")) {<NEW_LINE>String versionString = restRequest.param("if_version");<NEW_LINE>try {<NEW_LINE>ifVersion = Integer.parseInt(versionString);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new IllegalArgumentException(String.format(Locale.ROOT, "invalid value [%s] specified for [if_version]. must be an integer value", versionString));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Tuple<XContentType, BytesReference> sourceTuple = restRequest.contentOrSourceParam();<NEW_LINE>PutPipelineRequest request = new PutPipelineRequest(restRequest.param("id"), sourceTuple.v2(), sourceTuple.v1(), ifVersion);<NEW_LINE>request.masterNodeTimeout(restRequest.paramAsTime("master_timeout", request.masterNodeTimeout()));<NEW_LINE>request.timeout(restRequest.paramAsTime("timeout", request.timeout()));<NEW_LINE>return channel -> client.admin().cluster().putPipeline(request, <MASK><NEW_LINE>} | new RestToXContentListener<>(channel)); |
319,925 | public void testDeliveryDelayZeroAndNegativeValuesTopicClassicApi(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE>boolean testFailed = false;<NEW_LINE>TopicConnection con = jmsTCFBindings.createTopicConnection();<NEW_LINE>con.start();<NEW_LINE>TopicSession sessionSender = con.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);<NEW_LINE>TopicSubscriber <MASK><NEW_LINE>TopicPublisher send = sessionSender.createPublisher(jmsTopic);<NEW_LINE>send.publish(sessionSender.createTextMessage("Zero Delivery Delay"));<NEW_LINE>TextMessage recMsg = (TextMessage) rec.receiveNoWait();<NEW_LINE>if (recMsg == null) {<NEW_LINE>testFailed = true;<NEW_LINE>} else {<NEW_LINE>recMsg.getText();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>send.setDeliveryDelay(-10);<NEW_LINE>testFailed = true;<NEW_LINE>} catch (JMSException e) {<NEW_LINE>// expected<NEW_LINE>}<NEW_LINE>if (rec != null) {<NEW_LINE>rec.close();<NEW_LINE>}<NEW_LINE>con.close();<NEW_LINE>if (testFailed) {<NEW_LINE>throw new Exception("testDeliveryDelayZeroAndNegativeValuesClassicApi failed");<NEW_LINE>}<NEW_LINE>} | rec = sessionSender.createSubscriber(jmsTopic); |
1,269,711 | private ListenableFuture<Void> _processTables(final DatabaseDto databaseDto, final List<QualifiedName> tableNames) {<NEW_LINE>final QualifiedName databaseName = databaseDto.getName();<NEW_LINE>final List<ListenableFuture<Optional<TableDto>>> getTableFutures = tableNames.stream().map(tableName -> service.submit(() -> {<NEW_LINE>Optional<TableDto> result = null;<NEW_LINE>try {<NEW_LINE>result = catalogTraversalServiceHelper.getTable(databaseDto, tableName);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Traversal: Failed to retrieve table: {}", tableName);<NEW_LINE>registry.counter(registry.createId(Metrics.CounterCatalogTraversalTableReadFailed.getMetricName()).withTags(tableName.parts())).increment();<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>})).<MASK><NEW_LINE>return Futures.transformAsync(Futures.successfulAsList(getTableFutures), input -> applyTables(databaseName, input), defaultService);<NEW_LINE>} | collect(Collectors.toList()); |
1,093,609 | public static Collection<RegressionExecution> executions() {<NEW_LINE>ArrayList<RegressionExecution> executions = new ArrayList<>();<NEW_LINE>executions.add(new ExprCoreCaseSyntax1Sum());<NEW_LINE>executions.add(new ExprCoreCaseSyntax1SumOM());<NEW_LINE>executions.add(new ExprCoreCaseSyntax1SumCompile());<NEW_LINE>executions.add(new ExprCoreCaseSyntax1WithElse());<NEW_LINE>executions.add(new ExprCoreCaseSyntax1WithElseOM());<NEW_LINE>executions.add(new ExprCoreCaseSyntax1WithElseCompile());<NEW_LINE>executions.add(new ExprCoreCaseSyntax1Branches3());<NEW_LINE>executions.add(new ExprCoreCaseSyntax2());<NEW_LINE>executions.add(new ExprCoreCaseSyntax2StringsNBranches());<NEW_LINE>executions.add(new ExprCoreCaseSyntax2NoElseWithNull());<NEW_LINE>executions.add(new ExprCoreCaseSyntax1WithNull());<NEW_LINE>executions.add(new ExprCoreCaseSyntax2WithNullOM());<NEW_LINE>executions.add(new ExprCoreCaseSyntax2WithNullCompile());<NEW_LINE>executions.add(new ExprCoreCaseSyntax2WithNull());<NEW_LINE>executions.add(new ExprCoreCaseSyntax2WithNullBool());<NEW_LINE>executions.add(new ExprCoreCaseSyntax2WithCoercion());<NEW_LINE>executions.add(new ExprCoreCaseSyntax2WithinExpression());<NEW_LINE>executions.add(new ExprCoreCaseSyntax2Sum());<NEW_LINE>executions.add(new ExprCoreCaseSyntax2EnumChecks());<NEW_LINE>executions<MASK><NEW_LINE>executions.add(new ExprCoreCaseSyntax2NoAsName());<NEW_LINE>executions.add(new ExprCoreCaseWithArrayResult());<NEW_LINE>executions.add(new ExprCoreCaseWithTypeParameterizedProperty());<NEW_LINE>executions.add(new ExprCoreCaseWithTypeParameterizedPropertyInvalid());<NEW_LINE>return executions;<NEW_LINE>} | .add(new ExprCoreCaseSyntax2EnumResult()); |
993,080 | public Incident execute(CommandContext commandContext) {<NEW_LINE>EnsureUtil.ensureNotNull(BadUserRequestException.class, "Execution id cannot be null", "executionId", executionId);<NEW_LINE>EnsureUtil.ensureNotNull(BadUserRequestException.class, "incidentType", incidentType);<NEW_LINE>ExecutionEntity execution = commandContext.getExecutionManager().findExecutionById(executionId);<NEW_LINE>EnsureUtil.ensureNotNull(BadUserRequestException.class, "Cannot find an execution with executionId '" + executionId + "'", "execution", execution);<NEW_LINE>EnsureUtil.ensureNotNull(BadUserRequestException.class, "Execution must be related to an activity", <MASK><NEW_LINE>for (CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {<NEW_LINE>checker.checkUpdateProcessInstance(execution);<NEW_LINE>}<NEW_LINE>List<PropertyChange> propertyChanges = new ArrayList<>();<NEW_LINE>propertyChanges.add(new PropertyChange("incidentType", null, incidentType));<NEW_LINE>propertyChanges.add(new PropertyChange("configuration", null, configuration));<NEW_LINE>commandContext.getOperationLogManager().logProcessInstanceOperation(UserOperationLogEntry.OPERATION_TYPE_CREATE_INCIDENT, execution.getProcessInstanceId(), execution.getProcessDefinitionId(), null, propertyChanges);<NEW_LINE>return execution.createIncident(incidentType, configuration, message);<NEW_LINE>} | "activity", execution.getActivity()); |
1,842,570 | default Iterator<T> dropRight(int n) {<NEW_LINE>if (n <= 0) {<NEW_LINE>return this;<NEW_LINE>} else if (!hasNext()) {<NEW_LINE>return empty();<NEW_LINE>} else {<NEW_LINE>final Iterator<T> that = this;<NEW_LINE>return new Iterator<T>() {<NEW_LINE><NEW_LINE>private io.vavr.collection.Queue<T> queue = io.vavr.collection.Queue.empty();<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasNext() {<NEW_LINE>while (queue.length() < n && that.hasNext()) {<NEW_LINE>queue = queue.<MASK><NEW_LINE>}<NEW_LINE>return queue.length() == n && that.hasNext();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public T next() {<NEW_LINE>if (!hasNext()) {<NEW_LINE>throw new NoSuchElementException();<NEW_LINE>}<NEW_LINE>final Tuple2<T, io.vavr.collection.Queue<T>> t = queue.append(that.next()).dequeue();<NEW_LINE>queue = t._2;<NEW_LINE>return t._1;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>} | append(that.next()); |
306,105 | public Object execute(CommandContext commandContext) {<NEW_LINE>if (processInstanceId == null) {<NEW_LINE>throw new FlowableIllegalArgumentException("processInstanceId is null");<NEW_LINE>}<NEW_LINE>// Check if process instance is still running<NEW_LINE>HistoricProcessInstance instance = CommandContextUtil.getHistoricProcessInstanceEntityManager<MASK><NEW_LINE>if (instance == null) {<NEW_LINE>throw new FlowableObjectNotFoundException("No historic process instance found with id: " + processInstanceId, HistoricProcessInstance.class);<NEW_LINE>}<NEW_LINE>if (instance.getEndTime() == null) {<NEW_LINE>throw new FlowableException("Process instance is still running, cannot delete historic process instance: " + processInstanceId);<NEW_LINE>}<NEW_LINE>if (Flowable5Util.isFlowable5ProcessDefinitionId(commandContext, instance.getProcessDefinitionId())) {<NEW_LINE>Flowable5CompatibilityHandler compatibilityHandler = Flowable5Util.getFlowable5CompatibilityHandler();<NEW_LINE>compatibilityHandler.deleteHistoricProcessInstance(processInstanceId);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>CommandContextUtil.getHistoryManager(commandContext).recordProcessInstanceDeleted(processInstanceId, instance.getProcessDefinitionId(), instance.getTenantId());<NEW_LINE>return null;<NEW_LINE>} | (commandContext).findById(processInstanceId); |
1,347,800 | public static DescribeAiotVehicleTableItemsResponse unmarshall(DescribeAiotVehicleTableItemsResponse describeAiotVehicleTableItemsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeAiotVehicleTableItemsResponse.setRequestId(_ctx.stringValue("DescribeAiotVehicleTableItemsResponse.RequestId"));<NEW_LINE>describeAiotVehicleTableItemsResponse.setCode(_ctx.stringValue("DescribeAiotVehicleTableItemsResponse.Code"));<NEW_LINE>describeAiotVehicleTableItemsResponse.setMessage(_ctx.stringValue("DescribeAiotVehicleTableItemsResponse.Message"));<NEW_LINE>VehicleTableItems vehicleTableItems = new VehicleTableItems();<NEW_LINE>vehicleTableItems.setPageNum(_ctx.longValue("DescribeAiotVehicleTableItemsResponse.VehicleTableItems.PageNum"));<NEW_LINE>vehicleTableItems.setPageSize(_ctx.longValue("DescribeAiotVehicleTableItemsResponse.VehicleTableItems.PageSize"));<NEW_LINE>vehicleTableItems.setTotalNum(_ctx.longValue("DescribeAiotVehicleTableItemsResponse.VehicleTableItems.TotalNum"));<NEW_LINE>List<VehicleTableItemType> vehicleTableItemList = new ArrayList<VehicleTableItemType>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeAiotVehicleTableItemsResponse.VehicleTableItems.VehicleTableItemList.Length"); i++) {<NEW_LINE>VehicleTableItemType vehicleTableItemType = new VehicleTableItemType();<NEW_LINE>vehicleTableItemType.setVehicleTableItemId(_ctx.stringValue("DescribeAiotVehicleTableItemsResponse.VehicleTableItems.VehicleTableItemList[" + i + "].VehicleTableItemId"));<NEW_LINE>vehicleTableItemType.setVehicleTableId(_ctx.stringValue("DescribeAiotVehicleTableItemsResponse.VehicleTableItems.VehicleTableItemList[" + i + "].VehicleTableId"));<NEW_LINE>vehicleTableItemType.setPlateNo(_ctx.stringValue("DescribeAiotVehicleTableItemsResponse.VehicleTableItems.VehicleTableItemList[" + i + "].PlateNo"));<NEW_LINE>vehicleTableItemType.setOwnerName(_ctx.stringValue<MASK><NEW_LINE>vehicleTableItemType.setPhoneNo(_ctx.stringValue("DescribeAiotVehicleTableItemsResponse.VehicleTableItems.VehicleTableItemList[" + i + "].PhoneNo"));<NEW_LINE>vehicleTableItemType.setBeginTime(_ctx.stringValue("DescribeAiotVehicleTableItemsResponse.VehicleTableItems.VehicleTableItemList[" + i + "].BeginTime"));<NEW_LINE>vehicleTableItemType.setEndTime(_ctx.stringValue("DescribeAiotVehicleTableItemsResponse.VehicleTableItems.VehicleTableItemList[" + i + "].EndTime"));<NEW_LINE>vehicleTableItemType.setRemarks(_ctx.stringValue("DescribeAiotVehicleTableItemsResponse.VehicleTableItems.VehicleTableItemList[" + i + "].Remarks"));<NEW_LINE>vehicleTableItemList.add(vehicleTableItemType);<NEW_LINE>}<NEW_LINE>vehicleTableItems.setVehicleTableItemList(vehicleTableItemList);<NEW_LINE>describeAiotVehicleTableItemsResponse.setVehicleTableItems(vehicleTableItems);<NEW_LINE>return describeAiotVehicleTableItemsResponse;<NEW_LINE>} | ("DescribeAiotVehicleTableItemsResponse.VehicleTableItems.VehicleTableItemList[" + i + "].OwnerName")); |
1,306,892 | public void onConnectionStateChange(BluetoothGatt gatta, int status, int newState) {<NEW_LINE>Log.d(BleManager.LOG_TAG, "onConnectionStateChange to " + newState + " on peripheral: " + device.<MASK><NEW_LINE>gatt = gatta;<NEW_LINE>if (status != BluetoothGatt.GATT_SUCCESS) {<NEW_LINE>gatt.close();<NEW_LINE>// change the state to ensure the connection is teared down properly in the code below<NEW_LINE>newState = BluetoothProfile.STATE_DISCONNECTED;<NEW_LINE>}<NEW_LINE>connecting = false;<NEW_LINE>if (newState == BluetoothProfile.STATE_CONNECTED) {<NEW_LINE>connected = true;<NEW_LINE>discoverServicesRunnable = new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>gatt.discoverServices();<NEW_LINE>} catch (NullPointerException e) {<NEW_LINE>Log.d(BleManager.LOG_TAG, "onConnectionStateChange connected but gatt of Run method was null");<NEW_LINE>}<NEW_LINE>discoverServicesRunnable = null;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>mainHandler.post(discoverServicesRunnable);<NEW_LINE>sendConnectionEvent(device, "BleManagerConnectPeripheral", status);<NEW_LINE>if (connectCallback != null) {<NEW_LINE>Log.d(BleManager.LOG_TAG, "Connected to: " + device.getAddress());<NEW_LINE>connectCallback.invoke();<NEW_LINE>connectCallback = null;<NEW_LINE>}<NEW_LINE>} else if (newState == BluetoothProfile.STATE_DISCONNECTED) {<NEW_LINE>if (discoverServicesRunnable != null) {<NEW_LINE>mainHandler.removeCallbacks(discoverServicesRunnable);<NEW_LINE>discoverServicesRunnable = null;<NEW_LINE>}<NEW_LINE>List<Callback> callbacks = Arrays.asList(writeCallback, retrieveServicesCallback, readRSSICallback, readCallback, registerNotifyCallback, requestMTUCallback);<NEW_LINE>for (Callback currentCallback : callbacks) {<NEW_LINE>if (currentCallback != null) {<NEW_LINE>currentCallback.invoke("Device disconnected");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (connectCallback != null) {<NEW_LINE>connectCallback.invoke("Connection error");<NEW_LINE>connectCallback = null;<NEW_LINE>}<NEW_LINE>writeCallback = null;<NEW_LINE>writeQueue.clear();<NEW_LINE>readCallback = null;<NEW_LINE>retrieveServicesCallback = null;<NEW_LINE>readRSSICallback = null;<NEW_LINE>registerNotifyCallback = null;<NEW_LINE>requestMTUCallback = null;<NEW_LINE>commandQueue.clear();<NEW_LINE>commandQueueBusy = false;<NEW_LINE>this.disconnect(true);<NEW_LINE>}<NEW_LINE>} | getAddress() + " with status " + status); |
1,275,586 | public void deleteEventHubConsumerGroupById(String id) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String resourceName = Utils.getValueFromIdByName(id, "IotHubs");<NEW_LINE>if (resourceName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'IotHubs'.", id)));<NEW_LINE>}<NEW_LINE>String eventHubEndpointName = Utils.getValueFromIdByName(id, "eventHubEndpoints");<NEW_LINE>if (eventHubEndpointName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'eventHubEndpoints'.", id)));<NEW_LINE>}<NEW_LINE>String name = Utils.getValueFromIdByName(id, "ConsumerGroups");<NEW_LINE>if (name == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.<MASK><NEW_LINE>}<NEW_LINE>this.deleteEventHubConsumerGroupWithResponse(resourceGroupName, resourceName, eventHubEndpointName, name, Context.NONE);<NEW_LINE>} | format("The resource ID '%s' is not valid. Missing path segment 'ConsumerGroups'.", id))); |
1,247,258 | static String responseToXml(String endpointName, ApiResponse response) throws ApiException {<NEW_LINE>try {<NEW_LINE>DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();<NEW_LINE>DocumentBuilder docBuilder = docFactory.newDocumentBuilder();<NEW_LINE>Document doc = docBuilder.newDocument();<NEW_LINE>Element rootElement = doc.createElement(endpointName);<NEW_LINE>doc.appendChild(rootElement);<NEW_LINE>response.toXML(doc, rootElement);<NEW_LINE><MASK><NEW_LINE>Transformer transformer = transformerFactory.newTransformer();<NEW_LINE>DOMSource source = new DOMSource(doc);<NEW_LINE>StringWriter sw = new StringWriter();<NEW_LINE>StreamResult result = new StreamResult(sw);<NEW_LINE>transformer.transform(source, result);<NEW_LINE>return sw.toString();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Failed to convert API response to XML: " + e.getMessage(), e);<NEW_LINE>throw new ApiException(ApiException.Type.INTERNAL_ERROR, e);<NEW_LINE>}<NEW_LINE>} | TransformerFactory transformerFactory = TransformerFactory.newInstance(); |
1,149,609 | private void updateLoadingStatus(BrokerLoadingTaskAttachment attachment) {<NEW_LINE>loadingStatus.replaceCounter(DPP_ABNORMAL_ALL, increaseCounter(DPP_ABNORMAL_ALL, attachment.getCounter(DPP_ABNORMAL_ALL)));<NEW_LINE>loadingStatus.replaceCounter(DPP_NORMAL_ALL, increaseCounter(DPP_NORMAL_ALL, attachment.getCounter(DPP_NORMAL_ALL)));<NEW_LINE>loadingStatus.replaceCounter(UNSELECTED_ROWS, increaseCounter(UNSELECTED_ROWS, attachment.getCounter(UNSELECTED_ROWS)));<NEW_LINE>if (attachment.getTrackingUrl() != null) {<NEW_LINE>loadingStatus.setTrackingUrl(attachment.getTrackingUrl());<NEW_LINE>}<NEW_LINE>commitInfos.addAll(attachment.getCommitInfoList());<NEW_LINE>errorTabletInfos.<MASK><NEW_LINE>progress = (int) ((double) finishedTaskIds.size() / idToTasks.size() * 100);<NEW_LINE>if (progress == 100) {<NEW_LINE>progress = 99;<NEW_LINE>}<NEW_LINE>} | addAll(attachment.getErrorTabletInfos()); |
999,024 | public void forAllInRange(char startValue, char endValue, final RelativeRangeConsumer rrc) {<NEW_LINE>if (endValue <= startValue) {<NEW_LINE>throw new IllegalArgumentException("startValue (" + startValue + ") must be less than endValue (" + endValue + ")");<NEW_LINE>}<NEW_LINE>int startOffset = startValue;<NEW_LINE>int loc = Util.unsignedBinarySearch(<MASK><NEW_LINE>// the value doesn't exist, this is the index of the nearest value<NEW_LINE>int startIndex = loc >= 0 ? loc : -loc - 1;<NEW_LINE>int next = startValue;<NEW_LINE>for (int k = startIndex; k < cardinality; k++) {<NEW_LINE>int value = content[k];<NEW_LINE>if (endValue <= value) {<NEW_LINE>// value is already beyond the end<NEW_LINE>if (next < endValue) {<NEW_LINE>rrc.acceptAllAbsent(next - startOffset, endValue - startOffset);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (next < value) {<NEW_LINE>// fill in the missing values until value<NEW_LINE>rrc.acceptAllAbsent(next - startOffset, value - startOffset);<NEW_LINE>}<NEW_LINE>rrc.acceptPresent(value - startOffset);<NEW_LINE>next = value + 1;<NEW_LINE>}<NEW_LINE>if (next < endValue) {<NEW_LINE>// fill in the remaining values until end<NEW_LINE>rrc.acceptAllAbsent(next - startOffset, endValue - startOffset);<NEW_LINE>}<NEW_LINE>} | content, 0, cardinality, startValue); |
603,575 | public void write(final java.nio.ByteBuffer buf) {<NEW_LINE>try {<NEW_LINE>int startPositionMark = buf.position();<NEW_LINE>buf.position(<MASK><NEW_LINE>int unknownsCounter = 0;<NEW_LINE>if (unknownFields == null)<NEW_LINE>unknownsCounter = Integer.MAX_VALUE;<NEW_LINE>{<NEW_LINE>com.wowd.wobly.WoblyUtils.Buffers.putVInt(buf, this.player.ordinal());<NEW_LINE>}<NEW_LINE>{<NEW_LINE>buf.putLong(this.size);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>buf.putLong(this.duration);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>com.wowd.wobly.WoblyUtils.Buffers.putStringUTF8(buf, this.format, true);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>buf.putInt(this.height);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>buf.putInt(this.width);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>com.wowd.wobly.WoblyUtils.Buffers.putStringUTF8(buf, this.uri, true);<NEW_LINE>}<NEW_LINE>unknownsCounter = writeUnknownsUpTo(unknownsCounter, 0, buf);<NEW_LINE>if (this.title != null) {<NEW_LINE>buf.put((byte) 7);<NEW_LINE>com.wowd.wobly.WoblyUtils.Buffers.putStringUTF8(buf, this.title, true);<NEW_LINE>}<NEW_LINE>unknownsCounter = writeUnknownsUpTo(unknownsCounter, 1, buf);<NEW_LINE>if (this.bitrate != 0) {<NEW_LINE>buf.put((byte) 10);<NEW_LINE>buf.putInt(this.bitrate);<NEW_LINE>}<NEW_LINE>unknownsCounter = writeUnknownsUpTo(unknownsCounter, 2, buf);<NEW_LINE>if ((this.persons != null) && (this.persons.size() > 0)) {<NEW_LINE>buf.put((byte) 22);<NEW_LINE>int startFieldMark = buf.position();<NEW_LINE>buf.position(buf.position() + 4);<NEW_LINE>com.wowd.wobly.WoblyUtils.Buffers.putVInt(buf, this.persons.size());<NEW_LINE>for (String v1 : this.persons) {<NEW_LINE>com.wowd.wobly.WoblyUtils.Buffers.putStringUTF8(buf, v1, true);<NEW_LINE>}<NEW_LINE>buf.putInt(startFieldMark, buf.position() - startFieldMark - 4);<NEW_LINE>}<NEW_LINE>unknownsCounter = writeUnknownsUpTo(unknownsCounter, 3, buf);<NEW_LINE>if (this.copyright != null) {<NEW_LINE>buf.put((byte) 31);<NEW_LINE>com.wowd.wobly.WoblyUtils.Buffers.putStringUTF8(buf, this.copyright, true);<NEW_LINE>}<NEW_LINE>writeUnknownsUpTo(unknownsCounter, Integer.MAX_VALUE, buf);<NEW_LINE>com.wowd.wobly.WoblyUtils.Buffers.appendVariableSize(buf, startPositionMark);<NEW_LINE>} catch (com.wowd.wobly.exceptions.WoblyWriteException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (java.lang.Throwable t) {<NEW_LINE>throw new com.wowd.wobly.exceptions.WoblyWriteException(t);<NEW_LINE>}<NEW_LINE>} | buf.position() + 1); |
1,536,810 | protected synchronized BeanFactory initFactory(Locale locale) throws BeansException {<NEW_LINE>// Try to find cached factory for Locale:<NEW_LINE>// Have we already encountered that Locale before?<NEW_LINE>if (isCache()) {<NEW_LINE>BeanFactory cachedFactory = this.localeCache.get(locale);<NEW_LINE>if (cachedFactory != null) {<NEW_LINE>return cachedFactory;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Build list of ResourceBundle references for Locale.<NEW_LINE>List<ResourceBundle> bundles = new ArrayList<>(this.basenames.length);<NEW_LINE>for (String basename : this.basenames) {<NEW_LINE>bundles.add(getBundle(basename, locale));<NEW_LINE>}<NEW_LINE>// Try to find cached factory for ResourceBundle list:<NEW_LINE>// even if Locale was different, same bundles might have been found.<NEW_LINE>if (isCache()) {<NEW_LINE>BeanFactory cachedFactory = this.bundleCache.get(bundles);<NEW_LINE>if (cachedFactory != null) {<NEW_LINE>this.localeCache.put(locale, cachedFactory);<NEW_LINE>return cachedFactory;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Create child ApplicationContext for views.<NEW_LINE>GenericWebApplicationContext factory = new GenericWebApplicationContext();<NEW_LINE><MASK><NEW_LINE>factory.setServletContext(getServletContext());<NEW_LINE>// Load bean definitions from resource bundle.<NEW_LINE>org.springframework.beans.factory.support.PropertiesBeanDefinitionReader reader = new org.springframework.beans.factory.support.PropertiesBeanDefinitionReader(factory);<NEW_LINE>reader.setDefaultParentBean(this.defaultParentView);<NEW_LINE>for (ResourceBundle bundle : bundles) {<NEW_LINE>reader.registerBeanDefinitions(bundle);<NEW_LINE>}<NEW_LINE>factory.refresh();<NEW_LINE>// Cache factory for both Locale and ResourceBundle list.<NEW_LINE>if (isCache()) {<NEW_LINE>this.localeCache.put(locale, factory);<NEW_LINE>this.bundleCache.put(bundles, factory);<NEW_LINE>}<NEW_LINE>return factory;<NEW_LINE>} | factory.setParent(getApplicationContext()); |
94,017 | public DeleteResult delete() throws IOException {<NEW_LINE><MASK><NEW_LINE>final AtomicLong deletedBytes = new AtomicLong();<NEW_LINE>try (AmazonS3Reference clientReference = blobStore.clientReference()) {<NEW_LINE>ObjectListing prevListing = null;<NEW_LINE>while (true) {<NEW_LINE>ObjectListing list;<NEW_LINE>if (prevListing != null) {<NEW_LINE>final ObjectListing finalPrevListing = prevListing;<NEW_LINE>list = SocketAccess.doPrivileged(() -> clientReference.get().listNextBatchOfObjects(finalPrevListing));<NEW_LINE>} else {<NEW_LINE>final ListObjectsRequest listObjectsRequest = new ListObjectsRequest();<NEW_LINE>listObjectsRequest.setBucketName(blobStore.bucket());<NEW_LINE>listObjectsRequest.setPrefix(keyPath);<NEW_LINE>listObjectsRequest.setRequestMetricCollector(blobStore.listMetricCollector);<NEW_LINE>list = SocketAccess.doPrivileged(() -> clientReference.get().listObjects(listObjectsRequest));<NEW_LINE>}<NEW_LINE>final List<String> blobsToDelete = new ArrayList<>();<NEW_LINE>list.getObjectSummaries().forEach(s3ObjectSummary -> {<NEW_LINE>deletedBlobs.incrementAndGet();<NEW_LINE>deletedBytes.addAndGet(s3ObjectSummary.getSize());<NEW_LINE>blobsToDelete.add(s3ObjectSummary.getKey());<NEW_LINE>});<NEW_LINE>if (list.isTruncated()) {<NEW_LINE>doDeleteBlobs(blobsToDelete, false);<NEW_LINE>prevListing = list;<NEW_LINE>} else {<NEW_LINE>final List<String> lastBlobsToDelete = new ArrayList<>(blobsToDelete);<NEW_LINE>lastBlobsToDelete.add(keyPath);<NEW_LINE>doDeleteBlobs(lastBlobsToDelete, false);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (final AmazonClientException e) {<NEW_LINE>throw new IOException("Exception when deleting blob container [" + keyPath + "]", e);<NEW_LINE>}<NEW_LINE>return new DeleteResult(deletedBlobs.get(), deletedBytes.get());<NEW_LINE>} | final AtomicLong deletedBlobs = new AtomicLong(); |
1,508,318 | private void checkImplementableStatically(Member member, String messagePrefix) {<NEW_LINE>MemberDescriptor memberDescriptor = member.getDescriptor();<NEW_LINE>if (member.isMethod()) {<NEW_LINE>Method method = (Method) member;<NEW_LINE>boolean hasNonJsFunctionOverride = method.getDescriptor().getJavaOverriddenMethodDescriptors().stream().anyMatch(Predicates.not(MethodDescriptor::isJsFunction));<NEW_LINE>if (hasNonJsFunctionOverride) {<NEW_LINE>// Methods that are not effectively static dispatch are disallowed.<NEW_LINE>problems.error(member.getSourcePosition(), "%s method '%s' cannot override a supertype method.", messagePrefix, memberDescriptor.getReadableDescription());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (method.isNative()) {<NEW_LINE>// Only perform this check for methods to avoid giving error on fields that are not<NEW_LINE>// explicitly marked native.<NEW_LINE>problems.error(method.getSourcePosition(), "%s method '%s' cannot be native.", messagePrefix, method.getReadableDescription());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>method.accept(new AbstractVisitor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void exitSuperReference(SuperReference superReference) {<NEW_LINE>problems.error(method.getSourcePosition(), "Cannot use 'super' in %s method '%s'.", <MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>checkNotJsMember(member, messagePrefix);<NEW_LINE>} | messagePrefix, method.getReadableDescription()); |
736,558 | public void readFields(DataInput in) throws IOException {<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>PrimitiveType type = PrimitiveType.valueOf(Text.readString(in));<NEW_LINE>types.add(type);<NEW_LINE>LiteralExpr literal = null;<NEW_LINE>boolean isMax = in.readBoolean();<NEW_LINE>if (isMax) {<NEW_LINE>literal = MaxLiteral.MAX_VALUE;<NEW_LINE>} else {<NEW_LINE>switch(type) {<NEW_LINE>case TINYINT:<NEW_LINE>case SMALLINT:<NEW_LINE>case INT:<NEW_LINE>case BIGINT:<NEW_LINE>literal = IntLiteral.read(in);<NEW_LINE>break;<NEW_LINE>case LARGEINT:<NEW_LINE>literal = LargeIntLiteral.read(in);<NEW_LINE>break;<NEW_LINE>case DATE:<NEW_LINE>case DATETIME:<NEW_LINE>literal = DateLiteral.read(in);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IOException("type[" + type.name() + "] not supported: ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>literal.setType(Type.fromPrimitiveType(type));<NEW_LINE>keys.add(literal);<NEW_LINE>}<NEW_LINE>} | int count = in.readInt(); |
1,581,572 | public void openLog(TargetModuleID module) {<NEW_LINE>TomcatModule tomcatModule = null;<NEW_LINE>if (module instanceof TomcatModule) {<NEW_LINE>tomcatModule = (TomcatModule) module;<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>TargetModuleID[] tomMod = getRunningModules(ModuleType.WAR, new Target[] { module.getTarget() });<NEW_LINE>for (int i = 0; i < tomMod.length; i++) {<NEW_LINE>if (module.getModuleID().equals(tomMod[i].getModuleID())) {<NEW_LINE>tomcatModule = (TomcatModule) tomMod[i];<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (TargetException te) {<NEW_LINE>LOGGER.log(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tomcatModule != null && logManager.hasContextLogger(tomcatModule)) {<NEW_LINE>logManager.openContextLog(tomcatModule);<NEW_LINE>} else {<NEW_LINE>logManager.openSharedContextLog();<NEW_LINE>}<NEW_LINE>} | Level.INFO, null, te); |
230,415 | private void dispatchSplitsUseLocation(List<org.apache.hadoop.mapreduce.InputSplit> splitsNewAPI, int groupNumber, int groupItemNumber) throws IOException, InterruptedException {<NEW_LINE>splitNum = splitsNewAPI.size();<NEW_LINE>// Since the actual split size is sometimes not exactly equal to the expected split size, we<NEW_LINE>// need to fine tune the number of workergroup and task based on the actual split number<NEW_LINE>int estimatedGroupNum = (splitNum + groupItemNumber - 1) / groupItemNumber;<NEW_LINE>int base = 0;<NEW_LINE>// Dispatch data splits to workergroups, each SplitClassification corresponds to a workergroup.<NEW_LINE>// Record the location information for the splits in order to data localized schedule<NEW_LINE>for (int i = 0; i < estimatedGroupNum; i++) {<NEW_LINE>List<String> locationList = new ArrayList<String>(maxLocationLimit);<NEW_LINE>List<org.apache.hadoop.mapreduce.InputSplit> splitList = new ArrayList<org.apache.hadoop.mapreduce.InputSplit>();<NEW_LINE>base = i * groupItemNumber;<NEW_LINE>for (int j = 0; j < groupItemNumber && (base < splitNum); j++, base++) {<NEW_LINE>splitList.add(splitsNewAPI.get(base));<NEW_LINE>String[] locations = splitsNewAPI.<MASK><NEW_LINE>for (int k = 0; k < locations.length && locationList.size() < maxLocationLimit; k++) {<NEW_LINE>locationList.add(locations[k]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SplitClassification splitClassification = new SplitClassification(null, splitList, locationList.toArray(new String[locationList.size()]), true);<NEW_LINE>splitClassifications.put(i, splitClassification);<NEW_LINE>}<NEW_LINE>} | get(base).getLocations(); |
1,208,378 | private void init(Hashtable toCopy) {<NEW_LINE>type = (String) toCopy.get("type");<NEW_LINE>attribution = (String) toCopy.get("attribution");<NEW_LINE>message = (String) toCopy.get("message");<NEW_LINE>linkUrl = (String) toCopy.get("link");<NEW_LINE>linkDescription = (String) toCopy.get("description");<NEW_LINE>Hashtable cmnts = (<MASK><NEW_LINE>if (cmnts != null) {<NEW_LINE>commentsCount = (String) cmnts.get("count");<NEW_LINE>}<NEW_LINE>Hashtable f = (Hashtable) toCopy.get("from");<NEW_LINE>if (f != null) {<NEW_LINE>from.copy(f);<NEW_LINE>}<NEW_LINE>Hashtable toUsers = (Hashtable) toCopy.get("to");<NEW_LINE>if (toUsers != null) {<NEW_LINE>Vector toUsersArray = (Vector) toUsers.get("data");<NEW_LINE>if (toUsersArray != null) {<NEW_LINE>to = new Vector();<NEW_LINE>for (int i = 0; i < toUsersArray.size(); i++) {<NEW_LINE>Hashtable u = (Hashtable) toUsersArray.elementAt(i);<NEW_LINE>User toUser = new User();<NEW_LINE>toUser.copy(u);<NEW_LINE>to.addElement(toUser);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>created_time = (String) toCopy.get("created_time");<NEW_LINE>picture = (String) toCopy.get("picture");<NEW_LINE>Object likesObj = toCopy.get("likes");<NEW_LINE>if (likesObj != null) {<NEW_LINE>if (likesObj instanceof Hashtable) {<NEW_LINE>likes = (String) ((Hashtable) likesObj).get("count");<NEW_LINE>} else {<NEW_LINE>likes = likesObj.toString();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Hashtable) toCopy.get("comments"); |
1,699,579 | public static void horizontal(GrayF32 src, GrayF32 dst) {<NEW_LINE>if (src.width < dst.width)<NEW_LINE>throw new IllegalArgumentException("src width must be >= dst width");<NEW_LINE>if (src.height != dst.height)<NEW_LINE>throw new IllegalArgumentException("src height must equal dst height");<NEW_LINE>float scale = src.width / (float) dst.width;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, dst.height, y -> {<NEW_LINE>for (int y = 0; y < dst.height; y++) {<NEW_LINE>int indexDst = dst.startIndex + y * dst.stride;<NEW_LINE>for (int x = 0; x < dst.width - 1; x++, indexDst++) {<NEW_LINE>float srcX0 = x * scale;<NEW_LINE>float srcX1 = (x + 1) * scale;<NEW_LINE>int isrcX0 = (int) srcX0;<NEW_LINE>int isrcX1 = (int) srcX1;<NEW_LINE>int index = src.getIndex(isrcX0, y);<NEW_LINE>// compute value of overlapped region<NEW_LINE>float startWeight = (1.0f - (srcX0 - isrcX0));<NEW_LINE>float start = src.data[index++];<NEW_LINE>float middle = 0;<NEW_LINE>for (int i = isrcX0 + 1; i < isrcX1; i++) {<NEW_LINE>middle += src.data[index++];<NEW_LINE>}<NEW_LINE>float endWeight = (srcX1 % 1);<NEW_LINE>float end = src.data[index];<NEW_LINE>dst.data[indexDst] = (start * startWeight + middle + end * endWeight) / scale;<NEW_LINE>}<NEW_LINE>// handle the last area as a special case<NEW_LINE>int x = dst.width - 1;<NEW_LINE>float srcX0 = x * scale;<NEW_LINE>int isrcX0 = (int) srcX0;<NEW_LINE>int isrcX1 = src.width - 1;<NEW_LINE>int index = <MASK><NEW_LINE>// compute value of overlapped region<NEW_LINE>float startWeight = (1.0f - (srcX0 - isrcX0));<NEW_LINE>float start = src.data[index++];<NEW_LINE>float middle = 0;<NEW_LINE>for (int i = isrcX0 + 1; i < isrcX1; i++) {<NEW_LINE>middle += src.data[index++];<NEW_LINE>}<NEW_LINE>float end = isrcX1 != isrcX0 ? src.data[index] : 0;<NEW_LINE>dst.data[indexDst] = (start * startWeight + middle + end) / scale;<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} | src.getIndex(isrcX0, y); |
643,717 | public static DescribeSlowLogRecordsResponse unmarshall(DescribeSlowLogRecordsResponse describeSlowLogRecordsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSlowLogRecordsResponse.setRequestId<MASK><NEW_LINE>SlowLogRecords slowLogRecords = new SlowLogRecords();<NEW_LINE>slowLogRecords.setRows(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Rows"));<NEW_LINE>slowLogRecords.setRowsBeforeLimitAtLeast(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.RowsBeforeLimitAtLeast"));<NEW_LINE>Statistics statistics = new Statistics();<NEW_LINE>statistics.setRowsRead(_ctx.integerValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Statistics.RowsRead"));<NEW_LINE>statistics.setElapsedTime(_ctx.floatValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Statistics.ElapsedTime"));<NEW_LINE>statistics.setBytesRead(_ctx.integerValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Statistics.BytesRead"));<NEW_LINE>slowLogRecords.setStatistics(statistics);<NEW_LINE>List<ResultSet> tableSchema = new ArrayList<ResultSet>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSlowLogRecordsResponse.SlowLogRecords.TableSchema.Length"); i++) {<NEW_LINE>ResultSet resultSet = new ResultSet();<NEW_LINE>resultSet.setType(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.TableSchema[" + i + "].Type"));<NEW_LINE>resultSet.setName(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.TableSchema[" + i + "].Name"));<NEW_LINE>tableSchema.add(resultSet);<NEW_LINE>}<NEW_LINE>slowLogRecords.setTableSchema(tableSchema);<NEW_LINE>List<ResultSet1> data = new ArrayList<ResultSet1>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data.Length"); i++) {<NEW_LINE>ResultSet1 resultSet1 = new ResultSet1();<NEW_LINE>resultSet1.setType(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].Type"));<NEW_LINE>resultSet1.setQueryStartTime(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].QueryStartTime"));<NEW_LINE>resultSet1.setQuery(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].Query"));<NEW_LINE>resultSet1.setReadRows(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].ReadRows"));<NEW_LINE>resultSet1.setInitialAddress(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].InitialAddress"));<NEW_LINE>resultSet1.setMemoryUsage(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].MemoryUsage"));<NEW_LINE>resultSet1.setInitialUser(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].InitialUser"));<NEW_LINE>resultSet1.setInitialQueryId(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].InitialQueryId"));<NEW_LINE>resultSet1.setReadBytes(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].ReadBytes"));<NEW_LINE>resultSet1.setQueryDurationMs(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].QueryDurationMs"));<NEW_LINE>resultSet1.setResultBytes(_ctx.stringValue("DescribeSlowLogRecordsResponse.SlowLogRecords.Data[" + i + "].ResultBytes"));<NEW_LINE>data.add(resultSet1);<NEW_LINE>}<NEW_LINE>slowLogRecords.setData(data);<NEW_LINE>describeSlowLogRecordsResponse.setSlowLogRecords(slowLogRecords);<NEW_LINE>return describeSlowLogRecordsResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeSlowLogRecordsResponse.RequestId")); |
47,150 | public void handle(PacketWrapper wrapper) throws Exception {<NEW_LINE>String channel = wrapper.<MASK><NEW_LINE>if (channel.equals("minecraft:trader_list") || channel.equals("trader_list")) {<NEW_LINE>// Passthrough Window ID<NEW_LINE>wrapper.passthrough(Type.INT);<NEW_LINE>int size = wrapper.passthrough(Type.UNSIGNED_BYTE);<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>// Input Item<NEW_LINE>wrapper.write(Type.FLAT_VAR_INT_ITEM, wrapper.read(Type.FLAT_ITEM));<NEW_LINE>// Output Item<NEW_LINE>wrapper.write(Type.FLAT_VAR_INT_ITEM, wrapper.read(Type.FLAT_ITEM));<NEW_LINE>// Has second item<NEW_LINE>boolean secondItem = wrapper.passthrough(Type.BOOLEAN);<NEW_LINE>if (secondItem) {<NEW_LINE>wrapper.write(Type.FLAT_VAR_INT_ITEM, wrapper.read(Type.FLAT_ITEM));<NEW_LINE>}<NEW_LINE>// Trade disabled<NEW_LINE>wrapper.passthrough(Type.BOOLEAN);<NEW_LINE>// Number of tools uses<NEW_LINE>wrapper.passthrough(Type.INT);<NEW_LINE>// Maximum number of trade uses<NEW_LINE>wrapper.passthrough(Type.INT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | get(Type.STRING, 0); |
658,746 | public void uploadRangeWithResponse() {<NEW_LINE>ShareFileClient shareFileClient = createClientWithSASToken();<NEW_LINE>byte[] data = "default".getBytes(StandardCharsets.UTF_8);<NEW_LINE>// BEGIN: com.azure.storage.file.share.ShareFileClient.uploadRangeWithResponse#ShareFileUploadRangeOptions-Duration-Context<NEW_LINE>InputStream uploadData = new ByteArrayInputStream(data);<NEW_LINE>Response<ShareFileUploadInfo> response = shareFileClient.uploadRangeWithResponse(new ShareFileUploadRangeOptions(uploadData, data.length), Duration.ofSeconds(30), null);<NEW_LINE>System.out.printf(<MASK><NEW_LINE>System.out.printf("ETag of the file is %s%n", response.getValue().getETag());<NEW_LINE>// END: com.azure.storage.file.share.ShareFileClient.uploadRangeWithResponse#ShareFileUploadRangeOptions-Duration-Context<NEW_LINE>} | "Completed uploading the data with response %d%n.", response.getStatusCode()); |
416,972 | void endNetworkRequestInternal(String networkTraceKey, String uniqueId, int responseCode, int requestPayloadSize, int responsePayloadSize) {<NEW_LINE>// end time counting as fast as possible<NEW_LINE>long currentTimestamp = UtilsTime.currentTimestampMs();<NEW_LINE>L.<MASK><NEW_LINE>if (networkTraceKey == null || networkTraceKey.isEmpty()) {<NEW_LINE>L.e("[ModuleAPM] Provided a invalid trace key");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (uniqueId == null || uniqueId.isEmpty()) {<NEW_LINE>L.e("[ModuleAPM] Provided a invalid uniqueId");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String internalTraceKey = networkTraceKey + "|" + uniqueId;<NEW_LINE>if (networkTraces.containsKey(internalTraceKey)) {<NEW_LINE>Long startTimestamp = networkTraces.remove(internalTraceKey);<NEW_LINE>if (startTimestamp == null) {<NEW_LINE>L.e("[ModuleAPM] endNetworkRequestInternal, retrieved 'startTimestamp' is null");<NEW_LINE>} else {<NEW_LINE>recordNetworkRequestInternal(networkTraceKey, responseCode, requestPayloadSize, responsePayloadSize, startTimestamp, currentTimestamp);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>L.w("[ModuleAPM] endNetworkRequestInternal, trying to end trace which was not started");<NEW_LINE>}<NEW_LINE>} | d("[ModuleAPM] Calling 'endNetworkRequestInternal' with key:[" + networkTraceKey + "]"); |
362,984 | private static <T extends PipelineStageBase<?>> List<T> postOrderUnPackWithoutModelData(StageNode[] stages) {<NEW_LINE>if (stages == null || stages.length == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>LinkedList<Integer> stack = new LinkedList<>();<NEW_LINE>stack.push(0);<NEW_LINE>long id = stages.length - 1;<NEW_LINE>int lastLp = -1;<NEW_LINE>while (!stack.isEmpty()) {<NEW_LINE>int lp = stack.peek();<NEW_LINE>if (stages[lp].children != null && lastLp != stages[lp].children[0]) {<NEW_LINE>for (int i = 0; i < stages[lp].children.length; ++i) {<NEW_LINE>stack.push(stages[lp].children[i]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>if (stages[lp].identifier != null) {<NEW_LINE>stages[lp].stage = (PipelineStageBase<?>) Class.forName(stages[lp].identifier).getConstructor(Params.class).newInstance(stages[lp].params);<NEW_LINE>}<NEW_LINE>} catch (ClassNotFoundException | NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>// leaf node.<NEW_LINE>if (stages[lp].children != null) {<NEW_LINE>List<T> pipelineStageBases = new ArrayList<>();<NEW_LINE>for (int i = 0; i < stages[lp].children.length; ++i) {<NEW_LINE>pipelineStageBases.add((T) stages[stages[lp].children[i]].stage);<NEW_LINE>}<NEW_LINE>if (stages[lp].stage == null) {<NEW_LINE>return pipelineStageBases;<NEW_LINE>}<NEW_LINE>if (stages[lp].stage instanceof Pipeline) {<NEW_LINE>stages[lp].stage = new Pipeline(pipelineStageBases.toArray(new PipelineStageBase<MASK><NEW_LINE>} else if (stages[lp].stage instanceof PipelineModel) {<NEW_LINE>stages[lp].stage = new PipelineModel(pipelineStageBases.toArray(new TransformerBase<?>[0]));<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unsupported stage.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>id--;<NEW_LINE>lastLp = lp;<NEW_LINE>stack.pop();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | <?>[0])); |
1,486,723 | public void doSetType(ActionEvent ae) {<NEW_LINE>Debug.log(3, "doSetType: selected");<NEW_LINE>String error = "";<NEW_LINE>EditorPane editorPane = SikulixIDE.get().getCurrentCodePane();<NEW_LINE>String editorPaneText = editorPane.getText();<NEW_LINE>if (!editorPaneText.trim().isEmpty()) {<NEW_LINE>// TODO Changing Tab Type for non-empty tab<NEW_LINE>JOptionPane.showMessageDialog(null, "... not yet implemented for not empty tab", "Changing Tab Type", JOptionPane.PLAIN_MESSAGE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (selOptionsTypes == null) {<NEW_LINE>String types = "";<NEW_LINE>for (IRunner runner : Runner.getRunners()) {<NEW_LINE>types += runner.getType().replaceFirst(".*?\\/", "") + " ";<NEW_LINE>}<NEW_LINE>if (!types.isEmpty()) {<NEW_LINE>types = types.trim();<NEW_LINE>selOptionsTypes = types.split(" ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (null == selOptionsTypes) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String currentType = editorPane.getType();<NEW_LINE>Location mouseAt = new Location(mouseTrigger.getXOnScreen(), mouseTrigger.getYOnScreen());<NEW_LINE>Sikulix.popat(mouseAt.offset(100, 85));<NEW_LINE>String targetType = Sikulix.popSelect("Select the Content Type ...", selOptionsTypes, currentType<MASK><NEW_LINE>if (targetType == null) {<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>targetType = "text/" + targetType;<NEW_LINE>}<NEW_LINE>if (currentType.equals(targetType)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (editorPane.init()) {<NEW_LINE>if (editorPane.isText()) {<NEW_LINE>editorPane.setIsFile();<NEW_LINE>}<NEW_LINE>editorPane.updateDocumentListeners("setType");<NEW_LINE>SikulixIDE.getStatusbar().setType(targetType);<NEW_LINE>String msg = "doSetType: completed" + ": (" + targetType + ")";<NEW_LINE>SikulixIDE.getStatusbar().setMessage(msg);<NEW_LINE>Debug.log(3, msg);<NEW_LINE>}<NEW_LINE>} | .replaceFirst(".*?\\/", "")); |
1,717,375 | public void accumulateFrom(EBPFProfilingStack stack) {<NEW_LINE>List<EBPFProfilingStack.Symbol> stackList = stack.getSymbols();<NEW_LINE>if (codeSignature == null) {<NEW_LINE>codeSignature = stackList.get(0);<NEW_LINE>}<NEW_LINE>// add detected stack<NEW_LINE>this.detectedBy(stack);<NEW_LINE>// handle stack children<NEW_LINE>EBPFProfilingStackNode parent = this;<NEW_LINE>for (int depth = 1; depth < stackList.size(); depth++) {<NEW_LINE>EBPFProfilingStack.Symbol <MASK><NEW_LINE>// find same code signature children<NEW_LINE>EBPFProfilingStackNode childElement = null;<NEW_LINE>for (EBPFProfilingStackNode child : parent.children) {<NEW_LINE>if (Objects.equal(child.codeSignature, elementCodeSignature)) {<NEW_LINE>childElement = child;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (childElement != null) {<NEW_LINE>// add detected stack<NEW_LINE>childElement.detectedBy(stack);<NEW_LINE>parent = childElement;<NEW_LINE>} else {<NEW_LINE>// add children<NEW_LINE>EBPFProfilingStackNode childNode = newNode();<NEW_LINE>childNode.codeSignature = elementCodeSignature;<NEW_LINE>childNode.detectedBy(stack);<NEW_LINE>parent.children.add(childNode);<NEW_LINE>parent = childNode;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | elementCodeSignature = stackList.get(depth); |
876,595 | public IndexMetadata toIndexMetadata(String indexTableName) {<NEW_LINE>com.palantir.logsafe.Preconditions.<MASK><NEW_LINE>com.palantir.logsafe.Preconditions.checkState(!rowComponents.isEmpty(), "No row components specified.");<NEW_LINE>if (explicitCompressionRequested && explicitCompressionBlockSizeKb == 0) {<NEW_LINE>explicitCompressionBlockSizeKb = AtlasDbConstants.DEFAULT_INDEX_COMPRESSION_BLOCK_SIZE_KB;<NEW_LINE>}<NEW_LINE>if (colComponents.isEmpty()) {<NEW_LINE>return IndexMetadata.createIndex(indexTableName, javaIndexTableName, rowComponents, cachePriority, conflictHandler, rangeScanAllowed, explicitCompressionBlockSizeKb, negativeLookups, indexCondition, indexType, sweepStrategy, appendHeavyAndReadLight, numberOfComponentsHashed, tableNameSafety);<NEW_LINE>} else {<NEW_LINE>return IndexMetadata.createDynamicIndex(indexTableName, javaIndexTableName, rowComponents, colComponents, cachePriority, conflictHandler, rangeScanAllowed, explicitCompressionBlockSizeKb, negativeLookups, indexCondition, indexType, sweepStrategy, appendHeavyAndReadLight, numberOfComponentsHashed, tableNameSafety);<NEW_LINE>}<NEW_LINE>} | checkState(indexTableName != null, "No index table name specified."); |
1,548,432 | public static boolean dynamicIndexedPropertyExists(DynamicPropertyDescriptorByMethod descriptor, Object underlying, int index) {<NEW_LINE>try {<NEW_LINE>if (descriptor.isHasParameters()) {<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>Object array = descriptor.getMethod().invoke(underlying, null);<NEW_LINE>if (array == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (Array.getLength(array) <= index) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} catch (ClassCastException e) {<NEW_LINE>throw PropertyUtility.getMismatchException(descriptor.getMethod(), underlying, e);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>throw PropertyUtility.getInvocationTargetException(descriptor.getMethod(), e);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>throw PropertyUtility.getIllegalArgumentException(descriptor.getMethod(), e);<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>throw PropertyUtility.getIllegalAccessException(<MASK><NEW_LINE>}<NEW_LINE>} | descriptor.getMethod(), e); |
1,528,847 | public void addRateLimiter(LimitedRateGroup group, boolean upload) {<NEW_LINE>List<PEPeerTransport> transports;<NEW_LINE>try {<NEW_LINE>peer_transports_mon.enter();<NEW_LINE>ArrayList<Object[]> new_limiters = new ArrayList<>(external_rate_limiters_cow == null ? 1 : external_rate_limiters_cow.size() + 1);<NEW_LINE>if (external_rate_limiters_cow != null) {<NEW_LINE>new_limiters.addAll(external_rate_limiters_cow);<NEW_LINE>}<NEW_LINE>new_limiters.add(new Object[] { group, <MASK><NEW_LINE>external_rate_limiters_cow = new_limiters;<NEW_LINE>transports = peer_transports_cow;<NEW_LINE>} finally {<NEW_LINE>peer_transports_mon.exit();<NEW_LINE>}<NEW_LINE>for (int i = 0; i < transports.size(); i++) {<NEW_LINE>transports.get(i).addRateLimiter(group, upload);<NEW_LINE>}<NEW_LINE>} | Boolean.valueOf(upload) }); |
849,145 | public void execute(final String[] args) {<NEW_LINE>boolean success = true;<NEW_LINE>Opts opts = new Opts();<NEW_LINE>opts.parseArgs("accumulo init", args);<NEW_LINE>var siteConfig = SiteConfiguration.auto();<NEW_LINE>ZooReaderWriter zoo = new ZooReaderWriter(siteConfig);<NEW_LINE>SecurityUtil.serverLogin(siteConfig);<NEW_LINE>Configuration hadoopConfig = new Configuration();<NEW_LINE>InitialConfiguration initConfig = new InitialConfiguration(hadoopConfig, siteConfig);<NEW_LINE>ServerDirs serverDirs = new ServerDirs(siteConfig, hadoopConfig);<NEW_LINE>try (var fs = VolumeManagerImpl.get(siteConfig, hadoopConfig)) {<NEW_LINE>if (opts.resetSecurity) {<NEW_LINE>success = resetSecurity(initConfig, opts, fs);<NEW_LINE>}<NEW_LINE>if (success && opts.addVolumes) {<NEW_LINE>success = addVolumes(fs, initConfig, serverDirs);<NEW_LINE>}<NEW_LINE>if (!opts.resetSecurity && !opts.addVolumes) {<NEW_LINE>success = doInit(zoo, opts, fs, initConfig);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error("Problem trying to get Volume configuration", e);<NEW_LINE>success = false;<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>if (!success) {<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | SingletonManager.setMode(Mode.CLOSED); |
1,771,858 | public static DescribeDeletedInstancesResponse unmarshall(DescribeDeletedInstancesResponse describeDeletedInstancesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDeletedInstancesResponse.setRequestId(_ctx.stringValue("DescribeDeletedInstancesResponse.RequestId"));<NEW_LINE>describeDeletedInstancesResponse.setTotalCount(_ctx.longValue("DescribeDeletedInstancesResponse.TotalCount"));<NEW_LINE>describeDeletedInstancesResponse.setPageNumber(_ctx.integerValue("DescribeDeletedInstancesResponse.PageNumber"));<NEW_LINE>describeDeletedInstancesResponse.setPageSize(_ctx.integerValue("DescribeDeletedInstancesResponse.PageSize"));<NEW_LINE>List<Instance> instances = new ArrayList<Instance>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDeletedInstancesResponse.Instances.Length"); i++) {<NEW_LINE>Instance instance = new Instance();<NEW_LINE>instance.setInstanceId(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].InstanceId"));<NEW_LINE>instance.setInstanceName(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].InstanceName"));<NEW_LINE>instance.setStatus(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].Status"));<NEW_LINE>instance.setMajorVersion(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].MajorVersion"));<NEW_LINE>instance.setEngine(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].Engine"));<NEW_LINE>instance.setRegionId(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].RegionId"));<NEW_LINE>instance.setZoneId(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].ZoneId"));<NEW_LINE>instance.setCreatedTime(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].CreatedTime"));<NEW_LINE>instance.setDeleteTime(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].DeleteTime"));<NEW_LINE>instance.setClusterType(_ctx.stringValue<MASK><NEW_LINE>instance.setModuleStackVersion(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].ModuleStackVersion"));<NEW_LINE>instance.setParentId(_ctx.stringValue("DescribeDeletedInstancesResponse.Instances[" + i + "].ParentId"));<NEW_LINE>instances.add(instance);<NEW_LINE>}<NEW_LINE>describeDeletedInstancesResponse.setInstances(instances);<NEW_LINE>return describeDeletedInstancesResponse;<NEW_LINE>} | ("DescribeDeletedInstancesResponse.Instances[" + i + "].ClusterType")); |
123,893 | private FLClientStatus judgeStartFLJob(StartFLJob startFLJob, ResponseFLJob responseDataBuf) {<NEW_LINE>iteration = responseDataBuf.iteration();<NEW_LINE>FLClientStatus response = startFLJob.doResponse(responseDataBuf);<NEW_LINE>retCode = startFLJob.getRetCode();<NEW_LINE>status = response;<NEW_LINE>switch(response) {<NEW_LINE>case SUCCESS:<NEW_LINE>LOGGER.info(Common.addTag("[startFLJob] startFLJob success"));<NEW_LINE>featureSize = startFLJob.getFeatureSize();<NEW_LINE>secureProtocol.<MASK><NEW_LINE>LOGGER.info(Common.addTag("[startFLJob] ***the feature size get in ResponseFLJob***: " + featureSize));<NEW_LINE>int tag = setGlobalParameters(responseDataBuf);<NEW_LINE>if (tag == -1) {<NEW_LINE>LOGGER.severe(Common.addTag("[startFLJob] setGlobalParameters failed"));<NEW_LINE>status = FLClientStatus.FAILED;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case RESTART:<NEW_LINE>FLPlan flPlan = responseDataBuf.flPlanConfig();<NEW_LINE>if (flPlan == null) {<NEW_LINE>LOGGER.severe(Common.addTag("[startFLJob] the flPlan returned from server is null"));<NEW_LINE>return FLClientStatus.FAILED;<NEW_LINE>}<NEW_LINE>iterations = flPlan.iterations();<NEW_LINE>LOGGER.info(Common.addTag("[startFLJob] GlobalParameters <iterations> from server: " + iterations));<NEW_LINE>nextRequestTime = responseDataBuf.nextReqTime();<NEW_LINE>break;<NEW_LINE>case FAILED:<NEW_LINE>LOGGER.severe(Common.addTag("[startFLJob] startFLJob failed"));<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>LOGGER.severe(Common.addTag("[startFLJob] failed: the response of startFLJob is out of range " + "<SUCCESS, WAIT, FAILED, Restart>"));<NEW_LINE>status = FLClientStatus.FAILED;<NEW_LINE>}<NEW_LINE>return status;<NEW_LINE>} | setUpdateFeatureName(startFLJob.getUpdateFeatureName()); |
794,441 | public void logMutations(DataOutput out) {<NEW_LINE>VariableLong.writePositive(<MASK><NEW_LINE>for (Map.Entry<String, Map<String, IndexMutation>> store : mutations.entrySet()) {<NEW_LINE>out.writeObjectNotNull(store.getKey());<NEW_LINE>VariableLong.writePositive(out, store.getValue().size());<NEW_LINE>for (Map.Entry<String, IndexMutation> doc : store.getValue().entrySet()) {<NEW_LINE>out.writeObjectNotNull(doc.getKey());<NEW_LINE>IndexMutation mut = doc.getValue();<NEW_LINE>out.putByte((byte) (mut.isNew() ? 1 : (mut.isDeleted() ? 2 : 0)));<NEW_LINE>List<IndexEntry> additions = mut.getAdditions();<NEW_LINE>VariableLong.writePositive(out, additions.size());<NEW_LINE>for (IndexEntry add : additions) writeIndexEntry(out, add);<NEW_LINE>List<IndexEntry> deletions = mut.getDeletions();<NEW_LINE>VariableLong.writePositive(out, deletions.size());<NEW_LINE>for (IndexEntry del : deletions) writeIndexEntry(out, del);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | out, mutations.size()); |
439,813 | private static // a Frequentist confidence interval based on the tails of the Binomial distribution.<NEW_LINE>double computeApproxBinoUB(final long numSamplesI, final double theta, final int numSDev) {<NEW_LINE>if (theta == 1.0) {<NEW_LINE>return (numSamplesI);<NEW_LINE>} else if (numSamplesI == 0) {<NEW_LINE>final double delta = deltaOfNumSDev[numSDev];<NEW_LINE>final double rawUB = (Math.log(delta)) / (Math.log(1.0 - theta));<NEW_LINE>// round up<NEW_LINE>return (Math.ceil(rawUB));<NEW_LINE>} else if (numSamplesI > 120) {<NEW_LINE>// plenty of samples, so gaussian approximation to binomial distribution isn't too bad<NEW_LINE>final double rawUB = contClassicUB(numSamplesI, theta, numSDev);<NEW_LINE>// fake round up<NEW_LINE>return (rawUB + 0.5);<NEW_LINE>} else // at this point we know 1 <= numSamplesI <= 120<NEW_LINE>if (theta > (1.0 - 1e-5)) {<NEW_LINE>// empirically-determined threshold<NEW_LINE>return (numSamplesI + 1);<NEW_LINE>} else if (theta < ((numSamplesI) / 360.0)) {<NEW_LINE>// empirically-determined threshold<NEW_LINE>// here we use the gaussian approximation, but with a modified "numSDev"<NEW_LINE>final int index;<NEW_LINE>final double rawUB;<NEW_LINE>index = (3 * ((int) numSamplesI)) + (numSDev - 1);<NEW_LINE>rawUB = contClassicUB(numSamplesI, theta, EquivTables.getUB(index));<NEW_LINE>// fake round up<NEW_LINE>return (rawUB + 0.5);<NEW_LINE>} else {<NEW_LINE>// This is the most difficult range to approximate; we will compute an "exact" UB.<NEW_LINE>// We know that est <= 360, so specialNPrimeF() shouldn't be ridiculously slow.<NEW_LINE>final double delta = deltaOfNumSDev[numSDev];<NEW_LINE>final long nprimef = <MASK><NEW_LINE>// don't need to round<NEW_LINE>return (nprimef);<NEW_LINE>}<NEW_LINE>} | specialNPrimeF(numSamplesI, theta, delta); |
1,712,768 | private static String fallbackThreadDump(String dumpName) {<NEW_LINE>StringBuilder dump = new StringBuilder();<NEW_LINE>dump.append(dumpName);<NEW_LINE>ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();<NEW_LINE>for (ThreadInfo info : threadMXBean.getThreadInfo(threadMXBean.getAllThreadIds(), 500)) {<NEW_LINE>if (info == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>dump.append('"').append(info.getThreadName()).append("\" ");<NEW_LINE>dump.append("\n java.lang.Thread.State:").<MASK><NEW_LINE>if (info.getLockName() != null) {<NEW_LINE>switch(info.getThreadState()) {<NEW_LINE>case BLOCKED:<NEW_LINE>// $NON-NLS-1$<NEW_LINE>dump.append("\r\n\t- blocked on " + info.getLockName());<NEW_LINE>break;<NEW_LINE>case WAITING:<NEW_LINE>// $NON-NLS-1$<NEW_LINE>dump.append("\r\n\t- waiting on " + info.getLockName());<NEW_LINE>break;<NEW_LINE>case TIMED_WAITING:<NEW_LINE>// $NON-NLS-1$<NEW_LINE>dump.append("\r\n\t- waiting on " + info.getLockName());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (StackTraceElement stackTraceElement : info.getStackTrace()) {<NEW_LINE>dump.append("\n at ").append(stackTraceElement);<NEW_LINE>}<NEW_LINE>dump.append("\n\n");<NEW_LINE>}<NEW_LINE>return dump.toString();<NEW_LINE>} | append(info.getThreadState()); |
180,162 | private JsonProduct toJsonProduct(final I_M_Product productRecord) {<NEW_LINE>final IModelTranslationMap trls = InterfaceWrapperHelper.getModelTranslationMap(productRecord);<NEW_LINE>final ProductId productId = ProductId.<MASK><NEW_LINE>final UomId uomId = UomId.ofRepoId(productRecord.getC_UOM_ID());<NEW_LINE>return JsonProduct.builder().id(productId).externalId(productRecord.getExternalId()).productNo(productRecord.getValue()).name(trls.getColumnTrl(I_M_Product.COLUMNNAME_Name, productRecord.getName()).translate(adLanguage)).description(trls.getColumnTrl(I_M_Product.COLUMNNAME_Description, productRecord.getDescription()).translate(adLanguage)).ean(productRecord.getUPC()).uom(servicesFacade.getUOMSymbol(uomId)).bpartners(productBPartners.get(productId)).createdUpdatedInfo(servicesFacade.extractCreatedUpdatedInfo(productRecord)).build();<NEW_LINE>} | ofRepoId(productRecord.getM_Product_ID()); |
1,119,461 | public static DescribeDatabaseBackupResponse unmarshall(DescribeDatabaseBackupResponse describeDatabaseBackupResponse, UnmarshallerContext context) {<NEW_LINE>describeDatabaseBackupResponse.setRequestId(context.stringValue("DescribeDatabaseBackupResponse.RequestId"));<NEW_LINE>describeDatabaseBackupResponse.setInstanceId(context.stringValue("DescribeDatabaseBackupResponse.InstanceId"));<NEW_LINE>describeDatabaseBackupResponse.setDBName(context.stringValue("DescribeDatabaseBackupResponse.DBName"));<NEW_LINE>describeDatabaseBackupResponse.setPageNumber(context.integerValue("DescribeDatabaseBackupResponse.PageNumber"));<NEW_LINE>describeDatabaseBackupResponse.setPageRecordCount(context.integerValue("DescribeDatabaseBackupResponse.PageRecordCount"));<NEW_LINE>describeDatabaseBackupResponse.setTotalRecordCount(context.integerValue("DescribeDatabaseBackupResponse.TotalRecordCount"));<NEW_LINE>describeDatabaseBackupResponse.setBackupTotalSize(context.longValue("DescribeDatabaseBackupResponse.BackupTotalSize"));<NEW_LINE>List<Backup> backupItems = new ArrayList<Backup>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeDatabaseBackupResponse.BackupItems.Length"); i++) {<NEW_LINE>Backup backup = new Backup();<NEW_LINE>backup.setBackupId(context.integerValue("DescribeDatabaseBackupResponse.BackupItems[" + i + "].BackupId"));<NEW_LINE>backup.setBackupStatus(context.stringValue("DescribeDatabaseBackupResponse.BackupItems[" + i + "].BackupStatus"));<NEW_LINE>backup.setBackupStartTime(context.stringValue("DescribeDatabaseBackupResponse.BackupItems[" + i + "].BackupStartTime"));<NEW_LINE>backup.setBackupEndTime(context.stringValue("DescribeDatabaseBackupResponse.BackupItems[" + i + "].BackupEndTime"));<NEW_LINE>backup.setBackupMode(context.stringValue("DescribeDatabaseBackupResponse.BackupItems[" + i + "].BackupMode"));<NEW_LINE>backup.setBackupDownloadURL(context.stringValue("DescribeDatabaseBackupResponse.BackupItems[" + i + "].BackupDownloadURL"));<NEW_LINE>backup.setBackupSize(context.longValue<MASK><NEW_LINE>backup.setBackupNodeNumber(context.integerValue("DescribeDatabaseBackupResponse.BackupItems[" + i + "].BackupNodeNumber"));<NEW_LINE>backup.setBackupNodeClass(context.stringValue("DescribeDatabaseBackupResponse.BackupItems[" + i + "].BackupNodeClass"));<NEW_LINE>backupItems.add(backup);<NEW_LINE>}<NEW_LINE>describeDatabaseBackupResponse.setBackupItems(backupItems);<NEW_LINE>return describeDatabaseBackupResponse;<NEW_LINE>} | ("DescribeDatabaseBackupResponse.BackupItems[" + i + "].BackupSize")); |
806,880 | public void marshall(Authorizer authorizer, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (authorizer == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(authorizer.getAuthorizerCredentialsArn(), AUTHORIZERCREDENTIALSARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(authorizer.getAuthorizerId(), AUTHORIZERID_BINDING);<NEW_LINE>protocolMarshaller.marshall(authorizer.getAuthorizerPayloadFormatVersion(), AUTHORIZERPAYLOADFORMATVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(authorizer.getAuthorizerResultTtlInSeconds(), AUTHORIZERRESULTTTLINSECONDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(authorizer.getAuthorizerType(), AUTHORIZERTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(authorizer.getAuthorizerUri(), AUTHORIZERURI_BINDING);<NEW_LINE>protocolMarshaller.marshall(authorizer.getEnableSimpleResponses(), ENABLESIMPLERESPONSES_BINDING);<NEW_LINE>protocolMarshaller.marshall(authorizer.getIdentitySource(), IDENTITYSOURCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(authorizer.getJwtConfiguration(), JWTCONFIGURATION_BINDING);<NEW_LINE>protocolMarshaller.marshall(authorizer.getName(), NAME_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | authorizer.getIdentityValidationExpression(), IDENTITYVALIDATIONEXPRESSION_BINDING); |
330,463 | private void addCrusherTravertineRecipes(Consumer<FinishedRecipe> consumer, String basePath) {<NEW_LINE>// Polished Travertine -> Travertine<NEW_LINE>crushing(consumer, BYGBlocks.POLISHED_TRAVERTINE, BYGBlocks.TRAVERTINE, basePath + "from_polished");<NEW_LINE>crushing(consumer, BYGBlocks.POLISHED_TRAVERTINE_SLAB, <MASK><NEW_LINE>crushing(consumer, BYGBlocks.POLISHED_TRAVERTINE_STAIRS, BYGBlocks.TRAVERTINE_STAIRS, basePath + "polished_stairs_to_stairs");<NEW_LINE>crushing(consumer, BYGBlocks.POLISHED_TRAVERTINE_WALL, BYGBlocks.TRAVERTINE_WALL, basePath + "polished_walls_to_walls");<NEW_LINE>// Chiseled Travertine -> Polished Travertine<NEW_LINE>crushing(consumer, BYGBlocks.CHISELED_TRAVERTINE, BYGBlocks.POLISHED_TRAVERTINE, basePath + "chiseled_to_polished");<NEW_LINE>crushing(consumer, BYGBlocks.CHISELED_TRAVERTINE_SLAB, BYGBlocks.POLISHED_TRAVERTINE_SLAB, basePath + "chiseled_slabs_to_polished_slabs");<NEW_LINE>crushing(consumer, BYGBlocks.CHISELED_TRAVERTINE_STAIRS, BYGBlocks.POLISHED_TRAVERTINE_STAIRS, basePath + "chiseled_stairs_to_polished_stairs");<NEW_LINE>crushing(consumer, BYGBlocks.CHISELED_TRAVERTINE_WALL, BYGBlocks.POLISHED_TRAVERTINE_WALL, basePath + "chiseled_walls_to_polished_walls");<NEW_LINE>} | BYGBlocks.TRAVERTINE_SLAB, basePath + "polished_slabs_to_slabs"); |
1,441,885 | final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "grafana");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
427,081 | private void initializeClient() {<NEW_LINE>if (mConfiguration.getClientId() != null) {<NEW_LINE>Log.i(TAG, "Using static client ID: " + mConfiguration.getClientId());<NEW_LINE>// use a statically configured client ID<NEW_LINE>mClientId.set(mConfiguration.getClientId());<NEW_LINE>runOnUiThread(this::initializeAuthRequest);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>RegistrationResponse lastResponse = mAuthStateManager.getCurrent().getLastRegistrationResponse();<NEW_LINE>if (lastResponse != null) {<NEW_LINE>Log.i(TAG, "Using dynamic client ID: " + lastResponse.clientId);<NEW_LINE>// already dynamically registered a client ID<NEW_LINE>mClientId.set(lastResponse.clientId);<NEW_LINE>runOnUiThread(this::initializeAuthRequest);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// WrongThread inference is incorrect for lambdas<NEW_LINE>// noinspection WrongThread<NEW_LINE>runOnUiThread(() -> displayLoading("Dynamically registering client"));<NEW_LINE>Log.i(TAG, "Dynamically registering client");<NEW_LINE>RegistrationRequest registrationRequest = new RegistrationRequest.Builder(mAuthStateManager.getCurrent().getAuthorizationServiceConfiguration(), Collections.singletonList(mConfiguration.getRedirectUri())).setTokenEndpointAuthenticationMethod(ClientSecretBasic.NAME).build();<NEW_LINE>mAuthService.<MASK><NEW_LINE>} | performRegistrationRequest(registrationRequest, this::handleRegistrationResponse); |
1,822,148 | public void onEntityTarget(final EntityTargetEvent event) {<NEW_LINE>if (!(event.getTarget() instanceof Player)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final User user = ess.getUser((<MASK><NEW_LINE>if ((event.getReason() == TargetReason.CLOSEST_PLAYER || event.getReason() == TargetReason.TARGET_ATTACKED_ENTITY || event.getReason() == TargetReason.TARGET_ATTACKED_NEARBY_ENTITY || event.getReason() == TargetReason.RANDOM_TARGET || event.getReason() == TargetReason.DEFEND_VILLAGE || event.getReason() == TargetReason.TARGET_ATTACKED_OWNER || event.getReason() == TargetReason.OWNER_ATTACKED_TARGET) && prot.getSettingBool(ProtectConfig.prevent_entitytarget) && !user.isAuthorized("essentials.protect.entitytarget.bypass")) {<NEW_LINE>event.setCancelled(true);<NEW_LINE>}<NEW_LINE>} | Player) event.getTarget()); |
1,598,498 | private void emitOptionalSequence(TypeSpec.Builder intentBuilderTypeBuilder, List<ExtraInjection> optionalInjections) {<NEW_LINE>// find type<NEW_LINE>final ClassName optionalSequence = get(target.classPackage, builderClassName(), OPTIONAL_SEQUENCE_CLASS);<NEW_LINE>final ParameterizedTypeName parameterizedOptionalSequence = ParameterizedTypeName.get(optionalSequence, TypeVariableName.get(OPTIONAL_SEQUENCE_SUBCLASS_GENERIC));<NEW_LINE>final TypeVariableName typeVariable = TypeVariableName.get(OPTIONAL_SEQUENCE_SUBCLASS_GENERIC, parameterizedOptionalSequence);<NEW_LINE>// find superclass<NEW_LINE>final TypeName superClass;<NEW_LINE>if (target.parentPackage != null) {<NEW_LINE>final ClassName parentOptionalSequence = get(target.parentPackage, target.parentClass + BUNDLE_BUILDER_SUFFIX, OPTIONAL_SEQUENCE_CLASS);<NEW_LINE>superClass = ParameterizedTypeName.get(parentOptionalSequence, typeVariable);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>TypeSpec.Builder optionalSequenceBuilder = TypeSpec.classBuilder(OPTIONAL_SEQUENCE_CLASS).superclass(superClass).addTypeVariable(typeVariable).addModifiers(Modifier.PUBLIC).addModifiers(Modifier.STATIC);<NEW_LINE>MethodSpec.Builder constructorBuilder = MethodSpec.constructorBuilder().addModifiers(Modifier.PUBLIC).addParameter(Bundler.class, "bundler").addParameter(get("android.content", "Intent"), "intent").addStatement("super(bundler, intent)");<NEW_LINE>optionalSequenceBuilder.addMethod(constructorBuilder.build());<NEW_LINE>for (int i = 0; i < optionalInjections.size(); i++) {<NEW_LINE>emitOptionalSetter(optionalSequenceBuilder, optionalInjections.get(i), typeVariable);<NEW_LINE>}<NEW_LINE>intentBuilderTypeBuilder.addType(optionalSequenceBuilder.build());<NEW_LINE>} | superClass = get(AllRequiredSetState.class); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.