idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
700,223 | private void validateIfRevisionMatchesTheCurrentConfigAndUpdateTheMaterialMap(FanInGraphContext context, Pair<StageIdentifier, List<FaninScmMaterial>> stageIdentifierScmPair) {<NEW_LINE>final Set<MaterialConfig> currentScmMaterials = context.pipelineScmDepMap.get(materialConfig);<NEW_LINE>final Set<FaninScmMaterial> scmMaterials = new HashSet<>(stageIdentifierScmPair.last());<NEW_LINE>final Set<String> currentScmFingerprint = new HashSet<>();<NEW_LINE>for (MaterialConfig currentScmMaterial : currentScmMaterials) {<NEW_LINE>currentScmFingerprint.add(currentScmMaterial.getFingerprint());<NEW_LINE>}<NEW_LINE>final Set<String> <MASK><NEW_LINE>for (FaninScmMaterial scmMaterial : scmMaterials) {<NEW_LINE>scmMaterialsFingerprint.add(scmMaterial.fingerprint);<NEW_LINE>}<NEW_LINE>final Collection commonMaterials = CollectionUtils.intersection(currentScmFingerprint, scmMaterialsFingerprint);<NEW_LINE>if (commonMaterials.size() == scmMaterials.size() && commonMaterials.size() == currentScmMaterials.size()) {<NEW_LINE>stageIdentifierScmMaterial.put(stageIdentifierScmPair.first(), scmMaterials);<NEW_LINE>++currentCount;<NEW_LINE>} else {<NEW_LINE>Collection disjunctionWithConfig = CollectionUtils.disjunction(currentScmFingerprint, commonMaterials);<NEW_LINE>Collection disjunctionWithInstance = CollectionUtils.disjunction(scmMaterialsFingerprint, commonMaterials);<NEW_LINE>LOGGER.warn("[Fan-in] - Incompatible materials for {}. Config: {}. Instance: {}.", stageIdentifierScmPair.first().getStageLocator(), disjunctionWithConfig, disjunctionWithInstance);<NEW_LINE>// This is it. We will not go beyond this revision in history<NEW_LINE>totalInstanceCount = currentCount;<NEW_LINE>}<NEW_LINE>} | scmMaterialsFingerprint = new HashSet<>(); |
899,899 | final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));<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, "Keyspaces");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<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.OPERATION_NAME, "UntagResource"); |
1,265,047 | private UserNotificationRequest createNotification(final RequestSalesRepChanged event, final UserId recipientId) {<NEW_LINE>final UserNotificationsConfig <MASK><NEW_LINE>return //<NEW_LINE>UserNotificationRequest.builder().notificationsConfig(notificationsConfig).topic(TOPIC_Requests).// RequestActionTransfer - Request {} was transfered by {} from {} to {}<NEW_LINE>subjectADMessage(MSG_RequestActionTransfer).subjectADMessageParam(event.getRequestDocumentNo()).subjectADMessageParam(getUserFullname(event.getChangedById())).subjectADMessageParam(getUserFullname(event.getFromSalesRepId())).subjectADMessageParam(//<NEW_LINE>getUserFullname(event.getToSalesRepId())).contentADMessage(MSG_RequestActionTransfer).contentADMessageParam(event.getRequestDocumentNo()).contentADMessageParam(getUserFullname(event.getChangedById())).contentADMessageParam(getUserFullname(event.getFromSalesRepId())).contentADMessageParam(//<NEW_LINE>getUserFullname(event.getToSalesRepId())).targetAction(TargetRecordAction.of(I_R_Request.Table_Name, event.getRequestId().getRepoId())).build();<NEW_LINE>} | notificationsConfig = notificationsService.getUserNotificationsConfig(recipientId); |
1,332,678 | private void startServer(Size resolution, int port) {<NEW_LINE>if (rtspServerCamera1 == null) {<NEW_LINE>Timber.d("Resolution %dx%d", resolution.getWidth(), resolution.getHeight());<NEW_LINE>String viewType = this.view.getClass().getName();<NEW_LINE>if (viewType.contains("AutoFitTextureView")) {<NEW_LINE>rtspServerCamera1 = new RtspServerCamera1((<MASK><NEW_LINE>}<NEW_LINE>if (viewType.contains("AutoFitSurfaceView")) {<NEW_LINE>rtspServerCamera1 = new RtspServerCamera1((SurfaceView) view, this, port);<NEW_LINE>}<NEW_LINE>if (viewType.contains("AutoFitSurfaceGlView")) {<NEW_LINE>rtspServerCamera1 = new RtspServerCamera1((OpenGlView) view, this, port);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!rtspServerCamera1.isStreaming()) {<NEW_LINE>if (rtspServerCamera1.prepareAudio(64 * 1024, 32000, false, true, true) && rtspServerCamera1.prepareVideo(resolution.getWidth(), resolution.getHeight(), 20, 1200 * 1024, 2, 0)) {<NEW_LINE>rtspServerCamera1.startStream("");<NEW_LINE>// Delay starting the client for a second to make sure the server is started.<NEW_LINE>Runnable action = () -> startClient();<NEW_LINE>new DelayedRunner().runAfter(action, 1000L, TimeUnit.MILLISECONDS);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | AutoFitTextureView) view, this, port); |
206,059 | public List<I_M_InOutLine> sortLines(final I_M_InOut inOut) {<NEW_LINE>final HashMap<Integer, Integer> inoutLineId2orderId = new HashMap<>();<NEW_LINE>final List<I_M_InOutLine> lines = inOutDAO.retrieveLines(inOut);<NEW_LINE>for (int i = 0; i < lines.size(); i++) {<NEW_LINE>final I_M_InOutLine <MASK><NEW_LINE>final int currentOrderID = iol.getC_OrderLine_ID() > 0 ? iol.getC_OrderLine().getC_Order_ID() : 0;<NEW_LINE>final int currentLineID = iol.getM_InOutLine_ID();<NEW_LINE>// if this is not a comment line, then store its C_Order_ID in the map<NEW_LINE>if (currentOrderID != 0) {<NEW_LINE>inoutLineId2orderId.put(currentLineID, currentOrderID);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int valueIdToUse = -1;<NEW_LINE>// If this is a comment line, then iterate further, to find the next not-comment line<NEW_LINE>for (int j = 1; i + j < lines.size(); j++) {<NEW_LINE>final I_M_InOutLine nextLine = lines.get(i + j);<NEW_LINE>final int nextID = nextLine.getC_OrderLine_ID() > 0 ? nextLine.getC_OrderLine().getC_Order_ID() : 0;<NEW_LINE>if (// If this is a valid ID, put it into the Map.<NEW_LINE>nextID != 0) {<NEW_LINE>valueIdToUse = nextID;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>inoutLineId2orderId.put(currentLineID, valueIdToUse);<NEW_LINE>}<NEW_LINE>Check.assume(inoutLineId2orderId.size() == lines.size(), "Every line's id has been added to map '" + inoutLineId2orderId + "'");<NEW_LINE>final ComparatorChain<I_M_InOutLine> mainComparator = new ComparatorChain<>();<NEW_LINE>//<NEW_LINE>// DocLine Sort Preference criteria goes first<NEW_LINE>// final Comparator<I_M_InOutLine> docLineSortComparator = getDocLineSortComparator(inOut);<NEW_LINE>// mainComparator.addComparator(docLineSortComparator); // commented out: this is only called in one place; if needed, see history / I_C_DocLine_Sort<NEW_LINE>//<NEW_LINE>// Sort by order lines<NEW_LINE>final Comparator<I_M_InOutLine> orderLineComparator = getOrderLineComparator(inoutLineId2orderId);<NEW_LINE>mainComparator.addComparator(orderLineComparator);<NEW_LINE>lines.sort(mainComparator);<NEW_LINE>return lines;<NEW_LINE>} | iol = lines.get(i); |
915,197 | public synchronized IBinder bind(Intent intent) {<NEW_LINE>// ComponentName doesn't match, abort<NEW_LINE>if (!mName.equals(intent.getComponent()))<NEW_LINE>System.exit(1);<NEW_LINE>if (intent.getBooleanExtra(INTENT_DEBUG_KEY, false)) {<NEW_LINE>// ActivityThread.attach(true, 0) will set this to system_process<NEW_LINE>HiddenAPIs.setAppName(service.getPackageName() + ":root");<NEW_LINE>// For some reason Debug.waitForDebugger() won't work, manual spin lock...<NEW_LINE>while (!Debug.isDebuggerConnected()) {<NEW_LINE>SystemClock.sleep(200);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Bundle bundle = intent.getBundleExtra(INTENT_EXTRA_KEY);<NEW_LINE><MASK><NEW_LINE>mClient.linkToDeath(this, 0);<NEW_LINE>Container<IBinder> c = new Container<>();<NEW_LINE>UiThreadHandler.runAndWait(() -> {<NEW_LINE>if (mIntent != null) {<NEW_LINE>Log.d(TAG, mName + " rebind");<NEW_LINE>service.onRebind(intent);<NEW_LINE>} else {<NEW_LINE>Log.d(TAG, mName + " bind");<NEW_LINE>mIntent = intent.cloneFilter();<NEW_LINE>}<NEW_LINE>c.obj = service.onBind(intent);<NEW_LINE>});<NEW_LINE>return c.obj;<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.e(TAG, null, e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | mClient = bundle.getBinder(BUNDLE_BINDER_KEY); |
213,570 | // Update frame dimensions and report any changes to |rendererEvents|.<NEW_LINE>private void updateFrameDimensionsAndReportEvents(VideoFrame frame) {<NEW_LINE>synchronized (layoutLock) {<NEW_LINE>if (isRenderingPaused) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!isFirstFrameRendered) {<NEW_LINE>isFirstFrameRendered = true;<NEW_LINE>if (rendererEvents != null) {<NEW_LINE>rendererEvents.onFirstFrameRendered();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (rotatedFrameWidth != frame.getRotatedWidth() || rotatedFrameHeight != frame.getRotatedHeight() || frameRotation != frame.getRotation()) {<NEW_LINE>if (rendererEvents != null) {<NEW_LINE>rendererEvents.onFrameResolutionChanged(frame.getBuffer().getWidth(), frame.getBuffer().getHeight(<MASK><NEW_LINE>}<NEW_LINE>rotatedFrameWidth = frame.getRotatedWidth();<NEW_LINE>rotatedFrameHeight = frame.getRotatedHeight();<NEW_LINE>texture.setDefaultBufferSize(rotatedFrameWidth, rotatedFrameHeight);<NEW_LINE>frameRotation = frame.getRotation();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), frame.getRotation()); |
725,349 | public Request<AssociateAddressRequest> marshall(AssociateAddressRequest associateAddressRequest) {<NEW_LINE>if (associateAddressRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<AssociateAddressRequest> request = new DefaultRequest<AssociateAddressRequest>(associateAddressRequest, "AmazonEC2");<NEW_LINE>request.addParameter("Action", "AssociateAddress");<NEW_LINE>request.addParameter("Version", "2016-11-15");<NEW_LINE><MASK><NEW_LINE>if (associateAddressRequest.getAllocationId() != null) {<NEW_LINE>request.addParameter("AllocationId", StringUtils.fromString(associateAddressRequest.getAllocationId()));<NEW_LINE>}<NEW_LINE>if (associateAddressRequest.getInstanceId() != null) {<NEW_LINE>request.addParameter("InstanceId", StringUtils.fromString(associateAddressRequest.getInstanceId()));<NEW_LINE>}<NEW_LINE>if (associateAddressRequest.getPublicIp() != null) {<NEW_LINE>request.addParameter("PublicIp", StringUtils.fromString(associateAddressRequest.getPublicIp()));<NEW_LINE>}<NEW_LINE>if (associateAddressRequest.getAllowReassociation() != null) {<NEW_LINE>request.addParameter("AllowReassociation", StringUtils.fromBoolean(associateAddressRequest.getAllowReassociation()));<NEW_LINE>}<NEW_LINE>if (associateAddressRequest.getNetworkInterfaceId() != null) {<NEW_LINE>request.addParameter("NetworkInterfaceId", StringUtils.fromString(associateAddressRequest.getNetworkInterfaceId()));<NEW_LINE>}<NEW_LINE>if (associateAddressRequest.getPrivateIpAddress() != null) {<NEW_LINE>request.addParameter("PrivateIpAddress", StringUtils.fromString(associateAddressRequest.getPrivateIpAddress()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | request.setHttpMethod(HttpMethodName.POST); |
488,112 | private Statement findService(Model model) {<NEW_LINE>// Try to find by unique pServiceName (max backwards compatibility)<NEW_LINE>// then try to find by rdf:type fuseki:Service.<NEW_LINE>// JENA-1794<NEW_LINE>Statement stmt = getOne(model, null, pServiceName, null);<NEW_LINE>// null means 0 or many, not one.<NEW_LINE>if (stmt == null) {<NEW_LINE>// This calculates { ?x rdf:type fu:Service ; ?x fu:name ?name }<NEW_LINE>// One and only one service.<NEW_LINE>Statement stmt2 = getOne(model, null, RDF.type, FusekiVocab.fusekiService);<NEW_LINE>if (stmt2 == null) {<NEW_LINE>int count = model.listStatements(null, RDF.type, FusekiVocab.fusekiService).toList().size();<NEW_LINE>if (count == 0)<NEW_LINE>ServletOps.errorBadRequest("No triple rdf:type fuseki:Service found");<NEW_LINE>else<NEW_LINE>ServletOps.errorBadRequest("Multiple Fuseki service descriptions");<NEW_LINE>}<NEW_LINE>Statement stmt3 = getOne(model, stmt2.getSubject(), pServiceName, null);<NEW_LINE>if (stmt3 == null) {<NEW_LINE>StmtIterator sIter = model.listStatements(stmt2.getSubject()<MASK><NEW_LINE>if (!sIter.hasNext())<NEW_LINE>ServletOps.errorBadRequest("No name given in description of Fuseki service");<NEW_LINE>sIter.next();<NEW_LINE>if (sIter.hasNext())<NEW_LINE>ServletOps.errorBadRequest("Multiple names given in description of Fuseki service");<NEW_LINE>throw new InternalErrorException("Inconsistent: getOne didn't fail the second time");<NEW_LINE>}<NEW_LINE>stmt = stmt3;<NEW_LINE>}<NEW_LINE>if (!stmt.getObject().isLiteral())<NEW_LINE>ServletOps.errorBadRequest("Found " + FmtUtils.stringForRDFNode(stmt.getObject()) + " : Service names are strings, then used to build the external URI");<NEW_LINE>return stmt;<NEW_LINE>} | , pServiceName, (RDFNode) null); |
299,074 | protected void countSortFromTo(int from, int to, int min, int max) {<NEW_LINE>if (size == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>checkRangeFromTo(from, to, size);<NEW_LINE>int width = (max - min + 1);<NEW_LINE>int[] counts = new int[width];<NEW_LINE>int[] theElements = elements;<NEW_LINE>for (int i = from; i <= to; ) {<NEW_LINE>counts[(theElements[i++] - min)]++;<NEW_LINE>}<NEW_LINE>int fromIndex = from;<NEW_LINE>int val = min;<NEW_LINE>for (int i = 0; i < width; i++, val++) {<NEW_LINE>int c = counts[i];<NEW_LINE>if (c > 0) {<NEW_LINE>if (c == 1) {<NEW_LINE>theElements[fromIndex++] = val;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>fillFromToWith(fromIndex, toIndex, val);<NEW_LINE>fromIndex = toIndex + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int toIndex = fromIndex + c - 1; |
1,533,138 | private String findTheName(JsObject configObject) {<NEW_LINE>String name = null;<NEW_LINE>FileObject fo = configObject.getFileObject();<NEW_LINE>Source <MASK><NEW_LINE>TokenHierarchy<?> th = source.createSnapshot().getTokenHierarchy();<NEW_LINE>if (th == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>TokenSequence<? extends JsTokenId> ts = LexUtilities.getJsTokenSequence(th, configObject.getOffset());<NEW_LINE>Token<? extends JsTokenId> token;<NEW_LINE>if (ts == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ts.move(configObject.getOffset());<NEW_LINE>if (!ts.moveNext()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>token = LexUtilities.findPreviousToken(ts, Arrays.asList(JsTokenId.IDENTIFIER));<NEW_LINE>while (!(token.id() == JsTokenId.IDENTIFIER && CLASS.equals(token.text().toString())) && ts.movePrevious()) {<NEW_LINE>token = ts.token();<NEW_LINE>}<NEW_LINE>if (token.id() == JsTokenId.IDENTIFIER && CLASS.equals(token.text().toString()) && ts.movePrevious()) {<NEW_LINE>// we are at ^Class.create(...)<NEW_LINE>// now we need to find = and the identifier after =<NEW_LINE>List<JsTokenId> skipTokens = Arrays.asList(JsTokenId.WHITESPACE, JsTokenId.EOL, JsTokenId.BLOCK_COMMENT, JsTokenId.LINE_COMMENT);<NEW_LINE>token = LexUtilities.findPrevious(ts, skipTokens);<NEW_LINE>if (token.id() == JsTokenId.OPERATOR_ASSIGNMENT && ts.movePrevious()) {<NEW_LINE>token = LexUtilities.findPrevious(ts, skipTokens);<NEW_LINE>if (token.id() == JsTokenId.IDENTIFIER) {<NEW_LINE>name = token.text().toString();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return name;<NEW_LINE>} | source = Source.create(fo); |
747,334 | private View findTarget(View root, float x, float y) {<NEW_LINE>// we consider the "best target" to be the view width the smallest width / height<NEW_LINE>// whose location on screen is within the given touch area.<NEW_LINE>View bestTarget = root;<NEW_LINE>if (root instanceof ViewGroup) {<NEW_LINE>ViewGroup parent = (ViewGroup) root;<NEW_LINE>int count = parent.getChildCount();<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>View child = parent.getChildAt(i);<NEW_LINE><MASK><NEW_LINE>if (child.getVisibility() != VISIBLE) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (x >= outRect.left && x <= outRect.right && y >= outRect.top && y <= outRect.bottom) {<NEW_LINE>final View target = findTarget(child, x, y);<NEW_LINE>if (target.getWidth() <= bestTarget.getWidth() && target.getHeight() <= bestTarget.getHeight()) {<NEW_LINE>bestTarget = target;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return bestTarget;<NEW_LINE>} | measurementHelper.getContentRootLocation(child, outRect); |
312,792 | public void apply(ImmutableImage image) {<NEW_LINE>Graphics2D g2 = (Graphics2D) image<MASK><NEW_LINE>setupGraphics(g2);<NEW_LINE>FontMetrics fontMetrics = g2.getFontMetrics();<NEW_LINE>Rectangle2D bounds = fontMetrics.getStringBounds(text, g2);<NEW_LINE>g2.translate(image.width / 2.0, image.height / 2.0);<NEW_LINE>AffineTransform rotation = new AffineTransform();<NEW_LINE>double opad = image.height / (double) image.width;<NEW_LINE>double angle = Math.toDegrees(Math.atan(opad));<NEW_LINE>double idegrees = -1 * angle;<NEW_LINE>double theta = (2 * Math.PI * idegrees) / 360;<NEW_LINE>rotation.rotate(theta);<NEW_LINE>g2.transform(rotation);<NEW_LINE>double x1 = bounds.getWidth() / 2.0f * -1;<NEW_LINE>double y1 = bounds.getHeight() / 2.0f;<NEW_LINE>g2.translate(x1, y1);<NEW_LINE>g2.drawString(text, 0.0f, 0.0f);<NEW_LINE>g2.dispose();<NEW_LINE>} | .awt().getGraphics(); |
719,675 | public void postInvoke(Request request, Response response) throws IOException, ServletException {<NEW_LINE>HttpRequest hrequest = (HttpRequest) request;<NEW_LINE>HttpResponse hresponse = (HttpResponse) response;<NEW_LINE>HttpServletRequest hreq = (HttpServletRequest) hrequest.getRequest();<NEW_LINE>HttpServletResponse hres = (HttpServletResponse) hresponse.getResponse();<NEW_LINE>// Log post-service information<NEW_LINE>log("---------------------------------------------------------------");<NEW_LINE>log(" authType=" + hreq.getAuthType());<NEW_LINE>log(" contentLength=" + hresponse.getContentLength());<NEW_LINE>log(<MASK><NEW_LINE>Cookie[] rcookies = hreq.getCookies();<NEW_LINE>for (Cookie rcookie : rcookies) {<NEW_LINE>log(" cookie=" + rcookie.getName() + "=" + rcookie.getValue() + "; domain=" + rcookie.getDomain() + "; path=" + rcookie.getPath());<NEW_LINE>}<NEW_LINE>for (String rhname : hres.getHeaderNames()) {<NEW_LINE>for (String rhvalue : hres.getHeaders(rhname)) {<NEW_LINE>log(" header=" + rhname + "=" + rhvalue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log(" message=" + hresponse.getMessage());<NEW_LINE>log(" remoteUser=" + hreq.getRemoteUser());<NEW_LINE>log(" status=" + hres.getStatus());<NEW_LINE>log("===============================================================");<NEW_LINE>} | " contentType=" + hresponse.getContentType()); |
595,757 | private void updatePorts(Instance instance) {<NEW_LINE>Object dir = instance.getAttributeValue(StdAttr.FACING);<NEW_LINE>final var select = instance.getAttributeValue(PlexersLibrary.ATTR_SELECT);<NEW_LINE>var n = 1 << select.getWidth();<NEW_LINE>final var ps = new Port[n + 4];<NEW_LINE>if (dir == Direction.NORTH || dir == Direction.SOUTH) {<NEW_LINE>int x = -5 * n + 10;<NEW_LINE>int y = dir == <MASK><NEW_LINE>for (var i = 0; i < n; i++) {<NEW_LINE>ps[i] = new Port(x + 10 * i, y, Port.INPUT, 1);<NEW_LINE>}<NEW_LINE>ps[n + OUT] = new Port(0, 0, Port.OUTPUT, select.getWidth());<NEW_LINE>ps[n + EN_IN] = new Port(x + 10 * n, y / 2, Port.INPUT, 1);<NEW_LINE>ps[n + EN_OUT] = new Port(x - 10, y / 2, Port.OUTPUT, 1);<NEW_LINE>ps[n + GS] = new Port(10, 0, Port.OUTPUT, 1);<NEW_LINE>} else {<NEW_LINE>int x = dir == Direction.EAST ? -40 : 40;<NEW_LINE>int y = -5 * n + 10;<NEW_LINE>for (var i = 0; i < n; i++) {<NEW_LINE>ps[i] = new Port(x, y + 10 * i, Port.INPUT, 1);<NEW_LINE>}<NEW_LINE>ps[n + OUT] = new Port(0, 0, Port.OUTPUT, select.getWidth());<NEW_LINE>ps[n + EN_IN] = new Port(x / 2, y + 10 * n, Port.INPUT, 1);<NEW_LINE>ps[n + EN_OUT] = new Port(x / 2, y - 10, Port.OUTPUT, 1);<NEW_LINE>ps[n + GS] = new Port(0, 10, Port.OUTPUT, 1);<NEW_LINE>}<NEW_LINE>for (var i = 0; i < n; i++) {<NEW_LINE>ps[i].setToolTip(S.getter("priorityEncoderInTip", "" + i));<NEW_LINE>}<NEW_LINE>ps[n + OUT].setToolTip(S.getter("priorityEncoderOutTip"));<NEW_LINE>ps[n + EN_IN].setToolTip(S.getter("priorityEncoderEnableInTip"));<NEW_LINE>ps[n + EN_OUT].setToolTip(S.getter("priorityEncoderEnableOutTip"));<NEW_LINE>ps[n + GS].setToolTip(S.getter("priorityEncoderGroupSignalTip"));<NEW_LINE>instance.setPorts(ps);<NEW_LINE>} | Direction.NORTH ? 40 : -40; |
233,118 | public FieldVariable save(final FieldVariable var, final User user) throws DotDataException, DotSecurityException {<NEW_LINE>ContentTypeAPI contentTypeAPI = APILocator.getContentTypeAPI(user);<NEW_LINE>Field field = fieldFactory.byId(var.fieldId());<NEW_LINE>ContentType type = contentTypeAPI.find(field.contentTypeId());<NEW_LINE>APILocator.getPermissionAPI().checkPermission(type, PermissionLevel.EDIT_PERMISSIONS, user);<NEW_LINE>FieldVariable newFieldVariable = fieldFactory.save(ImmutableFieldVariable.builder().from(var).userId(user.getUserId()).build());<NEW_LINE>// update Content Type mod_date to detect the changes done on the field variables<NEW_LINE>contentTypeAPI.updateModDate(type);<NEW_LINE>// Validates custom mapping format<NEW_LINE>if (var.key().equals(FieldVariable.ES_CUSTOM_MAPPING_KEY)) {<NEW_LINE>try {<NEW_LINE>new <MASK><NEW_LINE>} catch (JSONException e) {<NEW_LINE>handleInvalidCustomMappingError(var, user, field, type, e);<NEW_LINE>}<NEW_LINE>// Verifies the field is marked as System Indexed. In case it isn't, the field will be updated with this flag on<NEW_LINE>if (!field.indexed()) {<NEW_LINE>save(FieldBuilder.builder(field).indexed(true).build(), user);<NEW_LINE>Logger.info(this, "Field " + type.variable() + "." + field.variable() + " has been marked as System Indexed as it has defined a field variable with key " + FieldVariable.ES_CUSTOM_MAPPING_KEY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newFieldVariable;<NEW_LINE>} | JSONObject(var.value()); |
1,437,905 | boolean mmapFile(final boolean create) {<NEW_LINE>if (this.buffer != null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>final File file = new File(this.path);<NEW_LINE>if (file.exists()) {<NEW_LINE>this.size = (int) file.length();<NEW_LINE>} else {<NEW_LINE>if (!create) {<NEW_LINE>LOG.error("File {} is not exists.", this.path);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try (FileChannel fc = openFileChannel(create)) {<NEW_LINE>this.buffer = fc.map(MapMode.READ_WRITE, 0, this.size);<NEW_LINE>this.<MASK><NEW_LINE>if (!loadHeader()) {<NEW_LINE>LOG.error("Fail to load segment header from file {}.", this.path);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} catch (final IOException e) {<NEW_LINE>LOG.error("Fail to mmap segment file {}.", this.path, e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | buffer.limit(this.size); |
140,227 | private void updateFunctionNode(JsMessage message, Node functionNode) throws MalformedException {<NEW_LINE>checkNode(functionNode, Token.FUNCTION);<NEW_LINE>Node nameNode = functionNode.getFirstChild();<NEW_LINE>checkNode(nameNode, Token.NAME);<NEW_LINE><MASK><NEW_LINE>checkNode(argListNode, Token.PARAM_LIST);<NEW_LINE>Node oldBlockNode = argListNode.getNext();<NEW_LINE>checkNode(oldBlockNode, Token.BLOCK);<NEW_LINE>Node valueNode = constructAddOrStringNode(message.getParts(), argListNode);<NEW_LINE>Node newBlockNode = IR.block(astFactory.createReturn(valueNode));<NEW_LINE>if (!newBlockNode.isEquivalentTo(oldBlockNode, /* compareType= */<NEW_LINE>false, /* recurse= */<NEW_LINE>true, /* jsDoc= */<NEW_LINE>false, /* sideEffect= */<NEW_LINE>false)) {<NEW_LINE>newBlockNode.srcrefTreeIfMissing(oldBlockNode);<NEW_LINE>oldBlockNode.replaceWith(newBlockNode);<NEW_LINE>compiler.reportChangeToEnclosingScope(newBlockNode);<NEW_LINE>}<NEW_LINE>} | Node argListNode = nameNode.getNext(); |
1,804,639 | public void init(IStreamDataExporterSite site) throws DBException {<NEW_LINE>super.init(site);<NEW_LINE>Map<String, Object> properties = site.getProperties();<NEW_LINE>this.delimiter = StreamTransferUtils.getDelimiterString(properties, PROP_DELIMITER);<NEW_LINE>this.rowDelimiter = StreamTransferUtils.getDelimiterString(properties, PROP_ROW_DELIMITER);<NEW_LINE>if (ROW_DELIMITER_DEFAULT.equalsIgnoreCase(this.rowDelimiter.trim())) {<NEW_LINE>this.rowDelimiter = GeneralUtils.getDefaultLineSeparator();<NEW_LINE>}<NEW_LINE>Object quoteProp = properties.get(PROP_QUOTE_CHAR);<NEW_LINE>String quoteStr = quoteProp == null ? DEF_QUOTE_CHAR : quoteProp.toString();<NEW_LINE>if (!CommonUtils.isEmpty(quoteStr)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (CommonUtils.toBoolean(properties.get(PROP_QUOTE_NEVER))) {<NEW_LINE>quoteChar = ' ';<NEW_LINE>}<NEW_LINE>Object nullStringProp = properties.get(PROP_NULL_STRING);<NEW_LINE>nullString = nullStringProp == null ? null : nullStringProp.toString();<NEW_LINE>useQuotes = quoteChar != ' ';<NEW_LINE>quoteStrategy = QuoteStrategy.fromValue(CommonUtils.toString(properties.get(PROP_QUOTE_ALWAYS)));<NEW_LINE>headerPosition = CommonUtils.valueOf(HeaderPosition.class, String.valueOf(properties.get(PROP_HEADER)), HeaderPosition.top);<NEW_LINE>headerFormat = CommonUtils.valueOf(HeaderFormat.class, String.valueOf(properties.get(PROP_HEADER_FORMAT)), HeaderFormat.label);<NEW_LINE>formatNumbers = CommonUtils.toBoolean(getSite().getProperties().get(PROP_FORMAT_NUMBERS));<NEW_LINE>} | quoteChar = quoteStr.charAt(0); |
70,676 | static CommandResult createReply(Packet packet, DebuggerController controller) {<NEW_LINE>PacketStream input = new PacketStream(packet);<NEW_LINE>PacketStream reply = new PacketStream().replyPacket().id(packet.id);<NEW_LINE>long threadId = input.readLong();<NEW_LINE>Object thread = verifyThread(threadId, reply, controller.getContext(), true);<NEW_LINE>if (thread == null) {<NEW_LINE>return new CommandResult(reply);<NEW_LINE>}<NEW_LINE>SuspendedInfo suspendedInfo = controller.getSuspendedInfo(thread);<NEW_LINE>if (suspendedInfo == null) {<NEW_LINE><MASK><NEW_LINE>return new CommandResult(reply);<NEW_LINE>}<NEW_LINE>if (suspendedInfo instanceof UnknownSuspendedInfo) {<NEW_LINE>suspendedInfo = awaitSuspendedInfo(controller, thread, suspendedInfo);<NEW_LINE>}<NEW_LINE>int length = suspendedInfo.getStackFrames().length;<NEW_LINE>reply.writeInt(suspendedInfo.getStackFrames().length);<NEW_LINE>LOGGER.fine(() -> "current frame count: " + length + " for thread: " + controller.getContext().getThreadName(thread));<NEW_LINE>return new CommandResult(reply);<NEW_LINE>} | reply.errorCode(ErrorCodes.THREAD_NOT_SUSPENDED); |
107,879 | public void init(IBatchConfig batchConfig) throws BatchContainerServiceException {<NEW_LINE>LOGGER.entering(CLASSNAME, "init", batchConfig);<NEW_LINE>schema = batchConfig.getDatabaseConfigurationBean().getSchema();<NEW_LINE>jndiName = batchConfig<MASK><NEW_LINE>prefix = batchConfig.getConfigProperties().getProperty(PAYARA_TABLE_PREFIX_PROPERTY, "");<NEW_LINE>suffix = batchConfig.getConfigProperties().getProperty(PAYARA_TABLE_SUFFIX_PROPERTY, "");<NEW_LINE>if (null == jndiName || jndiName.isEmpty()) {<NEW_LINE>throw new BatchContainerServiceException("JNDI name is not defined.");<NEW_LINE>}<NEW_LINE>Context ctx;<NEW_LINE>try {<NEW_LINE>ctx = new InitialContext();<NEW_LINE>dataSource = (DataSource) ctx.lookup(jndiName);<NEW_LINE>} catch (NamingException e) {<NEW_LINE>LOGGER.log(Level.SEVERE, "Lookup failed for JNDI name: {0}. " + "One cause of this could be that the batch runtime " + "is incorrectly configured to EE mode when it " + "should be in SE mode.", jndiName);<NEW_LINE>throw new BatchContainerServiceException(e);<NEW_LINE>}<NEW_LINE>// Load the table names and queries shared between different database types<NEW_LINE>tableNames = getSharedTableMap();<NEW_LINE>schemaTableNames = getSharedSchemaTableMap();<NEW_LINE>try {<NEW_LINE>queryStrings = getSQLServerSharedQueryMap(batchConfig);<NEW_LINE>} catch (SQLException e1) {<NEW_LINE>throw new BatchContainerServiceException(e1);<NEW_LINE>}<NEW_LINE>LOGGER.log(Level.CONFIG, "JNDI name = {0}", jndiName);<NEW_LINE>try {<NEW_LINE>if (!isSchemaValid()) {<NEW_LINE>setDefaultSchema();<NEW_LINE>}<NEW_LINE>checkSQLServerTables();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>LOGGER.severe(e.getLocalizedMessage());<NEW_LINE>throw new BatchContainerServiceException(e);<NEW_LINE>}<NEW_LINE>LOGGER.exiting(CLASSNAME, "init");<NEW_LINE>} | .getDatabaseConfigurationBean().getJndiName(); |
40,156 | public PropertiesPanel createPanel(ApplicationSupport.CurrentApplication dataSource) {<NEW_LINE>PropertiesPanel panel = new PropertiesPanel();<NEW_LINE>panel.setLayout(new BorderLayout());<NEW_LINE>JTextArea textArea = new JTextArea(// NOI18N<NEW_LINE>NbBundle.// NOI18N<NEW_LINE>getMessage(// NOI18N<NEW_LINE>GeneralPropertiesProvider.class, "MSG_ConnectionProperties")) {<NEW_LINE><NEW_LINE>public Dimension getMinimumSize() {<NEW_LINE>Dimension prefSize = getPreferredSize();<NEW_LINE>Dimension minSize = super.getMinimumSize();<NEW_LINE>prefSize.width = 0;<NEW_LINE>if (minSize.height < prefSize.height)<NEW_LINE>return prefSize;<NEW_LINE>else<NEW_LINE>return minSize;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>textArea.setBorder(BorderFactory.createEmptyBorder());<NEW_LINE>textArea.setOpaque(false);<NEW_LINE>// Nimbus LaF doesn't respect setOpaque(false), this is a workaround.<NEW_LINE>// May cause delays for remote X sessions due to color transparency.<NEW_LINE>if (// NOI18N<NEW_LINE>UIManager.getLookAndFeel().getID().equals("Nimbus"))<NEW_LINE>textArea.setBackground(new Color(0, 0, 0, 0));<NEW_LINE>textArea.setEditable(false);<NEW_LINE>textArea.setLineWrap(true);<NEW_LINE>textArea.setWrapStyleWord(true);<NEW_LINE>textArea.setCaretPosition(0);<NEW_LINE>textArea.setMinimumSize(<MASK><NEW_LINE>panel.add(textArea, BorderLayout.CENTER);<NEW_LINE>return panel;<NEW_LINE>} | new Dimension(1, 1)); |
1,683,657 | public static QueryPhoneNoAByTrackNoResponse unmarshall(QueryPhoneNoAByTrackNoResponse queryPhoneNoAByTrackNoResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryPhoneNoAByTrackNoResponse.setRequestId(_ctx.stringValue("QueryPhoneNoAByTrackNoResponse.RequestId"));<NEW_LINE>queryPhoneNoAByTrackNoResponse.setCode(_ctx.stringValue("QueryPhoneNoAByTrackNoResponse.Code"));<NEW_LINE>queryPhoneNoAByTrackNoResponse.setMessage(_ctx.stringValue("QueryPhoneNoAByTrackNoResponse.Message"));<NEW_LINE>List<PhoneNoAInfo> module = new ArrayList<PhoneNoAInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryPhoneNoAByTrackNoResponse.Module.Length"); i++) {<NEW_LINE>PhoneNoAInfo phoneNoAInfo = new PhoneNoAInfo();<NEW_LINE>phoneNoAInfo.setExtension(_ctx.stringValue("QueryPhoneNoAByTrackNoResponse.Module[" + i + "].Extension"));<NEW_LINE>phoneNoAInfo.setPhoneNoX(_ctx.stringValue("QueryPhoneNoAByTrackNoResponse.Module[" + i + "].PhoneNoX"));<NEW_LINE>phoneNoAInfo.setPhoneNoA(_ctx.stringValue<MASK><NEW_LINE>module.add(phoneNoAInfo);<NEW_LINE>}<NEW_LINE>queryPhoneNoAByTrackNoResponse.setModule(module);<NEW_LINE>return queryPhoneNoAByTrackNoResponse;<NEW_LINE>} | ("QueryPhoneNoAByTrackNoResponse.Module[" + i + "].PhoneNoA")); |
1,320,621 | public Request<ListVocabularyFiltersRequest> marshall(ListVocabularyFiltersRequest listVocabularyFiltersRequest) {<NEW_LINE>if (listVocabularyFiltersRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(ListVocabularyFiltersRequest)");<NEW_LINE>}<NEW_LINE>Request<ListVocabularyFiltersRequest> request = new DefaultRequest<ListVocabularyFiltersRequest>(listVocabularyFiltersRequest, "AmazonTranscribe");<NEW_LINE>String target = "Transcribe.ListVocabularyFilters";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (listVocabularyFiltersRequest.getNextToken() != null) {<NEW_LINE>String nextToken = listVocabularyFiltersRequest.getNextToken();<NEW_LINE>jsonWriter.name("NextToken");<NEW_LINE>jsonWriter.value(nextToken);<NEW_LINE>}<NEW_LINE>if (listVocabularyFiltersRequest.getMaxResults() != null) {<NEW_LINE>Integer maxResults = listVocabularyFiltersRequest.getMaxResults();<NEW_LINE>jsonWriter.name("MaxResults");<NEW_LINE>jsonWriter.value(maxResults);<NEW_LINE>}<NEW_LINE>if (listVocabularyFiltersRequest.getNameContains() != null) {<NEW_LINE>String nameContains = listVocabularyFiltersRequest.getNameContains();<NEW_LINE>jsonWriter.name("NameContains");<NEW_LINE>jsonWriter.value(nameContains);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.<MASK><NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | setContent(new StringInputStream(snippet)); |
612,268 | public static Vector readCertificateAuthoritiesExtension(byte[] extensionData) throws IOException {<NEW_LINE>if (extensionData == null) {<NEW_LINE>throw new IllegalArgumentException("'extensionData' cannot be null");<NEW_LINE>}<NEW_LINE>if (extensionData.length < 5) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>ByteArrayInputStream buf = new ByteArrayInputStream(extensionData);<NEW_LINE>int length = TlsUtils.readUint16(buf);<NEW_LINE>if (length != (extensionData.length - 2)) {<NEW_LINE>throw new TlsFatalAlert(AlertDescription.decode_error);<NEW_LINE>}<NEW_LINE>Vector authorities = new Vector();<NEW_LINE>while (buf.available() > 0) {<NEW_LINE>byte[] derEncoding = TlsUtils.readOpaque16(buf, 1);<NEW_LINE>ASN1Primitive asn1 = TlsUtils.readASN1Object(derEncoding);<NEW_LINE>X500Name ca = X500Name.getInstance(asn1);<NEW_LINE>TlsUtils.requireDEREncoding(ca, derEncoding);<NEW_LINE>authorities.addElement(ca);<NEW_LINE>}<NEW_LINE>return authorities;<NEW_LINE>} | throw new TlsFatalAlert(AlertDescription.decode_error); |
873,347 | public static void main(String[] args) throws IOException {<NEW_LINE>// TODO Use args for all parameters<NEW_LINE>// Load map.<NEW_LINE>MapDataStore mapData = new MapFile(DEFAULT_MAP_PATH);<NEW_LINE>// Assign tile.<NEW_LINE>final int ty = MercatorProjection.latitudeToTileY(LAT, ZOOM);<NEW_LINE>final int tx = MercatorProjection.longitudeToTileX(LNG, ZOOM);<NEW_LINE>Tile tile = new Tile(tx, ty, ZOOM, 256);<NEW_LINE>// Create requirements.<NEW_LINE>GraphicFactory gf = AwtGraphicFactory.INSTANCE;<NEW_LINE>XmlRenderTheme theme = InternalRenderTheme.OSMARENDER;<NEW_LINE>DisplayModel dm = new FixedTileSizeDisplayModel(256);<NEW_LINE>RenderThemeFuture rtf = new RenderThemeFuture(gf, theme, dm);<NEW_LINE>RendererJob theJob = new RendererJob(tile, mapData, rtf, dm, 1.0f, false, false);<NEW_LINE>File cacheDir = new File(HOME, SAVE_PATH);<NEW_LINE>FileSystemTileCache tileCache = new FileSystemTileCache(10, cacheDir, gf, false);<NEW_LINE>TileBasedLabelStore tileBasedLabelStore = new TileBasedLabelStore(tileCache.getCapacityFirstLevel());<NEW_LINE>// Create renderer.<NEW_LINE>DatabaseRenderer renderer = new DatabaseRenderer(mapData, gf, tileCache, tileBasedLabelStore, true, true, null);<NEW_LINE>// Create RendererTheme.<NEW_LINE>Thread t = new Thread(rtf);<NEW_LINE>t.start();<NEW_LINE>// Draw tile and save as PNG.<NEW_LINE>TileBitmap tb = renderer.executeJob(theJob);<NEW_LINE>tileCache.put(theJob, tb);<NEW_LINE>// Close map.<NEW_LINE>mapData.close();<NEW_LINE>System.out.printf("Tile has been saved at %s/%d/%d/%d.tile.\n", cacheDir.getPath(<MASK><NEW_LINE>} | ), ZOOM, tx, ty); |
1,140,933 | Command<K, V, String> migrate(String host, int port, int db, long timeout, MigrateArgs<K> migrateArgs) {<NEW_LINE>LettuceAssert.notNull(host, "Host " + MUST_NOT_BE_NULL);<NEW_LINE>LettuceAssert.<MASK><NEW_LINE>LettuceAssert.notNull(migrateArgs, "migrateArgs " + MUST_NOT_BE_NULL);<NEW_LINE>CommandArgs<K, V> args = new CommandArgs<>(codec);<NEW_LINE>args.add(host).add(port);<NEW_LINE>if (migrateArgs.keys.size() == 1) {<NEW_LINE>args.addKey(migrateArgs.keys.get(0));<NEW_LINE>} else {<NEW_LINE>args.add("");<NEW_LINE>}<NEW_LINE>args.add(db).add(timeout);<NEW_LINE>migrateArgs.build(args);<NEW_LINE>return createCommand(MIGRATE, new StatusOutput<>(codec), args);<NEW_LINE>} | notEmpty(host, "Host " + MUST_NOT_BE_EMPTY); |
1,428,815 | private boolean tryParseTimeZoneNumericUTCOffset() {<NEW_LINE>Matcher matcher = createMatch(patternTimeZoneNumericUTCOffset, rest, true);<NEW_LINE>if (matcher.matches()) {<NEW_LINE>offsetSign = group(rest, matcher, 1);<NEW_LINE>offsetHour = group(rest, matcher, 2);<NEW_LINE>offsetMinute = group(rest, matcher, 4);<NEW_LINE>offsetSecond = group(rest, matcher, 5);<NEW_LINE>offsetFraction = group(rest, matcher, 6);<NEW_LINE>timeZoneNumericUTCOffset = Strings.substring(context, rest, matcher.start(1), matcher.end(3) != -1 ? matcher.end(3) : Strings.length(rest));<NEW_LINE>if (offsetHour == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// differentiate between "-08" and "-08:00" here!<NEW_LINE>move(offsetMinute != null ? matcher.end(3) <MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | : matcher.end(2)); |
1,150,162 | public static void buildEqCondition(List<String> columnNames, RelDataType leftRowType, RelDataType rightRowType, int rightOffset, Map<String, Integer> leftColumnRefMap, Map<String, Integer> rightColumnRefMap, RexBuilder rexBuilder, RexNode[] condition, SqlOperator op) {<NEW_LINE>if (GeneralUtil.isEmpty(columnNames)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>columnNames.forEach(cn -> {<NEW_LINE>final Integer indexPk = leftColumnRefMap.get(cn);<NEW_LINE>final Integer primaryPk = rightColumnRefMap.get(cn);<NEW_LINE>final RelDataTypeField leftType = leftRowType.getFieldList().get(indexPk);<NEW_LINE>final RelDataTypeField rightType = rightRowType.<MASK><NEW_LINE>final RexNode pkEq = rexBuilder.makeCall(op, rexBuilder.makeInputRef(leftType.getType(), indexPk), rexBuilder.makeInputRef(rightType.getType(), rightOffset + primaryPk));<NEW_LINE>if (condition[0] == null) {<NEW_LINE>condition[0] = pkEq;<NEW_LINE>} else {<NEW_LINE>condition[0] = rexBuilder.makeCall(SqlStdOperatorTable.AND, condition[0], pkEq);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | getFieldList().get(primaryPk); |
1,161,079 | private IndexSearchDescriptor buildIndexSearchDescriptorForFulltext(OCommandContext ctx, OIndex index, OAndBlock block, OClass clazz) {<NEW_LINE>List<String> indexFields = index.getDefinition().getFields();<NEW_LINE>OBinaryCondition keyCondition = new OBinaryCondition(-1);<NEW_LINE>OIdentifier key = new OIdentifier("key");<NEW_LINE>keyCondition.setLeft(new OExpression(key));<NEW_LINE>boolean found = false;<NEW_LINE>OAndBlock blockCopy = block.copy();<NEW_LINE>Iterator<OBooleanExpression> blockIterator;<NEW_LINE>OAndBlock indexKeyValue = new OAndBlock(-1);<NEW_LINE>IndexSearchDescriptor result = new IndexSearchDescriptor();<NEW_LINE>result.idx = index;<NEW_LINE>result.keyCondition = indexKeyValue;<NEW_LINE>for (String indexField : indexFields) {<NEW_LINE>blockIterator = blockCopy.getSubBlocks().iterator();<NEW_LINE>boolean breakHere = false;<NEW_LINE>boolean indexFieldFound = false;<NEW_LINE>while (blockIterator.hasNext()) {<NEW_LINE>OBooleanExpression singleExp = blockIterator.next();<NEW_LINE>if (singleExp instanceof OContainsTextCondition) {<NEW_LINE>OExpression left = ((OContainsTextCondition) singleExp).getLeft();<NEW_LINE>if (left.isBaseIdentifier()) {<NEW_LINE>String fieldName = left.getDefaultAlias().getStringValue();<NEW_LINE>if (indexField.equals(fieldName)) {<NEW_LINE>found = true;<NEW_LINE>indexFieldFound = true;<NEW_LINE>OContainsTextCondition condition = new OContainsTextCondition(-1);<NEW_LINE>condition.setLeft(left);<NEW_LINE>condition.setRight(((OContainsTextCondition) singleExp).getRight().copy());<NEW_LINE>indexKeyValue.<MASK><NEW_LINE>blockIterator.remove();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (breakHere || !indexFieldFound) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result.keyCondition.getSubBlocks().size() < index.getDefinition().getFields().size() && !index.supportsOrderedIterations()) {<NEW_LINE>// hash indexes do not support partial key match<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (found) {<NEW_LINE>result.remainingCondition = blockCopy;<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | getSubBlocks().add(condition); |
314,828 | final DeleteLoadBalancerResult executeDeleteLoadBalancer(DeleteLoadBalancerRequest deleteLoadBalancerRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteLoadBalancerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteLoadBalancerRequest> request = null;<NEW_LINE>Response<DeleteLoadBalancerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteLoadBalancerRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteLoadBalancerRequest));<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, "Lightsail");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteLoadBalancer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteLoadBalancerResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>} | false), new DeleteLoadBalancerResultJsonUnmarshaller()); |
1,754,816 | // @Override<NEW_LINE>@Deprecated<NEW_LINE>protected void channelRead0(ChannelHandlerContext ctx, Packet packet) {<NEW_LINE>// super.channelRead0(ctx, packet);<NEW_LINE>try {<NEW_LINE>INetHandler netHandler = ctx.channel().attr(<MASK><NEW_LINE>EntityPlayer player = CoreProxy.proxy.getPlayerFromNetHandler(netHandler);<NEW_LINE>// packet.getID();<NEW_LINE>int packetID = 0;<NEW_LINE>switch(packetID) {<NEW_LINE>case PacketIds.PIPE_POWER:<NEW_LINE>// MOVED!<NEW_LINE>// onPacketPower(player, (PacketPowerUpdate) packet);<NEW_LINE>break;<NEW_LINE>case PacketIds.PIPE_LIQUID:<NEW_LINE>// action will have happened already at read time<NEW_LINE>break;<NEW_LINE>case PacketIds.PIPE_TRAVELER:<NEW_LINE>{<NEW_LINE>// MOVED!<NEW_LINE>// onPipeTravelerUpdate(player, (PacketPipeTransportTraveler) packet);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case PacketIds.PIPE_ITEMSTACK:<NEW_LINE>{<NEW_LINE>// action will have happened already at read time<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case PacketIds.DIAMOND_PIPE_SELECT:<NEW_LINE>{<NEW_LINE>onDiamondPipeSelect(player, (PacketSlotChange) packet);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case PacketIds.EMERALD_PIPE_SELECT:<NEW_LINE>{<NEW_LINE>onEmeraldPipeSelect(player, (PacketSlotChange) packet);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case PacketIds.PIPE_ITEMSTACK_REQUEST:<NEW_LINE>{<NEW_LINE>((PacketPipeTransportItemStackRequest) packet).sendDataToPlayer(player);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>} | NetworkRegistry.NET_HANDLER).get(); |
1,413,763 | public void traverse() {<NEW_LINE>final List<AnnotatedInterval> annotatedIntervalList = new ArrayList<>(intervals.size());<NEW_LINE>for (final SimpleInterval interval : intervals) {<NEW_LINE>if (interval.getLengthOnReference() == 0) {<NEW_LINE>throw new UserException.BadInput(String.format("Interval cannot have zero length: %s", interval));<NEW_LINE>}<NEW_LINE>final ReferenceContext referenceContext <MASK><NEW_LINE>final FeatureContext featureContext = new FeatureContext(features, interval);<NEW_LINE>final AnnotationMap annotations = new AnnotationMap(annotators.stream().collect(Collectors.mapping(a -> Pair.of(a.getAnnotationKey(), a.applyAndValidate(interval, referenceContext, featureContext)), Collectors.toList())));<NEW_LINE>annotatedIntervalList.add(new AnnotatedInterval(interval, annotations));<NEW_LINE>progressMeter.update(interval);<NEW_LINE>}<NEW_LINE>annotatedIntervals = new AnnotatedIntervalCollection(new SimpleLocatableMetadata(sequenceDictionary), annotatedIntervalList);<NEW_LINE>} | = new ReferenceContext(reference, interval); |
1,448,141 | protected String processActionForSpecialSymbols(String actionStr, int line, RuleBlock currentRule, ActionTransInfo tInfo) {<NEW_LINE>if (actionStr == null || actionStr.length() == 0)<NEW_LINE>return null;<NEW_LINE>// The action trans info tells us (at the moment) whether an<NEW_LINE>// assignment was done to the rule's tree root.<NEW_LINE>if (grammar == null)<NEW_LINE>return actionStr;<NEW_LINE>if ((grammar.buildAST && actionStr.indexOf('#') != -1) || grammar instanceof TreeWalkerGrammar || ((grammar instanceof LexerGrammar || grammar instanceof ParserGrammar) && actionStr.indexOf('$') != -1)) {<NEW_LINE>// Create a lexer to read an action and return the translated version<NEW_LINE>antlr.actions.cpp.ActionLexer lexer = new antlr.actions.cpp.ActionLexer(actionStr, currentRule, this, tInfo);<NEW_LINE>lexer.setLineOffset(line);<NEW_LINE>lexer.setFilename(grammar.getFilename());<NEW_LINE>lexer.setTool(antlrTool);<NEW_LINE>try {<NEW_LINE>lexer.mACTION(true);<NEW_LINE>actionStr = lexer<MASK><NEW_LINE>// System.out.println("action translated: "+actionStr);<NEW_LINE>// System.out.println("trans info is "+tInfo);<NEW_LINE>} catch (RecognitionException ex) {<NEW_LINE>lexer.reportError(ex);<NEW_LINE>return actionStr;<NEW_LINE>} catch (TokenStreamException tex) {<NEW_LINE>antlrTool.panic("Error reading action:" + actionStr);<NEW_LINE>return actionStr;<NEW_LINE>} catch (CharStreamException io) {<NEW_LINE>antlrTool.panic("Error reading action:" + actionStr);<NEW_LINE>return actionStr;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return actionStr;<NEW_LINE>} | .getTokenObject().getText(); |
1,184,016 | public RowBasedMatrix calulate(Vector other, Binary op) {<NEW_LINE>assert other != null;<NEW_LINE>RBCompIntDoubleMatrix res;<NEW_LINE>if (op.isInplace()) {<NEW_LINE>res = this;<NEW_LINE>} else {<NEW_LINE>res = new RBCompIntDoubleMatrix(matrixId, clock, rows.length, (int) cols, subDim);<NEW_LINE>}<NEW_LINE>if (op.isInplace()) {<NEW_LINE>for (int rowId = 0; rowId < rows.length; rowId++) {<NEW_LINE>if (null == rows[rowId]) {<NEW_LINE>initEmpty(rowId);<NEW_LINE>}<NEW_LINE>BinaryExecutor.apply(rows<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int rowId = 0; rowId < rows.length; rowId++) {<NEW_LINE>if (null == rows[rowId]) {<NEW_LINE>initEmpty(rowId);<NEW_LINE>}<NEW_LINE>res.setRow(rowId, (CompIntDoubleVector) BinaryExecutor.apply(rows[rowId], other, op));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} | [rowId], other, op); |
1,004,422 | private void sendEmail(DatabaseSession session, Project project, Revision revision) throws UserException {<NEW_LINE>Set<User> <MASK><NEW_LINE>for (User user : users) {<NEW_LINE>String body = null;<NEW_LINE>try {<NEW_LINE>if (MailSystem.isValidEmailAddress(user.getUsername())) {<NEW_LINE>EmailMessage message = getBimServer().getMailSystem().createMessage();<NEW_LINE>ServerSettings serverSettings = getBimServer().getServerSettingsCache().getServerSettings();<NEW_LINE>String emailSenderAddress = serverSettings.getEmailSenderAddress();<NEW_LINE>InternetAddress addressFrom = new InternetAddress(emailSenderAddress);<NEW_LINE>message.setFrom(addressFrom);<NEW_LINE>InternetAddress[] addressTo = new InternetAddress[1];<NEW_LINE>addressTo[0] = new InternetAddress(user.getUsername());<NEW_LINE>message.setRecipients(Message.RecipientType.TO, addressTo);<NEW_LINE>Map<String, Object> context = new HashMap<String, Object>();<NEW_LINE>context.put("name", user.getName());<NEW_LINE>context.put("username", user.getUsername());<NEW_LINE>context.put("siteaddress", serverSettings.getSiteAddress());<NEW_LINE>context.put("revisionId", revision.getId());<NEW_LINE>Authorization authorization = null;<NEW_LINE>if (user.getUserType() == UserType.ADMIN) {<NEW_LINE>authorization = new AdminAuthorization(getBimServer().getServerSettingsCache().getServerSettings().getSessionTimeOutSeconds(), TimeUnit.SECONDS);<NEW_LINE>} else {<NEW_LINE>authorization = new UserAuthorization(getBimServer().getServerSettingsCache().getServerSettings().getSessionTimeOutSeconds(), TimeUnit.SECONDS);<NEW_LINE>}<NEW_LINE>authorization.setUoid(user.getOid());<NEW_LINE>String asHexToken = authorization.asHexToken(getBimServer().getEncryptionKey());<NEW_LINE>context.put("token", asHexToken);<NEW_LINE>context.put("roid", revision.getOid());<NEW_LINE>context.put("comment", revision.getComment());<NEW_LINE>context.put("projectName", project.getName());<NEW_LINE>String subject = null;<NEW_LINE>body = getBimServer().getTemplateEngine().process(context, TemplateIdentifier.NEW_REVISION_EMAIL_BODY);<NEW_LINE>subject = getBimServer().getTemplateEngine().process(context, TemplateIdentifier.NEW_REVISION_EMAIL_SUBJECT);<NEW_LINE>message.setContent(body, "text/html");<NEW_LINE>message.setSubject(subject.trim());<NEW_LINE>LOGGER.info("Sending new revision e-mail to " + user.getUsername());<NEW_LINE>message.send();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error(body);<NEW_LINE>LOGGER.error("", e);<NEW_LINE>throw new UserException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | users = getUsers(session, project); |
1,514,863 | public Response doInvoke(Invocation invocation, SwaggerProducerOperation producerOperation) {<NEW_LINE>Response response;<NEW_LINE>try {<NEW_LINE>invocation.onBusinessMethodStart();<NEW_LINE>Object[] args = invocation.toProducerArguments();<NEW_LINE>for (ProducerInvokeExtension producerInvokeExtension : producerOperation.getProducerInvokeExtenstionList()) {<NEW_LINE>producerInvokeExtension.beforeMethodInvoke(invocation, producerOperation, args);<NEW_LINE>}<NEW_LINE>Object result = producerOperation.getProducerMethod().invoke(<MASK><NEW_LINE>response = producerOperation.getResponseMapper().mapResponse(invocation.getStatus(), result);<NEW_LINE>invocation.onBusinessMethodFinish();<NEW_LINE>invocation.onBusinessFinish();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (DynamicPropertyFactory.getInstance().getBooleanProperty(Const.PRINT_SENSITIVE_ERROR_MESSAGE, false).get()) {<NEW_LINE>LOGGER.error("unexpected error operation={}", invocation.getInvocationQualifiedName(), e);<NEW_LINE>} else {<NEW_LINE>if (shouldPrintErrorLog(e)) {<NEW_LINE>invocation.getTraceIdLogger().error(LOGGER, "unexpected error operation={}, message={}", invocation.getInvocationQualifiedName(), org.apache.servicecomb.foundation.common.utils.ExceptionUtils.getExceptionMessageWithoutTrace(e));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>invocation.onBusinessMethodFinish();<NEW_LINE>invocation.onBusinessFinish();<NEW_LINE>response = processException(invocation, e);<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>} | producerOperation.getProducerInstance(), args); |
860,487 | private static boolean eliminateCatchTemporary(Op03SimpleStatement catchh) {<NEW_LINE>if (catchh.getTargets().size() != 1)<NEW_LINE>return false;<NEW_LINE>Op03SimpleStatement maybeAssign = catchh.getTargets().get(0);<NEW_LINE>CatchStatement catchStatement = (CatchStatement) catchh.getStatement();<NEW_LINE>LValue catching = catchStatement.getCreatedLValue();<NEW_LINE>if (!(catching instanceof StackSSALabel))<NEW_LINE>return false;<NEW_LINE>StackSSALabel catchingSSA = (StackSSALabel) catching;<NEW_LINE>if (catchingSSA.getStackEntry().getUsageCount() != 1)<NEW_LINE>return false;<NEW_LINE>while (maybeAssign.getStatement() instanceof TryStatement) {<NEW_LINE>// Note that the 'tried' path is always path 0 of a try statement.<NEW_LINE>maybeAssign = maybeAssign.<MASK><NEW_LINE>}<NEW_LINE>WildcardMatch match = new WildcardMatch();<NEW_LINE>if (!match.match(new AssignmentSimple(BytecodeLoc.NONE, match.getLValueWildCard("caught"), new StackValue(BytecodeLoc.NONE, catchingSSA)), maybeAssign.getStatement())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Hurrah - maybeAssign is an assignment of the caught value.<NEW_LINE>catchh.replaceStatement(new CatchStatement(BytecodeLoc.TODO, catchStatement.getExceptions(), match.getLValueWildCard("caught").getMatch()));<NEW_LINE>maybeAssign.nopOut();<NEW_LINE>return true;<NEW_LINE>} | getTargets().get(0); |
1,231,736 | protected boolean checkIsSupported(@NonNull ActionHolder holder) {<NEW_LINE>boolean isNotLegacy = readCharacteristic(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL, -1) != CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY;<NEW_LINE>// Not sure we should check aeMode as well, probably all aeModes support locking,<NEW_LINE>// but this should not be a big issue since we're not even using different AE modes.<NEW_LINE>Integer aeMode = holder.getBuilder(this<MASK><NEW_LINE>boolean isAEOn = aeMode != null && (aeMode == CameraCharacteristics.CONTROL_AE_MODE_ON || aeMode == CameraCharacteristics.CONTROL_AE_MODE_ON_ALWAYS_FLASH || aeMode == CameraCharacteristics.CONTROL_AE_MODE_ON_AUTO_FLASH || aeMode == CameraCharacteristics.CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE || aeMode == 5);<NEW_LINE>boolean result = isNotLegacy && isAEOn;<NEW_LINE>LOG.i("checkIsSupported:", result);<NEW_LINE>return result;<NEW_LINE>} | ).get(CaptureRequest.CONTROL_AE_MODE); |
637,382 | public static ListBandwidthackagesResponse unmarshall(ListBandwidthackagesResponse listBandwidthackagesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listBandwidthackagesResponse.setRequestId(_ctx.stringValue("ListBandwidthackagesResponse.RequestId"));<NEW_LINE>listBandwidthackagesResponse.setTotalCount(_ctx.integerValue("ListBandwidthackagesResponse.TotalCount"));<NEW_LINE>listBandwidthackagesResponse.setPageNumber(_ctx.integerValue("ListBandwidthackagesResponse.PageNumber"));<NEW_LINE>listBandwidthackagesResponse.setPageSize(_ctx.integerValue("ListBandwidthackagesResponse.PageSize"));<NEW_LINE>List<BandwidthPackage> bandwidthPackages = new ArrayList<BandwidthPackage>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListBandwidthackagesResponse.BandwidthPackages.Length"); i++) {<NEW_LINE>BandwidthPackage bandwidthPackage = new BandwidthPackage();<NEW_LINE>bandwidthPackage.setBandwidthPackageId(_ctx.stringValue("ListBandwidthackagesResponse.BandwidthPackages[" + i + "].BandwidthPackageId"));<NEW_LINE>bandwidthPackage.setName(_ctx.stringValue("ListBandwidthackagesResponse.BandwidthPackages[" + i + "].Name"));<NEW_LINE>bandwidthPackage.setDescription(_ctx.stringValue("ListBandwidthackagesResponse.BandwidthPackages[" + i + "].Description"));<NEW_LINE>bandwidthPackage.setState(_ctx.stringValue("ListBandwidthackagesResponse.BandwidthPackages[" + i + "].State"));<NEW_LINE>bandwidthPackage.setBandwidth(_ctx.integerValue<MASK><NEW_LINE>bandwidthPackage.setChargeType(_ctx.stringValue("ListBandwidthackagesResponse.BandwidthPackages[" + i + "].ChargeType"));<NEW_LINE>bandwidthPackage.setExpiredTime(_ctx.stringValue("ListBandwidthackagesResponse.BandwidthPackages[" + i + "].ExpiredTime"));<NEW_LINE>bandwidthPackage.setCreateTime(_ctx.stringValue("ListBandwidthackagesResponse.BandwidthPackages[" + i + "].CreateTime"));<NEW_LINE>bandwidthPackage.setRegionId(_ctx.stringValue("ListBandwidthackagesResponse.BandwidthPackages[" + i + "].RegionId"));<NEW_LINE>List<String> accelerators = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListBandwidthackagesResponse.BandwidthPackages[" + i + "].Accelerators.Length"); j++) {<NEW_LINE>accelerators.add(_ctx.stringValue("ListBandwidthackagesResponse.BandwidthPackages[" + i + "].Accelerators[" + j + "]"));<NEW_LINE>}<NEW_LINE>bandwidthPackage.setAccelerators(accelerators);<NEW_LINE>bandwidthPackages.add(bandwidthPackage);<NEW_LINE>}<NEW_LINE>listBandwidthackagesResponse.setBandwidthPackages(bandwidthPackages);<NEW_LINE>return listBandwidthackagesResponse;<NEW_LINE>} | ("ListBandwidthackagesResponse.BandwidthPackages[" + i + "].Bandwidth")); |
1,179,185 | public static String[] buildEnvironment(Context currentPackageContext, boolean isFailSafe, String workingDirectory) {<NEW_LINE>TermuxConstants.TERMUX_HOME_DIR.mkdirs();<NEW_LINE>if (workingDirectory == null || workingDirectory.isEmpty())<NEW_LINE>workingDirectory = getDefaultWorkingDirectoryPath();<NEW_LINE>List<String> environment = new ArrayList<>();<NEW_LINE>loadTermuxEnvVariables(currentPackageContext);<NEW_LINE>if (TERMUX_VERSION_NAME != null)<NEW_LINE>environment.add("TERMUX_VERSION=" + TERMUX_VERSION_NAME);<NEW_LINE>if (TERMUX_IS_DEBUGGABLE_BUILD != null)<NEW_LINE>environment.add("TERMUX_IS_DEBUGGABLE_BUILD=" + TERMUX_IS_DEBUGGABLE_BUILD);<NEW_LINE>if (TERMUX_APP_PID != null)<NEW_LINE>environment.add("TERMUX_APP_PID=" + TERMUX_APP_PID);<NEW_LINE>if (TERMUX_APK_RELEASE != null)<NEW_LINE>environment.add("TERMUX_APK_RELEASE=" + TERMUX_APK_RELEASE);<NEW_LINE>if (TERMUX_API_VERSION_NAME != null)<NEW_LINE>environment.add("TERMUX_API_VERSION=" + TERMUX_API_VERSION_NAME);<NEW_LINE>environment.add("TERM=xterm-256color");<NEW_LINE>environment.add("COLORTERM=truecolor");<NEW_LINE>environment.add("HOME=" + TermuxConstants.TERMUX_HOME_DIR_PATH);<NEW_LINE>environment.add("PREFIX=" + TermuxConstants.TERMUX_PREFIX_DIR_PATH);<NEW_LINE>environment.add("BOOTCLASSPATH=" + System.getenv("BOOTCLASSPATH"));<NEW_LINE>environment.add("ANDROID_ROOT=" + System.getenv("ANDROID_ROOT"));<NEW_LINE>environment.add("ANDROID_DATA=" <MASK><NEW_LINE>// EXTERNAL_STORAGE is needed for /system/bin/am to work on at least<NEW_LINE>// Samsung S7 - see https://plus.google.com/110070148244138185604/posts/gp8Lk3aCGp3.<NEW_LINE>environment.add("EXTERNAL_STORAGE=" + System.getenv("EXTERNAL_STORAGE"));<NEW_LINE>// These variables are needed if running on Android 10 and higher.<NEW_LINE>addToEnvIfPresent(environment, "ANDROID_ART_ROOT");<NEW_LINE>addToEnvIfPresent(environment, "DEX2OATBOOTCLASSPATH");<NEW_LINE>addToEnvIfPresent(environment, "ANDROID_I18N_ROOT");<NEW_LINE>addToEnvIfPresent(environment, "ANDROID_RUNTIME_ROOT");<NEW_LINE>addToEnvIfPresent(environment, "ANDROID_TZDATA_ROOT");<NEW_LINE>if (isFailSafe) {<NEW_LINE>// Keep the default path so that system binaries can be used in the failsafe session.<NEW_LINE>environment.add("PATH= " + System.getenv("PATH"));<NEW_LINE>} else {<NEW_LINE>environment.add("LANG=en_US.UTF-8");<NEW_LINE>environment.add("PATH=" + TermuxConstants.TERMUX_BIN_PREFIX_DIR_PATH);<NEW_LINE>environment.add("PWD=" + workingDirectory);<NEW_LINE>environment.add("TMPDIR=" + TermuxConstants.TERMUX_TMP_PREFIX_DIR_PATH);<NEW_LINE>}<NEW_LINE>return environment.toArray(new String[0]);<NEW_LINE>} | + System.getenv("ANDROID_DATA")); |
604,015 | private void fillInvoicingDateByInvoicingMoment(Contract contract) {<NEW_LINE>ContractVersion version = contract.getCurrentContractVersion();<NEW_LINE>if (version.getAutomaticInvoicing()) {<NEW_LINE>switch(version.getInvoicingMomentSelect()) {<NEW_LINE>case ContractVersionRepository.END_INVOICING_MOMENT:<NEW_LINE>contract.setInvoicingDate(contract.getInvoicePeriodEndDate());<NEW_LINE>break;<NEW_LINE>case ContractVersionRepository.BEGIN_INVOICING_MOMENT:<NEW_LINE>contract.setInvoicingDate(contract.getInvoicePeriodStartDate());<NEW_LINE>break;<NEW_LINE>case ContractVersionRepository.END_INVOICING_MOMENT_PLUS:<NEW_LINE>if (contract.getInvoicePeriodEndDate() != null) {<NEW_LINE>contract.setInvoicingDate(contract.getInvoicePeriodEndDate().plusDays(version.getNumberOfDays()));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case ContractVersionRepository.BEGIN_INVOICING_MOMENT_PLUS:<NEW_LINE>if (contract.getInvoicePeriodStartDate() != null) {<NEW_LINE>contract.setInvoicingDate(contract.getInvoicePeriodStartDate().plusDays(version.getNumberOfDays()));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>contract.setInvoicingDate(appBaseService.getTodayDate<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (contract.getCompany())); |
397,561 | public static CodegenExpression codegenGetterWCoerce(EventPropertyGetterSPI getter, EPType getterType, EPType optionalCoercionType, CodegenMethod method, Class generator, CodegenClassScope classScope) {<NEW_LINE>getterType = JavaClassHelper.getBoxedType(getterType);<NEW_LINE>CodegenExpressionNewAnonymousClass anonymous = newAnonymousClass(method.getBlock(), EventPropertyValueGetter.EPTYPE);<NEW_LINE>CodegenMethod get = CodegenMethod.makeParentNode(EPTypePremade.OBJECT.getEPType(), generator, classScope).addParam(CodegenNamedParam.from(EventBean.EPTYPE, "bean"));<NEW_LINE>anonymous.addMethod("get", get);<NEW_LINE>CodegenExpression result = getter.eventBeanGetCodegen(ref("bean"), method, classScope);<NEW_LINE>if (optionalCoercionType instanceof EPTypeClass && !getterType.equals(optionalCoercionType) && JavaClassHelper.isNumeric(getterType)) {<NEW_LINE>SimpleNumberCoercer coercer = SimpleNumberCoercerFactory.getCoercer(getterType, JavaClassHelper.getBoxedType((EPTypeClass) optionalCoercionType));<NEW_LINE>get.getBlock().declareVar((EPTypeClass) getterType, "prop", cast(<MASK><NEW_LINE>result = coercer.coerceCodegen(ref("prop"), (EPTypeClass) getterType);<NEW_LINE>}<NEW_LINE>get.getBlock().methodReturn(result);<NEW_LINE>return anonymous;<NEW_LINE>} | (EPTypeClass) getterType, result)); |
870,520 | private RelDataType sqlType(RelDataTypeFactory typeFactory, int dataType, int precision, int scale, String typeString) {<NEW_LINE>// Fall back to ANY if type is unknown<NEW_LINE>final SqlTypeName sqlTypeName = Util.first(SqlTypeName.getNameForJdbcType(dataType), SqlTypeName.ANY);<NEW_LINE>switch(sqlTypeName) {<NEW_LINE>case ARRAY:<NEW_LINE>RelDataType component = null;<NEW_LINE>if (typeString != null && typeString.endsWith(" ARRAY")) {<NEW_LINE>// E.g. hsqldb gives "INTEGER ARRAY", so we deduce the component type<NEW_LINE>// "INTEGER".<NEW_LINE>final String remaining = typeString.substring(0, typeString.length() - " ARRAY".length());<NEW_LINE>component = parseTypeString(typeFactory, remaining);<NEW_LINE>}<NEW_LINE>if (component == null) {<NEW_LINE>component = typeFactory.createTypeWithNullability(typeFactory.createSqlType<MASK><NEW_LINE>}<NEW_LINE>return typeFactory.createArrayType(component, -1);<NEW_LINE>}<NEW_LINE>if (precision >= 0 && scale >= 0 && sqlTypeName.allowsPrecScale(true, true)) {<NEW_LINE>return typeFactory.createSqlType(sqlTypeName, precision, scale);<NEW_LINE>} else if (precision >= 0 && sqlTypeName.allowsPrecNoScale()) {<NEW_LINE>return typeFactory.createSqlType(sqlTypeName, precision);<NEW_LINE>} else {<NEW_LINE>assert sqlTypeName.allowsNoPrecNoScale();<NEW_LINE>return typeFactory.createSqlType(sqlTypeName);<NEW_LINE>}<NEW_LINE>} | (SqlTypeName.ANY), true); |
113,784 | private Result buildNewPlan(RelOptCluster cluster, RelOptSchema relOptSchema, BaselineInfo baselineInfo, SqlParameterized sqlParameterized, ExecutionContext executionContext, int currentHashCode) {<NEW_LINE>logger.info("build new plan, sql:" + baselineInfo.getParameterSql());<NEW_LINE>ExecutionPlan planWithContext = Planner.getInstance().doBuildPlan(sqlParameterized, executionContext);<NEW_LINE>RelNode p = planWithContext.getPlan();<NEW_LINE>PlanInfo resultPlanInfo = new PlanInfo(PlanManagerUtil.relNodeToJson(p), baselineInfo.getId(), simpleCostValue(p), executionContext.getTraceId(), PlanManagerUtil.getPlanOrigin(p), currentHashCode);<NEW_LINE>resultPlanInfo.setAccepted(true);<NEW_LINE>baselineInfo.getAcceptedPlans().put(<MASK><NEW_LINE>return new Result(baselineInfo, resultPlanInfo, resultPlanInfo.getPlan(cluster, relOptSchema), SPM_NEW_BUILD);<NEW_LINE>} | resultPlanInfo.getId(), resultPlanInfo); |
369,789 | public StaticObject JVM_GetArrayElement(@JavaType(Object.class) StaticObject array, int index, @Inject SubstitutionProfiler profiler) {<NEW_LINE>Meta meta = getMeta();<NEW_LINE>if (StaticObject.isNull(array)) {<NEW_LINE>profiler.profile(7);<NEW_LINE>throw meta.throwNullPointerException();<NEW_LINE>}<NEW_LINE>if (array.isArray()) {<NEW_LINE>profiler.profile(6);<NEW_LINE>return getInterpreterToVM().getArrayObject(index, array);<NEW_LINE>}<NEW_LINE>if (!array.getClass().isArray()) {<NEW_LINE>profiler.profile(5);<NEW_LINE>throw meta.throwExceptionWithMessage(meta.java_lang_IllegalArgumentException, "Argument is not an array");<NEW_LINE>}<NEW_LINE>assert array.getClass().isArray() && array.getClass().getComponentType().isPrimitive();<NEW_LINE>if (index < 0 || index >= JVM_GetArrayLength(array, profiler)) {<NEW_LINE>profiler.profile(4);<NEW_LINE>throw meta.throwExceptionWithMessage(meta.java_lang_ArrayIndexOutOfBoundsException, "index");<NEW_LINE>}<NEW_LINE>Object elem = <MASK><NEW_LINE>return getMeta().boxPrimitive(elem);<NEW_LINE>} | Array.get(array, index); |
1,760,891 | public void addInstances(InstanceList training) {<NEW_LINE>alphabet = training.getDataAlphabet();<NEW_LINE>numTypes = alphabet.size();<NEW_LINE>betaSum = beta * numTypes;<NEW_LINE>typeTopicCounts = <MASK><NEW_LINE>typeTopicWeights = new double[numTypes][numTopics];<NEW_LINE>totalTopicWeights = new double[numTopics];<NEW_LINE>for (int type = 0; type < numTypes; type++) {<NEW_LINE>Arrays.fill(typeTopicWeights[type], beta);<NEW_LINE>}<NEW_LINE>Arrays.fill(totalTopicWeights, betaSum);<NEW_LINE>int doc = 0;<NEW_LINE>for (Instance instance : training) {<NEW_LINE>doc++;<NEW_LINE>FeatureSequence tokenSequence = (FeatureSequence) instance.getData();<NEW_LINE>LabelSequence topicSequence = new LabelSequence(topicAlphabet, new int[tokenSequence.size()]);<NEW_LINE>TopicAssignment t = new TopicAssignment(instance, topicSequence);<NEW_LINE>data.add(t);<NEW_LINE>}<NEW_LINE>} | new int[numTypes][numTopics]; |
1,513,892 | public PathDetail deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {<NEW_LINE>JsonNode pathDetail = jp.readValueAsTree();<NEW_LINE>if (pathDetail.size() != 3)<NEW_LINE>throw new JsonParseException(jp, "PathDetail array must have exactly 3 entries but was " + pathDetail.size());<NEW_LINE>JsonNode from = pathDetail.get(0);<NEW_LINE>JsonNode <MASK><NEW_LINE>JsonNode val = pathDetail.get(2);<NEW_LINE>PathDetail pd;<NEW_LINE>if (val.isBoolean())<NEW_LINE>pd = new PathDetail(val.asBoolean());<NEW_LINE>else if (val.isDouble())<NEW_LINE>pd = new PathDetail(val.asDouble());<NEW_LINE>else if (val.canConvertToLong())<NEW_LINE>pd = new PathDetail(val.asLong());<NEW_LINE>else if (val.isTextual())<NEW_LINE>pd = new PathDetail(val.asText());<NEW_LINE>else<NEW_LINE>throw new JsonParseException(jp, "Unsupported type of PathDetail value " + pathDetail.getNodeType().name());<NEW_LINE>pd.setFirst(from.asInt());<NEW_LINE>pd.setLast(to.asInt());<NEW_LINE>return pd;<NEW_LINE>} | to = pathDetail.get(1); |
1,329,501 | private void showPredefineWaypointAppearanceDialog(@NonNull View container, @NonNull final MapActivity mapActivity) {<NEW_LINE>WptPtEditor waypointEditor = mapActivity.getContextMenu().getWptPtPointEditor();<NEW_LINE>if (waypointEditor != null) {<NEW_LINE>WptPt source = hasPredefinedWaypointAppearance() ? createWaypoint() : null;<NEW_LINE>String gpxFilePath = getSelectedGpxFilePath(true);<NEW_LINE>waypointEditor.setOnDismissListener(showDialogAfterTemplateEditing(mapActivity));<NEW_LINE>waypointEditor.setOnWaypointTemplateAddedListener((waypoint, categoryColor) -> {<NEW_LINE>predefinedWaypoint = waypoint;<NEW_LINE>predefinedCategoryColor = categoryColor;<NEW_LINE>setupWaypointAppearanceToggle(container, mapActivity);<NEW_LINE>});<NEW_LINE>if (gpxFilePath == null) {<NEW_LINE>int categoryColor = getColorFromParams(KEY_CATEGORY_COLOR, 0);<NEW_LINE><MASK><NEW_LINE>hideDialog(mapActivity);<NEW_LINE>} else {<NEW_LINE>getGpxFile(gpxFilePath, mapActivity, gpxFile -> {<NEW_LINE>waypointEditor.addWaypointTemplate(source, gpxFile);<NEW_LINE>hideDialog(mapActivity);<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | waypointEditor.addWaypointTemplate(source, categoryColor); |
189,702 | public void onSuccess(JSONValue result) {<NEW_LINE>JSONArray queries = result.isArray();<NEW_LINE>if (queries.size() == 0) {<NEW_LINE>notifyManager.showError("No saved query with ID " + idString);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>assert queries.size() == 1;<NEW_LINE>JSONObject query = queries.get(0).isObject();<NEW_LINE>int queryId = (int) query.get("id").isNumber().doubleValue();<NEW_LINE>String tokenString = query.get("url_token").isString().stringValue();<NEW_LINE>HistoryToken token;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (IllegalArgumentException exc) {<NEW_LINE>NotifyManager.getInstance().showError("Invalid saved query token " + tokenString);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// since this is happening asynchronously, the history may have changed, so ensure<NEW_LINE>// it's set back to what it should be.<NEW_LINE>HistoryToken shortToken = new HistoryToken();<NEW_LINE>shortToken.put(HISTORY_TOKEN, Integer.toString(queryId));<NEW_LINE>CustomHistory.newItem(shortToken);<NEW_LINE>CustomHistory.simulateHistoryToken(token);<NEW_LINE>} | token = HistoryToken.fromString(tokenString); |
51,618 | public void processView(EventBean[] newData, EventBean[] oldData, boolean isGenerateSynthetic) {<NEW_LINE>// apply to aggregates<NEW_LINE>Object[] groupKeysPerLevel = new Object[processor.getGroupByRollupDesc().getLevels().length];<NEW_LINE>EventBean[] eventsPerStream;<NEW_LINE>if (newData != null) {<NEW_LINE>for (EventBean aNewData : newData) {<NEW_LINE>eventsPerStream = new EventBean[] { aNewData };<NEW_LINE>Object groupKeyComplete = processor.generateGroupKeySingle(eventsPerStream, true);<NEW_LINE>for (AggregationGroupByRollupLevel level : processor.getGroupByRollupDesc().getLevels()) {<NEW_LINE>Object <MASK><NEW_LINE>groupKeysPerLevel[level.getLevelNumber()] = groupKey;<NEW_LINE>outputLimitGroupRepsPerLevel[level.getLevelNumber()].put(groupKey, eventsPerStream);<NEW_LINE>if (processor.isSelectRStream() && !groupRepsOutputLastUnordRStream[level.getLevelNumber()].containsKey(groupKey)) {<NEW_LINE>processor.generateOutputBatchedMapUnsorted(false, groupKey, level, eventsPerStream, true, isGenerateSynthetic, groupRepsOutputLastUnordRStream[level.getLevelNumber()]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>processor.getAggregationService().applyEnter(eventsPerStream, groupKeysPerLevel, processor.getExprEvaluatorContext());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (oldData != null) {<NEW_LINE>for (EventBean anOldData : oldData) {<NEW_LINE>eventsPerStream = new EventBean[] { anOldData };<NEW_LINE>Object groupKeyComplete = processor.generateGroupKeySingle(eventsPerStream, false);<NEW_LINE>for (AggregationGroupByRollupLevel level : processor.getGroupByRollupDesc().getLevels()) {<NEW_LINE>Object groupKey = level.computeSubkey(groupKeyComplete);<NEW_LINE>groupKeysPerLevel[level.getLevelNumber()] = groupKey;<NEW_LINE>outputLimitGroupRepsPerLevel[level.getLevelNumber()].put(groupKey, eventsPerStream);<NEW_LINE>if (processor.isSelectRStream() && !groupRepsOutputLastUnordRStream[level.getLevelNumber()].containsKey(groupKey)) {<NEW_LINE>processor.generateOutputBatchedMapUnsorted(false, groupKey, level, eventsPerStream, false, isGenerateSynthetic, groupRepsOutputLastUnordRStream[level.getLevelNumber()]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>processor.getAggregationService().applyLeave(eventsPerStream, groupKeysPerLevel, processor.getExprEvaluatorContext());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | groupKey = level.computeSubkey(groupKeyComplete); |
536,254 | protected void populateMBeanDescriptor(@Nonnull Descriptor desc, Object managedBean, String beanKey) {<NEW_LINE>Class intf = findJmxInterface(beanKey, AopUtils.getTargetClass(managedBean));<NEW_LINE>ManagedResource mr = this.attributeSource.getManagedResource(intf);<NEW_LINE>if (mr == null) {<NEW_LINE>applyDefaultCurrencyTimeLimit(desc);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>applyCurrencyTimeLimit(desc, mr.getCurrencyTimeLimit());<NEW_LINE>if (mr.isLog()) {<NEW_LINE>desc.setField(FIELD_LOG, "true");<NEW_LINE>}<NEW_LINE>if (StringUtils.hasLength(mr.getLogFile())) {<NEW_LINE>desc.setField(FIELD_LOG_FILE, mr.getLogFile());<NEW_LINE>}<NEW_LINE>if (StringUtils.hasLength(mr.getPersistPolicy())) {<NEW_LINE>desc.setField(FIELD_PERSIST_POLICY, mr.getPersistPolicy());<NEW_LINE>}<NEW_LINE>if (mr.getPersistPeriod() >= 0) {<NEW_LINE>desc.setField(FIELD_PERSIST_PERIOD, Integer.toString(mr.getPersistPeriod()));<NEW_LINE>}<NEW_LINE>if (StringUtils.hasLength(mr.getPersistName())) {<NEW_LINE>desc.setField(FIELD_PERSIST_NAME, mr.getPersistName());<NEW_LINE>}<NEW_LINE>if (StringUtils.hasLength(mr.getPersistLocation())) {<NEW_LINE>desc.setField(<MASK><NEW_LINE>}<NEW_LINE>} | FIELD_PERSIST_LOCATION, mr.getPersistLocation()); |
148,207 | public void serialize(MockSpan mockSpan, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {<NEW_LINE>jsonGenerator.writeStartObject();<NEW_LINE>jsonGenerator.writeStringField("spanId", mockSpan.context().toSpanId());<NEW_LINE>jsonGenerator.writeStringField("traceId", mockSpan.context().toTraceId());<NEW_LINE>jsonGenerator.writeStringField("operation_name", mockSpan.operationName());<NEW_LINE>jsonGenerator.writeNumberField(<MASK><NEW_LINE>mockSpan.tags().forEach((k, v) -> {<NEW_LINE>try {<NEW_LINE>jsonGenerator.writeStringField("tag_" + k, v.toString());<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mockSpan.context().baggageItems().forEach(entry -> {<NEW_LINE>try {<NEW_LINE>jsonGenerator.writeStringField("baggage_" + entry.getKey(), entry.getValue());<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>jsonGenerator.writeEndObject();<NEW_LINE>} | "parent_spanId", mockSpan.parentId()); |
548,389 | void draw(Graphics g, int dstx1, int dsty1, int dstx2, int dsty2, int srcx1, int srcy1, int srcx2, int srcy2) {<NEW_LINE>if (txt == null && g.getCompositeMode() == CompositeMode.SRC_OVER) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (g instanceof PrinterGraphics) {<NEW_LINE>// We're printing. Copy [txt] into a J2DTexture and draw it.<NEW_LINE>int w = srcx2 - srcx1;<NEW_LINE>int h = srcy2 - srcy1;<NEW_LINE>final IntBuffer pixels = IntBuffer.allocate(w * h);<NEW_LINE>PrismInvoker.runOnRenderThread(() -> {<NEW_LINE>getTexture().readPixels(pixels);<NEW_LINE>});<NEW_LINE>Image img = Image.fromIntArgbPreData(pixels, w, h);<NEW_LINE>Texture t = g.getResourceFactory().createTexture(img, Texture.Usage.STATIC, Texture.WrapMode.CLAMP_NOT_NEEDED);<NEW_LINE>g.drawTexture(t, dstx1, dsty1, dstx2, dsty2, 0, 0, w, h);<NEW_LINE>t.dispose();<NEW_LINE>} else {<NEW_LINE>if (txt == null) {<NEW_LINE>Paint p = g.getPaint();<NEW_LINE>g.setPaint(Color.TRANSPARENT);<NEW_LINE>g.fillQuad(<MASK><NEW_LINE>g.setPaint(p);<NEW_LINE>} else {<NEW_LINE>g.drawTexture(txt, dstx1, dsty1, dstx2, dsty2, srcx1 * pixelScale, srcy1 * pixelScale, srcx2 * pixelScale, srcy2 * pixelScale);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | dstx1, dsty1, dstx2, dsty2); |
143,548 | final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TagResourceRequest> request = null;<NEW_LINE>Response<TagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));<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, "Network Firewall");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());<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,634,397 | private void waitIfNeeded() throws Exception {<NEW_LINE>String osName = System.getProperty("os.name");<NEW_LINE>boolean isUnix = !(osName.startsWith("win") || osName.startsWith("Win"));<NEW_LINE>boolean lastConfigLessThanOneSecAgo = (System.currentTimeMillis() - lastConfigUpdate) < 1000;<NEW_LINE>Log.finer(c, "replaceServerConfiguration", "isUnix=" + isUnix + " lastConfigLessThanOneSecAgo=" + lastConfigLessThanOneSecAgo);<NEW_LINE>if (lastConfigLessThanOneSecAgo && isUnix) {<NEW_LINE>// Due to a java limitation on Unix, we need to wait at least<NEW_LINE>// 1 second between config updates so the server can see it.<NEW_LINE>// See https://www-01.ibm.com/support/docview.wss?uid=swg21446506<NEW_LINE>// Note that the above page says that it affects versions up to 1.6, but if you look at the sun bug it is not fixed until java 8.<NEW_LINE>Log.<MASK><NEW_LINE>Thread.sleep(1000);<NEW_LINE>}<NEW_LINE>} | finer(c, "replaceServerConfiguration", "Sleeping for 1 second to work around Unix / JDK limitation fixed in Java 8"); |
1,122,815 | private List<DataMediaPair> doToModel(List<DataMediaPairDO> dataMediaPairDos) {<NEW_LINE>List<Long> dataMediaPairIds = new ArrayList<Long>();<NEW_LINE>for (DataMediaPairDO dataMediaPairDo : dataMediaPairDos) {<NEW_LINE>dataMediaPairIds.add(dataMediaPairDo.getId());<NEW_LINE>}<NEW_LINE>Map<Long, List<ColumnPair>> columnPairMap = dataColumnPairService.listByDataMediaPairIds(dataMediaPairIds.toArray(new Long[dataMediaPairIds.size()]));<NEW_LINE>Map<Long, List<ColumnGroup>> columnPairGroupMap = dataColumnPairGroupService.listByDataMediaPairIds(dataMediaPairIds.toArray(new Long[dataMediaPairIds.size()]));<NEW_LINE>List<DataMediaPair> dataMediaPairs = new ArrayList<DataMediaPair>();<NEW_LINE>for (DataMediaPairDO dataMediaPairDo : dataMediaPairDos) {<NEW_LINE>List<ColumnPair> columnPairs = columnPairMap.get(dataMediaPairDo.getId()) == null ? new ArrayList<ColumnPair>() : columnPairMap.<MASK><NEW_LINE>List<ColumnGroup> columnGroups = columnPairGroupMap.get(dataMediaPairDo.getId()) == null ? new ArrayList<ColumnGroup>() : columnPairGroupMap.get(dataMediaPairDo.getId());<NEW_LINE>dataMediaPairs.add(doToModel(dataMediaPairDo, columnPairs, columnGroups));<NEW_LINE>}<NEW_LINE>return dataMediaPairs;<NEW_LINE>} | get(dataMediaPairDo.getId()); |
644,695 | final GenerateChangeSetResult executeGenerateChangeSet(GenerateChangeSetRequest generateChangeSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(generateChangeSetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GenerateChangeSetRequest> request = null;<NEW_LINE>Response<GenerateChangeSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GenerateChangeSetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(generateChangeSetRequest));<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, "SMS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GenerateChangeSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GenerateChangeSetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>} | false), new GenerateChangeSetResultJsonUnmarshaller()); |
1,658,335 | // //////////////Following are transform of input data.<NEW_LINE>private static <IN, O> DataSet<O> mapInputOperation(DataSet<IN> inputData, DataSet<Tuple2<String, Long>> nodeMapping, TransformInputOperation func0, TransformInputOperation func1, TransformInputOperation func2) {<NEW_LINE>int operationNum = 1 + (func1 == null ? 0 : 1) + (<MASK><NEW_LINE>if (operationNum == 1) {<NEW_LINE>return inCoGroupOperation(inputData, nodeMapping, func0, 0);<NEW_LINE>}<NEW_LINE>DataSet temp1 = inCoGroupOperation(inputData, nodeMapping, func0, 0);<NEW_LINE>if (operationNum == 2) {<NEW_LINE>return inCoGroupOperation(temp1, nodeMapping, func1, 1);<NEW_LINE>}<NEW_LINE>DataSet temp2 = inCoGroupOperation(temp1, nodeMapping, func1, 1);<NEW_LINE>return inCoGroupOperation(temp2, nodeMapping, func2, 2);<NEW_LINE>} | func2 == null ? 0 : 1); |
8,248 | static boolean _cutteeCutterEvents(int eventIndex, int eventIndexTemp, EditShape editShape, ArrayList<CutEvent> cutEvents, ArrayList<CutEvent> cutEventsTemp, int ipartCuttee, int ivertexCuttee, int ipartCutter, int ivertexCutter) {<NEW_LINE>int ilastVertexCuttee = editShape.getLastVertex(ipartCuttee);<NEW_LINE>int ilastVertexCutter = editShape.getLastVertex(ipartCutter);<NEW_LINE>int ifirstVertexCuttee = editShape.getFirstVertex(ipartCuttee);<NEW_LINE>int ifirstVertexCutter = editShape.getFirstVertex(ipartCutter);<NEW_LINE>int ivertexCutteePrev = editShape.getPrevVertex(ivertexCuttee);<NEW_LINE>int ivertexCutterPrev = editShape.getPrevVertex(ivertexCutter);<NEW_LINE>boolean bEndEnd = false;<NEW_LINE>boolean bEndStart = false;<NEW_LINE>boolean bStartEnd = false;<NEW_LINE>boolean bStartStart = false;<NEW_LINE>if (ivertexCuttee != ifirstVertexCuttee) {<NEW_LINE>if (ivertexCutter != ifirstVertexCutter)<NEW_LINE>bEndEnd = _cutteeEndCutterEndEvent(eventIndex, editShape, cutEvents, ipartCuttee, ivertexCutteePrev, ipartCutter, ivertexCutterPrev);<NEW_LINE>if (ivertexCutter != ilastVertexCutter)<NEW_LINE>bEndStart = _cutteeEndCutterStartEvent(eventIndex, editShape, cutEvents, ipartCuttee, ivertexCutteePrev, ipartCutter, ivertexCutter);<NEW_LINE>}<NEW_LINE>if (ivertexCuttee != ilastVertexCuttee) {<NEW_LINE>if (ivertexCutter != ifirstVertexCutter)<NEW_LINE>bStartEnd = _cutteeStartCutterEndEvent(eventIndexTemp, editShape, cutEventsTemp, ipartCuttee, ivertexCuttee, ipartCutter, ivertexCutterPrev, ifirstVertexCuttee);<NEW_LINE>if (ivertexCutter != ilastVertexCutter)<NEW_LINE>bStartStart = _cutteeStartCutterStartEvent(eventIndexTemp, editShape, cutEventsTemp, ipartCuttee, ivertexCuttee, ipartCutter, ivertexCutter, ifirstVertexCuttee);<NEW_LINE>}<NEW_LINE>if (bEndEnd && bEndStart && bStartEnd) {<NEW_LINE>int iendstart = cutEvents.size() - 1;<NEW_LINE>int istartend = (bStartStart ? cutEventsTemp.size() - 2 : cutEventsTemp.size() - 1);<NEW_LINE>if (cutEventsTemp.get(istartend).m_count == 2) {<NEW_LINE>// Replace bEndEnd with bEndStart, and remove duplicate<NEW_LINE>// bEndStart (get rid of bEndEnd)<NEW_LINE>cutEvents.set(iendstart - 1, cutEvents.get(iendstart));<NEW_LINE>cutEvents.remove(cutEvents.size() - 1);<NEW_LINE>}<NEW_LINE>} else if (bEndEnd && bEndStart && bStartStart) {<NEW_LINE>int istartstart = cutEventsTemp.size() - 1;<NEW_LINE>if (cutEventsTemp.get(istartstart).m_count == 2) {<NEW_LINE>// Remove bEndStart<NEW_LINE>CutEvent lastEvent = cutEvents.get(cutEvents.size() - 1);<NEW_LINE>cutEvents.remove(cutEvents.get(cutEvents.size() - 1));<NEW_LINE>int icutEvent = editShape.getUserIndex(lastEvent.m_ivertexCuttee, eventIndex);<NEW_LINE>if (icutEvent == cutEvents.size())<NEW_LINE>editShape.setUserIndex(lastEvent.m_ivertexCuttee, eventIndex, -1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} | return bEndEnd || bEndStart || bStartEnd || bStartStart; |
379,383 | final GetTableResult executeGetTable(GetTableRequest getTableRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getTableRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetTableRequest> request = null;<NEW_LINE>Response<GetTableResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetTableRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getTableRequest));<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, "Glue");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetTable");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetTableResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetTableResultJsonUnmarshaller());<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.endEvent(Field.RequestMarshallTime); |
267,583 | public final void save(File dest, OpenRocketDocument doc, StorageOptions opts, SavingProgress progress) throws IOException, DecalNotFoundException {<NEW_LINE>// This method is the core operational method. It saves the document into a new (hopefully unique)<NEW_LINE>// file, then if the save is successful, it will copy the file over the old one.<NEW_LINE>// Write to a temporary file in the same directory as the specified file.<NEW_LINE>File temporaryNewFile = File.createTempFile("ORSave", ".tmp", dest.getParentFile());<NEW_LINE>OutputStream s = new BufferedOutputStream(new FileOutputStream(temporaryNewFile));<NEW_LINE>if (progress != null) {<NEW_LINE>long estimatedSize = this.estimateFileSize(doc, opts);<NEW_LINE>s = new ProgressOutputStream(s, estimatedSize, progress);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>save(dest.getName(<MASK><NEW_LINE>} catch (DecalNotFoundException decex) {<NEW_LINE>temporaryNewFile.delete();<NEW_LINE>throw decex;<NEW_LINE>} finally {<NEW_LINE>s.close();<NEW_LINE>}<NEW_LINE>// Move the temporary new file over the specified file.<NEW_LINE>boolean destExists = dest.exists();<NEW_LINE>File oldBackupFile = new File(dest.getParentFile(), dest.getName() + "-bak");<NEW_LINE>if (destExists) {<NEW_LINE>dest.renameTo(oldBackupFile);<NEW_LINE>}<NEW_LINE>// since we created the temporary new file in the same directory as the dest file,<NEW_LINE>// it is on the same filesystem, so File.renameTo will work just fine.<NEW_LINE>boolean success = temporaryNewFile.renameTo(dest);<NEW_LINE>if (success) {<NEW_LINE>if (destExists) {<NEW_LINE>oldBackupFile.delete();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ), s, doc, opts); |
1,628,191 | private double computeRoleScore(String regex, List<Integer> groups) {<NEW_LINE>SortedMap<String, SortedSet<String>> nodeRolesMap = regexToNodeRolesMap(regex, groups, _nodes);<NEW_LINE>// produce a role-level topology and the list of nodes in each edge's source role<NEW_LINE>// that have an edge to some node in the edge's target role<NEW_LINE>SortedMap<RoleEdge, SortedSet<String>> roleEdges = new TreeMap<>();<NEW_LINE>for (Edge e : _topology.getEdges()) {<NEW_LINE>String n1 = e.getNode1();<NEW_LINE>String n2 = e.getNode2();<NEW_LINE>SortedSet<String> roles1 = nodeRolesMap.get(n1);<NEW_LINE>SortedSet<String> roles2 = nodeRolesMap.get(n2);<NEW_LINE>if (roles1 != null && roles2 != null && roles1.size() == 1 && roles2.size() == 1) {<NEW_LINE>String role1 = roles1.first();<NEW_LINE>String role2 = roles2.first();<NEW_LINE>// ignore self-edges<NEW_LINE>if (role1.equals(role2)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>RoleEdge redge = new RoleEdge(role1, role2);<NEW_LINE>SortedSet<String> roleEdgeNodes = roleEdges.getOrDefault(redge, new TreeSet<>());<NEW_LINE>roleEdgeNodes.add(n1);<NEW_LINE>roleEdges.put(redge, roleEdgeNodes);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (numEdges == 0) {<NEW_LINE>return 0.0;<NEW_LINE>}<NEW_LINE>// compute the "support" of each edge in the role-level topology:<NEW_LINE>// the percentage of nodes playing the source role that have an edge<NEW_LINE>// to a node in the target role.<NEW_LINE>// the score of this regex is then the average support across all role edges<NEW_LINE>SortedMap<String, SortedSet<String>> roleNodesMap = regexToRoleNodesMap(regex, groups, _nodes);<NEW_LINE>double supportSum = 0.0;<NEW_LINE>for (Map.Entry<RoleEdge, SortedSet<String>> roleEdgeCount : roleEdges.entrySet()) {<NEW_LINE>RoleEdge redge = roleEdgeCount.getKey();<NEW_LINE>int count = roleEdgeCount.getValue().size();<NEW_LINE>supportSum += (double) count / roleNodesMap.get(redge.getRole1()).size();<NEW_LINE>}<NEW_LINE>return supportSum / numEdges;<NEW_LINE>} | int numEdges = roleEdges.size(); |
628,810 | public void processPaths() {<NEW_LINE>final Map<String, PathItem> pathMap = openAPI.getPaths();<NEW_LINE>if (pathMap == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (String pathStr : pathMap.keySet()) {<NEW_LINE>PathItem pathItem = pathMap.get(pathStr);<NEW_LINE>addParametersToEachOperation(pathItem);<NEW_LINE>if (pathItem.getRef() != null) {<NEW_LINE>RefFormat refFormat = <MASK><NEW_LINE>PathItem resolvedPath = cache.loadRef(pathItem.getRef(), refFormat, PathItem.class);<NEW_LINE>// TODO: update references to the parent location<NEW_LINE>String pathRef = pathItem.getRef().split("#")[0];<NEW_LINE>updateLocalRefs(resolvedPath, pathRef);<NEW_LINE>if (resolvedPath != null) {<NEW_LINE>// we need to put the resolved path into swagger object<NEW_LINE>openAPI.path(pathStr, resolvedPath);<NEW_LINE>pathItem = resolvedPath;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// at this point we can process this path<NEW_LINE>final List<Parameter> processedPathParameters = parameterProcessor.processParameters(pathItem.getParameters());<NEW_LINE>pathItem.setParameters(processedPathParameters);<NEW_LINE>addParametersToEachOperation(pathItem);<NEW_LINE>final Map<PathItem.HttpMethod, Operation> operationMap = pathItem.readOperationsMap();<NEW_LINE>for (PathItem.HttpMethod httpMethod : operationMap.keySet()) {<NEW_LINE>Operation operation = operationMap.get(httpMethod);<NEW_LINE>operationProcessor.processOperation(operation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | computeRefFormat(pathItem.getRef()); |
444,002 | private Mono<Response<Flux<ByteBuffer>>> moveResourcesWithResponseAsync(String sourceResourceGroupName, ResourcesMoveInfo parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (sourceResourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter sourceResourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.moveResources(this.client.getEndpoint(), sourceResourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
393,933 | static SerializableObject readObject(final InputStream inputStream, final Class<?> clazz) throws IOException {<NEW_LINE>try {<NEW_LINE>// Look for the right constructor<NEW_LINE>final Constructor<?> c = clazz.getDeclaredConstructor(InputStream.class);<NEW_LINE>// Invoke it<NEW_LINE>final Object <MASK><NEW_LINE>// check whether caste will work<NEW_LINE>if (!(object instanceof SerializableObject)) {<NEW_LINE>throw new IOException("Object " + clazz.getName() + " does not implement SerializableObject");<NEW_LINE>}<NEW_LINE>return (SerializableObject) object;<NEW_LINE>} catch (InstantiationException e) {<NEW_LINE>throw new IOException("Instantiation exception for class " + clazz.getName() + ": " + e.getMessage(), e);<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>throw new IOException("Illegal access creating class " + clazz.getName() + ": " + e.getMessage(), e);<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>throw new IOException("No such method exception for class " + clazz.getName() + ": " + e.getMessage(), e);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>throw new IOException("Exception instantiating class " + clazz.getName() + ": " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | object = c.newInstance(inputStream); |
1,725,068 | final ExportCertificateResult executeExportCertificate(ExportCertificateRequest exportCertificateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(exportCertificateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ExportCertificateRequest> request = null;<NEW_LINE>Response<ExportCertificateResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ExportCertificateRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(exportCertificateRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "ACM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ExportCertificate");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ExportCertificateResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ExportCertificateResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.SIGNING_REGION, getSigningRegion()); |
1,380,457 | // doIt<NEW_LINE>private String createFormat(MTable table) throws Exception {<NEW_LINE>log.info("Table Name:" + table.getTableName());<NEW_LINE>MColumn[] cols = table.getColumns(true);<NEW_LINE>String unique = null;<NEW_LINE>boolean fieldname = false;<NEW_LINE>for (MColumn col : cols) {<NEW_LINE>if (col.isIdentifier() && col.getSeqNo() == 1) {<NEW_LINE>unique = col.getColumnName();<NEW_LINE>if (unique.equals("Name"))<NEW_LINE>fieldname = true;<NEW_LINE>log.info("Unique Key" + unique);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (unique == null)<NEW_LINE>unique = "Name";<NEW_LINE>MEXPFormat format = null;<NEW_LINE>// String formatValue = table.getTableName()+"_"+unique;<NEW_LINE>String formatValue = table.getTableName();<NEW_LINE>log.info("Export Format Value:" + formatValue);<NEW_LINE>format = (MEXPFormat) m_formats.get(formatValue);<NEW_LINE>if (format != null)<NEW_LINE>return format.getValue();<NEW_LINE>String where = " value = ? ";<NEW_LINE>Query sql = new Query(getCtx(), MEXPFormat.Table_Name, where, null).setParameters(new Object[] { formatValue });<NEW_LINE>if (sql.anyMatch()) {<NEW_LINE>format = (MEXPFormat) sql.first();<NEW_LINE>m_formats.put(format.getValue(), format);<NEW_LINE>return format.getValue();<NEW_LINE>}<NEW_LINE>format = MEXPFormat.getFormatByValueAD_Client_IDAndVersion(getCtx(), formatValue, getAD_Client_ID(<MASK><NEW_LINE>if (format == null)<NEW_LINE>format = new MEXPFormat(getCtx(), 0, get_TrxName());<NEW_LINE>format.setValue(formatValue);<NEW_LINE>format.setName(table.getName());<NEW_LINE>format.setAD_Table_ID(table.getAD_Table_ID());<NEW_LINE>format.setDescription(table.getDescription());<NEW_LINE>format.setHelp(table.getHelp());<NEW_LINE>format.setVersion("1");<NEW_LINE>format.save();<NEW_LINE>if (format != null)<NEW_LINE>m_formats.put(format.getValue(), format);<NEW_LINE>int position = 10;<NEW_LINE>for (MColumn col : cols) {<NEW_LINE>if (p_IsMandatory) {<NEW_LINE>if (col.isMandatory())<NEW_LINE>createFormatLine(format, table, col, position, false);<NEW_LINE>} else<NEW_LINE>createFormatLine(format, table, col, position, false);<NEW_LINE>position++;<NEW_LINE>}<NEW_LINE>return format.getValue();<NEW_LINE>} | ), "1", get_TrxName()); |
1,337,177 | private Mono<Response<Void>> deleteWithResponseAsync(String resourceGroupName, String resourceName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, resourceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); |
153,704 | public static QueryPushStatByAppResponse unmarshall(QueryPushStatByAppResponse queryPushStatByAppResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryPushStatByAppResponse.setRequestId(_ctx.stringValue("QueryPushStatByAppResponse.RequestId"));<NEW_LINE>List<AppPushStat> appPushStats = new ArrayList<AppPushStat>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryPushStatByAppResponse.AppPushStats.Length"); i++) {<NEW_LINE>AppPushStat appPushStat = new AppPushStat();<NEW_LINE>appPushStat.setTime(_ctx.stringValue("QueryPushStatByAppResponse.AppPushStats[" + i + "].Time"));<NEW_LINE>appPushStat.setDeletedCount(_ctx.longValue("QueryPushStatByAppResponse.AppPushStats[" + i + "].DeletedCount"));<NEW_LINE>appPushStat.setOpenedCount(_ctx.longValue("QueryPushStatByAppResponse.AppPushStats[" + i + "].OpenedCount"));<NEW_LINE>appPushStat.setSmsReceiveSuccessCount(_ctx.longValue("QueryPushStatByAppResponse.AppPushStats[" + i + "].SmsReceiveSuccessCount"));<NEW_LINE>appPushStat.setSmsSkipCount(_ctx.longValue("QueryPushStatByAppResponse.AppPushStats[" + i + "].SmsSkipCount"));<NEW_LINE>appPushStat.setSmsReceiveFailedCount(_ctx.longValue<MASK><NEW_LINE>appPushStat.setSmsFailedCount(_ctx.longValue("QueryPushStatByAppResponse.AppPushStats[" + i + "].SmsFailedCount"));<NEW_LINE>appPushStat.setReceivedCount(_ctx.longValue("QueryPushStatByAppResponse.AppPushStats[" + i + "].ReceivedCount"));<NEW_LINE>appPushStat.setSentCount(_ctx.longValue("QueryPushStatByAppResponse.AppPushStats[" + i + "].SentCount"));<NEW_LINE>appPushStat.setSmsSentCount(_ctx.longValue("QueryPushStatByAppResponse.AppPushStats[" + i + "].SmsSentCount"));<NEW_LINE>appPushStat.setAcceptCount(_ctx.longValue("QueryPushStatByAppResponse.AppPushStats[" + i + "].AcceptCount"));<NEW_LINE>appPushStats.add(appPushStat);<NEW_LINE>}<NEW_LINE>queryPushStatByAppResponse.setAppPushStats(appPushStats);<NEW_LINE>return queryPushStatByAppResponse;<NEW_LINE>} | ("QueryPushStatByAppResponse.AppPushStats[" + i + "].SmsReceiveFailedCount")); |
1,426,856 | private DataSet generateDataSet(int batchSize) {<NEW_LINE>int w = (int) originalImage.getWidth();<NEW_LINE>int h = (int) originalImage.getHeight();<NEW_LINE>PixelReader reader = originalImage.getPixelReader();<NEW_LINE>INDArray xy = Nd4j.zeros(batchSize, 2);<NEW_LINE>INDArray out = Nd4j.zeros(batchSize, 3);<NEW_LINE>for (int index = 0; index < batchSize; index++) {<NEW_LINE>int i = r.nextInt(w);<NEW_LINE>int <MASK><NEW_LINE>double xp = scaleXY(i, w);<NEW_LINE>double yp = scaleXY(j, h);<NEW_LINE>Color c = reader.getColor(i, j);<NEW_LINE>// 2 inputs. x and y.<NEW_LINE>xy.put(index, 0, xp);<NEW_LINE>xy.put(index, 1, yp);<NEW_LINE>// 3 outputs. the RGB values.<NEW_LINE>out.put(index, 0, c.getRed());<NEW_LINE>out.put(index, 1, c.getGreen());<NEW_LINE>out.put(index, 2, c.getBlue());<NEW_LINE>}<NEW_LINE>return new DataSet(xy, out);<NEW_LINE>} | j = r.nextInt(h); |
563,428 | public FrameMetric unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>FrameMetric frameMetric = new FrameMetric();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("frameName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>frameMetric.setFrameName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("threadStates", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>frameMetric.setThreadStates(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("type", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>frameMetric.setType(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 frameMetric;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,697,989 | private void updateModules() {<NEW_LINE>Set<ModuleContext> moduleContextSet = new HashSet<>();<NEW_LINE>for (Map.Entry<ModuleId, ModuleContext> moduleIdModuleContextEntry : moduleContextMap.entrySet()) {<NEW_LINE>ModuleId moduleId = moduleIdModuleContextEntry.getKey();<NEW_LINE><MASK><NEW_LINE>PackageDescriptor packageDescriptor = this.packageManifest.descriptor();<NEW_LINE>ModuleName moduleName = ModuleName.from(packageDescriptor.name(), oldModuleContext.moduleName().moduleNamePart());<NEW_LINE>ModuleDescriptor moduleDescriptor = ModuleDescriptor.from(moduleName, packageDescriptor);<NEW_LINE>Map<DocumentId, DocumentContext> srcDocContextMap = new HashMap<>();<NEW_LINE>for (DocumentId documentId : oldModuleContext.srcDocumentIds()) {<NEW_LINE>srcDocContextMap.put(documentId, oldModuleContext.documentContext(documentId));<NEW_LINE>}<NEW_LINE>Map<DocumentId, DocumentContext> testDocContextMap = new HashMap<>();<NEW_LINE>for (DocumentId documentId : oldModuleContext.testSrcDocumentIds()) {<NEW_LINE>testDocContextMap.put(documentId, oldModuleContext.documentContext(documentId));<NEW_LINE>}<NEW_LINE>Map<DocumentId, ResourceContext> resourceMap = new HashMap<>();<NEW_LINE>for (DocumentId documentId : oldModuleContext.resourceIds()) {<NEW_LINE>resourceMap.put(documentId, oldModuleContext.resourceContext(documentId));<NEW_LINE>}<NEW_LINE>Map<DocumentId, ResourceContext> testResourceMap = new HashMap<>();<NEW_LINE>for (DocumentId documentId : oldModuleContext.testResourceIds()) {<NEW_LINE>testResourceMap.put(documentId, oldModuleContext.resourceContext(documentId));<NEW_LINE>}<NEW_LINE>moduleContextSet.add(new ModuleContext(this.project, moduleId, moduleDescriptor, oldModuleContext.isDefaultModule(), srcDocContextMap, testDocContextMap, oldModuleContext.moduleMdContext().orElse(null), oldModuleContext.moduleDescDependencies(), resourceMap, testResourceMap));<NEW_LINE>}<NEW_LINE>updateModules(moduleContextSet);<NEW_LINE>} | ModuleContext oldModuleContext = moduleIdModuleContextEntry.getValue(); |
1,163,578 | public final <T> void writeObject(final int tag, int tagSize, final T value, final SchemaWriter<T> schemaWriter) throws IOException {<NEW_LINE>final LinkedBuffer lastBuffer;<NEW_LINE>// write the tag<NEW_LINE>if (tagSize == 1 && tail.offset != tail.buffer.length) {<NEW_LINE>lastBuffer = tail;<NEW_LINE>size++;<NEW_LINE>lastBuffer.buffer[lastBuffer.offset++] = (byte) tag;<NEW_LINE>} else {<NEW_LINE>tail = lastBuffer = writeRawVarInt32(tag, this, tail);<NEW_LINE>}<NEW_LINE>final int lastOffset = tail.offset, lastSize = size;<NEW_LINE>if (lastOffset == lastBuffer.buffer.length) {<NEW_LINE>// not enough size for the 1-byte delimiter<NEW_LINE>final LinkedBuffer nextBuffer = new LinkedBuffer(nextBufferSize);<NEW_LINE>// new buffer for the content<NEW_LINE>tail = nextBuffer;<NEW_LINE>schemaWriter.writeTo(this, value);<NEW_LINE>final int msgSize = size - lastSize;<NEW_LINE>final byte[] delimited = new byte[computeRawVarint32Size(msgSize)];<NEW_LINE>writeRawVarInt32(msgSize, delimited, 0);<NEW_LINE>size += delimited.length;<NEW_LINE>// wrap the byte array (delimited) and insert between the two buffers<NEW_LINE>new LinkedBuffer(delimited, 0, delimited.length, lastBuffer).next = nextBuffer;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// we have enough space for the 1-byte delim<NEW_LINE>lastBuffer.offset++;<NEW_LINE>size++;<NEW_LINE>schemaWriter.writeTo(this, value);<NEW_LINE>final <MASK><NEW_LINE>// optimize for small messages<NEW_LINE>if (msgSize < 128) {<NEW_LINE>// fits<NEW_LINE>lastBuffer.buffer[lastOffset] = (byte) msgSize;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// split into two buffers<NEW_LINE>// the second buffer (contains the message contents)<NEW_LINE>final LinkedBuffer view = new LinkedBuffer(lastBuffer.buffer, lastOffset + 1, lastBuffer.offset);<NEW_LINE>if (lastBuffer == tail) {<NEW_LINE>tail = view;<NEW_LINE>} else {<NEW_LINE>view.next = lastBuffer.next;<NEW_LINE>}<NEW_LINE>// the first buffer (contains the tag)<NEW_LINE>lastBuffer.offset = lastOffset;<NEW_LINE>final byte[] delimited = new byte[computeRawVarint32Size(msgSize)];<NEW_LINE>writeRawVarInt32(msgSize, delimited, 0);<NEW_LINE>// add the difference<NEW_LINE>size += (delimited.length - 1);<NEW_LINE>// wrap the byte array (delimited) and insert between the two buffers<NEW_LINE>new LinkedBuffer(delimited, 0, delimited.length, lastBuffer).next = view;<NEW_LINE>} | int msgSize = size - lastSize - 1; |
1,588,174 | private void gwFieldValueInt64V(MethodWriterContext mwc, FieldWriter fieldWriter, int OBJECT, int i, boolean jsonb) {<NEW_LINE>MethodWriter mw = mwc.mw;<NEW_LINE>String format = fieldWriter.getFormat();<NEW_LINE>String classNameType = mwc.classNameType;<NEW_LINE>int FIELD_VALUE = <MASK><NEW_LINE>int WRITE_DEFAULT_VALUE = mwc.var(NOT_WRITE_DEFAULT_VALUE);<NEW_LINE>Label notDefaultValue_ = new Label(), endWriteValue_ = new Label();<NEW_LINE>genGetObject(mwc, fieldWriter, OBJECT);<NEW_LINE>mw.visitInsn(Opcodes.DUP2);<NEW_LINE>mw.visitVarInsn(Opcodes.LSTORE, FIELD_VALUE);<NEW_LINE>mw.visitInsn(Opcodes.LCONST_0);<NEW_LINE>mw.visitInsn(Opcodes.LCMP);<NEW_LINE>mw.visitJumpInsn(Opcodes.IFNE, notDefaultValue_);<NEW_LINE>mw.visitVarInsn(Opcodes.ILOAD, WRITE_DEFAULT_VALUE);<NEW_LINE>mw.visitJumpInsn(Opcodes.IFEQ, notDefaultValue_);<NEW_LINE>mw.visitJumpInsn(Opcodes.GOTO, endWriteValue_);<NEW_LINE>mw.visitLabel(notDefaultValue_);<NEW_LINE>if (jsonb) {<NEW_LINE>gwFieldName(mwc, i);<NEW_LINE>mw.visitVarInsn(Opcodes.ALOAD, JSON_WRITER);<NEW_LINE>mw.visitVarInsn(Opcodes.LLOAD, FIELD_VALUE);<NEW_LINE>mw.visitMethodInsn(Opcodes.INVOKEVIRTUAL, TYPE_JSON_WRITER, "writeInt64", "(J)V", false);<NEW_LINE>} else {<NEW_LINE>// Int32FieldWriter.writeInt64(JSONWriter w, long value);<NEW_LINE>mw.visitVarInsn(Opcodes.ALOAD, THIS);<NEW_LINE>mw.visitFieldInsn(Opcodes.GETFIELD, classNameType, fieldWriter(i), DESC_FIELD_WRITER);<NEW_LINE>mw.visitVarInsn(Opcodes.ALOAD, JSON_WRITER);<NEW_LINE>mw.visitVarInsn(Opcodes.LLOAD, FIELD_VALUE);<NEW_LINE>if ("iso8601".equals(format)) {<NEW_LINE>mw.visitMethodInsn(Opcodes.INVOKEINTERFACE, TYPE_FIELD_WRITER, "writeDate", METHOD_DESC_WRITE_J, true);<NEW_LINE>} else {<NEW_LINE>mw.visitMethodInsn(Opcodes.INVOKEINTERFACE, TYPE_FIELD_WRITER, "writeInt64", METHOD_DESC_WRITE_J, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mw.visitLabel(endWriteValue_);<NEW_LINE>} | mwc.var(long.class); |
201,491 | protected void buildConfigurationDialog() {<NEW_LINE>configurationDialog = new JDialog(UISupport.getMainFrame());<NEW_LINE>configurationDialog.setTitle(assertion.getConfigurationDialogTitle());<NEW_LINE>configurationDialog.addWindowListener(new WindowAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void windowOpened(WindowEvent event) {<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>// pathArea.requestFocusInWindow();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>JPanel contentPanel = new JPanel(new BorderLayout());<NEW_LINE>contentPanel.add(UISupport.buildDescription(assertion.getPathAreaTitle(), assertion.getPathAreaDescription(), null), BorderLayout.NORTH);<NEW_LINE>JSplitPane splitPane = UISupport.createVerticalSplit();<NEW_LINE>JPanel pathPanel = getPathAreaPanel();<NEW_LINE>splitPane.setTopComponent(UISupport.addTitledBorder(pathPanel, assertion.getPathAreaBorderTitle()));<NEW_LINE>contentArea = new JUndoableTextArea();<NEW_LINE>contentArea.setToolTipText(assertion.getContentAreaToolTipText());<NEW_LINE>JPanel matchPanel = new JPanel(new BorderLayout());<NEW_LINE>JXToolBar contentToolbar = UISupport.createToolbar();<NEW_LINE>assertion.addMatchEditorActions(contentToolbar);<NEW_LINE>matchPanel.add(contentToolbar, BorderLayout.NORTH);<NEW_LINE>matchPanel.add(new JScrollPane(contentArea), BorderLayout.CENTER);<NEW_LINE>splitPane.setBottomComponent(UISupport.addTitledBorder(matchPanel, assertion.getContentAreaBorderTitle()));<NEW_LINE>splitPane.setDividerLocation(200);<NEW_LINE>splitPane.setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 1));<NEW_LINE>contentPanel.add(splitPane, BorderLayout.CENTER);<NEW_LINE>ButtonBarBuilder builder = new ButtonBarBuilder();<NEW_LINE>ShowOnlineHelpAction showOnlineHelpAction = new ShowOnlineHelpAction(this.getHelpURL());<NEW_LINE>builder.addFixed(UISupport.createToolbarButton(showOnlineHelpAction));<NEW_LINE>builder.addGlue();<NEW_LINE>JButton okButton = new JButton(createOkAction());<NEW_LINE>builder.addFixed(okButton);<NEW_LINE>builder.addRelatedGap();<NEW_LINE>builder.addFixed(new JButton(new CancelAction()));<NEW_LINE>builder.setBorder(BorderFactory.createEmptyBorder(1<MASK><NEW_LINE>contentPanel.add(builder.getPanel(), BorderLayout.SOUTH);<NEW_LINE>configurationDialog.setContentPane(contentPanel);<NEW_LINE>configurationDialog.setSize(800, 600);<NEW_LINE>configurationDialog.setModal(true);<NEW_LINE>UISupport.initDialogActions(configurationDialog, showOnlineHelpAction, okButton);<NEW_LINE>} | , 5, 5, 5)); |
150,767 | public Object prepareModel(T[] nodes) {<NEW_LINE>Map<File, Collection<T>> sortedNodes = new HashMap<File<MASK><NEW_LINE>for (T n : nodes) {<NEW_LINE>File root = n.getFileNode().getRoot();<NEW_LINE>if (root == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Collection<T> repositorySetups = sortedNodes.get(root);<NEW_LINE>if (repositorySetups == null) {<NEW_LINE>repositorySetups = new TreeSet<>(new PathComparator());<NEW_LINE>sortedNodes.put(root, repositorySetups);<NEW_LINE>}<NEW_LINE>repositorySetups.add(n);<NEW_LINE>}<NEW_LINE>Node rootNode;<NEW_LINE>Class<?> type = nodes.getClass().getComponentType();<NEW_LINE>if (sortedNodes.size() == 1) {<NEW_LINE>Map.Entry<File, Collection<T>> e = sortedNodes.entrySet().iterator().next();<NEW_LINE>rootNode = new RepositoryRootNode(e.getKey(), toArray(e.getValue(), type));<NEW_LINE>((TreeViewChildren) rootNode.getChildren()).buildSubNodes(type);<NEW_LINE>} else {<NEW_LINE>rootNode = new RootNode(sortedNodes);<NEW_LINE>((TreeViewChildren) rootNode.getChildren()).buildSubNodes(type);<NEW_LINE>}<NEW_LINE>return rootNode;<NEW_LINE>} | , Collection<T>>(); |
1,054,450 | private void buildItems() {<NEW_LINE>totalPrice = 0;<NEW_LINE>List<LootTrackerItem> items = this.items;<NEW_LINE>if (hideIgnoredItems) {<NEW_LINE>items = items.stream().filter(item -> !item.isIgnored()).collect(Collectors.toList());<NEW_LINE>}<NEW_LINE>boolean isHidden = items.isEmpty();<NEW_LINE>setVisible(!isHidden);<NEW_LINE>if (isHidden) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ToLongFunction<LootTrackerItem> getPrice = priceType == LootTrackerPriceType.HIGH_ALCHEMY ? LootTrackerItem::getTotalHaPrice : LootTrackerItem::getTotalGePrice;<NEW_LINE>totalPrice = items.stream().mapToLong(getPrice).sum();<NEW_LINE>items.sort(Comparator.comparingLong(getPrice).reversed());<NEW_LINE>// Calculates how many rows need to be display to fit all items<NEW_LINE>final int rowSize = ((items.size() % ITEMS_PER_ROW == 0) ? 0 : 1) + items.size() / ITEMS_PER_ROW;<NEW_LINE>itemContainer.removeAll();<NEW_LINE>itemContainer.setLayout(new GridLayout(rowSize, ITEMS_PER_ROW, 1, 1));<NEW_LINE>final EmptyBorder emptyBorder = new EmptyBorder(5, 5, 5, 5);<NEW_LINE>for (int i = 0; i < rowSize * ITEMS_PER_ROW; i++) {<NEW_LINE>final JPanel slotContainer = new JPanel();<NEW_LINE>slotContainer.setBackground(ColorScheme.DARKER_GRAY_COLOR);<NEW_LINE>if (i < items.size()) {<NEW_LINE>final LootTrackerItem item = items.get(i);<NEW_LINE>final JLabel imageLabel = new JLabel();<NEW_LINE>imageLabel.setToolTipText(buildToolTip(item));<NEW_LINE>imageLabel.setVerticalAlignment(SwingConstants.CENTER);<NEW_LINE><MASK><NEW_LINE>AsyncBufferedImage itemImage = itemManager.getImage(item.getId(), item.getQuantity(), item.getQuantity() > 1);<NEW_LINE>if (item.isIgnored()) {<NEW_LINE>Runnable addTransparency = () -> {<NEW_LINE>BufferedImage transparentImage = ImageUtil.alphaOffset(itemImage, .3f);<NEW_LINE>imageLabel.setIcon(new ImageIcon(transparentImage));<NEW_LINE>};<NEW_LINE>itemImage.onLoaded(addTransparency);<NEW_LINE>addTransparency.run();<NEW_LINE>} else {<NEW_LINE>itemImage.addTo(imageLabel);<NEW_LINE>}<NEW_LINE>slotContainer.add(imageLabel);<NEW_LINE>// Create popup menu<NEW_LINE>final JPopupMenu popupMenu = new JPopupMenu();<NEW_LINE>popupMenu.setBorder(emptyBorder);<NEW_LINE>slotContainer.setComponentPopupMenu(popupMenu);<NEW_LINE>final JMenuItem toggle = new JMenuItem("Toggle item");<NEW_LINE>toggle.addActionListener(e -> {<NEW_LINE>item.setIgnored(!item.isIgnored());<NEW_LINE>onItemToggle.accept(item.getName(), item.isIgnored());<NEW_LINE>});<NEW_LINE>popupMenu.add(toggle);<NEW_LINE>}<NEW_LINE>itemContainer.add(slotContainer);<NEW_LINE>}<NEW_LINE>itemContainer.revalidate();<NEW_LINE>} | imageLabel.setHorizontalAlignment(SwingConstants.CENTER); |
1,104,686 | private JPanel separationTab(AxialStage stage) {<NEW_LINE>JPanel panel = new JPanel(new MigLayout("fill"));<NEW_LINE>// Select separation event<NEW_LINE>panel.add(new StyledLabel(trans.get("StageConfig.separation.lbl.title") + " " + CommonStrings.dagger, Style.BOLD), "spanx, wrap rel");<NEW_LINE>StageSeparationConfiguration sepConfig = stage.getSeparationConfiguration();<NEW_LINE>JComboBox<?> combo = new JComboBox<StageSeparationConfiguration.SeparationEvent>(new EnumModel<StageSeparationConfiguration.SeparationEvent>(sepConfig, "SeparationEvent", SeparationEvent.values()));<NEW_LINE>// combo.setSelectedItem(sepConfig);<NEW_LINE>panel.add(combo, "");<NEW_LINE>// ... and delay<NEW_LINE>panel.add(new JLabel(trans.get("StageConfig.separation.lbl.plus")), "");<NEW_LINE>DoubleModel dm = new DoubleModel(sepConfig, "SeparationDelay", 0);<NEW_LINE>JSpinner spin = new JSpinner(dm.getSpinnerModel());<NEW_LINE>spin.setEditor(new SpinnerEditor(spin));<NEW_LINE>panel.add(spin, "width 45");<NEW_LINE>// // seconds<NEW_LINE>panel.add(new JLabel(trans.<MASK><NEW_LINE>panel.add(new StyledLabel(CommonStrings.override_description, -1), "spanx, wrap para");<NEW_LINE>return panel;<NEW_LINE>} | get("StageConfig.separation.lbl.seconds")), "wrap unrel"); |
485,141 | public void actionPerformed(ActionEvent e) {<NEW_LINE>Frame f = ProtegeManager.getInstance().getFrame(getWorkspace());<NEW_LINE>int val = JOptionPane.showConfirmDialog(f, "This will create an empty ontology in the current set of\n" + "ontologies. Press OK to continue.", "Create empty ontology.", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);<NEW_LINE>if (val != JOptionPane.OK_OPTION) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CreateOntologyWizard wizard = new CreateOntologyWizard(f, getOWLEditorKit());<NEW_LINE>if (wizard.showModalDialog() == Wizard.CANCEL_RETURN_CODE) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>OWLOntologyID ontologyID = wizard.getOntologyID();<NEW_LINE>if (ontologyID != null) {<NEW_LINE>try {<NEW_LINE>OWLOntology ont = getOWLModelManager().createNewOntology(<MASK><NEW_LINE>getOWLModelManager().getOWLOntologyManager().setOntologyFormat(ont, wizard.getFormat());<NEW_LINE>} catch (OWLOntologyCreationException e1) {<NEW_LINE>throw new OWLRuntimeException(e1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ontologyID, wizard.getLocationURI()); |
1,521,738 | private MRMA createCounterDoc() {<NEW_LINE>// Is this a counter doc ?<NEW_LINE>if (getRef_RMA_ID() > 0)<NEW_LINE>return null;<NEW_LINE>// Org Must be linked to BPartner<NEW_LINE>MOrg org = MOrg.get(getCtx(), getAD_Org_ID());<NEW_LINE>int counterC_BPartner_ID = org.getLinkedC_BPartner_ID(get_TrxName());<NEW_LINE>if (counterC_BPartner_ID == 0)<NEW_LINE>return null;<NEW_LINE>// Business Partner needs to be linked to Org<NEW_LINE>MBPartner bp = new MBPartner(getCtx(), getC_BPartner_ID(), get_TrxName());<NEW_LINE>int counterAD_Org_ID = bp.getAD_OrgBP_ID_Int();<NEW_LINE>if (counterAD_Org_ID == 0)<NEW_LINE>return null;<NEW_LINE>// Document Type<NEW_LINE>int C_DocTypeTarget_ID = 0;<NEW_LINE>MDocTypeCounter counterDT = MDocTypeCounter.getCounterDocType(getCtx(), getC_DocType_ID());<NEW_LINE>if (counterDT != null) {<NEW_LINE>log.<MASK><NEW_LINE>if (!counterDT.isCreateCounter() || !counterDT.isValid())<NEW_LINE>return null;<NEW_LINE>C_DocTypeTarget_ID = counterDT.getCounter_C_DocType_ID();<NEW_LINE>} else // indirect<NEW_LINE>{<NEW_LINE>C_DocTypeTarget_ID = MDocTypeCounter.getCounterDocType_ID(getCtx(), getC_DocType_ID());<NEW_LINE>log.fine("Indirect C_DocTypeTarget_ID=" + C_DocTypeTarget_ID);<NEW_LINE>if (C_DocTypeTarget_ID <= 0)<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Deep Copy<NEW_LINE>MRMA counter = copyFrom(this, C_DocTypeTarget_ID, !isSOTrx(), true, get_TrxName());<NEW_LINE>//<NEW_LINE>counter.setAD_Org_ID(counterAD_Org_ID);<NEW_LINE>counter.setC_BPartner_ID(counterC_BPartner_ID);<NEW_LINE>counter.saveEx(get_TrxName());<NEW_LINE>// Update copied lines<NEW_LINE>MRMALine[] counterLines = counter.getLines(true);<NEW_LINE>for (int i = 0; i < counterLines.length; i++) {<NEW_LINE>MRMALine counterLine = counterLines[i];<NEW_LINE>counterLine.setClientOrg(counter);<NEW_LINE>//<NEW_LINE>counterLine.saveEx(get_TrxName());<NEW_LINE>}<NEW_LINE>log.fine(counter.toString());<NEW_LINE>// Document Action<NEW_LINE>if (counterDT != null) {<NEW_LINE>if (counterDT.getDocAction() != null) {<NEW_LINE>counter.setDocAction(counterDT.getDocAction());<NEW_LINE>counter.processIt(counterDT.getDocAction());<NEW_LINE>counter.saveEx(get_TrxName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return counter;<NEW_LINE>} | fine(counterDT.toString()); |
480,081 | public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {<NEW_LINE>builder.startObject("adaptive_selection");<NEW_LINE>Set<String> allNodeIds = Sets.union(clientOutgoingConnections.keySet(), nodeComputedStats.keySet());<NEW_LINE>for (String nodeId : allNodeIds) {<NEW_LINE>builder.startObject(nodeId);<NEW_LINE>ResponseCollectorService.ComputedNodeStats <MASK><NEW_LINE>if (stats != null) {<NEW_LINE>long outgoingSearches = clientOutgoingConnections.getOrDefault(nodeId, 0L);<NEW_LINE>builder.field("outgoing_searches", outgoingSearches);<NEW_LINE>builder.field("avg_queue_size", stats.queueSize);<NEW_LINE>if (builder.humanReadable()) {<NEW_LINE>builder.field("avg_service_time", new TimeValue((long) stats.serviceTime, TimeUnit.NANOSECONDS).toString());<NEW_LINE>}<NEW_LINE>builder.field("avg_service_time_ns", (long) stats.serviceTime);<NEW_LINE>if (builder.humanReadable()) {<NEW_LINE>builder.field("avg_response_time", new TimeValue((long) stats.responseTime, TimeUnit.NANOSECONDS).toString());<NEW_LINE>}<NEW_LINE>builder.field("avg_response_time_ns", (long) stats.responseTime);<NEW_LINE>builder.field("rank", String.format(Locale.ROOT, "%.1f", stats.rank(outgoingSearches)));<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>}<NEW_LINE>builder.endObject();<NEW_LINE>return builder;<NEW_LINE>} | stats = nodeComputedStats.get(nodeId); |
639,160 | public <X> Arguments16Validator<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, X> apply(Function16<? super R1, ? super R2, ? super R3, ? super R4, ? super R5, ? super R6, ? super R7, ? super R8, ? super R9, ? super R10, ? super R11, ? super R12, ? super R13, ? super R14, ? super R15, ? super R16, ? extends X> f) {<NEW_LINE>return (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, locale, constraintContext) -> Validations.apply(f::apply, this.v1.validate(a1, locale, constraintContext), this.v2.validate(a2, locale, constraintContext), this.v3.validate(a3, locale, constraintContext), this.v4.validate(a4, locale, constraintContext), this.v5.validate(a5, locale, constraintContext), this.v6.validate(a6, locale, constraintContext), this.v7.validate(a7, locale, constraintContext), this.v8.validate(a8, locale, constraintContext), this.v9.validate(a9, locale, constraintContext), this.v10.validate(a10, locale, constraintContext), this.v11.validate(a11, locale, constraintContext), this.v12.validate(a12, locale, constraintContext), this.v13.validate(a13, locale, constraintContext), this.v14.validate(a14, locale, constraintContext), this.v15.validate(a15, locale, constraintContext), this.v16.validate<MASK><NEW_LINE>} | (a16, locale, constraintContext)); |
1,557,140 | private void loadNode191() {<NEW_LINE>BaseDataVariableTypeNode node = new BaseDataVariableTypeNode(this.context, Identifiers.SessionDiagnosticsArrayType_SessionDiagnostics_DeleteNodesCount, new QualifiedName(0, "DeleteNodesCount"), new LocalizedText("en", "DeleteNodesCount"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.ServiceCounterDataType, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsArrayType_SessionDiagnostics_DeleteNodesCount, Identifiers.HasTypeDefinition, Identifiers.BaseDataVariableType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsArrayType_SessionDiagnostics_DeleteNodesCount, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsArrayType_SessionDiagnostics_DeleteNodesCount, Identifiers.HasComponent, Identifiers.SessionDiagnosticsArrayType_SessionDiagnostics<MASK><NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), false)); |
1,178,418 | private static byte[] MFcrypt(byte[] P, byte[] S, int N, int r, int p, int dkLen) {<NEW_LINE>int MFLenBytes = r * 128;<NEW_LINE>byte[] bytes = SingleIterationPBKDF2(P, S, p * MFLenBytes);<NEW_LINE>int[] B = null;<NEW_LINE>try {<NEW_LINE>int BLen = bytes.length >>> 2;<NEW_LINE>B = new int[BLen];<NEW_LINE>Pack.littleEndianToInt(bytes, 0, B);<NEW_LINE>int d = 0, total = N * r;<NEW_LINE>while ((N - d) > 2 && total > (1 << 10)) {<NEW_LINE>++d;<NEW_LINE>total >>>= 1;<NEW_LINE>}<NEW_LINE>int MFLenWords = MFLenBytes >>> 2;<NEW_LINE>for (int BOff = 0; BOff < BLen; BOff += MFLenWords) {<NEW_LINE>// TODO These can be done in parallel threads<NEW_LINE>SMix(B, <MASK><NEW_LINE>}<NEW_LINE>Pack.intToLittleEndian(B, bytes, 0);<NEW_LINE>return SingleIterationPBKDF2(P, bytes, dkLen);<NEW_LINE>} finally {<NEW_LINE>Clear(bytes);<NEW_LINE>Clear(B);<NEW_LINE>}<NEW_LINE>} | BOff, N, d, r); |
323,187 | private void checkBigIndel(final List<CigarElement> cigarElements, final GATKRead read, final List<BreakpointEvidence> evidenceList) {<NEW_LINE><MASK><NEW_LINE>for (final CigarElement ele : cigarElements) {<NEW_LINE>final CigarOperator op = ele.getOperator();<NEW_LINE>if (ele.getLength() >= MIN_INDEL_LEN) {<NEW_LINE>if (op == CigarOperator.INSERTION) {<NEW_LINE>evidenceList.add(new BreakpointEvidence.LargeIndel(read, readMetadata, locus));<NEW_LINE>} else if (op == CigarOperator.DELETION) {<NEW_LINE>evidenceList.add(new BreakpointEvidence.LargeIndel(read, readMetadata, locus + ele.getLength() / 2));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (op.consumesReferenceBases()) {<NEW_LINE>locus += ele.getLength();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int locus = read.getStart(); |
1,450,575 | public long nextZero(final long index) {<NEW_LINE>if (index >= length)<NEW_LINE>return -1;<NEW_LINE>final long[] bits = this.bits;<NEW_LINE>final long words = numWords(length);<NEW_LINE><MASK><NEW_LINE>long maskedFirstWord = bits[from] | (1L << bit(index)) - 1;<NEW_LINE>if (maskedFirstWord != 0xFFFFFFFFFFFFFFFFL) {<NEW_LINE>final long result = from * BITS_PER_WORD + Fast.leastSignificantBit(~maskedFirstWord);<NEW_LINE>return result >= length ? -1 : result;<NEW_LINE>}<NEW_LINE>for (int i = from + 1; i < words; i++) if (bits[i] != 0xFFFFFFFFFFFFFFFFL) {<NEW_LINE>final long result = i * BITS_PER_WORD + Fast.leastSignificantBit(~bits[i]);<NEW_LINE>return result >= length ? -1 : result;<NEW_LINE>}<NEW_LINE>return -1;<NEW_LINE>} | final int from = word(index); |
1,150,303 | public boolean sendRequest(RestRequest originalRequest, RestRequest darkRequest, RequestContext originalRequestContext, int numRequestDuplicates) {<NEW_LINE>boolean requestSent = false;<NEW_LINE>Callback<RestResponse> callback = new Callback<RestResponse>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(RestResponse result) {<NEW_LINE>_successCount.incrementAndGet();<NEW_LINE>// Result of request is discarded if verifier is not enabled<NEW_LINE>_verifierManager.onDarkResponse(originalRequest, result, _darkClusterName);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Throwable e) {<NEW_LINE>_exceptionCount.incrementAndGet();<NEW_LINE>_notifier.notify(() -> new RuntimeException("Got error response for: " + darkRequest.getURI() + " from source host " + originalRequest.getURI(), e));<NEW_LINE>String exceptionName = e<MASK><NEW_LINE>if (e.getCause() != null) {<NEW_LINE>exceptionName += "/" + e.getCause().getClass().getSimpleName();<NEW_LINE>}<NEW_LINE>AtomicInteger oldCount = _exceptionCountMap.putIfAbsent(exceptionName, new AtomicInteger(1));<NEW_LINE>if (oldCount != null) {<NEW_LINE>oldCount.incrementAndGet();<NEW_LINE>}<NEW_LINE>_verifierManager.onDarkError(originalRequest, e, _darkClusterName);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>for (int i = 0; i < numRequestDuplicates; i++) {<NEW_LINE>_requestCount.incrementAndGet();<NEW_LINE>if (_dispatcher.sendRequest(originalRequest, darkRequest, originalRequestContext, _darkClusterName, callback)) {<NEW_LINE>requestSent = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return requestSent;<NEW_LINE>} | .getClass().getSimpleName(); |
1,757,316 | public CompletableFuture<QueryResponse> onQuery(final QueryRequest request) {<NEW_LINE>raft.checkThread();<NEW_LINE>logRequest(request);<NEW_LINE>// If this server has not yet applied entries up to the client's session ID, forward the<NEW_LINE>// query to the leader. This ensures that a follower does not tell the client its session<NEW_LINE>// doesn't exist if the follower hasn't had a chance to see the session's registration entry.<NEW_LINE>if (raft.getLastApplied() < request.session()) {<NEW_LINE>return CompletableFuture.completedFuture(logResponse(QueryResponse.builder().withStatus(RaftResponse.Status.ERROR).withError(RaftError.Type.UNKNOWN_SESSION, "Session has not yet been created. You're seeing into the future!").build()));<NEW_LINE>}<NEW_LINE>// Look up the client's session.<NEW_LINE>RaftSession session = raft.getSessions().getSession(request.session());<NEW_LINE>if (session == null) {<NEW_LINE>log.warn("Unknown session {}", request.session());<NEW_LINE>return CompletableFuture.completedFuture(logResponse(QueryResponse.builder().withStatus(RaftResponse.Status.ERROR).withError(RaftError.Type.UNKNOWN_SESSION).build()));<NEW_LINE>}<NEW_LINE>final Indexed<QueryEntry> entry = new Indexed<>(request.index(), new QueryEntry(raft.getTerm(), System.currentTimeMillis(), request.session(), request.sequenceNumber(), request<MASK><NEW_LINE>final CompletableFuture<QueryResponse> future;<NEW_LINE>switch(session.readConsistency()) {<NEW_LINE>case SEQUENTIAL:<NEW_LINE>future = queryLocal(entry);<NEW_LINE>break;<NEW_LINE>case LINEARIZABLE_LEASE:<NEW_LINE>future = queryBoundedLinearizable(entry);<NEW_LINE>break;<NEW_LINE>case LINEARIZABLE:<NEW_LINE>future = queryLinearizable(entry);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>future = Futures.exceptionalFuture(new IllegalStateException("Unknown consistency level: " + session.readConsistency()));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return future.thenApply(this::logResponse);<NEW_LINE>} | .operation()), 0); |
277,996 | public com.amazonaws.services.codedeploy.model.GitHubAccountTokenDoesNotExistException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.codedeploy.model.GitHubAccountTokenDoesNotExistException gitHubAccountTokenDoesNotExistException = new com.amazonaws.services.codedeploy.model.GitHubAccountTokenDoesNotExistException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return gitHubAccountTokenDoesNotExistException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,070,850 | public static Map<String, String> establishComposedTaskProperties(Map<String, String> taskDeploymentProperties, TaskNode taskNode) {<NEW_LINE>Assert.notNull(taskDeploymentProperties, "taskDeploymentProperties must not be null");<NEW_LINE>Assert.notNull(taskNode, "taskNode must not be null");<NEW_LINE>String result = "";<NEW_LINE>Map<String, String> taskAppProperties = new HashMap<>();<NEW_LINE>for (TaskApp subTask : taskNode.getTaskApps()) {<NEW_LINE>result = updateProperties(taskNode, subTask, taskDeploymentProperties, result, "app");<NEW_LINE>result = updateProperties(taskNode, subTask, taskDeploymentProperties, result, "deployer");<NEW_LINE>result = updateVersionProperties(taskNode, subTask, taskDeploymentProperties, result);<NEW_LINE>taskAppProperties.putAll(getTaskAppProperties(taskNode<MASK><NEW_LINE>taskAppProperties.putAll(getTaskAppProperties(taskNode, subTask, taskDeploymentProperties, "deployer"));<NEW_LINE>}<NEW_LINE>if (result.length() != 0) {<NEW_LINE>taskDeploymentProperties.put("app.composed-task-runner.composed-task-properties", result);<NEW_LINE>}<NEW_LINE>taskAppProperties.entrySet().stream().forEach(e -> {<NEW_LINE>taskDeploymentProperties.put("app.composed-task-runner.composed-task-app-properties." + Base64Utils.encode(e.getKey()), e.getValue());<NEW_LINE>});<NEW_LINE>return taskDeploymentProperties;<NEW_LINE>} | , subTask, taskDeploymentProperties, "app")); |
486,367 | private void loadNetworkSettings() {<NEW_LINE>Config config = Config.getInstance();<NEW_LINE>cmbSeg.setSelectedItem(config.getMaxSegments() + "");<NEW_LINE>cmbTimeout.setSelectedItem(config.getNetworkTimeout() > 1 ? config.getNetworkTimeout() + "" : "N/A");<NEW_LINE>String val = "Default";<NEW_LINE><MASK><NEW_LINE>if (ival > 0) {<NEW_LINE>val = ival + "";<NEW_LINE>}<NEW_LINE>cmbTcp.setSelectedItem(val);<NEW_LINE>// txtSpeedLimit.setText(config.getSpeedLimit() < 1 ? "N/A" :<NEW_LINE>// config.getSpeedLimit() + "");<NEW_LINE>int proxyMode = config.getProxyMode();<NEW_LINE>if (proxyMode == 0) {<NEW_LINE>chkUsePac.setSelected(false);<NEW_LINE>chkUseProxy.setSelected(false);<NEW_LINE>chkUseSocks.setSelected(false);<NEW_LINE>} else if (proxyMode == 1) {<NEW_LINE>chkUsePac.setSelected(true);<NEW_LINE>} else if (proxyMode == 2) {<NEW_LINE>chkUseProxy.setSelected(true);<NEW_LINE>} else if (proxyMode == 3) {<NEW_LINE>chkUseSocks.setSelected(true);<NEW_LINE>}<NEW_LINE>txtPACUrl.setText(config.getProxyPac());<NEW_LINE>if (config.getProxyHost() == null || config.getProxyHost().length() < 1) {<NEW_LINE>txtProxyHostnPort.setText("");<NEW_LINE>} else {<NEW_LINE>txtProxyHostnPort.setText(config.getProxyHost() + (config.getProxyPort() > 0 ? ":" + config.getProxyPort() : ""));<NEW_LINE>}<NEW_LINE>if (config.getSocksHost() == null || config.getSocksHost().length() < 1) {<NEW_LINE>txtSocksHostnPort.setText("");<NEW_LINE>} else {<NEW_LINE>txtSocksHostnPort.setText(config.getSocksHost() + (config.getSocksPort() > 0 ? ":" + config.getSocksPort() : ""));<NEW_LINE>}<NEW_LINE>if (config.getProxyUser() == null || config.getProxyUser().length() < 1) {<NEW_LINE>txtProxyUser.setText("");<NEW_LINE>txtProxyPass.setText("");<NEW_LINE>} else {<NEW_LINE>txtProxyUser.setText(config.getProxyUser());<NEW_LINE>if (config.getProxyPass() == null || config.getProxyPass().length() < 1) {<NEW_LINE>txtProxyPass.setText("");<NEW_LINE>} else {<NEW_LINE>txtProxyPass.setText(config.getProxyPass());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | int ival = config.getTcpWindowSize(); |
1,259,804 | final ListLogPatternSetsResult executeListLogPatternSets(ListLogPatternSetsRequest listLogPatternSetsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listLogPatternSetsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListLogPatternSetsRequest> request = null;<NEW_LINE>Response<ListLogPatternSetsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListLogPatternSetsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listLogPatternSetsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Insights");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListLogPatternSets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListLogPatternSetsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListLogPatternSetsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
1,800,890 | final ListReadinessChecksResult executeListReadinessChecks(ListReadinessChecksRequest listReadinessChecksRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listReadinessChecksRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListReadinessChecksRequest> request = null;<NEW_LINE>Response<ListReadinessChecksResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListReadinessChecksRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listReadinessChecksRequest));<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, "Route53 Recovery Readiness");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListReadinessChecks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListReadinessChecksResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListReadinessChecksResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,212,619 | public void register(List<ThreadPoolAdapterCacheConfig> requestParameter) {<NEW_LINE>synchronized (ThreadPoolAdapterService.class) {<NEW_LINE>for (ThreadPoolAdapterCacheConfig each : requestParameter) {<NEW_LINE>String mark = each.getMark();<NEW_LINE>Map<String, Map<String, List<ThreadPoolAdapterState>>> actual = THREAD_POOL_ADAPTER_MAP.get(mark);<NEW_LINE>if (CollectionUtil.isEmpty(actual)) {<NEW_LINE>actual = Maps.newHashMap();<NEW_LINE>THREAD_POOL_ADAPTER_MAP.put(mark, actual);<NEW_LINE>}<NEW_LINE>Map<String, List<ThreadPoolAdapterState>> tenantItemMap = actual.get(each.getTenantItemKey());<NEW_LINE>if (CollectionUtil.isEmpty(tenantItemMap)) {<NEW_LINE>tenantItemMap = Maps.newHashMap();<NEW_LINE>actual.put(each.getTenantItemKey(), tenantItemMap);<NEW_LINE>}<NEW_LINE>List<ThreadPoolAdapterState> threadPoolAdapterStates = each.getThreadPoolAdapterStates();<NEW_LINE>for (ThreadPoolAdapterState adapterState : threadPoolAdapterStates) {<NEW_LINE>List<ThreadPoolAdapterState> adapterStateList = tenantItemMap.<MASK><NEW_LINE>if (CollectionUtil.isEmpty(adapterStateList)) {<NEW_LINE>adapterStateList = Lists.newArrayList();<NEW_LINE>tenantItemMap.put(adapterState.getThreadPoolKey(), adapterStateList);<NEW_LINE>}<NEW_LINE>Optional<ThreadPoolAdapterState> first = adapterStateList.stream().filter(state -> Objects.equals(state.getClientAddress(), each.getClientAddress())).findFirst();<NEW_LINE>if (!first.isPresent()) {<NEW_LINE>ThreadPoolAdapterState state = new ThreadPoolAdapterState();<NEW_LINE>state.setClientAddress(each.getClientAddress());<NEW_LINE>state.setIdentify(each.getClientIdentify());<NEW_LINE>adapterStateList.add(state);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | get(adapterState.getThreadPoolKey()); |
1,423,020 | public CalciteContextException newValidationError(SqlNode node, Resources.ExInst<SqlValidatorException> e) {<NEW_LINE>assert node != null;<NEW_LINE>CalciteContextException exception = SqlUtil.newContextException(<MASK><NEW_LINE>if (OBJECT_NOT_FOUND.equals(ResourceUtil.key(e)) || OBJECT_NOT_FOUND_WITHIN.equals(ResourceUtil.key(e))) {<NEW_LINE>Object[] arguments = ResourceUtil.args(e);<NEW_LINE>String identifier = (arguments != null && arguments.length > 0) ? String.valueOf(arguments[0]) : null;<NEW_LINE>Mapping mapping = identifier != null ? iMapResolver.resolve(identifier) : null;<NEW_LINE>String sql = mapping != null ? SqlCreateMapping.unparse(mapping) : null;<NEW_LINE>String message = sql != null ? ValidatorResource.imapNotMapped(e.str(), identifier, sql) : e.str();<NEW_LINE>throw QueryException.error(SqlErrorCode.OBJECT_NOT_FOUND, message, exception, sql);<NEW_LINE>}<NEW_LINE>return exception;<NEW_LINE>} | node.getParserPosition(), e); |
1,402,183 | private static Profile profileFromAnnotationComponent(@NullAllowed final AnnotationComponent ac) {<NEW_LINE>if (ac == null) {<NEW_LINE>return Profile.COMPACT1;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final ElementValue ev = ac.getValue();<NEW_LINE>if (!(ev instanceof PrimitiveElementValue)) {<NEW_LINE>return Profile.COMPACT1;<NEW_LINE>}<NEW_LINE>final CPEntry cpEntry = ((PrimitiveElementValue) ev).getValue();<NEW_LINE>if (cpEntry.getTag() != 3) {<NEW_LINE>return Profile.COMPACT1;<NEW_LINE>}<NEW_LINE>final int ordinal = <MASK><NEW_LINE>if (ordinal <= 0) {<NEW_LINE>return Profile.COMPACT1;<NEW_LINE>}<NEW_LINE>final Profile[] values = Profile.values();<NEW_LINE>if (ordinal >= values.length) {<NEW_LINE>return Profile.DEFAULT;<NEW_LINE>}<NEW_LINE>return values[ordinal - 1];<NEW_LINE>} catch (NumberFormatException nfe) {<NEW_LINE>return Profile.COMPACT1;<NEW_LINE>}<NEW_LINE>} | (Integer) cpEntry.getValue(); |
98,790 | public void actionPerformed(ActionEvent event) {<NEW_LINE>TestStep testStep = getAssertable().getTestStep();<NEW_LINE>MessageExchange exchange = null;<NEW_LINE>if (testStep instanceof WsdlTestRequestStep) {<NEW_LINE>exchange = new WsdlResponseMessageExchange(((WsdlTestRequestStep) testStep).getTestRequest());<NEW_LINE>} else if (testStep instanceof RestTestRequestStepInterface) {<NEW_LINE>exchange = new RestResponseMessageExchange(((RestRequestInterface) ((RestTestRequestStepInterface) testStep).getTestRequest()));<NEW_LINE>} else if (testStep instanceof HttpTestRequestStepInterface) {<NEW_LINE>exchange = new HttpResponseMessageExchange(((HttpTestRequestStepInterface<MASK><NEW_LINE>} else if (testStep instanceof WsdlMockResponseTestStep) {<NEW_LINE>exchange = new WsdlMockResponseMessageExchange(((WsdlMockResponseTestStep) testStep).getMockResponse());<NEW_LINE>} else if (testStep instanceof JdbcRequestTestStep) {<NEW_LINE>JdbcRequestTestStep jdbcRequestTestStep = (JdbcRequestTestStep) testStep;<NEW_LINE>exchange = new JdbcMessageExchange(jdbcRequestTestStep, jdbcRequestTestStep.getJdbcRequest().getResponse());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Logging.addAppender(logger.getName(), Logging.getAppender(Logging.GLOBAL_GROOVY_LOG));<NEW_LINE>try {<NEW_LINE>setScriptText(editor.getEditArea().getText());<NEW_LINE>String result = assertScript(exchange, new WsdlTestRunContext(testStep), logger);<NEW_LINE>UISupport.showInfoMessage("Script Assertion Passed" + ((result == null) ? "" : ": [" + result + "]"));<NEW_LINE>} finally {<NEW_LINE>Logging.removeAppender(logger.getName(), Logging.getAppender(Logging.GLOBAL_GROOVY_LOG));<NEW_LINE>}<NEW_LINE>} catch (AssertionException e) {<NEW_LINE>UISupport.showErrorMessage(e.getMessage());<NEW_LINE>} catch (Exception e) {<NEW_LINE>SoapUI.logError(e);<NEW_LINE>UISupport.showErrorMessage(e.getMessage());<NEW_LINE>}<NEW_LINE>editor.requestFocusInWindow();<NEW_LINE>} | ) testStep).getTestRequest()); |
1,654,799 | private void proposeNewMethod(char[] token, ReferenceBinding reference) {<NEW_LINE>if (!this.requestor.isIgnored(CompletionProposal.POTENTIAL_METHOD_DECLARATION)) {<NEW_LINE>int relevance = computeBaseRelevance();<NEW_LINE>relevance += computeRelevanceForResolution();<NEW_LINE>relevance += computeRelevanceForInterestingProposal();<NEW_LINE>// no access restriction for new method<NEW_LINE>relevance += computeRelevanceForRestrictions(IAccessRule.K_ACCESSIBLE);<NEW_LINE>InternalCompletionProposal proposal = createProposal(<MASK><NEW_LINE>proposal.setDeclarationSignature(getSignature(reference));<NEW_LINE>proposal.setSignature(createMethodSignature(CharOperation.NO_CHAR_CHAR, CharOperation.NO_CHAR_CHAR, CharOperation.NO_CHAR, VOID));<NEW_LINE>proposal.setDeclarationPackageName(reference.qualifiedPackageName());<NEW_LINE>proposal.setDeclarationTypeName(reference.qualifiedSourceName());<NEW_LINE>// proposal.setPackageName(null);<NEW_LINE>proposal.setTypeName(VOID);<NEW_LINE>proposal.setName(token);<NEW_LINE>// proposal.setParameterPackageNames(null);<NEW_LINE>// proposal.setParameterTypeNames(null);<NEW_LINE>// proposal.setPackageName(null);<NEW_LINE>proposal.setCompletion(token);<NEW_LINE>proposal.setFlags(Flags.AccPublic);<NEW_LINE>proposal.setReplaceRange(this.startPosition - this.offset, this.endPosition - this.offset);<NEW_LINE>proposal.setTokenRange(this.tokenStart - this.offset, this.tokenEnd - this.offset);<NEW_LINE>proposal.setRelevance(relevance);<NEW_LINE>this.requestor.accept(proposal);<NEW_LINE>if (DEBUG) {<NEW_LINE>this.printDebug(proposal);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | CompletionProposal.POTENTIAL_METHOD_DECLARATION, this.actualCompletionPosition); |
507,806 | public ColumnAnalysis fold(ColumnAnalysis rhs) {<NEW_LINE>if (rhs == null) {<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>if (isError() && rhs.isError()) {<NEW_LINE>return errorMessage.equals(rhs.getErrorMessage()) ? this : ColumnAnalysis.error("multiple_errors");<NEW_LINE>} else if (isError()) {<NEW_LINE>return this;<NEW_LINE>} else if (rhs.isError()) {<NEW_LINE>return rhs;<NEW_LINE>}<NEW_LINE>if (!Objects.equals(type, rhs.getType())) {<NEW_LINE>return ColumnAnalysis.error(StringUtils.format("cannot_merge_diff_types: [%s] and [%s]", type, rhs.getType()));<NEW_LINE>}<NEW_LINE>if (!Objects.equals(typeSignature, rhs.getTypeSignature())) {<NEW_LINE>return ColumnAnalysis.error(StringUtils.format("cannot_merge_diff_types: [%s] and [%s]", typeSignature.asTypeString(), rhs.getTypeSignature().asTypeString()));<NEW_LINE>}<NEW_LINE>Integer cardinality = getCardinality();<NEW_LINE>final Integer rhsCardinality = rhs.getCardinality();<NEW_LINE>if (cardinality == null) {<NEW_LINE>cardinality = rhsCardinality;<NEW_LINE>} else if (rhsCardinality != null) {<NEW_LINE>cardinality = Math.max(cardinality, rhsCardinality);<NEW_LINE>}<NEW_LINE>final boolean multipleValues = hasMultipleValues || rhs.isHasMultipleValues();<NEW_LINE>Comparable newMin = choose(minValue, rhs.minValue, false);<NEW_LINE>Comparable newMax = choose(maxValue, rhs.maxValue, true);<NEW_LINE>// min and max are currently set for only string columns<NEW_LINE>if (typeSignature.equals(ColumnType.STRING)) {<NEW_LINE>newMin = NullHandling.nullToEmptyIfNeeded((String) newMin);<NEW_LINE>newMax = NullHandling<MASK><NEW_LINE>}<NEW_LINE>return new ColumnAnalysis(typeSignature, type, multipleValues, hasNulls || rhs.hasNulls, size + rhs.getSize(), cardinality, newMin, newMax, null);<NEW_LINE>} | .nullToEmptyIfNeeded((String) newMax); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.