idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
389,881 | protected Solver.SolutionInfo solve(DataSet x) {<NEW_LINE>final int l = x.size(), l2 = l << 1;<NEW_LINE>double[] alpha2 = new double[l2], linear_term = new double[l2];<NEW_LINE>for (int i = 0; i < l; i++) {<NEW_LINE>final double v = x.value(i);<NEW_LINE>linear_term[i] = p - v;<NEW_LINE>linear_term[i + l] = p + v;<NEW_LINE>}<NEW_LINE>byte[] y = new byte[l2];<NEW_LINE>Arrays.fill(<MASK><NEW_LINE>Arrays.fill(y, l, l2, MONE);<NEW_LINE>QMatrix Q = new SVR_Q(x, cache_size);<NEW_LINE>Q.initialize();<NEW_LINE>Solver.SolutionInfo si = new Solver().solve(l2, Q, linear_term, y, alpha2, C, C, eps, shrinking);<NEW_LINE>// Update alpha<NEW_LINE>double sum_alpha = 0;<NEW_LINE>for (int i = 0; i < l; i++) {<NEW_LINE>si.alpha[i] = alpha2[i] - alpha2[i + l];<NEW_LINE>sum_alpha += Math.abs(si.alpha[i]);<NEW_LINE>}<NEW_LINE>LOG.verbose("nu = " + (sum_alpha / (C * l)));<NEW_LINE>return si;<NEW_LINE>} | y, 0, l, ONE); |
347,053 | private void createNetModeTransaction() throws InvalidArgumentException {<NEW_LINE>if (chaincodeType == null) {<NEW_LINE>throw new InvalidArgumentException("Chaincode type is required");<NEW_LINE>}<NEW_LINE>List<String> modlist = new LinkedList<>();<NEW_LINE>modlist.add("init");<NEW_LINE>modlist.addAll(argList);<NEW_LINE>switch(chaincodeType) {<NEW_LINE>case JAVA:<NEW_LINE>ccType(<MASK><NEW_LINE>break;<NEW_LINE>case NODE:<NEW_LINE>ccType(Chaincode.ChaincodeSpec.Type.NODE);<NEW_LINE>break;<NEW_LINE>case GO_LANG:<NEW_LINE>ccType(Chaincode.ChaincodeSpec.Type.GOLANG);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new InvalidArgumentException("Requested chaincode type is not supported: " + chaincodeType);<NEW_LINE>}<NEW_LINE>Chaincode.ChaincodeDeploymentSpec depspec = createDeploymentSpec(ccType, chaincodeName, chaincodePath, chaincodeVersion, modlist, null);<NEW_LINE>List<ByteString> argList = new ArrayList<>();<NEW_LINE>// command<NEW_LINE>argList.add(ByteString.copyFromUtf8(action));<NEW_LINE>// channel name.<NEW_LINE>argList.add(ByteString.copyFromUtf8(context.getChannelID()));<NEW_LINE>argList.add(depspec.toByteString());<NEW_LINE>if (chaincodePolicy != null) {<NEW_LINE>argList.add(ByteString.copyFrom(chaincodePolicy));<NEW_LINE>} else if (null != chaincodeCollectionConfiguration) {<NEW_LINE>// place holder for chaincodePolicy<NEW_LINE>argList.add(ByteString.EMPTY);<NEW_LINE>}<NEW_LINE>if (null != chaincodeCollectionConfiguration) {<NEW_LINE>// escc name place holder<NEW_LINE>argList.add(ByteString.EMPTY);<NEW_LINE>// vscc name place holder<NEW_LINE>argList.add(ByteString.EMPTY);<NEW_LINE>argList.add(ByteString.copyFrom(chaincodeCollectionConfiguration));<NEW_LINE>}<NEW_LINE>args(argList);<NEW_LINE>} | Chaincode.ChaincodeSpec.Type.JAVA); |
921,738 | public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'petId' is set<NEW_LINE>if (petId == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'requiredFile' is set<NEW_LINE>if (requiredFile == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile".replaceAll("\\{format\\}", "json").replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (additionalMetadata != null)<NEW_LINE>localVarFormParams.put("additionalMetadata", additionalMetadata);<NEW_LINE>if (requiredFile != null)<NEW_LINE>localVarFormParams.put("requiredFile", requiredFile);<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "multipart/form-data" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames <MASK><NEW_LINE>GenericType<ModelApiResponse> localVarReturnType = new GenericType<ModelApiResponse>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | = new String[] { "petstore_auth" }; |
750,797 | public static void main(String[] args) throws Exception {<NEW_LINE>try {<NEW_LINE>if (args.length < 1) {<NEW_LINE><MASK><NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>String zkHost = DEFAULT_ZK_HOST;<NEW_LINE>int zkPort = DEFAULT_ZK_PORT;<NEW_LINE>if (args.length == 1) {<NEW_LINE>zkPort = Integer.parseInt(args[0]);<NEW_LINE>} else {<NEW_LINE>zkHost = args[0];<NEW_LINE>zkPort = Integer.parseInt(args[1]);<NEW_LINE>}<NEW_LINE>final File zkDir = IOUtils.createTempDir("distrlog", "zookeeper");<NEW_LINE>final LocalDLMEmulator localDlm = LocalDLMEmulator.newBuilder().zkHost(zkHost).zkPort(zkPort).build();<NEW_LINE>Runtime.getRuntime().addShutdownHook(new Thread() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>localDlm.teardown();<NEW_LINE>FileUtils.forceDeleteOnExit(zkDir);<NEW_LINE>System.out.println("ByeBye!");<NEW_LINE>} catch (Exception e) {<NEW_LINE>// do nothing<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>localDlm.start();<NEW_LINE>System.out.println(String.format("DistributedLog Sandbox is running now. You could access distributedlog://%s:%s", zkHost, zkPort));<NEW_LINE>} catch (Exception ex) {<NEW_LINE>System.out.println("Exception occurred running emulator " + ex);<NEW_LINE>}<NEW_LINE>} | System.out.println("Usage: LocalDLEmulator [<zk_host>] <zk_port>"); |
169,384 | final DeleteDocumentResult executeDeleteDocument(DeleteDocumentRequest deleteDocumentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteDocumentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteDocumentRequest> request = null;<NEW_LINE>Response<DeleteDocumentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteDocumentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDocumentRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDocument");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteDocumentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDocumentResultJsonUnmarshaller());<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>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
1,057,252 | public final void destroy() {<NEW_LINE>if (cancelledFlag.getAndSet(true)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int timeToWait = destroyImpl();<NEW_LINE>if (waitTask == null) {<NEW_LINE>// this could be in a case if exception occured during the process<NEW_LINE>// creation ...<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>waitTask.get(timeToWait, TimeUnit.SECONDS);<NEW_LINE>return;<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>} catch (ExecutionException ex) {<NEW_LINE>} catch (TimeoutException ex) {<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>exitValue();<NEW_LINE>// No exception means successful termination<NEW_LINE>return;<NEW_LINE>} catch (IllegalThreadStateException ex) {<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>SignalSupport.signalProcess(execEnv, pid, Signal.SIGTERM);<NEW_LINE>} catch (UnsupportedOperationException ex) {<NEW_LINE>// ignore ...<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>waitTask.get(SIGKILL_TIMEOUT, TimeUnit.SECONDS);<NEW_LINE>return;<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>Thread<MASK><NEW_LINE>} catch (ExecutionException ex) {<NEW_LINE>} catch (TimeoutException ex) {<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>exitValue();<NEW_LINE>// No exception means successful termination<NEW_LINE>return;<NEW_LINE>} catch (IllegalThreadStateException ex) {<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>SignalSupport.signalProcess(execEnv, pid, Signal.SIGKILL);<NEW_LINE>} catch (UnsupportedOperationException ex) {<NEW_LINE>// ignore ...<NEW_LINE>}<NEW_LINE>} | .currentThread().interrupt(); |
622,837 | public OptionalLong allocatedSizeInBytes(Path path) {<NEW_LINE>assert Files.isRegularFile(path) : path;<NEW_LINE>final WString fileName = new WString("\\\\?\\" + path);<NEW_LINE><MASK><NEW_LINE>final int lpFileSizeLow = GetCompressedFileSizeW(fileName, lpFileSizeHigh);<NEW_LINE>if (lpFileSizeLow == INVALID_FILE_SIZE) {<NEW_LINE>final int err = Native.getLastError();<NEW_LINE>if (err != NO_ERROR) {<NEW_LINE>logger.warn("error [{}] when executing native method GetCompressedFileSizeW for file [{}]", err, path);<NEW_LINE>return OptionalLong.empty();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// convert lpFileSizeLow to unsigned long and combine with signed/shifted lpFileSizeHigh<NEW_LINE>final long allocatedSize = (((long) lpFileSizeHigh.getValue()) << Integer.SIZE) | Integer.toUnsignedLong(lpFileSizeLow);<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("executing native method GetCompressedFileSizeW returned [high={}, low={}, allocated={}] for file [{}]", lpFileSizeHigh, lpFileSizeLow, allocatedSize, path);<NEW_LINE>}<NEW_LINE>return OptionalLong.of(allocatedSize);<NEW_LINE>} | final IntByReference lpFileSizeHigh = new IntByReference(); |
134,228 | protected void sort(final int modelColumnIndex) {<NEW_LINE>int rows = getRowCount();<NEW_LINE>if (rows == 0)<NEW_LINE>return;<NEW_LINE>sorting = true;<NEW_LINE>// other column<NEW_LINE>if (modelColumnIndex != p_lastSortIndex)<NEW_LINE>p_asc = true;<NEW_LINE>else<NEW_LINE>p_asc = !p_asc;<NEW_LINE>p_lastSortIndex = modelColumnIndex;<NEW_LINE>//<NEW_LINE>log.config("#" + modelColumnIndex + " - rows=" + rows + ", asc=" + p_asc);<NEW_LINE>// Selection<NEW_LINE>Object selected = null;<NEW_LINE>int selRow = getSelectedRow();<NEW_LINE>// used to identify current row<NEW_LINE>int selCol = p_keyColumnIndex == -1 ? 0 : p_keyColumnIndex;<NEW_LINE>if (getSelectedRow() >= 0)<NEW_LINE>selected = getValueAt(selRow, selCol);<NEW_LINE>// Prepare sorting<NEW_LINE>DefaultTableModel <MASK><NEW_LINE>final MSort sort = new MSort(0, null);<NEW_LINE>sort.setSortAsc(p_asc);<NEW_LINE>// teo_sarca: [ 1585369 ] CTable sorting is TOO LAZY<NEW_LINE>Collections.sort(model.getDataVector(), new Comparator<Object>() {<NEW_LINE><NEW_LINE>public int compare(Object o1, Object o2) {<NEW_LINE>Object item1 = ((Vector) o1).get(modelColumnIndex);<NEW_LINE>Object item2 = ((Vector) o2).get(modelColumnIndex);<NEW_LINE>return sort.compare(item1, item2);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// selection<NEW_LINE>clearSelection();<NEW_LINE>if (selected != null) {<NEW_LINE>for (int r = 0; r < rows; r++) {<NEW_LINE>if (selected.equals(getValueAt(r, selCol))) {<NEW_LINE>setRowSelectionInterval(r, r);<NEW_LINE>// teo_sarca: bug fix [ 1585369 ]<NEW_LINE>scrollRectToVisible(getCellRect(r, modelColumnIndex, true));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// selected != null<NEW_LINE>sorting = false;<NEW_LINE>} | model = (DefaultTableModel) getModel(); |
661,330 | public void testCanReadEntityAndConsumeInvocationCallbackWithoutBuffering_String(Map<String, String> param, StringBuilder ret) {<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder();<NEW_LINE>Client c = cb.build();<NEW_LINE>Future<String> future = null;<NEW_LINE>AtomicReference<String> invCallbackResult = new AtomicReference<>("uninvoked");<NEW_LINE>InvocationCallback<String> callback = new InvocationCallback<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void completed(String s) {<NEW_LINE>invCallbackResult.set(s);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void failed(Throwable t) {<NEW_LINE>t.printStackTrace();<NEW_LINE>invCallbackResult.set(t.toString());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>try {<NEW_LINE>future = c.target("http://" + serverIP + ":" + serverPort + "/" + moduleName + "/Test/rest/hello").request().<MASK><NEW_LINE>String res = future.get(2, TimeUnit.MINUTES);<NEW_LINE>ret.append(invCallbackResult.get()).append(" ").append(res);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>ret.append("[Error]:" + e.toString());<NEW_LINE>} finally {<NEW_LINE>c.close();<NEW_LINE>}<NEW_LINE>} | async().get(callback); |
1,120,845 | public Request<RebootInstancesRequest> marshall(RebootInstancesRequest rebootInstancesRequest) {<NEW_LINE>if (rebootInstancesRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<RebootInstancesRequest> request = new DefaultRequest<RebootInstancesRequest>(rebootInstancesRequest, "AmazonEC2");<NEW_LINE>request.addParameter("Action", "RebootInstances");<NEW_LINE>request.addParameter("Version", "2016-11-15");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> rebootInstancesRequestInstanceIdsList = (com.amazonaws.internal.SdkInternalList<String>) rebootInstancesRequest.getInstanceIds();<NEW_LINE>if (!rebootInstancesRequestInstanceIdsList.isEmpty() || !rebootInstancesRequestInstanceIdsList.isAutoConstruct()) {<NEW_LINE>int instanceIdsListIndex = 1;<NEW_LINE>for (String rebootInstancesRequestInstanceIdsListValue : rebootInstancesRequestInstanceIdsList) {<NEW_LINE>if (rebootInstancesRequestInstanceIdsListValue != null) {<NEW_LINE>request.addParameter("InstanceId." + instanceIdsListIndex<MASK><NEW_LINE>}<NEW_LINE>instanceIdsListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | , StringUtils.fromString(rebootInstancesRequestInstanceIdsListValue)); |
568,880 | public void onScrollChanged(int scrollY, boolean firstScroll, boolean dragging) {<NEW_LINE>// Translate overlay and image<NEW_LINE>float flexibleRange = mFlexibleSpaceImageHeight - mActionBarSize;<NEW_LINE>int minOverlayTransitionY = mActionBarSize - mOverlayView.getHeight();<NEW_LINE>ViewHelper.setTranslationY(mOverlayView, ScrollUtils.getFloat(-scrollY, minOverlayTransitionY, 0));<NEW_LINE>ViewHelper.setTranslationY(mImageView, ScrollUtils.getFloat(-scrollY / 2, minOverlayTransitionY, 0));<NEW_LINE>// Change alpha of overlay<NEW_LINE>ViewHelper.setAlpha(mOverlayView, ScrollUtils.getFloat((float) scrollY / flexibleRange, 0, 1));<NEW_LINE>// Scale title text<NEW_LINE>float scale = 1 + ScrollUtils.getFloat((flexibleRange - scrollY) / flexibleRange, 0, MAX_TEXT_SCALE_DELTA);<NEW_LINE>ViewHelper.setPivotX(mTitleView, 0);<NEW_LINE>ViewHelper.setPivotY(mTitleView, 0);<NEW_LINE>ViewHelper.setScaleX(mTitleView, scale);<NEW_LINE>ViewHelper.setScaleY(mTitleView, scale);<NEW_LINE>// Translate title text<NEW_LINE>int maxTitleTranslationY = (int) (mFlexibleSpaceImageHeight - mTitleView.getHeight() * scale);<NEW_LINE>int titleTranslationY = maxTitleTranslationY - scrollY;<NEW_LINE>ViewHelper.setTranslationY(mTitleView, titleTranslationY);<NEW_LINE>// Translate FAB<NEW_LINE>int maxFabTranslationY = mFlexibleSpaceImageHeight - mFab.getHeight() / 2;<NEW_LINE>float fabTranslationY = ScrollUtils.getFloat(-scrollY + mFlexibleSpaceImageHeight - mFab.getHeight() / 2, mActionBarSize - mFab.getHeight() / 2, maxFabTranslationY);<NEW_LINE>if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {<NEW_LINE>// On pre-honeycomb, ViewHelper.setTranslationX/Y does not set margin,<NEW_LINE>// which causes FAB's OnClickListener not working.<NEW_LINE>FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) mFab.getLayoutParams();<NEW_LINE>lp.leftMargin = mOverlayView.getWidth() - mFabMargin - mFab.getWidth();<NEW_LINE><MASK><NEW_LINE>mFab.requestLayout();<NEW_LINE>} else {<NEW_LINE>ViewHelper.setTranslationX(mFab, mOverlayView.getWidth() - mFabMargin - mFab.getWidth());<NEW_LINE>ViewHelper.setTranslationY(mFab, fabTranslationY);<NEW_LINE>}<NEW_LINE>// Show/hide FAB<NEW_LINE>if (fabTranslationY < mFlexibleSpaceShowFabOffset) {<NEW_LINE>hideFab();<NEW_LINE>} else {<NEW_LINE>showFab();<NEW_LINE>}<NEW_LINE>} | lp.topMargin = (int) fabTranslationY; |
877,432 | public void test1XSLEJBObjectGetHandleSerialize() throws Exception {<NEW_LINE>Handle handle1 = fejb1.getHandle();<NEW_LINE>assertNotNull("getHandle test was null", handle1);<NEW_LINE>ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>ObjectOutputStream oos = new ObjectOutputStream(baos);<NEW_LINE>oos.writeObject(handle1);<NEW_LINE>baos.close();<NEW_LINE>ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());<NEW_LINE><MASK><NEW_LINE>Object o = ois.readObject();<NEW_LINE>assertNotNull("Test deserialize object was null", o);<NEW_LINE>assertTrue("Test deserialize object class was not instance of Handle", o instanceof Handle);<NEW_LINE>Handle handle2 = (Handle) o;<NEW_LINE>EJBObject eo = handle2.getEJBObject();<NEW_LINE>assertNotNull("getEjbObject from handle was null", eo);<NEW_LINE>SLRa ejb1 = (SLRa) javax.rmi.PortableRemoteObject.narrow(eo, SLRa.class);<NEW_LINE>assertNotNull("SLRa from narrowing was null", ejb1);<NEW_LINE>assertTrue("isIdentical test (SLRa and Handle) should have returned true.", fejb1.isIdentical(ejb1));<NEW_LINE>} | ObjectInputStream ois = new ObjectInputStream(bais); |
1,543,882 | public ModelAndView dicitemsave(HttpServletRequest request, @Valid SysDic dic, @Valid String p) {<NEW_LINE>List<SysDic> sysDicList = sysDicRes.findByDicidAndName(dic.getDicid(<MASK><NEW_LINE>String msg = null;<NEW_LINE>String orgi = super.getOrgi(request);<NEW_LINE>if (sysDicList.size() == 0) {<NEW_LINE>dic.setHaschild(true);<NEW_LINE>dic.setOrgi(orgi);<NEW_LINE>dic.setCreater(super.getUser(request).getId());<NEW_LINE>dic.setCreatetime(new Date());<NEW_LINE>sysDicRes.save(dic);<NEW_LINE>reloadSysDicItem(dic, orgi);<NEW_LINE>} else {<NEW_LINE>msg = "exist";<NEW_LINE>}<NEW_LINE>return request(super.createView("redirect:/admin/sysdic/dicitem.html?id=" + dic.getParentid() + (msg != null ? "&p=" + p + "&msg=" + msg : "")));<NEW_LINE>} | ), dic.getName()); |
916,093 | protected void drawGuiContainerBackgroundLayer(float partialTick, int mouseX, int mouseY) {<NEW_LINE>GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);<NEW_LINE>bindGuiTexture();<NEW_LINE>int sx = (width - xSize) / 2;<NEW_LINE>int sy = (height - ySize) / 2;<NEW_LINE>drawTexturedModalRect(sx, sy, 0, 0, this.xSize, this.ySize);<NEW_LINE>targetList.drawScreen(mouseX, mouseY, partialTick);<NEW_LINE>super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY);<NEW_LINE>if (getOwner().getEnergy().getEnergyStored() < getOwner().getEnergy().getMaxUsage(CapacitorKey.DIALING_DEVICE_POWER_USE_TELEPORT)) {<NEW_LINE>// FIXME I18N<NEW_LINE>String txt = TextFormatting.DARK_RED + "No Power";<NEW_LINE>renderInfoMessage(sx, sy, txt, 0x000000);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (telepad.getEnergy().getEnergyStored() <= 0) {<NEW_LINE>// FIXME I18N<NEW_LINE>String txt = TextFormatting.DARK_RED + "Telepad not powered";<NEW_LINE>renderInfoMessage(sx, sy, txt, 0x000000);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (targetList.getSelectedElement() == null) {<NEW_LINE>// FIXME I18N<NEW_LINE>String txt = TextFormatting.DARK_RED + "Enter Target";<NEW_LINE>renderInfoMessage(sx, sy, txt, 0x000000);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>bindGuiTexture();<NEW_LINE>int progressScaled = Util.getProgressScaled(progressScale, telepad);<NEW_LINE>drawTexturedModalRect(sx + progressX, sy + progressY, 0, ySize, progressScaled, 10);<NEW_LINE>Entity e = telepad.getCurrentTarget();<NEW_LINE>if (e != null) {<NEW_LINE><MASK><NEW_LINE>renderInfoMessage(sx, sy, name, 0x000000);<NEW_LINE>} else if (telepad.wasBlocked()) {<NEW_LINE>String s = Lang.GUI_TELEPAD_ERROR_BLOCKED.get();<NEW_LINE>renderInfoMessage(sx, sy, s, 0xAA0000);<NEW_LINE>}<NEW_LINE>} | String name = e.getName(); |
890,966 | public Request<ListThingRegistrationTasksRequest> marshall(ListThingRegistrationTasksRequest listThingRegistrationTasksRequest) {<NEW_LINE>if (listThingRegistrationTasksRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(ListThingRegistrationTasksRequest)");<NEW_LINE>}<NEW_LINE>Request<ListThingRegistrationTasksRequest> request = new DefaultRequest<ListThingRegistrationTasksRequest>(listThingRegistrationTasksRequest, "AWSIot");<NEW_LINE>request.setHttpMethod(HttpMethodName.GET);<NEW_LINE>String uriResourcePath = "/thing-registration-tasks";<NEW_LINE>if (listThingRegistrationTasksRequest.getNextToken() != null) {<NEW_LINE>request.addParameter("nextToken", StringUtils.fromString(listThingRegistrationTasksRequest.getNextToken()));<NEW_LINE>}<NEW_LINE>if (listThingRegistrationTasksRequest.getMaxResults() != null) {<NEW_LINE>request.addParameter("maxResults", StringUtils.fromInteger(listThingRegistrationTasksRequest.getMaxResults()));<NEW_LINE>}<NEW_LINE>if (listThingRegistrationTasksRequest.getStatus() != null) {<NEW_LINE>request.addParameter("status", StringUtils.fromString<MASK><NEW_LINE>}<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.0");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | (listThingRegistrationTasksRequest.getStatus())); |
1,778,473 | public void enqueue(Lifespan lifespan, int partitionNumber, List<SerializedPage> pages) {<NEW_LINE>requireNonNull(lifespan, "lifespan is null");<NEW_LINE>requireNonNull(pages, "pages is null");<NEW_LINE>checkState(<MASK><NEW_LINE>// ignore pages after "no more pages" is set<NEW_LINE>// this can happen with a limit query<NEW_LINE>if (!state.get().canAddPages() || pageTracker.isNoMorePagesForLifespan(lifespan)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ImmutableList.Builder<SerializedPageReference> references = ImmutableList.builderWithExpectedSize(pages.size());<NEW_LINE>long bytesAdded = 0;<NEW_LINE>long rowCount = 0;<NEW_LINE>for (SerializedPage page : pages) {<NEW_LINE>long retainedSize = page.getRetainedSizeInBytes();<NEW_LINE>bytesAdded += retainedSize;<NEW_LINE>rowCount += page.getPositionCount();<NEW_LINE>// create page reference counts with an initial single reference<NEW_LINE>references.add(new SerializedPageReference(page, 1, lifespan));<NEW_LINE>}<NEW_LINE>List<SerializedPageReference> serializedPageReferences = references.build();<NEW_LINE>// reserve memory<NEW_LINE>memoryManager.updateMemoryUsage(bytesAdded);<NEW_LINE>// update stats<NEW_LINE>totalRowsAdded.addAndGet(rowCount);<NEW_LINE>totalPagesAdded.addAndGet(serializedPageReferences.size());<NEW_LINE>pageTracker.incrementLifespanPageCount(lifespan, serializedPageReferences.size());<NEW_LINE>// add pages to the buffer (this will increase the reference count by one)<NEW_LINE>partitions.get(partitionNumber).enqueuePages(serializedPageReferences);<NEW_LINE>// drop the initial reference<NEW_LINE>dereferencePages(serializedPageReferences, pageTracker);<NEW_LINE>} | pageTracker.isLifespanCompletionCallbackRegistered(), "lifespanCompletionCallback must be set before enqueueing data"); |
337,419 | private TypeDefPatch updateSupportedDiscoveryRelationship() {<NEW_LINE>final String typeName = "SupportedDiscoveryService";<NEW_LINE>TypeDefPatch typeDefPatch = archiveBuilder.getPatchForType(typeName);<NEW_LINE>typeDefPatch.setUpdatedBy(originatorName);<NEW_LINE>typeDefPatch.setUpdateTime(creationDate);<NEW_LINE>List<TypeDefAttribute> properties = new ArrayList<>();<NEW_LINE>TypeDefAttribute property;<NEW_LINE>final String attribute1Name = "assetTypes";<NEW_LINE>final String attribute1Description = "Deprecated property.";<NEW_LINE>final String attribute1DescriptionGUID = null;<NEW_LINE>final String attribute2Name = "discoveryRequestTypes";<NEW_LINE>final String attribute2Description = "Types of discovery request that links to the discovery service.";<NEW_LINE>final String attribute2DescriptionGUID = null;<NEW_LINE>final String attribute3Name = "defaultAnalysisParameters";<NEW_LINE>final String attribute3Description = "Map of parameter name to value that is passed to the discovery service by default.";<NEW_LINE>final String attribute3DescriptionGUID = null;<NEW_LINE>property = archiveHelper.getArrayStringTypeDefAttribute(attribute1Name, attribute1Description, attribute1DescriptionGUID);<NEW_LINE>property.setReplacedByAttribute(attribute2Name);<NEW_LINE>property.setAttributeStatus(TypeDefAttributeStatus.DEPRECATED_ATTRIBUTE);<NEW_LINE>properties.add(property);<NEW_LINE>property = archiveHelper.getArrayStringTypeDefAttribute(attribute2Name, attribute2Description, attribute2DescriptionGUID);<NEW_LINE>properties.add(property);<NEW_LINE>property = archiveHelper.<MASK><NEW_LINE>properties.add(property);<NEW_LINE>typeDefPatch.setPropertyDefinitions(properties);<NEW_LINE>return typeDefPatch;<NEW_LINE>} | getMapStringStringTypeDefAttribute(attribute3Name, attribute3Description, attribute3DescriptionGUID); |
1,791,619 | protected void doModification(ResultIterator resultIterator) throws Exception {<NEW_LINE>WorkingCopy copy = WorkingCopy.get(resultIterator.getParserResult());<NEW_LINE>copy.toPhase(Phase.RESOLVED);<NEW_LINE>TreeMaker tm = copy.getTreeMaker();<NEW_LINE>GeneratorUtilities gu = GeneratorUtilities.get(copy);<NEW_LINE>CompilationUnitTree cut = copy.getCompilationUnit();<NEW_LINE>ClassTree ct = (ClassTree) cut.getTypeDecls().get(0);<NEW_LINE>VariableTree field = (VariableTree) ct.getMembers().get(1);<NEW_LINE>List<Tree> members = new ArrayList<Tree>();<NEW_LINE>// NOI18N<NEW_LINE>AssignmentTree stat = tm.Assignment(tm.Identifier("name"), tm.Literal("Name"));<NEW_LINE>BlockTree init = tm.Block(Collections.singletonList(tm.ExpressionStatement(stat)), false);<NEW_LINE>members.add(init);<NEW_LINE>members.add(gu.createConstructor(ct, Collections.<VariableTree>emptyList()));<NEW_LINE>members.add(gu.createGetter(field));<NEW_LINE>ModifiersTree mods = tm.Modifiers(EnumSet.of(Modifier.PRIVATE));<NEW_LINE>// NOI18N<NEW_LINE>ClassTree inner = tm.Class(mods, "Inner", Collections.<TypeParameterTree>emptyList(), null, Collections.<Tree>emptyList(), Collections.<Tree>emptyList());<NEW_LINE>members.add(inner);<NEW_LINE>mods = tm.Modifiers(EnumSet.of(Modifier.PRIVATE, Modifier.STATIC));<NEW_LINE>// NOI18N<NEW_LINE>ClassTree nested = tm.Class(mods, "Nested", Collections.<TypeParameterTree>emptyList(), null, Collections.<Tree>emptyList(), Collections.<Tree>emptyList());<NEW_LINE>members.add(nested);<NEW_LINE>// NOI18N<NEW_LINE>IdentifierTree nestedId = tm.Identifier("Nested");<NEW_LINE>// NOI18N<NEW_LINE>VariableTree staticField = tm.Variable(mods, "instance", nestedId, null);<NEW_LINE>members.add(staticField);<NEW_LINE>NewClassTree nct = tm.NewClass(null, Collections.<ExpressionTree>emptyList(), nestedId, Collections.<ExpressionTree>emptyList(), null);<NEW_LINE>// NOI18N<NEW_LINE>stat = tm.Assignment(tm.Identifier("instance"), nct);<NEW_LINE>BlockTree staticInit = tm.Block(Collections.singletonList(tm.ExpressionStatement(stat)), true);<NEW_LINE>members.add(staticInit);<NEW_LINE>members.add(gu.createGetter(staticField));<NEW_LINE>ClassTree newCT = <MASK><NEW_LINE>copy.rewrite(ct, newCT);<NEW_LINE>} | gu.insertClassMembers(ct, members); |
578,896 | void becomeFollower(String method, DiscoveryNode leaderNode) {<NEW_LINE>assert Thread.holdsLock(mutex) : "Coordinator mutex not held";<NEW_LINE>assert leaderNode.isMasterNode() : leaderNode + " became a leader but is not master-eligible";<NEW_LINE>assert mode != Mode.LEADER : "do not switch to follower from leader (should be candidate first)";<NEW_LINE>if (mode == Mode.FOLLOWER && Optional.of(leaderNode).equals(lastKnownLeader)) {<NEW_LINE>logger.trace("{}: coordinator remaining FOLLOWER of [{}] in term {}", method, leaderNode, getCurrentTerm());<NEW_LINE>} else {<NEW_LINE>logger.debug("{}: coordinator becoming FOLLOWER of [{}] in term {} (was {}, lastKnownLeader was [{}])", method, leaderNode, getCurrentTerm(), mode, lastKnownLeader);<NEW_LINE>}<NEW_LINE>final boolean restartLeaderChecker = (mode == Mode.FOLLOWER && Optional.of(leaderNode)<MASK><NEW_LINE>if (mode != Mode.FOLLOWER) {<NEW_LINE>mode = Mode.FOLLOWER;<NEW_LINE>joinAccumulator.close(mode);<NEW_LINE>joinAccumulator = new JoinHelper.FollowerJoinAccumulator();<NEW_LINE>leaderChecker.setCurrentNodes(DiscoveryNodes.EMPTY_NODES);<NEW_LINE>}<NEW_LINE>lastKnownLeader = Optional.of(leaderNode);<NEW_LINE>peerFinder.deactivate(leaderNode);<NEW_LINE>clusterFormationFailureHelper.stop();<NEW_LINE>closePrevotingAndElectionScheduler();<NEW_LINE>cancelActivePublication("become follower: " + method);<NEW_LINE>preVoteCollector.update(getPreVoteResponse(), leaderNode);<NEW_LINE>if (restartLeaderChecker) {<NEW_LINE>leaderChecker.updateLeader(leaderNode);<NEW_LINE>}<NEW_LINE>followersChecker.clearCurrentNodes();<NEW_LINE>followersChecker.updateFastResponseState(getCurrentTerm(), mode);<NEW_LINE>lagDetector.clearTrackedNodes();<NEW_LINE>} | .equals(lastKnownLeader)) == false; |
1,030,165 | private void rotateLeft(GBSNode bfather, GBSNode bpoint) {<NEW_LINE>GBSNode bson = bpoint.leftChild();<NEW_LINE>if (bson.balance() == -1) /* Single LL rotation */<NEW_LINE>{<NEW_LINE>bpoint.setLeftChild(bson.rightChild());<NEW_LINE>bson.setRightChild(bpoint);<NEW_LINE>if (bfather.rightChild() == bpoint)<NEW_LINE>bfather.setRightChild(bson);<NEW_LINE>else<NEW_LINE>bfather.setLeftChild(bson);<NEW_LINE>bpoint.clearBalance();<NEW_LINE>bson.clearBalance();<NEW_LINE>} else /* Double LR rotation */<NEW_LINE>{<NEW_LINE>GBSNode blift = bson.rightChild();<NEW_LINE>bson.setRightChild(blift.leftChild());<NEW_LINE>blift.setLeftChild(bson);<NEW_LINE>bpoint.setLeftChild(blift.rightChild());<NEW_LINE>blift.setRightChild(bpoint);<NEW_LINE>if (bfather.rightChild() == bpoint)<NEW_LINE>bfather.setRightChild(blift);<NEW_LINE>else<NEW_LINE>bfather.setLeftChild(blift);<NEW_LINE>bpoint.setBalance(newBalance2[blift<MASK><NEW_LINE>bson.setBalance(newBalance1[blift.balance() + 1]);<NEW_LINE>blift.clearBalance();<NEW_LINE>}<NEW_LINE>} | .balance() + 1]); |
1,676,840 | private Tuple<Manifest, Metadata> loadFullStateBWC() throws IOException {<NEW_LINE>Map<Index, Long> indices = new HashMap<>();<NEW_LINE>Metadata.Builder metadataBuilder;<NEW_LINE>Tuple<Metadata, Long> metadataAndGeneration = Metadata.FORMAT.loadLatestStateWithGeneration(logger, namedXContentRegistry, nodeEnv.nodeDataPaths());<NEW_LINE>Metadata globalMetadata = metadataAndGeneration.v1();<NEW_LINE>long globalStateGeneration = metadataAndGeneration.v2();<NEW_LINE>final IndexGraveyard indexGraveyard;<NEW_LINE>if (globalMetadata != null) {<NEW_LINE>metadataBuilder = Metadata.builder(globalMetadata);<NEW_LINE>indexGraveyard = globalMetadata.custom(IndexGraveyard.TYPE);<NEW_LINE>} else {<NEW_LINE>metadataBuilder = Metadata.builder();<NEW_LINE>indexGraveyard = IndexGraveyard.builder().build();<NEW_LINE>}<NEW_LINE>for (String indexFolderName : nodeEnv.availableIndexFolders()) {<NEW_LINE>Tuple<IndexMetadata, Long> indexMetadataAndGeneration = IndexMetadata.FORMAT.loadLatestStateWithGeneration(logger, namedXContentRegistry, nodeEnv.resolveIndexFolder(indexFolderName));<NEW_LINE>IndexMetadata indexMetadata = indexMetadataAndGeneration.v1();<NEW_LINE>long generation = indexMetadataAndGeneration.v2();<NEW_LINE>if (indexMetadata != null) {<NEW_LINE>if (indexGraveyard.containsIndex(indexMetadata.getIndex())) {<NEW_LINE>logger.debug("[{}] found metadata for deleted index [{}]", indexFolderName, indexMetadata.getIndex());<NEW_LINE>// this index folder is cleared up when state is recovered<NEW_LINE>} else {<NEW_LINE>indices.put(indexMetadata.getIndex(), generation);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.debug("[{}] failed to find metadata for existing index location", indexFolderName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Manifest manifest = Manifest.unknownCurrentTermAndVersion(globalStateGeneration, indices);<NEW_LINE>return new Tuple<>(manifest, metadataBuilder.build());<NEW_LINE>} | metadataBuilder.put(indexMetadata, false); |
784,285 | public static UriPattern parse(String uri) {<NEW_LINE>if (uri.endsWith("?")) {<NEW_LINE>throw new InvalidUriPatternException("URI patterns must not end with '?'. Found " + uri);<NEW_LINE>} else if (!uri.startsWith("/")) {<NEW_LINE>throw new InvalidUriPatternException("URI pattern must start with '/'. Found " + uri);<NEW_LINE>} else if (uri.contains("#")) {<NEW_LINE>throw new InvalidUriPatternException("URI pattern must not contain a fragment. Found " + uri);<NEW_LINE>}<NEW_LINE>String[] parts = uri.split(java.util.regex.Pattern.quote("?"), 2);<NEW_LINE>String[] unparsedSegments = parts[0].split(java.util.regex.Pattern.quote("/"));<NEW_LINE>List<Segment> segments = new ArrayList<>();<NEW_LINE>// Skip the first "/" segment, and thus assume offset of 1.<NEW_LINE>int offset = 1;<NEW_LINE>for (int i = 1; i < unparsedSegments.length; i++) {<NEW_LINE>String segment = unparsedSegments[i];<NEW_LINE>segments.add(Segment.parse(segment, offset));<NEW_LINE>offset += segment.length();<NEW_LINE>}<NEW_LINE>Map<String, String> queryLiterals = new LinkedHashMap<>();<NEW_LINE>// Parse the query literals outside of the general pattern<NEW_LINE>if (parts.length == 2) {<NEW_LINE>if (parts[1].contains("{") || parts[1].contains("}")) {<NEW_LINE>throw new InvalidUriPatternException("URI labels must not appear in the query string. Found " + uri);<NEW_LINE>}<NEW_LINE>for (String kvp : parts[1].split(java.util.regex.Pattern.quote("&"))) {<NEW_LINE>String[] parameterParts = <MASK><NEW_LINE>String actualKey = parameterParts[0];<NEW_LINE>if (queryLiterals.containsKey(actualKey)) {<NEW_LINE>throw new InvalidUriPatternException("Literal query parameters must not be repeated: " + uri);<NEW_LINE>}<NEW_LINE>queryLiterals.put(actualKey, parameterParts.length == 2 ? parameterParts[1] : "");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new UriPattern(builder().pattern(uri).segments(segments), queryLiterals);<NEW_LINE>} | kvp.split("=", 2); |
857,907 | private void replaceNLSWithSpace(MultiTextEdit container, int startPos, int endPos) throws BadLocationException {<NEW_LINE>// remember first NLS token in a string of NLS tokens<NEW_LINE>Token fromToken = null;<NEW_LINE>int p = startPos + 1;<NEW_LINE>while (p < endPos) {<NEW_LINE>Token token = formatter.getTokens().get(p);<NEW_LINE><MASK><NEW_LINE>if (ttype == GroovyTokenTypeBridge.NLS) {<NEW_LINE>if (fromToken == null) {<NEW_LINE>fromToken = token;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (ttype == GroovyTokenTypeBridge.SL_COMMENT) {<NEW_LINE>// next token will be skipped whether it is a NLS or not!<NEW_LINE>p += 1;<NEW_LINE>}<NEW_LINE>if (fromToken != null) {<NEW_LINE>// replace NLS tokens from fromToken up to current token<NEW_LINE>addEdit(newReplaceEdit(fromToken, token, " "), container);<NEW_LINE>fromToken = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>p += 1;<NEW_LINE>}<NEW_LINE>// don't forget to replace nls tokens at the end.<NEW_LINE>if (fromToken != null) {<NEW_LINE>Token token = formatter.getTokens().get(p);<NEW_LINE>addEdit(newReplaceEdit(fromToken, token, " "), container);<NEW_LINE>}<NEW_LINE>} | int ttype = token.getType(); |
1,653,725 | private void processIndexSegmentEntriesBackward(IndexSegment indexSegment, Predicate<IndexEntry> predicate, Map<StoreKey, IndexFinalState> keyFinalStates) throws StoreException {<NEW_LINE>diskIOScheduler.getSlice(BlobStoreStats.IO_SCHEDULER_JOB_TYPE, BlobStoreStats.IO_SCHEDULER_JOB_ID, indexSegment.size());<NEW_LINE>logger.trace("Processing index entries backward by IndexScanner for segment {} for store {}", indexSegment.getFile().getName(), storeId);<NEW_LINE>// valid index entries wrt log segment reference time<NEW_LINE>forEachValidIndexEntry(indexSegment, newScanResults.logSegmentForecastStartTimeMsForDeleted, newScanResults.logSegmentForecastStartTimeMsForExpired, null, keyFinalStates, false, entry -> {<NEW_LINE>if (predicate == null || predicate.test(entry)) {<NEW_LINE>processEntryForLogSegmentBucket(newScanResults, entry, keyFinalStates);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// valid index entries wrt container reference time<NEW_LINE>forEachIndexEntry(indexSegment, newScanResults.containerForecastStartTimeMs, newScanResults.containerForecastStartTimeMs, null, keyFinalStates, true, (entry, isValid) -> {<NEW_LINE>if (predicate == null || predicate.test(entry)) {<NEW_LINE>processEntryForContainerBucket(<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | newScanResults, entry, isValid, keyFinalStates); |
1,316,074 | protected SpringPersistenceUnitInfo parsePersistenceUnitInfo(Element persistenceUnit, String version, @Nullable URL rootUrl) throws IOException {<NEW_LINE>SpringPersistenceUnitInfo unitInfo = new SpringPersistenceUnitInfo();<NEW_LINE>// set JPA version (1.0 or 2.0)<NEW_LINE>unitInfo.setPersistenceXMLSchemaVersion(version);<NEW_LINE>// set persistence unit root URL<NEW_LINE>unitInfo.setPersistenceUnitRootUrl(rootUrl);<NEW_LINE>// set unit name<NEW_LINE>unitInfo.setPersistenceUnitName(persistenceUnit.getAttribute(UNIT_NAME).trim());<NEW_LINE>// set transaction type<NEW_LINE>String txType = persistenceUnit.getAttribute(TRANSACTION_TYPE).trim();<NEW_LINE>if (StringUtils.hasText(txType)) {<NEW_LINE>unitInfo.setTransactionType(PersistenceUnitTransactionType.valueOf(txType));<NEW_LINE>}<NEW_LINE>// evaluate data sources<NEW_LINE>String jtaDataSource = DomUtils.getChildElementValueByTagName(persistenceUnit, JTA_DATA_SOURCE);<NEW_LINE>if (StringUtils.hasText(jtaDataSource)) {<NEW_LINE>unitInfo.setJtaDataSource(this.dataSourceLookup.getDataSource<MASK><NEW_LINE>}<NEW_LINE>String nonJtaDataSource = DomUtils.getChildElementValueByTagName(persistenceUnit, NON_JTA_DATA_SOURCE);<NEW_LINE>if (StringUtils.hasText(nonJtaDataSource)) {<NEW_LINE>unitInfo.setNonJtaDataSource(this.dataSourceLookup.getDataSource(nonJtaDataSource.trim()));<NEW_LINE>}<NEW_LINE>// provider<NEW_LINE>String provider = DomUtils.getChildElementValueByTagName(persistenceUnit, PROVIDER);<NEW_LINE>if (StringUtils.hasText(provider)) {<NEW_LINE>unitInfo.setPersistenceProviderClassName(provider.trim());<NEW_LINE>}<NEW_LINE>// exclude unlisted classes<NEW_LINE>Element excludeUnlistedClasses = DomUtils.getChildElementByTagName(persistenceUnit, EXCLUDE_UNLISTED_CLASSES);<NEW_LINE>if (excludeUnlistedClasses != null) {<NEW_LINE>String excludeText = DomUtils.getTextValue(excludeUnlistedClasses);<NEW_LINE>unitInfo.setExcludeUnlistedClasses(!StringUtils.hasText(excludeText) || Boolean.parseBoolean(excludeText));<NEW_LINE>}<NEW_LINE>// set JPA 2.0 shared cache mode<NEW_LINE>String cacheMode = DomUtils.getChildElementValueByTagName(persistenceUnit, SHARED_CACHE_MODE);<NEW_LINE>if (StringUtils.hasText(cacheMode)) {<NEW_LINE>unitInfo.setSharedCacheMode(SharedCacheMode.valueOf(cacheMode));<NEW_LINE>}<NEW_LINE>// set JPA 2.0 validation mode<NEW_LINE>String validationMode = DomUtils.getChildElementValueByTagName(persistenceUnit, VALIDATION_MODE);<NEW_LINE>if (StringUtils.hasText(validationMode)) {<NEW_LINE>unitInfo.setValidationMode(ValidationMode.valueOf(validationMode));<NEW_LINE>}<NEW_LINE>parseProperties(persistenceUnit, unitInfo);<NEW_LINE>parseManagedClasses(persistenceUnit, unitInfo);<NEW_LINE>parseMappingFiles(persistenceUnit, unitInfo);<NEW_LINE>parseJarFiles(persistenceUnit, unitInfo);<NEW_LINE>return unitInfo;<NEW_LINE>} | (jtaDataSource.trim())); |
703,675 | private static boolean isMigratable(Entity entity) {<NEW_LINE>// Checks specific to production data. See b/185954992 for details.<NEW_LINE>// The names of these bad entities in production do not conflict with other environments. For<NEW_LINE>// simplicities sake we apply them regardless of the source of the data.<NEW_LINE>if (entity.getKind().equals("DomainBase") && IGNORED_DOMAINS.contains(entity.getKey().getName())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (entity.getKind().equals("ContactResource")) {<NEW_LINE>String roid = entity.getKey().getName();<NEW_LINE>return !IGNORED_CONTACTS.contains(roid);<NEW_LINE>}<NEW_LINE>if (entity.getKind().equals("HostResource")) {<NEW_LINE>String roid = entity.getKey().getName();<NEW_LINE>return !IGNORED_HOSTS.contains(roid);<NEW_LINE>}<NEW_LINE>if (entity.getKind().equals("HistoryEntry")) {<NEW_LINE>// DOMAIN_APPLICATION_CREATE is deprecated type and should not be migrated.<NEW_LINE>// The Enum name DOMAIN_APPLICATION_CREATE no longer exists in Java and cannot<NEW_LINE>// be deserialized.<NEW_LINE>if (Objects.equals(entity.getProperty("type"), "DOMAIN_APPLICATION_CREATE")) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Remove production bad data: Histories of ignored EPP resources:<NEW_LINE>com.google.appengine.api.datastore.Key parentKey = entity.getKey().getParent();<NEW_LINE>if (parentKey.getKind().equals("ContactResource")) {<NEW_LINE>String contactRoid = parentKey.getName();<NEW_LINE>return !IGNORED_CONTACTS.contains(contactRoid);<NEW_LINE>}<NEW_LINE>if (parentKey.getKind().equals("HostResource")) {<NEW_LINE>String hostRoid = parentKey.getName();<NEW_LINE>return !IGNORED_HOSTS.contains(hostRoid);<NEW_LINE>}<NEW_LINE>if (parentKey.getKind().equals("DomainBase")) {<NEW_LINE>String domainRoid = parentKey.getName();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | return !IGNORED_DOMAINS.contains(domainRoid); |
553,838 | V putIfAbsentAsync(K key, V value, long duration, TimeUnit unit) {<NEW_LINE>// Keep in sync with LocalAsyncCache.AsMapView#putIfAbsent(key, value)<NEW_LINE>var expiry = (Expiry<K, V>) new AsyncExpiry<>(new FixedExpiry<>(duration, unit));<NEW_LINE>V asyncValue = (<MASK><NEW_LINE>for (; ; ) {<NEW_LINE>var priorFuture = (CompletableFuture<V>) cache.getIfPresent(key, /* recordStats */<NEW_LINE>false);<NEW_LINE>if (priorFuture != null) {<NEW_LINE>if (!priorFuture.isDone()) {<NEW_LINE>Async.getWhenSuccessful(priorFuture);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>V prior = Async.getWhenSuccessful(priorFuture);<NEW_LINE>if (prior != null) {<NEW_LINE>return prior;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean[] added = { false };<NEW_LINE>var computed = (CompletableFuture<V>) cache.compute(key, (k, oldValue) -> {<NEW_LINE>var oldValueFuture = (CompletableFuture<V>) oldValue;<NEW_LINE>added[0] = (oldValueFuture == null) || (oldValueFuture.isDone() && (Async.getIfReady(oldValueFuture) == null));<NEW_LINE>return added[0] ? asyncValue : oldValue;<NEW_LINE>}, expiry, /* recordMiss */<NEW_LINE>false, /* recordLoad */<NEW_LINE>false, /* recordLoadFailure */<NEW_LINE>false);<NEW_LINE>if (added[0]) {<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>V prior = Async.getWhenSuccessful(computed);<NEW_LINE>if (prior != null) {<NEW_LINE>return prior;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | V) CompletableFuture.completedFuture(value); |
1,507,998 | public List<I_M_InOutLine> retrieveInOutLines(final I_C_InvoiceLine il) {<NEW_LINE>//<NEW_LINE>// Try C_InvoiceLine->C_Invoice_Line_Alloc->C_Invoice_Candidate->C_InvoiceCandidate_InOutLine->M_InOutLine<NEW_LINE>final List<I_M_InOutLine> inoutLines = //<NEW_LINE>queryBL.createQueryBuilder(I_C_Invoice_Line_Alloc.class, il).addOnlyActiveRecordsFilter().addEqualsFilter(I_C_Invoice_Line_Alloc.COLUMN_C_InvoiceLine_ID, il.getC_InvoiceLine_ID()).// Collect C_Invoice_Candidates<NEW_LINE>andCollect(I_C_Invoice_Line_Alloc.COLUMN_C_Invoice_Candidate_ID).//<NEW_LINE>addOnlyActiveRecordsFilter().// Collect C_InvoiceCandidate_InOutLines<NEW_LINE>andCollectChildren(I_C_InvoiceCandidate_InOutLine.COLUMN_C_Invoice_Candidate_ID, //<NEW_LINE>I_C_InvoiceCandidate_InOutLine.class).// Collect M_InOutLines<NEW_LINE>andCollect(//<NEW_LINE>I_C_InvoiceCandidate_InOutLine.COLUMN_M_InOutLine_ID).// Order M_InOutLines<NEW_LINE>orderBy().addColumn(I_M_InOutLine.COLUMN_M_InOutLine_ID).//<NEW_LINE>endOrderBy().// Execute the query<NEW_LINE>create().list(I_M_InOutLine.class);<NEW_LINE>//<NEW_LINE>// If direct link C_InvoiceLine.M_InOutLine_ID is set,<NEW_LINE>// Add it to existing M_InOutLines list, if not already added<NEW_LINE>{<NEW_LINE>final int directInOutLineId = il.getM_InOutLine_ID();<NEW_LINE>if (directInOutLineId > 0) {<NEW_LINE>//<NEW_LINE>// Check if already exists<NEW_LINE>boolean found = false;<NEW_LINE>for (int i = 0; i < inoutLines.size(); i++) {<NEW_LINE>final I_M_InOutLine inoutLine = inoutLines.get(i);<NEW_LINE>if (inoutLine.getM_InOutLine_ID() != directInOutLineId) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Make sure the direct link it's the first record to be checked<NEW_LINE>if (i > 0) {<NEW_LINE>inoutLines.remove(i);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>found = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// Add the direct M_InOutLine if not already exists<NEW_LINE>if (!found) {<NEW_LINE>final I_M_InOutLine directInoutLine = il.getM_InOutLine();<NEW_LINE>inoutLines.add(0, directInoutLine);<NEW_LINE>logger.warn("Direct link was not found in IC-IOL associations. Adding now." + "\n C_InvoiceLine: " + il + "\n M_InOutLine: " + directInoutLine);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return inoutLines;<NEW_LINE>} | inoutLines.add(0, inoutLine); |
699,742 | private void createPopup() {<NEW_LINE>pop = new JPopupMenu();<NEW_LINE>pop.setBackground(ColorResource.getDarkerBgColor());<NEW_LINE>JMenu dl = new JMenu(StringResource.get("ND_DOWNLOAD_LATER"));<NEW_LINE>dl.setForeground(Color.WHITE);<NEW_LINE>dl.setBorder(new EmptyBorder(getScaledInt(5), getScaledInt(5), getScaledInt(5), getScaledInt(5)));<NEW_LINE>dl.addActionListener(this);<NEW_LINE>dl.<MASK><NEW_LINE>dl.setBorderPainted(false);<NEW_LINE>// dl.setBackground(C);<NEW_LINE>pop.add(dl);<NEW_LINE>createQueueItems(dl);<NEW_LINE>JMenuItem ig = new JMenuItem(StringResource.get("ND_IGNORE_URL"));<NEW_LINE>ig.setName("IGNORE_URL");<NEW_LINE>ig.setForeground(Color.WHITE);<NEW_LINE>ig.addActionListener(this);<NEW_LINE>pop.add(ig);<NEW_LINE>pop.setInvoker(btnMore);<NEW_LINE>} | setBackground(ColorResource.getDarkerBgColor()); |
977,409 | public UnderDatabase create(UdbContext udbContext, String type, UdbConfiguration configuration) {<NEW_LINE>Map<String, UnderDatabaseFactory> map = mFactories;<NEW_LINE>UnderDatabaseFactory factory = map.get(type);<NEW_LINE>if (factory == null) {<NEW_LINE>throw new IllegalArgumentException(String.format("UdbFactory for type '%s' does not exist.", type));<NEW_LINE>}<NEW_LINE>ClassLoader previousClassLoader = Thread.currentThread().getContextClassLoader();<NEW_LINE>try {<NEW_LINE>// Use the extension class loader of the factory.<NEW_LINE>Thread.currentThread().setContextClassLoader(factory.getClass().getClassLoader());<NEW_LINE>return <MASK><NEW_LINE>} catch (Throwable e) {<NEW_LINE>// Catching Throwable rather than Exception to catch service loading errors<NEW_LINE>throw new IllegalStateException(String.format("Failed to create UnderDb by factory %s", factory), e);<NEW_LINE>} finally {<NEW_LINE>Thread.currentThread().setContextClassLoader(previousClassLoader);<NEW_LINE>}<NEW_LINE>} | factory.create(udbContext, configuration); |
211,819 | public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header, serverObjects post, final serverSwitch env) {<NEW_LINE>final Switchboard sb = (Switchboard) env;<NEW_LINE>final serverObjects prop = new serverObjects();<NEW_LINE>prop.put("topmenu", sb.getConfigBool("publicTopmenu", true) ? 1 : 0);<NEW_LINE>final String promoteSearchPageGreeting = (env.getConfigBool(SwitchboardConstants.GREETING_NETWORK_NAME, false)) ? env.getConfig("network.unit.description", "") : env.getConfig(SwitchboardConstants.GREETING, "");<NEW_LINE>prop.put("topmenu_promoteSearchPageGreeting", promoteSearchPageGreeting);<NEW_LINE>final String query = (post == null) ? "" : post.get("query", "");<NEW_LINE>final String startRecord = (post == null) ? "0" : post.get("startRecord", "");<NEW_LINE>final String maximumRecords = (post == null) ? sb.getConfig(SwitchboardConstants.SEARCH_ITEMS, "10") : post.get("maximumRecords", "");<NEW_LINE>final boolean focus = (post == null) ? true : post.get("focus", "1").equals("1");<NEW_LINE>prop.putHTML("query", query);<NEW_LINE>prop.putHTML("startRecord", startRecord);<NEW_LINE>prop.putHTML("maximumRecords", maximumRecords);<NEW_LINE>prop.putHTML("querys", query.replaceAll(" ", "+"));<NEW_LINE>prop.put("serverlist", query.isEmpty() ? 1 : 0);<NEW_LINE>prop.put("focus", focus ? 1 : 0);<NEW_LINE><MASK><NEW_LINE>if (t - indexSizeTime > 60000) {<NEW_LINE>indeSizeCache = sb.index.fulltext().collectionSize();<NEW_LINE>indexSizeTime = t;<NEW_LINE>}<NEW_LINE>prop.put("allowrealtime", indeSizeCache < 100000 ? 1 : 0);<NEW_LINE>return prop;<NEW_LINE>} | long t = System.currentTimeMillis(); |
698,866 | private double scoreHelper(DataSet data, boolean training) {<NEW_LINE>boolean hasMaskArray = data.hasMaskArrays();<NEW_LINE>if (hasMaskArray)<NEW_LINE>setLayerMaskArrays(data.getFeaturesMaskArray(), data.getLabelsMaskArray());<NEW_LINE>if (!(getOutputLayer() instanceof IOutputLayer)) {<NEW_LINE>throw new IllegalStateException("Cannot calculate score if final layer is not an instance of IOutputLayer. " + "Final layer is of type: " + getOutputLayer().getClass());<NEW_LINE>}<NEW_LINE>WorkspaceMode wsm = (training ? layerWiseConfigurations.getTrainingWorkspaceMode() : layerWiseConfigurations.getInferenceWorkspaceMode());<NEW_LINE>LayerWorkspaceMgr mgr;<NEW_LINE>if (wsm == WorkspaceMode.NONE) {<NEW_LINE>mgr = LayerWorkspaceMgr.noWorkspaces();<NEW_LINE>} else {<NEW_LINE>mgr = // TODO we can probably optimize this<NEW_LINE>LayerWorkspaceMgr.builder().with(ArrayType.FF_WORKING_MEM, WS_LAYER_WORKING_MEM, WS_LAYER_WORKING_MEM_CONFIG).with(ArrayType.RNN_FF_LOOP_WORKING_MEM, WS_RNN_LOOP_WORKING_MEM, WS_RNN_LOOP_WORKING_MEM_CONFIG).noWorkspaceFor(ArrayType.ACTIVATIONS).noWorkspaceFor(<MASK><NEW_LINE>}<NEW_LINE>mgr.setHelperWorkspacePointers(helperWorkspaces);<NEW_LINE>INDArray inputToOutputLayer = outputOfLayerDetached(training, FwdPassType.STANDARD, layers.length - 2, data.getFeatures(), data.getFeaturesMaskArray(), data.getLabelsMaskArray(), null);<NEW_LINE>if (data.getFeatures().size(0) > Integer.MAX_VALUE)<NEW_LINE>throw new ND4JArraySizeException();<NEW_LINE>IOutputLayer ol = (IOutputLayer) getOutputLayer();<NEW_LINE>if (getLayerWiseConfigurations().getInputPreProcess(layers.length - 1) != null) {<NEW_LINE>inputToOutputLayer = getLayerWiseConfigurations().getInputPreProcess(layers.length - 1).preProcess(inputToOutputLayer, (int) data.getFeatures().size(0), mgr);<NEW_LINE>}<NEW_LINE>// Feedforward doesn't include output layer for efficiency<NEW_LINE>ol.setInput(inputToOutputLayer, mgr);<NEW_LINE>ol.setLabels(data.getLabels());<NEW_LINE>double score;<NEW_LINE>try (MemoryWorkspace ws = mgr.notifyScopeEntered(ArrayType.FF_WORKING_MEM)) {<NEW_LINE>score = ol.computeScore(calcRegularizationScore(true), training, mgr);<NEW_LINE>}<NEW_LINE>if (hasMaskArray)<NEW_LINE>clearLayerMaskArrays();<NEW_LINE>clearLayersStates();<NEW_LINE>return score;<NEW_LINE>} | ArrayType.INPUT).build(); |
511,305 | public String decrypt(String encryptedText) {<NEW_LINE>try {<NEW_LINE>byte[] decode = Base64.decode(encryptedText.getBytes(UTF_8), Base64.URL_SAFE);<NEW_LINE>// get back the iv and salt from the cipher text<NEW_LINE>ByteBuffer <MASK><NEW_LINE>byte[] iv = new byte[ivLengthByte];<NEW_LINE>bb.get(iv);<NEW_LINE>byte[] salt = new byte[saltLengthByte];<NEW_LINE>bb.get(salt);<NEW_LINE>byte[] cipherText = new byte[bb.remaining()];<NEW_LINE>bb.get(cipherText);<NEW_LINE>// get back the aes key from the same password and salt<NEW_LINE>SecretKey aesKeyFromPassword = CryptoUtils.getAESKeyFromPassword(password.asString().toCharArray(), salt);<NEW_LINE>Cipher cipher = Cipher.getInstance(encryptAlgo);<NEW_LINE>cipher.init(Cipher.DECRYPT_MODE, aesKeyFromPassword, new GCMParameterSpec(tagLengthBit, iv));<NEW_LINE>byte[] plainText = cipher.doFinal(cipherText);<NEW_LINE>return new String(plainText, UTF_8);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new NitriteSecurityException("failed to decrypt data", e);<NEW_LINE>}<NEW_LINE>} | bb = ByteBuffer.wrap(decode); |
1,659,995 | private void handleConfigUpdateRequest(HttpServletRequest req, HttpServletResponse resp) throws IOException {<NEW_LINE>SerializedConfig sconfig;<NEW_LINE>try {<NEW_LINE>String reqbody = req.getReader().lines().collect(Collectors.joining<MASK><NEW_LINE>sconfig = mapper.readValue(reqbody, SerializedConfig.class);<NEW_LINE>} catch (Exception e) {<NEW_LINE>resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);<NEW_LINE>resp.setContentType(CONTENT_TYPE);<NEW_LINE>try (PrintWriter writer = resp.getWriter()) {<NEW_LINE>writer.println(ErrorResponse.getErrorResponseString(HttpServletResponse.SC_BAD_REQUEST, String.format("error processing body: %s", e.getMessage())));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>applySerializedConfig(sconfig);<NEW_LINE>resp.setStatus(HttpServletResponse.SC_OK);<NEW_LINE>resp.setContentType(CONTENT_TYPE);<NEW_LINE>try (PrintWriter writer = resp.getWriter()) {<NEW_LINE>writer.println(getSerializedConfig());<NEW_LINE>}<NEW_LINE>} catch (InvalidFilterException e) {<NEW_LINE>resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);<NEW_LINE>resp.setContentType(CONTENT_TYPE);<NEW_LINE>try (PrintWriter writer = resp.getWriter()) {<NEW_LINE>writer.println(ErrorResponse.getErrorResponseString(HttpServletResponse.SC_BAD_REQUEST, String.format("invalid filter: %s", e.getMessage())));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (System.lineSeparator())); |
412,461 | /*@Override<NEW_LINE>public String getMenuName() {//KS TODO not implemented<NEW_LINE>return getString(R.string.snooze_alert);<NEW_LINE>}*/<NEW_LINE>public void addListenerOnButton() {<NEW_LINE>buttonSnooze = (Button) findViewById(R.id.button_snooze);<NEW_LINE>// low alerts<NEW_LINE>disableLowAlerts = (Button) findViewById(R.id.button_disable_low_alerts);<NEW_LINE>clearLowDisabled = (Button) findViewById(R.id.enable_low_alerts);<NEW_LINE>// high alerts<NEW_LINE>disableHighAlerts = (Button) findViewById(R.id.button_disable_high_alerts);<NEW_LINE>clearHighDisabled = (Button) findViewById(R.id.enable_high_alerts);<NEW_LINE>// all alerts<NEW_LINE>disableAlerts = (Button) findViewById(R.id.button_disable_alerts);<NEW_LINE>clearDisabled = (Button) <MASK><NEW_LINE>sendRemoteSnooze = (Button) findViewById(R.id.send_remote_snooze);<NEW_LINE>buttonSnooze.setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>public void onClick(View v) {<NEW_LINE>int intValue = getTimeFromSnoozeValue(snoozeValue.getValue());<NEW_LINE>AlertPlayer.getPlayer().Snooze(getApplicationContext(), intValue);<NEW_LINE>Intent intent = new Intent(getApplicationContext(), Home.class);<NEW_LINE>if (ActiveBgAlert.getOnly() != null) {<NEW_LINE>Log.e(TAG, "Snoozed! ActiveBgAlert.getOnly() != null TODO restart Home.class - watchface?");<NEW_LINE>// KS TODO startActivity(intent);<NEW_LINE>}<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>showDisableEnableButtons();<NEW_LINE>setOnClickListenerOnDisableButton(disableAlerts, "alerts_disabled_until");<NEW_LINE>setOnClickListenerOnDisableButton(disableLowAlerts, "low_alerts_disabled_until");<NEW_LINE>setOnClickListenerOnDisableButton(disableHighAlerts, "high_alerts_disabled_until");<NEW_LINE>setOnClickListenerOnClearDisabledButton(clearDisabled, "alerts_disabled_until");<NEW_LINE>setOnClickListenerOnClearDisabledButton(clearLowDisabled, "low_alerts_disabled_until");<NEW_LINE>setOnClickListenerOnClearDisabledButton(clearHighDisabled, "high_alerts_disabled_until");<NEW_LINE>} | findViewById(R.id.enable_alerts); |
1,147,930 | private void renameOutgoingPhis(int successor, boolean allVersions) {<NEW_LINE>int[] phiIndexes = phiIndexMap[successor];<NEW_LINE>List<Phi> phis = synthesizedPhisByBlock.get(successor);<NEW_LINE>for (int j = 0; j < phis.size(); ++j) {<NEW_LINE>Phi phi = phis.get(j);<NEW_LINE>Variable originalVar = program.variableAt(phiIndexes[j]);<NEW_LINE>Variable var = variableMap[phiIndexes[j]];<NEW_LINE>if (var != null) {<NEW_LINE>List<Variable> versions = definedVersions.get(phiIndexes[j]);<NEW_LINE>if (versions != null && allVersions) {<NEW_LINE>for (Variable version : versions) {<NEW_LINE>Incoming incoming = new Incoming();<NEW_LINE>incoming.setSource(currentBlock);<NEW_LINE>incoming.setValue(version);<NEW_LINE>phi.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>Variable sigmaVar = applySigmaRename(program.basicBlockAt(successor), originalVar);<NEW_LINE>Incoming incoming = new Incoming();<NEW_LINE>incoming.setSource(currentBlock);<NEW_LINE>incoming.setValue(sigmaVar != originalVar ? sigmaVar : var);<NEW_LINE>phi.getIncomings().add(incoming);<NEW_LINE>phi.getReceiver().setDebugName(var.getDebugName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getIncomings().add(incoming); |
93,004 | public static DescribeSecurityGroupAttributeResponse unmarshall(DescribeSecurityGroupAttributeResponse describeSecurityGroupAttributeResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSecurityGroupAttributeResponse.setRequestId(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.RequestId"));<NEW_LINE>describeSecurityGroupAttributeResponse.setVpcId(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.VpcId"));<NEW_LINE>describeSecurityGroupAttributeResponse.setInnerAccessPolicy(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.InnerAccessPolicy"));<NEW_LINE>describeSecurityGroupAttributeResponse.setDescription(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Description"));<NEW_LINE>describeSecurityGroupAttributeResponse.setSecurityGroupId(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.SecurityGroupId"));<NEW_LINE>describeSecurityGroupAttributeResponse.setSecurityGroupName(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.SecurityGroupName"));<NEW_LINE>describeSecurityGroupAttributeResponse.setRegionId(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.RegionId"));<NEW_LINE>List<Permission> permissions = new ArrayList<Permission>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSecurityGroupAttributeResponse.Permissions.Length"); i++) {<NEW_LINE>Permission permission = new Permission();<NEW_LINE>permission.setDirection(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].Direction"));<NEW_LINE>permission.setSourceGroupId(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].SourceGroupId"));<NEW_LINE>permission.setDestGroupOwnerAccount(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].DestGroupOwnerAccount"));<NEW_LINE>permission.setDestPrefixListId(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].DestPrefixListId"));<NEW_LINE>permission.setDestPrefixListName(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].DestPrefixListName"));<NEW_LINE>permission.setSourceCidrIp(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].SourceCidrIp"));<NEW_LINE>permission.setIpv6DestCidrIp(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].Ipv6DestCidrIp"));<NEW_LINE>permission.setCreateTime(_ctx.stringValue<MASK><NEW_LINE>permission.setIpv6SourceCidrIp(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].Ipv6SourceCidrIp"));<NEW_LINE>permission.setDestGroupId(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].DestGroupId"));<NEW_LINE>permission.setDestCidrIp(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].DestCidrIp"));<NEW_LINE>permission.setIpProtocol(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].IpProtocol"));<NEW_LINE>permission.setPriority(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].Priority"));<NEW_LINE>permission.setDestGroupName(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].DestGroupName"));<NEW_LINE>permission.setNicType(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].NicType"));<NEW_LINE>permission.setPolicy(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].Policy"));<NEW_LINE>permission.setDescription(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].Description"));<NEW_LINE>permission.setPortRange(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].PortRange"));<NEW_LINE>permission.setSourcePrefixListName(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].SourcePrefixListName"));<NEW_LINE>permission.setSourcePrefixListId(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].SourcePrefixListId"));<NEW_LINE>permission.setSourceGroupOwnerAccount(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].SourceGroupOwnerAccount"));<NEW_LINE>permission.setSourceGroupName(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].SourceGroupName"));<NEW_LINE>permission.setSourcePortRange(_ctx.stringValue("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].SourcePortRange"));<NEW_LINE>permissions.add(permission);<NEW_LINE>}<NEW_LINE>describeSecurityGroupAttributeResponse.setPermissions(permissions);<NEW_LINE>return describeSecurityGroupAttributeResponse;<NEW_LINE>} | ("DescribeSecurityGroupAttributeResponse.Permissions[" + i + "].CreateTime")); |
1,732,576 | public Set<LDAPCapabilityRepresentation> queryServerCapabilities() {<NEW_LINE>Set<LDAPCapabilityRepresentation> result = new LinkedHashSet<>();<NEW_LINE>try {<NEW_LINE>List<String> attrs = new ArrayList<>();<NEW_LINE>attrs.add("supportedControl");<NEW_LINE>attrs.add("supportedExtension");<NEW_LINE>attrs.add("supportedFeatures");<NEW_LINE>List<SearchResult> searchResults = operationManager.search("", "(objectClass=*)", Collections.unmodifiableCollection(attrs), SearchControls.OBJECT_SCOPE);<NEW_LINE>if (searchResults.size() != 1) {<NEW_LINE>throw new ModelException("Could not query root DSE: unexpected result size");<NEW_LINE>}<NEW_LINE>SearchResult rootDse = searchResults.get(0);<NEW_LINE>Attributes attributes = rootDse.getAttributes();<NEW_LINE>for (String attr : attrs) {<NEW_LINE>Attribute attribute = attributes.get(attr);<NEW_LINE>if (null != attribute) {<NEW_LINE>CapabilityType capabilityType = CapabilityType.fromRootDseAttributeName(attr);<NEW_LINE>NamingEnumeration<?> values = attribute.getAll();<NEW_LINE>while (values.hasMoreElements()) {<NEW_LINE><MASK><NEW_LINE>LDAPCapabilityRepresentation capability = new LDAPCapabilityRepresentation(o, capabilityType);<NEW_LINE>logger.info("rootDSE query: " + capability);<NEW_LINE>result.add(capability);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} catch (NamingException e) {<NEW_LINE>throw new ModelException("Failed to query root DSE: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | Object o = values.nextElement(); |
741,808 | private void loadCollectionDescriptors() {<NEW_LINE>// Load collection classes marked with @Collection annotation<NEW_LINE>List<CollectionDetails> collections = getCollections();<NEW_LINE>for (CollectionDetails collection : collections) {<NEW_LINE>CollectionInfo collectionInfo = collection.cd.getCollection();<NEW_LINE>collectionMap.put(collectionInfo.getHref().getPath(), collection);<NEW_LINE>}<NEW_LINE>// Now add collections to their parents<NEW_LINE>// Example add to /v1 collections services databases etc.<NEW_LINE>for (CollectionDetails details : collectionMap.values()) {<NEW_LINE>CollectionInfo collectionInfo = details.cd.getCollection();<NEW_LINE>if (collectionInfo.getName().equals("root")) {<NEW_LINE>// Collection root does not have any parent<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String parent = new File(collectionInfo.getHref().getPath()).getParent();<NEW_LINE>CollectionDetails <MASK><NEW_LINE>if (parentCollection != null) {<NEW_LINE>collectionMap.get(parent).addChildCollection(details);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | parentCollection = collectionMap.get(parent); |
1,129,336 | public com.amazonaws.services.ivs.model.StreamUnavailableException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.ivs.model.StreamUnavailableException streamUnavailableException = new com.amazonaws.services.ivs.model.StreamUnavailableException(null);<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("exceptionMessage", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>streamUnavailableException.setExceptionMessage(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 streamUnavailableException;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,619,091 | public void inASTStatementSequenceNode(ASTStatementSequenceNode node) {<NEW_LINE>for (AugmentedStmt as : node.getStatements()) {<NEW_LINE>Stmt s = as.get_Stmt();<NEW_LINE>if (!(s instanceof DefinitionStmt)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>DefinitionStmt ds = (DefinitionStmt) s;<NEW_LINE>ValueBox rightBox = ds.getRightOpBox();<NEW_LINE>Value right = rightBox.getValue();<NEW_LINE>// right type should contain the expected type on the left<NEW_LINE>// in the case of the cast this is the cast type else just get the left type<NEW_LINE>Type rightType = null;<NEW_LINE>ValueBox OpBox = null;<NEW_LINE>if (right instanceof CastExpr) {<NEW_LINE>rightType = ((CastExpr) right).getCastType();<NEW_LINE>OpBox = ((CastExpr) right).getOpBox();<NEW_LINE>} else {<NEW_LINE>rightType = ds.getLeftOp().getType();<NEW_LINE>OpBox = rightBox;<NEW_LINE>}<NEW_LINE>if (!(rightType instanceof IntType)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (!(Op.getType() instanceof BooleanType)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// ready for the switch<NEW_LINE>ImmediateBox trueBox = new ImmediateBox(IntConstant.v(1));<NEW_LINE>ImmediateBox falseBox = new ImmediateBox(IntConstant.v(0));<NEW_LINE>DShortcutIf shortcut = new DShortcutIf(OpBox, trueBox, falseBox);<NEW_LINE>if (DEBUG) {<NEW_LINE>System.out.println("created: " + shortcut);<NEW_LINE>}<NEW_LINE>rightBox.setValue(shortcut);<NEW_LINE>}<NEW_LINE>} | Value Op = OpBox.getValue(); |
1,708,505 | private static <T> T deserializeObject(final Class<T> expectedType, final String json, final ClassFieldCache classFieldCache) throws IllegalArgumentException {<NEW_LINE>// Parse the JSON<NEW_LINE>Object parsedJSON;<NEW_LINE>try {<NEW_LINE>parsedJSON = JSONParser.parseJSON(json);<NEW_LINE>} catch (final ParseException e) {<NEW_LINE>throw new IllegalArgumentException("Could not parse JSON", e);<NEW_LINE>}<NEW_LINE>T objectInstance;<NEW_LINE>try {<NEW_LINE>// Construct an object of the expected type<NEW_LINE>final Constructor<?> <MASK><NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final T newInstance = (T) constructor.newInstance();<NEW_LINE>objectInstance = newInstance;<NEW_LINE>} catch (final ReflectiveOperationException | SecurityException e) {<NEW_LINE>throw new IllegalArgumentException("Could not construct object of type " + expectedType.getName(), e);<NEW_LINE>}<NEW_LINE>// Populate the object from the parsed JSON<NEW_LINE>final List<Runnable> collectionElementAdders = new ArrayList<>();<NEW_LINE>populateObjectFromJsonObject(objectInstance, expectedType, parsedJSON, classFieldCache, getInitialIdToObjectMap(objectInstance, parsedJSON), collectionElementAdders);<NEW_LINE>for (final Runnable runnable : collectionElementAdders) {<NEW_LINE>runnable.run();<NEW_LINE>}<NEW_LINE>return objectInstance;<NEW_LINE>} | constructor = classFieldCache.getDefaultConstructorForConcreteTypeOf(expectedType); |
168,525 | private String discoverTagName(RSyntaxDocument doc, int dot) {<NEW_LINE>Stack<String> stack = new Stack<>();<NEW_LINE>Element root = doc.getDefaultRootElement();<NEW_LINE>int curLine = root.getElementIndex(dot);<NEW_LINE>for (int i = 0; i <= curLine; i++) {<NEW_LINE>Token t = doc.getTokenListForLine(i);<NEW_LINE>while (t != null && t.isPaintable()) {<NEW_LINE>if (t.getType() == Token.MARKUP_TAG_DELIMITER) {<NEW_LINE>if (t.isSingleChar('<') || t.isSingleChar('[')) {<NEW_LINE>t = t.getNextToken();<NEW_LINE>while (t != null && t.isPaintable()) {<NEW_LINE>if (// Being lenient here and also checking<NEW_LINE>t.getType() == Token.MARKUP_TAG_NAME || // for attributes, in case they<NEW_LINE>// (incorrectly) have whitespace between<NEW_LINE>// the '<' char and the element name.<NEW_LINE>t.getType() == Token.MARKUP_TAG_ATTRIBUTE) {<NEW_LINE>stack.<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>t = t.getNextToken();<NEW_LINE>}<NEW_LINE>} else if (t.length() == 2 && t.charAt(0) == '/' && (t.charAt(1) == '>' || t.charAt(1) == ']')) {<NEW_LINE>if (!stack.isEmpty()) {<NEW_LINE>// Always true for valid XML<NEW_LINE>stack.pop();<NEW_LINE>}<NEW_LINE>} else if (t.length() == 2 && (t.charAt(0) == '<' || t.charAt(0) == '[') && t.charAt(1) == '/') {<NEW_LINE>String tagName = null;<NEW_LINE>if (!stack.isEmpty()) {<NEW_LINE>// Always true for valid XML<NEW_LINE>tagName = stack.pop();<NEW_LINE>}<NEW_LINE>if (t.getEndOffset() >= dot) {<NEW_LINE>return tagName;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>t = t == null ? null : t.getNextToken();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Should never happen<NEW_LINE>return null;<NEW_LINE>} | push(t.getLexeme()); |
1,439,472 | public Action<Chain> uploadFile() {<NEW_LINE>return chain -> chain.post("upload", ctx -> {<NEW_LINE>TransformablePublisher<? extends ByteBuf> pub = ctx.getRequest().getBodyStream();<NEW_LINE>pub.subscribe(new Subscriber<ByteBuf>() {<NEW_LINE><NEW_LINE>private Subscription sub;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSubscribe(Subscription sub) {<NEW_LINE>this.sub = sub;<NEW_LINE>sub.request(1);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onNext(ByteBuf t) {<NEW_LINE>try {<NEW_LINE>int len = t.readableBytes();<NEW_LINE><MASK><NEW_LINE>// Do something useful with data<NEW_LINE>// Request next chunk<NEW_LINE>sub.request(1);<NEW_LINE>} finally {<NEW_LINE>// DO NOT FORGET to RELEASE !<NEW_LINE>t.release();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Throwable t) {<NEW_LINE>ctx.getResponse().status(500);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onComplete() {<NEW_LINE>ctx.getResponse().status(202);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>} | log.info("Got {} bytes", len); |
936,859 | protected // }<NEW_LINE>CrawlURI makeCrawlUri(JSONObject jo) throws URIException, JSONException {<NEW_LINE>JSONObject joHeaders = jo.getJSONObject("headers");<NEW_LINE>UURI uuri = UURIFactory.getInstance(jo.getString("url"));<NEW_LINE>UURI via = UURIFactory.getInstance(jo.getString("parentUrl"));<NEW_LINE>JSONObject parentUrlMetadata = jo.getJSONObject("parentUrlMetadata");<NEW_LINE>String parentHopPath = parentUrlMetadata.getString("pathFromSeed");<NEW_LINE>String hop = jo.optString("hop", Hop.INFERRED.getHopString());<NEW_LINE>String hopPath = parentHopPath + hop;<NEW_LINE>CrawlURI curi = new CrawlURI(uuri, hopPath, via, LinkContext.INFERRED_MISC);<NEW_LINE>populateHeritableMetadata(curi, parentUrlMetadata);<NEW_LINE>// set the http headers from the amqp message<NEW_LINE>Map<String, String> customHttpRequestHeaders = new HashMap<String, String>();<NEW_LINE>for (Object key : joHeaders.keySet()) {<NEW_LINE>String k = key.toString();<NEW_LINE>if (!k.startsWith(":") && !REQUEST_HEADER_BLACKLIST.contains(k)) {<NEW_LINE>customHttpRequestHeaders.put(k, joHeaders.getString(key.toString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>curi.getData().put("customHttpRequestHeaders", customHttpRequestHeaders);<NEW_LINE>if (Hop.INFERRED.getHopString().equals(curi.getLastHop())) {<NEW_LINE><MASK><NEW_LINE>curi.setPrecedence(1);<NEW_LINE>}<NEW_LINE>curi.setForceFetch(forceFetch || jo.optBoolean("forceFetch"));<NEW_LINE>curi.setSeed(jo.optBoolean("isSeed"));<NEW_LINE>curi.getAnnotations().add(A_RECEIVED_FROM_AMQP);<NEW_LINE>return curi;<NEW_LINE>} | curi.setSchedulingDirective(SchedulingConstants.HIGH); |
349,973 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public create variable boolean queryvar_bool", path);<NEW_LINE>env.compileDeploy("@public create variable int lower", path);<NEW_LINE><MASK><NEW_LINE>env.compileDeploy("on SupportBean set queryvar_bool=boolPrimitive, lower=intPrimitive,upper=intBoxed", path);<NEW_LINE>String stmtText = "@name('s0') select * from sql:MyDBWithLRU100000 ['select mybigint, mybool from mytesttable where ${queryvar_bool} = mytesttable.mybool and myint between ${lower} and ${upper} order by mybigint']";<NEW_LINE>String[] fields = new String[] { "mybigint", "mybool" };<NEW_LINE>env.compileDeploy(stmtText, path);<NEW_LINE>sendSupportBeanEvent(env, true, 20, 60);<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>for (int i = 0; i < 10000; i++) {<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, new Object[][] { { 4L, true } });<NEW_LINE>}<NEW_LINE>long end = System.currentTimeMillis();<NEW_LINE>long delta = end - start;<NEW_LINE>assertTrue("delta=" + delta, delta < 1000);<NEW_LINE>env.undeployAll();<NEW_LINE>} | env.compileDeploy("@public create variable int upper", path); |
776,203 | public Object execute(JSDynamicObject promise, Object reason) {<NEW_LINE>assert JSPromise.isPending(promise);<NEW_LINE>if (!JSConfig.EagerStackTrace && context.isOptionAsyncStackTraces() && JSError.isJSError(reason)) {<NEW_LINE>// Materialize lazy stack trace before clearing promise reactions.<NEW_LINE>materializeLazyStackTrace((JSErrorObject) reason);<NEW_LINE>}<NEW_LINE>Object reactions = getPromiseRejectReactions.getValue(promise);<NEW_LINE><MASK><NEW_LINE>setPromiseFulfillReactions.setValue(promise, Undefined.instance);<NEW_LINE>setPromiseRejectReactions.setValue(promise, Undefined.instance);<NEW_LINE>JSPromise.setPromiseState(promise, JSPromise.REJECTED);<NEW_LINE>if (unhandledProf.profile(getPromiseIsHandled.getValue(promise) != Boolean.TRUE)) {<NEW_LINE>context.notifyPromiseRejectionTracker(promise, JSPromise.REJECTION_TRACKER_OPERATION_REJECT, reason);<NEW_LINE>}<NEW_LINE>return triggerPromiseReactions.execute(reactions, reason);<NEW_LINE>} | setPromiseResult.setValue(promise, reason); |
99,114 | private void createSharedFieldSetter(Field field) {<NEW_LINE>String setterName = "set" + MetaClassHelper.capitalize(field.getName());<NEW_LINE>Parameter[] params = new Parameter[] { new Parameter(field.getAst()<MASK><NEW_LINE>MethodNode setter = spec.getAst().getMethod(setterName, params);<NEW_LINE>if (setter != null) {<NEW_LINE>errorReporter.error(field.getAst(), "@Shared field '%s' conflicts with method '%s'; please rename either of them", field.getName(), setter.getName());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BlockStatement setterBlock = new BlockStatement();<NEW_LINE>setter = new MethodNode(setterName, determineVisibilityForSharedFieldAccessor(field) | Opcodes.ACC_SYNTHETIC, getPlainReference(ClassHelper.VOID_TYPE), params, ClassNode.EMPTY_ARRAY, setterBlock);<NEW_LINE>setterBlock.addStatement(new ExpressionStatement(new BinaryExpression(new // use internal name<NEW_LINE>AttributeExpression(// use internal name<NEW_LINE>getSharedInstance(), new ConstantExpression(field.getAst().getName())), Token.newSymbol(Types.ASSIGN, -1, -1), new VariableExpression("$spock_value"))));<NEW_LINE>setter.setSourcePosition(field.getAst());<NEW_LINE>spec.getAst().addMethod(setter);<NEW_LINE>} | .getType(), "$spock_value") }; |
511,374 | public EnableEnhancedMonitoringResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>EnableEnhancedMonitoringResult enableEnhancedMonitoringResult = new EnableEnhancedMonitoringResult();<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE><MASK><NEW_LINE>if (name.equals("StreamName")) {<NEW_LINE>enableEnhancedMonitoringResult.setStreamName(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("CurrentShardLevelMetrics")) {<NEW_LINE>enableEnhancedMonitoringResult.setCurrentShardLevelMetrics(new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>} else if (name.equals("DesiredShardLevelMetrics")) {<NEW_LINE>enableEnhancedMonitoringResult.setDesiredShardLevelMetrics(new ListUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return enableEnhancedMonitoringResult;<NEW_LINE>} | String name = reader.nextName(); |
1,419,364 | public void endTessellation() {<NEW_LINE>if (root.tessUpdate) {<NEW_LINE>if (root.tessKind == TRIANGLES && hasPolys) {<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolyVertex.glId);<NEW_LINE>tessGeo.finalPolyVerticesBuffer(firstModifiedPolyVertex, lastModifiedPolyVertex);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolyColor.glId);<NEW_LINE>tessGeo.finalPolyColorsBuffer(firstModifiedPolyColor, lastModifiedPolyColor);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolyNormal.glId);<NEW_LINE>tessGeo.finalPolyNormalsBuffer(firstModifiedPolyNormal, lastModifiedPolyNormal);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolyTexCoord.glId);<NEW_LINE>tessGeo.finalPolyTexCoordsBuffer(firstModifiedPolyTexCoord, lastModifiedPolyTexCoord);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolyAmbient.glId);<NEW_LINE>tessGeo.finalPolyAmbientBuffer(firstModifiedPolyAmbient, lastModifiedPolyAmbient);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolySpecular.glId);<NEW_LINE>tessGeo.finalPolySpecularBuffer(firstModifiedPolySpecular, lastModifiedPolySpecular);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolyEmissive.glId);<NEW_LINE>tessGeo.finalPolyEmissiveBuffer(firstModifiedPolyEmissive, lastModifiedPolyEmissive);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPolyShininess.glId);<NEW_LINE>tessGeo.finalPolyShininessBuffer(firstModifiedPolyShininess, lastModifiedPolyShininess);<NEW_LINE>for (String name : polyAttribs.keySet()) {<NEW_LINE>VertexAttribute attrib = polyAttribs.get(name);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, attrib.buf.glId);<NEW_LINE>tessGeo.finalPolyAttribsBuffer(attrib, attrib.firstModified, attrib.lastModified);<NEW_LINE>}<NEW_LINE>} else if (root.tessKind == LINES && hasLines) {<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufLineVertex.glId);<NEW_LINE>tessGeo.finalLineVerticesBuffer(firstModifiedLineVertex, lastModifiedLineVertex);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufLineColor.glId);<NEW_LINE>tessGeo.finalLineColorsBuffer(firstModifiedLineColor, lastModifiedLineColor);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufLineAttrib.glId);<NEW_LINE>tessGeo.finalLineDirectionsBuffer(firstModifiedLineAttribute, lastModifiedLineAttribute);<NEW_LINE>} else if (root.tessKind == POINTS && hasPoints) {<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPointVertex.glId);<NEW_LINE>tessGeo.finalPointVerticesBuffer(firstModifiedPointVertex, lastModifiedPointVertex);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPointColor.glId);<NEW_LINE>tessGeo.finalPointColorsBuffer(firstModifiedPointColor, lastModifiedPointColor);<NEW_LINE>pgl.bindBuffer(PGL.ARRAY_BUFFER, bufPointAttrib.glId);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>root.selVertices = null;<NEW_LINE>root.tessUpdate = false;<NEW_LINE>// To avoid triggering a new tessellation in the draw method.<NEW_LINE>root.modified = false;<NEW_LINE>}<NEW_LINE>} | tessGeo.finalPointOffsetsBuffer(firstModifiedPointAttribute, lastModifiedPointAttribute); |
1,812,196 | public static ListHotlineTransferNumberResponse unmarshall(ListHotlineTransferNumberResponse listHotlineTransferNumberResponse, UnmarshallerContext _ctx) {<NEW_LINE>listHotlineTransferNumberResponse.setRequestId(_ctx.stringValue("ListHotlineTransferNumberResponse.RequestId"));<NEW_LINE>listHotlineTransferNumberResponse.setCode(_ctx.stringValue("ListHotlineTransferNumberResponse.Code"));<NEW_LINE>listHotlineTransferNumberResponse.setMessage(_ctx.stringValue("ListHotlineTransferNumberResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotal(_ctx.longValue("ListHotlineTransferNumberResponse.Data.Total"));<NEW_LINE>data.setPageNo(_ctx.integerValue("ListHotlineTransferNumberResponse.Data.PageNo"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListHotlineTransferNumberResponse.Data.PageSize"));<NEW_LINE>List<ValuesItem> values = new ArrayList<ValuesItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListHotlineTransferNumberResponse.Data.Values.Length"); i++) {<NEW_LINE>ValuesItem valuesItem = new ValuesItem();<NEW_LINE>valuesItem.setQualificationId(_ctx.stringValue("ListHotlineTransferNumberResponse.Data.Values[" + i + "].QualificationId"));<NEW_LINE>valuesItem.setPhoneNumber(_ctx.stringValue("ListHotlineTransferNumberResponse.Data.Values[" + i + "].PhoneNumber"));<NEW_LINE>valuesItem.setNumberOwnerName(_ctx.stringValue("ListHotlineTransferNumberResponse.Data.Values[" + i + "].NumberOwnerName"));<NEW_LINE>valuesItem.setIdentityCard(_ctx.stringValue("ListHotlineTransferNumberResponse.Data.Values[" + i + "].IdentityCard"));<NEW_LINE>valuesItem.setResUniqueCode(_ctx.stringValue<MASK><NEW_LINE>valuesItem.setHotlineNumber(_ctx.stringValue("ListHotlineTransferNumberResponse.Data.Values[" + i + "].HotlineNumber"));<NEW_LINE>values.add(valuesItem);<NEW_LINE>}<NEW_LINE>data.setValues(values);<NEW_LINE>listHotlineTransferNumberResponse.setData(data);<NEW_LINE>return listHotlineTransferNumberResponse;<NEW_LINE>} | ("ListHotlineTransferNumberResponse.Data.Values[" + i + "].ResUniqueCode")); |
443,179 | public Contentlet translateContent(Contentlet src, Language translateTo, List<Field> fieldsToTranslate, User user) throws TranslationException {<NEW_LINE>Preconditions.checkNotNull(src, "Unable to translate null content.");<NEW_LINE>Preconditions.checkNotNull(fieldsToTranslate, "List of fields to translate can't be null");<NEW_LINE>Preconditions.checkArgument(!<MASK><NEW_LINE>try {<NEW_LINE>Structure srcSt = src.getStructure();<NEW_LINE>List<Field> filteredFields = // exclude fileAsset name from translation<NEW_LINE>fieldsToTranslate.stream().filter(// exclude null field values from translation<NEW_LINE>f -> !(srcSt.isFileAsset() && f.getVelocityVarName().equals("fileName"))).filter(f -> src.getStringProperty(f.getVelocityVarName()) != null).collect(Collectors.toList());<NEW_LINE>List<String> valuesToTranslate = filteredFields.stream().map(f -> src.getStringProperty(f.getVelocityVarName())).collect(Collectors.toList());<NEW_LINE>Language translateFrom = apiProvider.languageAPI().getLanguage(src.getLanguageId());<NEW_LINE>List<String> translatedValues = translateStrings(valuesToTranslate, translateFrom, translateTo);<NEW_LINE>Contentlet translated = apiProvider.contentletAPI().checkout(src.getInode(), user, false);<NEW_LINE>translated.setLanguageId(translateTo.getId());<NEW_LINE>int i = 0;<NEW_LINE>for (Field field : filteredFields) {<NEW_LINE>translated.setStringProperty(field.getVelocityVarName(), translatedValues.get(i));<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>return translated;<NEW_LINE>} catch (DotContentletStateException | DotDataException | DotSecurityException e) {<NEW_LINE>throw new TranslationException("Error translating content", e);<NEW_LINE>}<NEW_LINE>} | fieldsToTranslate.isEmpty(), "List of fields to translate can't be empty"); |
1,245,334 | protected PDFormXObject importPageAsXForm(RenderingContext ctx, Element e, PdfBoxOutputDevice pdfBoxOutputDevice, LayerUtility layerUtility) throws IOException {<NEW_LINE>Map<String, PDFormXObject> map = getFormCacheMap(pdfBoxOutputDevice);<NEW_LINE>int pdfpage = getPageNumber(e);<NEW_LINE>String pdfsrc = e.getAttribute("pdfsrc");<NEW_LINE>String url = ctx.getUac().resolveURI(pdfsrc);<NEW_LINE>PDFormXObject pdFormXObject = map.get(url);<NEW_LINE>if (pdFormXObject == null) {<NEW_LINE>try (InputStream inputStream = new URL(url).openStream()) {<NEW_LINE>PDFParser pdfParser = new PDFParser(new RandomAccessBuffer(inputStream));<NEW_LINE>pdfParser.parse();<NEW_LINE>pdFormXObject = layerUtility.importPageAsForm(pdfParser.getPDDocument(), pdfpage - 1);<NEW_LINE>pdfParser<MASK><NEW_LINE>}<NEW_LINE>map.put(url, pdFormXObject);<NEW_LINE>}<NEW_LINE>return pdFormXObject;<NEW_LINE>} | .getPDDocument().close(); |
758,846 | public CreateLicenseResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateLicenseResult createLicenseResult = new CreateLicenseResult();<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 createLicenseResult;<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("LicenseArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createLicenseResult.setLicenseArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Status", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createLicenseResult.setStatus(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Version", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createLicenseResult.setVersion(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return createLicenseResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,034,513 | public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = new String[] { "sumvalue" };<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String epl = "@name('create') @public create window MyWindowFCLS#keepall as select theString as key, intPrimitive as value from SupportBean;\n" + "insert into MyWindowFCLS select theString as key, intPrimitive as value from SupportBean;\n";<NEW_LINE><MASK><NEW_LINE>sendSupportBeanInt(env, "G1", 5);<NEW_LINE>sendSupportBeanInt(env, "G2", 15);<NEW_LINE>sendSupportBeanInt(env, "G3", 2);<NEW_LINE>// create consumer<NEW_LINE>String stmtTextSelectOne = "@name('s0') select irstream sum(value) as sumvalue from MyWindowFCLS(value > 0, value < 10)";<NEW_LINE>env.compileDeploy(stmtTextSelectOne, path).addListener("s0");<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { 7 } });<NEW_LINE>sendSupportBeanInt(env, "G4", 1);<NEW_LINE>env.assertPropsIRPair("s0", fields, new Object[] { 8 }, new Object[] { 7 });<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { 8 } });<NEW_LINE>sendSupportBeanInt(env, "G5", 20);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { 8 } });<NEW_LINE>sendSupportBeanInt(env, "G6", 9);<NEW_LINE>env.assertPropsIRPair("s0", fields, new Object[] { 17 }, new Object[] { 8 });<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { 17 } });<NEW_LINE>// create delete stmt<NEW_LINE>String stmtTextDelete = "@name('delete') on SupportMarketDataBean as s0 delete from MyWindowFCLS as s1 where s0.symbol = s1.key";<NEW_LINE>env.compileDeploy(stmtTextDelete, path);<NEW_LINE>sendMarketBean(env, "G4");<NEW_LINE>env.assertPropsIRPair("s0", fields, new Object[] { 16 }, new Object[] { 17 });<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { 16 } });<NEW_LINE>sendMarketBean(env, "G5");<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { 16 } });<NEW_LINE>env.undeployModuleContaining("s0");<NEW_LINE>env.undeployModuleContaining("delete");<NEW_LINE>env.undeployModuleContaining("create");<NEW_LINE>} | env.compileDeploy(epl, path); |
1,054,355 | final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListTagsForResourceRequest> request = null;<NEW_LINE>Response<ListTagsForResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "QuickSight");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListTagsForResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
680,197 | public ProcessStatus handleRestValidateCode(final PwmRequest pwmRequest) throws PwmUnrecoverableException, IOException, ServletException, ChaiUnavailableException {<NEW_LINE>final PwmDomain pwmDomain = pwmRequest.getPwmDomain();<NEW_LINE>final PwmSession pwmSession = pwmRequest.getPwmSession();<NEW_LINE>final OTPUserRecord otpUserRecord = pwmSession.getUserInfo().getOtpUserRecord();<NEW_LINE>final OtpService otpService = pwmDomain.getOtpService();<NEW_LINE>final String bodyString = pwmRequest.readRequestBodyAsString();<NEW_LINE>final Map<String, String> clientValues = JsonFactory.get().deserializeStringMap(bodyString);<NEW_LINE>final String code = Validator.sanitizeInputValue(pwmRequest.getAppConfig(), clientValues.get("code"), 1024);<NEW_LINE>try {<NEW_LINE>final boolean passed = otpService.validateToken(pwmRequest.getLabel(), pwmSession.getUserInfo().getUserIdentity(), otpUserRecord, code, false);<NEW_LINE>final RestResultBean restResultBean = RestResultBean.withData(passed, Boolean.class);<NEW_LINE>LOGGER.trace(pwmRequest, () -> "returning result for restValidateCode: " + JsonFactory.get().serialize(restResultBean));<NEW_LINE>pwmRequest.outputJsonResult(restResultBean);<NEW_LINE>} catch (final PwmOperationalException e) {<NEW_LINE>final String errorMsg = "error during otp code validation: " + e.getMessage();<NEW_LINE>LOGGER.error(pwmRequest, () -> errorMsg);<NEW_LINE>pwmRequest.outputJsonResult(RestResultBean.fromError(new ErrorInformation(PwmError.<MASK><NEW_LINE>}<NEW_LINE>return ProcessStatus.Continue;<NEW_LINE>} | ERROR_INTERNAL, errorMsg), pwmRequest)); |
1,849,830 | public static void main(String[] args) throws InterruptedException {<NEW_LINE>String curProtocol = System.getProperty("dubbo.current.protocol", CommonConstants.DUBBO);<NEW_LINE>String zookeeperAddress = System.getProperty("zookeeper.address", "127.0.0.1");<NEW_LINE>new EmbeddedZooKeeper(2181, false).start();<NEW_LINE>ServiceConfig<GreeterService> serviceConfig = new ServiceConfig<>();<NEW_LINE>serviceConfig.setInterface(GreeterService.class);<NEW_LINE>serviceConfig<MASK><NEW_LINE>DubboBootstrap bootstrap = DubboBootstrap.getInstance();<NEW_LINE>bootstrap.application(new ApplicationConfig("dubbo-samples-migration-provider")).registry(new RegistryConfig("zookeeper://" + zookeeperAddress + ":2181")).protocol(new ProtocolConfig(curProtocol)).service(serviceConfig).start();<NEW_LINE>System.out.println("dubbo service started.");<NEW_LINE>bootstrap.await();<NEW_LINE>} | .setRef(new GreeterServiceImpl()); |
1,002,437 | // Dump the content of this bean returning it as a String<NEW_LINE>public void dump(StringBuffer str, String indent) {<NEW_LINE>String s;<NEW_LINE>Object o;<NEW_LINE>org.netbeans.modules.schema2beans.BaseBean n;<NEW_LINE>str.append(indent);<NEW_LINE>// NOI18N<NEW_LINE>str.append("Name");<NEW_LINE>// NOI18N<NEW_LINE>str.append(indent + "\t");<NEW_LINE>// NOI18N<NEW_LINE>str.append("<");<NEW_LINE>s = this.getName();<NEW_LINE>// NOI18N<NEW_LINE>str.append((s == null ? "null" : s.trim()));<NEW_LINE>// NOI18N<NEW_LINE>str.append(">\n");<NEW_LINE>this.dumpAttributes(<MASK><NEW_LINE>str.append(indent);<NEW_LINE>// NOI18N<NEW_LINE>str.append("Classname");<NEW_LINE>// NOI18N<NEW_LINE>str.append(indent + "\t");<NEW_LINE>// NOI18N<NEW_LINE>str.append("<");<NEW_LINE>s = this.getClassname();<NEW_LINE>// NOI18N<NEW_LINE>str.append((s == null ? "null" : s.trim()));<NEW_LINE>// NOI18N<NEW_LINE>str.append(">\n");<NEW_LINE>this.dumpAttributes(CLASSNAME, 0, str, indent);<NEW_LINE>str.append(indent);<NEW_LINE>// NOI18N<NEW_LINE>str.append("Arguments");<NEW_LINE>n = (org.netbeans.modules.schema2beans.BaseBean) this.getArguments();<NEW_LINE>if (n != null)<NEW_LINE>// NOI18N<NEW_LINE>n.dump(str, indent + "\t");<NEW_LINE>else<NEW_LINE>// NOI18N<NEW_LINE>str.append(indent + "\tnull");<NEW_LINE>this.dumpAttributes(ARGUMENTS, 0, str, indent);<NEW_LINE>} | NAME, 0, str, indent); |
1,376,334 | private OnHeapHnswGraph writeGraph(RandomAccessVectorValuesProducer vectorValues, VectorSimilarityFunction similarityFunction) throws IOException {<NEW_LINE>// build graph<NEW_LINE>HnswGraphBuilder hnswGraphBuilder = new HnswGraphBuilder(vectorValues, similarityFunction, maxConn, beamWidth, HnswGraphBuilder.randSeed);<NEW_LINE>hnswGraphBuilder.setInfoStream(segmentWriteState.infoStream);<NEW_LINE>OnHeapHnswGraph graph = hnswGraphBuilder.build(vectorValues.randomAccess());<NEW_LINE>// write vectors' neighbours on each level into the vectorIndex file<NEW_LINE><MASK><NEW_LINE>for (int level = 0; level < graph.numLevels(); level++) {<NEW_LINE>NodesIterator nodesOnLevel = graph.getNodesOnLevel(level);<NEW_LINE>while (nodesOnLevel.hasNext()) {<NEW_LINE>int node = nodesOnLevel.nextInt();<NEW_LINE>NeighborArray neighbors = graph.getNeighbors(level, node);<NEW_LINE>int size = neighbors.size();<NEW_LINE>vectorIndex.writeInt(size);<NEW_LINE>// Destructively modify; it's ok we are discarding it after this<NEW_LINE>int[] nnodes = neighbors.node();<NEW_LINE>Arrays.sort(nnodes, 0, size);<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>int nnode = nnodes[i];<NEW_LINE>assert nnode < countOnLevel0 : "node too large: " + nnode + ">=" + countOnLevel0;<NEW_LINE>vectorIndex.writeInt(nnode);<NEW_LINE>}<NEW_LINE>// if number of connections < maxConn, add bogus values up to maxConn to have predictable<NEW_LINE>// offsets<NEW_LINE>for (int i = size; i < maxConn; i++) {<NEW_LINE>vectorIndex.writeInt(0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return graph;<NEW_LINE>} | int countOnLevel0 = graph.size(); |
307,600 | protected void paintComponent(Graphics g) {<NEW_LINE>super.paintComponent(g);<NEW_LINE>Graphics2D g2 = (Graphics2D) g;<NEW_LINE>Stroke currentStroke = g2.getStroke();<NEW_LINE>g2.setStroke(new BasicStroke(BORDER_THICKNESS));<NEW_LINE>g2.setColor(BORDER_COLOR);<NEW_LINE>int borderWidth = getWidth() - 2 * BORDER_MARGIN;<NEW_LINE>int borderHeight <MASK><NEW_LINE>g2.drawRoundRect(BORDER_MARGIN, BORDER_MARGIN, borderWidth, borderHeight, BORDER_MARGIN, BORDER_MARGIN);<NEW_LINE>g2.setStroke(currentStroke);<NEW_LINE>g2.setColor(TEXT_COLOR);<NEW_LINE>g2.setFont(FONT);<NEW_LINE>Rectangle2D rectangle = g2.getFontMetrics().getStringBounds(NOTHING_SELECTED, g2);<NEW_LINE>int stringX = (int) (getWidth() - rectangle.getWidth()) / 2;<NEW_LINE>int stringY = (int) (getHeight() - rectangle.getHeight()) / 2;<NEW_LINE>g2.drawString(NOTHING_SELECTED, stringX, stringY);<NEW_LINE>} | = getHeight() - 2 * BORDER_MARGIN; |
1,071,447 | /* (non-Javadoc)<NEW_LINE>* @see com.kkalice.adempiere.migrate.DBObjectInterface#loadHeaders(java.util.HashMap, com.kkalice.adempiere.migrate.MigrateLogger, com.kkalice.adempiere.migrate.MigrateDBEngine, com.kkalice.adempiere.migrate.DBConnection, java.lang.String, java.util.HashMap)<NEW_LINE>*/<NEW_LINE>public void loadHeaders(HashMap<Integer, DBObjectDefinition> headerMap, Parameters parameters, MigrateLogger logger, DBEngine dbEngine, DBConnection parent, String name, PreparedStatementWrapper statement) {<NEW_LINE>parent.setPreparedStatementString(statement, 1, name);<NEW_LINE>ResultSet rs = parent.executeQuery(statement);<NEW_LINE>int counter = 0;<NEW_LINE>while (parent.getResultSetNext(rs)) {<NEW_LINE>String triggerName = parent.getResultSetString(rs, "TRIG_NAME");<NEW_LINE>String triggerType = parent.getResultSetString(rs, "TRIG_TYPE");<NEW_LINE>String triggerEvent = parent.getResultSetString(rs, "TRIG_EVENT");<NEW_LINE>String tableName = <MASK><NEW_LINE>String actionType = parent.getResultSetString(rs, "ACTION_TYPE");<NEW_LINE>String actionOrientation = parent.getResultSetString(rs, "ACTION_ORIENTATION");<NEW_LINE>DBObject_Trigger_Table obj = new DBObject_Trigger_Table(parent, triggerName, counter);<NEW_LINE>obj.initializeDefinition(triggerType, triggerEvent, tableName, actionType, actionOrientation);<NEW_LINE>headerMap.put(new Integer(counter), obj);<NEW_LINE>counter++;<NEW_LINE>}<NEW_LINE>parent.releaseResultSet(rs);<NEW_LINE>} | parent.getResultSetString(rs, "TABLE_NAME"); |
167,566 | public void process(boolean validate, boolean documentsOnly) {<NEW_LINE>for (SDField field : schema.allConcreteFields()) {<NEW_LINE>if (field.getMatching().getType() != MatchType.TEXT)<NEW_LINE>continue;<NEW_LINE>ScriptExpression script = field.getIndexingScript();<NEW_LINE>if (script == null)<NEW_LINE>continue;<NEW_LINE>DataType fieldType = field.getDataType();<NEW_LINE>if (fieldType instanceof CollectionDataType) {<NEW_LINE>fieldType = ((CollectionDataType) fieldType).getNestedType();<NEW_LINE>}<NEW_LINE>if (fieldType != DataType.STRING)<NEW_LINE>continue;<NEW_LINE>Set<String> <MASK><NEW_LINE>Set<String> staticSummary = new TreeSet<>();<NEW_LINE>new IndexingOutputs(schema, deployLogger, rankProfileRegistry, queryProfiles).findSummaryTo(schema, field, dynamicSummary, staticSummary);<NEW_LINE>MyVisitor visitor = new MyVisitor(dynamicSummary);<NEW_LINE>visitor.visit(script);<NEW_LINE>if (!visitor.requiresTokenize)<NEW_LINE>continue;<NEW_LINE>ExpressionConverter converter = new MyStringTokenizer(schema, findAnnotatorConfig(schema, field));<NEW_LINE>field.setIndexingScript((ScriptExpression) converter.convert(script));<NEW_LINE>}<NEW_LINE>} | dynamicSummary = new TreeSet<>(); |
924,450 | final CancelSpotInstanceRequestsResult executeCancelSpotInstanceRequests(CancelSpotInstanceRequestsRequest cancelSpotInstanceRequestsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(cancelSpotInstanceRequestsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CancelSpotInstanceRequestsRequest> request = null;<NEW_LINE>Response<CancelSpotInstanceRequestsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CancelSpotInstanceRequestsRequestMarshaller().marshall(super.beforeMarshalling(cancelSpotInstanceRequestsRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CancelSpotInstanceRequests");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<CancelSpotInstanceRequestsResult> responseHandler = new StaxResponseHandler<CancelSpotInstanceRequestsResult>(new CancelSpotInstanceRequestsResultStaxUnmarshaller());<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>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2"); |
1,669,162 | private void sendReport(HttpServletRequest req, HttpServletResponse resp, Hashtable<String, Integer> errorList) throws ServletException, IOException {<NEW_LINE><MASK><NEW_LINE>String absoluteUri = req.getRequestURI();<NEW_LINE>String relativePath = getRelativePath(req);<NEW_LINE>XMLWriter generatedXML = new XMLWriter();<NEW_LINE>generatedXML.writeXMLHeader();<NEW_LINE>generatedXML.writeElement(null, "multistatus" + generateNamespaceDeclarations(), XMLWriter.OPENING);<NEW_LINE>Enumeration<String> pathList = errorList.keys();<NEW_LINE>while (pathList.hasMoreElements()) {<NEW_LINE>String errorPath = pathList.nextElement();<NEW_LINE>int errorCode = errorList.get(errorPath);<NEW_LINE>generatedXML.writeElement(null, "response", XMLWriter.OPENING);<NEW_LINE>generatedXML.writeElement(null, "href", XMLWriter.OPENING);<NEW_LINE>String toAppend = errorPath.substring(relativePath.length());<NEW_LINE>if (!toAppend.startsWith("/"))<NEW_LINE>toAppend = "/" + toAppend;<NEW_LINE>generatedXML.writeText(absoluteUri + toAppend);<NEW_LINE>generatedXML.writeElement(null, "href", XMLWriter.CLOSING);<NEW_LINE>generatedXML.writeElement(null, "status", XMLWriter.OPENING);<NEW_LINE>generatedXML.writeText("HTTP/1.1 " + errorCode + " " + WebdavStatus.getStatusText(errorCode));<NEW_LINE>generatedXML.writeElement(null, "status", XMLWriter.CLOSING);<NEW_LINE>generatedXML.writeElement(null, "response", XMLWriter.CLOSING);<NEW_LINE>}<NEW_LINE>generatedXML.writeElement(null, "multistatus", XMLWriter.CLOSING);<NEW_LINE>try (Writer writer = resp.getWriter()) {<NEW_LINE>writer.write(generatedXML.toString());<NEW_LINE>}<NEW_LINE>} | resp.setStatus(WebdavStatus.SC_MULTI_STATUS); |
1,825,033 | public void migrateSyncIfNeeded(final Set<UUID> connectionIds) {<NEW_LINE>final StopWatch globalMigrationWatch = new StopWatch();<NEW_LINE>globalMigrationWatch.start();<NEW_LINE>refreshRunningWorkflow();<NEW_LINE>connectionIds.forEach((connectionId) -> {<NEW_LINE>final StopWatch singleSyncMigrationWatch = new StopWatch();<NEW_LINE>singleSyncMigrationWatch.start();<NEW_LINE>if (!isInRunningWorkflowCache(getConnectionManagerName(connectionId))) {<NEW_LINE>log.info("Migrating: " + connectionId);<NEW_LINE>try {<NEW_LINE>submitConnectionUpdaterAsync(connectionId);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>log.error("New workflow submission failed, retrying", e);<NEW_LINE>refreshRunningWorkflow();<NEW_LINE>submitConnectionUpdaterAsync(connectionId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>singleSyncMigrationWatch.stop();<NEW_LINE>log.info("Sync migration took: " + singleSyncMigrationWatch.formatTime());<NEW_LINE>});<NEW_LINE>globalMigrationWatch.stop();<NEW_LINE>log.info(<MASK><NEW_LINE>} | "The migration to the new scheduler took: " + globalMigrationWatch.formatTime()); |
1,844,743 | public synchronized TlsSecret deriveUsingPRF(int prfAlgorithm, String label, byte[] seed, int length) {<NEW_LINE>checkAlive();<NEW_LINE>try {<NEW_LINE>switch(prfAlgorithm) {<NEW_LINE>case PRFAlgorithm.tls13_hkdf_sha256:<NEW_LINE>return TlsCryptoUtils.hkdfExpandLabel(this, CryptoHashAlgorithm.sha256, label, seed, length);<NEW_LINE>case PRFAlgorithm.tls13_hkdf_sha384:<NEW_LINE>return TlsCryptoUtils.hkdfExpandLabel(this, CryptoHashAlgorithm.sha384, label, seed, length);<NEW_LINE>case PRFAlgorithm.tls13_hkdf_sm3:<NEW_LINE>return TlsCryptoUtils.hkdfExpandLabel(this, CryptoHashAlgorithm.sm3, label, seed, length);<NEW_LINE>default:<NEW_LINE>return crypto.adoptLocalSecret(prf(prfAlgorithm<MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} | , label, seed, length)); |
554,676 | public static Wallet adaptWallet(GateioFunds bterAccountInfo) {<NEW_LINE>List<Balance> balances = new ArrayList<>();<NEW_LINE>for (Entry<String, BigDecimal> funds : bterAccountInfo.getAvailableFunds().entrySet()) {<NEW_LINE>Currency currency = Currency.getInstance(funds.getKey().toUpperCase());<NEW_LINE>BigDecimal amount = funds.getValue();<NEW_LINE>BigDecimal locked = bterAccountInfo.getLockedFunds().get(currency.toString());<NEW_LINE>balances.add(new Balance(currency, null, amount, locked == null ? BigDecimal.ZERO : locked));<NEW_LINE>}<NEW_LINE>for (Entry<String, BigDecimal> funds : bterAccountInfo.getLockedFunds().entrySet()) {<NEW_LINE>Currency currency = Currency.getInstance(funds.getKey().toUpperCase());<NEW_LINE>if (balances.stream().noneMatch(balance -> balance.getCurrency().equals(currency))) {<NEW_LINE>BigDecimal amount = funds.getValue();<NEW_LINE>balances.add(new Balance(currency, null<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Wallet.Builder.from(balances).build();<NEW_LINE>} | , BigDecimal.ZERO, amount)); |
833,183 | public void mouseDragged(MouseEvent me) {<NEW_LINE>super.mouseDragged(me);<NEW_LINE>if (disableElementMovement()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (IS_DRAGGING) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (IS_DRAGGING_DIAGRAM) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Relation r = (Relation) me.getComponent();<NEW_LINE>int gridSize = CurrentDiagram.getInstance().getDiagramHandler().getGridSize();<NEW_LINE>// delta<NEW_LINE>int delta_x = 0;<NEW_LINE>int delta_y = 0;<NEW_LINE>if (IS_DRAGGING_LINEPOINT) {<NEW_LINE>Vector<Point> tmp = r.getLinePoints();<NEW_LINE>Point p = tmp.elementAt(LINEPOINT);<NEW_LINE>delta_x = (r.getRectangle().<MASK><NEW_LINE>delta_y = (r.getRectangle().y + p.y) % gridSize;<NEW_LINE>}<NEW_LINE>Point newp = getNewCoordinate();<NEW_LINE>Point oldp = getOldCoordinate();<NEW_LINE>int diffx = newp.x - oldp.x - delta_x;<NEW_LINE>int diffy = newp.y - oldp.y - delta_y;<NEW_LINE>if (IS_DRAGGING_LINEPOINT & LINEPOINT >= 0) {<NEW_LINE>controller.executeCommand(new OldMoveLinePoint(r, LINEPOINT, diffx, diffy));<NEW_LINE>return;<NEW_LINE>} else if (IS_DRAGGING_LINE) {<NEW_LINE>controller.executeCommand(new Move(Collections.<Direction>emptySet(), r, diffx, diffy, oldp, me.isShiftDown(), false, true, StickableMap.EMPTY_MAP));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int where = r.getLinePoint(new Point(me.getX(), me.getY()));<NEW_LINE>if (where >= 0) {<NEW_LINE>IS_DRAGGING_LINEPOINT = true;<NEW_LINE>LINEPOINT = where;<NEW_LINE>controller.executeCommand(new OldMoveLinePoint(r, where, diffx, diffy));<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>Point p = new Point(me.getX(), me.getY());<NEW_LINE>int ins = r.getWhereToInsert(p);<NEW_LINE>if (ins > 0) {<NEW_LINE>IS_DRAGGING_LINEPOINT = true;<NEW_LINE>LINEPOINT = ins;<NEW_LINE>controller.executeCommand(new OldAddLinePoint(r, ins, me.getX(), me.getY()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | x + p.x) % gridSize; |
850,901 | protected List<Tuple2<Long, float[]>> train(List<Tuple2<Long, float[]>> relatedFeatures, Map<Long, Integer> mapFeatureId2Local, List<int[]> trainData) throws Exception {<NEW_LINE>if (null != this.contextParams) {<NEW_LINE>long startTimeConsumption = System.nanoTime();<NEW_LINE>LOG.info("taskId: {}, localId: {}", getPatitionId(), getRuntimeContext().getIndexOfThisSubtask());<NEW_LINE>Long[] seeds = this.contextParams.getLongArray("seeds");<NEW_LINE>Long[] nsPool = this.contextParams.getLongArray("negBound");<NEW_LINE>final boolean metapathMode = params.getBoolOrDefault("metapathMode", false);<NEW_LINE>long[] groupIdxStarts = null;<NEW_LINE>if (metapathMode) {<NEW_LINE>groupIdxStarts = ArrayUtils.toPrimitive(this.contextParams.getLongArray("groupIdxes"));<NEW_LINE>}<NEW_LINE>int vocSize = this.contextParams.getLong("vocSize").intValue();<NEW_LINE>long <MASK><NEW_LINE>LOG.info("taskId: {}, trainDataSize: {}", getPatitionId(), trainData.size());<NEW_LINE>int vectorSize = params.get(HasVectorSizeDefaultAs100.VECTOR_SIZE);<NEW_LINE>float[] buffer = new float[relatedFeatures.size() * vectorSize];<NEW_LINE>int cur = 0;<NEW_LINE>int inputSize = 0;<NEW_LINE>for (Tuple2<Long, float[]> val : relatedFeatures) {<NEW_LINE>if (val.f0 < vocSize) {<NEW_LINE>inputSize++;<NEW_LINE>}<NEW_LINE>System.arraycopy(val.f1, 0, buffer, cur * vectorSize, vectorSize);<NEW_LINE>cur++;<NEW_LINE>}<NEW_LINE>LOG.info("taskId: {}, trainInputSize: {}", getPatitionId(), inputSize);<NEW_LINE>LOG.info("taskId: {}, trainOutputSize: {}", getPatitionId(), relatedFeatures.size() - inputSize);<NEW_LINE>new TrainSubSet(vocSize, nsPool, params, getPatitionId(), null, groupIdxStarts).train(seed, trainData, buffer, mapFeatureId2Local);<NEW_LINE>for (int i = 0; i < cur; ++i) {<NEW_LINE>System.arraycopy(buffer, i * vectorSize, relatedFeatures.get(i).f1, 0, vectorSize);<NEW_LINE>}<NEW_LINE>long endTimeConsumption = System.nanoTime();<NEW_LINE>LOG.info("taskId: {}, trainTime: {}", getPatitionId(), (endTimeConsumption - startTimeConsumption) / 1000000.0);<NEW_LINE>return relatedFeatures;<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException();<NEW_LINE>}<NEW_LINE>} | seed = seeds[getPatitionId()]; |
1,380,794 | private void createDependencyDeclarationTab(@NotNull TabFolder folder) {<NEW_LINE>Composite container = new Composite(folder, SWT.NONE);<NEW_LINE>container.setLayout(new GridLayout(1, true));<NEW_LINE>container.setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE>GridData gd = new GridData(GridData.FILL_BOTH);<NEW_LINE>gd.heightHint = UIUtils.getFontHeight(container.getFont()) * 12;<NEW_LINE>fieldText = new Text(container, SWT.V_SCROLL | SWT.MULTI | SWT.BORDER);<NEW_LINE>fieldText.setLayoutData(gd);<NEW_LINE>fieldText.addModifyListener(event -> parseArtifactText());<NEW_LINE>errorLabel = new CLabel(container, SWT.NONE);<NEW_LINE>errorLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));<NEW_LINE>errorLabel.setVisible(false);<NEW_LINE>UIUtils.asyncExec(() -> setStatus<MASK><NEW_LINE>TabItem item = new TabItem(folder, SWT.NONE);<NEW_LINE>item.setText(UIConnectionMessages.dialog_edit_driver_edit_maven_raw);<NEW_LINE>item.setControl(container);<NEW_LINE>item.setData(TabType.DEPENDENCY_DECLARATION);<NEW_LINE>} | (false, UIConnectionMessages.dialog_edit_driven_edit_maven_field_text_message)); |
167,938 | public synchronized static void init(Context c) {<NEW_LINE>if (c == null) {<NEW_LINE>LOG.d("AppProfile init null");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AppSP.get().init(c);<NEW_LINE>if (!Android6.canWrite(c)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (profile.equals(getCurrent(c))) {<NEW_LINE>LOG.d("AppProfile skip", profile);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>profile = getCurrent(c);<NEW_LINE>AppDB.get().open(c, "db-" + AppSP.get().rootPath.hashCode() + "-" + profile);<NEW_LINE>LOG.d("AppProfile init", profile);<NEW_LINE>SYNC_FOLDER_ROOT = new File(AppSP.get().rootPath);<NEW_LINE>SYNC_FOLDER_BOOKS = new File(SYNC_FOLDER_ROOT, "Books");<NEW_LINE>SYNC_FOLDER_DICT = new File(SYNC_FOLDER_ROOT, "dict");<NEW_LINE>FONT_LOCAL_ZIP = new File(SYNC_FOLDER_ROOT, "fonts.zip.pack");<NEW_LINE>syncFontFolder = new File(SYNC_FOLDER_ROOT, "Fonts");<NEW_LINE>syncDownloadFolder = new File(SYNC_FOLDER_ROOT, "Downloads");<NEW_LINE>SYNC_FOLDER_PROFILE = new File(SYNC_FOLDER_ROOT, PROFILE_PREFIX + getCurrent(c));<NEW_LINE>SYNC_FOLDER_DEVICE_PROFILE = new File(SYNC_FOLDER_PROFILE, DEVICE_MODEL);<NEW_LINE>SYNC_FOLDER_DEVICE_PROFILE.mkdirs();<NEW_LINE>syncFavorite = new File(SYNC_FOLDER_DEVICE_PROFILE, APP_FAVORITE_JSON);<NEW_LINE>syncExclude = new File(SYNC_FOLDER_DEVICE_PROFILE, APP_EXCLUDE_JSON);<NEW_LINE>syncTags = new File(SYNC_FOLDER_DEVICE_PROFILE, APP_TAGS_JSON);<NEW_LINE>syncPlaylist = new File(SYNC_FOLDER_DEVICE_PROFILE, "playlists");<NEW_LINE>syncBookmarks = new File(SYNC_FOLDER_DEVICE_PROFILE, APP_BOOKMARKS_JSON);<NEW_LINE>syncProgress = new File(SYNC_FOLDER_DEVICE_PROFILE, APP_PROGRESS_JSON);<NEW_LINE>syncRecent = new File(SYNC_FOLDER_DEVICE_PROFILE, APP_RECENT_JSON);<NEW_LINE>syncState <MASK><NEW_LINE>syncCSS = new File(SYNC_FOLDER_DEVICE_PROFILE, APP_CSS_JSON);<NEW_LINE>final boolean isLoaded = AppState.get().loadInit(c);<NEW_LINE>if (isLoaded) {<NEW_LINE>AppState.get().load(c);<NEW_LINE>}<NEW_LINE>TintUtil.init();<NEW_LINE>BookCSS.get().load1(c);<NEW_LINE>PasswordState.get().load(c);<NEW_LINE>DragingPopup.loadCache(c);<NEW_LINE>ExtUtils.init(c);<NEW_LINE>} | = new File(SYNC_FOLDER_DEVICE_PROFILE, APP_STATE_JSON); |
1,602,958 | public MethodDefinition.ImplementationDefinition<S> define(MethodDescription methodDescription) {<NEW_LINE>MethodDefinition.ParameterDefinition.Initial<S> initialParameterDefinition = methodDescription.isConstructor() ? defineConstructor(methodDescription.getModifiers()) : defineMethod(methodDescription.getInternalName(), methodDescription.getReturnType(), methodDescription.getModifiers());<NEW_LINE>ParameterList<?> parameterList = methodDescription.getParameters();<NEW_LINE>MethodDefinition.ExceptionDefinition<S> exceptionDefinition;<NEW_LINE>if (parameterList.hasExplicitMetaData()) {<NEW_LINE>MethodDefinition.ParameterDefinition<S> parameterDefinition = initialParameterDefinition;<NEW_LINE>for (ParameterDescription parameter : parameterList) {<NEW_LINE>parameterDefinition = parameterDefinition.withParameter(parameter.getType(), parameter.getName(), parameter.getModifiers());<NEW_LINE>}<NEW_LINE>exceptionDefinition = parameterDefinition;<NEW_LINE>} else {<NEW_LINE>exceptionDefinition = initialParameterDefinition.withParameters(parameterList.asTypeList());<NEW_LINE>}<NEW_LINE>MethodDefinition.TypeVariableDefinition<S> typeVariableDefinition = exceptionDefinition.throwing(methodDescription.getExceptionTypes());<NEW_LINE>for (TypeDescription.Generic typeVariable : methodDescription.getTypeVariables()) {<NEW_LINE>typeVariableDefinition = typeVariableDefinition.typeVariable(typeVariable.getSymbol(<MASK><NEW_LINE>}<NEW_LINE>return typeVariableDefinition;<NEW_LINE>} | ), typeVariable.getUpperBounds()); |
309,445 | public void performFix(@Nonnull DataContext dataContext) {<NEW_LINE>ProjectStructureSettingsUtil util = (ProjectStructureSettingsUtil) ShowSettingsUtil.getInstance();<NEW_LINE>LibrariesConfigurator librariesConfigurator = util.getLibrariesModel(myProject);<NEW_LINE>final LibraryTable.ModifiableModel libraryTable = librariesConfigurator.getModifiableLibraryTable(myLibrary.getTable());<NEW_LINE>if (libraryTable instanceof LibrariesModifiableModel) {<NEW_LINE>for (String invalidRoot : myInvalidUrls) {<NEW_LINE>final ExistingLibraryEditor libraryEditor = ((LibrariesModifiableModel<MASK><NEW_LINE>libraryEditor.removeRoot(invalidRoot, myType);<NEW_LINE>}<NEW_LINE>// todo context.getDaemonAnalyzer().queueUpdate(LibraryProjectStructureElement.this);<NEW_LINE>Settings settings = Objects.requireNonNull(dataContext.getData(Settings.KEY));<NEW_LINE>ProjectLibrariesConfigurable librariesConfigurable = settings.findConfigurable(ProjectLibrariesConfigurable.class);<NEW_LINE>navigate(myProject).doWhenDone(() -> {<NEW_LINE>final MasterDetailsConfigurable configurable = librariesConfigurable.getSelectedConfigurable();<NEW_LINE>if (configurable instanceof LibraryConfigurable) {<NEW_LINE>((LibraryConfigurable) configurable).updateComponent();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | ) libraryTable).getLibraryEditor(myLibrary); |
1,330,263 | public boolean updateState(State currentState, Event event, State nextState, DataCenterResourceEntity podEntity, Object data) {<NEW_LINE>EngineHostPodVO vo = findById(podEntity.getId());<NEW_LINE><MASK><NEW_LINE>SearchCriteria<EngineHostPodVO> sc = StateChangeSearch.create();<NEW_LINE>sc.setParameters("id", vo.getId());<NEW_LINE>sc.setParameters("state", currentState);<NEW_LINE>UpdateBuilder builder = getUpdateBuilder(vo);<NEW_LINE>builder.set(vo, "state", nextState);<NEW_LINE>builder.set(vo, "lastUpdated", new Date());<NEW_LINE>int rows = update(vo, sc);<NEW_LINE>if (rows == 0 && s_logger.isDebugEnabled()) {<NEW_LINE>EngineHostPodVO dbDC = findByIdIncludingRemoved(vo.getId());<NEW_LINE>if (dbDC != null) {<NEW_LINE>StringBuilder str = new StringBuilder("Unable to update ").append(vo.toString());<NEW_LINE>str.append(": DB Data={id=").append(dbDC.getId()).append("; state=").append(dbDC.getState()).append(";updatedTime=").append(dbDC.getLastUpdated());<NEW_LINE>str.append(": New Data={id=").append(vo.getId()).append("; state=").append(nextState).append("; event=").append(event).append("; updatedTime=").append(vo.getLastUpdated());<NEW_LINE>str.append(": stale Data={id=").append(vo.getId()).append("; state=").append(currentState).append("; event=").append(event).append("; updatedTime=").append(oldUpdatedTime);<NEW_LINE>} else {<NEW_LINE>s_logger.debug("Unable to update dataCenter: id=" + vo.getId() + ", as there is no such dataCenter exists in the database anymore");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return rows > 0;<NEW_LINE>} | Date oldUpdatedTime = vo.getLastUpdated(); |
708,899 | public void render(ChestBlockEntity chest, float partialTicks, PoseStack poseStack, MultiBufferSource buffers, int combinedLight, int combinedOverlay) {<NEW_LINE>Level level = chest.getLevel();<NEW_LINE>if (level == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>var <MASK><NEW_LINE>if (cellItem == null) {<NEW_LINE>// No cell inserted into chest<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Try to get the right cell chassis model from the drive model since it already<NEW_LINE>// loads them all<NEW_LINE>DriveBakedModel driveModel = getDriveModel();<NEW_LINE>if (driveModel == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BakedModel cellModel = driveModel.getCellChassisModel(cellItem);<NEW_LINE>poseStack.pushPose();<NEW_LINE>poseStack.translate(0.5, 0.5, 0.5);<NEW_LINE>FacingToRotation rotation = FacingToRotation.get(chest.getForward(), chest.getUp());<NEW_LINE>rotation.push(poseStack);<NEW_LINE>poseStack.translate(-0.5, -0.5, -0.5);<NEW_LINE>// The models are created for the top-left slot of the drive model,<NEW_LINE>// we need to move them into place for the slot on the ME chest<NEW_LINE>poseStack.translate(5 / 16.0, 4 / 16.0, 0);<NEW_LINE>// Render the cell model as-if it was a block model<NEW_LINE>VertexConsumer buffer = buffers.getBuffer(RenderType.cutout());<NEW_LINE>// We "fake" the position here to make it use the light-value in front of the<NEW_LINE>// drive<NEW_LINE>FaceRotatingModel rotatedModel = new FaceRotatingModel(cellModel, rotation);<NEW_LINE>blockRenderer.tesselateBlock(level, rotatedModel, chest.getBlockState(), chest.getBlockPos(), poseStack, buffer, false, new Random(), 0L, combinedOverlay);<NEW_LINE>VertexConsumer ledBuffer = buffers.getBuffer(CellLedRenderer.RENDER_LAYER);<NEW_LINE>CellLedRenderer.renderLed(chest, 0, ledBuffer, poseStack, partialTicks);<NEW_LINE>poseStack.popPose();<NEW_LINE>} | cellItem = chest.getCellItem(0); |
1,615,249 | static double[][] of(double[] data, double[] breaks) {<NEW_LINE>int k = breaks.length - 1;<NEW_LINE>if (k <= 1) {<NEW_LINE>throw new IllegalArgumentException("Invalid number of bins: " + k);<NEW_LINE>}<NEW_LINE>double[][] freq = new double[3][k];<NEW_LINE>for (int i = 0; i < k; i++) {<NEW_LINE>freq[0][i] = breaks[i];<NEW_LINE>freq[1][i] = breaks[i + 1];<NEW_LINE>freq[2][i] = 0.0f;<NEW_LINE>}<NEW_LINE>for (double d : data) {<NEW_LINE>int j = <MASK><NEW_LINE>if (j >= k) {<NEW_LINE>j = k - 1;<NEW_LINE>}<NEW_LINE>if (j < -1 && j >= -breaks.length) {<NEW_LINE>j = -j - 2;<NEW_LINE>}<NEW_LINE>if (j >= 0) {<NEW_LINE>freq[2][j]++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return freq;<NEW_LINE>} | Arrays.binarySearch(breaks, d); |
440,259 | public Deferred<ArrayList<ArrayList<KeyValue>>> nextRows() {<NEW_LINE>if (region == DONE) {<NEW_LINE>// We're already done scanning.<NEW_LINE>return Deferred.fromResult(null);<NEW_LINE>} else if (region == null) {<NEW_LINE>// We need to open the scanner first.<NEW_LINE>if (this.isReversed() && !this.isFirstReverseRegion()) {<NEW_LINE>return client.openReverseScanner<MASK><NEW_LINE>} else {<NEW_LINE>if (is_reversed && start_key == EMPTY_ARRAY) {<NEW_LINE>start_key = Bytes.createMaxByteArray(Short.MAX_VALUE - table.length - 3);<NEW_LINE>}<NEW_LINE>return client.openScanner(this).addCallbackDeferring(opened_scanner);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (scannerClosedOnServer) {<NEW_LINE>return scanFinished(moreRows);<NEW_LINE>}<NEW_LINE>// Need to silence this warning because the callback `got_next_row'<NEW_LINE>// declares its return type to be Object, because its return value<NEW_LINE>// may or may not be deferred.<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final Deferred<ArrayList<ArrayList<KeyValue>>> d = (Deferred) client.scanNextRows(this).addCallbacks(got_next_row, nextRowErrback());<NEW_LINE>return d;<NEW_LINE>} | (this).addCallbackDeferring(opened_scanner); |
783,564 | private void updateAcceptedTypeOrigins() {<NEW_LINE>Map<PoiCategory, LinkedHashSet<String>> <MASK><NEW_LINE>for (Entry<PoiCategory, LinkedHashSet<String>> e : acceptedTypes.entrySet()) {<NEW_LINE>if (e.getValue() != null) {<NEW_LINE>for (String s : e.getValue()) {<NEW_LINE>PoiType subtype = poiTypes.getPoiTypeByKey(s);<NEW_LINE>if (subtype != null) {<NEW_LINE>PoiCategory c = subtype.getCategory();<NEW_LINE>String typeName = subtype.getKeyName();<NEW_LINE>Set<String> acceptedSubtypes = getAcceptedSubtypes(c);<NEW_LINE>if (acceptedSubtypes != null && !acceptedSubtypes.contains(typeName)) {<NEW_LINE>LinkedHashSet<String> typeNames = acceptedTypesOrigin.get(c);<NEW_LINE>if (typeNames == null) {<NEW_LINE>typeNames = new LinkedHashSet<>();<NEW_LINE>acceptedTypesOrigin.put(c, typeNames);<NEW_LINE>}<NEW_LINE>typeNames.add(typeName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.acceptedTypesOrigin = acceptedTypesOrigin;<NEW_LINE>} | acceptedTypesOrigin = new LinkedHashMap<>(); |
267,528 | public void processOpts() {<NEW_LINE>super.processOpts();<NEW_LINE>if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {<NEW_LINE>setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME));<NEW_LINE>} else {<NEW_LINE>additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName);<NEW_LINE>}<NEW_LINE>if (additionalProperties.containsKey(CodegenConstants.OPEN_API_SPEC_NAME)) {<NEW_LINE>setOpenApiSpecName((String) additionalProperties.get(CodegenConstants.OPEN_API_SPEC_NAME));<NEW_LINE>} else {<NEW_LINE>additionalProperties.put(CodegenConstants.OPEN_API_SPEC_NAME, openApiSpecName);<NEW_LINE>}<NEW_LINE>additionalProperties.put("apiVersion", apiVersion);<NEW_LINE>additionalProperties.put("apiPath", apiPath);<NEW_LINE>supportingFiles.add(new SupportingFile<MASK><NEW_LINE>supportingFiles.add(new SupportingFile("app.src.mustache", "", "src" + File.separator + this.packageName + ".app.src"));<NEW_LINE>supportingFiles.add(new SupportingFile("router.mustache", "", toSourceFilePath("router", "erl")));<NEW_LINE>supportingFiles.add(new SupportingFile("api.mustache", "", toSourceFilePath("api", "erl")));<NEW_LINE>supportingFiles.add(new SupportingFile("server.mustache", "", toSourceFilePath("server", "erl")));<NEW_LINE>supportingFiles.add(new SupportingFile("utils.mustache", "", toSourceFilePath("utils", "erl")));<NEW_LINE>supportingFiles.add(new SupportingFile("auth.mustache", "", toSourceFilePath("auth", "erl")));<NEW_LINE>supportingFiles.add(new SupportingFile("openapi.mustache", "", toPrivFilePath(this.openApiSpecName, "json")));<NEW_LINE>supportingFiles.add(new SupportingFile("default_logic_handler.mustache", "", toSourceFilePath("default_logic_handler", "erl")));<NEW_LINE>supportingFiles.add(new SupportingFile("logic_handler.mustache", "", toSourceFilePath("logic_handler", "erl")));<NEW_LINE>supportingFiles.add(new SupportingFile("README.mustache", "", "README.md").doNotOverwrite());<NEW_LINE>} | ("rebar.config.mustache", "", "rebar.config")); |
60,054 | public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {<NEW_LINE>log.debug("login success");<NEW_LINE>Map<String, Object> rsp = new HashMap<>();<NEW_LINE>User principal = (User) authentication.getPrincipal();<NEW_LINE>AccountEntity accountEntity = accountService.queryByUsername(principal.getUsername());<NEW_LINE>String authorization = response.getHeader(JwtUtils.AUTHORIZATION_HEADER_PREFIX);<NEW_LINE>// Set the global user Id variable<NEW_LINE>Security.setProperty(authorization, accountEntity.getId().toString());<NEW_LINE>rsp.put(JwtUtils.AUTHORIZATION_HEADER_PREFIX, authorization);<NEW_LINE>rsp.put("username", accountEntity.getUsername());<NEW_LINE>// return<NEW_LINE>BaseResponse baseResponse = new BaseResponse(ConstantCode.SUCCESS);<NEW_LINE>try {<NEW_LINE>baseResponse.setData(JsonHelper.object2Json(rsp));<NEW_LINE>baseResponse.setMessage("success");<NEW_LINE>log.debug("login backInfo:{}"<MASK><NEW_LINE>response.getWriter().write(JsonHelper.object2Json(baseResponse));<NEW_LINE>} catch (BrokerException e) {<NEW_LINE>log.error("Code: " + e.getCode() + ", " + e.getMessage());<NEW_LINE>}<NEW_LINE>} | , JsonHelper.object2Json(baseResponse)); |
1,145,585 | public void handleCommand(Command command) {<NEW_LINE>Thing thing = thingProvider.apply(link.getLinkedUID().getThingUID());<NEW_LINE>if (thing != null) {<NEW_LINE>final ThingHandler handler = thing.getHandler();<NEW_LINE>if (handler != null) {<NEW_LINE>if (ThingHandlerHelper.isHandlerInitialized(thing)) {<NEW_LINE>logger.debug("Delegating command '{}' for item '{}' to handler for channel '{}'", command, link.getItemName(<MASK><NEW_LINE>safeCaller.create(handler, ThingHandler.class).withTimeout(CommunicationManager.THINGHANDLER_EVENT_TIMEOUT).onTimeout(() -> {<NEW_LINE>logger.warn("Handler for thing '{}' takes more than {}ms for handling a command", handler.getThing().getUID(), CommunicationManager.THINGHANDLER_EVENT_TIMEOUT);<NEW_LINE>}).build().handleCommand(link.getLinkedUID(), command);<NEW_LINE>} else {<NEW_LINE>logger.debug("Not delegating command '{}' for item '{}' to handler for channel '{}', " + "because handler is not initialized (thing must be in status UNKNOWN, ONLINE or OFFLINE but was {}).", command, link.getItemName(), link.getLinkedUID(), thing.getStatus());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.warn("Cannot delegate command '{}' for item '{}' to handler for channel '{}', " + "because no handler is assigned. Maybe the binding is not installed or not " + "propertly initialized.", command, link.getItemName(), link.getLinkedUID());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.warn("Cannot delegate command '{}' for item '{}' to handler for channel '{}', " + "because no thing with the UID '{}' could be found.", command, link.getItemName(), link.getLinkedUID(), link.getLinkedUID().getThingUID());<NEW_LINE>}<NEW_LINE>} | ), link.getLinkedUID()); |
407,224 | public Stream<CompilerInput> finalize(Path path, PackageID pkgId) {<NEW_LINE>// Set package version if its empty<NEW_LINE>if (pkgId.version.value.isEmpty() && !pkgId.orgName.equals(Names.BUILTIN_ORG) && !pkgId.orgName.equals(Names.ANON_ORG)) {<NEW_LINE>Manifest <MASK><NEW_LINE>pkgId.version = new Name(manifest.getProject().getVersion());<NEW_LINE>}<NEW_LINE>if ((!ProjectDirs.isProject(root) || RepoUtils.isBallerinaStandaloneFile(path)) && Files.isRegularFile(path)) {<NEW_LINE>return Stream.of(new FileSystemSourceInput(path, root.resolve(pkgId.name.value)));<NEW_LINE>} else if (Files.isRegularFile(path)) {<NEW_LINE>return Stream.of(new FileSystemSourceInput(path, root.resolve(ProjectDirConstants.SOURCE_DIR_NAME).resolve(pkgId.name.value)));<NEW_LINE>} else {<NEW_LINE>return Stream.of();<NEW_LINE>}<NEW_LINE>} | manifest = TomlParserUtils.getManifest(root); |
1,339,669 | public static float computeQueryDocumentScoreWithSimilarityAndAnalyzer(IndexReader reader, String docid, String q, Similarity similarity, Analyzer analyzer) throws IOException {<NEW_LINE>// We compute the query-document score by issuing the query with an additional filter clause that restricts<NEW_LINE>// consideration to only the docid in question, and then returning the retrieval score.<NEW_LINE>//<NEW_LINE>// This implementation is inefficient, but as the advantage of using the existing Lucene similarity, which means<NEW_LINE>// that we don't need to copy the scoring function and keep it in sync wrt code updates.<NEW_LINE>IndexSearcher searcher = new IndexSearcher(reader);<NEW_LINE>searcher.setSimilarity(similarity);<NEW_LINE>Query query = new BagOfWordsQueryGenerator().buildQuery(IndexArgs.CONTENTS, analyzer, q);<NEW_LINE>Query filterQuery = new ConstantScoreQuery(new TermQuery(new Term(IndexArgs.ID, docid)));<NEW_LINE>BooleanQuery.Builder builder = new BooleanQuery.Builder();<NEW_LINE>builder.add(<MASK><NEW_LINE>builder.add(query, BooleanClause.Occur.MUST);<NEW_LINE>Query finalQuery = builder.build();<NEW_LINE>TopDocs rs = searcher.search(finalQuery, 1);<NEW_LINE>// We want the score of the first (and only) hit, but remember to remove 1 for the ConstantScoreQuery.<NEW_LINE>// If we get zero results, indicates that term isn't found in the document.<NEW_LINE>return rs.scoreDocs.length == 0 ? 0 : rs.scoreDocs[0].score - 1;<NEW_LINE>} | filterQuery, BooleanClause.Occur.MUST); |
1,488,704 | public static ListGatewaysGisInfoResponse unmarshall(ListGatewaysGisInfoResponse listGatewaysGisInfoResponse, UnmarshallerContext _ctx) {<NEW_LINE>listGatewaysGisInfoResponse.setRequestId(_ctx.stringValue("ListGatewaysGisInfoResponse.RequestId"));<NEW_LINE>listGatewaysGisInfoResponse.setSuccess(_ctx.booleanValue("ListGatewaysGisInfoResponse.Success"));<NEW_LINE>List<GatewayGisInfo> data = new ArrayList<GatewayGisInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListGatewaysGisInfoResponse.Data.Length"); i++) {<NEW_LINE>GatewayGisInfo gatewayGisInfo = new GatewayGisInfo();<NEW_LINE>gatewayGisInfo.setGwEui(_ctx.stringValue<MASK><NEW_LINE>gatewayGisInfo.setGisCoordinateSystem(_ctx.stringValue("ListGatewaysGisInfoResponse.Data[" + i + "].GisCoordinateSystem"));<NEW_LINE>gatewayGisInfo.setLongitude(_ctx.floatValue("ListGatewaysGisInfoResponse.Data[" + i + "].Longitude"));<NEW_LINE>gatewayGisInfo.setLatitude(_ctx.floatValue("ListGatewaysGisInfoResponse.Data[" + i + "].Latitude"));<NEW_LINE>gatewayGisInfo.setFreqBandPlanGroupId(_ctx.longValue("ListGatewaysGisInfoResponse.Data[" + i + "].FreqBandPlanGroupId"));<NEW_LINE>gatewayGisInfo.setName(_ctx.stringValue("ListGatewaysGisInfoResponse.Data[" + i + "].Name"));<NEW_LINE>gatewayGisInfo.setOnlineState(_ctx.stringValue("ListGatewaysGisInfoResponse.Data[" + i + "].OnlineState"));<NEW_LINE>gatewayGisInfo.setGisSourceType(_ctx.stringValue("ListGatewaysGisInfoResponse.Data[" + i + "].GisSourceType"));<NEW_LINE>gatewayGisInfo.setEnabled(_ctx.booleanValue("ListGatewaysGisInfoResponse.Data[" + i + "].Enabled"));<NEW_LINE>gatewayGisInfo.setChargeStatus(_ctx.stringValue("ListGatewaysGisInfoResponse.Data[" + i + "].ChargeStatus"));<NEW_LINE>gatewayGisInfo.setAuthTypes(_ctx.stringValue("ListGatewaysGisInfoResponse.Data[" + i + "].AuthTypes"));<NEW_LINE>data.add(gatewayGisInfo);<NEW_LINE>}<NEW_LINE>listGatewaysGisInfoResponse.setData(data);<NEW_LINE>return listGatewaysGisInfoResponse;<NEW_LINE>} | ("ListGatewaysGisInfoResponse.Data[" + i + "].GwEui")); |
350,160 | public void verify(final String host, final X509Certificate cert) throws SSLException {<NEW_LINE>final HostNameType hostType = determineHostFormat(host);<NEW_LINE>final List<SubjectName> subjectAlts = getSubjectAltNames(cert);<NEW_LINE>if (subjectAlts != null && !subjectAlts.isEmpty()) {<NEW_LINE>switch(hostType) {<NEW_LINE>case IPv4:<NEW_LINE>matchIPAddress(host, subjectAlts);<NEW_LINE>break;<NEW_LINE>case IPv6:<NEW_LINE>matchIPv6Address(host, subjectAlts);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>matchDNSName(<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// CN matching has been deprecated by rfc2818 and can be used<NEW_LINE>// as fallback only when no subjectAlts are available<NEW_LINE>final X500Principal subjectPrincipal = cert.getSubjectX500Principal();<NEW_LINE>final String cn = extractCN(subjectPrincipal.getName(X500Principal.RFC2253));<NEW_LINE>if (cn == null) {<NEW_LINE>throw new SSLException("Certificate subject for <" + host + "> doesn't contain " + "a common name and does not have alternative names");<NEW_LINE>}<NEW_LINE>matchCN(host, cn, this.publicSuffixMatcher);<NEW_LINE>}<NEW_LINE>} | host, subjectAlts, this.publicSuffixMatcher); |
17,795 | public static ListRootStacksResponse unmarshall(ListRootStacksResponse listRootStacksResponse, UnmarshallerContext _ctx) {<NEW_LINE>listRootStacksResponse.setRequestId(_ctx.stringValue("ListRootStacksResponse.RequestId"));<NEW_LINE>listRootStacksResponse.setMessage(_ctx.stringValue("ListRootStacksResponse.Message"));<NEW_LINE>listRootStacksResponse.setCode(_ctx.integerValue("ListRootStacksResponse.Code"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setCurrentPage(_ctx.integerValue("ListRootStacksResponse.Data.CurrentPage"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListRootStacksResponse.Data.PageSize"));<NEW_LINE>data.setTotalSize(_ctx.integerValue("ListRootStacksResponse.Data.TotalSize"));<NEW_LINE>List<RootStack> result = new ArrayList<RootStack>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListRootStacksResponse.Data.Result.Length"); i++) {<NEW_LINE>RootStack rootStack = new RootStack();<NEW_LINE>Root root = new Root();<NEW_LINE>root.setId(_ctx.longValue("ListRootStacksResponse.Data.Result[" + i + "].Root.Id"));<NEW_LINE>root.setName(_ctx.stringValue("ListRootStacksResponse.Data.Result[" + i + "].Root.Name"));<NEW_LINE>rootStack.setRoot(root);<NEW_LINE>List<ChildStack> children = new ArrayList<ChildStack>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListRootStacksResponse.Data.Result[" + i + "].Children.Length"); j++) {<NEW_LINE>ChildStack childStack = new ChildStack();<NEW_LINE>childStack.setId(_ctx.longValue("ListRootStacksResponse.Data.Result[" + i + "].Children[" + j + "].Id"));<NEW_LINE>childStack.setName(_ctx.stringValue("ListRootStacksResponse.Data.Result[" + i + "].Children[" + j + "].Name"));<NEW_LINE>childStack.setIcon(_ctx.stringValue("ListRootStacksResponse.Data.Result[" + i + "].Children[" + j + "].Icon"));<NEW_LINE>childStack.setComment(_ctx.stringValue("ListRootStacksResponse.Data.Result[" + i <MASK><NEW_LINE>children.add(childStack);<NEW_LINE>}<NEW_LINE>rootStack.setChildren(children);<NEW_LINE>result.add(rootStack);<NEW_LINE>}<NEW_LINE>data.setResult(result);<NEW_LINE>listRootStacksResponse.setData(data);<NEW_LINE>return listRootStacksResponse;<NEW_LINE>} | + "].Children[" + j + "].Comment")); |
227,350 | private Map<String, String> parseEnvironment(final String[] entries) {<NEW_LINE>final Map<String, String> map = new HashMap<>();<NEW_LINE>if (entries.length > 1) {<NEW_LINE>// Skip the last entry it contains the cron expression no variables.<NEW_LINE>for (int i = 0; i < entries.length - 1; i++) {<NEW_LINE>final String entry = entries[i];<NEW_LINE>if (entry.startsWith("#") || entry.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final int n = entry.indexOf('=');<NEW_LINE>if (n >= 0) {<NEW_LINE>final String key = entry.substring(0, n).trim();<NEW_LINE>final String value = entry.substring(n + 1).trim();<NEW_LINE>map.put(key, value);<NEW_LINE>} else {<NEW_LINE>map.put(entry.trim(), <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>} else {<NEW_LINE>return Collections.emptyMap();<NEW_LINE>}<NEW_LINE>} | Boolean.TRUE.toString()); |
1,385,563 | public static void addListenerToSipXml(Document sipXmlDocument, String listenerClassName, String desc) {<NEW_LINE>if (listenerClassName == null)<NEW_LINE>return;<NEW_LINE>Element listenerE = sipXmlDocument.createElement("listener");<NEW_LINE>Element listenerClassNameE = sipXmlDocument.createElement("javaee:listener-class");<NEW_LINE>Element descE = sipXmlDocument.createElement("javaee:description");<NEW_LINE>if (desc != null && !desc.equals("")) {<NEW_LINE>descE.appendChild<MASK><NEW_LINE>listenerE.appendChild(sipXmlDocument.createTextNode("\n "));<NEW_LINE>listenerE.appendChild(sipXmlDocument.createTextNode("\t\t "));<NEW_LINE>listenerE.appendChild(descE);<NEW_LINE>}<NEW_LINE>listenerE.appendChild(sipXmlDocument.createTextNode("\n "));<NEW_LINE>listenerE.appendChild(sipXmlDocument.createTextNode("\t\t "));<NEW_LINE>listenerClassNameE.setTextContent(listenerClassName);<NEW_LINE>listenerE.appendChild(listenerClassNameE);<NEW_LINE>listenerE.appendChild(sipXmlDocument.createTextNode("\n "));<NEW_LINE>Node sipAppE = sipXmlDocument.getElementsByTagName("sip-app").item(0);<NEW_LINE>Node pivotNode = getNodeToInsertBefore(sipAppE, listenerE);<NEW_LINE>sipAppE.insertBefore(sipXmlDocument.createTextNode("\n\n "), pivotNode);<NEW_LINE>sipAppE.insertBefore(listenerE, pivotNode);<NEW_LINE>sipAppE.insertBefore(sipXmlDocument.createTextNode("\n\n "), pivotNode);<NEW_LINE>} | (sipXmlDocument.createTextNode(desc)); |
1,158,490 | public static DescribeManagedInstancesResponse unmarshall(DescribeManagedInstancesResponse describeManagedInstancesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeManagedInstancesResponse.setRequestId(_ctx.stringValue("DescribeManagedInstancesResponse.RequestId"));<NEW_LINE>describeManagedInstancesResponse.setPageSize(_ctx.longValue("DescribeManagedInstancesResponse.PageSize"));<NEW_LINE>describeManagedInstancesResponse.setPageNumber(_ctx.longValue("DescribeManagedInstancesResponse.PageNumber"));<NEW_LINE>describeManagedInstancesResponse.setTotalCount(_ctx.longValue("DescribeManagedInstancesResponse.TotalCount"));<NEW_LINE>List<Instance> instances = new ArrayList<Instance>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeManagedInstancesResponse.Instances.Length"); i++) {<NEW_LINE>Instance instance = new Instance();<NEW_LINE>instance.setLastInvokedTime(_ctx.stringValue("DescribeManagedInstancesResponse.Instances[" + i + "].LastInvokedTime"));<NEW_LINE>instance.setConnected(_ctx.booleanValue("DescribeManagedInstancesResponse.Instances[" + i + "].Connected"));<NEW_LINE>instance.setInternetIp(_ctx.stringValue("DescribeManagedInstancesResponse.Instances[" + i + "].InternetIp"));<NEW_LINE>instance.setHostname(_ctx.stringValue("DescribeManagedInstancesResponse.Instances[" + i + "].Hostname"));<NEW_LINE>instance.setInstanceId(_ctx.stringValue("DescribeManagedInstancesResponse.Instances[" + i + "].InstanceId"));<NEW_LINE>instance.setActivationId(_ctx.stringValue("DescribeManagedInstancesResponse.Instances[" + i + "].ActivationId"));<NEW_LINE>instance.setIntranetIp(_ctx.stringValue("DescribeManagedInstancesResponse.Instances[" + i + "].IntranetIp"));<NEW_LINE>instance.setAgentVersion(_ctx.stringValue<MASK><NEW_LINE>instance.setRegistrationTime(_ctx.stringValue("DescribeManagedInstancesResponse.Instances[" + i + "].RegistrationTime"));<NEW_LINE>instance.setInstanceName(_ctx.stringValue("DescribeManagedInstancesResponse.Instances[" + i + "].InstanceName"));<NEW_LINE>instance.setOsType(_ctx.stringValue("DescribeManagedInstancesResponse.Instances[" + i + "].OsType"));<NEW_LINE>instance.setOsVersion(_ctx.stringValue("DescribeManagedInstancesResponse.Instances[" + i + "].OsVersion"));<NEW_LINE>instance.setInvocationCount(_ctx.longValue("DescribeManagedInstancesResponse.Instances[" + i + "].InvocationCount"));<NEW_LINE>instance.setMachineId(_ctx.stringValue("DescribeManagedInstancesResponse.Instances[" + i + "].MachineId"));<NEW_LINE>instances.add(instance);<NEW_LINE>}<NEW_LINE>describeManagedInstancesResponse.setInstances(instances);<NEW_LINE>return describeManagedInstancesResponse;<NEW_LINE>} | ("DescribeManagedInstancesResponse.Instances[" + i + "].AgentVersion")); |
264,078 | public static Object callScript(String scriptName) throws ScriptExecutionException {<NEW_LINE>ModelRepository repo = ScriptServiceUtil.getModelRepository();<NEW_LINE>if (repo != null) {<NEW_LINE>String scriptNameWithExt = scriptName;<NEW_LINE>if (!scriptName.endsWith(Script.SCRIPT_FILEEXT)) {<NEW_LINE>scriptNameWithExt <MASK><NEW_LINE>}<NEW_LINE>XExpression expr = (XExpression) repo.getModel(scriptNameWithExt);<NEW_LINE>if (expr != null) {<NEW_LINE>ScriptEngine scriptEngine = ScriptServiceUtil.getScriptEngine();<NEW_LINE>if (scriptEngine != null) {<NEW_LINE>Script script = scriptEngine.newScriptFromXExpression(expr);<NEW_LINE>return script.execute();<NEW_LINE>} else {<NEW_LINE>throw new ScriptExecutionException("Script engine is not available.");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new ScriptExecutionException("Script '" + scriptName + "' cannot be found.");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new ScriptExecutionException("Model repository is not available.");<NEW_LINE>}<NEW_LINE>} | = scriptName + "." + Script.SCRIPT_FILEEXT; |
485,592 | public static DescribeAppResponse unmarshall(DescribeAppResponse describeAppResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeAppResponse.setRequestId(_ctx.stringValue("DescribeAppResponse.requestId"));<NEW_LINE>Result result = new Result();<NEW_LINE>result.setId(_ctx.stringValue("DescribeAppResponse.result.id"));<NEW_LINE>result.setDescription(_ctx.stringValue("DescribeAppResponse.result.description"));<NEW_LINE>result.setStatus(_ctx.stringValue("DescribeAppResponse.result.status"));<NEW_LINE>result.setType(_ctx.stringValue("DescribeAppResponse.result.type"));<NEW_LINE>result.setClusterName(_ctx.stringValue("DescribeAppResponse.result.clusterName"));<NEW_LINE>result.setAlgoDeploymentId(_ctx.integerValue("DescribeAppResponse.result.algoDeploymentId"));<NEW_LINE>result.setCreated(_ctx.integerValue("DescribeAppResponse.result.created"));<NEW_LINE>result.setAutoSwitch(_ctx.booleanValue("DescribeAppResponse.result.autoSwitch"));<NEW_LINE>result.setProgressPercent<MASK><NEW_LINE>result.setSchema(_ctx.mapValue("DescribeAppResponse.result.schema"));<NEW_LINE>List<String> fetchFields = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeAppResponse.result.fetchFields.Length"); i++) {<NEW_LINE>fetchFields.add(_ctx.stringValue("DescribeAppResponse.result.fetchFields[" + i + "]"));<NEW_LINE>}<NEW_LINE>result.setFetchFields(fetchFields);<NEW_LINE>Quota quota = new Quota();<NEW_LINE>quota.setDocSize(_ctx.integerValue("DescribeAppResponse.result.quota.docSize"));<NEW_LINE>quota.setComputeResource(_ctx.integerValue("DescribeAppResponse.result.quota.computeResource"));<NEW_LINE>quota.setQps(_ctx.integerValue("DescribeAppResponse.result.quota.qps"));<NEW_LINE>quota.setSpec(_ctx.stringValue("DescribeAppResponse.result.quota.spec"));<NEW_LINE>result.setQuota(quota);<NEW_LINE>Domain domain = new Domain();<NEW_LINE>domain.setName(_ctx.stringValue("DescribeAppResponse.result.domain.name"));<NEW_LINE>domain.setCategory(_ctx.stringValue("DescribeAppResponse.result.domain.category"));<NEW_LINE>Functions functions = new Functions();<NEW_LINE>List<String> qp = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeAppResponse.result.domain.functions.qp.Length"); i++) {<NEW_LINE>qp.add(_ctx.stringValue("DescribeAppResponse.result.domain.functions.qp[" + i + "]"));<NEW_LINE>}<NEW_LINE>functions.setQp(qp);<NEW_LINE>List<String> algo = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeAppResponse.result.domain.functions.algo.Length"); i++) {<NEW_LINE>algo.add(_ctx.stringValue("DescribeAppResponse.result.domain.functions.algo[" + i + "]"));<NEW_LINE>}<NEW_LINE>functions.setAlgo(algo);<NEW_LINE>List<String> service = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeAppResponse.result.domain.functions.service.Length"); i++) {<NEW_LINE>service.add(_ctx.stringValue("DescribeAppResponse.result.domain.functions.service[" + i + "]"));<NEW_LINE>}<NEW_LINE>functions.setService(service);<NEW_LINE>domain.setFunctions(functions);<NEW_LINE>result.setDomain(domain);<NEW_LINE>describeAppResponse.setResult(result);<NEW_LINE>return describeAppResponse;<NEW_LINE>} | (_ctx.integerValue("DescribeAppResponse.result.progressPercent")); |
88,856 | public OResultSet syncPull(OCommandContext ctx, int nRecords) throws OTimeoutException {<NEW_LINE>getPrev().ifPresent(x -> x.syncPull(ctx, nRecords));<NEW_LINE>long begin = profilingEnabled ? System.nanoTime() : 0;<NEW_LINE>try {<NEW_LINE>if (found) {<NEW_LINE>return new OInternalResultSet();<NEW_LINE>}<NEW_LINE>if (this.targetClass.equals(this.parentClass)) {<NEW_LINE>return new OInternalResultSet();<NEW_LINE>}<NEW_LINE>ODatabase db = ctx.getDatabase();<NEW_LINE>OSchema schema = db.getMetadata().getSchema();<NEW_LINE>OClass parentClazz = <MASK><NEW_LINE>if (parentClazz == null) {<NEW_LINE>throw new OCommandExecutionException("Class not found: " + this.parentClass);<NEW_LINE>}<NEW_LINE>OClass targetClazz = schema.getClass(this.targetClass);<NEW_LINE>if (targetClazz == null) {<NEW_LINE>throw new OCommandExecutionException("Class not found: " + this.targetClass);<NEW_LINE>}<NEW_LINE>if (parentClazz.equals(targetClazz)) {<NEW_LINE>found = true;<NEW_LINE>} else {<NEW_LINE>for (OClass sublcass : parentClazz.getAllSubclasses()) {<NEW_LINE>if (sublcass.equals(targetClazz)) {<NEW_LINE>this.found = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!found) {<NEW_LINE>throw new OCommandExecutionException("Class " + this.targetClass + " is not a subclass of " + this.parentClass);<NEW_LINE>}<NEW_LINE>return new OInternalResultSet();<NEW_LINE>} finally {<NEW_LINE>if (profilingEnabled) {<NEW_LINE>cost += (System.nanoTime() - begin);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | schema.getClass(this.parentClass); |
1,372,374 | public void buildPlacementUI(Table table) {<NEW_LINE>table.image().color(Pal.gray).height(4f).<MASK><NEW_LINE>table.row();<NEW_LINE>table.left().margin(0f).defaults().size(48f).left();<NEW_LINE>table.button(Icon.paste, Styles.clearPartiali, () -> {<NEW_LINE>ui.schematics.show();<NEW_LINE>}).tooltip("@schematics");<NEW_LINE>table.button(Icon.book, Styles.clearPartiali, () -> {<NEW_LINE>ui.database.show();<NEW_LINE>}).tooltip("@database");<NEW_LINE>table.button(Icon.tree, Styles.clearPartiali, () -> {<NEW_LINE>ui.research.show();<NEW_LINE>}).visible(() -> state.isCampaign()).tooltip("@research");<NEW_LINE>table.button(Icon.map, Styles.clearPartiali, () -> {<NEW_LINE>ui.planet.show();<NEW_LINE>}).visible(() -> state.isCampaign()).tooltip("@planetmap");<NEW_LINE>} | colspan(4).growX(); |
1,048,519 | public synchronized void drop(DropTargetDropEvent e) {<NEW_LINE>tabbedPane.setBorder(plainBorder);<NEW_LINE>tabbedPane.setBackground(plainBackground);<NEW_LINE>try {<NEW_LINE>e.acceptDrop(DnDConstants.ACTION_COPY);<NEW_LINE>addCertificates(e.getTransferable().getTransferData(DataFlavor.javaFileListFlavor), getSelectedList(), true);<NEW_LINE>return;<NEW_LINE>} catch (IOException | UnsupportedFlavorException ignore) {<NEW_LINE>}<NEW_LINE>e.acceptDrop(DnDConstants.ACTION_MOVE);<NEW_LINE>Component targetComponent = e<MASK><NEW_LINE>if (targetComponent instanceof JTabbedPane) {<NEW_LINE>JTabbedPane tabbedPane = (JTabbedPane) targetComponent;<NEW_LINE>CertificateDisplay selectedCert = getSelectedCertificate();<NEW_LINE>int targetIndex = tabbedPane.indexAtLocation(e.getLocation().x, e.getLocation().y);<NEW_LINE>ContainerList<CertificateDisplay> target = getListByIndex(targetIndex);<NEW_LINE>ContainerList<CertificateDisplay> source = getSelectedList();<NEW_LINE>if (source != target) {<NEW_LINE>addCertificate(selectedCert, target, false);<NEW_LINE>removeCertificate(selectedCert, source);<NEW_LINE>clearSelection();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getDropTargetContext().getComponent(); |
1,465,141 | public static void markFieldsAsImmutable(BLangClassDefinition classDef, SymbolEnv pkgEnv, BObjectType objectType, Types types, BLangAnonymousModelHelper anonymousModelHelper, SymbolTable symbolTable, Names names, Location pos) {<NEW_LINE>SymbolEnv typeDefEnv = SymbolEnv.createClassEnv(classDef, objectType.tsymbol.scope, pkgEnv);<NEW_LINE>Iterator<BField> objectTypeFieldIterator = objectType.fields.values().iterator();<NEW_LINE>Map<String, BLangSimpleVariable> classFields = new HashMap<>();<NEW_LINE>for (BLangSimpleVariable field : classDef.fields) {<NEW_LINE>classFields.put(field.name.value, field);<NEW_LINE>}<NEW_LINE>for (BLangSimpleVariable field : classDef.referencedFields) {<NEW_LINE>classFields.put(field.name.value, field);<NEW_LINE>}<NEW_LINE>while (objectTypeFieldIterator.hasNext()) {<NEW_LINE><MASK><NEW_LINE>BLangSimpleVariable classField = classFields.get(typeField.name.value);<NEW_LINE>BType type = typeField.type;<NEW_LINE>if (!types.isInherentlyImmutableType(type)) {<NEW_LINE>BType immutableFieldType = typeField.symbol.type = ImmutableTypeCloner.getImmutableIntersectionType(pos, types, type, typeDefEnv, symbolTable, anonymousModelHelper, names, classDef.flagSet);<NEW_LINE>classField.setBType(typeField.type = immutableFieldType);<NEW_LINE>}<NEW_LINE>typeField.symbol.flags |= Flags.FINAL;<NEW_LINE>classField.flagSet.add(Flag.FINAL);<NEW_LINE>}<NEW_LINE>} | BField typeField = objectTypeFieldIterator.next(); |
1,691,530 | final DescribeStackSetResult executeDescribeStackSet(DescribeStackSetRequest describeStackSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeStackSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DescribeStackSetRequest> request = null;<NEW_LINE>Response<DescribeStackSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeStackSetRequestMarshaller().marshall(super.beforeMarshalling(describeStackSetRequest));<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, "CloudFormation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeStackSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeStackSetResult> responseHandler = new StaxResponseHandler<DescribeStackSetResult>(new DescribeStackSetResultStaxUnmarshaller());<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.startEvent(Field.ClientExecuteTime); |
511,818 | private static void tryAssertionSix(RegressionEnvironment env, String expression) {<NEW_LINE>env.compileDeploy(expression).addListener("s0");<NEW_LINE>String[] fields = "valh0,valh1,valh2".split(",");<NEW_LINE>sendBeanInt(env, "S00", 1, 1, 1);<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, new Object[][] { { "H01", "H11", "H01-H21" } });<NEW_LINE>sendBeanInt(env, "S01", 0, 1, 1);<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, null);<NEW_LINE>sendBeanInt(env, "S02", 1, 1, 0);<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, null);<NEW_LINE>sendBeanInt(env, "S03", 1, 1, 2);<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, new Object[][] { { "H01", "H11", "H01-H21" }, { "H01", "H11", "H01-H22" } });<NEW_LINE>sendBeanInt(env, "S04", 2, 2, 1);<NEW_LINE>Object[][] result = new Object[][] { { "H01", "H11", "H01-H21" }, { "H02", "H11", "H02-H21" }, { "H01", "H12", "H01-H21" }, <MASK><NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("s0", fields, result);<NEW_LINE>env.undeployModuleContaining("s0");<NEW_LINE>} | { "H02", "H12", "H02-H21" } }; |
1,177,181 | public DownloadTokenGenerateResponse generateDownloadUrlForZipArchive(ZipDownloadRequest body, String xSdsAuthToken) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling generateDownloadUrlForZipArchive");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/nodes/zip";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (xSdsAuthToken != null)<NEW_LINE>localVarHeaderParams.put("X-Sds-Auth-Token", apiClient.parameterToString(xSdsAuthToken));<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String <MASK><NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<DownloadTokenGenerateResponse> localVarReturnType = new GenericType<DownloadTokenGenerateResponse>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>} | localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
820,765 | private boolean findUsageInFile(@Nonnull FileEditor editor, @Nonnull FileSearchScope direction) {<NEW_LINE>ApplicationManager<MASK><NEW_LINE>if (myLastSearchInFileData == null)<NEW_LINE>return false;<NEW_LINE>PsiElement[] primaryElements = myLastSearchInFileData.getPrimaryElements();<NEW_LINE>PsiElement[] secondaryElements = myLastSearchInFileData.getSecondaryElements();<NEW_LINE>if (primaryElements.length == 0) {<NEW_LINE>// all elements have been invalidated<NEW_LINE>Messages.showMessageDialog(myProject, FindBundle.message("find.searched.elements.have.been.changed.error"), FindBundle.message("cannot.search.for.usages.title"), Messages.getInformationIcon());<NEW_LINE>// SCR #10022<NEW_LINE>// clearFindingNextUsageInFile();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// todo<NEW_LINE>TextEditor textEditor = (TextEditor) editor;<NEW_LINE>Document document = textEditor.getEditor().getDocument();<NEW_LINE>PsiFile psiFile = PsiDocumentManager.getInstance(myProject).getPsiFile(document);<NEW_LINE>if (psiFile == null)<NEW_LINE>return false;<NEW_LINE>final FindUsagesHandler handler = getFindUsagesHandler(primaryElements[0], false);<NEW_LINE>if (handler == null)<NEW_LINE>return false;<NEW_LINE>findUsagesInEditor(primaryElements, secondaryElements, handler, psiFile, direction, myLastSearchInFileData.myOptions, textEditor);<NEW_LINE>return true;<NEW_LINE>} | .getApplication().assertIsDispatchThread(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.