idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,379,891
void solveElastic(final TimeStep step) {<NEW_LINE>float elasticStrength = step.inv_dt * m_elasticStrength;<NEW_LINE>for (int k = 0; k < m_triadCount; k++) {<NEW_LINE>final Triad triad = m_triadBuffer[k];<NEW_LINE>if ((triad.flags & ParticleType.b2_elasticParticle) != 0) {<NEW_LINE>int a = triad.indexA;<NEW_LINE>int b = triad.indexB;<NEW_LINE>int c = triad.indexC;<NEW_LINE>final Vec2 oa = triad.pa;<NEW_LINE>final Vec2 ob = triad.pb;<NEW_LINE>final Vec2 oc = triad.pc;<NEW_LINE>final Vec2 pa = m_positionBuffer.data[a];<NEW_LINE>final Vec2 pb = m_positionBuffer.data[b];<NEW_LINE>final Vec2 pc = m_positionBuffer.data[c];<NEW_LINE>final float px = 1f / 3 * (pa.x + pb.x + pc.x);<NEW_LINE>final float py = 1f / 3 * (pa.y + pb.y + pc.y);<NEW_LINE>float rs = Vec2.cross(oa, pa) + Vec2.cross(ob, pb) + Vec2.cross(oc, pc);<NEW_LINE>float rc = Vec2.dot(oa, pa) + Vec2.dot(ob, pb) + Vec2.dot(oc, pc);<NEW_LINE>float r2 = rs * rs + rc * rc;<NEW_LINE>float invR = r2 == 0 ? Float.MAX_VALUE : MathUtils.sqrt(1f / r2);<NEW_LINE>rs *= invR;<NEW_LINE>rc *= invR;<NEW_LINE>final float strength = elasticStrength * triad.strength;<NEW_LINE>final float roax = rc * oa<MASK><NEW_LINE>final float roay = rs * oa.x + rc * oa.y;<NEW_LINE>final float robx = rc * ob.x - rs * ob.y;<NEW_LINE>final float roby = rs * ob.x + rc * ob.y;<NEW_LINE>final float rocx = rc * oc.x - rs * oc.y;<NEW_LINE>final float rocy = rs * oc.x + rc * oc.y;<NEW_LINE>final Vec2 va = m_velocityBuffer.data[a];<NEW_LINE>final Vec2 vb = m_velocityBuffer.data[b];<NEW_LINE>final Vec2 vc = m_velocityBuffer.data[c];<NEW_LINE>va.x += strength * (roax - (pa.x - px));<NEW_LINE>va.y += strength * (roay - (pa.y - py));<NEW_LINE>vb.x += strength * (robx - (pb.x - px));<NEW_LINE>vb.y += strength * (roby - (pb.y - py));<NEW_LINE>vc.x += strength * (rocx - (pc.x - px));<NEW_LINE>vc.y += strength * (rocy - (pc.y - py));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.x - rs * oa.y;
1,572,127
public void OnFileOperationComplete(FileOperationsVariants currentFileOperation, boolean fileOperationResult, String path, String tag) {<NEW_LINE>if (currentFileOperation == deleteFile && !fileOperationResult) {<NEW_LINE>Log.e(LOG_TAG, "Unable to delete file " + path);<NEW_LINE>} else if (currentFileOperation == moveBinaryFile) {<NEW_LINE>if (dialogFragment != null) {<NEW_LINE>dialogFragment.dismiss();<NEW_LINE>dialogFragment = null;<NEW_LINE>}<NEW_LINE>if (fileOperationResult) {<NEW_LINE>DialogFragment commandResult = NotificationDialogFragment.newInstance(getText(R.string.help_activity_logs_saved).toString() + " " + pathToSaveLogs);<NEW_LINE>commandResult.show(getSupportFragmentManager(), "NotificationDialogFragment");<NEW_LINE>} else {<NEW_LINE>File logs = new File(cacheDir + "/logs/InvizibleLogs.txt");<NEW_LINE>if (logs.isFile()) {<NEW_LINE>Uri uri = FileProvider.getUriForFile(this, this.<MASK><NEW_LINE>Utils.INSTANCE.sendMail(this, info, uri);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getPackageName() + ".fileprovider", logs);
181,811
protected String[] parseCommands(String content) {<NEW_LINE>Collection<String> parsedCommands = new ArrayList<String>();<NEW_LINE>BufferedReader in = new BufferedReader(new StringReader(content));<NEW_LINE>if (content.startsWith("[PresenceSimulation]")) {<NEW_LINE>// Presence Simulation event. Needs to be fired only if PresenceSimulation event is set to ON<NEW_LINE>try {<NEW_LINE>in.readLine();<NEW_LINE>} catch (IOException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String command;<NEW_LINE>while ((command = in.readLine()) != null) {<NEW_LINE>if (StringUtils.isNotBlank(command)) {<NEW_LINE>parsedCommands.add(command.trim());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>logger.error("reading event content throws exception", ioe);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>in.close();<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return parsedCommands.toArray(new String[0]);<NEW_LINE>}
logger.error("reading event content throws exception", e);
1,353,371
private void updateGrabbingState() {<NEW_LINE>boolean lastGrabbingValue = mLastGrabbingState;<NEW_LINE>mLastGrabbingState = CallbackBridge.isGrabbing();<NEW_LINE>if (lastGrabbingValue == mLastGrabbingState)<NEW_LINE>return;<NEW_LINE>// Switch grabbing state then<NEW_LINE>mCurrentMap.resetPressedState();<NEW_LINE>if (mLastGrabbingState) {<NEW_LINE>mCurrentMap = mGameMap;<NEW_LINE>mPointerImageView.setVisibility(View.INVISIBLE);<NEW_LINE>mMouseSensitivity = 18;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mCurrentMap = mMenuMap;<NEW_LINE>// removing what we were doing<NEW_LINE>sendDirectionalKeycode(mCurrentJoystickDirection, false, mGameMap);<NEW_LINE>mMouse_x = CallbackBridge.windowWidth / 2;<NEW_LINE>mMouse_y = CallbackBridge.windowHeight / 2;<NEW_LINE><MASK><NEW_LINE>placePointerView(CallbackBridge.physicalWidth / 2, CallbackBridge.physicalHeight / 2);<NEW_LINE>mPointerImageView.setVisibility(View.VISIBLE);<NEW_LINE>// Sensitivity in menu is MC and HARDWARE resolution dependent<NEW_LINE>mMouseSensitivity = 19 * mScaleFactor / mSensitivityFactor;<NEW_LINE>}
CallbackBridge.sendCursorPos(mMouse_x, mMouse_y);
1,656,209
private void connect(ActionEvent evt) {<NEW_LINE>connectButton.setEnabled(false);<NEW_LINE>for (Map.Entry<Property<?>, PropertyEditor> ent : propertyEditors.entrySet()) {<NEW_LINE>Property<?> prop = ent.getKey();<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Property<Object> objProp = (Property<Object>) prop;<NEW_LINE>objProp.setValue(ent.getValue().getValue());<NEW_LINE>}<NEW_LINE>setStatusText("Connecting...");<NEW_LINE>synchronized (this) {<NEW_LINE>futureConnect = factory.build();<NEW_LINE>}<NEW_LINE>futureConnect.thenAcceptAsync(m -> {<NEW_LINE>modelService.addModel(m);<NEW_LINE>setStatusText("");<NEW_LINE>close();<NEW_LINE>modelService.activateModel(m);<NEW_LINE>synchronized (this) {<NEW_LINE>result.completeAsync(() -> m);<NEW_LINE>result = null;<NEW_LINE>}<NEW_LINE>}, SwingExecutorService.LATER).exceptionally(e -> {<NEW_LINE><MASK><NEW_LINE>if (!(e instanceof CancellationException)) {<NEW_LINE>Msg.showError(this, getComponent(), "Could not connect", e);<NEW_LINE>}<NEW_LINE>setStatusText("Could not connect: " + e.getMessage(), MessageType.ERROR);<NEW_LINE>return null;<NEW_LINE>}).whenComplete((v, e) -> {<NEW_LINE>synchronized (this) {<NEW_LINE>futureConnect = null;<NEW_LINE>}<NEW_LINE>connectButton.setEnabled(true);<NEW_LINE>});<NEW_LINE>}
e = AsyncUtils.unwrapThrowable(e);
397,124
public boolean visit(MySqlKey x) {<NEW_LINE>if (x.isHasConstraint()) {<NEW_LINE>print0(ucase ? "CONSTRAINT " : "constraint ");<NEW_LINE>if (x.getName() != null) {<NEW_LINE>x.getName().accept(this);<NEW_LINE>print(' ');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String indexType = x.getIndexType();<NEW_LINE>boolean fullText = "FULLTEXT".equalsIgnoreCase(indexType);<NEW_LINE>boolean clustering = "CLUSTERING".equalsIgnoreCase(indexType);<NEW_LINE>boolean <MASK><NEW_LINE>if (fullText) {<NEW_LINE>print0(ucase ? "FULLTEXT " : "fulltext ");<NEW_LINE>} else if (clustering) {<NEW_LINE>print0(ucase ? "CLUSTERING " : "clustering ");<NEW_LINE>} else if (clustered) {<NEW_LINE>print0(ucase ? "CLUSTERED " : "CLUSTERED ");<NEW_LINE>}<NEW_LINE>print0(ucase ? "KEY" : "key");<NEW_LINE>SQLName name = x.getName();<NEW_LINE>if (name != null) {<NEW_LINE>print(' ');<NEW_LINE>name.accept(this);<NEW_LINE>}<NEW_LINE>if (indexType != null && !fullText && !clustering && !clustered) {<NEW_LINE>print0(ucase ? " USING " : " using ");<NEW_LINE>print0(indexType);<NEW_LINE>}<NEW_LINE>print0(" (");<NEW_LINE>for (int i = 0, size = x.getColumns().size(); i < size; ++i) {<NEW_LINE>if (i != 0) {<NEW_LINE>print0(", ");<NEW_LINE>}<NEW_LINE>x.getColumns().get(i).accept(this);<NEW_LINE>}<NEW_LINE>print(')');<NEW_LINE>SQLExpr comment = x.getComment();<NEW_LINE>if (comment != null) {<NEW_LINE>print0(ucase ? " COMMENT " : " comment ");<NEW_LINE>printExpr(comment);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
clustered = "CLUSTERED".equalsIgnoreCase(indexType);
942,670
public static QueryDeviceGroupTagListResponse unmarshall(QueryDeviceGroupTagListResponse queryDeviceGroupTagListResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryDeviceGroupTagListResponse.setRequestId(_ctx.stringValue("QueryDeviceGroupTagListResponse.RequestId"));<NEW_LINE>queryDeviceGroupTagListResponse.setSuccess(_ctx.booleanValue("QueryDeviceGroupTagListResponse.Success"));<NEW_LINE>queryDeviceGroupTagListResponse.setCode(_ctx.stringValue("QueryDeviceGroupTagListResponse.Code"));<NEW_LINE>queryDeviceGroupTagListResponse.setErrorMessage(_ctx.stringValue("QueryDeviceGroupTagListResponse.ErrorMessage"));<NEW_LINE>List<GroupTagInfo> data <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryDeviceGroupTagListResponse.Data.Length"); i++) {<NEW_LINE>GroupTagInfo groupTagInfo = new GroupTagInfo();<NEW_LINE>groupTagInfo.setTagKey(_ctx.stringValue("QueryDeviceGroupTagListResponse.Data[" + i + "].TagKey"));<NEW_LINE>groupTagInfo.setTagValue(_ctx.stringValue("QueryDeviceGroupTagListResponse.Data[" + i + "].TagValue"));<NEW_LINE>data.add(groupTagInfo);<NEW_LINE>}<NEW_LINE>queryDeviceGroupTagListResponse.setData(data);<NEW_LINE>return queryDeviceGroupTagListResponse;<NEW_LINE>}
= new ArrayList<GroupTagInfo>();
635,483
protected void paintComponent(Graphics g0) {<NEW_LINE>super.paintComponent(g0);<NEW_LINE>// getX();<NEW_LINE>int x = 0;<NEW_LINE>// getY();<NEW_LINE>int y = 0;<NEW_LINE>int width = getWidth();<NEW_LINE>int height = getHeight();<NEW_LINE>// layout parameters<NEW_LINE>// initialize<NEW_LINE>cachedImage = new BufferedImage(width, height, TYPE_INT_ARGB);<NEW_LINE>Graphics2D g = (Graphics2D) cachedImage.getGraphics();<NEW_LINE>g.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);<NEW_LINE>if (Lizzie.leelaz != null) {<NEW_LINE>// && Lizzie.leelaz.isLoaded()) {<NEW_LINE>if (Lizzie.config.showSubBoard) {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>if (boardParams == null || width != boardParams[0] || height != boardParams[3]) {<NEW_LINE>boardParams = subBoardRenderer.availableLength(max(width, Board.boardWidth + 5), max(height, Board.boardHeight + 5), Lizzie.config.showCoordinates, false);<NEW_LINE>}<NEW_LINE>subBoardRenderer.setBoardParam(boardParams);<NEW_LINE>subBoardRenderer.draw(g);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// This can happen when no space is left for subboard.<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// cleanup<NEW_LINE>g.dispose();<NEW_LINE>// draw the image<NEW_LINE>// TODO BufferStrategy does not support transparent background?<NEW_LINE>// bs.getDrawGraphics();<NEW_LINE>Graphics2D bsGraphics = (Graphics2D) g0;<NEW_LINE>bsGraphics.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);<NEW_LINE>bsGraphics.drawImage(cachedImage, 0, 0, null);<NEW_LINE>// cleanup<NEW_LINE>bsGraphics.dispose();<NEW_LINE>// TODO BufferStrategy does not support transparent background?<NEW_LINE>// bs.show();<NEW_LINE>}
subBoardRenderer.setLocation(x, y);
617,550
final UpdateDashboardResult executeUpdateDashboard(UpdateDashboardRequest updateDashboardRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateDashboardRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateDashboardRequest> request = null;<NEW_LINE>Response<UpdateDashboardResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateDashboardRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDashboardRequest));<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, "IoTSiteWise");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateDashboard");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "monitor.";<NEW_LINE>String resolvedHostPrefix = String.format("monitor.");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateDashboardResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDashboardResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,350,691
public void run() {<NEW_LINE>if (!ch.isClosing()) {<NEW_LINE>UserConnection userCon = new UserConnection(bungee, ch, getName(), InitialHandler.this);<NEW_LINE>userCon.setCompressionThreshold(BungeeCord.getInstance().config.getCompressionThreshold());<NEW_LINE>userCon.init();<NEW_LINE>unsafe.sendPacket(new LoginSuccess(getUniqueId(), getName()));<NEW_LINE><MASK><NEW_LINE>ch.getHandle().pipeline().get(HandlerBoss.class).setHandler(new UpstreamBridge(bungee, userCon));<NEW_LINE>bungee.getPluginManager().callEvent(new PostLoginEvent(userCon));<NEW_LINE>ServerInfo server;<NEW_LINE>if (bungee.getReconnectHandler() != null) {<NEW_LINE>server = bungee.getReconnectHandler().getServer(userCon);<NEW_LINE>} else {<NEW_LINE>server = AbstractReconnectHandler.getForcedHost(InitialHandler.this);<NEW_LINE>}<NEW_LINE>if (server == null) {<NEW_LINE>server = bungee.getServerInfo(listener.getDefaultServer());<NEW_LINE>}<NEW_LINE>userCon.connect(server, null, true, ServerConnectEvent.Reason.JOIN_PROXY);<NEW_LINE>}<NEW_LINE>}
ch.setProtocol(Protocol.GAME);
1,433,377
public static int patchBitSequence(int original, int value, int[] bitsUsed, int[] offsets) {<NEW_LINE>assert bitsUsed.length == 4 && offsets.length == 4 : "bitsUsed and offsets parameter should be of length 4";<NEW_LINE>int result = 0;<NEW_LINE>int curValue = value;<NEW_LINE>for (int i = 0; i < bitsUsed.length; i++) {<NEW_LINE>int usedBits = bitsUsed[i];<NEW_LINE>if (usedBits == 0) {<NEW_LINE>// want to retain the original value<NEW_LINE>result = result | (original & (0xFF <MASK><NEW_LINE>}<NEW_LINE>int offset = offsets[i];<NEW_LINE>int mask = (1 << usedBits) - 1;<NEW_LINE>byte patchTarget = (byte) ((original >> (8 * i)) & 0xFF);<NEW_LINE>byte patch = (byte) (((curValue & mask) << offset) & 0xFF);<NEW_LINE>byte retainedPatchTarget = (byte) (patchTarget & ((~(mask << offset)) & 0xFF));<NEW_LINE>int patchValue = (retainedPatchTarget | patch) & 0xFF;<NEW_LINE>result = result | (patchValue << (8 * i));<NEW_LINE>curValue = curValue >> usedBits;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
<< (8 * i)));
288,385
private void analyzeOrderByClause() throws AnalysisException {<NEW_LINE>if (selectStmt.getOrderByElements() == null) {<NEW_LINE>supplyOrderColumn();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<OrderByElement> orderByElements = selectStmt.getOrderByElements();<NEW_LINE>if (orderByElements.size() > mvColumnItemList.size()) {<NEW_LINE>throw new AnalysisException("The number of columns in order clause must be less then " + "the number of " + "columns in select clause");<NEW_LINE>}<NEW_LINE>if (beginIndexOfAggregation != -1 && (orderByElements.size() != (beginIndexOfAggregation))) {<NEW_LINE>throw new AnalysisException("The order-by columns must be identical to the group-by columns");<NEW_LINE>}<NEW_LINE>for (int i = 0; i < orderByElements.size(); i++) {<NEW_LINE>Expr orderByElement = orderByElements.get(i).getExpr();<NEW_LINE>if (!(orderByElement instanceof SlotRef)) {<NEW_LINE>throw new AnalysisException("The column in order clause must be original column without calculation. " + "Error column: " + orderByElement.toSql());<NEW_LINE>}<NEW_LINE>MVColumnItem mvColumnItem = mvColumnItemList.get(i);<NEW_LINE>SlotRef slotRef = (SlotRef) orderByElement;<NEW_LINE>if (!mvColumnItem.getName().equalsIgnoreCase(slotRef.getColumnName())) {<NEW_LINE>throw new AnalysisException("The order of columns in order by clause must be same as " + "the order of columns in select list");<NEW_LINE>}<NEW_LINE>Preconditions.checkState(mvColumnItem.getAggregationType() == null);<NEW_LINE>mvColumnItem.setIsKey(true);<NEW_LINE>}<NEW_LINE>// supplement none aggregate type<NEW_LINE>for (MVColumnItem mvColumnItem : mvColumnItemList) {<NEW_LINE>if (mvColumnItem.isKey()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (mvColumnItem.getAggregationType() != null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>mvColumnItem.<MASK><NEW_LINE>}<NEW_LINE>}
setAggregationType(AggregateType.NONE, true);
615,378
public Collection<V> values() {<NEW_LINE>if (values == null) {<NEW_LINE>values = new AbstractCollection<V>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>@Nonnull<NEW_LINE>public Iterator<V> iterator() {<NEW_LINE>return new MyIterator<V>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>V fieldElement(int offset) {<NEW_LINE>return offset == 0 ? v1 : offset == 1 ? v2 : v3;<NEW_LINE>}<NEW_LINE><NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>@Override<NEW_LINE>V tableElement(int offset) {<NEW_LINE>return (<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void forEach(Consumer<? super V> action) {<NEW_LINE>if (k1 != null) {<NEW_LINE>if (k2 != null) {<NEW_LINE>if (k3 != null) {<NEW_LINE>action.accept(v3);<NEW_LINE>}<NEW_LINE>action.accept(v2);<NEW_LINE>}<NEW_LINE>action.accept(v1);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < data.length; i += 2) {<NEW_LINE>Object key = data[i];<NEW_LINE>if (key != null) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>V v = (V) data[i + 1];<NEW_LINE>action.accept(v);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean contains(Object o) {<NEW_LINE>return containsValue(o);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int size() {<NEW_LINE>return UnmodifiableHashMap.this.size();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>return values;<NEW_LINE>}
V) data[offset + 1];
1,552,236
public static ListPoliciesForUserResponse unmarshall(ListPoliciesForUserResponse listPoliciesForUserResponse, UnmarshallerContext _ctx) {<NEW_LINE>listPoliciesForUserResponse.setRequestId(_ctx.stringValue("ListPoliciesForUserResponse.RequestId"));<NEW_LINE>List<Policy> policies = new ArrayList<Policy>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListPoliciesForUserResponse.Policies.Length"); i++) {<NEW_LINE>Policy policy = new Policy();<NEW_LINE>policy.setDefaultVersion(_ctx.stringValue<MASK><NEW_LINE>policy.setDescription(_ctx.stringValue("ListPoliciesForUserResponse.Policies[" + i + "].Description"));<NEW_LINE>policy.setPolicyName(_ctx.stringValue("ListPoliciesForUserResponse.Policies[" + i + "].PolicyName"));<NEW_LINE>policy.setAttachDate(_ctx.stringValue("ListPoliciesForUserResponse.Policies[" + i + "].AttachDate"));<NEW_LINE>policy.setPolicyType(_ctx.stringValue("ListPoliciesForUserResponse.Policies[" + i + "].PolicyType"));<NEW_LINE>policies.add(policy);<NEW_LINE>}<NEW_LINE>listPoliciesForUserResponse.setPolicies(policies);<NEW_LINE>return listPoliciesForUserResponse;<NEW_LINE>}
("ListPoliciesForUserResponse.Policies[" + i + "].DefaultVersion"));
1,304,648
protected void processAnswer(final VMSnapshotVO vmSnapshot, UserVm userVm, final Answer as, Long hostId) {<NEW_LINE>try {<NEW_LINE>Transaction.execute(new TransactionCallbackWithExceptionNoReturn<NoTransitionException>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void doInTransactionWithoutResult(TransactionStatus status) throws NoTransitionException {<NEW_LINE>if (as instanceof CreateVMSnapshotAnswer) {<NEW_LINE>CreateVMSnapshotAnswer answer = (CreateVMSnapshotAnswer) as;<NEW_LINE>finalizeCreate(vmSnapshot, answer.getVolumeTOs());<NEW_LINE>vmSnapshotHelper.vmSnapshotStateTransitTo(vmSnapshot, VMSnapshot.Event.OperationSucceeded);<NEW_LINE>} else if (as instanceof RevertToVMSnapshotAnswer) {<NEW_LINE>RevertToVMSnapshotAnswer answer = (RevertToVMSnapshotAnswer) as;<NEW_LINE>finalizeRevert(vmSnapshot, answer.getVolumeTOs());<NEW_LINE>vmSnapshotHelper.vmSnapshotStateTransitTo(vmSnapshot, VMSnapshot.Event.OperationSucceeded);<NEW_LINE>} else if (as instanceof DeleteVMSnapshotAnswer) {<NEW_LINE>if (as.getResult()) {<NEW_LINE>DeleteVMSnapshotAnswer answer = (DeleteVMSnapshotAnswer) as;<NEW_LINE>finalizeDelete(vmSnapshot, answer.getVolumeTOs());<NEW_LINE>vmSnapshotDao.<MASK><NEW_LINE>} else {<NEW_LINE>vmSnapshotHelper.vmSnapshotStateTransitTo(vmSnapshot, VMSnapshot.Event.OperationFailed);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>String errMsg = "Error while process answer: " + as.getClass() + " due to " + e.getMessage();<NEW_LINE>s_logger.error(errMsg, e);<NEW_LINE>throw new CloudRuntimeException(errMsg);<NEW_LINE>}<NEW_LINE>}
remove(vmSnapshot.getId());
128,225
protected void writeBarbecue(JRComponentElement componentElement, JRXmlWriter reportWriter) throws IOException {<NEW_LINE>Component component = componentElement.getComponent();<NEW_LINE>BarbecueComponent barcode = (BarbecueComponent) component;<NEW_LINE>JRXmlWriteHelper writer = reportWriter.getXmlWriteHelper();<NEW_LINE>ComponentKey componentKey = componentElement.getComponentKey();<NEW_LINE>XmlNamespace namespace = new XmlNamespace(ComponentsExtensionsRegistryFactory.NAMESPACE, componentKey.getNamespacePrefix(), ComponentsExtensionsRegistryFactory.XSD_LOCATION);<NEW_LINE>writer.startElement("barbecue", namespace);<NEW_LINE>writer.addAttribute("type", barcode.getType());<NEW_LINE>writer.addAttribute("drawText", barcode.isDrawText());<NEW_LINE>writer.addAttribute("checksumRequired", barcode.isChecksumRequired());<NEW_LINE>writer.addAttribute("barWidth", barcode.getBarWidth());<NEW_LINE>writer.addAttribute("barHeight", barcode.getBarHeight());<NEW_LINE>if (isNewerVersionOrEqual(componentElement, reportWriter, JRConstants.VERSION_4_0_0)) {<NEW_LINE>writer.addAttribute(<MASK><NEW_LINE>}<NEW_LINE>if (barcode.getEvaluationTimeValue() != EvaluationTimeEnum.NOW) {<NEW_LINE>writer.addAttribute(JRXmlConstants.ATTRIBUTE_evaluationTime, barcode.getEvaluationTimeValue());<NEW_LINE>}<NEW_LINE>writer.addAttribute(JRXmlConstants.ATTRIBUTE_evaluationGroup, barcode.getEvaluationGroup());<NEW_LINE>writeExpression("codeExpression", barcode.getCodeExpression(), false, componentElement, reportWriter);<NEW_LINE>writeExpression("applicationIdentifierExpression", barcode.getApplicationIdentifierExpression(), false, componentElement, reportWriter);<NEW_LINE>writer.closeElement();<NEW_LINE>}
"rotation", barcode.getOwnRotation());
379,336
private void installContextMenu() {<NEW_LINE>invokeLaterIfNeeded(() -> {<NEW_LINE>final DefaultActionGroup rerunActionGroup = new DefaultActionGroup();<NEW_LINE>List<AnAction> restartActions = myBuildDescriptor.getRestartActions();<NEW_LINE>rerunActionGroup.addAll(restartActions);<NEW_LINE>if (!restartActions.isEmpty()) {<NEW_LINE>rerunActionGroup.addSeparator();<NEW_LINE>}<NEW_LINE>final DefaultActionGroup sourceActionGroup = new DefaultActionGroup();<NEW_LINE>EditSourceAction edit = new EditSourceAction();<NEW_LINE>ActionUtil.copyFrom(edit, "EditSource");<NEW_LINE>sourceActionGroup.add(edit);<NEW_LINE>DefaultActionGroup <MASK><NEW_LINE>final DefaultActionGroup navigationActionGroup = new DefaultActionGroup();<NEW_LINE>final CommonActionsManager actionsManager = CommonActionsManager.getInstance();<NEW_LINE>final AnAction prevAction = actionsManager.createPrevOccurenceAction(this);<NEW_LINE>navigationActionGroup.add(prevAction);<NEW_LINE>final AnAction nextAction = actionsManager.createNextOccurenceAction(this);<NEW_LINE>navigationActionGroup.add(nextAction);<NEW_LINE>myTree.addMouseListener(new PopupHandler() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void invokePopup(Component comp, int x, int y) {<NEW_LINE>final DefaultActionGroup group = new DefaultActionGroup();<NEW_LINE>group.addAll(rerunActionGroup);<NEW_LINE>group.addAll(sourceActionGroup);<NEW_LINE>group.addSeparator();<NEW_LINE>ExecutionNode[] selectedNodes = getSelectedNodes();<NEW_LINE>if (selectedNodes.length == 1) {<NEW_LINE>ExecutionNode selectedNode = selectedNodes[0];<NEW_LINE>List<AnAction> contextActions = myBuildDescriptor.getContextActions(selectedNode);<NEW_LINE>if (!contextActions.isEmpty()) {<NEW_LINE>group.addAll(contextActions);<NEW_LINE>group.addSeparator();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>group.addAll(filteringActionsGroup);<NEW_LINE>group.addSeparator();<NEW_LINE>group.addAll(navigationActionGroup);<NEW_LINE>ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu("BuildView", group);<NEW_LINE>popupMenu.setTargetComponent(myTree);<NEW_LINE>JPopupMenu menu = popupMenu.getComponent();<NEW_LINE>menu.show(comp, x, y);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
filteringActionsGroup = BuildTreeFilters.createFilteringActionsGroup(this);
894,687
private static JSONDocumentPrintingOptions toJSONDocumentPrintingOptions(@NonNull final DocumentPrintOptionsIncludingDescriptors printOptions, @NonNull final String adLanguage) {<NEW_LINE>final ArrayList<JSONDocumentPrintingOption> jsonOptionsList = new ArrayList<>();<NEW_LINE>for (final DocumentPrintOptionDescriptor option : printOptions.getOptionDescriptors()) {<NEW_LINE>final String caption = option.getName().translate(adLanguage);<NEW_LINE>final String description = option.getDescription().translate(adLanguage);<NEW_LINE>final String internalName = option.getInternalName();<NEW_LINE>final DocumentPrintOptionValue value = printOptions.getOptionValue(internalName);<NEW_LINE>jsonOptionsList.add(JSONDocumentPrintingOption.builder().caption(caption).description(description).internalName(internalName).value(value.isTrue()).debugSourceName(value.getSourceName<MASK><NEW_LINE>}<NEW_LINE>return JSONDocumentPrintingOptions.builder().caption(TranslatableStrings.adMessage(MSG_PrintOptions_Caption).translate(adLanguage)).okButtonCaption(TranslatableStrings.adMessage(MSG_PrintOptions_OKButtonCaption).translate(adLanguage)).options(jsonOptionsList).build();<NEW_LINE>}
()).build());
1,426,769
protected List<byte[]> importState(Map<String, Object> map) {<NEW_LINE>List<byte[]> result = null;<NEW_LINE>byte[][] updated_tree = new byte[tree.length][];<NEW_LINE>synchronized (tree_lock) {<NEW_LINE>for (int i = 1; i <= piece_layer_index; i++) {<NEW_LINE>byte[] layer = (byte[]) map.get(String.valueOf(i));<NEW_LINE>if (layer != null && layer.length == tree[i].length) {<NEW_LINE>updated_tree[i] = layer;<NEW_LINE>if (i == piece_layer_index) {<NEW_LINE>result = new ArrayList<<MASK><NEW_LINE>for (int j = 0; j < layer.length; j += DIGEST_LENGTH) {<NEW_LINE>byte[] x = new byte[DIGEST_LENGTH];<NEW_LINE>System.arraycopy(layer, j, x, 0, DIGEST_LENGTH);<NEW_LINE>boolean ok = false;<NEW_LINE>for (int k = 0; k < DIGEST_LENGTH; k++) {<NEW_LINE>if (x[k] != 0) {<NEW_LINE>ok = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.add(ok ? x : null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// invalid<NEW_LINE>Debug.out("Invalid hash tree state");<NEW_LINE>return (Collections.EMPTY_LIST);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result == null) {<NEW_LINE>Debug.out("Invalid hash tree state");<NEW_LINE>return (Collections.EMPTY_LIST);<NEW_LINE>} else {<NEW_LINE>for (int i = 1; i <= piece_layer_index; i++) {<NEW_LINE>tree[i] = updated_tree[i];<NEW_LINE>}<NEW_LINE>return (result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
>(layer.length / DIGEST_LENGTH);
802,174
public void testJMS2CompletionListener() throws JMSException, InterruptedException {<NEW_LINE>clearQueue(depthLimitedQueue_);<NEW_LINE>completionListener_.reset();<NEW_LINE>try (JMSContext context = queueConnectionFactory_.createContext()) {<NEW_LINE>JMSProducer producer = context.createProducer();<NEW_LINE>producer.setAsync(completionListener_);<NEW_LINE>for (int i = 0; i < 5; i++) {<NEW_LINE>TextMessage textMessage = context.createTextMessage("testJMS2CompletionListener:" + new java.util.Date());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>boolean completed = completionListener_.waitFor(5, 0);<NEW_LINE>Util.TRACE("completed=" + completed + "completionCount=" + completionListener_.completionCount_ + ",exceptionCount=" + completionListener_.exceptionCount_);<NEW_LINE>TextMessage textMessage = context.createTextMessage("testJMS2CompletionListener:" + new java.util.Date());<NEW_LINE>producer.send(depthLimitedQueue_, textMessage);<NEW_LINE>boolean conditionMet = completionListener_.waitFor(5, 1);<NEW_LINE>Util.TRACE("conditionMet=" + conditionMet + "completionCount=" + completionListener_.completionCount_ + ",exceptionCount=" + completionListener_.exceptionCount_);<NEW_LINE>if (completed && conditionMet) {<NEW_LINE>reportSuccess();<NEW_LINE>} else {<NEW_LINE>reportFailure();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>clearQueue(queueOne_);<NEW_LINE>completionListener_.reset();<NEW_LINE>}
producer.send(depthLimitedQueue_, textMessage);
974,152
protected ViewLayout createViewLayout(final ViewLayoutKey key) {<NEW_LINE>final ITranslatableString caption = getProcessCaption(WEBUI_Order_ProductsProposal_Launcher.class).orElse(null);<NEW_LINE>return //<NEW_LINE>ViewLayout.builder().setWindowId(key.getWindowId()).setCaption(caption).allowViewCloseAction(ViewCloseAction.CANCEL).allowViewCloseAction(ViewCloseAction.DONE).setFocusOnFieldName(ProductsProposalRow.FIELD_Qty).addElementsFromViewRowClassAndFieldNames(ProductsProposalRow.class, key.getViewDataType(), ClassViewColumnOverrides.ofFieldName(ProductsProposalRow.FIELD_Product), ClassViewColumnOverrides.ofFieldName(ProductsProposalRow.FIELD_Qty), ClassViewColumnOverrides.ofFieldName(ProductsProposalRow.FIELD_PackDescription), ClassViewColumnOverrides.ofFieldName(ProductsProposalRow.FIELD_ASI), ClassViewColumnOverrides.ofFieldName(ProductsProposalRow.FIELD_LastShipmentDays), ClassViewColumnOverrides.ofFieldName(ProductsProposalRow.FIELD_Price), ClassViewColumnOverrides.ofFieldName(ProductsProposalRow.FIELD_Currency), ClassViewColumnOverrides.ofFieldName(ProductsProposalRow.FIELD_IsCampaignPrice), //<NEW_LINE>ClassViewColumnOverrides.ofFieldName(ProductsProposalRow.FIELD_Description)).<MASK><NEW_LINE>}
setAllowOpeningRowDetails(false).build();
985,285
public void createMqProducer() throws MQClientException {<NEW_LINE>DefaultMQProducer producer = new DefaultMQProducer(rocketmqConfig.getProducerGroup());<NEW_LINE>producer.setNamesrvAddr(rocketmqConfig.getNamesrvAddr());<NEW_LINE>if (StrUtil.isNotBlank(rocketmqConfig.getNamespace())) {<NEW_LINE>producer.setNamespace(rocketmqConfig.getNamespace());<NEW_LINE>}<NEW_LINE>if (StrUtil.isNotBlank(rocketmqConfig.getInstanceName())) {<NEW_LINE>producer.setInstanceName(rocketmqConfig.getInstanceName());<NEW_LINE>}<NEW_LINE>if (StrUtil.isNotBlank(rocketmqConfig.getClientIP())) {<NEW_LINE>producer.setClientIP(rocketmqConfig.getClientIP());<NEW_LINE>}<NEW_LINE>if (StrUtil.isNotBlank(rocketmqConfig.getCreateTopicKey())) {<NEW_LINE>producer.setCreateTopicKey(rocketmqConfig.getCreateTopicKey());<NEW_LINE>}<NEW_LINE>if (rocketmqConfig.getUseTLS() != null) {<NEW_LINE>producer.setUseTLS(rocketmqConfig.getUseTLS());<NEW_LINE>}<NEW_LINE>if (rocketmqConfig.getSendLatencyFaultEnable() != null) {<NEW_LINE>producer.setSendLatencyFaultEnable(rocketmqConfig.getSendLatencyFaultEnable());<NEW_LINE>}<NEW_LINE>if (rocketmqConfig.getSendMessageWithVIPChannel() != null) {<NEW_LINE>producer.setSendMessageWithVIPChannel(rocketmqConfig.getSendMessageWithVIPChannel());<NEW_LINE>}<NEW_LINE>if (rocketmqConfig.getSendMsgTimeout() != null) {<NEW_LINE>producer.setSendMsgTimeout(rocketmqConfig.getSendMsgTimeout());<NEW_LINE>}<NEW_LINE>if (rocketmqConfig.getRetryAnotherBrokerWhenNotStoreOK() != null) {<NEW_LINE>producer.<MASK><NEW_LINE>}<NEW_LINE>if (rocketmqConfig.getRetryTimesWhenSendAsyncFailed() != null) {<NEW_LINE>producer.setRetryTimesWhenSendAsyncFailed(rocketmqConfig.getRetryTimesWhenSendAsyncFailed());<NEW_LINE>}<NEW_LINE>if (rocketmqConfig.getRetryTimesWhenSendFailed() != null) {<NEW_LINE>producer.setRetryTimesWhenSendFailed(rocketmqConfig.getRetryTimesWhenSendFailed());<NEW_LINE>}<NEW_LINE>mqProducer = producer;<NEW_LINE>producer.start();<NEW_LINE>}
setRetryAnotherBrokerWhenNotStoreOK(rocketmqConfig.getRetryAnotherBrokerWhenNotStoreOK());
1,715,563
GraphQLFieldDefinition buildField(BuildContext buildCtx, TypeDefinition<?> parentType, FieldDefinition fieldDef) {<NEW_LINE>GraphQLFieldDefinition.Builder builder = GraphQLFieldDefinition.newFieldDefinition();<NEW_LINE>builder.definition(buildCtx.isCaptureAstDefinitions() ? fieldDef : null);<NEW_LINE>builder.name(fieldDef.getName());<NEW_LINE>builder.description(buildDescription(buildCtx, fieldDef, fieldDef.getDescription()));<NEW_LINE>builder.deprecate(buildDeprecationReason(fieldDef.getDirectives()));<NEW_LINE>builder.comparatorRegistry(buildCtx.getComparatorRegistry());<NEW_LINE>Pair<List<GraphQLDirective>, List<GraphQLAppliedDirective>> appliedDirectives = buildAppliedDirectives(buildCtx, inputTypeFactory(buildCtx), fieldDef.getDirectives(), emptyList(), FIELD_DEFINITION, buildCtx.getDirectives(), buildCtx.getComparatorRegistry());<NEW_LINE>buildAppliedDirectives(buildCtx, builder, appliedDirectives);<NEW_LINE>fieldDef.getInputValueDefinitions().forEach(inputValueDefinition -> builder.argument(buildArgument(buildCtx, inputValueDefinition)));<NEW_LINE>GraphQLOutputType fieldType = buildOutputType(buildCtx, fieldDef.getType());<NEW_LINE>builder.type(fieldType);<NEW_LINE>GraphQLFieldDefinition fieldDefinition = builder.build();<NEW_LINE>// if they have already wired in a fetcher - then leave it alone<NEW_LINE>FieldCoordinates coordinates = FieldCoordinates.coordinates(parentType.getName(<MASK><NEW_LINE>if (!buildCtx.getCodeRegistry().hasDataFetcher(coordinates)) {<NEW_LINE>DataFetcherFactory<?> dataFetcherFactory = buildDataFetcherFactory(buildCtx, parentType, fieldDef, fieldType, appliedDirectives.first, appliedDirectives.second);<NEW_LINE>buildCtx.getCodeRegistry().dataFetcher(coordinates, dataFetcherFactory);<NEW_LINE>}<NEW_LINE>return directivesObserve(buildCtx, fieldDefinition);<NEW_LINE>}
), fieldDefinition.getName());
1,155,862
ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String path0, String path1, String path2, String path3, JsonElement jsonElement) throws Exception {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wo wo = new Wo();<NEW_LINE>String executorSeed = null;<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>WorkCompleted workCompleted = emc.fetch(id, WorkCompleted.class, ListTools.toList(WorkCompleted.job_FIELDNAME));<NEW_LINE>if (null == workCompleted) {<NEW_LINE>throw new ExceptionEntityNotExist(id, WorkCompleted.class);<NEW_LINE>}<NEW_LINE>executorSeed = workCompleted.getJob();<NEW_LINE>}<NEW_LINE>Callable<String> callable = new Callable<String>() {<NEW_LINE><NEW_LINE>public String call() throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>WorkCompleted workCompleted = emc.find(id, WorkCompleted.class);<NEW_LINE>if (null == workCompleted) {<NEW_LINE>throw new ExceptionEntityNotExist(id, WorkCompleted.class);<NEW_LINE>}<NEW_LINE>if (BooleanUtils.isTrue(workCompleted.getMerged())) {<NEW_LINE>throw new ExceptionModifyMerged(workCompleted.getId());<NEW_LINE>}<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(workCompleted.getId());<NEW_LINE>updateData(business, workCompleted, jsonElement, <MASK><NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>};<NEW_LINE>ProcessPlatformExecutorFactory.get(executorSeed).submit(callable).get(300, TimeUnit.SECONDS);<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}
path0, path1, path2, path3);
1,599,827
protected void writeSvgStyle(JRPrintGraphicElement element) throws IOException {<NEW_LINE>writer.write("style=\"fill:" + JRColorUtil.getCssColor(element.getBackcolor()) + ";");<NEW_LINE>writer.write("stroke:" + JRColorUtil.getCssColor(element.getLinePen().getLineColor()) + ";");<NEW_LINE>writer.write("stroke-width:" + element.getLinePen().getLineWidth() + ";");<NEW_LINE>switch(element.getLinePen().getLineStyleValue()) {<NEW_LINE>case DOTTED:<NEW_LINE>{<NEW_LINE>writer.write("stroke-dasharray:" + element.getLinePen().getLineWidth() + "," + element.getLinePen(<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case DASHED:<NEW_LINE>{<NEW_LINE>writer.write("stroke-dasharray:" + 5 * element.getLinePen().getLineWidth() + "," + 3 * element.getLinePen().getLineWidth() + ";");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// FIXME: there is no built-in svg support for double stroke style; strokes could be rendered twice as a workaround<NEW_LINE>case DOUBLE:<NEW_LINE>case SOLID:<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
).getLineWidth() + ";");
1,396,607
public static String process(ClassInfoType cit) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("package ").append(cit.getPackageName()).append(";").append("\n");<NEW_LINE>sb.append("\n");<NEW_LINE>processAnnotationsType(cit.getAnnotations(<MASK><NEW_LINE>printModifiersType(cit.getModifiers(), sb);<NEW_LINE>if (cit.isIsInterface()) {<NEW_LINE>sb.append("interface ");<NEW_LINE>} else {<NEW_LINE>sb.append("class ");<NEW_LINE>}<NEW_LINE>sb.append(cit.getName());<NEW_LINE>final String superclassName = cit.getSuperclassName();<NEW_LINE>if (superclassName != null && !superclassName.trim().isEmpty() && !superclassName.trim().equals("java.lang.Object")) {<NEW_LINE>sb.append(" extends ").append(superclassName.replace("/", ".")).append(" ");<NEW_LINE>}<NEW_LINE>final InterfacesType ifaces = cit.getInterfaces();<NEW_LINE>if (ifaces != null) {<NEW_LINE>List<String> ifaceList = ifaces.getInterface();<NEW_LINE>if (ifaceList.size() > 0) {<NEW_LINE>sb.append(" implements ");<NEW_LINE>boolean first = true;<NEW_LINE>for (String iface : ifaceList) {<NEW_LINE>if (!first) {<NEW_LINE>sb.append(", ");<NEW_LINE>} else {<NEW_LINE>first = false;<NEW_LINE>}<NEW_LINE>sb.append(iface.replace("/", "."));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append(" {\n");<NEW_LINE>printFields(cit, sb);<NEW_LINE>sb.append("\n");<NEW_LINE>printMethods(cit, sb);<NEW_LINE>sb.append("\n}\n");<NEW_LINE>return sb.toString();<NEW_LINE>}
), "", sb, false);
1,069,561
final ListProvisioningTemplateVersionsResult executeListProvisioningTemplateVersions(ListProvisioningTemplateVersionsRequest listProvisioningTemplateVersionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listProvisioningTemplateVersionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListProvisioningTemplateVersionsRequest> request = null;<NEW_LINE>Response<ListProvisioningTemplateVersionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListProvisioningTemplateVersionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listProvisioningTemplateVersionsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListProvisioningTemplateVersions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListProvisioningTemplateVersionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListProvisioningTemplateVersionsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");
493,418
public BucketList listBuckets(ListBucketsRequest listBucketRequest) throws OSSException, ClientException {<NEW_LINE>assertParameterNotNull(listBucketRequest, "listBucketRequest");<NEW_LINE>Map<String, String> params = new LinkedHashMap<String, String>();<NEW_LINE>if (listBucketRequest.getPrefix() != null) {<NEW_LINE>params.put(PREFIX, listBucketRequest.getPrefix());<NEW_LINE>}<NEW_LINE>if (listBucketRequest.getMarker() != null) {<NEW_LINE>params.put(MARKER, listBucketRequest.getMarker());<NEW_LINE>}<NEW_LINE>if (listBucketRequest.getMaxKeys() != null) {<NEW_LINE>params.put(MAX_KEYS, Integer.toString(listBucketRequest.getMaxKeys()));<NEW_LINE>}<NEW_LINE>if (listBucketRequest.getBid() != null) {<NEW_LINE>params.put(BID, listBucketRequest.getBid());<NEW_LINE>}<NEW_LINE>if (listBucketRequest.getTagKey() != null && listBucketRequest.getTagValue() != null) {<NEW_LINE>params.put(TAG_KEY, listBucketRequest.getTagKey());<NEW_LINE>params.put(TAG_VALUE, listBucketRequest.getTagValue());<NEW_LINE>}<NEW_LINE>Map<String, String> headers = new <MASK><NEW_LINE>addOptionalResourceGroupIdHeader(headers, listBucketRequest.getResourceGroupId());<NEW_LINE>RequestMessage request = new OSSRequestMessageBuilder(getInnerClient()).setEndpoint(getEndpoint(listBucketRequest)).setMethod(HttpMethod.GET).setHeaders(headers).setParameters(params).setOriginalRequest(listBucketRequest).build();<NEW_LINE>return doOperation(request, listBucketResponseParser, null, null, true);<NEW_LINE>}
HashMap<String, String>();
1,808,789
final GetEC2InstanceRecommendationsResult executeGetEC2InstanceRecommendations(GetEC2InstanceRecommendationsRequest getEC2InstanceRecommendationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getEC2InstanceRecommendationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetEC2InstanceRecommendationsRequest> request = null;<NEW_LINE>Response<GetEC2InstanceRecommendationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetEC2InstanceRecommendationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getEC2InstanceRecommendationsRequest));<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, "Compute Optimizer");<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<GetEC2InstanceRecommendationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetEC2InstanceRecommendationsResultJsonUnmarshaller());<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, "GetEC2InstanceRecommendations");
1,539,549
@JSONP<NEW_LINE>@NoCache<NEW_LINE>@Produces({ MediaType.APPLICATION_JSON, "application/javascript" })<NEW_LINE>public void deleteSite(@Context final HttpServletRequest httpServletRequest, @Context final HttpServletResponse httpServletResponse, @Suspended final AsyncResponse asyncResponse, @PathParam("siteId") final String siteId) throws DotDataException, DotSecurityException {<NEW_LINE>final User user = new WebResource.InitBuilder(this.webResource).requestAndResponse(httpServletRequest, httpServletResponse).requiredBackendUser(true).rejectWhenNoUser(true).requiredPortlet("sites").init().getUser();<NEW_LINE>Logger.debug(this, () -> "deleting the site: " + siteId);<NEW_LINE>final PageMode pageMode = PageMode.get(httpServletRequest);<NEW_LINE>final boolean respectFrontendRoles = pageMode.respectAnonPerms;<NEW_LINE>final Host host = pageMode.respectAnonPerms ? this.siteHelper.getSite(user, siteId) : this.siteHelper.getSiteNoFrontEndRoles(user, siteId);<NEW_LINE>if (null == host) {<NEW_LINE>throw new IllegalArgumentException("Site: " + siteId + " does not exists");<NEW_LINE>}<NEW_LINE>if (host.isDefault()) {<NEW_LINE>throw new DotStateException("the default site can't be deleted");<NEW_LINE>}<NEW_LINE>final Future<Boolean> deleteHostResult = this.siteHelper.<MASK><NEW_LINE>if (null == deleteHostResult) {<NEW_LINE>throw new DotStateException("the Site: " + siteId + " couldn't be deleted");<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>asyncResponse.resume(new ResponseEntityView(deleteHostResult.get()));<NEW_LINE>} catch (Exception e) {<NEW_LINE>asyncResponse.resume(ResponseUtil.mapExceptionResponse(e));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
delete(host, user, respectFrontendRoles);
1,290,134
protected void run() {<NEW_LINE>try {<NEW_LINE>runInterceptHook();<NEW_LINE>String donationAddressString = processModel.getDaoFacade().getParamValue(Param.RECIPIENT_BTC_ADDRESS);<NEW_LINE>Coin minerFee = trade.getTradeTxFee();<NEW_LINE>TradeWalletService tradeWalletService = processModel.getTradeWalletService();<NEW_LINE>Transaction depositTx = checkNotNull(processModel.getDepositTx());<NEW_LINE><MASK><NEW_LINE>Transaction preparedDelayedPayoutTx = tradeWalletService.createDelayedUnsignedPayoutTx(depositTx, donationAddressString, minerFee, lockTime);<NEW_LINE>TradeDataValidation.validateDelayedPayoutTx(trade, preparedDelayedPayoutTx, processModel.getDaoFacade(), processModel.getBtcWalletService());<NEW_LINE>processModel.setPreparedDelayedPayoutTx(preparedDelayedPayoutTx);<NEW_LINE>processModel.getTradeManager().requestPersistence();<NEW_LINE>complete();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>failed(t);<NEW_LINE>}<NEW_LINE>}
long lockTime = trade.getLockTime();
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 = mwc.var(long.class);<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, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>mw.visitLabel(endWriteValue_);<NEW_LINE>}
TYPE_FIELD_WRITER, "writeInt64", METHOD_DESC_WRITE_J, true);
1,417,530
final ListAutoScalingConfigurationsResult executeListAutoScalingConfigurations(ListAutoScalingConfigurationsRequest listAutoScalingConfigurationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listAutoScalingConfigurationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListAutoScalingConfigurationsRequest> request = null;<NEW_LINE>Response<ListAutoScalingConfigurationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListAutoScalingConfigurationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAutoScalingConfigurationsRequest));<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, "AppRunner");<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<ListAutoScalingConfigurationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListAutoScalingConfigurationsResultJsonUnmarshaller());<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, "ListAutoScalingConfigurations");
696,572
public UpdateConnectionApiKeyAuthRequestParameters unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateConnectionApiKeyAuthRequestParameters updateConnectionApiKeyAuthRequestParameters = new UpdateConnectionApiKeyAuthRequestParameters();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ApiKeyName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateConnectionApiKeyAuthRequestParameters.setApiKeyName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ApiKeyValue", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateConnectionApiKeyAuthRequestParameters.setApiKeyValue(context.getUnmarshaller(String.<MASK><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 updateConnectionApiKeyAuthRequestParameters;<NEW_LINE>}
class).unmarshall(context));
164,370
public int read(ByteBuffer byteBuffer, int off, int len) throws IOException {<NEW_LINE>Preconditions.checkArgument(off >= 0 && len >= 0 && len + off <= byteBuffer.capacity(), PreconditionMessage.ERR_BUFFER_STATE.toString(), byteBuffer.<MASK><NEW_LINE>checkIfClosed();<NEW_LINE>if (len == 0) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>if (mPos == mLength) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>readChunk();<NEW_LINE>if (mCurrentChunk == null) {<NEW_LINE>mEOF = true;<NEW_LINE>}<NEW_LINE>if (mEOF) {<NEW_LINE>closeDataReader();<NEW_LINE>Preconditions.checkState(mPos >= mLength, PreconditionMessage.BLOCK_LENGTH_INCONSISTENT.toString(), mId, mLength, mPos);<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>int toRead = Math.min(len, mCurrentChunk.readableBytes());<NEW_LINE>byteBuffer.position(off).limit(off + toRead);<NEW_LINE>mCurrentChunk.readBytes(byteBuffer);<NEW_LINE>mPos += toRead;<NEW_LINE>if (mPos == mLength) {<NEW_LINE>// a performance improvement introduced by https://github.com/Alluxio/alluxio/issues/14020<NEW_LINE>closeDataReader();<NEW_LINE>}<NEW_LINE>return toRead;<NEW_LINE>}
capacity(), off, len);
359,440
public void handleIncomingStream(HttpServletRequest req, HttpServletResponse resp) {<NEW_LINE>ConfigurableWebApplicationContext appContext = (ConfigurableWebApplicationContext) req.getServletContext().getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);<NEW_LINE>if (appContext != null && appContext.isRunning()) {<NEW_LINE>String applicationName = appContext.getApplicationName();<NEW_LINE>String filepath = WEBAPPS + applicationName + STREAMS + req.getPathInfo();<NEW_LINE>File finalFile = new File(filepath);<NEW_LINE>String tmpFilepath = filepath + ".tmp";<NEW_LINE>File tmpFile = new File(tmpFilepath);<NEW_LINE>File streamsDir = new File(WEBAPPS + applicationName + STREAMS);<NEW_LINE>File firstParent = finalFile.getParentFile();<NEW_LINE>File grandParent = firstParent.getParentFile();<NEW_LINE>if (firstParent.equals(streamsDir) || grandParent.equals(streamsDir)) {<NEW_LINE>mkdirIfRequired(req, applicationName);<NEW_LINE>try {<NEW_LINE>IChunkedCacheManager cacheManager = (IChunkedCacheManager) appContext.getBean(IChunkedCacheManager.BEAN_NAME);<NEW_LINE>logger.debug("doPut key:{}", finalFile.getAbsolutePath());<NEW_LINE>cacheManager.addCache(finalFile.getAbsolutePath());<NEW_LINE>IParser atomparser;<NEW_LINE>if (filepath.endsWith(".mpd") || filepath.endsWith(".m3u8")) {<NEW_LINE>// don't parse atom for mpd files because they are text files<NEW_LINE>atomparser = new MockAtomParser();<NEW_LINE>} else {<NEW_LINE>atomparser = new AtomParser(completeChunk -> cacheManager.append(finalFile.getAbsolutePath(), completeChunk));<NEW_LINE>}<NEW_LINE>AsyncContext asyncContext = req.startAsync();<NEW_LINE>StatusListener statusListener = new StatusListener(filepath);<NEW_LINE>asyncContext.addListener(statusListener);<NEW_LINE>InputStream inputStream = asyncContext<MASK><NEW_LINE>asyncContext.start(() -> readInputStream(finalFile, tmpFile, cacheManager, atomparser, asyncContext, inputStream, statusListener));<NEW_LINE>} catch (BeansException | IllegalStateException | IOException e) {<NEW_LINE>logger.error("Exception in handleIncomingStream for the chunk:{} ", finalFile.getAbsolutePath());<NEW_LINE>logger.error(ExceptionUtils.getStackTrace(e));<NEW_LINE>writeInternalError(resp, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, null);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.warn("AppContext is not running for write request to {}", req.getRequestURI());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.warn("AppContext is not running for write request to {}", req.getRequestURI());<NEW_LINE>writeInternalError(resp, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Server is not ready. It's likely starting. Please try a few seconds later. ");<NEW_LINE>}<NEW_LINE>}
.getRequest().getInputStream();
465,116
protected void actionWithSelectedCards(Cards cards, Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(source.getControllerId());<NEW_LINE>if (player != null && numberToPick.calculate(game, source, this) > 0 && cards.count(filter, source.getControllerId(), source, game) > 0) {<NEW_LINE>if (!optional || player.chooseUse(Outcome.DrawCard, getMayText(), source, game)) {<NEW_LINE>FilterCard pickFilter = filter.copy();<NEW_LINE>pickFilter.setMessage(getPickText());<NEW_LINE>int number = min(cards.size(), numberToPick.calculate(game, source, this));<NEW_LINE>TargetCard target = new TargetCard((upTo ? 0 : number), number, Zone.LIBRARY, pickFilter);<NEW_LINE>if (player.choose(Outcome.DrawCard, cards, target, game)) {<NEW_LINE>Cards pickedCards = new CardsImpl(target.getTargets());<NEW_LINE>cards.removeAll(pickedCards);<NEW_LINE>if (targetPickedCards == Zone.LIBRARY && !putOnTopSelected) {<NEW_LINE>player.putCardsOnBottomOfLibrary(pickedCards, game, source, anyOrder);<NEW_LINE>} else {<NEW_LINE>player.moveCards(pickedCards.getCards(game), targetPickedCards, source, game);<NEW_LINE>}<NEW_LINE>if (revealPickedCards) {<NEW_LINE>player.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
revealCards(source, pickedCards, game);
1,793,237
private void updateports(Instance instance) {<NEW_LINE>final var facing = instance.getAttributeValue(StdAttr.FACING);<NEW_LINE>final var volumeWidth = (byte) instance.getAttributeValue(VOLUME_WIDTH).getWidth();<NEW_LINE>final <MASK><NEW_LINE>if (facing == Direction.EAST || facing == Direction.WEST) {<NEW_LINE>ports[FREQ] = new Port(0, -10, Port.INPUT, 14);<NEW_LINE>ports[VOL] = new Port(0, 10, Port.INPUT, volumeWidth);<NEW_LINE>} else {<NEW_LINE>ports[FREQ] = new Port(-10, 0, Port.INPUT, 14);<NEW_LINE>ports[VOL] = new Port(10, 0, Port.INPUT, volumeWidth);<NEW_LINE>}<NEW_LINE>ports[FREQ].setToolTip(S.getter("buzzerFrequecy"));<NEW_LINE>ports[VOL].setToolTip(S.getter("buzzerVolume"));<NEW_LINE>ports[ENABLE] = new Port(0, 0, Port.INPUT, 1);<NEW_LINE>ports[ENABLE].setToolTip(S.getter("enableSound"));<NEW_LINE>final var selectLoc = instance.getAttributeValue(StdAttr.SELECT_LOC);<NEW_LINE>var xPw = 20;<NEW_LINE>var yPw = 20;<NEW_LINE>if (facing == Direction.NORTH || facing == Direction.SOUTH) {<NEW_LINE>xPw *= selectLoc == StdAttr.SELECT_BOTTOM_LEFT ? -1 : 1;<NEW_LINE>yPw *= facing == Direction.SOUTH ? -1 : 1;<NEW_LINE>} else {<NEW_LINE>xPw *= facing == Direction.EAST ? -1 : 1;<NEW_LINE>yPw *= selectLoc == StdAttr.SELECT_TOP_RIGHT ? -1 : 1;<NEW_LINE>}<NEW_LINE>ports[PW] = new Port(xPw, yPw, Port.INPUT, 8);<NEW_LINE>ports[PW].setToolTip(S.getter("buzzerDutyCycle"));<NEW_LINE>instance.setPorts(ports);<NEW_LINE>}
var ports = new Port[4];
10,496
void addResource(String type, String name, TypedResource value) {<NEW_LINE>ResName resName = new ResName(packageName, type, name);<NEW_LINE>// compound style names were previously registered with underscores (TextAppearance_Small)<NEW_LINE>// because they came from R.style; re-register with dots.<NEW_LINE>ResName resNameWithUnderscores = new ResName(packageName, type, underscorize(name));<NEW_LINE>Integer oldId = resourceTable.inverse().get(resNameWithUnderscores);<NEW_LINE>if (oldId != null) {<NEW_LINE>resourceTable.forcePut(oldId, resName);<NEW_LINE>}<NEW_LINE>Integer id = resourceTable.inverse().get(resName);<NEW_LINE>if (id == null && isAndroidPackage(resName)) {<NEW_LINE>id = androidResourceIdGenerator.generate(type, name);<NEW_LINE>ResName existing = resourceTable.put(id, resName);<NEW_LINE>if (existing != null) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>resources.put(resName, value);<NEW_LINE>}
IllegalStateException(resName + " assigned ID to already existing " + existing);
3,394
public static void convertBodyToBaf(SootMethod m) {<NEW_LINE><MASK><NEW_LINE>Assert.assertNotNull(b);<NEW_LINE>if (!(b instanceof BafBody)) {<NEW_LINE>// If ShimpleBody, first convert to JimpleBody<NEW_LINE>if (b instanceof ShimpleBody) {<NEW_LINE>b = ((ShimpleBody) b).toJimpleBody();<NEW_LINE>}<NEW_LINE>Assert.assertTrue("Does not currently handle " + b.getClass(), b instanceof JimpleBody);<NEW_LINE>// Convert JimpleBody to BafBody (based on PackManager#convertJimpleBodyToBaf)<NEW_LINE>BafBody bafBody = Baf.v().newBody((JimpleBody) b);<NEW_LINE>PackManager.v().getPack("bop").apply(bafBody);<NEW_LINE>PackManager.v().getPack("tag").apply(bafBody);<NEW_LINE>m.setActiveBody(bafBody);<NEW_LINE>}<NEW_LINE>}
Body b = m.retrieveActiveBody();
1,734,877
private Expression rewriteDouble(Literal literal, double value) {<NEW_LINE>if (testType.equals(TypeConstants.DOUBLE)) {<NEW_LINE>if (Double.isNaN(value)) {<NEW_LINE>return new ArithmeticOperation(BytecodeLoc.NONE, Literal.DOUBLE_ZERO, Literal.DOUBLE_ZERO, ArithOp.DIVIDE);<NEW_LINE>}<NEW_LINE>if (Double.compare(Double.NEGATIVE_INFINITY, value) == 0) {<NEW_LINE>return new ArithmeticOperation(BytecodeLoc.NONE, Literal.DOUBLE_MINUS_ONE, Literal.DOUBLE_ZERO, ArithOp.DIVIDE);<NEW_LINE>}<NEW_LINE>if (Double.compare(Double.POSITIVE_INFINITY, value) == 0) {<NEW_LINE>return new ArithmeticOperation(BytecodeLoc.NONE, Literal.DOUBLE_ONE, <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (Double.isNaN(value))<NEW_LINE>return new LValueExpression(D_NAN);<NEW_LINE>if (Double.compare(Double.NEGATIVE_INFINITY, value) == 0)<NEW_LINE>return new LValueExpression(D_NEGATIVE_INFINITY);<NEW_LINE>if (Double.compare(Double.POSITIVE_INFINITY, value) == 0)<NEW_LINE>return new LValueExpression(D_POSITIVE_INFINITY);<NEW_LINE>if (Double.compare(Double.MAX_VALUE, value) == 0)<NEW_LINE>return new LValueExpression(D_MAX_VALUE);<NEW_LINE>if (Double.compare(Double.MIN_VALUE, value) == 0)<NEW_LINE>return new LValueExpression(D_MIN_VALUE);<NEW_LINE>if (Double.compare(Double.MIN_NORMAL, value) == 0)<NEW_LINE>return new LValueExpression(D_MIN_NORMAL);<NEW_LINE>}<NEW_LINE>if (!testType.equals(TypeConstants.MATH)) {<NEW_LINE>if (Double.compare(Math.E, value) == 0)<NEW_LINE>return new LValueExpression(MATH_E);<NEW_LINE>float nearestFloat = (float) value;<NEW_LINE>if (Double.compare(nearestFloat, value) == 0) {<NEW_LINE>// "(double)".length() == 8, "f" suffix is one more<NEW_LINE>if (Float.toString(nearestFloat).length() + 9 < Double.toString(value).length()) {<NEW_LINE>return new CastExpression(BytecodeLoc.NONE, INFERRED_DOUBLE, new Literal(TypedLiteral.getFloat(nearestFloat)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Expression piExpr = maybeGetPiExpression(value);<NEW_LINE>if (piExpr != null)<NEW_LINE>return piExpr;<NEW_LINE>}<NEW_LINE>return literal;<NEW_LINE>}
Literal.DOUBLE_ZERO, ArithOp.DIVIDE);
1,527,703
public void protocolSelectionChanged(final NSPopUpButton sender) {<NEW_LINE>if (null == sender.selectedItem().representedObject()) {<NEW_LINE>final PreferencesController controller = PreferencesControllerFactory.instance();<NEW_LINE>controller.window().makeKeyAndOrderFront(null);<NEW_LINE>controller.setSelectedPanel(PreferencesController.PreferencesToolbarItem.profiles.name());<NEW_LINE>} else {<NEW_LINE>final Protocol selected = ProtocolFactory.get().forName(sender.selectedItem().representedObject());<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Protocol selection changed to %s", selected));<NEW_LINE>}<NEW_LINE>bookmark.<MASK><NEW_LINE>if (!bookmark.getProtocol().isHostnameConfigurable()) {<NEW_LINE>// Previously selected protocol had a default hostname. Change to default<NEW_LINE>// of newly selected protocol.<NEW_LINE>bookmark.setHostname(selected.getDefaultHostname());<NEW_LINE>}<NEW_LINE>if (!selected.isHostnameConfigurable()) {<NEW_LINE>// Hostname of newly selected protocol is not configurable. Change to default.<NEW_LINE>bookmark.setHostname(selected.getDefaultHostname());<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotBlank(selected.getDefaultHostname())) {<NEW_LINE>// Prefill with default hostname<NEW_LINE>bookmark.setHostname(selected.getDefaultHostname());<NEW_LINE>}<NEW_LINE>if (Objects.equals(bookmark.getDefaultPath(), bookmark.getProtocol().getDefaultPath()) || !selected.isPathConfigurable()) {<NEW_LINE>bookmark.setDefaultPath(selected.getDefaultPath());<NEW_LINE>}<NEW_LINE>bookmark.setProtocol(selected);<NEW_LINE>final int port = HostnameConfiguratorFactory.get(selected).getPort(bookmark.getHostname());<NEW_LINE>if (port != -1) {<NEW_LINE>// External configuration found<NEW_LINE>bookmark.setPort(port);<NEW_LINE>}<NEW_LINE>options.configure(selected);<NEW_LINE>validator.configure(selected);<NEW_LINE>this.update();<NEW_LINE>}<NEW_LINE>}
setPort(selected.getDefaultPort());
1,236,890
private Change createReferenceUpdatingMoveChange(IProgressMonitor pm) throws JavaModelException {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>pm.beginTask("", 2 + (fUpdateQualifiedNames ? 1 : 0));<NEW_LINE>try {<NEW_LINE>CompositeChange composite = new DynamicValidationStateChange(RefactoringCoreMessages.ReorgPolicy_move);<NEW_LINE>composite.markAsSynthetic();<NEW_LINE>// XX workaround for bug 13558<NEW_LINE>// <workaround><NEW_LINE>if (fChangeManager == null) {<NEW_LINE>fChangeManager = createChangeManager(new SubProgressMonitor(pm, 1), new RefactoringStatus());<NEW_LINE>// TODO: non-CU matches silently dropped<NEW_LINE>RefactoringStatus status;<NEW_LINE>try {<NEW_LINE>status = Checks.validateModifiesFiles(getAllModifiedFiles(), null, pm);<NEW_LINE>if (status.hasFatalError()) {<NEW_LINE>fChangeManager = new TextChangeManager();<NEW_LINE>}<NEW_LINE>} catch (CoreException e) {<NEW_LINE>fChangeManager = new TextChangeManager();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// </workaround><NEW_LINE>composite.merge(new CompositeChange(RefactoringCoreMessages.MoveRefactoring_reorganize_elements<MASK><NEW_LINE>Change fileMove = createSimpleMoveChange(new SubProgressMonitor(pm, 1));<NEW_LINE>if (fileMove instanceof CompositeChange) {<NEW_LINE>composite.merge(((CompositeChange) fileMove));<NEW_LINE>} else {<NEW_LINE>composite.add(fileMove);<NEW_LINE>}<NEW_LINE>return composite;<NEW_LINE>} finally {<NEW_LINE>pm.done();<NEW_LINE>}<NEW_LINE>}
, fChangeManager.getAllChanges()));
544,733
private SamLocusAndReferenceIterator createSamLocusAndReferenceIterator(final SamReader sam, final ReferenceSequenceFileWalker referenceSequenceFileWalker) {<NEW_LINE>sequenceDictionary = referenceSequenceFileWalker.getSequenceDictionary();<NEW_LINE>if (sam.getFileHeader().getSortOrder() != SAMFileHeader.SortOrder.coordinate) {<NEW_LINE>throw new PicardException("Input BAM must be sorted by coordinate");<NEW_LINE>}<NEW_LINE>// Make sure our reference and reads have the same sequence dictionary:<NEW_LINE>sequenceDictionary.assertSameDictionary(sam.getFileHeader().getSequenceDictionary());<NEW_LINE>final IntervalList regionOfInterest = getIntervals(sequenceDictionary);<NEW_LINE>log.info("Getting SamLocusIterator");<NEW_LINE>final SamLocusIterator samLocusIterator = new SamLocusIterator(sam, regionOfInterest);<NEW_LINE>// We want to know about indels:<NEW_LINE>samLocusIterator.setIncludeIndels(true);<NEW_LINE>// Now go through and compare information at each of these sites<NEW_LINE>samLocusIterator.setEmitUncoveredLoci(false);<NEW_LINE>samLocusIterator.setMappingQualityScoreCutoff(MIN_MAPPING_Q);<NEW_LINE>samLocusIterator.setQualityScoreCutoff(MIN_BASE_Q);<NEW_LINE>log.info("Using " + aggregatorList.size() + " aggregators.");<NEW_LINE>aggregatorList.forEach(la -> IOUtil.assertFileIsWritable(new File(OUTPUT + la.getSuffix())));<NEW_LINE>// iterate over loci<NEW_LINE>log.info("Starting iteration over loci");<NEW_LINE>final SamLocusAndReferenceIterator iterator <MASK><NEW_LINE>// This hasNext() call has side-effects. It loads up the index and makes sure that<NEW_LINE>// the iterator is really ready for<NEW_LINE>// action. Calling this allows for the logging to be more accurate.<NEW_LINE>iterator.hasNext();<NEW_LINE>return iterator;<NEW_LINE>}
= new SamLocusAndReferenceIterator(referenceSequenceFileWalker, samLocusIterator);
1,589,208
final ForgotPasswordResult executeForgotPassword(ForgotPasswordRequest forgotPasswordRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(forgotPasswordRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ForgotPasswordRequest> request = null;<NEW_LINE>Response<ForgotPasswordResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ForgotPasswordRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(forgotPasswordRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Cognito Identity Provider");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ForgotPassword");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ForgotPasswordResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ForgotPasswordResultJsonUnmarshaller());<NEW_LINE>response = anonymousInvoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
611,496
public ImportKeysListEntry createFromParcel(final Parcel source) {<NEW_LINE>ImportKeysListEntry vr = new ImportKeysListEntry();<NEW_LINE>vr.mParcelableKeyRing = source.readParcelable(ParcelableKeyRing.class.getClassLoader());<NEW_LINE>vr.mPrimaryUserId = <MASK><NEW_LINE>vr.mUserIds = new ArrayList<>();<NEW_LINE>source.readStringList(vr.mUserIds);<NEW_LINE>vr.mMergedUserIds = (HashMap<String, HashSet<String>>) source.readSerializable();<NEW_LINE>vr.mRevoked = source.readByte() == 1;<NEW_LINE>vr.mExpired = source.readByte() == 1;<NEW_LINE>vr.mUpdated = source.readByte() == 1;<NEW_LINE>vr.mDate = source.readInt() != 0 ? new Date(source.readLong()) : null;<NEW_LINE>vr.mFingerprint = source.createByteArray();<NEW_LINE>vr.mKeyIdHex = source.readString();<NEW_LINE>vr.mBitStrength = source.readInt() != 0 ? source.readInt() : null;<NEW_LINE>vr.mAlgorithm = source.readString();<NEW_LINE>vr.mSecretKey = source.readByte() == 1;<NEW_LINE>vr.mKeyserver = source.readParcelable(HkpKeyserverAddress.class.getClassLoader());<NEW_LINE>vr.mFbUsername = source.readString();<NEW_LINE>return vr;<NEW_LINE>}
(UserId) source.readSerializable();
1,133,741
public DataSet loadFromMetaData(List<RecordMetaData> list) throws IOException {<NEW_LINE>if (underlying == null) {<NEW_LINE>SequenceRecord r = recordReader.loadSequenceFromMetaData<MASK><NEW_LINE>initializeUnderlying(r);<NEW_LINE>}<NEW_LINE>// Two cases: single vs. multiple reader...<NEW_LINE>List<RecordMetaData> l = new ArrayList<>(list.size());<NEW_LINE>if (singleSequenceReaderMode) {<NEW_LINE>for (RecordMetaData m : list) {<NEW_LINE>l.add(new RecordMetaDataComposableMap(Collections.singletonMap(READER_KEY, m)));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (RecordMetaData m : list) {<NEW_LINE>RecordMetaDataComposable rmdc = (RecordMetaDataComposable) m;<NEW_LINE>Map<String, RecordMetaData> map = new HashMap<>(2);<NEW_LINE>map.put(READER_KEY, rmdc.getMeta()[0]);<NEW_LINE>map.put(READER_KEY_LABEL, rmdc.getMeta()[1]);<NEW_LINE>l.add(new RecordMetaDataComposableMap(map));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return mdsToDataSet(underlying.loadFromMetaData(l));<NEW_LINE>}
(list.get(0));
1,269,356
public DeleteConnectorResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DeleteConnectorResult deleteConnectorResult = new DeleteConnectorResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return deleteConnectorResult;<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("connectorArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteConnectorResult.setConnectorArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("connectorState", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>deleteConnectorResult.setConnectorState(context.getUnmarshaller(String.<MASK><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 deleteConnectorResult;<NEW_LINE>}
class).unmarshall(context));
1,544,472
public int compareTo(getTabletServerStatus_result other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetSuccess()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.compare(isSetSec(), other.isSetSec());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetSec()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
this.sec, other.sec);
352,519
public void init(GameEngine engine) {<NEW_LINE>// context from loading state gets used.<NEW_LINE>nuiManager = context.get(NUIManager.class);<NEW_LINE>worldRenderer = context.get(WorldRenderer.class);<NEW_LINE>eventSystem = context.get(EventSystem.class);<NEW_LINE>componentSystemManager = context.get(ComponentSystemManager.class);<NEW_LINE>entityManager = context.get(EngineEntityManager.class);<NEW_LINE>cameraTargetSystem = context.get(CameraTargetSystem.class);<NEW_LINE>if (nuiManager != null) {<NEW_LINE>inputSystem = context.get(InputSystem.class);<NEW_LINE>eventSystem.registerEventHandler(nuiManager);<NEW_LINE>}<NEW_LINE>networkSystem = context.get(NetworkSystem.class);<NEW_LINE>storageManager = context.get(StorageManager.class);<NEW_LINE>storageServiceWorker = <MASK><NEW_LINE>console = context.get(Console.class);<NEW_LINE>if (nuiManager != null) {<NEW_LINE>// Show or hide the HUD according to the settings<NEW_LINE>nuiManager.getHUD().bindVisible(new ReadOnlyBinding<Boolean>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Boolean get() {<NEW_LINE>return !context.get(Config.class).getRendering().getDebug().isHudHidden();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (networkSystem.getMode() == NetworkMode.CLIENT) {<NEW_LINE>String motd = networkSystem.getServer().getInfo().getMOTD();<NEW_LINE>if (nuiManager != null && motd != null && motd.length() != 0) {<NEW_LINE>nuiManager.pushScreen(MessagePopup.ASSET_URI, MessagePopup.class).setMessage("Server MOTD", motd);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
context.get(StorageServiceWorker.class);
542,461
public boolean authorize(ZapRequest request, boolean verbose) {<NEW_LINE>if (allowAny) {<NEW_LINE>if (verbose) {<NEW_LINE>System.out.println("ZAuth: allowed (CURVE allow any client)");<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>if (certStore != null) {<NEW_LINE>if (certStore.containsPublicKey(request.clientKey)) {<NEW_LINE>// login allowed<NEW_LINE>if (verbose) {<NEW_LINE>System.out.printf("ZAuth: Allowed (CURVE) client_key=%s\n", request.clientKey);<NEW_LINE>}<NEW_LINE>request.userId = request.clientKey;<NEW_LINE>request.metadata = <MASK><NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>// login not allowed. couldn't find certificate<NEW_LINE>if (verbose) {<NEW_LINE>System.out.printf("ZAuth: Denied (CURVE) client_key=%s\n", request.clientKey);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
certStore.getMetadata(request.clientKey);
1,545,290
public static QueryAuthResponse unmarshall(QueryAuthResponse queryAuthResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryAuthResponse.setRequestId(_ctx.stringValue("QueryAuthResponse.RequestId"));<NEW_LINE>queryAuthResponse.setCode(_ctx.integerValue("QueryAuthResponse.Code"));<NEW_LINE>queryAuthResponse.setSuccess(_ctx.booleanValue("QueryAuthResponse.Success"));<NEW_LINE>queryAuthResponse.setMessage(_ctx.stringValue("QueryAuthResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setInstanceId(_ctx.stringValue("QueryAuthResponse.Data.InstanceId"));<NEW_LINE>data.setProductCode(_ctx.stringValue("QueryAuthResponse.Data.ProductCode"));<NEW_LINE>List<InfoDTOListItem> infoDTOList = new ArrayList<InfoDTOListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryAuthResponse.Data.InfoDTOList.Length"); i++) {<NEW_LINE>InfoDTOListItem infoDTOListItem = new InfoDTOListItem();<NEW_LINE>infoDTOListItem.setItemName(_ctx.stringValue("QueryAuthResponse.Data.InfoDTOList[" + i + "].ItemName"));<NEW_LINE>infoDTOListItem.setItemRecordVid(_ctx.stringValue<MASK><NEW_LINE>infoDTOListItem.setAuthOrderVid(_ctx.stringValue("QueryAuthResponse.Data.InfoDTOList[" + i + "].AuthOrderVid"));<NEW_LINE>infoDTOListItem.setOperateCode(_ctx.stringValue("QueryAuthResponse.Data.InfoDTOList[" + i + "].OperateCode"));<NEW_LINE>infoDTOList.add(infoDTOListItem);<NEW_LINE>}<NEW_LINE>data.setInfoDTOList(infoDTOList);<NEW_LINE>queryAuthResponse.setData(data);<NEW_LINE>return queryAuthResponse;<NEW_LINE>}
("QueryAuthResponse.Data.InfoDTOList[" + i + "].ItemRecordVid"));
1,577,967
private HttpRequest.Builder updateUserRequestBuilder(String username, User body) throws ApiException {<NEW_LINE>// verify the required parameter 'username' is set<NEW_LINE>if (username == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'body' when calling updateUser");<NEW_LINE>}<NEW_LINE>HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder();<NEW_LINE>String localVarPath = "/user/{username}".replace("{username}", ApiClient.urlEncode(username.toString()));<NEW_LINE>localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath));<NEW_LINE>localVarRequestBuilder.header("Content-Type", "application/json");<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body);<NEW_LINE>localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody));<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new ApiException(e);<NEW_LINE>}<NEW_LINE>if (memberVarReadTimeout != null) {<NEW_LINE>localVarRequestBuilder.timeout(memberVarReadTimeout);<NEW_LINE>}<NEW_LINE>if (memberVarInterceptor != null) {<NEW_LINE>memberVarInterceptor.accept(localVarRequestBuilder);<NEW_LINE>}<NEW_LINE>return localVarRequestBuilder;<NEW_LINE>}
localVarRequestBuilder.header("Accept", "application/json");
934,887
public void onBindViewHolder(ViewHolder holder, int position) {<NEW_LINE>DataMPU6050 temp = results.get(position);<NEW_LINE>holder.tvAx.setText(DataFormatter.formatDouble(temp.getAx<MASK><NEW_LINE>holder.tvAy.setText(DataFormatter.formatDouble(temp.getAy(), DataFormatter.LOW_PRECISION_FORMAT));<NEW_LINE>holder.tvAz.setText(DataFormatter.formatDouble(temp.getAz(), DataFormatter.LOW_PRECISION_FORMAT));<NEW_LINE>holder.tvGx.setText(DataFormatter.formatDouble(temp.getGx(), DataFormatter.LOW_PRECISION_FORMAT));<NEW_LINE>holder.tvGy.setText(DataFormatter.formatDouble(temp.getGy(), DataFormatter.LOW_PRECISION_FORMAT));<NEW_LINE>holder.tvGz.setText(DataFormatter.formatDouble(temp.getGz(), DataFormatter.LOW_PRECISION_FORMAT));<NEW_LINE>holder.tvTemperature.setText(DataFormatter.formatDouble(temp.getTemperature(), DataFormatter.LOW_PRECISION_FORMAT));<NEW_LINE>holder.tvTitle.setText("Raw Data #" + (position + 1));<NEW_LINE>}
(), DataFormatter.LOW_PRECISION_FORMAT));
16,310
public static INDArray generatePointsOnGraph(double xMin, double xMax, double yMin, double yMax, int nPointsPerAxis) {<NEW_LINE>// generate all the x,y points<NEW_LINE>double[][] evalPoints = new double[nPointsPerAxis * nPointsPerAxis][2];<NEW_LINE>int count = 0;<NEW_LINE>for (int i = 0; i < nPointsPerAxis; i++) {<NEW_LINE>for (int j = 0; j < nPointsPerAxis; j++) {<NEW_LINE>double x = i * (xMax - xMin) <MASK><NEW_LINE>double y = j * (yMax - yMin) / (nPointsPerAxis - 1) + yMin;<NEW_LINE>evalPoints[count][0] = x;<NEW_LINE>evalPoints[count][1] = y;<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Nd4j.create(evalPoints);<NEW_LINE>}
/ (nPointsPerAxis - 1) + xMin;
42,756
public RegisterWorkerPResponse call() throws Exception {<NEW_LINE>// If an error was received earlier, the stream is no longer open<NEW_LINE>Preconditions.checkState(mErrorReceived.get() == null, <MASK><NEW_LINE>// Initialize the context on the 1st message<NEW_LINE>synchronized (workerRequestObserver) {<NEW_LINE>if (mContext == null) {<NEW_LINE>Preconditions.checkState(isHead, "Context is not initialized but the request is not the 1st in a stream!");<NEW_LINE>LOG.debug("Initializing context for {}", workerId);<NEW_LINE>mContext = WorkerRegisterContext.create(mBlockMaster, workerId, workerRequestObserver);<NEW_LINE>LOG.debug("Context created for {}", workerId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Verify the context is successfully initialized<NEW_LINE>Preconditions.checkState(mContext != null, "Stream message received from the client side but the context was not initialized!");<NEW_LINE>Preconditions.checkState(mContext.isOpen(), "WorkerRegisterContext has been closed before this message is received! " + "Probably %s was exceeded!", PropertyKey.MASTER_WORKER_REGISTER_STREAM_RESPONSE_TIMEOUT.toString());<NEW_LINE>// Update the TS before and after processing the request, so that when a message<NEW_LINE>// takes long to process, the stream does not time out.<NEW_LINE>mContext.updateTs();<NEW_LINE>mBlockMaster.workerRegisterStream(mContext, chunk, isHead);<NEW_LINE>mContext.updateTs();<NEW_LINE>// Return an ACK to the worker so it sends the next batch<NEW_LINE>return RegisterWorkerPResponse.newBuilder().build();<NEW_LINE>}
"The stream has been closed due to an earlier error received: %s", mErrorReceived.get());
349,191
private void processManifest(Manifest mf, ClassLoader mcl) {<NEW_LINE>if (mf != null) {<NEW_LINE>Attributes attrs = mf.getMainAttributes();<NEW_LINE>String cnames = null;<NEW_LINE>String xnames = null;<NEW_LINE>if (attrs != null) {<NEW_LINE>cnames = attrs.getValue(PROBE_PROVIDER_CLASS_NAMES);<NEW_LINE>if (cnames != null) {<NEW_LINE>if (LOGGER.isLoggable(Level.FINE))<NEW_LINE>LOGGER.log(Level.FINE, "probe providers = {0}", cnames);<NEW_LINE>StringTokenizer st = new StringTokenizer(cnames, DELIMITER);<NEW_LINE>while (st.hasMoreTokens()) {<NEW_LINE>try {<NEW_LINE>if (mcl != null)<NEW_LINE>processProbeProviderClass(mcl.loadClass(st.nextToken().trim()));<NEW_LINE>} catch (ClassNotFoundException | NoSuchElementException e) {<NEW_LINE>LOGGER.log(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>xnames = attrs.getValue(PROBE_PROVIDER_XML_FILE_NAMES);<NEW_LINE>if (xnames != null) {<NEW_LINE>if (LOGGER.isLoggable(Level.FINE))<NEW_LINE>LOGGER.log(Level.FINE, "xnames = {0}", xnames);<NEW_LINE>StringTokenizer st = new StringTokenizer(xnames, DELIMITER);<NEW_LINE>while (st.hasMoreTokens()) {<NEW_LINE>processProbeProviderXML(mcl, st.nextToken(), true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Level.SEVERE, unableToLoadProbeProvider, e);
1,762,651
public void update() {<NEW_LINE>MinecraftServer server = mod.getServer();<NEW_LINE>if (server == null) {<NEW_LINE>this.online = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ServerPlayerEntity player = server.<MASK><NEW_LINE>if (player == null) {<NEW_LINE>this.online = false;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.gamemode = GAMEMODE_MAP.get(player.interactionManager.getGameType());<NEW_LINE>if (this.gamemode == null)<NEW_LINE>this.gamemode = Gamemode.SURVIVAL;<NEW_LINE>EffectInstance invis = player.getActivePotionEffect(Effects.INVISIBILITY);<NEW_LINE>this.invisible = invis != null && invis.getDuration() > 0;<NEW_LINE>this.name = Text.of(player.getName().getString());<NEW_LINE>this.online = true;<NEW_LINE>net.minecraft.util.math.vector.Vector3d pos = player.getPositionVec();<NEW_LINE>this.position = new Vector3d(pos.getX(), pos.getY(), pos.getZ());<NEW_LINE>this.sneaking = player.isSneaking();<NEW_LINE>try {<NEW_LINE>this.world = mod.getUUIDForWorld(player.getServerWorld());<NEW_LINE>} catch (IOException e) {<NEW_LINE>this.world = UNKNOWN_WORLD_UUID;<NEW_LINE>}<NEW_LINE>}
getPlayerList().getPlayerByUUID(uuid);
1,053,279
public InteractionResultHolder<ItemStack> use(Level world, Player player, @Nonnull InteractionHand hand) {<NEW_LINE>ItemStack stack = player.getItemInHand(hand);<NEW_LINE>if (!world.isClientSide) {<NEW_LINE>ItemStack copy = stack.copy();<NEW_LINE>copy.setCount(1);<NEW_LINE>EntityThornChakram c = new EntityThornChakram(player, world, copy);<NEW_LINE>c.shootFromRotation(player, player.getXRot(), player.getYRot(), 0.0F, 1.5F, 1.0F);<NEW_LINE>SoundEvent sound = ModSounds.thornChakramThrow;<NEW_LINE>if (stack.is(ModItems.flareChakram)) {<NEW_LINE>c.setFire(true);<NEW_LINE>sound = ModSounds.flareChakramThrow;<NEW_LINE>}<NEW_LINE>world.addFreshEntity(c);<NEW_LINE>world.playSound(null, player.getX(), player.getY(), player.getZ(), sound, SoundSource.PLAYERS, 1F, 0.4F / (player.getRandom().nextFloat<MASK><NEW_LINE>stack.shrink(1);<NEW_LINE>}<NEW_LINE>return InteractionResultHolder.success(stack);<NEW_LINE>}
() * 0.4F + 0.8F));
1,297,126
public void readFromWithId(ShardSearchContextId id, StreamInput in) throws IOException {<NEW_LINE>this.contextId = id;<NEW_LINE>from = in.readVInt();<NEW_LINE>size = in.readVInt();<NEW_LINE>int numSortFieldsPlus1 = in.readVInt();<NEW_LINE>if (numSortFieldsPlus1 == 0) {<NEW_LINE>sortValueFormats = null;<NEW_LINE>} else {<NEW_LINE>sortValueFormats = new DocValueFormat[numSortFieldsPlus1 - 1];<NEW_LINE>for (int i = 0; i < sortValueFormats.length; ++i) {<NEW_LINE>sortValueFormats[i] = in.readNamedWriteable(DocValueFormat.class);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setTopDocs(readTopDocs(in));<NEW_LINE>if (in.getVersion().before(LegacyESVersion.V_7_7_0)) {<NEW_LINE>if (hasAggs = in.readBoolean()) {<NEW_LINE>aggregations = DelayableWriteable.referencing<MASK><NEW_LINE>}<NEW_LINE>if (in.getVersion().before(LegacyESVersion.V_7_2_0)) {<NEW_LINE>// The list of PipelineAggregators is sent by old versions. We don't need it anyway.<NEW_LINE>in.readNamedWriteableList(PipelineAggregator.class);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (hasAggs = in.readBoolean()) {<NEW_LINE>aggregations = DelayableWriteable.delayed(InternalAggregations::readFrom, in);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (in.readBoolean()) {<NEW_LINE>suggest = new Suggest(in);<NEW_LINE>}<NEW_LINE>searchTimedOut = in.readBoolean();<NEW_LINE>terminatedEarly = in.readOptionalBoolean();<NEW_LINE>profileShardResults = in.readOptionalWriteable(ProfileShardResult::new);<NEW_LINE>hasProfileResults = profileShardResults != null;<NEW_LINE>serviceTimeEWMA = in.readZLong();<NEW_LINE>nodeQueueSize = in.readInt();<NEW_LINE>if (in.getVersion().onOrAfter(LegacyESVersion.V_7_10_0)) {<NEW_LINE>setShardSearchRequest(in.readOptionalWriteable(ShardSearchRequest::new));<NEW_LINE>setRescoreDocIds(new RescoreDocIds(in));<NEW_LINE>}<NEW_LINE>}
(InternalAggregations.readFrom(in));
1,103,724
String format(@NonNull BiFunction<Integer, String, String> handler) {<NEW_LINE>Objects.requireNonNull(handler);<NEW_LINE>String pat = pattern;<NEW_LINE>StringBuilder result = new StringBuilder();<NEW_LINE>while (pat.length() > 0) {<NEW_LINE>int <MASK><NEW_LINE>if (subst < 0) {<NEW_LINE>result.append(pat);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>result.append(pat.substring(0, subst));<NEW_LINE>pat = pat.substring(subst + 1);<NEW_LINE>int end = pat.indexOf('}');<NEW_LINE>if (end < 0) {<NEW_LINE>throw new IllegalStateException("unmatched { in " + pat);<NEW_LINE>}<NEW_LINE>String substPat = pat.substring(0, end);<NEW_LINE>int dot = substPat.indexOf('.');<NEW_LINE>String key = "";<NEW_LINE>if (dot >= 0) {<NEW_LINE>key = substPat.substring(dot + 1);<NEW_LINE>substPat = substPat.substring(0, dot);<NEW_LINE>}<NEW_LINE>int fieldNum;<NEW_LINE>try {<NEW_LINE>fieldNum = Integer.parseInt(substPat);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new IllegalArgumentException("Bad integer value " + substPat + " in " + pattern);<NEW_LINE>}<NEW_LINE>if (fieldNum < 0) {<NEW_LINE>throw new IllegalArgumentException("The given fieldNum was negative: " + fieldNum);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>result.append(handler.apply(fieldNum, key));<NEW_LINE>} catch (IllegalArgumentException iae) {<NEW_LINE>throw new IllegalArgumentException("Problem processing " + pattern + " format " + substPat, iae);<NEW_LINE>}<NEW_LINE>pat = pat.substring(end + 1);<NEW_LINE>}<NEW_LINE>return result.toString();<NEW_LINE>}
subst = pat.indexOf('{');
1,716,351
public DescribeAlarmsForMetricResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeAlarmsForMetricResult describeAlarmsForMetricResult = new DescribeAlarmsForMetricResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 2;<NEW_LINE>while (true) {<NEW_LINE>int xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent == XmlPullParser.END_DOCUMENT)<NEW_LINE>break;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("MetricAlarms/member", targetDepth)) {<NEW_LINE>describeAlarmsForMetricResult.withMetricAlarms(MetricAlarmStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent == XmlPullParser.END_TAG) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return describeAlarmsForMetricResult;<NEW_LINE>}
().unmarshall(context));
401,313
final CreateJobResult executeCreateJob(CreateJobRequest createJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateJobRequest> request = null;<NEW_LINE>Response<CreateJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateJobRequestMarshaller().marshall(super.beforeMarshalling(createJobRequest));<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, "S3 Control");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>ValidationUtils.assertStringNotEmpty(createJobRequest.getAccountId(), "AccountId");<NEW_LINE>HostnameValidator.validateHostnameCompliant(createJobRequest.<MASK><NEW_LINE>String hostPrefix = "{AccountId}.";<NEW_LINE>String resolvedHostPrefix = String.format("%s.", createJobRequest.getAccountId());<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<CreateJobResult> responseHandler = new com.amazonaws.services.s3control.internal.S3ControlStaxResponseHandler<CreateJobResult>(new CreateJobResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
getAccountId(), "AccountId", "createJobRequest");
1,741,131
public void run() {<NEW_LINE>Map<String, String> strategyMap = cm.getHashAll(UAV_CACHE_REGION, RT_STRATEGY_KEY);<NEW_LINE>try {<NEW_LINE>strategyLock.lockInterruptibly();<NEW_LINE>fScope.clear();<NEW_LINE>mScope.clear();<NEW_LINE>iScope.clear();<NEW_LINE>multiInsts.clear();<NEW_LINE>strategies.clear();<NEW_LINE>if (null == strategyMap || strategyMap.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (String key : strategyMap.keySet()) {<NEW_LINE>String json = strategyMap.get(key);<NEW_LINE>NotifyStrategy stra <MASK><NEW_LINE>if (log.isDebugEnable()) {<NEW_LINE>log.debug(this, "Parse NotifyStrategy: " + JSONHelper.toString(stra));<NEW_LINE>}<NEW_LINE>if ("I".equals(stra.getScope()) && !stra.getInstances().isEmpty()) {<NEW_LINE>// deal with multi instances<NEW_LINE>putMultiInstStrategy(key, stra);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>putStrategy(key, stra);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// ignore<NEW_LINE>} finally {<NEW_LINE>strategyLock.unlock();<NEW_LINE>}<NEW_LINE>}
= new NotifyStrategy(key, json);
136,027
protected void startUp() {<NEW_LINE>eventBus.register(this);<NEW_LINE>LOG.debug("Starting processing status recorder service");<NEW_LINE>try {<NEW_LINE>dbService.get().ifPresent(processingStatus -> {<NEW_LINE>LOG.debug("Loaded persisted processing status: {}", processingStatus);<NEW_LINE>// Do not directly set the timestamps on the atomic reference to make sure latestTimestamp() is used.<NEW_LINE>// The timestamps could already have been updated once the database call is finished.<NEW_LINE>final ProcessingStatusDto.<MASK><NEW_LINE>updateIngestReceiveTime(receiveTimes.ingest());<NEW_LINE>updatePostProcessingReceiveTime(receiveTimes.postProcessing());<NEW_LINE>updatePostIndexingReceiveTime(receiveTimes.postIndexing());<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Couldn't load persisted processing status", e);<NEW_LINE>}<NEW_LINE>final long interval = persistInterval.toMilliseconds();<NEW_LINE>future = scheduler.scheduleWithFixedDelay(this::doPersist, interval, interval, TimeUnit.MILLISECONDS);<NEW_LINE>}
ReceiveTimes receiveTimes = processingStatus.receiveTimes();
19,526
protected List findByCompanyId(String companyId, int begin, int end, OrderByComparator obc) throws SystemException {<NEW_LINE>Session session = null;<NEW_LINE>try {<NEW_LINE>session = openSession();<NEW_LINE>StringBuffer query = new StringBuffer();<NEW_LINE>query.append("FROM UserTracker IN CLASS com.liferay.portal.ejb.UserTrackerHBM WHERE ");<NEW_LINE>query.append("companyId = ?");<NEW_LINE>query.append(" ");<NEW_LINE>if (obc != null) {<NEW_LINE>query.append("ORDER BY " + obc.getOrderBy());<NEW_LINE>}<NEW_LINE>Query q = session.createQuery(query.toString());<NEW_LINE>int queryPos = 0;<NEW_LINE>q<MASK><NEW_LINE>List list = new ArrayList();<NEW_LINE>if (getDialect().supportsLimit()) {<NEW_LINE>q.setMaxResults(end - begin);<NEW_LINE>q.setFirstResult(begin);<NEW_LINE>Iterator itr = q.list().iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>UserTrackerHBM userTrackerHBM = (UserTrackerHBM) itr.next();<NEW_LINE>list.add(UserTrackerHBMUtil.model(userTrackerHBM));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ScrollableResults sr = q.scroll();<NEW_LINE>if (sr.first() && sr.scroll(begin)) {<NEW_LINE>for (int i = begin; i < end; i++) {<NEW_LINE>UserTrackerHBM userTrackerHBM = (UserTrackerHBM) sr.get(0);<NEW_LINE>list.add(UserTrackerHBMUtil.model(userTrackerHBM));<NEW_LINE>if (!sr.next()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} catch (HibernateException he) {<NEW_LINE>throw new SystemException(he);<NEW_LINE>} finally {<NEW_LINE>HibernateUtil.closeSession(session);<NEW_LINE>}<NEW_LINE>}
.setString(queryPos++, companyId);
162,346
private static void heapDump(SparkPlatform platform, CommandSender sender, CommandResponseHandler resp, Arguments arguments) {<NEW_LINE>Path file = platform.resolveSaveFile("heap", HeapDump.isOpenJ9() ? "phd" : "hprof");<NEW_LINE>boolean liveOnly = !arguments.boolFlag("include-non-live");<NEW_LINE>if (arguments.boolFlag("run-gc-before")) {<NEW_LINE>resp.broadcastPrefixed(text("Running garbage collector..."));<NEW_LINE>System.gc();<NEW_LINE>}<NEW_LINE>resp.broadcastPrefixed(text("Creating a new heap dump, please wait..."));<NEW_LINE>try {<NEW_LINE>HeapDump.dumpHeap(file, liveOnly);<NEW_LINE>} catch (Exception e) {<NEW_LINE>resp.broadcastPrefixed(text("An error occurred whilst creating a heap dump.", RED));<NEW_LINE>e.printStackTrace();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>resp.broadcastPrefixed(text().content("Heap dump written to: ").color(GOLD).append(text(file.toString(), GRAY)).build());<NEW_LINE>platform.getActivityLog().addToLog(Activity.fileActivity(sender, System.currentTimeMillis(), "Heap dump"<MASK><NEW_LINE>Compression compressionMethod = null;<NEW_LINE>Iterator<String> compressArgs = arguments.stringFlag("compress").iterator();<NEW_LINE>if (compressArgs.hasNext()) {<NEW_LINE>try {<NEW_LINE>compressionMethod = Compression.valueOf(compressArgs.next().toUpperCase());<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (compressionMethod != null) {<NEW_LINE>try {<NEW_LINE>heapDumpCompress(platform, resp, file, compressionMethod);<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, file.toString()));
1,357,395
private void init() {<NEW_LINE>try {<NEW_LINE>UnitConfig uc = loadUnit();<NEW_LINE>// Unit<NEW_LINE>jSTempTimeOut.setValue(new Integer(uc.getTempTimeOutHour()));<NEW_LINE>jSProxyTimeOut.setValue(new Integer(uc.getProxyTimeOutHour()));<NEW_LINE>jSInterval.setValue(new Integer(uc.getInterval()));<NEW_LINE>cbAutoStart.setSelected(uc.isAutoStart());<NEW_LINE>List<Host> hosts = uc.getHosts();<NEW_LINE>if (hosts != null) {<NEW_LINE>for (int i = 0, size = hosts.size(); i < size; i++) {<NEW_LINE>Host host = hosts.get(i);<NEW_LINE>int row = tableHosts.addRow();<NEW_LINE>tableHosts.data.setValueAt(host.getIp(), row, COL_HOST);<NEW_LINE>tableHosts.data.setValueAt(host.getPort(), row, COL_PORT);<NEW_LINE>tableHosts.data.setValueAt(host.getMaxTaskNum(), row, COL_MAXTASKNUM);<NEW_LINE>boolean isLocal = AppUtil.isLocalIP(host.getIp());<NEW_LINE>tableHosts.data.setValueAt(isLocal ? YES : NO, row, COL_ISLOCAL);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (rc > 0) {<NEW_LINE>rc--;<NEW_LINE>tableHosts.rowfocusChanged(rc, rc);<NEW_LINE>}<NEW_LINE>// Client<NEW_LINE>cbCheck.setSelected(uc.isCheckClients());<NEW_LINE>List<String> starts = uc.getEnabledClientsStart();<NEW_LINE>List<String> ends = uc.getEnabledClientsEnd();<NEW_LINE>if (starts != null) {<NEW_LINE>for (int i = 0, size = starts.size(); i < size; i++) {<NEW_LINE>String start = starts.get(i);<NEW_LINE>String end = ends.get(i);<NEW_LINE>int row = tableClients.addRow();<NEW_LINE>tableClients.data.setValueAt(start, row, COL_START);<NEW_LINE>tableClients.data.setValueAt(end, row, COL_END);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>}
int rc = tableHosts.getRowCount();
388
private void createProjectsRoot(Composite workArea) {<NEW_LINE>// project specification group<NEW_LINE>Composite projectGroup = new Composite(workArea, SWT.NONE);<NEW_LINE>GridLayout layout = new GridLayout();<NEW_LINE>layout.numColumns = 3;<NEW_LINE>layout.makeColumnsEqualWidth = false;<NEW_LINE>layout.marginWidth = 0;<NEW_LINE>projectGroup.setLayout(layout);<NEW_LINE>projectGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));<NEW_LINE>// project location entry field<NEW_LINE>Label l = new Label(projectGroup, SWT.NONE);<NEW_LINE>l.setText(EplMessages.WizardFolderImportPage_SelectFolder);<NEW_LINE>this.directoryPathField = new Text(projectGroup, SWT.BORDER);<NEW_LINE>this.directoryPathField.addModifyListener(modifyListener);<NEW_LINE>this.directoryPathField.setLayoutData(new GridData(GridData<MASK><NEW_LINE>// browse button<NEW_LINE>browseDirectoriesButton = new Button(projectGroup, SWT.PUSH);<NEW_LINE>browseDirectoriesButton.setText(DataTransferMessages.DataTransfer_browse);<NEW_LINE>setButtonLayoutData(browseDirectoriesButton);<NEW_LINE>browseDirectoriesButton.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>handleLocationDirectoryButtonPressed();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// project name entry field<NEW_LINE>l = new Label(projectGroup, SWT.NONE);<NEW_LINE>l.setText(EplMessages.WizardFolderImportPage_ProjectName);<NEW_LINE>projectNameField = new Text(projectGroup, SWT.BORDER);<NEW_LINE>projectNameField.addModifyListener(modifyListener);<NEW_LINE>projectNameField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));<NEW_LINE>}
.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
1,775,874
private // not the nicest but this is always the case anyway.<NEW_LINE>FlightDataType findFlightDataType(String name) {<NEW_LINE>// Kevins version with lookup by key. Not using right now<NEW_LINE>// Look in built in types<NEW_LINE>for (FlightDataType t : FlightDataType.ALL_TYPES) {<NEW_LINE>if (t.getName().equals(name)) {<NEW_LINE>return t;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Replace deprecated 'Position upwind' with new 'Position North of launch' option<NEW_LINE>if (name.equals(trans.get("FlightDataType.TYPE_UPWIND"))) {<NEW_LINE>return FlightDataType.TYPE_POSITION_Y;<NEW_LINE>}<NEW_LINE>// Look in custom expressions<NEW_LINE>for (CustomExpression exp : simHandler.getDocument().getCustomExpressions()) {<NEW_LINE>if (exp.getName().equals(name)) {<NEW_LINE>return exp.getType();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.warn("Could not find the flight data type '" + name + "' used in the XML file. Substituted type with unknown symbol and units.");<NEW_LINE>return FlightDataType.getType(<MASK><NEW_LINE>}
name, "Unknown", UnitGroup.UNITS_NONE);
1,810,532
private void resolveGroups(String dispName, String include, String exclude) {<NEW_LINE>// NOI18N<NEW_LINE>LOGGER.fine("resolveGroups include=" + include);<NEW_LINE>List<String> applicablePaths = getApplicablePaths(Collections.singleton(include), Collections.singleton(exclude));<NEW_LINE>Set<String> groups <MASK><NEW_LINE>Pattern p = Pattern.compile(include);<NEW_LINE>for (String path : applicablePaths) {<NEW_LINE>Matcher m = p.matcher(path);<NEW_LINE>m.matches();<NEW_LINE>if (m.groupCount() == 1) {<NEW_LINE>String group = m.group(1);<NEW_LINE>if (group != null) {<NEW_LINE>groups.add(group);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>LOGGER.fine("GROUPS=" + groups);<NEW_LINE>for (String group : groups) {<NEW_LINE>// add additional items according to groups<NEW_LINE>String newDisplayName = group;<NEW_LINE>if (dispName.contains("{")) {<NEW_LINE>// NOI18N<NEW_LINE>newDisplayName = MessageFormat.format(dispName, group);<NEW_LINE>}<NEW_LINE>addItem(newDisplayName, include.replace(GROUP_PATTERN, group), exclude);<NEW_LINE>}<NEW_LINE>}
= new HashSet<String>();
249,753
protected void doExecute(Task task, DeleteCalendarAction.Request request, ActionListener<AcknowledgedResponse> listener) {<NEW_LINE>final String calendarId = request.getCalendarId();<NEW_LINE>ActionListener<Calendar> calendarListener = ActionListener.wrap(calendar -> {<NEW_LINE>// Delete calendar and events<NEW_LINE>DeleteByQueryRequest dbqRequest = buildDeleteByQuery(calendarId);<NEW_LINE>executeAsyncWithOrigin(client, ML_ORIGIN, DeleteByQueryAction.INSTANCE, dbqRequest, ActionListener.wrap(response -> {<NEW_LINE>if (response.getDeleted() == 0) {<NEW_LINE>listener.onFailure(new ResourceNotFoundException("No calendar with id [" + calendarId + "]"));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>jobManager.updateProcessOnCalendarChanged(calendar.getJobIds(), ActionListener.wrap(r -> listener.onResponse(AcknowledgedResponse.TRUE), listener::onFailure));<NEW_LINE>}, listener::onFailure));<NEW_LINE>}, listener::onFailure);<NEW_LINE><MASK><NEW_LINE>}
jobResultsProvider.calendar(calendarId, calendarListener);
1,828,777
private void registerHostnameVerifier(String verifier, RestClientBuilder builder) {<NEW_LINE>try {<NEW_LINE>Class<?> verifierClass = Thread.currentThread().getContextClassLoader().loadClass(verifier);<NEW_LINE>builder.hostnameVerifier((HostnameVerifier) verifierClass.<MASK><NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>throw new RuntimeException("Could not find a public, no-argument constructor for the hostname verifier class " + verifier, e);<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new RuntimeException("Could not find hostname verifier class " + verifier, e);<NEW_LINE>} catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {<NEW_LINE>throw new RuntimeException("Failed to instantiate hostname verifier class " + verifier + ". Make sure it has a public, no-argument constructor", e);<NEW_LINE>} catch (ClassCastException e) {<NEW_LINE>throw new RuntimeException("The provided hostname verifier " + verifier + " is not an instance of HostnameVerifier", e);<NEW_LINE>}<NEW_LINE>}
getDeclaredConstructor().newInstance());
494,732
public static void sendAlloyForMelting(FluidStack output, Object... input) {<NEW_LINE>assert (input.length % 2 == 0);<NEW_LINE>FluidStack[] inputStacks = new FluidStack[input.length / 2];<NEW_LINE>for (int i = 0; i < inputStacks.length; i++) if (input[i * 2] instanceof String && input[i * 2 + 1] instanceof Integer) {<NEW_LINE>Fluid f = FluidRegistry.getFluid((String) input[i * 2]);<NEW_LINE>if (f != null)<NEW_LINE>inputStacks[i] = new FluidStack(f, (Integer) input[i * 2 + 1]);<NEW_LINE>}<NEW_LINE>ListNBT tagList = new ListNBT();<NEW_LINE>tagList.add(output.writeToNBT(new CompoundNBT()));<NEW_LINE>for (FluidStack stack : inputStacks) if (stack != null)<NEW_LINE>tagList.add(stack.writeToNBT(new CompoundNBT()));<NEW_LINE>CompoundNBT message = new CompoundNBT();<NEW_LINE><MASK><NEW_LINE>// FMLInterModComms.sendMessage("tconstruct", "alloy", message);<NEW_LINE>// For some reason IMC on this is broken? So direct interaction is required. Oh well.<NEW_LINE>TinkerRegistry.registerAlloy(output, inputStacks);<NEW_LINE>}
message.put("alloy", tagList);
418,845
public void openRemoteDatabase(OChannelBinaryAsynchClient network) throws IOException {<NEW_LINE>OStorageRemoteSession session = getCurrentSession();<NEW_LINE>OStorageRemoteNodeSession nodeSession = session.getOrCreateServerSession(network.getServerURL());<NEW_LINE>OOpen37Request request = new OOpen37Request(name, session.connectionUserName, session.connectionUserPassword);<NEW_LINE>try {<NEW_LINE>network.<MASK><NEW_LINE>network.writeInt(nodeSession.getSessionId());<NEW_LINE>network.writeBytes(null);<NEW_LINE>request.write(network, session);<NEW_LINE>} finally {<NEW_LINE>endRequest(network);<NEW_LINE>}<NEW_LINE>final int sessionId;<NEW_LINE>OOpen37Response response = request.createResponse();<NEW_LINE>try {<NEW_LINE>network.beginResponse(nodeSession.getSessionId(), true);<NEW_LINE>response.read(network, session);<NEW_LINE>} finally {<NEW_LINE>endResponse(network);<NEW_LINE>connectionManager.release(network);<NEW_LINE>}<NEW_LINE>sessionId = response.getSessionId();<NEW_LINE>byte[] token = response.getSessionToken();<NEW_LINE>if (token.length == 0) {<NEW_LINE>token = null;<NEW_LINE>}<NEW_LINE>nodeSession.setSession(sessionId, token);<NEW_LINE>OLogManager.instance().debug(this, "Client connected to %s with session id=%d", network.getServerURL(), sessionId);<NEW_LINE>// READ CLUSTER CONFIGURATION<NEW_LINE>// updateClusterConfiguration(network.getServerURL(),<NEW_LINE>// response.getDistributedConfiguration());<NEW_LINE>// This need to be protected by a lock for now, let's see in future<NEW_LINE>stateLock.acquireWriteLock();<NEW_LINE>try {<NEW_LINE>status = STATUS.OPEN;<NEW_LINE>} finally {<NEW_LINE>stateLock.releaseWriteLock();<NEW_LINE>}<NEW_LINE>}
writeByte(request.getCommand());
184,655
public boolean visit(MySqlSelectQueryBlock x) {<NEW_LINE>if (x.getFrom() != null) {<NEW_LINE>final SQLExpr sqlExpr = SQLUtils.buildCondition(SQLBinaryOperator.BooleanAnd, SQLUtils.toSQLExpr("1!=1"), true, x.getWhere());<NEW_LINE>x.setWhere(sqlExpr);<NEW_LINE>} else {<NEW_LINE>// if a sql without reference any table. it shouldn't add '1!=1' condition. Although it works in msyql 8.0 but cause syntax error in mysql 5.7.<NEW_LINE>}<NEW_LINE>x.setGroupBy(null);<NEW_LINE>x.setOrderBy(null);<NEW_LINE>x.setLimit(new SQLLimit<MASK><NEW_LINE>if (isFirstSelectQuery) {<NEW_LINE>final List<String> commentsDirect = x.getBeforeCommentsDirect();<NEW_LINE>final String comment = "/* used for prepare statement. */";<NEW_LINE>if (commentsDirect != null) {<NEW_LINE>commentsDirect.add(0, comment);<NEW_LINE>} else {<NEW_LINE>x.addBeforeComment(comment);<NEW_LINE>}<NEW_LINE>isFirstSelectQuery = false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
(new SQLIntegerExpr(0)));
1,053,037
private AddEntryResult addEntry(final int recordVersion, final byte[] entryContent, final OAtomicOperation atomicOperation) throws IOException {<NEW_LINE>int recordSizesDiff;<NEW_LINE>int position;<NEW_LINE>int finalVersion = 0;<NEW_LINE>long pageIndex;<NEW_LINE>do {<NEW_LINE>final FindFreePageResult findFreePageResult = findFreePage(entryContent.length, atomicOperation);<NEW_LINE>final int freePageIndex = findFreePageResult.freePageIndex;<NEW_LINE>pageIndex = findFreePageResult.pageIndex;<NEW_LINE>final boolean newRecord = freePageIndex >= FREE_LIST_SIZE;<NEW_LINE>OCacheEntry cacheEntry = loadPageForWrite(atomicOperation, fileId, pageIndex, false, true);<NEW_LINE>if (cacheEntry == null) {<NEW_LINE>cacheEntry = addPage(atomicOperation, fileId);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final OClusterPage localPage = new OClusterPage(cacheEntry);<NEW_LINE>if (newRecord) {<NEW_LINE>localPage.init();<NEW_LINE>}<NEW_LINE>assert newRecord || freePageIndex == calculateFreePageIndex(localPage);<NEW_LINE>final int initialFreeSpace = localPage.getFreeSpace();<NEW_LINE>position = localPage.appendRecord(recordVersion, entryContent, -1, atomicOperation.getBookedRecordPositions(id, cacheEntry.getPageIndex()));<NEW_LINE>final <MASK><NEW_LINE>recordSizesDiff = initialFreeSpace - freeSpace;<NEW_LINE>if (position >= 0) {<NEW_LINE>finalVersion = localPage.getRecordVersion(position);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>releasePageFromWrite(atomicOperation, cacheEntry);<NEW_LINE>}<NEW_LINE>updateFreePagesIndex(freePageIndex, pageIndex, atomicOperation);<NEW_LINE>} while (position < 0);<NEW_LINE>return new AddEntryResult(pageIndex, position, finalVersion, recordSizesDiff);<NEW_LINE>}
int freeSpace = localPage.getFreeSpace();
1,126,768
Mark mark(int methodId, ProfilingSessionStatus status) {<NEW_LINE>ClientUtils.SourceCodeSelection method = null;<NEW_LINE>synchronized (markGuard) {<NEW_LINE>if (marks == null || marks.length == 0 || status == null) {<NEW_LINE>return Mark.DEFAULT;<NEW_LINE>}<NEW_LINE>status.beginTrans(false);<NEW_LINE>try {<NEW_LINE>String[<MASK><NEW_LINE>String[] mNames = status.getInstrMethodNames();<NEW_LINE>String[] sigs = status.getInstrMethodSignatures();<NEW_LINE>if (mNames.length <= methodId || cNames.length <= methodId || sigs.length <= methodId) {<NEW_LINE>int maxMid = Math.min(Math.min(mNames.length, cNames.length), sigs.length);<NEW_LINE>LOGGER.log(Level.WARNING, INVALID_MID, new Object[] { methodId, maxMid });<NEW_LINE>} else {<NEW_LINE>method = new ClientUtils.SourceCodeSelection(cNames[methodId], mNames[methodId], sigs[methodId]);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>status.endTrans();<NEW_LINE>}<NEW_LINE>if (method != null) {<NEW_LINE>String methodSig = method.toFlattened();<NEW_LINE>for (int i = 0; i < marks.length; i++) {<NEW_LINE>if (methodSig.startsWith(marks[i].markSig)) {<NEW_LINE>return marks[i].mark;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Mark.DEFAULT;<NEW_LINE>}<NEW_LINE>}
] cNames = status.getInstrMethodClasses();
1,671,320
public void addAll(final List<? extends Entry> entries, final OBinarySerializer<K> keySerializer, final boolean isEncrypted) {<NEW_LINE>final int currentSize = size();<NEW_LINE>final boolean isLeaf = isLeaf();<NEW_LINE>if (!isLeaf) {<NEW_LINE>for (int i = 0; i < entries.size(); i++) {<NEW_LINE>final NonLeafEntry entry = (NonLeafEntry) entries.get(i);<NEW_LINE>doAddNonLeafEntry(i + currentSize, entry.key, entry.leftChild, entry.rightChild, false);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < entries.size(); i++) {<NEW_LINE>final LeafEntry entry = (LeafEntry) entries.get(i);<NEW_LINE>final <MASK><NEW_LINE>final List<ORID> values = entry.values;<NEW_LINE>if (!values.isEmpty()) {<NEW_LINE>doCreateMainLeafEntry(i + currentSize, key, values.get(0), entry.mId);<NEW_LINE>} else {<NEW_LINE>doCreateMainLeafEntry(i + currentSize, key, null, entry.mId);<NEW_LINE>}<NEW_LINE>if (values.size() > 1) {<NEW_LINE>appendNewLeafEntries(i + currentSize, values.subList(1, values.size()), entry.entriesCount);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setIntValue(SIZE_OFFSET, currentSize + entries.size());<NEW_LINE>if (isLeaf) {<NEW_LINE>// noinspection unchecked<NEW_LINE>addPageOperation(new CellBTreeMultiValueV2BucketAddAllLeafEntriesPO(currentSize, (List<LeafEntry>) entries, keySerializer, isEncrypted));<NEW_LINE>} else {<NEW_LINE>// noinspection unchecked<NEW_LINE>addPageOperation(new CellBTreeMultiValueV2BucketAddAllNonLeafEntriesPO(currentSize, (List<NonLeafEntry>) entries, keySerializer, isEncrypted));<NEW_LINE>}<NEW_LINE>}
byte[] key = entry.key;
537,684
public HbaseOutputFormat finish() {<NEW_LINE>Preconditions.checkNotNull(format.host, "zookeeperQuorum should be specified");<NEW_LINE>Preconditions.checkNotNull(format.tableName, "tableName should be specified");<NEW_LINE>Preconditions.checkNotNull(format.columnNames, "columnNames should be specified");<NEW_LINE>Preconditions.checkArgument(format.columnNames.length != 0, "columnNames length should not be zero");<NEW_LINE>String[] families = new String[format.columnNames.length];<NEW_LINE>String[] qualifiers = new <MASK><NEW_LINE>if (format.columnNameFamily != null) {<NEW_LINE>List<String> keyList = new LinkedList<>(format.columnNameFamily.keySet());<NEW_LINE>String[] columns = keyList.toArray(new String[0]);<NEW_LINE>for (int i = 0; i < columns.length; ++i) {<NEW_LINE>String col = columns[i];<NEW_LINE>String[] part = col.split(":");<NEW_LINE>families[i] = part[0];<NEW_LINE>qualifiers[i] = part[1];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>format.families = families;<NEW_LINE>format.qualifiers = qualifiers;<NEW_LINE>return format;<NEW_LINE>}
String[format.columnNames.length];
699,499
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE><MASK><NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_termux_api);<NEW_LINE>// Set NightMode.APP_NIGHT_MODE<NEW_LINE>TermuxThemeUtils.setAppNightMode(this);<NEW_LINE>AppCompatActivityUtils.setNightMode(this, NightMode.getAppNightMode().getName(), true);<NEW_LINE>AppCompatActivityUtils.setToolbar(this, R.id.toolbar);<NEW_LINE>AppCompatActivityUtils.setToolbarTitle(this, R.id.toolbar, TermuxConstants.TERMUX_API_APP_NAME, 0);<NEW_LINE>TextView pluginInfo = findViewById(R.id.textview_plugin_info);<NEW_LINE>pluginInfo.setText(getString(R.string.plugin_info, TermuxConstants.TERMUX_GITHUB_REPO_URL, TermuxConstants.TERMUX_API_GITHUB_REPO_URL, TermuxConstants.TERMUX_API_APT_PACKAGE_NAME, TermuxConstants.TERMUX_API_APT_GITHUB_REPO_URL));<NEW_LINE>mBatteryOptimizationNotDisabledWarning = findViewById(R.id.textview_battery_optimization_not_disabled_warning);<NEW_LINE>mDisableBatteryOptimization = findViewById(R.id.btn_disable_battery_optimizations);<NEW_LINE>mDisableBatteryOptimization.setOnClickListener(v -> requestDisableBatteryOptimizations());<NEW_LINE>mDisplayOverOtherAppsPermissionNotGrantedWarning = findViewById(R.id.textview_display_over_other_apps_not_granted_warning);<NEW_LINE>mGrantDisplayOverOtherAppsPermission = findViewById(R.id.btn_grant_display_over_other_apps_permission);<NEW_LINE>mGrantDisplayOverOtherAppsPermission.setOnClickListener(v -> requestDisplayOverOtherAppsPermission());<NEW_LINE>}
Logger.logDebug(LOG_TAG, "onCreate");
326,684
private boolean updateExistingSchemas(String namespace, String compression, List<ChangeSet> changeSets, List<HTableDescriptor> currentHtds, List<SchemaChangeLog> executedLogs) {<NEW_LINE><MASK><NEW_LINE>List<String> executedChangeLogIds = executedLogs.stream().map(SchemaChangeLog::getId).collect(Collectors.toList());<NEW_LINE>logger.info("[{}] Executed change logs : {}", namespace, executedChangeLogIds);<NEW_LINE>ChangeSetManager changeSetManager = new ChangeSetManager(changeSets);<NEW_LINE>// Check if the current table schema matches the expected schema specified by the executed schema change logs.<NEW_LINE>HbaseSchemaCommandManager initCommandManager = new HbaseSchemaCommandManager(namespace, compression);<NEW_LINE>List<ChangeSet> executedChangeSets = changeSetManager.getExecutedChangeSets(executedLogs);<NEW_LINE>for (ChangeSet executedChangeSet : executedChangeSets) {<NEW_LINE>initCommandManager.applyChangeSet(executedChangeSet);<NEW_LINE>}<NEW_LINE>if (!hbaseSchemaVerifier.verifySchemas(initCommandManager.getSchemaSnapshot(), currentHtds)) {<NEW_LINE>throw new IllegalStateException("Current table schema does not match the schema change log records.");<NEW_LINE>}<NEW_LINE>List<ChangeSet> changeSetsToApply = changeSetManager.filterExecutedChangeSets(executedLogs);<NEW_LINE>if (changeSetsToApply.isEmpty()) {<NEW_LINE>logger.info("[{}] Hbase schema already at latest version", namespace);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>HbaseSchemaCommandManager updateCommandManager = new HbaseSchemaCommandManager(namespace, compression, currentHtds);<NEW_LINE>return applyChangeSets(updateCommandManager, changeSetsToApply, executedLogs);<NEW_LINE>}
logger.info("[{}] Updating hbase schema.", namespace);
948,030
public void handleNotification(Notification notification) {<NEW_LINE>super.handleNotification(notification);<NEW_LINE>Sandbox sandbox = Sandbox.getInstance();<NEW_LINE><MASK><NEW_LINE>switch(notification.getName()) {<NEW_LINE>case Overlap2DMenuBar.CUSTOM_VARIABLES_EDITOR_OPEN:<NEW_LINE>viewComponent.show(uiStage);<NEW_LINE>break;<NEW_LINE>case UIBasicItemProperties.CUSTOM_VARS_BUTTON_CLICKED:<NEW_LINE>viewComponent.show(uiStage);<NEW_LINE>break;<NEW_LINE>case MsgAPI.ITEM_SELECTION_CHANGED:<NEW_LINE>Set<Entity> selection = notification.getBody();<NEW_LINE>if (selection.size() == 1) {<NEW_LINE>setObservable(selection.iterator().next());<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case MsgAPI.EMPTY_SPACE_CLICKED:<NEW_LINE>setObservable(null);<NEW_LINE>break;<NEW_LINE>case CustomVariablesDialog.ADD_BUTTON_PRESSED:<NEW_LINE>setVariable();<NEW_LINE>break;<NEW_LINE>case CustomVariablesDialog.DELETE_BUTTON_PRESSED:<NEW_LINE>removeVariable(notification.getBody());<NEW_LINE>break;<NEW_LINE>case CustomVariableModifyCommand.DONE:<NEW_LINE>updateView();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
UIStage uiStage = sandbox.getUIStage();
81,547
void jbInit() throws Exception {<NEW_LINE>this.setLayout(borderLayout1);<NEW_LINE>textF.setEditable(false);<NEW_LINE>textF.setText(text);<NEW_LINE>cancelB.setMaximumSize(new Dimension(120, 26));<NEW_LINE>cancelB.setMinimumSize(new Dimension(80, 26));<NEW_LINE>cancelB.setPreferredSize(new Dimension(120, 26));<NEW_LINE>cancelB.setText(Local.getString("Cancel"));<NEW_LINE>cancelB.setFocusable(false);<NEW_LINE>cancelB.addActionListener(new java.awt.event.ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>cancelB_actionPerformed(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>continueB.addActionListener(new java.awt.event.ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>continueB_actionPerformed(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>continueB.setText(Local.getString("Find next"));<NEW_LINE>continueB.setPreferredSize(new Dimension(120, 26));<NEW_LINE>continueB.setMinimumSize(new Dimension(80, 26));<NEW_LINE>continueB.setMaximumSize(new Dimension(120, 26));<NEW_LINE>continueB.setFocusable(false);<NEW_LINE><MASK><NEW_LINE>buttonsPanel.setLayout(flowLayout1);<NEW_LINE>jLabel1.setText(" " + Local.getString("Search for") + ": ");<NEW_LINE>jLabel1.setIcon(new ImageIcon(HTMLEditor.class.getResource("resources/icons/findbig.png")));<NEW_LINE>this.add(jLabel1, BorderLayout.WEST);<NEW_LINE>this.add(textF, BorderLayout.CENTER);<NEW_LINE>buttonsPanel.add(continueB, null);<NEW_LINE>buttonsPanel.add(cancelB, null);<NEW_LINE>this.add(buttonsPanel, BorderLayout.EAST);<NEW_LINE>}
flowLayout1.setAlignment(FlowLayout.RIGHT);
1,177,858
// helper method for repeatHelper.<NEW_LINE>private static int findInterval(String inputText) {<NEW_LINE>HashMap<String, Integer> wordsToNum = new HashMap<String, Integer>();<NEW_LINE>String[] words = new String[] { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve" };<NEW_LINE>for (int i = 0; i < words.length; i++) {<NEW_LINE>wordsToNum.put(words[i], i + 1);<NEW_LINE>wordsToNum.put(Integer.toString(i + 1), i + 1);<NEW_LINE>}<NEW_LINE>wordsToNum.put("other", 2);<NEW_LINE>Pattern pattern = Pattern.compile("(?i)\\bevery (\\w*)\\b");<NEW_LINE>int interval = 1;<NEW_LINE>Matcher m = pattern.matcher(inputText);<NEW_LINE>if (m.find() && m.group(1) != null) {<NEW_LINE>String intervalStr = m.group(1);<NEW_LINE>if (wordsToNum.containsKey(intervalStr))<NEW_LINE><MASK><NEW_LINE>else {<NEW_LINE>try {<NEW_LINE>interval = Integer.parseInt(intervalStr);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>// Ah well<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return interval;<NEW_LINE>}
interval = wordsToNum.get(intervalStr);
1,101,720
public TrialMinutes unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>TrialMinutes trialMinutes = new TrialMinutes();<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("total", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>trialMinutes.setTotal(context.getUnmarshaller(Double.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("remaining", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>trialMinutes.setRemaining(context.getUnmarshaller(Double.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 trialMinutes;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
860,217
void addAll(String[] unmatched) {<NEW_LINE>if (setter != null) {<NEW_LINE>try {<NEW_LINE>setter.set(unmatched);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new PicocliException(String.format("Could not invoke setter (%s) with unmatched argument array '%s': %s", setter, Arrays.toString(unmatched), ex), ex);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>Collection<String> collection = getter.get();<NEW_LINE>if (collection == null) {<NEW_LINE>collection = new ArrayList<String>();<NEW_LINE>((ISetter) getter).set(collection);<NEW_LINE>}<NEW_LINE>collection.addAll<MASK><NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new PicocliException(String.format("Could not add unmatched argument array '%s' to collection returned by getter (%s): %s", Arrays.toString(unmatched), getter, ex), ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(Arrays.asList(unmatched));
620,376
public void startUp(FloodlightModuleContext context) {<NEW_LINE>// paag: register the IControllerCompletionListener<NEW_LINE>floodlightProviderService.addCompletionListener(this);<NEW_LINE>floodlightProviderService.addOFMessageListener(OFType.PACKET_IN, this);<NEW_LINE>floodlightProviderService.addOFMessageListener(OFType.FLOW_REMOVED, this);<NEW_LINE>floodlightProviderService.addOFMessageListener(OFType.ERROR, this);<NEW_LINE>restApiService.addRestletRoutable(new LearningSwitchWebRoutable());<NEW_LINE>// read our config options<NEW_LINE>Map<String, String> configOptions = context.getConfigParams(this);<NEW_LINE>try {<NEW_LINE>String idleTimeout = configOptions.get("idletimeout");<NEW_LINE>if (idleTimeout != null) {<NEW_LINE>FLOWMOD_DEFAULT_IDLE_TIMEOUT = Short.parseShort(idleTimeout);<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>log.warn("Error parsing flow idle timeout, " + "using default of {} seconds", FLOWMOD_DEFAULT_IDLE_TIMEOUT);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String hardTimeout = configOptions.get("hardtimeout");<NEW_LINE>if (hardTimeout != null) {<NEW_LINE>FLOWMOD_DEFAULT_HARD_TIMEOUT = Short.parseShort(hardTimeout);<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>log.warn("Error parsing flow hard timeout, " + "using default of {} seconds", FLOWMOD_DEFAULT_HARD_TIMEOUT);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String priority = configOptions.get("priority");<NEW_LINE>if (priority != null) {<NEW_LINE>FLOWMOD_PRIORITY = Short.parseShort(priority);<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>log.warn("Error parsing flow priority, " + "using default of {}", FLOWMOD_PRIORITY);<NEW_LINE>}<NEW_LINE>log.debug("FlowMod idle timeout set to {} seconds", FLOWMOD_DEFAULT_IDLE_TIMEOUT);<NEW_LINE>log.debug("FlowMod hard timeout set to {} seconds", FLOWMOD_DEFAULT_HARD_TIMEOUT);<NEW_LINE><MASK><NEW_LINE>debugCounterService.registerModule(this.getName());<NEW_LINE>counterFlowMod = debugCounterService.registerCounter(this.getName(), "flow-mods-written", "Flow mods written to switches by LearningSwitch", MetaData.WARN);<NEW_LINE>counterPacketOut = debugCounterService.registerCounter(this.getName(), "packet-outs-written", "Packet outs written to switches by LearningSwitch", MetaData.WARN);<NEW_LINE>}
log.debug("FlowMod priority set to {}", FLOWMOD_PRIORITY);
603,842
public void marshall(CopyPackageVersionsRequest copyPackageVersionsRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (copyPackageVersionsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getDomain(), DOMAIN_BINDING);<NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getDomainOwner(), DOMAINOWNER_BINDING);<NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getSourceRepository(), SOURCEREPOSITORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getDestinationRepository(), DESTINATIONREPOSITORY_BINDING);<NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getFormat(), FORMAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getNamespace(), NAMESPACE_BINDING);<NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getPackage(), PACKAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getVersions(), VERSIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getAllowOverwrite(), ALLOWOVERWRITE_BINDING);<NEW_LINE>protocolMarshaller.marshall(copyPackageVersionsRequest.getIncludeFromUpstream(), INCLUDEFROMUPSTREAM_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
copyPackageVersionsRequest.getVersionRevisions(), VERSIONREVISIONS_BINDING);
785
private void detectNodeJs(Project project) {<NEW_LINE>NodeJsSupport nodeJsSupport = NodeJsSupport.forProject(project);<NEW_LINE><MASK><NEW_LINE>if (preferences.isEnabled()) {<NEW_LINE>// already enabled => noop<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>PackageJson packageJson = nodeJsSupport.getPackageJson();<NEW_LINE>if (!packageJson.exists()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, Object> content = packageJson.getContent();<NEW_LINE>if (content == null) {<NEW_LINE>// some error<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object engines = content.get(PackageJson.FIELD_ENGINES);<NEW_LINE>if (engines instanceof Map) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<String, Object> engines2 = (Map<String, Object>) engines;<NEW_LINE>if (engines2.containsKey(PackageJson.FIELD_NODE)) {<NEW_LINE>Notifications.notifyNodeJsDetected(project);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
NodeJsPreferences preferences = nodeJsSupport.getPreferences();
1,853,395
public synchronized void startup() throws Exception {<NEW_LINE>// Make sure the festival directory structure exists under<NEW_LINE>// mary.base/tmp:<NEW_LINE>festivalDir = new File(MaryProperties.getFilename("festival.tmp.dir", System.getProperty("mary.base") + File.separator + "tmp" + File.separator + "festival"));<NEW_LINE>relationsDir = new File(festivalDir.getPath() + File.separator + "relations");<NEW_LINE>segmentDir = new File(relationsDir.getPath() + File.separator + "Segment");<NEW_LINE>syllableDir = new File(relationsDir.getPath() + File.separator + "Syllable");<NEW_LINE>wordDir = new File(relationsDir.getPath() + File.separator + "Word");<NEW_LINE>intEventDir = new File(relationsDir.getPath() + File.separator + "IntEvent");<NEW_LINE>phraseDir = new File(relationsDir.getPath(<MASK><NEW_LINE>targetDir = new File(relationsDir.getPath() + File.separator + "Target");<NEW_LINE>uttsDir = new File(festivalDir.getPath() + File.separator + "utts");<NEW_LINE>makeSureIsDirectory(festivalDir);<NEW_LINE>makeSureIsDirectory(relationsDir);<NEW_LINE>makeSureIsDirectory(segmentDir);<NEW_LINE>makeSureIsDirectory(syllableDir);<NEW_LINE>makeSureIsDirectory(wordDir);<NEW_LINE>makeSureIsDirectory(intEventDir);<NEW_LINE>makeSureIsDirectory(phraseDir);<NEW_LINE>makeSureIsDirectory(targetDir);<NEW_LINE>makeSureIsDirectory(uttsDir);<NEW_LINE>super.startup();<NEW_LINE>}
) + File.separator + "Phrase");
618,298
private Map<String, Object> createNumbersMap(List<TPS> tpsData) {<NEW_LINE>long now = System.currentTimeMillis();<NEW_LINE>long dayAgo = now - TimeUnit.DAYS.toMillis(1L);<NEW_LINE>long weekAgo = now - TimeUnit.DAYS.toMillis(7L);<NEW_LINE>Map<String, Object> numbers = new HashMap<>();<NEW_LINE>TPSMutator tpsDataMonth = new TPSMutator(tpsData);<NEW_LINE>TPSMutator tpsDataWeek = tpsDataMonth.filterDataBetween(weekAgo, now);<NEW_LINE>TPSMutator tpsDataDay = tpsDataWeek.filterDataBetween(dayAgo, now);<NEW_LINE>Double tpsThreshold = config.get(DisplaySettings.GRAPH_TPS_THRESHOLD_MED);<NEW_LINE>numbers.put("low_tps_spikes_30d", tpsDataMonth.lowTpsSpikeCount(tpsThreshold));<NEW_LINE>numbers.put("low_tps_spikes_7d", tpsDataWeek.lowTpsSpikeCount(tpsThreshold));<NEW_LINE>numbers.put("low_tps_spikes_24h", tpsDataDay.lowTpsSpikeCount(tpsThreshold));<NEW_LINE>numbers.put("server_downtime_30d", timeAmount.apply(tpsDataMonth.serverDownTime()));<NEW_LINE>numbers.put("server_downtime_7d", timeAmount.apply(tpsDataWeek.serverDownTime()));<NEW_LINE>numbers.put("server_downtime_24h", timeAmount.apply(tpsDataDay.serverDownTime()));<NEW_LINE>numbers.put("tps_30d", format(tpsDataMonth.averageTPS()));<NEW_LINE>numbers.put("tps_7d", format(tpsDataWeek.averageTPS()));<NEW_LINE>numbers.put("tps_24h", format(tpsDataDay.averageTPS()));<NEW_LINE>numbers.put("cpu_30d", formatPercentage(tpsDataMonth.averageCPU()));<NEW_LINE>numbers.put("cpu_7d", formatPercentage(tpsDataWeek.averageCPU()));<NEW_LINE>numbers.put("cpu_24h", formatPercentage(tpsDataDay.averageCPU()));<NEW_LINE>numbers.put("ram_30d", formatBytes(tpsDataMonth.averageRAM()));<NEW_LINE>numbers.put("ram_7d", formatBytes(tpsDataWeek.averageRAM()));<NEW_LINE>numbers.put("ram_24h", formatBytes(tpsDataDay.averageRAM()));<NEW_LINE>numbers.put("entities_30d", format((int) tpsDataMonth.averageEntities()));<NEW_LINE>numbers.put("entities_7d", format((int) tpsDataWeek.averageEntities()));<NEW_LINE>numbers.put("entities_24h", format((int<MASK><NEW_LINE>numbers.put("chunks_30d", format((int) tpsDataMonth.averageChunks()));<NEW_LINE>numbers.put("chunks_7d", format((int) tpsDataWeek.averageChunks()));<NEW_LINE>numbers.put("chunks_24h", format((int) tpsDataDay.averageChunks()));<NEW_LINE>numbers.put("max_disk_30d", formatBytes(tpsDataMonth.maxFreeDisk()));<NEW_LINE>numbers.put("max_disk_7d", formatBytes(tpsDataWeek.maxFreeDisk()));<NEW_LINE>numbers.put("max_disk_24h", formatBytes(tpsDataDay.maxFreeDisk()));<NEW_LINE>numbers.put("min_disk_30d", formatBytes(tpsDataMonth.minFreeDisk()));<NEW_LINE>numbers.put("min_disk_7d", formatBytes(tpsDataWeek.minFreeDisk()));<NEW_LINE>numbers.put("min_disk_24h", formatBytes(tpsDataDay.minFreeDisk()));<NEW_LINE>return numbers;<NEW_LINE>}
) tpsDataDay.averageEntities()));
1,494,492
public static double stringSimilarity(String... strings) {<NEW_LINE>if (strings == null)<NEW_LINE>return 0;<NEW_LINE>Counter<String> counter = new Counter<>();<NEW_LINE>Counter<String> counter2 = new Counter<>();<NEW_LINE>for (int i = 0; i < strings[0].length(); i++) counter.incrementCount(String.valueOf(strings[0].charAt(i)), 1.0f);<NEW_LINE>for (int i = 0; i < strings[1].length(); i++) counter2.incrementCount(String.valueOf(strings[1].charAt(i)), 1.0f);<NEW_LINE>Set<String> v1 = counter.keySet();<NEW_LINE>Set<String> v2 = counter2.keySet();<NEW_LINE>Set<String> both = SetUtils.intersection(v1, v2);<NEW_LINE>double sclar = 0, norm1 = 0, norm2 = 0;<NEW_LINE>for (String k : both) sclar += counter.getCount(k) * counter2.getCount(k);<NEW_LINE>for (String k : v1) norm1 += counter.getCount(k<MASK><NEW_LINE>for (String k : v2) norm2 += counter2.getCount(k) * counter2.getCount(k);<NEW_LINE>return sclar / Math.sqrt(norm1 * norm2);<NEW_LINE>}
) * counter.getCount(k);
1,564,962
protected void paintComponent(Graphics g) {<NEW_LINE>super.paintComponent(g);<NEW_LINE>if (image == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int width = Math.max(this.getWidth(), 1);<NEW_LINE>final int height = Math.max(this.getHeight(), 1);<NEW_LINE>final int origWidth = Math.max(image.getWidth(), 1);<NEW_LINE>final int origHeight = Math.max(image.getHeight(), 1);<NEW_LINE>// Determine scaling factor<NEW_LINE>double scaleX = ((double) width) / origWidth;<NEW_LINE>double scaleY = ((double) height) / origHeight;<NEW_LINE>double scale = MathUtil.min(scaleX, scaleY);<NEW_LINE>if (scale >= 1) {<NEW_LINE>scale = 1.0;<NEW_LINE>}<NEW_LINE>// Center in the middle of the component<NEW_LINE>int finalWidth = (int) Math.round(origWidth * scale);<NEW_LINE>int finalHeight = (int) <MASK><NEW_LINE>int posX = (width - finalWidth) / 2;<NEW_LINE>int posY = (height - finalHeight) / 2;<NEW_LINE>// Draw the image<NEW_LINE>int dx1 = posX;<NEW_LINE>int dy1 = posY;<NEW_LINE>int dx2 = posX + finalWidth;<NEW_LINE>int dy2 = posY + finalHeight;<NEW_LINE>int sx1 = 0;<NEW_LINE>int sy1 = 0;<NEW_LINE>int sx2 = origWidth;<NEW_LINE>int sy2 = origHeight;<NEW_LINE>Graphics2D g2 = (Graphics2D) g;<NEW_LINE>g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);<NEW_LINE>g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);<NEW_LINE>g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);<NEW_LINE>g2.drawImage(image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null);<NEW_LINE>}
Math.round(origHeight * scale);
1,266,995
// MBeanServerConnection JMXConnector.getMBeanServerConnection(); // throws IOException<NEW_LINE>// MBeanServerConnection.queryMBeans(...) // throws IOException<NEW_LINE>// MBeanServerConnection.queryNames(...) // throws IOException<NEW_LINE>//<NEW_LINE>@Override<NEW_LINE>protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>String test = request.getParameter("test");<NEW_LINE>setTest(test);<NEW_LINE>// Read from the engine server at 'logs/state/com.ibm.ws.jmx.local.address'.<NEW_LINE>String decodedLocalAddress = request.getParameter("localAddress");<NEW_LINE>setLocalAddress(decodedLocalAddress);<NEW_LINE>PrintWriter out = response.getWriter();<NEW_LINE>out.println("Starting " + test + "<br>");<NEW_LINE>// The injection engine doesn't like this at the class level.<NEW_LINE>TraceComponent tc = Tr.register(getClass());<NEW_LINE>Tr.entry(this, tc, test);<NEW_LINE>try {<NEW_LINE>System.out.println(" Starting : " + test);<NEW_LINE>getClass().getMethod(test, HttpServletRequest.class, HttpServletResponse.class).invoke(this, request, response);<NEW_LINE>out.println(test + " COMPLETED SUCCESSFULLY");<NEW_LINE>System.out.println(" Ending : " + test);<NEW_LINE>Tr.exit(this, tc, test);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (e instanceof InvocationTargetException) {<NEW_LINE>e = e.getCause();<NEW_LINE>}<NEW_LINE>out.println("<pre>ERROR in " + test + ":");<NEW_LINE>e.printStackTrace(out);<NEW_LINE>out.println("</pre>");<NEW_LINE>System.out.println(" Ending : " + test);<NEW_LINE>System.out.println("ERROR in " + test + ":");<NEW_LINE>e.printStackTrace(System.out);<NEW_LINE>Tr.exit(<MASK><NEW_LINE>}<NEW_LINE>}
this, tc, test, e);
1,338,723
public static HashMap<String, Object> calculateLoanProvision(Properties ctx, int agreementId, Timestamp runningDate, String trxName) {<NEW_LINE>// Validate agreement<NEW_LINE>if (agreementId <= 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>HashMap<String, Object> returnValues = new HashMap<String, Object>();<NEW_LINE>// if null then is now<NEW_LINE>if (runningDate == null) {<NEW_LINE>runningDate = new Timestamp(System.currentTimeMillis());<NEW_LINE>}<NEW_LINE>// Get agreement<NEW_LINE>MFMAgreement agreement = MFMAgreement.<MASK><NEW_LINE>// Calculate it<NEW_LINE>MFMProduct financialProduct = MFMProduct.getById(ctx, agreement.getFM_Product_ID(), trxName);<NEW_LINE>// Get Interest Rate<NEW_LINE>int dunningId = financialProduct.get_ValueAsInt("FM_Dunning_ID");<NEW_LINE>// Validate Dunning for it<NEW_LINE>if (dunningId == 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>MFMDunning dunning = null;<NEW_LINE>// Get dunning configuration if exist<NEW_LINE>if (dunningId > 0) {<NEW_LINE>dunning = MFMDunning.getById(ctx, dunningId);<NEW_LINE>}<NEW_LINE>// Get<NEW_LINE>List<MFMAccount> accounts = MFMAccount.getAccountFromAgreement(agreement);<NEW_LINE>MFMAccount account = null;<NEW_LINE>if (accounts.isEmpty()) {<NEW_LINE>account = new MFMAccount(agreement);<NEW_LINE>account.saveEx();<NEW_LINE>} else {<NEW_LINE>account = accounts.get(0);<NEW_LINE>}<NEW_LINE>// Hash Map for Amortization<NEW_LINE>List<AmortizationValue> amortizationList = new ArrayList<AmortizationValue>();<NEW_LINE>//<NEW_LINE>for (AmortizationValue row : getCurrentAmortizationList(ctx, agreementId, trxName)) {<NEW_LINE>if (row.isPaid()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (row.getDaysDue(runningDate) <= 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// For distinct levels<NEW_LINE>MFMDunningLevel level = null;<NEW_LINE>if (dunning != null) {<NEW_LINE>level = dunning.getValidLevelInstance(row.getDaysDue());<NEW_LINE>if (level == null || !level.isAccrual()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Get Provision Rate<NEW_LINE>BigDecimal provisionRate = level.getProvisionPercentage();<NEW_LINE>if (provisionRate == null || provisionRate.doubleValue() == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>provisionRate = provisionRate.divide(Env.ONEHUNDRED);<NEW_LINE>// Set Capital<NEW_LINE>BigDecimal capitalAmount = row.getCapitalAmtFee();<NEW_LINE>// Set Interest<NEW_LINE>BigDecimal interestAmount = row.getInterestAmtFee();<NEW_LINE>// Set Dunning<NEW_LINE>BigDecimal dunningInterestAmount = row.getDunningInterestAmount();<NEW_LINE>// Set Provision<NEW_LINE>BigDecimal provisionAmount = (capitalAmount.add(interestAmount).add(dunningInterestAmount)).multiply(provisionRate);<NEW_LINE>row.setProvisionAmt(provisionAmount);<NEW_LINE>amortizationList.add(row);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add list<NEW_LINE>returnValues.put("AMORTIZATION_LIST", amortizationList);<NEW_LINE>return returnValues;<NEW_LINE>}
getById(ctx, agreementId, trxName);
665,232
private static Buffer decodeEscapeByteaStringToBuffer(int index, int len, ByteBuf buff) {<NEW_LINE>Buffer buffer = Buffer.buffer();<NEW_LINE>int pos = 0;<NEW_LINE>while (pos < len) {<NEW_LINE>byte current = buff.getByte(pos + index);<NEW_LINE>if (current == '\\') {<NEW_LINE>if (pos + 2 <= len && buff.getByte(pos + index + 1) == '\\') {<NEW_LINE>// check double backslashes<NEW_LINE>buffer.appendByte((byte) '\\');<NEW_LINE>pos += 2;<NEW_LINE>} else if (pos + 4 <= len) {<NEW_LINE>// a preceded backslash with three-digit octal value<NEW_LINE>int high = Character.digit(buff.getByte(pos + index + 1), 8) << 6;<NEW_LINE>int medium = Character.digit(buff.getByte(pos + index + 2), 8) << 3;<NEW_LINE>int low = Character.digit(buff.getByte(pos <MASK><NEW_LINE>int escapedValue = high + medium + low;<NEW_LINE>buffer.appendByte((byte) escapedValue);<NEW_LINE>pos += 4;<NEW_LINE>} else {<NEW_LINE>throw new DecoderException("Decoding unexpected BYTEA escape format");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// printable octets<NEW_LINE>buffer.appendByte(current);<NEW_LINE>pos++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return buffer;<NEW_LINE>}
+ index + 3), 8);
428,686
public static void main(String[] args) throws IOException {<NEW_LINE>PrintWriter out;<NEW_LINE>String rules;<NEW_LINE>if (args.length > 0) {<NEW_LINE>rules = args[0];<NEW_LINE>} else {<NEW_LINE>rules = "edu/stanford/nlp/ling/tokensregex/demo/rules/colors.rules.txt";<NEW_LINE>}<NEW_LINE>if (args.length > 2) {<NEW_LINE>out = new PrintWriter(args[2]);<NEW_LINE>} else {<NEW_LINE>out = new PrintWriter(System.out);<NEW_LINE>}<NEW_LINE>Properties properties = new Properties();<NEW_LINE>properties.setProperty("annotators", "tokenize,ssplit,pos,lemma,ner,tokensregexdemo");<NEW_LINE>properties.setProperty("customAnnotatorClass.tokensregexdemo", "edu.stanford.nlp.pipeline.TokensRegexAnnotator");<NEW_LINE>properties.setProperty("tokensregexdemo.rules", rules);<NEW_LINE><MASK><NEW_LINE>Annotation annotation;<NEW_LINE>if (args.length > 1) {<NEW_LINE>annotation = new Annotation(IOUtils.slurpFileNoExceptions(args[1]));<NEW_LINE>} else {<NEW_LINE>annotation = new Annotation("Both blue and light blue are nice colors.");<NEW_LINE>}<NEW_LINE>pipeline.annotate(annotation);<NEW_LINE>// An Annotation is a Map and you can get and use the various analyses individually.<NEW_LINE>// The toString() method on an Annotation just prints the text of the Annotation<NEW_LINE>// But you can see what is in it with other methods like toShorterString()<NEW_LINE>out.println();<NEW_LINE>out.println("The top level annotation");<NEW_LINE>out.println(annotation.toShorterString());<NEW_LINE>out.println();<NEW_LINE>List<CoreMap> sentences = annotation.get(CoreAnnotations.SentencesAnnotation.class);<NEW_LINE>for (CoreMap sentence : sentences) {<NEW_LINE>// NOTE: Depending on what tokensregex rules are specified, there are other annotations<NEW_LINE>// that are of interest other than just the tokens and what we print out here<NEW_LINE>for (CoreLabel token : sentence.get(CoreAnnotations.TokensAnnotation.class)) {<NEW_LINE>// Print out words, lemma, ne, and normalized ne<NEW_LINE>String word = token.get(CoreAnnotations.TextAnnotation.class);<NEW_LINE>String lemma = token.get(CoreAnnotations.LemmaAnnotation.class);<NEW_LINE>String pos = token.get(CoreAnnotations.PartOfSpeechAnnotation.class);<NEW_LINE>String ne = token.get(CoreAnnotations.NamedEntityTagAnnotation.class);<NEW_LINE>String normalized = token.get(CoreAnnotations.NormalizedNamedEntityTagAnnotation.class);<NEW_LINE>out.println("token: " + "word=" + word + ", lemma=" + lemma + ", pos=" + pos + ", ne=" + ne + ", normalized=" + normalized);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.flush();<NEW_LINE>}
StanfordCoreNLP pipeline = new StanfordCoreNLP(properties);
1,203,321
private Mono<Response<SshPublicKeyResourceInner>> createWithResponseAsync(String resourceGroupName, String sshPublicKeyName, SshPublicKeyResourceInner parameters, 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 (sshPublicKeyName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter sshPublicKeyName 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.<MASK><NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-11-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.create(this.client.getEndpoint(), resourceGroupName, sshPublicKeyName, apiVersion, this.client.getSubscriptionId(), parameters, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
689,334
private List<ModoAcesso> obterModosAcessoPassados(NoChamadaFuncao chamadaFuncao) {<NEW_LINE>List<ModoAcesso> modosAcesso = new ArrayList<>();<NEW_LINE>if (chamadaFuncao.getParametros() != null) {<NEW_LINE>for (NoExpressao parametro : chamadaFuncao.getParametros()) {<NEW_LINE>if (parametro instanceof NoReferenciaVariavel) {<NEW_LINE>NoReferenciaVariavel noReferenciaVariavel = (NoReferenciaVariavel) parametro;<NEW_LINE>if (noReferenciaVariavel.getEscopoBiblioteca() == null) {<NEW_LINE>Simbolo simbolo = memoria.getSimbolo(noReferenciaVariavel.getNome());<NEW_LINE>if (simbolo == null) {<NEW_LINE>return modosAcesso;<NEW_LINE>}<NEW_LINE>if (simbolo.constante()) {<NEW_LINE>modosAcesso.add(ModoAcesso.POR_VALOR);<NEW_LINE>} else {<NEW_LINE>modosAcesso.add(ModoAcesso.POR_REFERENCIA);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>modosAcesso.add(ModoAcesso.POR_VALOR);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return modosAcesso;<NEW_LINE>}
modosAcesso.add(ModoAcesso.POR_VALOR);