idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,646,902 | // ----- static methods -----<NEW_LINE>public static Object invokeMethod(final SecurityContext securityContext, final Method method, final Object entity, final Map<String, Object> propertySet, final EvaluationHints hints) throws FrameworkException {<NEW_LINE>try {<NEW_LINE>// new structure: first parameter is always securityContext and second parameter can be Map (for dynamically defined methods)<NEW_LINE>if (method.getParameterTypes().length == 2 && method.getParameterTypes()[0].isAssignableFrom(SecurityContext.class) && method.getParameterTypes()[1].equals(Map.class)) {<NEW_LINE>final Object[] args = new Object[] { securityContext };<NEW_LINE>return method.invoke(entity, ArrayUtils.add(args, propertySet));<NEW_LINE>}<NEW_LINE>// second try: extracted parameter list<NEW_LINE>final Object[] args = extractParameters(propertySet, method.getParameterTypes());<NEW_LINE>return method.invoke(entity, ArrayUtils.add(args, 0, securityContext));<NEW_LINE>} catch (InvocationTargetException itex) {<NEW_LINE>final Throwable cause = itex.getCause();<NEW_LINE>if (cause instanceof AssertException) {<NEW_LINE><MASK><NEW_LINE>throw new FrameworkException(e.getStatus(), e.getMessage());<NEW_LINE>}<NEW_LINE>if (cause instanceof FrameworkException) {<NEW_LINE>throw (FrameworkException) cause;<NEW_LINE>}<NEW_LINE>} catch (IllegalAccessException | IllegalArgumentException t) {<NEW_LINE>logger.warn("Unable to invoke method {}: {}", method.getName(), t.getMessage());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | final AssertException e = (AssertException) cause; |
26,822 | public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {<NEW_LINE>if (((bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>output.writeInt32(3, containerPort_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 4, protocol_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.writeString(output, 5, hostIP_);<NEW_LINE>}<NEW_LINE>unknownFields.writeTo(output);<NEW_LINE>} | output.writeInt32(2, hostPort_); |
1,394,479 | protected void zkInit() throws Exception {<NEW_LINE>boolean isRMAWindow = isRMA();<NEW_LINE>bPartnerLabel.setText(Msg.getElement(Env.getCtx(), "C_BPartner_ID"));<NEW_LINE>orderLabel.setText(Msg.getElement(Env.getCtx(), "C_Order_ID", false));<NEW_LINE>invoiceLabel.setText(Msg.getElement(Env.getCtx(), "C_Invoice_ID", false));<NEW_LINE>rmaLabel.setText(Msg.translate(Env.getCtx(), "M_RMA_ID"));<NEW_LINE>locatorLabel.setText(Msg.translate(Env.getCtx(), "M_Locator_ID"));<NEW_LINE>sameWarehouseCb.setText(Msg.getMsg(Env.getCtx(), "FromSameWarehouseOnly", true));<NEW_LINE>sameWarehouseCb.setTooltiptext(Msg.getMsg(Env.getCtx(), "FromSameWarehouseOnly", false));<NEW_LINE>upcLabel.setText(Msg.getElement(Env.getCtx(), "UPC", false));<NEW_LINE>Borderlayout parameterLayout = new Borderlayout();<NEW_LINE>parameterLayout.setHeight("120px");<NEW_LINE>parameterLayout.setWidth("100%");<NEW_LINE>Panel parameterPanel = v_CreateFromPanel.getParameterPanel();<NEW_LINE>parameterPanel.appendChild(parameterLayout);<NEW_LINE>Grid parameterStdLayout = GridFactory.newGridLayout();<NEW_LINE>Panel parameterStdPanel = new Panel();<NEW_LINE>parameterStdPanel.appendChild(parameterStdLayout);<NEW_LINE>Center center = new Center();<NEW_LINE>parameterLayout.appendChild(center);<NEW_LINE>center.appendChild(parameterStdPanel);<NEW_LINE>parameterStdPanel.appendChild(parameterStdLayout);<NEW_LINE>Rows rows = (Rows) parameterStdLayout.newRows();<NEW_LINE>Row row = rows.newRow();<NEW_LINE>row.appendChild(bPartnerLabel.rightAlign());<NEW_LINE>if (bPartnerField != null)<NEW_LINE>row.appendChild(bPartnerField.getComponent());<NEW_LINE>if (!isRMAWindow) {<NEW_LINE>row.appendChild(orderLabel.rightAlign());<NEW_LINE>row.appendChild(orderField);<NEW_LINE>}<NEW_LINE>row = rows.newRow();<NEW_LINE>row.<MASK><NEW_LINE>row.appendChild(locatorField.getComponent());<NEW_LINE>if (!isRMAWindow) {<NEW_LINE>row.appendChild(invoiceLabel.rightAlign());<NEW_LINE>row.appendChild(invoiceField);<NEW_LINE>}<NEW_LINE>row = rows.newRow();<NEW_LINE>row.appendChild(new Space());<NEW_LINE>row.appendChild(sameWarehouseCb);<NEW_LINE>row = rows.newRow();<NEW_LINE>row.appendChild(upcLabel.rightAlign());<NEW_LINE>row.appendChild(upcField.getComponent());<NEW_LINE>if (isRMAWindow) {<NEW_LINE>// Add RMA document selection to panel<NEW_LINE>row.appendChild(rmaLabel.rightAlign());<NEW_LINE>row.appendChild(rmaField);<NEW_LINE>}<NEW_LINE>// Add to Main<NEW_LINE>v_CreateFromPanel.setWidth("100%");<NEW_LINE>v_CreateFromPanel.setHeight("100%");<NEW_LINE>v_Container.appendChild(v_CreateFromPanel);<NEW_LINE>} | appendChild(locatorLabel.rightAlign()); |
190,578 | public Result detectBaseDirectory(final String patchFileName) {<NEW_LINE>String[] nameComponents = patchFileName.split("/");<NEW_LINE>String patchName = nameComponents[nameComponents.length - 1];<NEW_LINE>if (patchName.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final PsiFile[] psiFiles = FilenameIndex.getFilesByName(myProject, patchName, GlobalSearchScope.projectScope(myProject));<NEW_LINE>if (psiFiles.length == 1) {<NEW_LINE>PsiDirectory parent = psiFiles[0].getContainingDirectory();<NEW_LINE>for (int i = nameComponents.length - 2; i >= 0; i--) {<NEW_LINE>if (!parent.getName().equals(nameComponents[i]) || Comparing.equal(parent.getVirtualFile(), myProject.getBaseDir())) {<NEW_LINE>return new Result(parent.getVirtualFile().<MASK><NEW_LINE>}<NEW_LINE>parent = parent.getParentDirectory();<NEW_LINE>}<NEW_LINE>if (parent == null)<NEW_LINE>return null;<NEW_LINE>return new Result(parent.getVirtualFile().getPresentableUrl(), 0);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | getPresentableUrl(), i + 1); |
639,840 | private BibEntry jsonItemToBibEntry(JSONObject item) throws ParseException {<NEW_LINE>try {<NEW_LINE>BibEntry entry = new BibEntry(StandardEntryType.Article);<NEW_LINE>entry.setField(StandardField.URL, item.optString("url"));<NEW_LINE>entry.setField(StandardField.TITLE, item.optString("title"));<NEW_LINE>entry.setField(StandardField.ABSTRACT, item.optString("abstract"));<NEW_LINE>entry.setField(StandardField.VENUE, item.optString("venue"));<NEW_LINE>entry.setField(StandardField.YEAR, item.optString("year"));<NEW_LINE>entry.setField(StandardField.AUTHOR, IntStream.range(0, item.optJSONArray("authors").length()).mapToObj(item.optJSONArray("authors")::getJSONObject).map((author) -> author.has("name") ? author.getString("name") : "").collect(Collectors.joining(" and ")));<NEW_LINE>JSONObject externalIds = item.optJSONObject("externalIds");<NEW_LINE>entry.setField(StandardField.DOI, externalIds.optString("DOI"));<NEW_LINE>if (externalIds.has("ArXiv")) {<NEW_LINE>entry.setField(StandardField.EPRINT, externalIds.getString("ArXiv"));<NEW_LINE>entry.setField(StandardField.EPRINTTYPE, "arXiv");<NEW_LINE>}<NEW_LINE>entry.setField(StandardField.PMID, externalIds.optString("PubMed"));<NEW_LINE>return entry;<NEW_LINE>} catch (JSONException exception) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | throw new ParseException("SemanticScholar API JSON format has changed", exception); |
1,767,724 | public void index(Record record) {<NEW_LINE>if (db == null)<NEW_LINE>init();<NEW_LINE>// is there a previous version of this record? if so, remove it<NEW_LINE>String id = getId(record);<NEW_LINE>if (!overwrite && file != null) {<NEW_LINE>Record old = findRecordById(id);<NEW_LINE>if (old != null) {<NEW_LINE>for (KeyFunction keyfunc : functions) {<NEW_LINE>NavigableMap<String, Block> blocks = getBlocks(keyfunc);<NEW_LINE>String key = keyfunc.makeKey(old);<NEW_LINE>Block <MASK><NEW_LINE>block.remove(id);<NEW_LINE>// changed the object, so need to write again<NEW_LINE>blocks.put(key, block);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>indexById(record);<NEW_LINE>// index by key<NEW_LINE>for (KeyFunction keyfunc : functions) {<NEW_LINE>NavigableMap<String, Block> blocks = getBlocks(keyfunc);<NEW_LINE>String key = keyfunc.makeKey(record);<NEW_LINE>Block block = blocks.get(key);<NEW_LINE>if (block == null)<NEW_LINE>block = new Block();<NEW_LINE>block.add(id);<NEW_LINE>// changed the object, so need to write again<NEW_LINE>blocks.put(key, block);<NEW_LINE>}<NEW_LINE>} | block = blocks.get(key); |
1,471,722 | public void marshall(Volume volume, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (volume == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(volume.getCreationTime(), CREATIONTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(volume.getFileSystemId(), FILESYSTEMID_BINDING);<NEW_LINE>protocolMarshaller.marshall(volume.getLifecycle(), LIFECYCLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(volume.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(volume.getResourceARN(), RESOURCEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(volume.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(volume.getVolumeId(), VOLUMEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(volume.getVolumeType(), VOLUMETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(volume.getLifecycleTransitionReason(), LIFECYCLETRANSITIONREASON_BINDING);<NEW_LINE>protocolMarshaller.marshall(volume.getAdministrativeActions(), ADMINISTRATIVEACTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(volume.getOpenZFSConfiguration(), OPENZFSCONFIGURATION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | volume.getOntapConfiguration(), ONTAPCONFIGURATION_BINDING); |
667,023 | private void updateIfChanged(List<String> newList) {<NEW_LINE>if (null == newList || newList.isEmpty()) {<NEW_LINE>LOGGER.warn("[update-serverlist] current serverlist from address server is empty!!!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<String> newServerAddrList = new ArrayList<String>();<NEW_LINE>for (String server : newList) {<NEW_LINE>if (server.startsWith(HTTP) || server.startsWith(HTTPS)) {<NEW_LINE>newServerAddrList.add(server);<NEW_LINE>} else {<NEW_LINE>newServerAddrList.add(HTTP + server);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (newServerAddrList.equals(serverUrls)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>serverUrls = new ArrayList<String>(newServerAddrList);<NEW_LINE>iterator = iterator();<NEW_LINE>currentServerAddr = iterator.next();<NEW_LINE>EventDispatcher<MASK><NEW_LINE>LOGGER.info("[{}] [update-serverlist] serverlist updated to {}", name, serverUrls);<NEW_LINE>} | .fireEvent(new ServerlistChangeEvent()); |
550,199 | static void addHandlerAfterReactorCodecs(Connection context, String name, ChannelHandler handler) {<NEW_LINE>Objects.requireNonNull(name, "name");<NEW_LINE>Objects.requireNonNull(handler, "handler");<NEW_LINE>Channel channel = context.channel();<NEW_LINE>boolean exists = channel.pipeline().get(name) != null;<NEW_LINE>if (exists) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(format(channel, "Handler [{}] already exists in the pipeline, encoder has been skipped"), name);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// we need to find the correct position<NEW_LINE>String after = null;<NEW_LINE>for (String s : channel.pipeline().names()) {<NEW_LINE>if (s.startsWith(NettyPipeline.LEFT)) {<NEW_LINE>after = s;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (after == null) {<NEW_LINE>channel.pipeline().addFirst(name, handler);<NEW_LINE>} else {<NEW_LINE>channel.pipeline().addAfter(after, name, handler);<NEW_LINE>}<NEW_LINE>registerForClose(context.isPersistent(), name, context);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(format(channel, "Added encoder [{}] at the beginning of the user pipeline, full pipeline: {}"), name, channel.<MASK><NEW_LINE>}<NEW_LINE>} | pipeline().names()); |
174,458 | public static ListApplicationOrderCaseSKUResponse unmarshall(ListApplicationOrderCaseSKUResponse listApplicationOrderCaseSKUResponse, UnmarshallerContext _ctx) {<NEW_LINE>listApplicationOrderCaseSKUResponse.setRequestId(_ctx.stringValue("ListApplicationOrderCaseSKUResponse.RequestId"));<NEW_LINE>listApplicationOrderCaseSKUResponse.setPageSize(_ctx.integerValue("ListApplicationOrderCaseSKUResponse.PageSize"));<NEW_LINE>listApplicationOrderCaseSKUResponse.setTotalCount(_ctx.integerValue("ListApplicationOrderCaseSKUResponse.TotalCount"));<NEW_LINE>listApplicationOrderCaseSKUResponse.setPageNumber(_ctx.integerValue("ListApplicationOrderCaseSKUResponse.PageNumber"));<NEW_LINE>listApplicationOrderCaseSKUResponse.setSuccess(_ctx.booleanValue("ListApplicationOrderCaseSKUResponse.Success"));<NEW_LINE>List<ApplyOrderCaseSkuModel> applyOrderCaseSkus = new ArrayList<ApplyOrderCaseSkuModel>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListApplicationOrderCaseSKUResponse.ApplyOrderCaseSkus.Length"); i++) {<NEW_LINE>ApplyOrderCaseSkuModel applyOrderCaseSkuModel = new ApplyOrderCaseSkuModel();<NEW_LINE>applyOrderCaseSkuModel.setProductSizeName(_ctx.stringValue("ListApplicationOrderCaseSKUResponse.ApplyOrderCaseSkus[" + i + "].ProductSizeName"));<NEW_LINE>applyOrderCaseSkuModel.setCaseCode(_ctx.stringValue("ListApplicationOrderCaseSKUResponse.ApplyOrderCaseSkus[" + i + "].CaseCode"));<NEW_LINE>applyOrderCaseSkuModel.setBoxQuantity(_ctx.integerValue("ListApplicationOrderCaseSKUResponse.ApplyOrderCaseSkus[" + i + "].BoxQuantity"));<NEW_LINE>applyOrderCaseSkuModel.setProductId(_ctx.stringValue<MASK><NEW_LINE>applyOrderCaseSkuModel.setProductColorCode(_ctx.stringValue("ListApplicationOrderCaseSKUResponse.ApplyOrderCaseSkus[" + i + "].ProductColorCode"));<NEW_LINE>applyOrderCaseSkuModel.setProductName(_ctx.stringValue("ListApplicationOrderCaseSKUResponse.ApplyOrderCaseSkus[" + i + "].ProductName"));<NEW_LINE>applyOrderCaseSkuModel.setProductSizeCode(_ctx.stringValue("ListApplicationOrderCaseSKUResponse.ApplyOrderCaseSkus[" + i + "].ProductSizeCode"));<NEW_LINE>applyOrderCaseSkuModel.setProductCode(_ctx.stringValue("ListApplicationOrderCaseSKUResponse.ApplyOrderCaseSkus[" + i + "].ProductCode"));<NEW_LINE>applyOrderCaseSkuModel.setProductSizeId(_ctx.stringValue("ListApplicationOrderCaseSKUResponse.ApplyOrderCaseSkus[" + i + "].ProductSizeId"));<NEW_LINE>applyOrderCaseSkuModel.setProductColorId(_ctx.stringValue("ListApplicationOrderCaseSKUResponse.ApplyOrderCaseSkus[" + i + "].ProductColorId"));<NEW_LINE>applyOrderCaseSkuModel.setCaseId(_ctx.stringValue("ListApplicationOrderCaseSKUResponse.ApplyOrderCaseSkus[" + i + "].CaseId"));<NEW_LINE>applyOrderCaseSkuModel.setProductColorName(_ctx.stringValue("ListApplicationOrderCaseSKUResponse.ApplyOrderCaseSkus[" + i + "].ProductColorName"));<NEW_LINE>applyOrderCaseSkuModel.setBindingQuantity(_ctx.integerValue("ListApplicationOrderCaseSKUResponse.ApplyOrderCaseSkus[" + i + "].BindingQuantity"));<NEW_LINE>applyOrderCaseSkuModel.setBarcodeId(_ctx.stringValue("ListApplicationOrderCaseSKUResponse.ApplyOrderCaseSkus[" + i + "].BarcodeId"));<NEW_LINE>applyOrderCaseSkuModel.setBarcode(_ctx.stringValue("ListApplicationOrderCaseSKUResponse.ApplyOrderCaseSkus[" + i + "].Barcode"));<NEW_LINE>applyOrderCaseSkuModel.setSKUName(_ctx.stringValue("ListApplicationOrderCaseSKUResponse.ApplyOrderCaseSkus[" + i + "].SKUName"));<NEW_LINE>applyOrderCaseSkus.add(applyOrderCaseSkuModel);<NEW_LINE>}<NEW_LINE>listApplicationOrderCaseSKUResponse.setApplyOrderCaseSkus(applyOrderCaseSkus);<NEW_LINE>return listApplicationOrderCaseSKUResponse;<NEW_LINE>} | ("ListApplicationOrderCaseSKUResponse.ApplyOrderCaseSkus[" + i + "].ProductId")); |
1,728,585 | public PlatformInstance deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {<NEW_LINE>ObjectCodec codec = jp.getCodec();<NEW_LINE>JsonNode json = codec.readTree(jp);<NEW_LINE>try {<NEW_LINE>if (json.has("uuid") && json.has("config_uuid") && json.has("address") && json.has("is_leader") && json.has("is_local")) {<NEW_LINE>PlatformInstance instance = new PlatformInstance();<NEW_LINE>instance.uuid = UUID.fromString(json.get("uuid").asText());<NEW_LINE>UUID configUUID = UUID.fromString(json.get("config_uuid").asText());<NEW_LINE>instance.config = HighAvailabilityConfig.get(configUUID).orElse(null);<NEW_LINE>instance.address = json.get("address").asText();<NEW_LINE>instance.setIsLeader(json.get("is_leader").asBoolean());<NEW_LINE>instance.setIsLocal(json.get("is_local").asBoolean());<NEW_LINE>JsonNode <MASK><NEW_LINE>instance.lastBackup = (lastBackup == null || lastBackup.asText().equals("null")) ? null : new Date(lastBackup.asLong());<NEW_LINE>return instance;<NEW_LINE>} else {<NEW_LINE>LOG.error("Could not deserialize {} to platform instance model. " + "At least one expected field is missing", json);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Error importing platform instance: {}", json, e);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | lastBackup = json.get("last_backup"); |
450,240 | public static APICreateDataVolumeEvent __example__() {<NEW_LINE>APICreateDataVolumeEvent event = new APICreateDataVolumeEvent();<NEW_LINE>String volumeUuid = uuid();<NEW_LINE>VolumeInventory vol = new VolumeInventory();<NEW_LINE>vol.setName("test-volume");<NEW_LINE>vol.setCreateDate(new Timestamp(org.zstack.header.message.DocUtils.date));<NEW_LINE>vol.setLastOpDate(new Timestamp(org.zstack.header.message.DocUtils.date));<NEW_LINE>vol.setType(VolumeType.Root.toString());<NEW_LINE>vol.setUuid(volumeUuid);<NEW_LINE>vol.setSize(SizeUnit.GIGABYTE.toByte(100));<NEW_LINE>vol.setActualSize(SizeUnit.GIGABYTE.toByte(20));<NEW_LINE>vol.setDeviceId(0);<NEW_LINE>vol.setState(VolumeState.Enabled.toString());<NEW_LINE>vol.setFormat("qcow2");<NEW_LINE>vol.setDiskOfferingUuid(uuid());<NEW_LINE>vol.setInstallPath(String.format("/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-%s/%s.qcow2", volumeUuid, volumeUuid));<NEW_LINE>vol.setStatus(VolumeStatus.Ready.toString());<NEW_LINE>vol.setPrimaryStorageUuid(uuid());<NEW_LINE><MASK><NEW_LINE>vol.setRootImageUuid(uuid());<NEW_LINE>event.setInventory(vol);<NEW_LINE>return event;<NEW_LINE>} | vol.setVmInstanceUuid(uuid()); |
1,787,775 | public void marshall(TableInput tableInput, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (tableInput == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(tableInput.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getOwner(), OWNER_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getLastAccessTime(), LASTACCESSTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getLastAnalyzedTime(), LASTANALYZEDTIME_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getRetention(), RETENTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getStorageDescriptor(), STORAGEDESCRIPTOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getPartitionKeys(), PARTITIONKEYS_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getViewOriginalText(), VIEWORIGINALTEXT_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getViewExpandedText(), VIEWEXPANDEDTEXT_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getTableType(), TABLETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(tableInput.getParameters(), PARAMETERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | tableInput.getTargetTable(), TARGETTABLE_BINDING); |
1,514,364 | Map<List<TableId>, Long> calculateUsage() {<NEW_LINE>// Bitset of tables that contain a file and total usage by all files that share that usage<NEW_LINE>Map<List<Integer>, Long> usage = new HashMap<>();<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace("fileSizes {}", fileSizes);<NEW_LINE>}<NEW_LINE>// For each file w/ referenced-table bitset<NEW_LINE>for (Entry<String, Integer[]> entry : tableFiles.entrySet()) {<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace("file {} table bitset {}", entry.getKey(), Arrays.toString<MASK><NEW_LINE>}<NEW_LINE>List<Integer> key = Arrays.asList(entry.getValue());<NEW_LINE>Long size = fileSizes.get(entry.getKey());<NEW_LINE>Long tablesUsage = usage.get(key);<NEW_LINE>if (tablesUsage == null)<NEW_LINE>tablesUsage = 0L;<NEW_LINE>tablesUsage += size;<NEW_LINE>usage.put(key, tablesUsage);<NEW_LINE>}<NEW_LINE>Map<List<TableId>, Long> externalUsage = new HashMap<>();<NEW_LINE>for (Entry<List<Integer>, Long> entry : usage.entrySet()) {<NEW_LINE>List<TableId> externalKey = new ArrayList<>();<NEW_LINE>List<Integer> key = entry.getKey();<NEW_LINE>// table bitset<NEW_LINE>for (int i = 0; i < key.size(); i++) if (key.get(i) != 0)<NEW_LINE>// Convert by internal id to the table id<NEW_LINE>externalKey.add(externalIds.get(i));<NEW_LINE>// list of table ids and size of files shared across the tables<NEW_LINE>externalUsage.put(externalKey, entry.getValue());<NEW_LINE>}<NEW_LINE>// mapping of all enumerations of files being referenced by tables and total size of files who<NEW_LINE>// share the same reference<NEW_LINE>return externalUsage;<NEW_LINE>} | (entry.getValue())); |
1,143,191 | public DetectDominantLanguageResult detectDominantLanguage(DetectDominantLanguageRequest detectDominantLanguageRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(detectDominantLanguageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DetectDominantLanguageRequest> request = null;<NEW_LINE>Response<DetectDominantLanguageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DetectDominantLanguageRequestMarshaller().marshall(detectDominantLanguageRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<DetectDominantLanguageResult, JsonUnmarshallerContext> unmarshaller = new DetectDominantLanguageResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<DetectDominantLanguageResult> responseHandler = new JsonResponseHandler<DetectDominantLanguageResult>(unmarshaller);<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
376,748 | public int compareTo(HostedMethod other) {<NEW_LINE>if (this.equals(other)) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>int result = Boolean.compare(this.compilationInfo.isDeoptTarget(), other.compilationInfo.isDeoptTarget());<NEW_LINE>if (result == 0) {<NEW_LINE>result = this.getDeclaringClass().compareTo(other.getDeclaringClass());<NEW_LINE>}<NEW_LINE>if (result == 0) {<NEW_LINE>result = this.getName().compareTo(other.getName());<NEW_LINE>}<NEW_LINE>if (result == 0) {<NEW_LINE>result = this.getSignature().getParameterCount(false) - other.<MASK><NEW_LINE>}<NEW_LINE>if (result == 0) {<NEW_LINE>for (int i = 0; i < this.getSignature().getParameterCount(false); i++) {<NEW_LINE>result = ((HostedType) this.getSignature().getParameterType(i, null)).compareTo((HostedType) other.getSignature().getParameterType(i, null));<NEW_LINE>if (result != 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result == 0) {<NEW_LINE>result = ((HostedType) this.getSignature().getReturnType(null)).compareTo((HostedType) other.getSignature().getReturnType(null));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | getSignature().getParameterCount(false); |
1,649,208 | public InteractionResultHolder<ItemStack> use(@Nonnull Level world, Player player, @Nonnull InteractionHand hand) {<NEW_LINE>ItemStack <MASK><NEW_LINE>if (player.isShiftKeyDown()) {<NEW_LINE>if (!world.isClientSide()) {<NEW_LINE>MekanismContainerTypes.DICTIONARY.tryOpenGui((ServerPlayer) player, hand, stack);<NEW_LINE>}<NEW_LINE>return InteractionResultHolder.sidedSuccess(stack, world.isClientSide);<NEW_LINE>} else {<NEW_LINE>BlockHitResult result = MekanismUtils.rayTrace(player, ClipContext.Fluid.ANY);<NEW_LINE>if (result.getType() != Type.MISS) {<NEW_LINE>FluidState fluidState = world.getFluidState(result.getBlockPos());<NEW_LINE>if (!fluidState.isEmpty()) {<NEW_LINE>if (!world.isClientSide()) {<NEW_LINE>sendTagsOrEmptyToPlayer(player, MekanismLang.DICTIONARY_FLUID_TAGS_FOUND, fluidState.getTags());<NEW_LINE>}<NEW_LINE>return InteractionResultHolder.sidedSuccess(stack, world.isClientSide);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return InteractionResultHolder.pass(stack);<NEW_LINE>} | stack = player.getItemInHand(hand); |
1,124,855 | public boolean sendHtmlMail(MailSenderInfo mailInfo) {<NEW_LINE>MyAuthenticator authenticator = null;<NEW_LINE>Properties pro = mailInfo.getProperties();<NEW_LINE>if (mailInfo.isValidate()) {<NEW_LINE>authenticator = new MyAuthenticator(mailInfo.getUserName(), mailInfo.getPassword());<NEW_LINE>}<NEW_LINE>Session sendMailSession = Session.getDefaultInstance(pro, authenticator);<NEW_LINE>try {<NEW_LINE>Message mailMessage = new MimeMessage(sendMailSession);<NEW_LINE>Address from = new InternetAddress(mailInfo.getFromAddress());<NEW_LINE>mailMessage.setFrom(from);<NEW_LINE>Address[] to = new Address[mailInfo.getToAddress().split(";").length];<NEW_LINE>int i = 0;<NEW_LINE>for (String e : mailInfo.getToAddress().split(";")) to[i<MASK><NEW_LINE>mailMessage.setRecipients(Message.RecipientType.TO, to);<NEW_LINE>mailMessage.setSubject(mailInfo.getSubject());<NEW_LINE>mailMessage.setSentDate(new Date());<NEW_LINE>Multipart mainPart = new MimeMultipart();<NEW_LINE>BodyPart html = new MimeBodyPart();<NEW_LINE>html.setContent(mailInfo.getContent(), "text/html; charset=UTF-8");<NEW_LINE>mainPart.addBodyPart(html);<NEW_LINE>List<File> list = mailInfo.getFileList();<NEW_LINE>if (list != null && list.size() > 0) {<NEW_LINE>for (File f : list) {<NEW_LINE>MimeBodyPart mbp = new MimeBodyPart();<NEW_LINE>FileDataSource fds = new FileDataSource(f.getAbsolutePath());<NEW_LINE>mbp.setDataHandler(new DataHandler(fds));<NEW_LINE>mbp.setFileName(f.getName());<NEW_LINE>mainPart.addBodyPart(mbp);<NEW_LINE>}<NEW_LINE>list.clear();<NEW_LINE>}<NEW_LINE>mailMessage.setContent(mainPart);<NEW_LINE>Transport.send(mailMessage);<NEW_LINE>return true;<NEW_LINE>} catch (MessagingException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | ++] = new InternetAddress(e); |
1,618,989 | public void stateChanged(ChangeEvent e) {<NEW_LINE>JViewport viewport = (JViewport) e.getSource();<NEW_LINE>int tabPlacement = tabPane.getTabPlacement();<NEW_LINE>int tabCount = tabPane.getTabCount();<NEW_LINE>Rectangle vpRect = viewport.getBounds();<NEW_LINE>Dimension viewSize = viewport.getViewSize();<NEW_LINE>Rectangle viewRect = viewport.getViewRect();<NEW_LINE>leadingTabIndex = getClosestTab(viewRect.x, viewRect.y);<NEW_LINE>// If the tab isn't right aligned, adjust it.<NEW_LINE>if (leadingTabIndex + 1 < tabCount) {<NEW_LINE>switch(tabPlacement) {<NEW_LINE>case TOP:<NEW_LINE>case BOTTOM:<NEW_LINE>if (rects[leadingTabIndex].x < viewRect.x) {<NEW_LINE>leadingTabIndex++;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case LEFT:<NEW_LINE>case RIGHT:<NEW_LINE>if (rects[leadingTabIndex].y < viewRect.y) {<NEW_LINE>leadingTabIndex++;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Insets contentInsets = getContentBorderInsets(tabPlacement);<NEW_LINE>switch(tabPlacement) {<NEW_LINE>case LEFT:<NEW_LINE>tabPane.repaint(vpRect.x + vpRect.width, vpRect.y, contentInsets.left, vpRect.height);<NEW_LINE>scrollBackwardButton.setEnabled(viewRect.y > 0 && leadingTabIndex > 0);<NEW_LINE>scrollForwardButton.setEnabled(leadingTabIndex < tabCount - 1 && viewSize.height - viewRect.y > viewRect.height);<NEW_LINE>break;<NEW_LINE>case RIGHT:<NEW_LINE>tabPane.repaint(vpRect.x - contentInsets.right, vpRect.y, contentInsets.right, vpRect.height);<NEW_LINE>scrollBackwardButton.setEnabled(viewRect.y > 0 && leadingTabIndex > 0);<NEW_LINE>scrollForwardButton.setEnabled(leadingTabIndex < tabCount - 1 && viewSize.height - <MASK><NEW_LINE>break;<NEW_LINE>case BOTTOM:<NEW_LINE>tabPane.repaint(vpRect.x, vpRect.y - contentInsets.bottom, vpRect.width, contentInsets.bottom);<NEW_LINE>scrollBackwardButton.setEnabled(viewRect.x > 0 && leadingTabIndex > 0);<NEW_LINE>scrollForwardButton.setEnabled(leadingTabIndex < tabCount - 1 && viewSize.width - viewRect.x > viewRect.width);<NEW_LINE>break;<NEW_LINE>case TOP:<NEW_LINE>default:<NEW_LINE>tabPane.repaint(vpRect.x, vpRect.y + vpRect.height, vpRect.width, contentInsets.top);<NEW_LINE>scrollBackwardButton.setEnabled(viewRect.x > 0 && leadingTabIndex > 0);<NEW_LINE>scrollForwardButton.setEnabled(leadingTabIndex < tabCount - 1 && viewSize.width - viewRect.x > viewRect.width);<NEW_LINE>}<NEW_LINE>} | viewRect.y > viewRect.height); |
789,707 | private static void drawGem_36(Canvas canvas, RectF targetFrame, ResizingBehavior resizing) {<NEW_LINE>// Resize to Target Frame<NEW_LINE>canvas.save();<NEW_LINE>RectF resizedFrame = CacheForGem_36.resizedFrame;<NEW_LINE>HabiticaIcons.resizingBehaviorApply(resizing, CacheForGem_36.originalFrame, targetFrame, resizedFrame);<NEW_LINE>canvas.translate(resizedFrame.left, resizedFrame.top);<NEW_LINE>canvas.scale(resizedFrame.width() / 36f, <MASK><NEW_LINE>// Gem36<NEW_LINE>RectF gem36Rect = CacheForGem_36.gem36Rect;<NEW_LINE>gem36Rect.set(0f, 0f, 36f, 36f);<NEW_LINE>canvas.save();<NEW_LINE>canvas.clipRect(gem36Rect);<NEW_LINE>canvas.translate(gem36Rect.left, gem36Rect.top);<NEW_LINE>RectF gem36TargetRect = CacheForGem_36.gem36TargetRect;<NEW_LINE>gem36TargetRect.set(0f, 0f, gem36Rect.width(), gem36Rect.height());<NEW_LINE>HabiticaIcons.drawGem(canvas, gem36TargetRect, ResizingBehavior.Stretch);<NEW_LINE>canvas.restore();<NEW_LINE>canvas.restore();<NEW_LINE>} | resizedFrame.height() / 36f); |
661,517 | private File reconstructAssets(Version version) throws IOException {<NEW_LINE>File indexDir = new File(assetsDirectory, "indexes");<NEW_LINE>File objectDir = new File(assetsDirectory, "objects");<NEW_LINE>String assetVersion = version.getAssetIndexInfo().getId();<NEW_LINE>File indexFile = new File(indexDir, assetVersion + ".json");<NEW_LINE>File virtualRoot = new File(new File<MASK><NEW_LINE>if (!indexFile.isFile()) {<NEW_LINE>Log.w(TAG, "reconstructAssets: No assets index file " + virtualRoot + "; can't reconstruct assets");<NEW_LINE>return virtualRoot;<NEW_LINE>}<NEW_LINE>AssetIndex index;<NEW_LINE>try (Reader r = new FileReader(indexFile)) {<NEW_LINE>index = gson.fromJson(r, AssetIndex.class);<NEW_LINE>}<NEW_LINE>if (index.isVirtual()) {<NEW_LINE>Log.i(TAG, "reconstructAssets: Reconstructing virtual assets folder at " + virtualRoot);<NEW_LINE>for (Map.Entry<String, AssetIndex.AssetObject> entry : index.getFileMap().entrySet()) {<NEW_LINE>File target = new File(virtualRoot, entry.getKey());<NEW_LINE>File original = new File(new File(objectDir, entry.getValue().getHash().substring(0, 2)), entry.getValue().getHash());<NEW_LINE>if (!target.isFile())<NEW_LINE>try (InputStream is = new FileInputStream(original);<NEW_LINE>OutputStream os = new FileOutputStream(target)) {<NEW_LINE>FileUtils.copy(is, os);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try (OutputStream os = new FileOutputStream(new File(virtualRoot, ".lastused"))) {<NEW_LINE>os.write(new DateDeserializer().serializeToString(new Date()).getBytes());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return virtualRoot;<NEW_LINE>} | (assetsDirectory, "virtual"), assetVersion); |
1,183,156 | public AcknowledgeAlarmActionRequest unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AcknowledgeAlarmActionRequest acknowledgeAlarmActionRequest = new AcknowledgeAlarmActionRequest();<NEW_LINE><MASK><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("requestId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>acknowledgeAlarmActionRequest.setRequestId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("alarmModelName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>acknowledgeAlarmActionRequest.setAlarmModelName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("keyValue", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>acknowledgeAlarmActionRequest.setKeyValue(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("note", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>acknowledgeAlarmActionRequest.setNote(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 acknowledgeAlarmActionRequest;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
866,861 | public static <T> T[] addAll(final T[] array1, @SuppressWarnings("unchecked") final T... array2) {<NEW_LINE>if (array1 == null) {<NEW_LINE>return clone(array2);<NEW_LINE>} else if (array2 == null) {<NEW_LINE>return clone(array1);<NEW_LINE>}<NEW_LINE>final Class<?> type1 = array1.getClass().getComponentType();<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final T[] joinedArray = (T[]) Array.newInstance(type1, <MASK><NEW_LINE>System.arraycopy(array1, 0, joinedArray, 0, array1.length);<NEW_LINE>try {<NEW_LINE>System.arraycopy(array2, 0, joinedArray, array1.length, array2.length);<NEW_LINE>} catch (final ArrayStoreException ase) {<NEW_LINE>final Class<?> type2 = array2.getClass().getComponentType();<NEW_LINE>if (!type1.isAssignableFrom(type2)) {<NEW_LINE>throw new IllegalArgumentException("Cannot store " + type2.getName() + " in an array of " + type1.getName(), ase);<NEW_LINE>}<NEW_LINE>throw ase;<NEW_LINE>}<NEW_LINE>return joinedArray;<NEW_LINE>} | array1.length + array2.length); |
652,784 | public AnnotationMirror greatestLowerBound(AnnotationMirror a1, AnnotationMirror a2) {<NEW_LINE>if (!AnnotationUtils.areSameByName(getTopAnnotation(a1), getTopAnnotation(a2))) {<NEW_LINE>return null;<NEW_LINE>} else if (isSubtype(a1, a2)) {<NEW_LINE>return a1;<NEW_LINE>} else if (isSubtype(a2, a1)) {<NEW_LINE>return a2;<NEW_LINE>} else if (AnnotationUtils.areSameByName(a1, a2)) {<NEW_LINE>List<MethodSignature> a1Sigs = getListOfMethodSignatures(a1);<NEW_LINE>List<<MASK><NEW_LINE>Set<MethodSignature> lubSigs = new HashSet<>(a1Sigs);<NEW_LINE>// intersection<NEW_LINE>lubSigs.retainAll(a2Sigs);<NEW_LINE>AnnotationMirror result = createMethodVal(lubSigs);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | MethodSignature> a2Sigs = getListOfMethodSignatures(a2); |
155,678 | public CipherParameters decrypt(byte[] in, int inOff, int inLen, int keyLen) throws IllegalArgumentException {<NEW_LINE>if (!(key instanceof ECPrivateKeyParameters)) {<NEW_LINE>throw new IllegalArgumentException("Private key required for encryption");<NEW_LINE>}<NEW_LINE>ECPrivateKeyParameters ecPrivKey = (ECPrivateKeyParameters) key;<NEW_LINE>ECDomainParameters ecParams = ecPrivKey.getParameters();<NEW_LINE>ECCurve curve = ecParams.getCurve();<NEW_LINE>BigInteger n = ecParams.getN();<NEW_LINE>BigInteger h = ecParams.getH();<NEW_LINE>// Decode the ephemeral public key<NEW_LINE>byte[] C = new byte[inLen];<NEW_LINE>System.arraycopy(in, inOff, C, 0, inLen);<NEW_LINE>// NOTE: Decoded points are already normalized (i.e in affine form)<NEW_LINE>ECPoint <MASK><NEW_LINE>// Compute the static-ephemeral key agreement<NEW_LINE>ECPoint gHat = gTilde;<NEW_LINE>if ((CofactorMode) || (OldCofactorMode)) {<NEW_LINE>gHat = gHat.multiply(h);<NEW_LINE>}<NEW_LINE>BigInteger xHat = ecPrivKey.getD();<NEW_LINE>if (CofactorMode) {<NEW_LINE>xHat = xHat.multiply(ecParams.getHInv()).mod(n);<NEW_LINE>}<NEW_LINE>ECPoint hTilde = gHat.multiply(xHat).normalize();<NEW_LINE>// Encode the shared secret value<NEW_LINE>byte[] PEH = hTilde.getAffineXCoord().getEncoded();<NEW_LINE>return deriveKey(keyLen, C, PEH);<NEW_LINE>} | gTilde = curve.decodePoint(C); |
420,876 | public ObjectName register(JmxExporter jmxExporter, SessionConnector connector, String connectorId) {<NEW_LINE>try {<NEW_LINE>final ObjectName connectorName = getConnectorName(connector, connectorId);<NEW_LINE>ConnectorAdmin connectorAdmin;<NEW_LINE>if (connector instanceof AbstractSocketAcceptor) {<NEW_LINE>connectorAdmin = new SocketAcceptorAdmin(jmxExporter, (AbstractSocketAcceptor) connector, connectorName, sessionExporter);<NEW_LINE>} else if (connector instanceof AbstractSocketInitiator) {<NEW_LINE>connectorAdmin = new SocketInitiatorAdmin(jmxExporter, (AbstractSocketInitiator) connector, connectorName, sessionExporter);<NEW_LINE>} else {<NEW_LINE>throw new QFJException("Unknown connector type: " + connector.getClass().getName());<NEW_LINE>}<NEW_LINE>jmxExporter.registerMBean(connectorAdmin, connectorName);<NEW_LINE>return connectorName;<NEW_LINE>} catch (final RuntimeException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (final Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | throw new QFJException("Failed to export connector MBean", e); |
711,053 | protected X9ECParameters createParameters() {<NEW_LINE>// p = 2^128 - 2^97 - 1<NEW_LINE>BigInteger p = fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF");<NEW_LINE>BigInteger a = fromHex("D6031998D1B3BBFEBF59CC9BBFF9AEE1");<NEW_LINE>BigInteger b = fromHex("5EEEFCA380D02919DC2C6558BB6D8A5D");<NEW_LINE>byte[] S = Hex.decode("004D696E67687561517512D8F03431FCE63B88F4");<NEW_LINE>BigInteger n = fromHex("3FFFFFFF7FFFFFFFBE0024720613B5A3");<NEW_LINE>BigInteger h = BigInteger.valueOf(4);<NEW_LINE>ECCurve curve = new ECCurve.Fp(p, a, b);<NEW_LINE>// ECPoint G = curve.decodePoint(Hex.decode("02"<NEW_LINE>// + "7B6AA5D85E572983E6FB32A7CDEBC140"));<NEW_LINE>ECPoint G = curve.decodePoint(Hex.decode("04" + "7B6AA5D85E572983E6FB32A7CDEBC140" + "27B6916A894D3AEE7106FE805FC34B44"));<NEW_LINE>return new X9ECParameters(curve, <MASK><NEW_LINE>} | G, n, h, S); |
1,667,468 | final DeleteIdentitiesResult executeDeleteIdentities(DeleteIdentitiesRequest deleteIdentitiesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteIdentitiesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteIdentitiesRequest> request = null;<NEW_LINE>Response<DeleteIdentitiesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteIdentitiesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteIdentitiesRequest));<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(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Cognito Identity");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteIdentities");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteIdentitiesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteIdentitiesResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
670,915 | public <T> T query(String sql, StatementParameters parameters, final DalHints hints, final DalResultSetExtractor<T> extractor, final DalTaskContext dalTaskContext) throws SQLException {<NEW_LINE>ConnectionAction<T> action = new ConnectionAction<T>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public T execute() throws Exception {<NEW_LINE>conn = getConnection(hints, this);<NEW_LINE>preparedStatement = createPreparedStatement(conn, sql, parameters, hints);<NEW_LINE>beginExecute();<NEW_LINE>rs = executeQuery(preparedStatement, entry);<NEW_LINE>endExecute();<NEW_LINE>T result;<NEW_LINE>if (extractor instanceof HintsAwareExtractor)<NEW_LINE>result = ((DalResultSetExtractor<T>) ((HintsAwareExtractor) extractor).extractWith(<MASK><NEW_LINE>else<NEW_LINE>result = extractor.extract(rs);<NEW_LINE>entry.setResultCount(fetchSize(rs, result));<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>action.populate(DalEventEnum.QUERY, sql, parameters, dalTaskContext);<NEW_LINE>return doInConnection(action, hints);<NEW_LINE>} | hints)).extract(rs); |
305,772 | public void run() {<NEW_LINE>try {<NEW_LINE>// Actions have to be invoked in dispatch thread<NEW_LINE>// (see http://www.netbeans.org/issues/show_bug.cgi?id=35755)<NEW_LINE>EventQueue.invokeAndWait(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>if (SystemAction.class.isAssignableFrom(systemActionClass)) {<NEW_LINE>// SystemAction used in IDE<NEW_LINE>SystemAction.get(systemActionClass).actionPerformed(new ActionEvent(new Container(), 0, null));<NEW_LINE>} else {<NEW_LINE>// action implements javax.swing.Action<NEW_LINE>try {<NEW_LINE>((javax.swing.Action) systemActionClass.newInstance()).actionPerformed(new ActionEvent(new Container(), 0, null));<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new JemmyException("Exception when trying to create instance of action \"" + systemActionClass.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new JemmyException("Exception while performing action in dispatch thread", e);<NEW_LINE>}<NEW_LINE>} | getName() + "\".", e); |
1,161,712 | public PushNotificationPreferences unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>PushNotificationPreferences pushNotificationPreferences = new PushNotificationPreferences();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><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("AllowNotifications", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>pushNotificationPreferences.setAllowNotifications(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("FilterRule", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>pushNotificationPreferences.setFilterRule(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 pushNotificationPreferences;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,771,650 | public Map<String, String> tableOptions() {<NEW_LINE>Map<String, String> map = super.tableOptions();<NEW_LINE>map.put("connector", "hive");<NEW_LINE>map.put("default-database", database);<NEW_LINE>if (null != hiveVersion) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (null != hadoopConfDir) {<NEW_LINE>map.put("hadoop-conf-dir", hadoopConfDir);<NEW_LINE>}<NEW_LINE>if (null != hiveConfDir) {<NEW_LINE>map.put("hive-conf-dir", hiveConfDir);<NEW_LINE>}<NEW_LINE>if (null != partitionFields) {<NEW_LINE>Map<String, String> properties = super.getProperties();<NEW_LINE>if (null == properties || !properties.containsKey(trigger)) {<NEW_LINE>map.put(trigger, "process-time");<NEW_LINE>}<NEW_LINE>if (null == properties || !properties.containsKey(timestampPattern)) {<NEW_LINE>map.put(timestampPattern, "yyyy-MM-dd");<NEW_LINE>}<NEW_LINE>if (null == properties || !properties.containsKey(delay)) {<NEW_LINE>map.put(delay, "10s");<NEW_LINE>}<NEW_LINE>if (null == properties || !properties.containsKey(policyKind)) {<NEW_LINE>map.put(policyKind, "metastore,success-file");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>} | map.put("hive-version", hiveVersion); |
870,907 | public void testRxFlowableInvoker_postReceiveTimeout(Map<String, String> param, StringBuilder ret) {<NEW_LINE>long timeout = messageTimeout;<NEW_LINE>if (isZOS()) {<NEW_LINE>timeout = zTimeout;<NEW_LINE>}<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder();<NEW_LINE>// cb.property("com.ibm.ws.jaxrs.client.receive.timeout", TIMEOUT);<NEW_LINE>cb.readTimeout(TIMEOUT, TimeUnit.MILLISECONDS);<NEW_LINE>Client c = cb.build();<NEW_LINE>c.register(RxFlowableInvokerProvider.class);<NEW_LINE>WebTarget t = c.target("http://" + serverIP + ":" + serverPort + "/jaxrs21bookstore/JAXRS21bookstore2/post/" + SLEEP);<NEW_LINE>Builder builder = t.request();<NEW_LINE>Flowable<Response> flowable = builder.rx(RxFlowableInvoker.class).post(Entity.xml(Long.toString(SLEEP)));<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>final Holder<Response> holder = new Holder<Response>();<NEW_LINE>final CountDownLatch countDownLatch = new CountDownLatch(1);<NEW_LINE>flowable.subscribe(v -> {<NEW_LINE>// OnNext<NEW_LINE>holder.value = v;<NEW_LINE>}, throwable -> {<NEW_LINE>if (throwable.getMessage().contains("SocketTimeoutException")) {<NEW_LINE>// OnError<NEW_LINE>ret.append("Timeout as expected");<NEW_LINE>} else {<NEW_LINE>ret.append("throwable");<NEW_LINE>throwable.printStackTrace();<NEW_LINE>}<NEW_LINE>countDownLatch.countDown();<NEW_LINE>}, // OnCompleted<NEW_LINE>() -> ret.append("OnCompleted"));<NEW_LINE>try {<NEW_LINE>if (!(countDownLatch.await(timeout, TimeUnit.SECONDS))) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>long elapsed = System.currentTimeMillis() - startTime;<NEW_LINE>System.out.println("testRxFlowableInvoker_postReceiveTimeout with TIMEOUT " + TIMEOUT + " OnError elapsed time " + elapsed);<NEW_LINE>c.close();<NEW_LINE>} | throw new RuntimeException("testRxFlowableInvoker_postReceiveTimeout: Response took too long. Waited " + timeout); |
161,454 | private Mono<Response<Flux<ByteBuffer>>> purgeWithResponseAsync(String location, String resourceGroupName, String accountName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (location == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (accountName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.purge(this.client.getEndpoint(), location, resourceGroupName, accountName, this.client.getApiVersion(), this.client.<MASK><NEW_LINE>} | getSubscriptionId(), accept, context); |
146,455 | public okhttp3.Call readNamespacedHorizontalPodAutoscalerStatusCall(String name, String namespace, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())).replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new <MASK><NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | HashMap<String, String>(); |
518,572 | private static Request prepareReindexRequest(ReindexRequest reindexRequest, boolean waitForCompletion) throws IOException {<NEW_LINE>String endpoint = new EndpointBuilder().addPathPart("_reindex").build();<NEW_LINE>Request request = new Request(HttpPost.METHOD_NAME, endpoint);<NEW_LINE>Params params = new Params().withWaitForCompletion(waitForCompletion).withRefresh(reindexRequest.isRefresh()).withTimeout(reindexRequest.getTimeout()).withWaitForActiveShards(reindexRequest.getWaitForActiveShards()).withRequestsPerSecond(reindexRequest.getRequestsPerSecond()).withSlices(reindexRequest.getSlices()).withRequireAlias(reindexRequest.<MASK><NEW_LINE>if (reindexRequest.getScrollTime() != null) {<NEW_LINE>params.putParam("scroll", reindexRequest.getScrollTime());<NEW_LINE>}<NEW_LINE>request.addParameters(params.asMap());<NEW_LINE>request.setEntity(createEntity(reindexRequest, REQUEST_BODY_CONTENT_TYPE));<NEW_LINE>return request;<NEW_LINE>} | getDestination().isRequireAlias()); |
302,600 | private static void computeAnnotations(File repository, File file, HgProgressSupport progress, AnnotationBar ab, String revision) {<NEW_LINE>List<String> list = null;<NEW_LINE>try {<NEW_LINE>list = HgCommand.doAnnotate(repository, file, revision, progress.getLogger());<NEW_LINE>} catch (HgException.HgCommandCanceledException ex) {<NEW_LINE>// canceled by user, do nothing<NEW_LINE>} catch (HgException ex) {<NEW_LINE>HgUtils.notifyException(ex);<NEW_LINE>}<NEW_LINE>if (progress.isCanceled()) {<NEW_LINE>// NOI18N;<NEW_LINE>ab.setAnnotationMessage(NbBundle.getMessage(AnnotateAction.class, "CTL_AnnotationFailed"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (list == null) {<NEW_LINE>// NOI18N;<NEW_LINE>ab.setAnnotationMessage(NbBundle.getMessage(AnnotateAction.class, "CTL_AnnotationFailed"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AnnotateLine[] lines = toAnnotateLines(list);<NEW_LINE>List<String> revisions = getRevisionNumbers(lines);<NEW_LINE>HgLogMessage initialRevision = null;<NEW_LINE>HgLogMessage[<MASK><NEW_LINE>if (!revisions.isEmpty()) {<NEW_LINE>logs = HgCommand.getLogMessages(repository, Collections.singleton(file), revisions.get(0), "0", true, false, false, 1, Collections.<String>emptyList(), OutputLogger.getLogger(null), true);<NEW_LINE>if (logs.length == 1) {<NEW_LINE>initialRevision = logs[0];<NEW_LINE>}<NEW_LINE>logs = HgCommand.getRevisionInfo(repository, revisions, progress.getLogger());<NEW_LINE>if (logs.length != revisions.size()) {<NEW_LINE>Logger.getLogger(AnnotateAction.class.getName()).log(Level.WARNING, "Missing some of the requested revisions: {0}", revisions);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (progress.isCanceled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (logs == null)<NEW_LINE>return;<NEW_LINE>fillCommitMessages(lines, logs, initialRevision);<NEW_LINE>ab.setAnnotatedRevision(revision);<NEW_LINE>ab.annotationLines(file, Arrays.asList(lines));<NEW_LINE>} | ] logs = new HgLogMessage[0]; |
320,986 | private static void defineConstructor(final Window window, final Scriptable prototype, final ScriptableObject constructor) {<NEW_LINE>constructor.setParentScope(window);<NEW_LINE>try {<NEW_LINE>ScriptableObject.defineProperty(prototype, "constructor", constructor, ScriptableObject.DONTENUM | ScriptableObject.PERMANENT | ScriptableObject.READONLY);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>// TODO see issue #1897<NEW_LINE>if (LOG.isWarnEnabled()) {<NEW_LINE>final String newline = System.lineSeparator();<NEW_LINE>LOG.warn("Error during JavaScriptEngine.init(WebWindow, Context)" + newline + e.getMessage() + newline + "prototype: " + prototype.getClassName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ScriptableObject.defineProperty(constructor, "prototype", prototype, ScriptableObject.DONTENUM | ScriptableObject.PERMANENT | ScriptableObject.READONLY);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>// TODO see issue #1897<NEW_LINE>if (LOG.isWarnEnabled()) {<NEW_LINE>final String newline = System.lineSeparator();<NEW_LINE>LOG.warn("Error during JavaScriptEngine.init(WebWindow, Context)" + newline + e.getMessage() + newline + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>window.defineProperty(constructor.getClassName(), constructor, ScriptableObject.DONTENUM);<NEW_LINE>} | "prototype: " + prototype.getClassName()); |
1,202,272 | /* Sample generated code:<NEW_LINE>*<NEW_LINE>* @com.ibm.j9ddr.GeneratedFieldAccessor(offsetFieldName="_fifteenMinuteAverageOffset_", declaredType="double")<NEW_LINE>* public double fifteenMinuteAverage() throws CorruptDataException {<NEW_LINE>* return getDoubleAtOffset(J9PortSysInfoLoadData._fifteenMinuteAverageOffset_);<NEW_LINE>* }<NEW_LINE>*/<NEW_LINE>private void doDoubleMethod(FieldDescriptor field) {<NEW_LINE>MethodVisitor method = beginAnnotatedMethod(field, <MASK><NEW_LINE>method.visitCode();<NEW_LINE>if (checkPresent(field, method)) {<NEW_LINE>method.visitVarInsn(ALOAD, 0);<NEW_LINE>loadLong(method, field.getOffset());<NEW_LINE>method.visitMethodInsn(INVOKEVIRTUAL, className, "getDoubleAtOffset", doubleFromLong, false);<NEW_LINE>method.visitInsn(DRETURN);<NEW_LINE>}<NEW_LINE>method.visitMaxs(3, 1);<NEW_LINE>method.visitEnd();<NEW_LINE>doEAMethod("Double", field);<NEW_LINE>} | field.getName(), doubleFromVoid); |
653,219 | public void declareRelation(final String name, final int keysize, final int payloadsize) throws SpaceExceededException {<NEW_LINE>// try to get the relation from the relation-cache<NEW_LINE>final Index relation = this.relations.get(name);<NEW_LINE>if (relation != null)<NEW_LINE>return;<NEW_LINE>// try to find the relation as stored on file<NEW_LINE>final String[] list = this.baseDir.list();<NEW_LINE>final String targetfilename = filename(name, keysize, payloadsize);<NEW_LINE>for (int i = 0; i < list.length; i++) {<NEW_LINE>if (list[i].startsWith(name)) {<NEW_LINE>if (!list[i].equals(targetfilename))<NEW_LINE>continue;<NEW_LINE>final Row row = rowdef(list[i]);<NEW_LINE>// a wrong table<NEW_LINE>if (row.primaryKeyLength != keysize || row.column(1).cellwidth != payloadsize)<NEW_LINE>continue;<NEW_LINE>Index table;<NEW_LINE>try {<NEW_LINE>table = new Table(new File(this.baseDir, list[i]), row, 1024 * 1024, 0, this.useTailCache, this.exceed134217727, true);<NEW_LINE>} catch (final SpaceExceededException e) {<NEW_LINE>table = new Table(new File(this.baseDir, list[i]), row, 0, 0, false, this.exceed134217727, true);<NEW_LINE>}<NEW_LINE>this.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// the relation does not exist, create it<NEW_LINE>final Row row = rowdef(keysize, payloadsize);<NEW_LINE>Index table;<NEW_LINE>try {<NEW_LINE>table = new Table(new File(this.baseDir, targetfilename), row, 1024 * 1024, 0, this.useTailCache, this.exceed134217727, true);<NEW_LINE>} catch (final SpaceExceededException e) {<NEW_LINE>table = new Table(new File(this.baseDir, targetfilename), row, 0, 0, false, this.exceed134217727, true);<NEW_LINE>}<NEW_LINE>this.relations.put(name, table);<NEW_LINE>} | relations.put(name, table); |
1,503,636 | public void run() {<NEW_LINE><MASK><NEW_LINE>final StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("%n------------------------------------------------------------%nGradle ");<NEW_LINE>sb.append(currentVersion.getVersion());<NEW_LINE>sb.append("%n------------------------------------------------------------%n%nBuild time: ");<NEW_LINE>sb.append(currentVersion.getBuildTimestamp());<NEW_LINE>sb.append("%nRevision: ");<NEW_LINE>sb.append(currentVersion.getGitRevision());<NEW_LINE>sb.append("%n%nKotlin: ");<NEW_LINE>sb.append(KotlinDslVersion.current().getKotlinVersion());<NEW_LINE>sb.append("%nGroovy: ");<NEW_LINE>sb.append(ReleaseInfo.getVersion());<NEW_LINE>sb.append("%nAnt: ");<NEW_LINE>sb.append(Main.getAntVersion());<NEW_LINE>sb.append("%nJVM: ");<NEW_LINE>sb.append(Jvm.current());<NEW_LINE>sb.append("%nOS: ");<NEW_LINE>sb.append(OperatingSystem.current());<NEW_LINE>sb.append("%n");<NEW_LINE>System.out.println(String.format(sb.toString()));<NEW_LINE>} | DefaultGradleVersion currentVersion = DefaultGradleVersion.current(); |
797,633 | public void reset(final BaseActivity activity, final RedditCommentListItem comment, final boolean updateOnly) {<NEW_LINE>if (!updateOnly) {<NEW_LINE>if (!comment.isComment()) {<NEW_LINE>throw new RuntimeException("Not a comment");<NEW_LINE>}<NEW_LINE>if (mComment != comment) {<NEW_LINE>if (mComment != null) {<NEW_LINE>mChangeDataManager.removeListener(mComment.asComment(), this);<NEW_LINE>}<NEW_LINE>mChangeDataManager.addListener(comment.asComment(), this);<NEW_LINE>}<NEW_LINE>mComment = comment;<NEW_LINE>resetSwipeState();<NEW_LINE>}<NEW_LINE>mIndentView.<MASK><NEW_LINE>final boolean hideLinkButtons = comment.asComment().getParsedComment().getRawComment().author.equalsIgnoreCase("autowikibot");<NEW_LINE>mBodyHolder.removeAllViews();<NEW_LINE>final View commentBody = comment.asComment().getBody(activity, mTheme.rrCommentBodyCol, 13.0f * mBodyFontScale, mShowLinkButtons && !hideLinkButtons);<NEW_LINE>mBodyHolder.addView(commentBody);<NEW_LINE>General.setLayoutMatchWidthWrapHeight(commentBody);<NEW_LINE>((MarginLayoutParams) commentBody.getLayoutParams()).topMargin = General.dpToPixels(activity, 1);<NEW_LINE>final RedditRenderableComment renderableComment = mComment.asComment();<NEW_LINE>final int ageUnits = PrefsUtility.appearance_comment_age_units();<NEW_LINE>final long postTimestamp = (mFragment != null && mFragment.getPost() != null) ? mFragment.getPost().src.getCreatedTimeSecsUTC() : RedditRenderableComment.NO_TIMESTAMP;<NEW_LINE>final long parentCommentTimestamp = mComment.getParent() != null ? mComment.getParent().asComment().getParsedComment().getRawComment().created_utc : RedditRenderableComment.NO_TIMESTAMP;<NEW_LINE>final boolean isCollapsed = mComment.isCollapsed(mChangeDataManager);<NEW_LINE>final CharSequence headerText = renderableComment.getHeader(mTheme, mChangeDataManager, activity, ageUnits, postTimestamp, parentCommentTimestamp);<NEW_LINE>mHeader.setContentDescription(renderableComment.getAccessibilityHeader(mTheme, mChangeDataManager, activity, ageUnits, postTimestamp, parentCommentTimestamp, isCollapsed, Optional.of(comment.getIndent())));<NEW_LINE>if (isCollapsed) {<NEW_LINE>setFlingingEnabled(false);<NEW_LINE>// noinspection SetTextI18n<NEW_LINE>mHeader.setText(// Note that this removes formatting (which is fine)<NEW_LINE>"[ + ] " + headerText);<NEW_LINE>mBodyHolder.setVisibility(GONE);<NEW_LINE>} else {<NEW_LINE>setFlingingEnabled(true);<NEW_LINE>mHeader.setText(headerText);<NEW_LINE>mBodyHolder.setVisibility(VISIBLE);<NEW_LINE>}<NEW_LINE>} | setIndentation(comment.getIndent()); |
1,258,854 | public static ListAccelerateAreasResponse unmarshall(ListAccelerateAreasResponse listAccelerateAreasResponse, UnmarshallerContext _ctx) {<NEW_LINE>listAccelerateAreasResponse.setRequestId(_ctx.stringValue("ListAccelerateAreasResponse.RequestId"));<NEW_LINE>List<AreasItem> areas = new ArrayList<AreasItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListAccelerateAreasResponse.Areas.Length"); i++) {<NEW_LINE>AreasItem areasItem = new AreasItem();<NEW_LINE>areasItem.setAreaId(_ctx.stringValue("ListAccelerateAreasResponse.Areas[" + i + "].AreaId"));<NEW_LINE>areasItem.setLocalName(_ctx.stringValue("ListAccelerateAreasResponse.Areas[" + i + "].LocalName"));<NEW_LINE>List<RegionListItem> regionList = new ArrayList<RegionListItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListAccelerateAreasResponse.Areas[" + i + "].RegionList.Length"); j++) {<NEW_LINE>RegionListItem regionListItem = new RegionListItem();<NEW_LINE>regionListItem.setRegionId(_ctx.stringValue("ListAccelerateAreasResponse.Areas[" + i <MASK><NEW_LINE>regionListItem.setLocalName(_ctx.stringValue("ListAccelerateAreasResponse.Areas[" + i + "].RegionList[" + j + "].LocalName"));<NEW_LINE>regionList.add(regionListItem);<NEW_LINE>}<NEW_LINE>areasItem.setRegionList(regionList);<NEW_LINE>areas.add(areasItem);<NEW_LINE>}<NEW_LINE>listAccelerateAreasResponse.setAreas(areas);<NEW_LINE>return listAccelerateAreasResponse;<NEW_LINE>} | + "].RegionList[" + j + "].RegionId")); |
1,319,932 | protected void installDefaults() {<NEW_LINE>super.installDefaults();<NEW_LINE>LookAndFeel.installProperty(comboBox, "opaque", false);<NEW_LINE>minimumWidth = UIManager.getInt("ComboBox.minimumWidth");<NEW_LINE>editorColumns = UIManager.getInt("ComboBox.editorColumns");<NEW_LINE>buttonStyle = UIManager.getString("ComboBox.buttonStyle");<NEW_LINE>arrowType = UIManager.getString("Component.arrowType");<NEW_LINE><MASK><NEW_LINE>editableBackground = UIManager.getColor("ComboBox.editableBackground");<NEW_LINE>focusedBackground = UIManager.getColor("ComboBox.focusedBackground");<NEW_LINE>disabledBackground = UIManager.getColor("ComboBox.disabledBackground");<NEW_LINE>disabledForeground = UIManager.getColor("ComboBox.disabledForeground");<NEW_LINE>buttonBackground = UIManager.getColor("ComboBox.buttonBackground");<NEW_LINE>buttonFocusedBackground = UIManager.getColor("ComboBox.buttonFocusedBackground");<NEW_LINE>buttonEditableBackground = UIManager.getColor("ComboBox.buttonEditableBackground");<NEW_LINE>buttonSeparatorWidth = FlatUIUtils.getUIFloat("ComboBox.buttonSeparatorWidth", FlatUIUtils.getUIFloat("Component.borderWidth", 1));<NEW_LINE>buttonSeparatorColor = UIManager.getColor("ComboBox.buttonSeparatorColor");<NEW_LINE>buttonDisabledSeparatorColor = UIManager.getColor("ComboBox.buttonDisabledSeparatorColor");<NEW_LINE>buttonArrowColor = UIManager.getColor("ComboBox.buttonArrowColor");<NEW_LINE>buttonDisabledArrowColor = UIManager.getColor("ComboBox.buttonDisabledArrowColor");<NEW_LINE>buttonHoverArrowColor = UIManager.getColor("ComboBox.buttonHoverArrowColor");<NEW_LINE>buttonPressedArrowColor = UIManager.getColor("ComboBox.buttonPressedArrowColor");<NEW_LINE>popupBackground = UIManager.getColor("ComboBox.popupBackground");<NEW_LINE>// set maximumRowCount<NEW_LINE>int maximumRowCount = UIManager.getInt("ComboBox.maximumRowCount");<NEW_LINE>if (maximumRowCount > 0 && maximumRowCount != 8 && comboBox.getMaximumRowCount() == 8)<NEW_LINE>comboBox.setMaximumRowCount(maximumRowCount);<NEW_LINE>paddingBorder = new CellPaddingBorder(padding);<NEW_LINE>MigLayoutVisualPadding.install(comboBox);<NEW_LINE>} | isIntelliJTheme = UIManager.getBoolean("Component.isIntelliJTheme"); |
334,079 | public io.kubernetes.client.proto.V1beta1Extensions.FSGroupStrategyOptions buildPartial() {<NEW_LINE>io.kubernetes.client.proto.V1beta1Extensions.FSGroupStrategyOptions result = new io.kubernetes.client.<MASK><NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.rule_ = rule_;<NEW_LINE>if (rangesBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>ranges_ = java.util.Collections.unmodifiableList(ranges_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>}<NEW_LINE>result.ranges_ = ranges_;<NEW_LINE>} else {<NEW_LINE>result.ranges_ = rangesBuilder_.build();<NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>} | proto.V1beta1Extensions.FSGroupStrategyOptions(this); |
340,780 | protected Panel<WizardDescriptor>[] initializePanels() {<NEW_LINE>selectUriStep = new SelectUriStep(repository, remotes, SelectUriStep.Mode.FETCH);<NEW_LINE>selectUriStep.addChangeListener(FetchWizard.this);<NEW_LINE>fetchBranchesStep = new FetchBranchesStep(repository, FetchBranchesStep.Mode.ACCEPT_NON_EMPTY_SELECTION_ONLY);<NEW_LINE>fetchBranchesStep.addChangeListener(FetchWizard.this);<NEW_LINE>Panel[] panels = new <MASK><NEW_LINE>String[] steps = new String[panels.length];<NEW_LINE>for (int i = 0; i < panels.length; i++) {<NEW_LINE>Component c = panels[i].getComponent();<NEW_LINE>// Default step name to component name of panel. Mainly useful<NEW_LINE>// for getting the name of the target chooser to appear in the<NEW_LINE>// list of steps.<NEW_LINE>steps[i] = c.getName();<NEW_LINE>if (c instanceof JComponent) {<NEW_LINE>// assume Swing components<NEW_LINE>JComponent jc = (JComponent) c;<NEW_LINE>// Sets step number of a component<NEW_LINE>// NOI18N<NEW_LINE>jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, Integer.valueOf(i));<NEW_LINE>// Sets steps names for a panel<NEW_LINE>// NOI18N<NEW_LINE>jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps);<NEW_LINE>// Turn on subtitle creation on each step<NEW_LINE>// NOI18N<NEW_LINE>jc.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, Boolean.TRUE);<NEW_LINE>// Show steps on the left side with the image on the background<NEW_LINE>// NOI18N<NEW_LINE>jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, Boolean.TRUE);<NEW_LINE>// Turn on numbering of all steps<NEW_LINE>// NOI18N<NEW_LINE>jc.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, Boolean.TRUE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return panels;<NEW_LINE>} | Panel[] { selectUriStep, fetchBranchesStep }; |
896,976 | private static void parseArgs(final Map<String, ? super String> context, final String args) throws UnsupportedEncodingException {<NEW_LINE>if (args != null) {<NEW_LINE>for (String arg : args.substring(1).split("&")) {<NEW_LINE>String[] valueAndKey = arg.split("=");<NEW_LINE>if (valueAndKey.length != 2) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String key = URLDecoder.decode(valueAndKey[1], "US-ASCII");<NEW_LINE>for (int idx = 0; ; ) {<NEW_LINE>idx = key.indexOf("%", idx);<NEW_LINE>if (idx == -1) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>int ch = Integer.parseInt(key.substring(idx + 1, idx + 3), 16);<NEW_LINE>key = key.substring(0, idx) + (char) ch + <MASK><NEW_LINE>idx++;<NEW_LINE>}<NEW_LINE>context.put(valueAndKey[0], key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | key.substring(idx + 3); |
1,736,721 | boolean attach(Leaf leaf, Leaf at) {<NEW_LINE>Leaf attach = this;<NEW_LINE>int myIndex = (parent.parent == null) ? 0 : exactIndex(parent.parent.leaf.newStructure, this);<NEW_LINE>int atIndex = (at == this) ? 0 : exactIndex(newStructure, at) + 1;<NEW_LINE>while (leaf.oper != Oper.DELETE && attach.oper == Oper.DELETE && myIndex > 0) {<NEW_LINE>myIndex--;<NEW_LINE>attach = parent.parent.leaf.newStructure.get(myIndex);<NEW_LINE>atIndex <MASK><NEW_LINE>}<NEW_LINE>if (leaf.parent.parentHashCode == attach.parent.hashCode) {<NEW_LINE>// direct attachment<NEW_LINE>if (leaf.oper != Oper.DELETE && attach.oper == Oper.DELETE) {<NEW_LINE>return attach.parent.parent.leaf.attach(leaf, this);<NEW_LINE>}<NEW_LINE>if (leaf.oper == null && (leaf.val.isJsonPrimitive() || leaf.val.isJsonNull())) {<NEW_LINE>leaf.oper = Oper.SET;<NEW_LINE>}<NEW_LINE>attach.newStructure.add(atIndex, leaf);<NEW_LINE>leaf.rehash(attach);<NEW_LINE>if (JsonDiff.LOG.isLoggable(Level.FINE))<NEW_LINE>JsonDiff.LOG.info("ATT " + leaf + " @" + this);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (parent.parent == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return parent.parent.leaf.attach(leaf, this);<NEW_LINE>} | = attach.newStructure.size(); |
781,441 | private Mono<PagedResponse<ServerCommunicationLinkInner>> listByServerSinglePageAsync(String resourceGroupName, String serverName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (serverName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2014-04-01";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listByServer(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, serverName, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value<MASK><NEW_LINE>} | (), null, null)); |
613,555 | private void calculateConsumerFilterTime() {<NEW_LINE>// R3: Record consumer filter execution time<NEW_LINE>Long filterStartTime = (Long) RpcInvokeContext.getContext().get(RpcConstants.INTERNAL_KEY_CONSUMER_FILTER_START_TIME_NANO);<NEW_LINE>Long filterEndTime = (Long) RpcInvokeContext.getContext().get(RpcConstants.INTERNAL_KEY_CONSUMER_FILTER_END_TIME_NANO);<NEW_LINE>Long invokerStartTime = (Long) RpcInvokeContext.getContext(<MASK><NEW_LINE>Long invokerEndTime = (Long) RpcInvokeContext.getContext().get(RpcConstants.INTERNAL_KEY_CONSUMER_INVOKE_END_TIME_NANO);<NEW_LINE>if (filterStartTime != null && filterEndTime != null && invokerStartTime != null && invokerEndTime != null) {<NEW_LINE>RpcInvokeContext.getContext().put(RpcConstants.INTERNAL_KEY_CLIENT_FILTER_TIME_NANO, filterEndTime - filterStartTime - (invokerEndTime - invokerStartTime));<NEW_LINE>}<NEW_LINE>} | ).get(RpcConstants.INTERNAL_KEY_CONSUMER_INVOKE_START_TIME_NANO); |
1,604,558 | private static ImmutableMap<AdWindowId, CustomizedWindowInfo> computeEffectiveCustomizedWindowInfos(@NonNull final List<CustomizedWindowInfo> list) {<NEW_LINE>final ImmutableMap<AdWindowId, CustomizedWindowInfo> customizedWindowsByCustomizedWindowId = Maps.uniqueIndex(list, CustomizedWindowInfo::getCustomizationWindowId);<NEW_LINE>//<NEW_LINE>// Create the groups<NEW_LINE>final ArrayList<ArrayList<AdWindowId>> groups = new ArrayList<>();<NEW_LINE>for (final CustomizedWindowInfo link : list) {<NEW_LINE>boolean linkMerged = false;<NEW_LINE>for (final ArrayList<AdWindowId> group : groups) {<NEW_LINE>if (mergeLinkToGroup(link, group)) {<NEW_LINE>linkMerged = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!linkMerged) {<NEW_LINE>final ArrayList<AdWindowId> newGroup = new ArrayList<>();<NEW_LINE>mergeLinkToGroup(link, newGroup);<NEW_LINE>groups.add(newGroup);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Merge groups<NEW_LINE>boolean someMergesWerePerformed;<NEW_LINE>do {<NEW_LINE>someMergesWerePerformed = false;<NEW_LINE>for (int i = 0; i < groups.size(); i++) {<NEW_LINE>final ArrayList<AdWindowId> groupToMerge = groups.get(i);<NEW_LINE>if (groupToMerge.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (int j = i + 1; j < groups.size(); j++) {<NEW_LINE>final ArrayList<AdWindowId> targetGroup = groups.get(j);<NEW_LINE>if (targetGroup.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (mergeGroups(targetGroup, groupToMerge)) {<NEW_LINE>someMergesWerePerformed = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} while (someMergesWerePerformed);<NEW_LINE>//<NEW_LINE>// Remove empty groups<NEW_LINE>groups.removeIf(ArrayList::isEmpty);<NEW_LINE>//<NEW_LINE>// Create result<NEW_LINE>final ImmutableMap.Builder<AdWindowId, CustomizedWindowInfo> result = ImmutableMap.builder();<NEW_LINE>for (final ArrayList<AdWindowId> group : groups) {<NEW_LINE>final int groupSize = group.size();<NEW_LINE>final AdWindowId baseWindowId = group.get(0);<NEW_LINE>final AdWindowId customizationWindowId = <MASK><NEW_LINE>final ImmutableList<AdWindowId> previousCustomizationWindowIds = groupSize > 2 ? ImmutableList.copyOf(group.subList(1, groupSize - 1)) : ImmutableList.of();<NEW_LINE>final CustomizedWindowInfo initialCustomizedWindowInfo = customizedWindowsByCustomizedWindowId.get(customizationWindowId);<NEW_LINE>final CustomizedWindowInfo customizedWindowInfo = initialCustomizedWindowInfo.toBuilder().previousCustomizationWindowIds(previousCustomizationWindowIds).baseWindowId(baseWindowId).build();<NEW_LINE>result.put(baseWindowId, customizedWindowInfo);<NEW_LINE>result.put(customizationWindowId, customizedWindowInfo);<NEW_LINE>previousCustomizationWindowIds.forEach(previousCustomizationWindowId -> result.put(previousCustomizationWindowId, customizedWindowInfo));<NEW_LINE>}<NEW_LINE>return result.build();<NEW_LINE>} | group.get(groupSize - 1); |
557,792 | public void postPreDeleteEvent(final QualifiedName name, final MetacatRequestContext metacatRequestContext) {<NEW_LINE>if (name.isPartitionDefinition()) {<NEW_LINE>final PartitionsSaveRequestDto partitionsSaveRequestDto = new PartitionsSaveRequestDto();<NEW_LINE>partitionsSaveRequestDto.setPartitionIdsForDeletes(Lists.newArrayList<MASK><NEW_LINE>this.eventBus.post(new MetacatDeleteTablePartitionPreEvent(name, metacatRequestContext, this, partitionsSaveRequestDto));<NEW_LINE>} else if (name.isViewDefinition()) {<NEW_LINE>this.eventBus.post(new MetacatDeleteMViewPreEvent(name, metacatRequestContext, this));<NEW_LINE>} else if (name.isTableDefinition()) {<NEW_LINE>this.eventBus.post(new MetacatDeleteTablePreEvent(name, metacatRequestContext, this));<NEW_LINE>} else if (name.isDatabaseDefinition()) {<NEW_LINE>final DatabaseDto dto = new DatabaseDto();<NEW_LINE>dto.setName(name);<NEW_LINE>eventBus.post(new MetacatDeleteDatabasePreEvent(name, metacatRequestContext, this, dto));<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException(String.format("Invalid name %s", name));<NEW_LINE>}<NEW_LINE>} | (name.getPartitionName())); |
1,831,153 | public void markupAsInsertion(org.docx4j.wml.SdtContentBlock cbLeft, javax.xml.transform.Result result, String author, java.util.Calendar date, RelationshipsPart docPartRelsLeft) {<NEW_LINE>Writer diffxResult = new StringWriter();<NEW_LINE>try {<NEW_LINE>// Now marshall it<NEW_LINE>JAXBContext jc = Context.jc;<NEW_LINE>Marshaller marshaller = jc.createMarshaller();<NEW_LINE>org.w3c.dom.Document doc = org.docx4j.XmlUtils.neww3cDomDocument();<NEW_LINE>marshaller.marshal(cbLeft, doc);<NEW_LINE>Map<String, Object> transformParameters = new java.util.HashMap<String, Object>();<NEW_LINE>if (date != null) {<NEW_LINE>String dateString = RFC3339_FORMAT.format(date.getTime());<NEW_LINE>transformParameters.put("date", dateString);<NEW_LINE>}<NEW_LINE>transformParameters.put("Differencer", this);<NEW_LINE>transformParameters.put("author", author);<NEW_LINE>transformParameters.put("docPartRelsLeft", docPartRelsLeft);<NEW_LINE>transformParameters.put("docPartRelsRight", null);<NEW_LINE><MASK><NEW_LINE>XmlUtils.transform(doc, xsltMarkupInsert, transformParameters, result);<NEW_LINE>} catch (Exception exc) {<NEW_LINE>exc.printStackTrace();<NEW_LINE>}<NEW_LINE>} | transformParameters.put("relsDiffIdentifier", relsDiffIdentifier); |
1,286,230 | private void initFieldsToRead(boolean[] orcReaderInclude, TypeDescription fieldType, String field) {<NEW_LINE>int fieldId = fieldType.getId();<NEW_LINE>// Include ID for top level field<NEW_LINE>orcReaderInclude[fieldId] = true;<NEW_LINE>TypeDescription.Category category = fieldType.getCategory();<NEW_LINE>if (category == TypeDescription.Category.LIST) {<NEW_LINE>// Lists always have a single child column for its elements<NEW_LINE>TypeDescription childFieldType = fieldType.getChildren().get(0);<NEW_LINE>initFieldsToRead(orcReaderInclude, childFieldType, field);<NEW_LINE>} else if (category == TypeDescription.Category.MAP) {<NEW_LINE>// include ID for the map's keys<NEW_LINE>orcReaderInclude[fieldId + 1] = true;<NEW_LINE>// Maps always have two child columns for its keys and values<NEW_LINE>List<TypeDescription> children = fieldType.getChildren();<NEW_LINE>TypeDescription.Category keyCategory = children.get(0).getCategory();<NEW_LINE>Preconditions.checkState(isSupportedSingleValueType(keyCategory), "Illegal map key field type: %s (field %s)", keyCategory, field);<NEW_LINE>initFieldsToRead(orcReaderInclude, children.get(1), field);<NEW_LINE>} else if (category == TypeDescription.Category.STRUCT) {<NEW_LINE>List<String<MASK><NEW_LINE>List<TypeDescription> childrenFieldTypes = fieldType.getChildren();<NEW_LINE>// Struct columns have one child column for each field of the struct<NEW_LINE>for (int i = 0; i < childrenFieldNames.size(); i++) {<NEW_LINE>initFieldsToRead(orcReaderInclude, childrenFieldTypes.get(i), childrenFieldNames.get(i));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Single-value field<NEW_LINE>Preconditions.checkState(isSupportedSingleValueType(category), "Illegal single-value field type: %s (field %s)", category, field);<NEW_LINE>}<NEW_LINE>} | > childrenFieldNames = fieldType.getFieldNames(); |
994,093 | public com.amazonaws.services.elastictranscoder.model.ResourceInUseException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.elastictranscoder.model.ResourceInUseException resourceInUseException = new com.amazonaws.services.elastictranscoder.model.ResourceInUseException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><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>} 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 resourceInUseException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,327,408 | public Request<StartMetricStreamsRequest> marshall(StartMetricStreamsRequest startMetricStreamsRequest) {<NEW_LINE>if (startMetricStreamsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<StartMetricStreamsRequest> request = new DefaultRequest<MASK><NEW_LINE>request.addParameter("Action", "StartMetricStreams");<NEW_LINE>request.addParameter("Version", "2010-08-01");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (!startMetricStreamsRequest.getNames().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) startMetricStreamsRequest.getNames()).isAutoConstruct()) {<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> namesList = (com.amazonaws.internal.SdkInternalList<String>) startMetricStreamsRequest.getNames();<NEW_LINE>int namesListIndex = 1;<NEW_LINE>for (String namesListValue : namesList) {<NEW_LINE>if (namesListValue != null) {<NEW_LINE>request.addParameter("Names.member." + namesListIndex, StringUtils.fromString(namesListValue));<NEW_LINE>}<NEW_LINE>namesListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | <StartMetricStreamsRequest>(startMetricStreamsRequest, "AmazonCloudWatch"); |
1,156,675 | public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {<NEW_LINE>com.google.protobuf.GeneratedMessageV3.ExtendableMessage<com.google.transit.realtime.GtfsRealtime.TripUpdate>.ExtensionWriter extensionWriter = newExtensionWriter();<NEW_LINE>if (((bitField0_ & 0x00000001) != 0)) {<NEW_LINE>output.writeMessage(1, getTrip());<NEW_LINE>}<NEW_LINE>for (StopTimeUpdate stopTimeUpdate : stopTimeUpdate_) {<NEW_LINE>output.writeMessage(2, stopTimeUpdate);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000002) != 0)) {<NEW_LINE>output.writeMessage(3, getVehicle());<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000004) != 0)) {<NEW_LINE>output.writeUInt64(4, timestamp_);<NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000008) != 0)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (((bitField0_ & 0x00000010) != 0)) {<NEW_LINE>output.writeMessage(6, getTripProperties());<NEW_LINE>}<NEW_LINE>extensionWriter.writeUntil(2000, output);<NEW_LINE>extensionWriter.writeUntil(10000, output);<NEW_LINE>unknownFields.writeTo(output);<NEW_LINE>} | output.writeInt32(5, delay_); |
291,740 | public void run() {<NEW_LINE>// Guava Stopwatch is useful here, for a friendlier toString, but the versions of Guava<NEW_LINE>// are different in incompatible ways, so we avoid it here and use Duration instead, so<NEW_LINE>// there won't be conflicts.<NEW_LINE>long startTime;<NEW_LINE>Duration duration;<NEW_LINE>if (!ReplicationTable.isOnline(context)) {<NEW_LINE>log.debug("Replication table isn't online, not attempting to clean up wals");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HashSet<String> closed = null;<NEW_LINE>Span span = TraceUtil.startSpan(this.getClass(), "findReferencedWals");<NEW_LINE>try (Scope findWalsSpan = span.makeCurrent()) {<NEW_LINE>startTime = System.nanoTime();<NEW_LINE>closed = getClosedLogs();<NEW_LINE>duration = Duration.ofNanos(System.nanoTime() - startTime);<NEW_LINE>} finally {<NEW_LINE>span.end();<NEW_LINE>}<NEW_LINE>log.info("Found {} WALs referenced in metadata in {}", <MASK><NEW_LINE>long recordsClosed = 0;<NEW_LINE>Span updateReplicationSpan = TraceUtil.startSpan(this.getClass(), "updateReplicationTable");<NEW_LINE>try (Scope updateReplicationScope = updateReplicationSpan.makeCurrent()) {<NEW_LINE>startTime = System.nanoTime();<NEW_LINE>recordsClosed = updateReplicationEntries(context, closed);<NEW_LINE>duration = Duration.ofNanos(System.nanoTime() - startTime);<NEW_LINE>} finally {<NEW_LINE>updateReplicationSpan.end();<NEW_LINE>}<NEW_LINE>log.info("Closed {} WAL replication references in replication table in {}", recordsClosed, duration);<NEW_LINE>} | closed.size(), duration); |
31,614 | public JBPopup createPopup() {<NEW_LINE>AbstractPopup popup = new AbstractPopup().init(myProject, myComponent, myPreferredFocusedComponent, myRequestFocus, myFocusable, myMovable, myDimensionServiceKey, myResizable, myTitle, myCallback, myCancelOnClickOutside, myListeners, myUseDimServiceForXYLocation, myCommandButton, myCancelButton, myCancelOnMouseOutCallback, myCancelOnWindow, myTitleIcon, myCancelKeyEnabled, myLocateByContent, myPlaceWithinScreen, myMinSize, myAlpha, myMaskProvider, myInStack, myModalContext, myFocusOwners, myAd, myAdAlignment, false, myKeyboardActions, mySettingsButtons, myPinCallback, myMayBeParent, myShowShadow, myShowBorder, myBorderColor, myCancelOnWindowDeactivation, myKeyEventHandler);<NEW_LINE>popup.setNormalWindowLevel(myNormalWindowLevel);<NEW_LINE>popup.setOkHandler(myOkHandler);<NEW_LINE>if (myUserData != null) {<NEW_LINE>popup.setUserData(myUserData);<NEW_LINE>}<NEW_LINE>Disposer.register(<MASK><NEW_LINE>return popup;<NEW_LINE>} | ApplicationManager.getApplication(), popup); |
199,346 | private static // parses the row to a trade<NEW_LINE>FxNdfTrade parseRow(CsvRow row, TradeInfo info) {<NEW_LINE>CurrencyAmount settlementNotional;<NEW_LINE>Currency settlementCurrency;<NEW_LINE>Currency nonDeliverableCurrency;<NEW_LINE>Optional<String> leg1NotionalOpt = row.findValue(LEG_1_NOTIONAL_FIELD);<NEW_LINE>Optional<String> leg2NotionalOpt = row.findValue(LEG_2_NOTIONAL_FIELD);<NEW_LINE>if (leg1NotionalOpt.isPresent() && leg2NotionalOpt.isPresent()) {<NEW_LINE>throw new IllegalArgumentException("Notional found for both legs; only one leg can contain notional amount to determine settlement leg");<NEW_LINE>} else if (leg1NotionalOpt.isPresent()) {<NEW_LINE>settlementNotional = CsvLoaderUtils.parseCurrencyAmountWithDirection(row, LEG_1_CURRENCY_FIELD, LEG_1_NOTIONAL_FIELD, LEG_1_DIRECTION_FIELD);<NEW_LINE>settlementCurrency = row.getField(LEG_1_CURRENCY_FIELD, LoaderUtils::parseCurrency);<NEW_LINE>nonDeliverableCurrency = row.getField(LEG_2_CURRENCY_FIELD, LoaderUtils::parseCurrency);<NEW_LINE>} else if (row.findValue(LEG_2_NOTIONAL_FIELD).isPresent()) {<NEW_LINE>settlementNotional = CsvLoaderUtils.parseCurrencyAmountWithDirection(row, LEG_2_CURRENCY_FIELD, LEG_2_NOTIONAL_FIELD, LEG_2_DIRECTION_FIELD);<NEW_LINE>settlementCurrency = row.getField(LEG_2_CURRENCY_FIELD, LoaderUtils::parseCurrency);<NEW_LINE>nonDeliverableCurrency = row.getField(LEG_1_CURRENCY_FIELD, LoaderUtils::parseCurrency);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Notional could not be found to determine settlement leg");<NEW_LINE>}<NEW_LINE>PayReceive leg1Direction = row.getValue(LEG_1_DIRECTION_FIELD, LoaderUtils::parsePayReceive);<NEW_LINE>PayReceive leg2Direction = row.getValue(LEG_2_DIRECTION_FIELD, LoaderUtils::parsePayReceive);<NEW_LINE>if (leg1Direction.equals(leg2Direction)) {<NEW_LINE>throw new IllegalArgumentException(Messages.format("FxNdf legs must not have the same direction: {}, {}", leg1Direction, leg2Direction));<NEW_LINE>}<NEW_LINE>CurrencyPair currencyPair = CurrencyPair.of(settlementCurrency, nonDeliverableCurrency);<NEW_LINE>LocalDate paymentDate = row.getField(PAYMENT_DATE_FIELD, LoaderUtils::parseDate);<NEW_LINE>FxRate agreedFxRate = FxRate.of(currencyPair, row.getField<MASK><NEW_LINE>FxIndex index = parseFxIndex(row, currencyPair);<NEW_LINE>FxNdf fxNdf = FxNdf.builder().settlementCurrencyNotional(settlementNotional).agreedFxRate(agreedFxRate).index(index).paymentDate(paymentDate).build();<NEW_LINE>return FxNdfTrade.of(info, fxNdf);<NEW_LINE>} | (FX_RATE_FIELD, LoaderUtils::parseDouble)); |
192,221 | public boolean test(PersistentTasksCustomMetadata.PersistentTask<?> persistentTask) {<NEW_LINE>// Persistent task being null means it has been removed from state, and is now complete<NEW_LINE>if (persistentTask == null) {<NEW_LINE>isCompleted = true;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>SnapshotUpgradeTaskState snapshotUpgradeTaskState = (SnapshotUpgradeTaskState) persistentTask.getState();<NEW_LINE>SnapshotUpgradeState snapshotUpgradeState = snapshotUpgradeTaskState == null ? SnapshotUpgradeState.STOPPED : snapshotUpgradeTaskState.getState();<NEW_LINE>String reason = snapshotUpgradeTaskState == null <MASK><NEW_LINE>PersistentTasksCustomMetadata.Assignment assignment = persistentTask.getAssignment();<NEW_LINE>// This logic is only appropriate when opening a job, not when reallocating following a failure,<NEW_LINE>// and this is why this class must only be used when opening a job<NEW_LINE>SnapshotUpgradeTaskParams params = (SnapshotUpgradeTaskParams) persistentTask.getParams();<NEW_LINE>Optional<ElasticsearchException> assignmentException = checkAssignmentState(assignment, params.getJobId(), logger);<NEW_LINE>if (assignmentException.isPresent()) {<NEW_LINE>exception = assignmentException.get();<NEW_LINE>shouldCancel = true;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (snapshotUpgradeState == SnapshotUpgradeState.FAILED) {<NEW_LINE>exception = ExceptionsHelper.serverError("Unexpected state [" + snapshotUpgradeState + "] while waiting for to be assigned to a node; recorded reason [" + reason + "]");<NEW_LINE>shouldCancel = true;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (persistentTask.getExecutorNode() != null) {<NEW_LINE>node = persistentTask.getExecutorNode();<NEW_LINE>// If waitForCompletion is true, we need to wait for the task to be finished. Otherwise, return true once it is assigned<NEW_LINE>return waitForCompletion == false;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | ? "" : snapshotUpgradeTaskState.getReason(); |
1,271,273 | protected Map<String, List<Object>> autoGeneratePks(BigDecimal cursor, String autoColumnName, Integer updateCount) throws SQLException {<NEW_LINE>BigDecimal step = BigDecimal.ONE;<NEW_LINE>String resourceId = statementProxy.getConnectionProxy().getDataSourceProxy().getResourceId();<NEW_LINE>if (RESOURCE_ID_STEP_CACHE.containsKey(resourceId)) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>ResultSet increment = null;<NEW_LINE>try {<NEW_LINE>increment = statementProxy.getTargetStatement().executeQuery("SHOW VARIABLES LIKE 'auto_increment_increment'");<NEW_LINE>increment.next();<NEW_LINE>step = new BigDecimal(increment.getString(2));<NEW_LINE>RESOURCE_ID_STEP_CACHE.put(resourceId, step);<NEW_LINE>} finally {<NEW_LINE>IOUtil.close(increment);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Object> pkValues = new ArrayList<>();<NEW_LINE>for (int i = 0; i < updateCount; i++) {<NEW_LINE>pkValues.add(cursor);<NEW_LINE>cursor = cursor.add(step);<NEW_LINE>}<NEW_LINE>Map<String, List<Object>> pkValuesMap = new HashMap<>(1, 1.001f);<NEW_LINE>pkValuesMap.put(autoColumnName, pkValues);<NEW_LINE>return pkValuesMap;<NEW_LINE>} | step = RESOURCE_ID_STEP_CACHE.get(resourceId); |
1,839,736 | public Object sendRpcRequest(RpcRequest rpcRequest) {<NEW_LINE>// build return value<NEW_LINE>CompletableFuture<RpcResponse<Object>> resultFuture = new CompletableFuture<>();<NEW_LINE>// get server address<NEW_LINE>InetSocketAddress inetSocketAddress = serviceDiscovery.lookupService(rpcRequest);<NEW_LINE>// get server address related channel<NEW_LINE>Channel channel = getChannel(inetSocketAddress);<NEW_LINE>if (channel.isActive()) {<NEW_LINE>// put unprocessed request<NEW_LINE>unprocessedRequests.put(rpcRequest.getRequestId(), resultFuture);<NEW_LINE>RpcMessage rpcMessage = RpcMessage.builder().data(rpcRequest).codec(SerializationTypeEnum.HESSIAN.getCode()).compress(CompressTypeEnum.GZIP.getCode()).messageType(RpcConstants.REQUEST_TYPE).build();<NEW_LINE>channel.writeAndFlush(rpcMessage).addListener((ChannelFutureListener) future -> {<NEW_LINE>if (future.isSuccess()) {<NEW_LINE>log.info("client send message: [{}]", rpcMessage);<NEW_LINE>} else {<NEW_LINE>future.channel().close();<NEW_LINE>resultFuture.completeExceptionally(future.cause());<NEW_LINE>log.error(<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>return resultFuture;<NEW_LINE>} | "Send failed:", future.cause()); |
1,828,831 | public static QueryMetrics createFromCollection(Collection<QueryMetrics> queryMetricsCollection) {<NEW_LINE>long retrievedDocumentCount = 0;<NEW_LINE>long retrievedDocumentSize = 0;<NEW_LINE>long outputDocumentCount = 0;<NEW_LINE>long outputDocumentSize = 0;<NEW_LINE>long indexHitDocumentCount = 0;<NEW_LINE>Duration totalQueryExecutionTime = Duration.ZERO;<NEW_LINE>Collection<QueryPreparationTimes> queryPreparationTimesCollection <MASK><NEW_LINE>Duration indexLookupTime = Duration.ZERO;<NEW_LINE>Duration documentLoadTime = Duration.ZERO;<NEW_LINE>Duration vmExecutionTime = Duration.ZERO;<NEW_LINE>Collection<RuntimeExecutionTimes> runtimeExecutionTimesCollection = new ArrayList<RuntimeExecutionTimes>();<NEW_LINE>Duration documentWriteTime = Duration.ZERO;<NEW_LINE>Collection<ClientSideMetrics> clientSideMetricsCollection = new ArrayList<ClientSideMetrics>();<NEW_LINE>List<String> activityIds = new ArrayList<>();<NEW_LINE>Collection<IndexUtilizationInfo> indexUtilizationInfoCollection = new ArrayList<IndexUtilizationInfo>();<NEW_LINE>for (QueryMetrics queryMetrics : queryMetricsCollection) {<NEW_LINE>if (queryMetrics == null) {<NEW_LINE>throw new NullPointerException("queryMetricsList can not have null elements");<NEW_LINE>}<NEW_LINE>activityIds.addAll(queryMetrics.activityIds);<NEW_LINE>retrievedDocumentCount += queryMetrics.retrievedDocumentCount;<NEW_LINE>retrievedDocumentSize += queryMetrics.retrievedDocumentSize;<NEW_LINE>outputDocumentCount += queryMetrics.outputDocumentCount;<NEW_LINE>outputDocumentSize += queryMetrics.outputDocumentSize;<NEW_LINE>indexHitDocumentCount += queryMetrics.indexHitDocumentCount;<NEW_LINE>totalQueryExecutionTime = totalQueryExecutionTime.plus(queryMetrics.totalQueryExecutionTime);<NEW_LINE>queryPreparationTimesCollection.add(queryMetrics.queryPreparationTimes);<NEW_LINE>indexLookupTime = indexLookupTime.plus(queryMetrics.indexLookupTime);<NEW_LINE>documentLoadTime = documentLoadTime.plus(queryMetrics.documentLoadTime);<NEW_LINE>vmExecutionTime = vmExecutionTime.plus(queryMetrics.vmExecutionTime);<NEW_LINE>runtimeExecutionTimesCollection.add(queryMetrics.runtimeExecutionTimes);<NEW_LINE>documentWriteTime = documentWriteTime.plus(queryMetrics.documentWriteTime);<NEW_LINE>clientSideMetricsCollection.add(queryMetrics.clientSideMetrics);<NEW_LINE>indexUtilizationInfoCollection.add(queryMetrics.indexUtilizationInfo);<NEW_LINE>}<NEW_LINE>return new QueryMetrics(activityIds, retrievedDocumentCount, retrievedDocumentSize, outputDocumentCount, outputDocumentSize, indexHitDocumentCount, totalQueryExecutionTime, QueryPreparationTimes.createFromCollection(queryPreparationTimesCollection), indexLookupTime, documentLoadTime, vmExecutionTime, RuntimeExecutionTimes.createFromCollection(runtimeExecutionTimesCollection), documentWriteTime, ClientSideMetrics.createFromCollection(clientSideMetricsCollection), IndexUtilizationInfo.createFromCollection(indexUtilizationInfoCollection));<NEW_LINE>} | = new ArrayList<QueryPreparationTimes>(); |
742,594 | public CdmObject copy(ResolveOptions resOpt, CdmObject host) {<NEW_LINE>if (resOpt == null) {<NEW_LINE>resOpt = new ResolveOptions(this, this.getCtx().getCorpus().getDefaultResolutionDirectives());<NEW_LINE>}<NEW_LINE>CdmArgumentDefinition copy;<NEW_LINE>if (host == null) {<NEW_LINE>copy = new CdmArgumentDefinition(this.getCtx(), this.name);<NEW_LINE>} else {<NEW_LINE>copy = (CdmArgumentDefinition) host;<NEW_LINE>copy.<MASK><NEW_LINE>copy.setName(this.getName());<NEW_LINE>}<NEW_LINE>if (this.getValue() != null) {<NEW_LINE>if (this.getValue() instanceof CdmObject) {<NEW_LINE>copy.setValue(((CdmObject) this.getValue()).copy(resOpt));<NEW_LINE>} else {<NEW_LINE>copy.setValue(this.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>copy.setResolvedParameter(this.resolvedParameter);<NEW_LINE>copy.setExplanation(this.getExplanation());<NEW_LINE>return copy;<NEW_LINE>} | setCtx(this.getCtx()); |
1,656,945 | public synchronized void drawGlyphVector(SunGraphics2D sg2d, GlyphVector glyphVector, float x, float y) {<NEW_LINE>OSXSurfaceData surfaceData = (OSXSurfaceData) sg2d.getSurfaceData();<NEW_LINE>Shape shape = glyphVector.getOutline(x, y);<NEW_LINE>// get final destination compositing bounds (after all transformations if needed)<NEW_LINE>Rectangle2D compositingBounds = padBounds(sg2d, shape);<NEW_LINE>// constrain the bounds to be within surface bounds<NEW_LINE>clipBounds(sg2d, compositingBounds);<NEW_LINE>// if the compositing region is empty we skip all remaining compositing work:<NEW_LINE>if (compositingBounds.isEmpty() == false) {<NEW_LINE>BufferedImage srcPixels;<NEW_LINE>{<NEW_LINE>// create matching image into which we'll render the primitive to be composited<NEW_LINE>srcPixels = surfaceData.getCompositingSrcImage((int) compositingBounds.getWidth(), (<MASK><NEW_LINE>Graphics2D g = srcPixels.createGraphics();<NEW_LINE>// sync up graphics state<NEW_LINE>ShapeTM.setToTranslation(-compositingBounds.getX(), -compositingBounds.getY());<NEW_LINE>ShapeTM.concatenate(sg2d.transform);<NEW_LINE>g.setTransform(ShapeTM);<NEW_LINE>g.setPaint(sg2d.getPaint());<NEW_LINE>g.setStroke(sg2d.getStroke());<NEW_LINE>g.setFont(sg2d.getFont());<NEW_LINE>g.setRenderingHints(sg2d.getRenderingHints());<NEW_LINE>// render the primitive to be composited<NEW_LINE>g.drawGlyphVector(glyphVector, x, y);<NEW_LINE>g.dispose();<NEW_LINE>}<NEW_LINE>composite(sg2d, surfaceData, srcPixels, compositingBounds);<NEW_LINE>}<NEW_LINE>} | int) compositingBounds.getHeight()); |
1,460,147 | final DescribeScalingActivitiesResult executeDescribeScalingActivities(DescribeScalingActivitiesRequest describeScalingActivitiesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeScalingActivitiesRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeScalingActivitiesRequest> request = null;<NEW_LINE>Response<DescribeScalingActivitiesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeScalingActivitiesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeScalingActivitiesRequest));<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(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Auto Scaling");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeScalingActivities");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeScalingActivitiesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeScalingActivitiesResultJsonUnmarshaller());<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>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
1,582,517 | public static IndexReader openIndex(String indexPath, String dirImpl) throws Exception {<NEW_LINE>final Path root = FileSystems.getDefault().getPath(Objects.requireNonNull(indexPath));<NEW_LINE>final List<DirectoryReader> readers = new ArrayList<>();<NEW_LINE>// find all valid index directories in this directory<NEW_LINE>Files.walkFileTree(root, new SimpleFileVisitor<Path>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public FileVisitResult preVisitDirectory(Path path, BasicFileAttributes attrs) throws IOException {<NEW_LINE>Directory dir = openDirectory(path, dirImpl);<NEW_LINE>try {<NEW_LINE>DirectoryReader <MASK><NEW_LINE>readers.add(dr);<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.log(Level.WARNING, "Error opening directory", e);<NEW_LINE>}<NEW_LINE>return FileVisitResult.CONTINUE;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (readers.isEmpty()) {<NEW_LINE>throw new RuntimeException("No valid directory at the location: " + indexPath);<NEW_LINE>}<NEW_LINE>log.info(String.format(Locale.ENGLISH, "IndexReaders (%d leaf readers) successfully opened. Index path=%s", readers.size(), indexPath));<NEW_LINE>if (readers.size() == 1) {<NEW_LINE>return readers.get(0);<NEW_LINE>} else {<NEW_LINE>return new MultiReader(readers.toArray(new IndexReader[readers.size()]));<NEW_LINE>}<NEW_LINE>} | dr = DirectoryReader.open(dir); |
678,130 | private Mono<Response<Flux<ByteBuffer>>> stopWithResponseAsync(String resourceGroupName, String factoryName, String triggerName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (factoryName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter factoryName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (triggerName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter triggerName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = <MASK><NEW_LINE>return service.stop(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, factoryName, triggerName, this.client.getApiVersion(), accept, context);<NEW_LINE>} | this.client.mergeContext(context); |
1,585,464 | private void renderRailButton(GL2 gl, RailButton r, Surface which) {<NEW_LINE>if (which == Surface.OUTSIDE) {<NEW_LINE>// renderOther(gl, r);<NEW_LINE>final double or = r.getOuterDiameter() / 2.0;<NEW_LINE>final double ir = r.getInnerDiameter() / 2.0;<NEW_LINE>gl.glRotated(r.getAngleOffset() * 180 / Math.PI - 90, 1, 0, 0);<NEW_LINE>// Inner Diameter<NEW_LINE>glu.gluCylinder(q, ir, ir, r.getTotalHeight(), LOD, 1);<NEW_LINE>// Bottom Disc<NEW_LINE>glu.gluCylinder(q, or, or, r.getBaseHeight(), LOD, 1);<NEW_LINE>glu.gluQuadricOrientation(q, GLU.GLU_INSIDE);<NEW_LINE>glu.gluDisk(q, 0, or, LOD, 2);<NEW_LINE>glu.gluQuadricOrientation(q, GLU.GLU_OUTSIDE);<NEW_LINE>gl.glTranslated(0, 0, r.getBaseHeight());<NEW_LINE>glu.gluDisk(q, 0, or, LOD, 2);<NEW_LINE>// Upper Disc<NEW_LINE>gl.glTranslated(0, 0, r.getTotalHeight() - r.getFlangeHeight() * 2.0);<NEW_LINE>glu.gluCylinder(q, or, or, r.<MASK><NEW_LINE>glu.gluQuadricOrientation(q, GLU.GLU_INSIDE);<NEW_LINE>glu.gluDisk(q, 0, or, LOD, 2);<NEW_LINE>glu.gluQuadricOrientation(q, GLU.GLU_OUTSIDE);<NEW_LINE>gl.glTranslated(0, 0, r.getFlangeHeight());<NEW_LINE>glu.gluDisk(q, 0, or, LOD, 2);<NEW_LINE>}<NEW_LINE>} | getFlangeHeight(), LOD, 1); |
1,003,307 | public void run() {<NEW_LINE>setTitleImage(Images.active);<NEW_LINE>CircularBufferDataProvider totalProvider = (CircularBufferDataProvider) totalTrace.getDataProvider();<NEW_LINE>CircularBufferDataProvider activeProvider = (CircularBufferDataProvider) activeTrace.getDataProvider();<NEW_LINE>totalProvider.clearTrace();<NEW_LINE>activeProvider.clearTrace();<NEW_LINE>for (int i = 0; i < timeLv.size(); i++) {<NEW_LINE>long time = timeLv.getLong(i);<NEW_LINE>double totalV = totalLv.getDouble(i);<NEW_LINE>double activeV = activeLv.getDouble(i);<NEW_LINE>totalProvider.addSample(new Sample(time, totalV));<NEW_LINE>activeProvider.addSample(<MASK><NEW_LINE>}<NEW_LINE>DbDailyTotalConnView.this.setContentDescription(date.substring(0, 4) + "-" + date.substring(4, 6) + "-" + date.substring(6, 8));<NEW_LINE>long stime = DateUtil.yyyymmdd(date);<NEW_LINE>long etime = stime + DateUtil.MILLIS_PER_DAY - 1;<NEW_LINE>xyGraph.primaryXAxis.setRange(stime, etime);<NEW_LINE>double max = ChartUtil.getMax(totalProvider.iterator());<NEW_LINE>xyGraph.primaryYAxis.setRange(0, max);<NEW_LINE>} | new Sample(time, activeV)); |
1,359,497 | public boolean eIsSet(int featureID) {<NEW_LINE>switch(featureID) {<NEW_LINE>case ModelPackage.MBRICKLET_SOLID_STATE_RELAY__LOGGER:<NEW_LINE>return LOGGER_EDEFAULT == null ? logger != null : !LOGGER_EDEFAULT.equals(logger);<NEW_LINE>case ModelPackage.MBRICKLET_SOLID_STATE_RELAY__UID:<NEW_LINE>return UID_EDEFAULT == null ? uid != null : !UID_EDEFAULT.equals(uid);<NEW_LINE>case ModelPackage.MBRICKLET_SOLID_STATE_RELAY__POLL:<NEW_LINE>return poll != POLL_EDEFAULT;<NEW_LINE>case ModelPackage.MBRICKLET_SOLID_STATE_RELAY__ENABLED_A:<NEW_LINE>return ENABLED_A_EDEFAULT == null ? enabledA != null : !ENABLED_A_EDEFAULT.equals(enabledA);<NEW_LINE>case ModelPackage.MBRICKLET_SOLID_STATE_RELAY__TINKERFORGE_DEVICE:<NEW_LINE>return tinkerforgeDevice != null;<NEW_LINE>case ModelPackage.MBRICKLET_SOLID_STATE_RELAY__IP_CONNECTION:<NEW_LINE>return IP_CONNECTION_EDEFAULT == null ? ipConnection != null : !IP_CONNECTION_EDEFAULT.equals(ipConnection);<NEW_LINE>case ModelPackage.MBRICKLET_SOLID_STATE_RELAY__CONNECTED_UID:<NEW_LINE>return CONNECTED_UID_EDEFAULT == null ? connectedUid != null : !CONNECTED_UID_EDEFAULT.equals(connectedUid);<NEW_LINE>case ModelPackage.MBRICKLET_SOLID_STATE_RELAY__POSITION:<NEW_LINE>return position != POSITION_EDEFAULT;<NEW_LINE>case ModelPackage.MBRICKLET_SOLID_STATE_RELAY__DEVICE_IDENTIFIER:<NEW_LINE>return deviceIdentifier != DEVICE_IDENTIFIER_EDEFAULT;<NEW_LINE>case ModelPackage.MBRICKLET_SOLID_STATE_RELAY__NAME:<NEW_LINE>return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);<NEW_LINE>case ModelPackage.MBRICKLET_SOLID_STATE_RELAY__BRICKD:<NEW_LINE>return basicGetBrickd() != null;<NEW_LINE>case ModelPackage.MBRICKLET_SOLID_STATE_RELAY__SWITCH_STATE:<NEW_LINE>return SWITCH_STATE_EDEFAULT == null ? switchState != null : !SWITCH_STATE_EDEFAULT.equals(switchState);<NEW_LINE>case ModelPackage.MBRICKLET_SOLID_STATE_RELAY__DEVICE_TYPE:<NEW_LINE>return DEVICE_TYPE_EDEFAULT == null ? deviceType != null <MASK><NEW_LINE>}<NEW_LINE>return super.eIsSet(featureID);<NEW_LINE>} | : !DEVICE_TYPE_EDEFAULT.equals(deviceType); |
1,200,409 | protected String printAbscissae(int cell) {<NEW_LINE>// # of x digits<NEW_LINE>final int wn = Math.max(1, (int) Math.ceil(Math.log10(width)));<NEW_LINE>// # of y digits<NEW_LINE>final int hn = Math.max(1, (int) Math.ceil(Math.log10(height)));<NEW_LINE>final String margin = "%" + hn + "s ";<NEW_LINE>final String dFormat = "%" + cell + "d";<NEW_LINE>final String sFormat = "%" + cell + "s";<NEW_LINE>// Abscissae<NEW_LINE>for (int i = wn - 1; i >= 0; i--) {<NEW_LINE>int mod = (int) Math.pow(10, i);<NEW_LINE>System.out.printf(margin, "");<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>if ((x % 10) == 0) {<NEW_LINE>int d = (x / mod) % 10;<NEW_LINE>System.out.printf(dFormat, d);<NEW_LINE>} else if (i == 0) {<NEW_LINE>System.out.printf(dFormat, x % 10);<NEW_LINE>} else {<NEW_LINE>System.out.printf(sFormat, "");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>}<NEW_LINE>System.<MASK><NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>System.out.printf(sFormat, "-");<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>return "%" + hn + "d:";<NEW_LINE>} | out.printf(margin, ""); |
1,177,703 | private void appendPrimaryKey(CQLTranslator translator, EmbeddableType compoEmbeddableType, Field[] fields, StringBuilder queryBuilder) {<NEW_LINE>for (Field f : fields) {<NEW_LINE>if (!ReflectUtils.isTransientOrStatic(f)) {<NEW_LINE>if (f.getType().isAnnotationPresent(Embeddable.class)) {<NEW_LINE>// compound partition key<NEW_LINE>MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(puMetadata.getPersistenceUnitName());<NEW_LINE>queryBuilder.append(translator.OPEN_BRACKET);<NEW_LINE><MASK><NEW_LINE>appendPrimaryKey(translator, (EmbeddableType) metaModel.embeddable(f.getType()), f.getType().getDeclaredFields(), queryBuilder);<NEW_LINE>queryBuilder.deleteCharAt(queryBuilder.length() - 1);<NEW_LINE>queryBuilder.append(translator.CLOSE_BRACKET);<NEW_LINE>queryBuilder.append(Constants.SPACE_COMMA);<NEW_LINE>} else {<NEW_LINE>Attribute attribute = compoEmbeddableType.getAttribute(f.getName());<NEW_LINE>translator.appendColumnName(queryBuilder, ((AbstractAttribute) attribute).getJPAColumnName());<NEW_LINE>queryBuilder.append(Constants.SPACE_COMMA);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | queryBuilder.append(translator.SPACE_STRING); |
506,418 | public <T, K> Flux<ClientResponsePayload<K>> streamingRequestStreamingResponse(Publisher<ClientRequestPayload<T>> payloads, RpcOptions options) {<NEW_LINE>Flux<ClientResponsePayload<K>> clientResponsePayloadFlux = Flux.from(payloads).switchOnFirst((signal, flux) -> {<NEW_LINE>final ClientRequestPayload<T> clientRequestPayload = signal.get();<NEW_LINE>final ProtocolId protocol = clientRequestPayload.getRequestRpcMetadata().getProtocol();<NEW_LINE>final TProtocolType <MASK><NEW_LINE>final Flux<Payload> payloadFlux = flux.map(t -> clientRequestPayloadToRSocketPayload(t, protocolType));<NEW_LINE>Flux<Payload> requestChannel = rsocket.requestChannel(payloadFlux);<NEW_LINE>return requestChannel.onErrorResume(t -> Flux.just(ByteBufPayload.create(getExceptionString(t, clientRequestPayload.getRequestRpcMetadata().getName())))).map(new StreamingResponseHandler<>(clientRequestPayload));<NEW_LINE>});<NEW_LINE>return clientResponsePayloadFlux;<NEW_LINE>} | protocolType = TProtocolType.fromProtocolId(protocol); |
453,449 | private NodeInfoVO transfer(NodeInfo nodeInfo, HttpServletRequest req) throws AppStandardErrorException {<NEW_LINE>NodeInfoVO nodeInfoVO = new NodeInfoVO();<NEW_LINE>BeanUtils.copyProperties(nodeInfo, nodeInfoVO);<NEW_LINE>nodeInfoVO.setTitle(nodeInfo.getName());<NEW_LINE>nodeInfoVO.setType(nodeInfo.getNodeType());<NEW_LINE>nodeInfoVO.setImage(nodeInfo.getIcon());<NEW_LINE>DomainSupplier<NodeUi, String> descriptionSupplier = internationalization(req, NodeUi::getDescriptionEn, NodeUi::getDescription);<NEW_LINE>DomainSupplier<NodeUi, String> lableNameSupplier = internationalization(req, NodeUi::getLableNameEn, NodeUi::getLableName);<NEW_LINE>ArrayList<NodeUiVO> <MASK><NEW_LINE>for (NodeUi nodeUi : nodeInfo.getNodeUis()) {<NEW_LINE>NodeUiVO nodeUiVO = new NodeUiVO();<NEW_LINE>BeanUtils.copyProperties(nodeUi, nodeUiVO);<NEW_LINE>nodeUiVO.setDesc(descriptionSupplier.get(nodeUi));<NEW_LINE>nodeUiVO.setLableName(lableNameSupplier.get(nodeUi));<NEW_LINE>nodeUiVO.setNodeUiValidateVOS(nodeUi.getNodeUiValidates().stream().map(v -> transfer(v, req)).sorted(NodeUiValidateVO::compareTo).collect(Collectors.toList()));<NEW_LINE>nodeUiVOS.add(nodeUiVO);<NEW_LINE>}<NEW_LINE>nodeUiVOS.sort(NodeUiVO::compareTo);<NEW_LINE>nodeInfoVO.setNodeUiVOS(nodeUiVOS);<NEW_LINE>// cache<NEW_LINE>AppConn applicationAppConn = AppConnManager.getAppConnManager().getAppConn(nodeInfo.getAppConnName());<NEW_LINE>if (applicationAppConn instanceof OnlySSOAppConn) {<NEW_LINE>SSOIntegrationStandard standard = ((OnlySSOAppConn) applicationAppConn).getOrCreateSSOStandard();<NEW_LINE>if (null != standard) {<NEW_LINE>SSOUrlBuilderOperation ssoUrlBuilderOperation = standard.getSSOBuilderService().createSSOUrlBuilderOperation();<NEW_LINE>ssoUrlBuilderOperation.setDSSUrl(Configuration.GATEWAY_URL().getValue());<NEW_LINE>// todo add redirect url by labels<NEW_LINE>ssoUrlBuilderOperation.setReqUrl(applicationAppConn.getAppDesc().getAppInstances().get(0).getBaseUrl());<NEW_LINE>String redirectUrl = ssoUrlBuilderOperation.getBuiltUrl();<NEW_LINE>if (redirectUrl != null) {<NEW_LINE>nodeInfoVO.setJumpUrl(redirectUrl);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return nodeInfoVO;<NEW_LINE>} | nodeUiVOS = new ArrayList<>(); |
1,285,629 | protected Statement methodInvoker(FrameworkMethod method, Object test) {<NEW_LINE>DesugarRule desugarRule = Iterables.getOnlyElement(getTestClass().getAnnotatedFieldValues(test, Rule.class, DesugarRule.class));<NEW_LINE>// Compile source Java files before desugar transformation.<NEW_LINE>try {<NEW_LINE>desugarRule.compileSourceInputs();<NEW_LINE>} catch (IOException | SourceCompilationException e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>}<NEW_LINE>JdkSuppress jdkSuppress = getJdkSuppress(method);<NEW_LINE>if (jdkSuppress != null) {<NEW_LINE>ImmutableMap<String, Integer<MASK><NEW_LINE>ImmutableCollection<Integer> classFileVersions = inputClassFileMajorVersions.values();<NEW_LINE>if (min(classFileVersions) < jdkSuppress.minJdkVersion() || max(classFileVersions) > jdkSuppress.maxJdkVersion()) {<NEW_LINE>return new VacuousSuccess(String.format("@Test method (%s) passed vacuously without execution: All or part of the input" + " class file versions (%s) does not meet the declared prerequisite version" + " range (%s) for testing.", method, inputClassFileMajorVersions, jdkSuppress));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>desugarRule.executeDesugarTransformation();<NEW_LINE>desugarRule.injectTestInstanceFields();<NEW_LINE>Method reflectMethod = method.getMethod();<NEW_LINE>ImmutableMap.Builder<Parameter, Object> parameterBindingsBuilder = ImmutableMap.builder();<NEW_LINE>// Load bindings from annotations.<NEW_LINE>if (reflectMethod.isAnnotationPresent(ParameterValueSourceSet.class) || reflectMethod.isAnnotationPresent(ParameterValueSource.class)) {<NEW_LINE>parameterBindingsBuilder.putAll(((ValueSourceAnnotatedMethod) method).getResolvableParameters());<NEW_LINE>}<NEW_LINE>// Load bindings from desugar rule.<NEW_LINE>parameterBindingsBuilder.putAll(desugarRule.getResolvableParameters(reflectMethod));<NEW_LINE>ImmutableMap<Parameter, Object> parameterBindings = parameterBindingsBuilder.build();<NEW_LINE>Parameter[] parameters = reflectMethod.getParameters();<NEW_LINE>int parameterCount = parameters.length;<NEW_LINE>Object[] resolvedParameterValues = new Object[parameterCount];<NEW_LINE>for (int i = 0; i < parameterCount; i++) {<NEW_LINE>resolvedParameterValues[i] = parameterBindings.get(parameters[i]);<NEW_LINE>}<NEW_LINE>return new InvokeMethodWithParams(method, test, resolvedParameterValues);<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE>throw new IllegalStateException(throwable);<NEW_LINE>}<NEW_LINE>} | > inputClassFileMajorVersions = desugarRule.getInputClassFileMajorVersionMap(); |
1,474,151 | public static DescribeColumnsResponse unmarshall(DescribeColumnsResponse describeColumnsResponse, UnmarshallerContext context) {<NEW_LINE>describeColumnsResponse.setRequestId(context.stringValue("DescribeColumnsResponse.RequestId"));<NEW_LINE>describeColumnsResponse.setPageSize(context.integerValue("DescribeColumnsResponse.PageSize"));<NEW_LINE>describeColumnsResponse.setCurrentPage(context.integerValue("DescribeColumnsResponse.CurrentPage"));<NEW_LINE>describeColumnsResponse.setTotalCount(context.integerValue("DescribeColumnsResponse.TotalCount"));<NEW_LINE>List<Column> items = new ArrayList<Column>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeColumnsResponse.Items.Length"); i++) {<NEW_LINE>Column column = new Column();<NEW_LINE>column.setId(context.longValue("DescribeColumnsResponse.Items[" + i + "].Id"));<NEW_LINE>column.setName(context.stringValue("DescribeColumnsResponse.Items[" + i + "].Name"));<NEW_LINE>column.setInstanceId(context.longValue("DescribeColumnsResponse.Items[" + i + "].InstanceId"));<NEW_LINE>column.setTableId(context.longValue("DescribeColumnsResponse.Items[" + i + "].TableId"));<NEW_LINE>column.setCreationTime(context.longValue("DescribeColumnsResponse.Items[" + i + "].CreationTime"));<NEW_LINE>column.setSensitive(context.booleanValue("DescribeColumnsResponse.Items[" + i + "].Sensitive"));<NEW_LINE>column.setProductCode(context.stringValue("DescribeColumnsResponse.Items[" + i + "].ProductCode"));<NEW_LINE>column.setDataType(context.stringValue("DescribeColumnsResponse.Items[" + i + "].DataType"));<NEW_LINE>column.setOdpsRiskLevelValue(context.integerValue<MASK><NEW_LINE>column.setOdpsRiskLevelName(context.stringValue("DescribeColumnsResponse.Items[" + i + "].OdpsRiskLevelName"));<NEW_LINE>column.setRiskLevelId(context.longValue("DescribeColumnsResponse.Items[" + i + "].RiskLevelId"));<NEW_LINE>column.setRiskLevelName(context.stringValue("DescribeColumnsResponse.Items[" + i + "].RiskLevelName"));<NEW_LINE>column.setRuleId(context.longValue("DescribeColumnsResponse.Items[" + i + "].RuleId"));<NEW_LINE>column.setRuleName(context.stringValue("DescribeColumnsResponse.Items[" + i + "].RuleName"));<NEW_LINE>column.setDepartName(context.stringValue("DescribeColumnsResponse.Items[" + i + "].DepartName"));<NEW_LINE>items.add(column);<NEW_LINE>}<NEW_LINE>describeColumnsResponse.setItems(items);<NEW_LINE>return describeColumnsResponse;<NEW_LINE>} | ("DescribeColumnsResponse.Items[" + i + "].OdpsRiskLevelValue")); |
1,347,143 | public void initialize(WizardDescriptor wiz) {<NEW_LINE>this.wizardInfo = getWizardInfo();<NEW_LINE>this.helper = new ResourceConfigHelperHolder().getJMSHelper();<NEW_LINE>// this.wiz = wiz;<NEW_LINE>// NOI18N<NEW_LINE>wiz.putProperty("NewFileWizard_Title", NbBundle.getMessage(JMSWizard.class, "Templates/SunResources/JMS_Resource"));<NEW_LINE>index = 0;<NEW_LINE>project = Templates.getProject(wiz);<NEW_LINE>panels = createPanels();<NEW_LINE>// Make sure list of steps is accurate.<NEW_LINE>steps = createSteps();<NEW_LINE>try {<NEW_LINE>FileObject pkgLocation = project.getProjectDirectory();<NEW_LINE>if (pkgLocation != null) {<NEW_LINE>this.helper.<MASK><NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < panels.length; i++) {<NEW_LINE>Component c = panels[i].getComponent();<NEW_LINE>if (c instanceof JComponent) {<NEW_LINE>// assume Swing components<NEW_LINE>JComponent jc = (JComponent) c;<NEW_LINE>// Step #.<NEW_LINE>// NOI18N<NEW_LINE>jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, i);<NEW_LINE>// Step name (actually the whole list for reference).<NEW_LINE>// NOI18N<NEW_LINE>jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getData().setTargetFileObject(pkgLocation); |
944,747 | private I_C_Invoice_Rejection_Detail of(@NonNull final ImportedInvoiceResponse response) {<NEW_LINE>final I_C_Invoice_Rejection_Detail rejectionDetail = InterfaceWrapperHelper.newInstance(I_C_Invoice_Rejection_Detail.class);<NEW_LINE>rejectionDetail.setIsDone(false);<NEW_LINE>rejectionDetail.setInvoiceNumber(response.getDocumentNumber());<NEW_LINE>if (response.getInvoiceId() != null) {<NEW_LINE>rejectionDetail.setC_Invoice_ID(response.getInvoiceId().getRepoId());<NEW_LINE>}<NEW_LINE>rejectionDetail.setClient(response.getClient());<NEW_LINE>rejectionDetail.setInvoiceRecipient(response.getInvoiceRecipient());<NEW_LINE>rejectionDetail.setReason(Joiner.on(REASON_SEPARATOR).join(response.getReason()));<NEW_LINE>rejectionDetail.setExplanation(response.getExplanation());<NEW_LINE>rejectionDetail.setResponsiblePerson(response.getResponsiblePerson());<NEW_LINE>rejectionDetail.setPhone(response.getPhone());<NEW_LINE>rejectionDetail.setEMail(response.getEmail());<NEW_LINE>final Status status = response.getStatus();<NEW_LINE>if (status == null) {<NEW_LINE>throw new AdempiereException("The given response has no status. Probably support for this type of response is not implemented yet").appendParametersToMessage(<MASK><NEW_LINE>}<NEW_LINE>rejectionDetail.setStatus(status.name());<NEW_LINE>rejectionDetail.setAD_Org_ID(response.getBillerOrg());<NEW_LINE>return rejectionDetail;<NEW_LINE>} | ).setParameter("response", response); |
547,740 | public void gracefullyShutdownClientChannels() {<NEW_LINE>LOG.warn("Gracefully shutting down all client channels");<NEW_LINE>try {<NEW_LINE>// Mark all active connections to be closed after next response sent.<NEW_LINE>LOG.warn("Flagging CLOSE_AFTER_RESPONSE on " + channels.size() + " client channels.");<NEW_LINE>// Pick some arbitrary executor.<NEW_LINE>PromiseCombiner closeAfterPromises <MASK><NEW_LINE>for (Channel channel : channels) {<NEW_LINE>ConnectionCloseType.setForChannel(channel, ConnectionCloseType.DELAYED_GRACEFUL);<NEW_LINE>ChannelPromise closePromise = channel.pipeline().newPromise();<NEW_LINE>channel.attr(ConnectionCloseChannelAttributes.CLOSE_AFTER_RESPONSE).set(closePromise);<NEW_LINE>// TODO(carl-mastrangelo): remove closePromise, since I don't think it's needed. Need to verify.<NEW_LINE>closeAfterPromises.add(channel.closeFuture());<NEW_LINE>}<NEW_LINE>// Wait for all of the attempts to close connections gracefully, or max of 30 secs each.<NEW_LINE>Promise<Void> combinedCloseAfterPromise = executor.newPromise();<NEW_LINE>closeAfterPromises.finish(combinedCloseAfterPromise);<NEW_LINE>combinedCloseAfterPromise.await(30, TimeUnit.SECONDS);<NEW_LINE>// Close all of the remaining active connections.<NEW_LINE>LOG.warn("Closing remaining active client channels.");<NEW_LINE>List<ChannelFuture> forceCloseFutures = new ArrayList<>();<NEW_LINE>channels.forEach(channel -> {<NEW_LINE>if (channel.isActive()) {<NEW_LINE>ChannelFuture f = channel.pipeline().close();<NEW_LINE>forceCloseFutures.add(f);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>LOG.warn("Waiting for " + forceCloseFutures.size() + " client channels to be closed.");<NEW_LINE>PromiseCombiner closePromisesCombiner = new PromiseCombiner(ImmediateEventExecutor.INSTANCE);<NEW_LINE>closePromisesCombiner.addAll(forceCloseFutures.toArray(new ChannelFuture[0]));<NEW_LINE>Promise<Void> combinedClosePromise = executor.newPromise();<NEW_LINE>closePromisesCombiner.finish(combinedClosePromise);<NEW_LINE>combinedClosePromise.await(5, TimeUnit.SECONDS);<NEW_LINE>LOG.warn(forceCloseFutures.size() + " client channels closed.");<NEW_LINE>} catch (InterruptedException ie) {<NEW_LINE>LOG.warn("Interrupted while shutting down client channels");<NEW_LINE>}<NEW_LINE>} | = new PromiseCombiner(ImmediateEventExecutor.INSTANCE); |
35,684 | @Consumes("application/json")<NEW_LINE>public Response addProvJson(String body, @PathParam("id") String idSupplied, @QueryParam("entityName") String entityName) {<NEW_LINE>if (!systemConfig.isProvCollectionEnabled()) {<NEW_LINE>return error(FORBIDDEN, BundleUtil.getStringFromBundle("api.prov.error.provDisabled"));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>DataFile dataFile = findDataFileOrDie(idSupplied);<NEW_LINE>if (null == dataFile.getFileMetadata()) {<NEW_LINE>// can happen when a datafile is not fully initialized, though unlikely in our current implementation<NEW_LINE>return error(BAD_REQUEST, BundleUtil.getStringFromBundle("api.prov.error.badDataFileId"));<NEW_LINE>}<NEW_LINE>if (dataFile.isReleased() && dataFile.getProvEntityName() != null) {<NEW_LINE>return error(FORBIDDEN<MASK><NEW_LINE>}<NEW_LINE>if (!provUtil.isProvValid(body)) {<NEW_LINE>return error(BAD_REQUEST, BundleUtil.getStringFromBundle("file.editProvenanceDialog.invalidSchemaError"));<NEW_LINE>} | , BundleUtil.getStringFromBundle("api.prov.error.jsonUpdateNotAllowed")); |
725,607 | public OutputFormatterCallback<Target> createPostFactoStreamCallback(OutputStream out, QueryOptions options) {<NEW_LINE>return new OutputFormatterCallback<Target>() {<NEW_LINE><NEW_LINE>private Document doc;<NEW_LINE><NEW_LINE>private Element queryElem;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void start() {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>doc = factory.newDocumentBuilder().newDocument();<NEW_LINE>} catch (ParserConfigurationException e) {<NEW_LINE>// This shouldn't be possible: all the configuration is hard-coded.<NEW_LINE>throw new IllegalStateException("XML output failed", e);<NEW_LINE>}<NEW_LINE>doc.setXmlVersion("1.1");<NEW_LINE>queryElem = doc.createElement("query");<NEW_LINE>queryElem.setAttribute("version", "2");<NEW_LINE>doc.appendChild(queryElem);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void processOutput(Iterable<Target> partialResult) throws InterruptedException {<NEW_LINE>for (Target target : partialResult) {<NEW_LINE>queryElem.appendChild(createTargetElement(doc, target));<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void close(boolean failFast) {<NEW_LINE>if (!failFast) {<NEW_LINE>try {<NEW_LINE>Transformer transformer = TransformerFactory.newInstance().newTransformer();<NEW_LINE>transformer.setOutputProperty(OutputKeys.INDENT, "yes");<NEW_LINE>transformer.transform(new DOMSource(doc), new StreamResult(out));<NEW_LINE>} catch (TransformerFactoryConfigurationError | TransformerException e) {<NEW_LINE>// This shouldn't be possible: all the configuration is hard-coded.<NEW_LINE>throw new IllegalStateException("XML output failed", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); |
1,335,897 | public void putDocument(T attributes) throws SearchServiceException {<NEW_LINE>if (client == null) {<NEW_LINE>log.warning(ERROR_SEARCH_NOT_IMPLEMENTED);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (attributes == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, Object> searchableFields = createDocument(attributes).getSearchableFields();<NEW_LINE>SolrInputDocument document = new SolrInputDocument();<NEW_LINE>searchableFields.forEach((key, value) -> document.addField(key, value));<NEW_LINE>try {<NEW_LINE>client.add(getCollectionName(), Collections.singleton(document));<NEW_LINE><MASK><NEW_LINE>} catch (SolrServerException e) {<NEW_LINE>log.severe(String.format(ERROR_PUT_DOCUMENT, document, e.getRootCause()), e);<NEW_LINE>throw new SearchServiceException(e, HttpStatus.SC_BAD_GATEWAY);<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.severe(String.format(ERROR_PUT_DOCUMENT, document, e.getCause()), e);<NEW_LINE>throw new SearchServiceException(e, HttpStatus.SC_BAD_GATEWAY);<NEW_LINE>}<NEW_LINE>} | client.commit(getCollectionName()); |
583,453 | protected IStatus run(DBRProgressMonitor dbrMonitor) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>if (resource instanceof IFolder) {<NEW_LINE>((IFolder) resource).delete(true, true, monitor);<NEW_LINE>} else if (resource instanceof IProject) {<NEW_LINE>// Delete project<NEW_LINE>DBWorkbench.getPlatform().getGlobalEventManager().fireGlobalEvent(DBTTaskRegistry.EVENT_BEFORE_PROJECT_DELETE, Map.of(DBTTaskRegistry.EVENT_PARAM_PROJECT, resource.getName()));<NEW_LINE>((IProject) resource).delete(deleteContent, true, monitor);<NEW_LINE>} else if (resource != null) {<NEW_LINE>resource.delete(IResource.FORCE | IResource.KEEP_HISTORY, monitor);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>return GeneralUtils.makeExceptionStatus(NLS.bind(UINavigatorMessages.error_deleting_resource_message, resource.getFullPath().toString()), e);<NEW_LINE>}<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>} | IProgressMonitor monitor = dbrMonitor.getNestedMonitor(); |
464,223 | private static void configureHttpPercentiles(MeterRegistry.Config config) {<NEW_LINE>String percentiles = System.getProperty(HTTP_PERCENTILES_PROPERTY);<NEW_LINE>if (null != percentiles) {<NEW_LINE>double[] finalPercentiles = Arrays.stream(percentiles.split(",")).map(String::trim).flatMapToDouble(p -> {<NEW_LINE>try {<NEW_LINE>double percentile = Double.parseDouble(p);<NEW_LINE>if (Double.isFinite(percentile) && percentile >= 0.0 && percentile <= 1.0) {<NEW_LINE>return DoubleStream.of(percentile);<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>}<NEW_LINE>logger.warn("Value \"{}\" can not be used as the percentile for the {}, was expecting a double [0, 1].", p, HTTP_PERCENTILES_PROPERTY);<NEW_LINE>return DoubleStream.empty();<NEW_LINE>}).toArray();<NEW_LINE>if (finalPercentiles.length > 0) {<NEW_LINE>config.meterFilter(new PercentilesMeterFilter<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (finalPercentiles, StargateMetricConstants.METRIC_HTTP_SERVER_REQUESTS)); |
771,017 | private void writeRemappedClass(URL classUrl, JarOutputStream jarStream, String targetPackage) throws IOException {<NEW_LINE>InputStream inputStream = classUrl.openStream();<NEW_LINE>String sourceInternalName = getClassInternalName(classUrl);<NEW_LINE>String targetInternalName = getTargetInternalName(sourceInternalName, targetPackage);<NEW_LINE>SimpleRemapper remapper <MASK><NEW_LINE>ClassReader reader = new ClassReader(inputStream);<NEW_LINE>ClassWriter writer = new ClassWriter(reader, ClassWriter.COMPUTE_FRAMES);<NEW_LINE>ClassRemapper remappingVisitor = new ClassRemapper(writer, remapper);<NEW_LINE>ClassVisitor versionVisitor = new AddVersionFieldClassAdapter(remappingVisitor, VERSION_FIELD_NAME, getCurrentVersion());<NEW_LINE>reader.accept(versionVisitor, ClassReader.EXPAND_FRAMES);<NEW_LINE>JarEntry jarEntry = new JarEntry(targetInternalName + ".class");<NEW_LINE>jarStream.putNextEntry(jarEntry);<NEW_LINE>jarStream.write(writer.toByteArray());<NEW_LINE>} | = new SimpleRemapper(sourceInternalName, targetInternalName); |
1,359,889 | public S3ResourceClassificationUpdate unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>S3ResourceClassificationUpdate s3ResourceClassificationUpdate = new S3ResourceClassificationUpdate();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><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("bucketName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>s3ResourceClassificationUpdate.setBucketName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("prefix", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>s3ResourceClassificationUpdate.setPrefix(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("classificationTypeUpdate", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>s3ResourceClassificationUpdate.setClassificationTypeUpdate(ClassificationTypeUpdateJsonUnmarshaller.getInstance().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 s3ResourceClassificationUpdate;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,457,899 | static TableMetadata createTableMetadata() {<NEW_LINE>ImmutableList.Builder<ColumnMetadata> columnBuilder = ImmutableList.builder();<NEW_LINE>columnBuilder.add(new ColumnMetadata(COL_INTERFACE, Schema.INTERFACE, "Interface", true, false));<NEW_LINE>columnBuilder.add(new ColumnMetadata(COL_VRF, Schema.STRING, "VRF", true, false));<NEW_LINE>columnBuilder.add(new ColumnMetadata(COL_IP, Schema.IP, "Ip", true, false));<NEW_LINE>columnBuilder.add(new ColumnMetadata(COL_AREA, Schema.LONG, "Area", true, false));<NEW_LINE>columnBuilder.add(new ColumnMetadata(COL_REMOTE_INTERFACE, Schema.INTERFACE, "Remote Interface", false, true));<NEW_LINE>columnBuilder.add(new ColumnMetadata(COL_REMOTE_VRF, Schema.STRING, "Remote VRF", false, true));<NEW_LINE>columnBuilder.add(new ColumnMetadata(COL_REMOTE_IP, Schema.IP, "Remote IP", false, true));<NEW_LINE>columnBuilder.add(new ColumnMetadata(COL_REMOTE_AREA, Schema.LONG, "Remote Area", false, true));<NEW_LINE>columnBuilder.add(new ColumnMetadata(COL_SESSION_STATUS, Schema.STRING<MASK><NEW_LINE>return new TableMetadata(columnBuilder.build(), "Display OSPF sessions");<NEW_LINE>} | , "Status of the OSPF session", false, true)); |
1,119,764 | public String refresh(@RequestAttribute SysSite site, @SessionAttribute SysUser admin, String path, Long[] ids, HttpServletRequest request, ModelMap model) {<NEW_LINE>SysDept dept = sysDeptService.getEntity(admin.getDeptId());<NEW_LINE>if (ControllerUtils.verifyNotEmpty("deptId", admin.getDeptId(), model) || ControllerUtils.verifyNotEmpty("deptId", dept, model) || ControllerUtils.verifyCustom("noright", !(dept.isOwnsAllPage() || null != sysDeptPageService.getEntity(new SysDeptPageId(admin.getDeptId(), CommonConstants.SEPARATOR + TemplateComponent.INCLUDE_DIRECTORY + path))), model)) {<NEW_LINE>return CommonConstants.TEMPLATE_ERROR;<NEW_LINE>}<NEW_LINE>if (CommonUtils.notEmpty(ids)) {<NEW_LINE>service.refresh(site.getId(), ids, path);<NEW_LINE>logOperateService.save(new LogOperate(site.getId(), admin.getId(), LogLoginService.CHANNEL_WEB_MANAGER, "refresh.place", RequestUtils.getIpAddress(request), CommonUtils.getDate(), StringUtils.join(ids, CommonConstants.COMMA)));<NEW_LINE>if (CmsFileUtils.exists(siteComponent.getWebFilePath(site, TemplateComponent.INCLUDE_DIRECTORY + path))) {<NEW_LINE>try {<NEW_LINE>String filePath = siteComponent.getWebTemplateFilePath(site, TemplateComponent.INCLUDE_DIRECTORY + path);<NEW_LINE>CmsPlaceMetadata metadata = metadataComponent.getPlaceMetadata(filePath);<NEW_LINE>templateComponent.staticPlace(site, path, metadata);<NEW_LINE>} catch (IOException | TemplateException e) {<NEW_LINE>log.error(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return CommonConstants.TEMPLATE_DONE;<NEW_LINE>} | e.getMessage(), e); |
1,121,962 | public void serialize(DataOutputStream output) throws IOException {<NEW_LINE>output.writeBoolean(useNewAPI);<NEW_LINE>if (useNewAPI) {<NEW_LINE>int size = splitsNewAPI.size();<NEW_LINE>output.writeInt(size);<NEW_LINE>output.writeInt(locations.length);<NEW_LINE>for (int i = 0; i < locations.length; i++) {<NEW_LINE>output.writeUTF(locations[i]);<NEW_LINE>}<NEW_LINE>if (size > 0) {<NEW_LINE>output.writeUTF(splitsNewAPI.get(0).getClass().getName());<NEW_LINE>SerializationFactory factory = new SerializationFactory(new Configuration());<NEW_LINE>Serializer serializer = factory.getSerializer(splitsNewAPI.get(0).getClass());<NEW_LINE>serializer.open(output);<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>serializer.serialize(splitsNewAPI.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>int size = splitsOldAPI.size();<NEW_LINE>output.writeInt(size);<NEW_LINE>output.writeInt(locations.length);<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>output.writeUTF(locations[i]);<NEW_LINE>}<NEW_LINE>if (size > 0) {<NEW_LINE>output.writeUTF(splitsOldAPI.get(0).getClass().getName());<NEW_LINE>SerializationFactory factory = new SerializationFactory(new Configuration());<NEW_LINE>Serializer serializer = factory.getSerializer(splitsOldAPI.get<MASK><NEW_LINE>serializer.open(output);<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>serializer.serialize(splitsOldAPI.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (0).getClass()); |
841,462 | protected void saveSetAssociateResults(SetStruct set) {<NEW_LINE>// used to store the size of the structure from a previous iteration<NEW_LINE>int before = matches.size;<NEW_LINE>// Copy the results from being local to this set into the original input indexes<NEW_LINE>FastAccess<AssociatedIndex<MASK><NEW_LINE>matches.resize(matches.size + setMatches.size);<NEW_LINE>for (int assocIdx = 0; assocIdx < setMatches.size; assocIdx++) {<NEW_LINE>AssociatedIndex sa = setMatches.get(assocIdx);<NEW_LINE>int inputIdxSrc = set.indexSrc.data[sa.src];<NEW_LINE>int inputIdxDst = set.indexDst.data[sa.dst];<NEW_LINE>matches.data[before + assocIdx].setTo(inputIdxSrc, inputIdxDst, sa.fitScore);<NEW_LINE>}<NEW_LINE>// Copy unassociated indexes over and updated indexes to input indexes<NEW_LINE>DogArray_I32 setUnassociatedSrc = _associator.getUnassociatedSource();<NEW_LINE>before = unassociatedSrc.size;<NEW_LINE>unassociatedSrc.extend(before + setUnassociatedSrc.size);<NEW_LINE>for (int i = 0; i < setUnassociatedSrc.size; i++) {<NEW_LINE>unassociatedSrc.data[before + i] = set.indexSrc.data[setUnassociatedSrc.get(i)];<NEW_LINE>}<NEW_LINE>DogArray_I32 setUnassociatedDst = _associator.getUnassociatedDestination();<NEW_LINE>before = unassociatedDst.size;<NEW_LINE>unassociatedDst.extend(before + setUnassociatedDst.size);<NEW_LINE>for (int i = 0; i < setUnassociatedDst.size; i++) {<NEW_LINE>unassociatedDst.data[before + i] = set.indexDst.data[setUnassociatedDst.get(i)];<NEW_LINE>}<NEW_LINE>} | > setMatches = _associator.getMatches(); |
833,092 | @Consumes(MediaType.APPLICATION_JSON)<NEW_LINE>@Produces(MediaType.APPLICATION_JSON)<NEW_LINE>@Operation(description = "Add the specified public key to the service.")<NEW_LINE>public void putPublicKeyEntry(@Parameter(description = "name of the domain", required = true) @PathParam("domain") String domain, @Parameter(description = "name of the service", required = true) @PathParam("service") String service, @Parameter(description = "the identifier of the public key to be added", required = true) @PathParam("id") String id, @Parameter(description = "Audit param required(not empty) if domain auditEnabled is true.", required = true) @HeaderParam("Y-Audit-Ref") String auditRef, @Parameter(description = "PublicKeyEntry object to be added/updated in the service", required = true) PublicKeyEntry publicKeyEntry) {<NEW_LINE>int code = ResourceException.OK;<NEW_LINE>ResourceContext context = null;<NEW_LINE>try {<NEW_LINE>context = this.delegate.newResourceContext(this.<MASK><NEW_LINE>context.authorize("update", "" + domain + ":service." + service + "", null);<NEW_LINE>this.delegate.putPublicKeyEntry(context, domain, service, id, auditRef, publicKeyEntry);<NEW_LINE>} catch (ResourceException e) {<NEW_LINE>code = e.getCode();<NEW_LINE>switch(code) {<NEW_LINE>case ResourceException.BAD_REQUEST:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.CONFLICT:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.FORBIDDEN:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.NOT_FOUND:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.TOO_MANY_REQUESTS:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.UNAUTHORIZED:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>default:<NEW_LINE>System.err.println("*** Warning: undeclared exception (" + code + ") for resource putPublicKeyEntry");<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>this.delegate.publishChangeMessage(context, code);<NEW_LINE>this.delegate.recordMetrics(context, code);<NEW_LINE>}<NEW_LINE>} | request, this.response, "putPublicKeyEntry"); |
804,568 | public void compress(int[] values, ByteBuffer bb) {<NEW_LINE>RunLength<MASK><NEW_LINE>int[] counts = rl.getCounts();<NEW_LINE>int[] keys = rl.getValues();<NEW_LINE>int esc = Math.max(1, (1 << (MathUtil.log2(counts.length) - 2)) - 1);<NEW_LINE>VLC vlc = buildCodes(counts, esc);<NEW_LINE>int[] codes = vlc.getCodes();<NEW_LINE>int[] codeSizes = vlc.getCodeSizes();<NEW_LINE>bb.putInt(codes.length);<NEW_LINE>for (int i = 0; i < codes.length; i++) {<NEW_LINE>bb.put((byte) codeSizes[i]);<NEW_LINE>bb.putShort((short) (codes[i] >>> 16));<NEW_LINE>bb.putInt(keys[i]);<NEW_LINE>}<NEW_LINE>BitWriter br = new BitWriter(bb);<NEW_LINE>for (int j = 0; j < values.length; j++) {<NEW_LINE>int l = values[j];<NEW_LINE>for (int i = 0; i < keys.length; i++) if (keys[i] == l) {<NEW_LINE>vlc.writeVLC(br, i);<NEW_LINE>if (codes[i] == esc)<NEW_LINE>br.writeNBit(i, 16);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>br.flush();<NEW_LINE>} | .Integer rl = getValueStats(values); |
159,928 | // Binary Search<NEW_LINE>public static void main(String[] args) {<NEW_LINE>// Creating Scanner Object for taking Inputs from the USER<NEW_LINE>Scanner sc = new Scanner(System.in);<NEW_LINE>// Take the SIZE of the Array from the USER<NEW_LINE>System.out.print(" Enter SIZE of the Array: ");<NEW_LINE>int n = sc.nextInt();<NEW_LINE>// Create Array of Required SIZE<NEW_LINE>int[] arr = new int[n];<NEW_LINE>// fill the Array By Taking n inputs from the USER<NEW_LINE>System.out.print(" Enter " + n + " Elements: ");<NEW_LINE>for (int i = 0; i < n; i++) arr[i] = sc.nextInt();<NEW_LINE>// Display the Array<NEW_LINE>System.out.println(Arrays.toString(arr));<NEW_LINE>// take the Target Element from the USER<NEW_LINE>System.out.print(" Enter target Element to Find: ");<NEW_LINE><MASK><NEW_LINE>// Display if the Element Found or not<NEW_LINE>System.out.println(target + " Found at Index: " + search(arr, target));<NEW_LINE>} | int target = sc.nextInt(); |
1,159,770 | public byte[] read_size_and_inflate() throws IOException {<NEW_LINE>final int size = read4BE();<NEW_LINE>final byte[] buf = new byte[size];<NEW_LINE>final java.util.zip.Inflater inflater = new java.util.zip.Inflater();<NEW_LINE>final java.util.zip.InflaterInputStream is = new java.util.zip.InflaterInputStream(this, inflater);<NEW_LINE>try {<NEW_LINE>int pos = 0;<NEW_LINE>while (pos < size) {<NEW_LINE>// Inflate fully<NEW_LINE>final int dsize = is.read(buf, pos, size - pos);<NEW_LINE>if (dsize == 0)<NEW_LINE>break;<NEW_LINE>pos += dsize;<NEW_LINE>}<NEW_LINE>if (pos < size) {<NEW_LINE>throw new IOException("Decompression gave " + pos + " bytes, not " + size);<NEW_LINE>}<NEW_LINE>// Back up if the inflater read ahead:<NEW_LINE><MASK><NEW_LINE>setPos(getPos() - read_ahead);<NEW_LINE>} finally {<NEW_LINE>is.close();<NEW_LINE>}<NEW_LINE>return buf;<NEW_LINE>} | int read_ahead = inflater.getRemaining(); |
236,792 | public JMenuBar createMenu(JPanel searchPanel, JPanel zoomPanel, JToggleButton mailButton) {<NEW_LINE>JMenuBar menu = new JMenuBar();<NEW_LINE>menuFactory = MenuFactorySwing.getInstance();<NEW_LINE>JMenu fileMenu = new JMenu(MenuConstants.FILE);<NEW_LINE>fileMenu.setMnemonic(KeyEvent.VK_F);<NEW_LINE>fileMenu.add(menuFactory.createNew());<NEW_LINE>fileMenu.add(menuFactory.createOpen());<NEW_LINE>fileMenu.add(menuFactory.createClose());<NEW_LINE>fileMenu.add(menuFactory.createRecentFiles());<NEW_LINE>fileMenu.addSeparator();<NEW_LINE>fileMenu.add(menuFactory.createGenerate());<NEW_LINE>fileMenu.add(menuFactory.createGenerateOptions());<NEW_LINE>fileMenu.addSeparator();<NEW_LINE>fileMenu.add(menuFactory.createSave());<NEW_LINE>fileMenu.add(menuFactory.createSaveAs());<NEW_LINE>fileMenu.add(menuFactory.createExport());<NEW_LINE>fileMenu.add(menuFactory.createExportAs());<NEW_LINE>fileMenu.add(menuFactory.createMailTo());<NEW_LINE>fileMenu.addSeparator();<NEW_LINE>fileMenu.add(menuFactory.createEditCurrentPalette());<NEW_LINE>fileMenu.addSeparator();<NEW_LINE>fileMenu.add(menuFactory.createOptions());<NEW_LINE>fileMenu.addSeparator();<NEW_LINE>fileMenu.add(menuFactory.createPrint());<NEW_LINE>fileMenu.addSeparator();<NEW_LINE>fileMenu.add(menuFactory.createExit());<NEW_LINE>menu.add(fileMenu);<NEW_LINE>editMenu = new JMenu(MenuConstants.EDIT);<NEW_LINE>editMenu.setMnemonic(KeyEvent.VK_E);<NEW_LINE>editMenu.add(editUndo = menuFactory.createUndo());<NEW_LINE>editMenu.add(editRedo = menuFactory.createRedo());<NEW_LINE>editMenu.add(editDelete = menuFactory.createDelete());<NEW_LINE>editMenu.addSeparator();<NEW_LINE>editMenu.add(editSelectAll = menuFactory.createSelectAll());<NEW_LINE>editMenu.add(editGroup = menuFactory.createGroup());<NEW_LINE>editMenu.add(editUngroup = menuFactory.createUngroup());<NEW_LINE>editMenu.addSeparator();<NEW_LINE>editMenu.add(editCopy = menuFactory.createCopy());<NEW_LINE>editMenu.add(<MASK><NEW_LINE>editMenu.add(editPaste = menuFactory.createPaste(false));<NEW_LINE>menu.add(editMenu);<NEW_LINE>editDelete.setEnabled(false);<NEW_LINE>editGroup.setEnabled(false);<NEW_LINE>editCut.setEnabled(false);<NEW_LINE>editPaste.setEnabled(false);<NEW_LINE>editUngroup.setEnabled(false);<NEW_LINE>// Custom Element Menu<NEW_LINE>JMenu menu_custom = new JMenu(MenuConstants.CUSTOM_ELEMENTS);<NEW_LINE>menu_custom.setMnemonic(KeyEvent.VK_C);<NEW_LINE>menu_custom.add(customNew = menuFactory.createNewCustomElement());<NEW_LINE>menu_custom.add(customNewFromTemplate = menuFactory.createNewCustomElementFromTemplate());<NEW_LINE>menu_custom.add(customEdit = menuFactory.createEditSelected());<NEW_LINE>menu_custom.addSeparator();<NEW_LINE>menu_custom.add(menuFactory.createCustomElementTutorial());<NEW_LINE>menu.add(menu_custom);<NEW_LINE>customEdit.setEnabled(false);<NEW_LINE>// Help Menu<NEW_LINE>JMenu helpMenu = new JMenu(MenuConstants.HELP);<NEW_LINE>helpMenu.setMnemonic(KeyEvent.VK_H);<NEW_LINE>helpMenu.add(menuFactory.createOnlineHelp());<NEW_LINE>helpMenu.add(menuFactory.createOnlineSampleDiagrams());<NEW_LINE>helpMenu.add(menuFactory.createVideoTutorials());<NEW_LINE>helpMenu.addSeparator();<NEW_LINE>helpMenu.add(menuFactory.createProgramHomepage());<NEW_LINE>helpMenu.add(menuFactory.createRateProgram());<NEW_LINE>helpMenu.addSeparator();<NEW_LINE>helpMenu.add(menuFactory.createAboutProgram());<NEW_LINE>menu.add(helpMenu);<NEW_LINE>menu.add(searchPanel);<NEW_LINE>menu.add(zoomPanel);<NEW_LINE>this.mailButton = mailButton;<NEW_LINE>menu.add(mailButton);<NEW_LINE>return menu;<NEW_LINE>} | editCut = menuFactory.createCut()); |
733,227 | public void runHarvest(HarvestingClient harvestingClient) {<NEW_LINE>try {<NEW_LINE>DataverseRequest dataverseRequest = new DataverseRequest(session.getUser(), (HttpServletRequest) null);<NEW_LINE>harvesterService.doAsyncHarvest(dataverseRequest, harvestingClient);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>String failMessage = BundleUtil.getStringFromBundle("harvest.start.error");<NEW_LINE>JH.addMessage(FacesMessage.SEVERITY_FATAL, failMessage);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String successMessage = BundleUtil.getStringFromBundle("harvestclients.actions.runharvest.success");<NEW_LINE>successMessage = successMessage.replace(<MASK><NEW_LINE>JsfHelper.addSuccessMessage(successMessage);<NEW_LINE>// refresh the harvesting clients list - we want this one to be showing<NEW_LINE>// "inprogress"; and we want to be able to disable all the actions buttons<NEW_LINE>// for it:<NEW_LINE>// (looks like we need to sleep for a few milliseconds here, to make sure<NEW_LINE>// it has already been updated with the "inprogress" setting)<NEW_LINE>try {<NEW_LINE>Thread.sleep(500L);<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>configuredHarvestingClients = harvestingClientService.getAllHarvestingClients();<NEW_LINE>} | "{0}", harvestingClient.getName()); |
822,570 | public static void main(String... args) {<NEW_LINE>Map<String, Object> props = new HashMap<>();<NEW_LINE>props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");<NEW_LINE>props.put(ProducerConfig.RETRIES_CONFIG, 0);<NEW_LINE>props.put(ProducerConfig.BATCH_SIZE_CONFIG, 16384);<NEW_LINE>props.put(ProducerConfig.LINGER_MS_CONFIG, 1);<NEW_LINE>props.put(ProducerConfig.BUFFER_MEMORY_CONFIG, 33554432);<NEW_LINE>props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);<NEW_LINE>props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, LongSerializer.class);<NEW_LINE>List<KeyValue<String, Long>> userClicks = Arrays.asList(new KeyValue<>("alice", 13L), new KeyValue<>("bob", 4L), new KeyValue<>("chao", 25L), new KeyValue<>("bob", 19L), new KeyValue<>("dave", 56L), new KeyValue<>("eve", 78L), new KeyValue<>("alice", 40L), new KeyValue<>("fang", 99L));<NEW_LINE>DefaultKafkaProducerFactory<String, Long> pf = new DefaultKafkaProducerFactory<>(props);<NEW_LINE>KafkaTemplate<String, Long> template = new <MASK><NEW_LINE>template.setDefaultTopic("user-clicks");<NEW_LINE>for (KeyValue<String, Long> keyValue : userClicks) {<NEW_LINE>template.sendDefault(keyValue.key, keyValue.value);<NEW_LINE>}<NEW_LINE>List<KeyValue<String, String>> userRegions = Arrays.asList(new KeyValue<>("alice", "asia"), /* Alice lived in Asia originally... */<NEW_LINE>new KeyValue<>("bob", "americas"), new KeyValue<>("chao", "asia"), new KeyValue<>("dave", "europe"), new KeyValue<>("alice", "europe"), /* ...but moved to Europe some time later. */<NEW_LINE>new KeyValue<>("eve", "americas"), new KeyValue<>("fang", "asia"));<NEW_LINE>props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);<NEW_LINE>props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class);<NEW_LINE>DefaultKafkaProducerFactory<String, String> pf1 = new DefaultKafkaProducerFactory<>(props);<NEW_LINE>KafkaTemplate<String, String> template1 = new KafkaTemplate<>(pf1, true);<NEW_LINE>template1.setDefaultTopic("user-regions");<NEW_LINE>for (KeyValue<String, String> keyValue : userRegions) {<NEW_LINE>template1.sendDefault(keyValue.key, keyValue.value);<NEW_LINE>}<NEW_LINE>} | KafkaTemplate<>(pf, true); |
1,398,380 | void persistChannelListener(final String groupId, final List<String> memberList) {<NEW_LINE>mScheduler.execute(() -> {<NEW_LINE>Connection connection = null;<NEW_LINE>PreparedStatement statement = null;<NEW_LINE>try {<NEW_LINE>connection = DBUtil.getConnection();<NEW_LINE>connection.setAutoCommit(false);<NEW_LINE>String sql = "insert into t_channel_listener (`_cid`" + ", `_mid`" + ", `_dt`) values(?, ?, ?)" + " ON DUPLICATE KEY UPDATE " + "`_dt` = ?";<NEW_LINE>statement = connection.prepareStatement(sql);<NEW_LINE>long dt = System.currentTimeMillis();<NEW_LINE>for (String member : memberList) {<NEW_LINE>int index = 1;<NEW_LINE>statement.setString(index++, groupId);<NEW_LINE>statement.setString(index++, member);<NEW_LINE>statement.setLong(index++, dt);<NEW_LINE>statement.setLong(index++, dt);<NEW_LINE>int count = statement.executeUpdate();<NEW_LINE>LOG.info("Update rows {}", count);<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e.printStackTrace();<NEW_LINE>Utility.<MASK><NEW_LINE>} finally {<NEW_LINE>if (connection != null) {<NEW_LINE>try {<NEW_LINE>connection.commit();<NEW_LINE>connection.setAutoCommit(true);<NEW_LINE>} catch (SQLException e1) {<NEW_LINE>e1.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DBUtil.closeDB(connection, statement);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | printExecption(LOG, e, RDBS_Exception); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.