idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
900,746
public void accept(ClassWriter writer, Type controller, String handlerInternalName, MethodVisitor visitor, ParamDefinition parameter, NameGenerator nameGenerator) throws Exception {<NEW_LINE>String methodName = parameter.getName();<NEW_LINE>String name = parameter.getHttpName();<NEW_LINE>visitor.visitLdcInsn(name);<NEW_LINE>visitor.visitMethodInsn(INVOKESTATIC, <MASK><NEW_LINE>if (parameter.getType().isPrimitive()) {<NEW_LINE>Method toPrimitive = Primitives.toPrimitive(parameter.getType());<NEW_LINE>visitor.visitTypeInsn(Opcodes.CHECKCAST, getInternalName(toPrimitive.getDeclaringClass()));<NEW_LINE>visitor.visitMethodInsn(INVOKEVIRTUAL, getInternalName(toPrimitive.getDeclaringClass()), toPrimitive.getName(), getMethodDescriptor(toPrimitive), false);<NEW_LINE>} else {<NEW_LINE>visitor.visitTypeInsn(Opcodes.CHECKCAST, parameter.getType().toJvmType().getInternalName());<NEW_LINE>}<NEW_LINE>if (!nameGenerator.has(methodName)) {<NEW_LINE>attribute(writer, parameter, nameGenerator.generate(methodName));<NEW_LINE>}<NEW_LINE>}
handlerInternalName, methodName, "(Lio/jooby/Context;Ljava/lang/String;)Ljava/lang/Object;", false);
1,527,224
public INDArray activate(boolean training, LayerWorkspaceMgr workspaceMgr) {<NEW_LINE>if (input.rank() != 3)<NEW_LINE>throw new DL4JInvalidInputException("Got rank " + input.rank() + " array as input to Subsampling1DLayer with shape " + Arrays.toString(input.shape()) + ". Expected rank 3 array with shape [minibatchSize, features, length]. " + layerId());<NEW_LINE>// add singleton fourth dimension to input<NEW_LINE>INDArray origInput = input;<NEW_LINE>if (layerConf().getCnn2dDataFormat() == CNN2DFormat.NCHW)<NEW_LINE>input = input.castTo(dataType).reshape(input.size(0), input.size(1), input.size(2), 1);<NEW_LINE>else {<NEW_LINE>input = input.castTo(dataType).reshape(input.size(0), input.size(1), 1, input.size(2));<NEW_LINE>}<NEW_LINE>// call 2D SubsamplingLayer's activate method<NEW_LINE>INDArray acts = super.activate(training, workspaceMgr);<NEW_LINE>if (layerConf().getCnn2dDataFormat() == CNN2DFormat.NCHW)<NEW_LINE>acts = acts.reshape(acts.size(0), acts.size(1), acts.size(2));<NEW_LINE>else {<NEW_LINE>acts = acts.reshape(acts.size(0), acts.size(1), acts.size(3));<NEW_LINE>}<NEW_LINE>// remove singleton fourth dimension from input and output activations<NEW_LINE>input = origInput;<NEW_LINE>if (maskArray != null) {<NEW_LINE>INDArray maskOut = feedForwardMaskArray(maskArray, MaskState.Active, (int) acts.size(0)).getFirst();<NEW_LINE>Preconditions.checkState(acts.size(0) == maskOut.size(0) && acts.size(2) == maskOut.size(1), "Activations dimensions (0,2) and mask dimensions (0,1) don't match: Activations %s, Mask %s", acts.shape(), maskOut.shape());<NEW_LINE>Broadcast.mul(acts, <MASK><NEW_LINE>}<NEW_LINE>return acts;<NEW_LINE>}
maskOut, acts, 0, 2);
143,360
public void uncaughtException(@NonNull Thread thread, @NonNull Throwable exception) {<NEW_LINE>Timber.e(exception);<NEW_LINE>// Log the exception<NEW_LINE>Timber.i("Logging crash exception");<NEW_LINE>try {<NEW_LINE>List<LogHelper.LogEntry> log = new ArrayList<>();<NEW_LINE>log.add(new LogHelper.LogEntry(StringHelper.protect(<MASK><NEW_LINE>log.add(new LogHelper.LogEntry(getStackTraceString(exception)));<NEW_LINE>LogHelper.LogInfo logInfo = new LogHelper.LogInfo();<NEW_LINE>logInfo.setEntries(log);<NEW_LINE>logInfo.setHeaderName("latest-crash");<NEW_LINE>LogHelper.writeLog(HentoidApp.getInstance(), logInfo);<NEW_LINE>} finally {<NEW_LINE>// Restart the Activity<NEW_LINE>Timber.i("Restart %s", myActivityClass.getSimpleName());<NEW_LINE>Intent intent = new Intent(myContext, myActivityClass);<NEW_LINE>myContext.startActivity(intent);<NEW_LINE>}<NEW_LINE>Timber.i("Kill current process");<NEW_LINE>Process.killProcess(Process.myPid());<NEW_LINE>System.exit(0);<NEW_LINE>}
exception.getMessage())));
1,240,583
protected Map<String, DiagramNode> fixFlowNodePositionsIfModelFromAdonis(Document bpmnModel, Map<String, DiagramNode> elementBoundsFromBpmnDi) {<NEW_LINE>if (isExportedFromAdonis50(bpmnModel)) {<NEW_LINE>Map<String, DiagramNode> mapOfFixedBounds = new HashMap<>();<NEW_LINE>XPathFactory xPathFactory = XPathFactory.newInstance();<NEW_LINE>XPath xPath = xPathFactory.newXPath();<NEW_LINE>xPath.setNamespaceContext(new Bpmn20NamespaceContext());<NEW_LINE>for (Entry<String, DiagramNode> entry : elementBoundsFromBpmnDi.entrySet()) {<NEW_LINE><MASK><NEW_LINE>DiagramNode elementBounds = entry.getValue();<NEW_LINE>String expression = "local-name(//bpmn:*[@id = '" + elementId + "'])";<NEW_LINE>try {<NEW_LINE>XPathExpression xPathExpression = xPath.compile(expression);<NEW_LINE>String elementLocalName = xPathExpression.evaluate(bpmnModel);<NEW_LINE>if (!"participant".equals(elementLocalName) && !"lane".equals(elementLocalName) && !"textAnnotation".equals(elementLocalName) && !"group".equals(elementLocalName)) {<NEW_LINE>elementBounds.setX(elementBounds.getX() - elementBounds.getWidth() / 2);<NEW_LINE>elementBounds.setY(elementBounds.getY() - elementBounds.getHeight() / 2);<NEW_LINE>}<NEW_LINE>} catch (XPathExpressionException e) {<NEW_LINE>throw new FlowableException("Error while evaluating the following XPath expression on a BPMN XML document: '" + expression + "'.", e);<NEW_LINE>}<NEW_LINE>mapOfFixedBounds.put(elementId, elementBounds);<NEW_LINE>}<NEW_LINE>return mapOfFixedBounds;<NEW_LINE>} else {<NEW_LINE>return elementBoundsFromBpmnDi;<NEW_LINE>}<NEW_LINE>}
String elementId = entry.getKey();
1,381,333
public static List<ClickHouseColumn> parse(String args) {<NEW_LINE>if (args == null || args.isEmpty()) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>String name = null;<NEW_LINE>ClickHouseColumn column = null;<NEW_LINE>List<ClickHouseColumn> list = new LinkedList<>();<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>for (int i = 0, len = args.length(); i < len; i++) {<NEW_LINE>char ch = args.charAt(i);<NEW_LINE>if (Character.isWhitespace(ch)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>// column name<NEW_LINE>i = ClickHouseUtils.readNameOrQuotedString(args, i, len, builder) - 1;<NEW_LINE>name = builder.toString();<NEW_LINE>builder.setLength(0);<NEW_LINE>} else if (column == null) {<NEW_LINE>// now type<NEW_LINE>LinkedList<ClickHouseColumn> <MASK><NEW_LINE>i = readColumn(args, i, len, name, colList) - 1;<NEW_LINE>list.add(column = colList.getFirst());<NEW_LINE>} else {<NEW_LINE>// prepare for next column<NEW_LINE>i = ClickHouseUtils.skipContentsUntil(args, i, len, ',') - 1;<NEW_LINE>name = null;<NEW_LINE>column = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<ClickHouseColumn> c = new ArrayList<>(list.size());<NEW_LINE>for (ClickHouseColumn cc : list) {<NEW_LINE>c.add(cc);<NEW_LINE>}<NEW_LINE>return Collections.unmodifiableList(c);<NEW_LINE>}
colList = new LinkedList<>();
90,185
public void visitVariableExpression(final VariableExpression e) {<NEW_LINE>if (e.getAccessedVariable() instanceof Parameter) {<NEW_LINE>Parameter p = (Parameter) e.getAccessedVariable();<NEW_LINE>if (p.hasInitialExpression() && !Arrays.asList(params).contains(p)) {<NEW_LINE>VariableScope blockScope = code.getVariableScope();<NEW_LINE>VariableExpression localVariable = (VariableExpression) blockScope.getDeclaredVariable(p.getName());<NEW_LINE>if (localVariable == null) {<NEW_LINE>// create a variable declaration so that the name can be found in the new method<NEW_LINE>localVariable = localVarX(p.getName(), p.getType());<NEW_LINE>localVariable.<MASK><NEW_LINE>blockScope.putDeclaredVariable(localVariable);<NEW_LINE>localVariable.setInStaticContext(blockScope.isInStaticContext());<NEW_LINE>code.addStatement(declS(localVariable, p.getInitialExpression()));<NEW_LINE>}<NEW_LINE>if (!localVariable.isClosureSharedVariable()) {<NEW_LINE>localVariable.setClosureSharedVariable(inClosure);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setModifiers(p.getModifiers());
1,358,262
public void write(JsonWriter out, ComplexQuadrilateral value) throws IOException {<NEW_LINE>JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();<NEW_LINE>obj.remove("additionalProperties");<NEW_LINE>// serialize additonal properties<NEW_LINE>if (value.getAdditionalProperties() != null) {<NEW_LINE>for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) {<NEW_LINE>if (entry.getValue() instanceof String)<NEW_LINE>obj.addProperty(entry.getKey(), (String) entry.getValue());<NEW_LINE>else if (entry.getValue() instanceof Number)<NEW_LINE>obj.addProperty(entry.getKey(), (Number) entry.getValue());<NEW_LINE>else if (entry.getValue() instanceof Boolean)<NEW_LINE>obj.addProperty(entry.getKey(), (Boolean) entry.getValue());<NEW_LINE>else if (entry.getValue() instanceof Character)<NEW_LINE>obj.addProperty(entry.getKey(), (Character) entry.getValue());<NEW_LINE>else {<NEW_LINE>obj.add(entry.getKey(), gson.toJsonTree(entry.getValue()).getAsJsonObject());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
elementAdapter.write(out, obj);
1,444,263
// @see org.eclipse.swt.widgets.Composite#computeSize(int, int, boolean)<NEW_LINE>@Override<NEW_LINE>public Point computeSize(int wHint, int hHint, boolean changed) {<NEW_LINE>int border = getBorderWidth() * 2;<NEW_LINE>if (border == 0 && (canvas.getStyle() & SWT.BORDER) > 0) {<NEW_LINE>border = 2;<NEW_LINE>}<NEW_LINE>Point pt = new Point(border, border);<NEW_LINE>if (sDisplayText == null) {<NEW_LINE>return pt;<NEW_LINE>}<NEW_LINE>Font existingFont = (Font) canvas.getData("font");<NEW_LINE>Color existingColor = (Color) canvas.getData("color");<NEW_LINE>GC gc = new GC(this);<NEW_LINE>if (existingFont != null) {<NEW_LINE>gc.setFont(existingFont);<NEW_LINE>}<NEW_LINE>if (existingColor != null) {<NEW_LINE>gc.setForeground(existingColor);<NEW_LINE>}<NEW_LINE>if (antialiasMode != SWT.DEFAULT) {<NEW_LINE>try {<NEW_LINE>gc.setTextAntialias(antialiasMode);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// Ignore ERROR_NO_GRAPHICS_LIBRARY error or any others<NEW_LINE>}<NEW_LINE>}<NEW_LINE>gc.setAlpha(alpha);<NEW_LINE>GCStringPrinter sp = new GCStringPrinter(gc, sDisplayText, new Rectangle(0, 0, wHint == -1 ? 3000 : wHint, hHint == -1 ? 3000 : hHint), true, false, style & SWT.WRAP);<NEW_LINE>sp.calculateMetrics();<NEW_LINE>pt = sp.getCalculatedSize();<NEW_LINE>pt.x += (border + hpadding) * 2;<NEW_LINE>pt.y <MASK><NEW_LINE>gc.dispose();<NEW_LINE>if (isUnderline) {<NEW_LINE>pt.y++;<NEW_LINE>}<NEW_LINE>if (hasShadow) {<NEW_LINE>pt.x++;<NEW_LINE>}<NEW_LINE>if (isItalic) {<NEW_LINE>pt.x += 4;<NEW_LINE>}<NEW_LINE>int fixedWidth = skinProperties.getIntValue(sConfigID + ".width", -1);<NEW_LINE>if (fixedWidth >= 0) {<NEW_LINE>pt.x = fixedWidth;<NEW_LINE>// pt.x = fixedWidth;<NEW_LINE>}<NEW_LINE>int fixedHeight = skinProperties.getIntValue(sConfigID + ".height", -1);<NEW_LINE>if (fixedHeight >= 0) {<NEW_LINE>pt.y = fixedHeight;<NEW_LINE>// pt.y = fixedHeight;<NEW_LINE>}<NEW_LINE>if (isVisible()) {<NEW_LINE>if (pt.x > ptMax.x) {<NEW_LINE>ptMax.x = pt.x;<NEW_LINE>}<NEW_LINE>if (pt.y > ptMax.y) {<NEW_LINE>ptMax.y = pt.y;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return pt;<NEW_LINE>}
+= (border + vpadding) * 2;
1,725,415
private Component createUinPassPanel() {<NEW_LINE>JPanel uinPassPanel = new TransparentPanel(new BorderLayout(10, 10));<NEW_LINE>JPanel labelsPanel = new TransparentPanel();<NEW_LINE>JPanel valuesPanel = new TransparentPanel();<NEW_LINE>labelsPanel.setLayout(new BoxLayout(labelsPanel, BoxLayout.Y_AXIS));<NEW_LINE>valuesPanel.setLayout(new BoxLayout<MASK><NEW_LINE>JLabel uinLabel = new JLabel(Resources.getString("plugin.aimaccregwizz.USERNAME"));<NEW_LINE>JPanel emptyPanel = new TransparentPanel();<NEW_LINE>JLabel uinExampleLabel = new JLabel(USER_NAME_EXAMPLE);<NEW_LINE>JLabel passLabel = new JLabel(Resources.getString("service.gui.PASSWORD"));<NEW_LINE>this.uinField.getDocument().addDocumentListener(this);<NEW_LINE>this.rememberPassBox.setSelected(wizard.getRegistration().isRememberPassword());<NEW_LINE>uinExampleLabel.setForeground(Color.GRAY);<NEW_LINE>uinExampleLabel.setFont(uinExampleLabel.getFont().deriveFont(8));<NEW_LINE>emptyPanel.setMaximumSize(new Dimension(40, 35));<NEW_LINE>uinExampleLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 8, 0));<NEW_LINE>labelsPanel.add(uinLabel);<NEW_LINE>labelsPanel.add(emptyPanel);<NEW_LINE>labelsPanel.add(passLabel);<NEW_LINE>valuesPanel.add(uinField);<NEW_LINE>valuesPanel.add(uinExampleLabel);<NEW_LINE>valuesPanel.add(passField);<NEW_LINE>uinPassPanel.add(labelsPanel, BorderLayout.WEST);<NEW_LINE>uinPassPanel.add(valuesPanel, BorderLayout.CENTER);<NEW_LINE>uinPassPanel.add(rememberPassBox, BorderLayout.SOUTH);<NEW_LINE>uinPassPanel.setBorder(BorderFactory.createTitledBorder(Resources.getString("plugin.aimaccregwizz.USERNAME_AND_PASSWORD")));<NEW_LINE>return uinPassPanel;<NEW_LINE>}
(valuesPanel, BoxLayout.Y_AXIS));
556,310
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {<NEW_LINE>try {<NEW_LINE>if (sessionHandler == null) {<NEW_LINE>// No session handler available, do nothing<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (sessionHandler.beforeHandle()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (this.isClosed()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (msg instanceof MinecraftPacket) {<NEW_LINE>MinecraftPacket pkt = (MinecraftPacket) msg;<NEW_LINE>if (!pkt.handle(sessionHandler)) {<NEW_LINE>sessionHandler.handleGeneric((MinecraftPacket) msg);<NEW_LINE>}<NEW_LINE>} else if (msg instanceof HAProxyMessage) {<NEW_LINE>HAProxyMessage proxyMessage = (HAProxyMessage) msg;<NEW_LINE>this.remoteAddress = new InetSocketAddress(proxyMessage.sourceAddress(<MASK><NEW_LINE>} else if (msg instanceof ByteBuf) {<NEW_LINE>sessionHandler.handleUnknown((ByteBuf) msg);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>ReferenceCountUtil.release(msg);<NEW_LINE>}<NEW_LINE>}
), proxyMessage.sourcePort());
121,960
private JavaScriptNode enterIdentNodeSuper(IdentNode identNode) {<NEW_LINE>if (!identNode.isDirectSuper()) {<NEW_LINE>// ES6 12.3.5.3 Runtime Semantics: MakeSuperPropertyReference(propertyKey, strict)<NEW_LINE>// ES6 8.1.1.3.5 GetSuperBase()<NEW_LINE>JavaScriptNode getSuperBase = factory.createGetPrototype(environment.findSuperVar().createReadNode());<NEW_LINE>JavaScriptNode receiver = checkThisBindingInitialized(environment.findThisVar().createReadNode());<NEW_LINE>return factory.createSuperPropertyReference(getSuperBase, receiver);<NEW_LINE>} else {<NEW_LINE>// ES6 12.3.5.2 Runtime Semantics: GetSuperConstructor()<NEW_LINE>// super accesses should not reach here<NEW_LINE>assert identNode.isDirectSuper();<NEW_LINE>JavaScriptNode activeFunction = factory.createAccessCallee(currentFunction().getThisFunctionLevel());<NEW_LINE>JavaScriptNode superConstructor = factory.createGetPrototype(activeFunction);<NEW_LINE>JavaScriptNode receiver = environment.findThisVar().createReadNode();<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>}
factory.createTargetableWrapper(superConstructor, receiver);
468,416
private void dynamicPriority() {<NEW_LINE>// suspend activities with dynamic priority node<NEW_LINE>String sql = // suspended<NEW_LINE>"SELECT * " + "FROM AD_WF_Activity a " + "WHERE Processed='N' AND WFState='OS'" + " AND EXISTS (SELECT * FROM AD_Workflow wf" + " INNER JOIN AD_WF_Node wfn ON (wf.AD_Workflow_ID=wfn.AD_Workflow_ID) " + "WHERE a.AD_WF_Node_ID=wfn.AD_WF_Node_ID AND wf.AD_WorkflowProcessor_ID=?" + " AND wfn.DynPriorityUnit IS NOT NULL AND wfn.DynPriorityChange IS NOT NULL)";<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>int count = 0;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, null);<NEW_LINE>pstmt.setInt(1, m_model.getAD_WorkflowProcessor_ID());<NEW_LINE>ResultSet rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>MWFActivity activity = new MWFActivity(getCtx(), rs, null);<NEW_LINE>if (activity.getDynPriorityStart() == 0)<NEW_LINE>activity.<MASK><NEW_LINE>long ms = System.currentTimeMillis() - activity.getCreated().getTime();<NEW_LINE>MWFNode node = activity.getNode();<NEW_LINE>int prioDiff = node.calculateDynamicPriority((int) (ms / 1000));<NEW_LINE>activity.setPriority(activity.getDynPriorityStart() + prioDiff);<NEW_LINE>activity.saveEx();<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.log(Level.SEVERE, sql, e);<NEW_LINE>} finally {<NEW_LINE>DB.close(pstmt);<NEW_LINE>}<NEW_LINE>m_summary.append("DynPriority #").append(count).append(" - ");<NEW_LINE>}
setDynPriorityStart(activity.getPriority());
1,249,344
public static Runnable updateInjectedFoldRegions(@Nonnull final Editor editor, @Nonnull final PsiFile file, final boolean applyDefaultState) {<NEW_LINE>if (file instanceof PsiCompiledElement)<NEW_LINE>return null;<NEW_LINE>ApplicationManager.getApplication().assertReadAccessAllowed();<NEW_LINE>final Project project = file.getProject();<NEW_LINE>Document document = editor.getDocument();<NEW_LINE>LOG.assertTrue(!PsiDocumentManager.getInstance(project).isUncommited(document));<NEW_LINE>final FoldingModel foldingModel = editor.getFoldingModel();<NEW_LINE>final long timeStamp = document.getModificationStamp();<NEW_LINE>Object lastTimeStamp = editor.getUserData(LAST_UPDATE_INJECTED_STAMP_KEY);<NEW_LINE>if (lastTimeStamp instanceof Long && ((Long) lastTimeStamp).longValue() == timeStamp)<NEW_LINE>return null;<NEW_LINE>List<DocumentWindow> injectedDocuments = InjectedLanguageManager.getInstance(project).getCachedInjectedDocumentsInRange(file, file.getTextRange());<NEW_LINE>if (injectedDocuments.isEmpty())<NEW_LINE>return null;<NEW_LINE>final List<EditorWindow> injectedEditors = new ArrayList<>();<NEW_LINE>final List<PsiFile> injectedFiles = new ArrayList<>();<NEW_LINE>final List<List<RegionInfo>> lists = new ArrayList<>();<NEW_LINE>for (final DocumentWindow injectedDocument : injectedDocuments) {<NEW_LINE>if (!injectedDocument.isValid()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>InjectedLanguageUtil.enumerate(injectedDocument, file, (injectedFile, places) -> {<NEW_LINE>if (!injectedFile.isValid())<NEW_LINE>return;<NEW_LINE>Editor injectedEditor = <MASK><NEW_LINE>if (!(injectedEditor instanceof EditorWindow))<NEW_LINE>return;<NEW_LINE>injectedEditors.add((EditorWindow) injectedEditor);<NEW_LINE>injectedFiles.add(injectedFile);<NEW_LINE>final List<RegionInfo> map = new ArrayList<>();<NEW_LINE>lists.add(map);<NEW_LINE>getFoldingsFor(injectedFile, injectedEditor.getDocument(), map, false);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return () -> {<NEW_LINE>final ArrayList<Runnable> updateOperations = new ArrayList<>(injectedEditors.size());<NEW_LINE>for (int i = 0; i < injectedEditors.size(); i++) {<NEW_LINE>EditorWindow injectedEditor = injectedEditors.get(i);<NEW_LINE>PsiFile injectedFile = injectedFiles.get(i);<NEW_LINE>if (!injectedEditor.getDocument().isValid())<NEW_LINE>continue;<NEW_LINE>List<RegionInfo> list = lists.get(i);<NEW_LINE>updateOperations.add(new UpdateFoldRegionsOperation(project, injectedEditor, injectedFile, list, applyDefaultStateMode(applyDefaultState), !applyDefaultState, true));<NEW_LINE>}<NEW_LINE>foldingModel.runBatchFoldingOperation(() -> {<NEW_LINE>for (Runnable operation : updateOperations) {<NEW_LINE>operation.run();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>editor.putUserData(LAST_UPDATE_INJECTED_STAMP_KEY, timeStamp);<NEW_LINE>};<NEW_LINE>}
InjectedLanguageUtil.getInjectedEditorForInjectedFile(editor, injectedFile);
1,561,177
private void loadConfigFromFile() {<NEW_LINE>SharedPreferences sp = <MASK><NEW_LINE>switchCustomizeKeyboard.setChecked(sp.getBoolean(sp_enable_ckb, true));<NEW_LINE>switchPCKeyboard.setChecked(sp.getBoolean(sp_enable_onscreenkeyboard, false));<NEW_LINE>switchPCMouse.setChecked(sp.getBoolean(sp_enable_onscreenmouse, false));<NEW_LINE>switchPEKeyboard.setChecked(sp.getBoolean(sp_enable_crosskeyboard, true));<NEW_LINE>switchPEItembar.setChecked(sp.getBoolean(sp_enable_itembar, true));<NEW_LINE>switchPEJoystick.setChecked(sp.getBoolean(sp_enable_joystick, false));<NEW_LINE>switchTouchpad.setChecked(sp.getBoolean(sp_enable_onscreentouchpad, true));<NEW_LINE>switchInputBox.setChecked(sp.getBoolean(sp_enable_inputbox, false));<NEW_LINE>switchDebugInfo.setChecked(sp.getBoolean(sp_enable_debuginfo, false));<NEW_LINE>if (!sp.contains(sp_first_loadder)) {<NEW_LINE>resetAllPosOnScreen();<NEW_LINE>((CustomizeKeyboard) custmoizeKeyboard).mManager.loadKeyboard(new CustomizeKeyboardMaker(context).createDefaultKeyboard());<NEW_LINE>}<NEW_LINE>}
context.getSharedPreferences(spFileName, spMode);
78,682
private Mono<Response<Flux<ByteBuffer>>> performMaintenanceWithResponseAsync(String resourceGroupName, String vmName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><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 (vmName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter vmName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2020-06-01";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.performMaintenance(this.client.getEndpoint(), resourceGroupName, vmName, apiVersion, this.client.getSubscriptionId(), context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
850,326
public Object returnOriginalState(List<OMultiValueChangeEvent<OIdentifiable, OIdentifiable>> multiValueChangeEvents) {<NEW_LINE>final OEmbeddedRidBag reverted = new OEmbeddedRidBag();<NEW_LINE>for (OIdentifiable identifiable : this) reverted.add(identifiable);<NEW_LINE>final ListIterator<OMultiValueChangeEvent<OIdentifiable, OIdentifiable>> listIterator = multiValueChangeEvents.listIterator(multiValueChangeEvents.size());<NEW_LINE>while (listIterator.hasPrevious()) {<NEW_LINE>final OMultiValueChangeEvent<OIdentifiable, OIdentifiable> event = listIterator.previous();<NEW_LINE>switch(event.getChangeType()) {<NEW_LINE>case ADD:<NEW_LINE>reverted.remove(event.getKey());<NEW_LINE>break;<NEW_LINE>case REMOVE:<NEW_LINE>reverted.<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Invalid change type : " + event.getChangeType());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return reverted;<NEW_LINE>}
add(event.getOldValue());
272,007
public boolean isCallerInRole(EJBComponentMetaData cmd, EJBRequestData request, String roleName, String roleLink, Subject subject) {<NEW_LINE>String role = roleLink == null ? roleName : roleLink;<NEW_LINE>String appName = getApplicationName(request.getEJBMethodMetaData());<NEW_LINE>waitForSecurity();<NEW_LINE>SecurityService securityService = securityServiceRef.getService();<NEW_LINE>AuthorizationService authzService = securityService.getAuthorizationService();<NEW_LINE>if (authzService == null) {<NEW_LINE>// If we can not get the authorization service, fail securely<NEW_LINE>String authzUserName = subject.getPrincipals(WSPrincipal.class).iterator().next().getName();<NEW_LINE>Tr.error(tc, "EJB_AUTHZ_SERVICE_NOTFOUND", authzUserName, "isCallerInRole", appName);<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>final List<String> requiredRoles <MASK><NEW_LINE>requiredRoles.add(role);<NEW_LINE>return authzService.isAuthorized(appName, requiredRoles, subject);<NEW_LINE>}<NEW_LINE>}
= new ArrayList<String>();
215,303
public void incLiveness(final String userId, final String field) {<NEW_LINE>Stopwatchs.start("Inc liveness");<NEW_LINE>final String date = DateFormatUtils.format(System.currentTimeMillis(), "yyyyMMdd");<NEW_LINE>try {<NEW_LINE>JSONObject liveness = livenessRepository.getByUserAndDate(userId, date);<NEW_LINE>if (null == liveness) {<NEW_LINE>liveness = new JSONObject();<NEW_LINE>liveness.put(Liveness.LIVENESS_USER_ID, userId);<NEW_LINE>liveness.put(Liveness.LIVENESS_DATE, date);<NEW_LINE>liveness.put(Liveness.LIVENESS_POINT, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_ACTIVITY, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_ARTICLE, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_COMMENT, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_PV, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_REWARD, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_THANK, 0);<NEW_LINE>liveness.put(Liveness.LIVENESS_VOTE, 0);<NEW_LINE>liveness.<MASK><NEW_LINE>liveness.put(Liveness.LIVENESS_ACCEPT_ANSWER, 0);<NEW_LINE>livenessRepository.add(liveness);<NEW_LINE>}<NEW_LINE>liveness.put(field, liveness.optInt(field) + 1);<NEW_LINE>livenessRepository.update(liveness.optString(Keys.OBJECT_ID), liveness);<NEW_LINE>} catch (final RepositoryException e) {<NEW_LINE>LOGGER.log(Level.ERROR, "Updates a liveness [" + date + "] field [" + field + "] failed", e);<NEW_LINE>} finally {<NEW_LINE>Stopwatchs.end();<NEW_LINE>}<NEW_LINE>}
put(Liveness.LIVENESS_VOTE, 0);
484,130
protected void modified(Map<?, ?> newProperties) {<NEW_LINE>final String originalProvider = (String) props.get("defaultPersistenceProvider");<NEW_LINE>final String originalDefaultJtaDataSourceJndiName = (String) props.get("defaultJtaDataSourceJndiName");<NEW_LINE>final String originalDefaultNonJtaDataSourceJndiName = (String) props.get("defaultNonJtaDataSourceJndiName");<NEW_LINE>if (newProperties instanceof Dictionary) {<NEW_LINE>props = (<MASK><NEW_LINE>} else {<NEW_LINE>props = new Hashtable(newProperties);<NEW_LINE>}<NEW_LINE>final String curProvider = (String) newProperties.get("defaultPersistenceProvider");<NEW_LINE>final String curDefaultJtaDataSourceJndiName = (String) newProperties.get("defaultJtaDataSourceJndiName");<NEW_LINE>final String curDefaultNonJtaDataSourceJndiName = (String) newProperties.get("defaultNonJtaDataSourceJndiName");<NEW_LINE>boolean recycleJPAApplications = false;<NEW_LINE>if (!Objects.equals(originalProvider, curProvider)) {<NEW_LINE>// If the <jpa defaultPersistenceProvider=""/> element has changed, restart all JPA apps<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "Detected change in defaultPersistenceProvider of the <jpa> element. Restarting all JPA applications.", originalProvider + " -> " + curProvider);<NEW_LINE>recycleJPAApplications = true;<NEW_LINE>} else if (!Objects.equals(originalDefaultJtaDataSourceJndiName, curDefaultJtaDataSourceJndiName)) {<NEW_LINE>// If the <jpa defaultJtaDataSourceJndiName=""/> element has changed, restart all JPA apps<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "Detected change in defaultJtaDataSourceJndiName of the <jpa> element. Restarting all JPA applications.", originalProvider + " -> " + curProvider);<NEW_LINE>recycleJPAApplications = true;<NEW_LINE>} else if (!Objects.equals(originalDefaultNonJtaDataSourceJndiName, curDefaultNonJtaDataSourceJndiName)) {<NEW_LINE>// If the <jpa defaultNonJtaDataSourceJndiName=""/> element has changed, restart all JPA apps<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "Detected change in defaultNonJtaDataSourceJndiName of the <jpa> element. Restarting all JPA applications.", originalProvider + " -> " + curProvider);<NEW_LINE>recycleJPAApplications = true;<NEW_LINE>}<NEW_LINE>if (recycleJPAApplications) {<NEW_LINE>recycleJPAApplications();<NEW_LINE>}<NEW_LINE>}
Dictionary<String, Object>) newProperties;
740,037
protected boolean doTokensMatchPattern(List<Token> previousTokens, Token current, Pattern regex) {<NEW_LINE>if (regex == PLSQL_PACKAGE_DEFINITION_REGEX && previousTokens.stream().anyMatch(t -> t.getType() == TokenType.KEYWORD && t.getText().equalsIgnoreCase("ACCESSIBLE"))) {<NEW_LINE>ArrayList<String> tokenStrings = new ArrayList<>();<NEW_LINE>tokenStrings.add(current.getText());<NEW_LINE>for (int i = previousTokens.size() - 1; i >= 0; i--) {<NEW_LINE>Token prevToken = previousTokens.get(i);<NEW_LINE>if (prevToken.getType() == TokenType.KEYWORD) {<NEW_LINE>tokenStrings.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>for (int i = tokenStrings.size() - 1; i >= 0; i--) {<NEW_LINE>builder.append(tokenStrings.get(i));<NEW_LINE>if (i != 0) {<NEW_LINE>builder.append(" ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return regex.matcher(builder.toString()).matches() || super.doTokensMatchPattern(previousTokens, current, regex);<NEW_LINE>}<NEW_LINE>return super.doTokensMatchPattern(previousTokens, current, regex);<NEW_LINE>}
add(prevToken.getText());
1,220,886
private void croppingResult(Activity activity, final int requestCode, final int resultCode, final Intent data) {<NEW_LINE>if (data != null) {<NEW_LINE>Uri resultUri = UCrop.getOutput(data);<NEW_LINE>if (resultUri != null) {<NEW_LINE>try {<NEW_LINE>if (width > 0 && height > 0) {<NEW_LINE>File resized = compression.resize(this.reactContext, resultUri.getPath(), width, height, width, height, 100);<NEW_LINE>resultUri = Uri.fromFile(resized);<NEW_LINE>}<NEW_LINE>WritableMap result = getSelection(activity, resultUri, false);<NEW_LINE>if (result != null) {<NEW_LINE>result.putMap("cropRect", PickerModule.getCroppedRectMap(data));<NEW_LINE>resultCollector.setWaitCount(1);<NEW_LINE>resultCollector.notifySuccess(result);<NEW_LINE>} else {<NEW_LINE>throw new Exception("Cannot crop video files");<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>resultCollector.notifyProblem(<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>resultCollector.notifyProblem(E_NO_IMAGE_DATA_FOUND, "Cannot find image data");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>resultCollector.notifyProblem(E_PICKER_CANCELLED_KEY, E_PICKER_CANCELLED_MSG);<NEW_LINE>}<NEW_LINE>}
E_NO_IMAGE_DATA_FOUND, ex.getMessage());
724,238
private static Map<? extends Number, Long> convertToValueMap(DictIdsWrapper dictIdsWrapper) {<NEW_LINE>Dictionary dictionary = dictIdsWrapper._dictionary;<NEW_LINE>Int2IntOpenHashMap dictIdCountMap = dictIdsWrapper._dictIdCountMap;<NEW_LINE>int numValues = dictIdCountMap.size();<NEW_LINE>ObjectIterator<Int2IntMap.Entry> iterator = Int2IntMaps.fastIterator(dictIdCountMap);<NEW_LINE>DataType storedType = dictionary.getValueType();<NEW_LINE>switch(storedType) {<NEW_LINE>case INT:<NEW_LINE>Int2LongOpenHashMap intValueMap = new Int2LongOpenHashMap(numValues);<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Int2IntMap.<MASK><NEW_LINE>intValueMap.put(dictionary.getIntValue(next.getIntKey()), next.getIntValue());<NEW_LINE>}<NEW_LINE>return intValueMap;<NEW_LINE>case LONG:<NEW_LINE>Long2LongOpenHashMap longValueMap = new Long2LongOpenHashMap(numValues);<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Int2IntMap.Entry next = iterator.next();<NEW_LINE>longValueMap.put(dictionary.getLongValue(next.getIntKey()), next.getIntValue());<NEW_LINE>}<NEW_LINE>return longValueMap;<NEW_LINE>case FLOAT:<NEW_LINE>Float2LongOpenHashMap floatValueMap = new Float2LongOpenHashMap(numValues);<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Int2IntMap.Entry next = iterator.next();<NEW_LINE>floatValueMap.put(dictionary.getFloatValue(next.getIntKey()), next.getIntValue());<NEW_LINE>}<NEW_LINE>return floatValueMap;<NEW_LINE>case DOUBLE:<NEW_LINE>Double2LongOpenHashMap doubleValueMap = new Double2LongOpenHashMap(numValues);<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Int2IntMap.Entry next = iterator.next();<NEW_LINE>doubleValueMap.put(dictionary.getDoubleValue(next.getIntKey()), next.getIntValue());<NEW_LINE>}<NEW_LINE>return doubleValueMap;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Illegal data type for MODE aggregation function: " + storedType);<NEW_LINE>}<NEW_LINE>}
Entry next = iterator.next();
1,213,515
public static DescribeLiveStreamsControlHistoryResponse unmarshall(DescribeLiveStreamsControlHistoryResponse describeLiveStreamsControlHistoryResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeLiveStreamsControlHistoryResponse.setRequestId(_ctx.stringValue("DescribeLiveStreamsControlHistoryResponse.RequestId"));<NEW_LINE>List<LiveStreamControlInfo> controlInfo = new ArrayList<LiveStreamControlInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeLiveStreamsControlHistoryResponse.ControlInfo.Length"); i++) {<NEW_LINE>LiveStreamControlInfo liveStreamControlInfo = new LiveStreamControlInfo();<NEW_LINE>liveStreamControlInfo.setClientIP(_ctx.stringValue("DescribeLiveStreamsControlHistoryResponse.ControlInfo[" + i + "].ClientIP"));<NEW_LINE>liveStreamControlInfo.setTimeStamp(_ctx.stringValue("DescribeLiveStreamsControlHistoryResponse.ControlInfo[" + i + "].TimeStamp"));<NEW_LINE>liveStreamControlInfo.setAction(_ctx.stringValue<MASK><NEW_LINE>liveStreamControlInfo.setStreamName(_ctx.stringValue("DescribeLiveStreamsControlHistoryResponse.ControlInfo[" + i + "].StreamName"));<NEW_LINE>controlInfo.add(liveStreamControlInfo);<NEW_LINE>}<NEW_LINE>describeLiveStreamsControlHistoryResponse.setControlInfo(controlInfo);<NEW_LINE>return describeLiveStreamsControlHistoryResponse;<NEW_LINE>}
("DescribeLiveStreamsControlHistoryResponse.ControlInfo[" + i + "].Action"));
713,034
public name.abuchen.portfolio.model.proto.v1.PPortfolio buildPartial() {<NEW_LINE>name.abuchen.portfolio.model.proto.v1.PPortfolio result = new name.abuchen.portfolio.model.proto.v1.PPortfolio(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>result.uuid_ = uuid_;<NEW_LINE>result.name_ = name_;<NEW_LINE>if (((from_bitField0_ & 0x00000001) != 0)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.note_ = note_;<NEW_LINE>result.isRetired_ = isRetired_;<NEW_LINE>if (((from_bitField0_ & 0x00000002) != 0)) {<NEW_LINE>to_bitField0_ |= 0x00000002;<NEW_LINE>}<NEW_LINE>result.referenceAccount_ = referenceAccount_;<NEW_LINE>if (attributesBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000004) != 0)) {<NEW_LINE>attributes_ = java.util.Collections.unmodifiableList(attributes_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000004);<NEW_LINE>}<NEW_LINE>result.attributes_ = attributes_;<NEW_LINE>} else {<NEW_LINE>result.attributes_ = attributesBuilder_.build();<NEW_LINE>}<NEW_LINE>if (updatedAtBuilder_ == null) {<NEW_LINE>result.updatedAt_ = updatedAt_;<NEW_LINE>} else {<NEW_LINE>result<MASK><NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
.updatedAt_ = updatedAtBuilder_.build();
1,749,397
public static int clang_indexSourceFileFullArgv(@NativeType("CXIndexAction") long action, @NativeType("CXClientData") long client_data, @NativeType("IndexerCallbacks *") IndexerCallbacks index_callbacks, @NativeType("unsigned") int index_callbacks_size, @NativeType("unsigned") int index_options, @NativeType("char const *") CharSequence source_filename, @NativeType("char const * const *") PointerBuffer command_line_args, @Nullable @NativeType("struct CXUnsavedFile *") CXUnsavedFile.Buffer unsaved_files, @Nullable @NativeType("CXTranslationUnit *") PointerBuffer out_TU, @NativeType("unsigned") int TU_options) {<NEW_LINE>if (CHECKS) {<NEW_LINE>checkSafe(out_TU, 1);<NEW_LINE>}<NEW_LINE>MemoryStack stack = stackGet();<NEW_LINE>int stackPointer = stack.getPointer();<NEW_LINE>try {<NEW_LINE>stack.nUTF8(source_filename, true);<NEW_LINE>long source_filenameEncoded = stack.getPointerAddress();<NEW_LINE>return nclang_indexSourceFileFullArgv(action, client_data, index_callbacks.address(), index_callbacks_size, index_options, source_filenameEncoded, memAddress(command_line_args), command_line_args.remaining(), memAddressSafe(unsaved_files), remainingSafe(unsaved_files)<MASK><NEW_LINE>} finally {<NEW_LINE>stack.setPointer(stackPointer);<NEW_LINE>}<NEW_LINE>}
, memAddressSafe(out_TU), TU_options);
1,162,797
public static void main(String[] args) throws Exception {<NEW_LINE>MySqlSource<String> mySqlSource = // set captured database<NEW_LINE>MySqlSource.<String>builder().hostname(SOURCE_IP).port(SOURCE_PORT).// set captured database<NEW_LINE>databaseList(// set captured table<NEW_LINE>SOURCE_DB).// set captured table<NEW_LINE>tableList(// set captured user<NEW_LINE>SOURCE_TABLS).// set captured user<NEW_LINE>username(// set captured pwd<NEW_LINE>SOURCE_USER).// set captured pwd<NEW_LINE>password(// converts SourceRecord to JSON String<NEW_LINE>SOURCE_PWD).// converts SourceRecord to JSON String<NEW_LINE>deserializer(new JsonDebeziumDeserializationSchema()).build();<NEW_LINE>StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();<NEW_LINE>env.setParallelism(1);<NEW_LINE>// enable checkpoint<NEW_LINE>env.enableCheckpointing(10000);<NEW_LINE>DataStreamSource<String> cdcSource = env.fromSource(mySqlSource, WatermarkStrategy.noWatermarks(), "MySQL CDC Source");<NEW_LINE>// get table list<NEW_LINE>List<String> tableList = getTableList();<NEW_LINE>if (null != tableList && tableList.size() > 0) {<NEW_LINE>// get column map<NEW_LINE>Map<String, String> tableColumn = getTableColumn();<NEW_LINE>for (String tbl : tableList) {<NEW_LINE>String column = tableColumn.get(tbl);<NEW_LINE>SingleOutputStreamOperator fifterStream = fifterTableData(cdcSource, tbl);<NEW_LINE>SingleOutputStreamOperator<<MASK><NEW_LINE>DorisSink dorisSink = buildDorisSink(tbl, column);<NEW_LINE>cleanStream.sinkTo(dorisSink).name(tbl);<NEW_LINE>}<NEW_LINE>env.execute("Full Database Sync");<NEW_LINE>}<NEW_LINE>}
String> cleanStream = cleanData(fifterStream);
1,830,150
private <T extends DataRecord> List<T> filterForRecordsWithCorrectPlatformId(@NonNull final List<T> records, @NonNull final ImmutableList.Builder<LocalToRemoteSyncResult> resultToAddErrorsTo) {<NEW_LINE>final Predicate<T> predicate = r -> Objects.equals(r.getPlatformId(), platformId);<NEW_LINE>final String errorMessage = StringUtils.formatMessage("Data record's platformId={} does not match this client's platFormId={}", platformId);<NEW_LINE>final Map<Boolean, List<T>> okAndNotOkDataRecords = partitionByOkAndNotOk(records, predicate);<NEW_LINE>okAndNotOkDataRecords.get(false).stream().map(p -> LocalToRemoteSyncResult.error(p, errorMessage)<MASK><NEW_LINE>final List<T> personsWithEmail = okAndNotOkDataRecords.get(true);<NEW_LINE>return personsWithEmail;<NEW_LINE>}
).forEach(resultToAddErrorsTo::add);
1,259,876
private void createDashboard(VisualisCommonResponseRef dashboardCreateResponseRef, NodeRequestRef requestRef) throws ExternalOperationFailedException {<NEW_LINE>String url = getBaseUrl() + URLUtils.dashboardPortalUrl + "/" + dashboardCreateResponseRef.getDashboardId() + "/dashboards";<NEW_LINE>VisualisPostAction visualisPostAction = new VisualisPostAction();<NEW_LINE>visualisPostAction.setUser(requestRef.getUserName());<NEW_LINE>visualisPostAction.addRequestPayload("config", "");<NEW_LINE>visualisPostAction.addRequestPayload("dashboardPortalId", Long.parseLong(dashboardCreateResponseRef.getDashboardId()));<NEW_LINE>visualisPostAction.addRequestPayload("index", 0);<NEW_LINE>visualisPostAction.addRequestPayload("name", requestRef.getName());<NEW_LINE>visualisPostAction.addRequestPayload("parentId", 0);<NEW_LINE>visualisPostAction.addRequestPayload("type", 1);<NEW_LINE>SSOUrlBuilderOperation ssoUrlBuilderOperation = requestRef.getWorkspace().getSSOUrlBuilderOperation().copy();<NEW_LINE>ssoUrlBuilderOperation.setAppName(getAppName());<NEW_LINE>ssoUrlBuilderOperation.setReqUrl(url);<NEW_LINE>ssoUrlBuilderOperation.setWorkspace(requestRef.getWorkspace().getWorkspaceName());<NEW_LINE>Map<String, Object> resMap = Maps.newHashMap();<NEW_LINE>try {<NEW_LINE>visualisPostAction.setUrl(ssoUrlBuilderOperation.getBuiltUrl());<NEW_LINE>HttpResult httpResult = (HttpResult) this.ssoRequestOperation.requestWithSSO(ssoUrlBuilderOperation, visualisPostAction);<NEW_LINE>resMap = BDPJettyServerHelper.jacksonJson().readValue(httpResult.getResponseBody(), Map.class);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>Map<String, Object> header = (Map<String, Object>) resMap.get("header");<NEW_LINE>int code = (int) header.get("code");<NEW_LINE>if (code != 200) {<NEW_LINE>String errorMsg = header.toString();<NEW_LINE>throw new ExternalOperationFailedException(90176, errorMsg, null);<NEW_LINE>}<NEW_LINE>}
ExternalOperationFailedException(90177, "Create Dashboard Exception", e);
225,137
private JPanel createTargetPanel() {<NEW_LINE>JPanel panel = new JPanel(new BorderLayout());<NEW_LINE>targetFunctionsCB = new JComboBox<>();<NEW_LINE><MASK><NEW_LINE>targetFunctionsCB.setModel(targetFunctionsCBModel);<NEW_LINE>targetFunctionsCB.setRenderer(new FunctionListCellRenderer());<NEW_LINE>targetFunctionsCB.addItemListener(new ItemListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void itemStateChanged(ItemEvent e) {<NEW_LINE>if (e.getStateChange() != ItemEvent.SELECTED) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Function selected = (Function) targetFunctionsCBModel.getSelectedItem();<NEW_LINE>loadFunctions((Function) sourceFunctionsCBModel.getSelectedItem(), selected);<NEW_LINE>updateTabText();<NEW_LINE>// Fire a notification to update the UI state; without this the<NEW_LINE>// actions would not be properly enabled/disabled<NEW_LINE>tool.contextChanged(provider);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>panel.add(targetFunctionsCB, BorderLayout.CENTER);<NEW_LINE>return panel;<NEW_LINE>}
targetFunctionsCBModel = new DefaultComboBoxModel<>();
1,262,214
final GetAssetPropertyValueHistoryResult executeGetAssetPropertyValueHistory(GetAssetPropertyValueHistoryRequest getAssetPropertyValueHistoryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getAssetPropertyValueHistoryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetAssetPropertyValueHistoryRequest> request = null;<NEW_LINE>Response<GetAssetPropertyValueHistoryResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetAssetPropertyValueHistoryRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getAssetPropertyValueHistoryRequest));<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, "GetAssetPropertyValueHistory");<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 = "data.";<NEW_LINE>String resolvedHostPrefix = String.format("data.");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetAssetPropertyValueHistoryResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetAssetPropertyValueHistoryResultJsonUnmarshaller());<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>}
addHandlerContext(HandlerContextKey.SERVICE_ID, "IoTSiteWise");
389,946
public boolean isTriggerActive(IStatementContainer container, IStatementParameter[] parameters) {<NEW_LINE>if (!(container instanceof IGate) || parameters.length < 1 || !(parameters[0] instanceof StatementParameterRedstoneLevel)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int level = ((StatementParameterRedstoneLevel<MASK><NEW_LINE>IGate gate = (IGate) container;<NEW_LINE>TileGenericPipe tile = (TileGenericPipe) gate.getPipe().getTile();<NEW_LINE>int inputLevel = tile.redstoneInput;<NEW_LINE>if (parameters.length > 1 && parameters[1] instanceof StatementParamGateSideOnly && ((StatementParamGateSideOnly) parameters[1]).isOn) {<NEW_LINE>inputLevel = tile.redstoneInputSide[gate.getSide().ordinal()];<NEW_LINE>}<NEW_LINE>switch(mode) {<NEW_LINE>case LESS:<NEW_LINE>return inputLevel < level;<NEW_LINE>case EQUAL:<NEW_LINE>default:<NEW_LINE>return inputLevel == level;<NEW_LINE>case GREATER:<NEW_LINE>return inputLevel > level;<NEW_LINE>}<NEW_LINE>}
) parameters[0]).level;
1,370,231
private void log(final String output) {<NEW_LINE>final String msg = StringUtil.toIsoDate(Instant.now()) + " " + output + "\n";<NEW_LINE>if (debugWriter != null) {<NEW_LINE>try {<NEW_LINE>debugWriter.append(msg);<NEW_LINE>debugWriter.flush();<NEW_LINE>} catch (final IOException e) {<NEW_LINE>LOGGER.warn(pwNotifyService.getSessionLabel(), () -> "unexpected IO error writing to debugWriter: " + e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>internalLog.append(msg);<NEW_LINE>while (internalLog.length() > MAX_LOG_SIZE) {<NEW_LINE>final int nextLf = internalLog.indexOf("\n");<NEW_LINE>if (nextLf > 0) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>internalLog.delete(0, Math.max(1024, internalLog.length()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOGGER.trace(pwNotifyService.getSessionLabel(), () -> output);<NEW_LINE>}
internalLog.delete(0, nextLf);
1,508,338
public void crop() {<NEW_LINE>if (croppedImage == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>setNewImageName(getRandomImageName());<NEW_LINE>ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();<NEW_LINE>String newFileName = externalContext.getRealPath("") + File.separator + "resources" + File.separator + "demo" + File.separator + "images" + File.separator + "crop" + File.separator + getNewImageName() + ".jpg";<NEW_LINE>FileImageOutputStream imageOutput;<NEW_LINE>try {<NEW_LINE>imageOutput = new <MASK><NEW_LINE>imageOutput.write(croppedImage.getBytes(), 0, croppedImage.getBytes().length);<NEW_LINE>imageOutput.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, "Error", "Cropping failed."));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Success", "Cropping finished."));<NEW_LINE>}
FileImageOutputStream(new File(newFileName));
102,728
private void loadConfigFile() throws IngestModuleException {<NEW_LINE>Document xmlinput;<NEW_LINE>try {<NEW_LINE>String path = PlatformUtil.getUserConfigDirectory() + File.separator + XMLFILE;<NEW_LINE>File f = new File(path);<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.INFO, "Load successful");<NEW_LINE>DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();<NEW_LINE><MASK><NEW_LINE>xmlinput = db.parse(f);<NEW_LINE>if (!XMLUtil.xmlIsValid(xmlinput, SearchEngineURLQueryAnalyzer.class, XSDFILE)) {<NEW_LINE>// NON-NLS<NEW_LINE>logger.log(Level.WARNING, "Error loading Search Engines: could not validate against [" + XSDFILE + "], results may not be accurate.");<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>// NON-NLS<NEW_LINE>throw new IngestModuleException(Bundle.cannotLoadSEUQA() + e.getLocalizedMessage(), e);<NEW_LINE>} catch (ParserConfigurationException pce) {<NEW_LINE>// NON-NLS<NEW_LINE>throw new IngestModuleException(Bundle.cannotBuildXmlParser() + pce.getLocalizedMessage(), pce);<NEW_LINE>} catch (SAXException sxe) {<NEW_LINE>// NON-NLS<NEW_LINE>throw new IngestModuleException(Bundle.cannotParseXml() + sxe.getLocalizedMessage(), sxe);<NEW_LINE>}<NEW_LINE>// NON-NLS<NEW_LINE>NodeList nlist = xmlinput.getElementsByTagName("SearchEngine");<NEW_LINE>SearchEngineURLQueryAnalyzer.SearchEngine[] listEngines = new SearchEngineURLQueryAnalyzer.SearchEngine[nlist.getLength()];<NEW_LINE>for (int i = 0; i < nlist.getLength(); i++) {<NEW_LINE>NamedNodeMap nnm = nlist.item(i).getAttributes();<NEW_LINE>// NON-NLS<NEW_LINE>String EngineName = nnm.getNamedItem("engine").getNodeValue();<NEW_LINE>// NON-NLS<NEW_LINE>String EnginedomainSubstring = nnm.getNamedItem("domainSubstring").getNodeValue();<NEW_LINE>List<KeyPair> keys = new ArrayList<>();<NEW_LINE>// NON-NLS<NEW_LINE>NodeList listSplits = xmlinput.getElementsByTagName("splitToken");<NEW_LINE>for (int k = 0; k < listSplits.getLength(); k++) {<NEW_LINE>if (listSplits.item(k).getParentNode().getAttributes().getNamedItem("engine").getNodeValue().equals(EngineName)) {<NEW_LINE>// NON-NLS<NEW_LINE>// NON-NLS<NEW_LINE>keys.add(new KeyPair(listSplits.item(k).getAttributes().getNamedItem("plainToken").getNodeValue(), listSplits.item(k).getAttributes().getNamedItem("regexToken").getNodeValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SearchEngineURLQueryAnalyzer.SearchEngine Se = new SearchEngineURLQueryAnalyzer.SearchEngine(EngineName, EnginedomainSubstring, keys);<NEW_LINE>listEngines[i] = Se;<NEW_LINE>}<NEW_LINE>engines = listEngines;<NEW_LINE>}
DocumentBuilder db = dbf.newDocumentBuilder();
152,049
void load(byte[] data, int dataOffset, RandomAccessData variableData, long variableOffset, JarEntryFilter filter) throws IOException {<NEW_LINE>// Load fixed part<NEW_LINE>this.header = data;<NEW_LINE>this.headerOffset = dataOffset;<NEW_LINE>long compressedSize = Bytes.littleEndianValue(data, dataOffset + 20, 4);<NEW_LINE>long uncompressedSize = Bytes.littleEndianValue(<MASK><NEW_LINE>long nameLength = Bytes.littleEndianValue(data, dataOffset + 28, 2);<NEW_LINE>long extraLength = Bytes.littleEndianValue(data, dataOffset + 30, 2);<NEW_LINE>long commentLength = Bytes.littleEndianValue(data, dataOffset + 32, 2);<NEW_LINE>long localHeaderOffset = Bytes.littleEndianValue(data, dataOffset + 42, 4);<NEW_LINE>// Load variable part<NEW_LINE>dataOffset += 46;<NEW_LINE>if (variableData != null) {<NEW_LINE>data = variableData.read(variableOffset + 46, nameLength + extraLength + commentLength);<NEW_LINE>dataOffset = 0;<NEW_LINE>}<NEW_LINE>this.name = new AsciiBytes(data, dataOffset, (int) nameLength);<NEW_LINE>if (filter != null) {<NEW_LINE>this.name = filter.apply(this.name);<NEW_LINE>}<NEW_LINE>this.extra = NO_EXTRA;<NEW_LINE>this.comment = NO_COMMENT;<NEW_LINE>if (extraLength > 0) {<NEW_LINE>this.extra = new byte[(int) extraLength];<NEW_LINE>System.arraycopy(data, (int) (dataOffset + nameLength), this.extra, 0, this.extra.length);<NEW_LINE>}<NEW_LINE>this.localHeaderOffset = getLocalHeaderOffset(compressedSize, uncompressedSize, localHeaderOffset, this.extra);<NEW_LINE>if (commentLength > 0) {<NEW_LINE>this.comment = new AsciiBytes(data, (int) (dataOffset + nameLength + extraLength), (int) commentLength);<NEW_LINE>}<NEW_LINE>}
data, dataOffset + 24, 4);
36,886
private static String expandRedirectUri(ServerHttpRequest request, ClientRegistration clientRegistration) {<NEW_LINE>Map<String, String> uriVariables = new HashMap<>();<NEW_LINE>uriVariables.put("registrationId", clientRegistration.getRegistrationId());<NEW_LINE>// @formatter:off<NEW_LINE>UriComponents uriComponents = UriComponentsBuilder.fromUri(request.getURI()).replacePath(request.getPath().contextPath().value()).replaceQuery(null).fragment(null).build();<NEW_LINE>// @formatter:on<NEW_LINE>String scheme = uriComponents.getScheme();<NEW_LINE>uriVariables.put("baseScheme", (scheme != null) ? scheme : "");<NEW_LINE><MASK><NEW_LINE>uriVariables.put("baseHost", (host != null) ? host : "");<NEW_LINE>// following logic is based on HierarchicalUriComponents#toUriString()<NEW_LINE>int port = uriComponents.getPort();<NEW_LINE>uriVariables.put("basePort", (port == -1) ? "" : ":" + port);<NEW_LINE>String path = uriComponents.getPath();<NEW_LINE>if (StringUtils.hasLength(path)) {<NEW_LINE>if (path.charAt(0) != PATH_DELIMITER) {<NEW_LINE>path = PATH_DELIMITER + path;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>uriVariables.put("basePath", (path != null) ? path : "");<NEW_LINE>uriVariables.put("baseUrl", uriComponents.toUriString());<NEW_LINE>String action = "";<NEW_LINE>if (AuthorizationGrantType.AUTHORIZATION_CODE.equals(clientRegistration.getAuthorizationGrantType())) {<NEW_LINE>action = "login";<NEW_LINE>}<NEW_LINE>uriVariables.put("action", action);<NEW_LINE>// @formatter:off<NEW_LINE>return UriComponentsBuilder.fromUriString(clientRegistration.getRedirectUri()).buildAndExpand(uriVariables).toUriString();<NEW_LINE>// @formatter:on<NEW_LINE>}
String host = uriComponents.getHost();
1,356,309
public ECPoint twicePlus(ECPoint b) {<NEW_LINE>if (this.isInfinity()) {<NEW_LINE>return b;<NEW_LINE>}<NEW_LINE>if (b.isInfinity()) {<NEW_LINE>return twice();<NEW_LINE>}<NEW_LINE>ECCurve curve = this.getCurve();<NEW_LINE>ECFieldElement X1 = this.x;<NEW_LINE>if (X1.isZero()) {<NEW_LINE>// A point with X == 0 is its own additive inverse<NEW_LINE>return b;<NEW_LINE>}<NEW_LINE>ECFieldElement X2 = b.getRawXCoord(), Z2 = b.getZCoord(0);<NEW_LINE>if (X2.isZero() || !Z2.isOne()) {<NEW_LINE>return twice().add(b);<NEW_LINE>}<NEW_LINE>ECFieldElement L1 = this.y, Z1 = this.zs[0];<NEW_LINE>ECFieldElement L2 = b.getRawYCoord();<NEW_LINE>ECFieldElement X1Sq = X1.square();<NEW_LINE>ECFieldElement L1Sq = L1.square();<NEW_LINE>ECFieldElement Z1Sq = Z1.square();<NEW_LINE>ECFieldElement L1Z1 = L1.multiply(Z1);<NEW_LINE>ECFieldElement T = curve.getA().multiply(Z1Sq).add(L1Sq).add(L1Z1);<NEW_LINE>ECFieldElement L2plus1 = L2.addOne();<NEW_LINE>ECFieldElement A = curve.getA().add(L2plus1).multiply(Z1Sq).add(L1Sq).multiplyPlusProduct(T, X1Sq, Z1Sq);<NEW_LINE>ECFieldElement X2Z1Sq = X2.multiply(Z1Sq);<NEW_LINE>ECFieldElement B = X2Z1Sq.add(T).square();<NEW_LINE>if (B.isZero()) {<NEW_LINE>if (A.isZero()) {<NEW_LINE>return b.twice();<NEW_LINE>}<NEW_LINE>return curve.getInfinity();<NEW_LINE>}<NEW_LINE>if (A.isZero()) {<NEW_LINE>return new SecT163R1Point(curve, A, curve.getB().sqrt());<NEW_LINE>}<NEW_LINE>ECFieldElement X3 = A.<MASK><NEW_LINE>ECFieldElement Z3 = A.multiply(B).multiply(Z1Sq);<NEW_LINE>ECFieldElement L3 = A.add(B).square().multiplyPlusProduct(T, L2plus1, Z3);<NEW_LINE>return new SecT163R1Point(curve, X3, L3, new ECFieldElement[] { Z3 });<NEW_LINE>}
square().multiply(X2Z1Sq);
1,147,197
public static DescribeBackupSourceGroupsResponse unmarshall(DescribeBackupSourceGroupsResponse describeBackupSourceGroupsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeBackupSourceGroupsResponse.setRequestId(_ctx.stringValue("DescribeBackupSourceGroupsResponse.RequestId"));<NEW_LINE>describeBackupSourceGroupsResponse.setSuccess<MASK><NEW_LINE>describeBackupSourceGroupsResponse.setCode(_ctx.stringValue("DescribeBackupSourceGroupsResponse.Code"));<NEW_LINE>describeBackupSourceGroupsResponse.setMessage(_ctx.stringValue("DescribeBackupSourceGroupsResponse.Message"));<NEW_LINE>describeBackupSourceGroupsResponse.setTotalCount(_ctx.longValue("DescribeBackupSourceGroupsResponse.TotalCount"));<NEW_LINE>describeBackupSourceGroupsResponse.setPageSize(_ctx.integerValue("DescribeBackupSourceGroupsResponse.PageSize"));<NEW_LINE>describeBackupSourceGroupsResponse.setPageNumber(_ctx.integerValue("DescribeBackupSourceGroupsResponse.PageNumber"));<NEW_LINE>List<BackupSourceGroup> backupSourceGroups = new ArrayList<BackupSourceGroup>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeBackupSourceGroupsResponse.BackupSourceGroups.Length"); i++) {<NEW_LINE>BackupSourceGroup backupSourceGroup = new BackupSourceGroup();<NEW_LINE>backupSourceGroup.setBackupSourceGroupId(_ctx.stringValue("DescribeBackupSourceGroupsResponse.BackupSourceGroups[" + i + "].BackupSourceGroupId"));<NEW_LINE>backupSourceGroup.setDescription(_ctx.stringValue("DescribeBackupSourceGroupsResponse.BackupSourceGroups[" + i + "].Description"));<NEW_LINE>backupSourceGroup.setSourceType(_ctx.stringValue("DescribeBackupSourceGroupsResponse.BackupSourceGroups[" + i + "].SourceType"));<NEW_LINE>backupSourceGroup.setBackupSourceCount(_ctx.integerValue("DescribeBackupSourceGroupsResponse.BackupSourceGroups[" + i + "].BackupSourceCount"));<NEW_LINE>backupSourceGroup.setClusterId(_ctx.stringValue("DescribeBackupSourceGroupsResponse.BackupSourceGroups[" + i + "].ClusterId"));<NEW_LINE>backupSourceGroup.setCreatedTime(_ctx.longValue("DescribeBackupSourceGroupsResponse.BackupSourceGroups[" + i + "].CreatedTime"));<NEW_LINE>backupSourceGroup.setUpdatedTime(_ctx.longValue("DescribeBackupSourceGroupsResponse.BackupSourceGroups[" + i + "].UpdatedTime"));<NEW_LINE>backupSourceGroups.add(backupSourceGroup);<NEW_LINE>}<NEW_LINE>describeBackupSourceGroupsResponse.setBackupSourceGroups(backupSourceGroups);<NEW_LINE>return describeBackupSourceGroupsResponse;<NEW_LINE>}
(_ctx.booleanValue("DescribeBackupSourceGroupsResponse.Success"));
138,792
public static SearchPipelineResponse unmarshall(SearchPipelineResponse searchPipelineResponse, UnmarshallerContext _ctx) {<NEW_LINE>searchPipelineResponse.setRequestId(_ctx.stringValue("SearchPipelineResponse.RequestId"));<NEW_LINE>searchPipelineResponse.setTotalCount(_ctx.longValue("SearchPipelineResponse.TotalCount"));<NEW_LINE>searchPipelineResponse.setPageSize(_ctx.longValue("SearchPipelineResponse.PageSize"));<NEW_LINE>searchPipelineResponse.setPageNumber(_ctx.longValue("SearchPipelineResponse.PageNumber"));<NEW_LINE>List<Pipeline> pipelineList = new ArrayList<Pipeline>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("SearchPipelineResponse.PipelineList.Length"); i++) {<NEW_LINE>Pipeline pipeline = new Pipeline();<NEW_LINE>pipeline.setSpeed(_ctx.stringValue("SearchPipelineResponse.PipelineList[" + i + "].Speed"));<NEW_LINE>pipeline.setState(_ctx.stringValue("SearchPipelineResponse.PipelineList[" + i + "].State"));<NEW_LINE>pipeline.setSpeedLevel(_ctx.longValue("SearchPipelineResponse.PipelineList[" + i + "].SpeedLevel"));<NEW_LINE>pipeline.setRole(_ctx.stringValue("SearchPipelineResponse.PipelineList[" + i + "].Role"));<NEW_LINE>pipeline.setName(_ctx.stringValue<MASK><NEW_LINE>pipeline.setId(_ctx.stringValue("SearchPipelineResponse.PipelineList[" + i + "].Id"));<NEW_LINE>pipeline.setQuotaAllocate(_ctx.longValue("SearchPipelineResponse.PipelineList[" + i + "].QuotaAllocate"));<NEW_LINE>NotifyConfig notifyConfig = new NotifyConfig();<NEW_LINE>notifyConfig.setMqTopic(_ctx.stringValue("SearchPipelineResponse.PipelineList[" + i + "].NotifyConfig.MqTopic"));<NEW_LINE>notifyConfig.setQueueName(_ctx.stringValue("SearchPipelineResponse.PipelineList[" + i + "].NotifyConfig.QueueName"));<NEW_LINE>notifyConfig.setMqTag(_ctx.stringValue("SearchPipelineResponse.PipelineList[" + i + "].NotifyConfig.MqTag"));<NEW_LINE>notifyConfig.setTopic(_ctx.stringValue("SearchPipelineResponse.PipelineList[" + i + "].NotifyConfig.Topic"));<NEW_LINE>pipeline.setNotifyConfig(notifyConfig);<NEW_LINE>pipelineList.add(pipeline);<NEW_LINE>}<NEW_LINE>searchPipelineResponse.setPipelineList(pipelineList);<NEW_LINE>return searchPipelineResponse;<NEW_LINE>}
("SearchPipelineResponse.PipelineList[" + i + "].Name"));
1,024,844
public void run(RegressionEnvironment env) {<NEW_LINE>String text = "@name('s0') select irstream symbol, price from SupportMarketDataBean#unique(symbol) order by symbol";<NEW_LINE>if (optionalAnnotation != null) {<NEW_LINE>text = optionalAnnotation + text;<NEW_LINE>}<NEW_LINE>env.compileDeployAddListenerMileZero(text, "s0");<NEW_LINE>env.sendEventBean(makeMarketDataEvent("S1", 100));<NEW_LINE>env.assertPropsNV("s0", new Object[][] { { "symbol", "S1" }, { "price", 100.0 } }, null);<NEW_LINE>env.milestone(1);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("S2", 5));<NEW_LINE>env.assertPropsNV("s0", new Object[][] { { "symbol", "S2" }, { "price", 5.0 } }, null);<NEW_LINE>env.milestone(2);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("S1", 101));<NEW_LINE>env.assertPropsNV("s0", new Object[][] { { "symbol", "S1" }, { "price", 101.0 } }, new Object[][] { { "symbol", "S1" }, { "price", 100.0 } });<NEW_LINE>env.milestone(3);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("S1", 102));<NEW_LINE>env.assertPropsNV("s0", new Object[][] { { "symbol", "S1" }, { "price", 102.0 } }, new Object[][] { { "symbol", "S1" }, { "price", 101.0 } });<NEW_LINE>// test iterator<NEW_LINE>env.assertPropsPerRowIterator("s0", new String[] { "price" }, new Object[][] { { <MASK><NEW_LINE>env.milestone(4);<NEW_LINE>env.sendEventBean(makeMarketDataEvent("S2", 6));<NEW_LINE>env.assertPropsNV("s0", new Object[][] { { "symbol", "S2" }, { "price", 6.0 } }, new Object[][] { { "symbol", "S2" }, { "price", 5.0 } });<NEW_LINE>env.undeployAll();<NEW_LINE>}
102.0 }, { 5.0 } });
210,769
public static void fillRectangle(GrayS32 image, int value, int x0, int y0, int width, int height) {<NEW_LINE>int x1 = x0 + width;<NEW_LINE>int y1 = y0 + height;<NEW_LINE>if (x0 < 0)<NEW_LINE>x0 = 0;<NEW_LINE>if (x1 > image.width)<NEW_LINE>x1 = image.width;<NEW_LINE>if (y0 < 0)<NEW_LINE>y0 = 0;<NEW_LINE>if (y1 > image.height)<NEW_LINE>y1 = image.height;<NEW_LINE>final int _x0 = x0;<NEW_LINE>final int _x1 = x1;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(y0, y1 , y->{<NEW_LINE>for (int y = y0; y < y1; y++) {<NEW_LINE>int index = image.startIndex <MASK><NEW_LINE>Arrays.fill(image.data, index, index + _x1 - _x0, value);<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
+ y * image.stride + _x0;
610,416
static IndexMetadata buildIndexMetadata(String indexName, List<AliasMetadata> aliases, Supplier<DocumentMapper> documentMapperSupplier, Settings indexSettings, int routingNumShards, @Nullable IndexMetadata sourceMetadata, boolean isSystem) {<NEW_LINE>IndexMetadata.Builder indexMetadataBuilder = createIndexMetadataBuilder(indexName, sourceMetadata, indexSettings, routingNumShards);<NEW_LINE>indexMetadataBuilder.system(isSystem);<NEW_LINE>// now, update the mappings with the actual source<NEW_LINE>Map<String, MappingMetadata> <MASK><NEW_LINE>DocumentMapper mapper = documentMapperSupplier.get();<NEW_LINE>if (mapper != null) {<NEW_LINE>MappingMetadata mappingMd = new MappingMetadata(mapper);<NEW_LINE>mappingsMetadata.put(mapper.type(), mappingMd);<NEW_LINE>}<NEW_LINE>for (MappingMetadata mappingMd : mappingsMetadata.values()) {<NEW_LINE>indexMetadataBuilder.putMapping(mappingMd);<NEW_LINE>}<NEW_LINE>// apply the aliases in reverse order as the lower index ones have higher order<NEW_LINE>for (int i = aliases.size() - 1; i >= 0; i--) {<NEW_LINE>indexMetadataBuilder.putAlias(aliases.get(i));<NEW_LINE>}<NEW_LINE>indexMetadataBuilder.state(IndexMetadata.State.OPEN);<NEW_LINE>return indexMetadataBuilder.build();<NEW_LINE>}
mappingsMetadata = new HashMap<>();
103,175
private void submitForm(boolean fromConfirmAccount) {<NEW_LINE>logDebug("fromConfirmAccount - " + fromConfirmAccount + " email: " + this.emailTemp + "__" + this.passwdTemp);<NEW_LINE>lastEmail = this.emailTemp;<NEW_LINE>lastPassword = this.passwdTemp;<NEW_LINE>imm.hideSoftInputFromWindow(et_user.getWindowToken(), 0);<NEW_LINE>if (!isOnline(context)) {<NEW_LINE>loginLoggingIn.setVisibility(View.GONE);<NEW_LINE>loginLogin.setVisibility(View.VISIBLE);<NEW_LINE>closeCancelDialog();<NEW_LINE>loginCreateAccount.setVisibility(View.VISIBLE);<NEW_LINE>queryingSignupLinkText.setVisibility(View.GONE);<NEW_LINE>confirmingAccountText.setVisibility(View.GONE);<NEW_LINE>generatingKeysText.setVisibility(View.GONE);<NEW_LINE>loggingInText.setVisibility(View.GONE);<NEW_LINE>fetchingNodesText.setVisibility(View.GONE);<NEW_LINE><MASK><NEW_LINE>serversBusyText.setVisibility(View.GONE);<NEW_LINE>((LoginActivity) context).showSnackbar(getString(R.string.error_server_connection_problem));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>loginLogin.setVisibility(View.GONE);<NEW_LINE>loginCreateAccount.setVisibility(View.GONE);<NEW_LINE>loginLoggingIn.setVisibility(View.VISIBLE);<NEW_LINE>generatingKeysText.setVisibility(View.VISIBLE);<NEW_LINE>loginProgressBar.setVisibility(View.VISIBLE);<NEW_LINE>loginFetchNodesProgressBar.setVisibility(View.GONE);<NEW_LINE>queryingSignupLinkText.setVisibility(View.GONE);<NEW_LINE>confirmingAccountText.setVisibility(View.GONE);<NEW_LINE>logDebug("Generating keys");<NEW_LINE>onKeysGenerated(lastEmail, lastPassword);<NEW_LINE>}
prepareNodesText.setVisibility(View.GONE);
874,682
private long findRecoverySeq(List<Path> recoveryLogs, Set<String> tabletFiles, int tabletId) throws IOException {<NEW_LINE>HashSet<String> suffixes = new HashSet<>();<NEW_LINE>for (String path : tabletFiles) suffixes.add(getPathSuffix(path));<NEW_LINE>long lastStart = 0;<NEW_LINE>long lastFinish = 0;<NEW_LINE>long recoverySeq = 0;<NEW_LINE>try (RecoveryLogsIterator rli = new RecoveryLogsIterator(context, recoveryLogs, minKey(COMPACTION_START, tabletId), maxKey(COMPACTION_START, tabletId), false)) {<NEW_LINE>DeduplicatingIterator ddi = new DeduplicatingIterator(rli);<NEW_LINE>String lastStartFile = null;<NEW_LINE>LogEvents lastEvent = null;<NEW_LINE>while (ddi.hasNext()) {<NEW_LINE>LogFileKey key = ddi.next().getKey();<NEW_LINE>checkState(key.seq >= 0, <MASK><NEW_LINE>// should only fail if bug elsewhere<NEW_LINE>checkState(key.tabletId == tabletId);<NEW_LINE>// should only fail if bug elsewhere<NEW_LINE>checkState(key.seq >= Math.max(lastFinish, lastStart));<NEW_LINE>switch(key.event) {<NEW_LINE>case COMPACTION_START:<NEW_LINE>lastStart = key.seq;<NEW_LINE>lastStartFile = key.filename;<NEW_LINE>break;<NEW_LINE>case COMPACTION_FINISH:<NEW_LINE>checkState(key.seq > lastStart, "Compaction finish <= start %s %s %s", key.tabletId, key.seq, lastStart);<NEW_LINE>checkState(lastEvent != COMPACTION_FINISH, "Saw consecutive COMPACTION_FINISH events %s %s %s", key.tabletId, lastFinish, key.seq);<NEW_LINE>lastFinish = key.seq;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Non compaction event seen " + key.event);<NEW_LINE>}<NEW_LINE>lastEvent = key.event;<NEW_LINE>}<NEW_LINE>if (lastEvent == COMPACTION_START && suffixes.contains(getPathSuffix(lastStartFile))) {<NEW_LINE>// There was no compaction finish event following this start, however the last compaction<NEW_LINE>// start event has a file in the metadata table, so the compaction finished.<NEW_LINE>log.debug("Considering compaction start {} {} finished because file {} in metadata table", tabletId, lastStart, getPathSuffix(lastStartFile));<NEW_LINE>recoverySeq = lastStart;<NEW_LINE>} else {<NEW_LINE>// Recover everything >= the maximum finish sequence number if its set, otherwise return 0.<NEW_LINE>recoverySeq = Math.max(0, lastFinish - 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return recoverySeq;<NEW_LINE>}
"Unexpected negative seq %s for tabletId %s", key.seq, tabletId);
537,647
private static float[][] convertData(float[][] lpcc, int lpcOrder) {<NEW_LINE>int nCep = lpcc[0].length;<NEW_LINE>double[] c = new double[nCep];<NEW_LINE>double[] a = new double[lpcOrder + 1];<NEW_LINE>float[][] lpc = new float[lpcc.length][lpcOrder + 1];<NEW_LINE>// For each LPC vector:<NEW_LINE>for (int i = 0; i < lpcc.length; i++) {<NEW_LINE>// Cast the LPCC coeffs from float to double<NEW_LINE>for (int k = 0; k < nCep; k++) {<NEW_LINE>c[k] = (double) (lpcc[i][k]);<NEW_LINE>}<NEW_LINE>// Do the conversion<NEW_LINE>a = CepstrumLPCAnalyser.lpcc2lpc(c, lpcOrder);<NEW_LINE>// Recover the energy from the cepstrum vector<NEW_LINE>lpc[i][0] = (float) (Math.<MASK><NEW_LINE>// Cast the LPCs back to floats<NEW_LINE>for (int k = 1; k <= lpcOrder; k++) {<NEW_LINE>lpc[i][k] = (float) (a[k]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (lpc);<NEW_LINE>}
exp(c[0]));
1,104,429
ActionResult<WrapOutMap> execute(String appId) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<WrapOutMap> <MASK><NEW_LINE>WrapOutMap wrap = new WrapOutMap();<NEW_LINE>List<FormField> list = new ArrayList<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>AppInfo appInfo = emc.find(appId, AppInfo.class);<NEW_LINE>if (null == appInfo) {<NEW_LINE>throw new ExceptionAppInfoNotExist(appId);<NEW_LINE>}<NEW_LINE>List<String> ids = business.formFieldFactory().listWithAppInfo(appInfo.getId());<NEW_LINE>for (FormField o : emc.list(FormField.class, ids)) {<NEW_LINE>if (!contains(list, o)) {<NEW_LINE>list.add(o);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<String, List<FormField>> map = list.stream().sorted(Comparator.comparing(FormField::getDataType).thenComparing(Comparator.comparing(FormField::getName))).collect(Collectors.groupingBy(FormField::getDataType));<NEW_LINE>wrap.putAll(map);<NEW_LINE>result.setData(wrap);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
result = new ActionResult<>();
580,720
protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {<NEW_LINE>ByteBuf buf = (ByteBuf) msg;<NEW_LINE>if (BitUtil.check(buf.getByte(buf.readerIndex()), 7)) {<NEW_LINE>int content = buf.readUnsignedByte();<NEW_LINE>if (BitUtil.check(content, 0)) {<NEW_LINE>String id = ByteBufUtil.hexDump(buf.readSlice(buf.readUnsignedByte())).replace("f", "");<NEW_LINE>getDeviceSession(channel, remoteAddress, id);<NEW_LINE>}<NEW_LINE>if (BitUtil.check(content, 1)) {<NEW_LINE>// identifier type<NEW_LINE>buf.skipBytes(buf.readUnsignedByte());<NEW_LINE>}<NEW_LINE>if (BitUtil.check(content, 2)) {<NEW_LINE>// authentication<NEW_LINE>buf.skipBytes(buf.readUnsignedByte());<NEW_LINE>}<NEW_LINE>if (BitUtil.check(content, 3)) {<NEW_LINE>// routing<NEW_LINE>buf.skipBytes(buf.readUnsignedByte());<NEW_LINE>}<NEW_LINE>if (BitUtil.check(content, 4)) {<NEW_LINE>// forwarding<NEW_LINE>buf.skipBytes(buf.readUnsignedByte());<NEW_LINE>}<NEW_LINE>if (BitUtil.check(content, 5)) {<NEW_LINE>// response redirection<NEW_LINE>buf.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress);<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int service = buf.readUnsignedByte();<NEW_LINE>int type = buf.readUnsignedByte();<NEW_LINE>int index = buf.readUnsignedShort();<NEW_LINE>if (service == SERVICE_ACKNOWLEDGED) {<NEW_LINE>sendResponse(channel, remoteAddress, type, index, 0);<NEW_LINE>}<NEW_LINE>if (type == MSG_EVENT_REPORT || type == MSG_LOCATE_REPORT || type == MSG_MINI_EVENT_REPORT || type == MSG_USER_DATA) {<NEW_LINE>return decodePosition(deviceSession, type, buf);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
skipBytes(buf.readUnsignedByte());
759,869
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {<NEW_LINE>for (Iterator<MageObjectReference> it = affectedObjectList.iterator(); it.hasNext(); ) {<NEW_LINE>Permanent perm = it.next().getPermanent(game);<NEW_LINE>if (perm == null) {<NEW_LINE>it.remove();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (perm.getCounters(game).getCount(CounterType.AWAKENING) < 1) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>switch(layer) {<NEW_LINE>case TypeChangingEffects_4:<NEW_LINE>perm.<MASK><NEW_LINE>perm.addSubType(game, SubType.ELEMENTAL);<NEW_LINE>break;<NEW_LINE>case ColorChangingEffects_5:<NEW_LINE>perm.getColor(game).addColor(ObjectColor.GREEN);<NEW_LINE>break;<NEW_LINE>case PTChangingEffects_7:<NEW_LINE>if (sublayer == SubLayer.SetPT_7b) {<NEW_LINE>perm.getPower().setValue(8);<NEW_LINE>perm.getToughness().setValue(8);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
addCardType(game, CardType.CREATURE);
1,605,375
private static String allErrorsToString(List<String> allErrors) {<NEW_LINE>if (allErrors == null || allErrors.size() == 0)<NEW_LINE>// should never be<NEW_LINE>return "Error list empty";<NEW_LINE>StringBuilder b = new StringBuilder();<NEW_LINE>b.append("Number of errors: ").append(allErrors.size()).append("+").append("\n");<NEW_LINE>List<String> ruleValidationErrors = allErrors.stream().filter((error) -> error.startsWith(RULE_ERROR_PREFIX)).collect(toList());<NEW_LINE>if (ruleValidationErrors.isEmpty()) {<NEW_LINE>for (int i = 1; i <= allErrors.size(); i++) {<NEW_LINE>b.append(i).append(". ").append(allErrors.get(i - 1)).append(";; \n");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>b.append("I. Rule Validation Errors: \n");<NEW_LINE>for (int i = 1; i <= ruleValidationErrors.size(); i++) {<NEW_LINE>b.append('\t').append(i).append(". ").append(ruleValidationErrors.get(i - 1)).append(";; \n");<NEW_LINE>}<NEW_LINE>b.append("\n");<NEW_LINE>List<String> configValidationErrors <MASK><NEW_LINE>configValidationErrors.removeAll(ruleValidationErrors);<NEW_LINE>b.append("II. Config Validation Errors: \n");<NEW_LINE>for (int i = 1; i <= configValidationErrors.size(); i++) {<NEW_LINE>b.append('\t').append(i).append(". ").append(configValidationErrors.get(i - 1)).append(";; \n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return b.toString();<NEW_LINE>}
= new ArrayList<>(allErrors);
374,537
// Use invokeAll where the group of tasks to invoke is a single task and where it is no tasks at all.<NEW_LINE>// When a single task is invoked, it runs on the current thread if a permit is available, and otherwise on a separate thread.<NEW_LINE>// However, if using CallerRuns, then it always runs on the current thread regardless of whether a permit is available.<NEW_LINE>@Test<NEW_LINE>public void testInvokeAllOfOneAndNone() throws Exception {<NEW_LINE>PolicyExecutor executor = provider.create("testInvokeAllOfOneAndNone").maxConcurrency(1).maxPolicy(MaxPolicy.strict).maxQueueSize(2).maxWaitForEnqueue(TimeUnit.SECONDS.toMillis(10));<NEW_LINE>long threadId = Thread.currentThread().getId();<NEW_LINE>List<Future<Long>> futures;<NEW_LINE>// Invoke group of none<NEW_LINE>futures = executor.invokeAll(Collections.<Callable<Long>>emptySet());<NEW_LINE>assertEquals(0, futures.size());<NEW_LINE>// Invoke group of one, where a maxConcurrency permit is available<NEW_LINE>futures = executor.invokeAll(Collections.singleton(new ThreadIdTask()));<NEW_LINE>assertEquals(<MASK><NEW_LINE>assertEquals(Long.valueOf(threadId), futures.get(0).get(0, TimeUnit.MINUTES));<NEW_LINE>// Use up the maxConcurrency permit<NEW_LINE>CountDownLatch blockingLatch = new CountDownLatch(1);<NEW_LINE>Future<Boolean> blockingFuture = executor.submit(new CountDownTask(new CountDownLatch(1), blockingLatch, TimeUnit.MINUTES.toNanos(15)));<NEW_LINE>// Invoke group of one, where a maxConcurrency permit is unavailable.<NEW_LINE>// Because no threads are available to run the task, invokeAll will be blocked, and we will need to interrupt it<NEW_LINE>testThreads.submit(new InterrupterTask(Thread.currentThread(), blockingLatch, 1, TimeUnit.SECONDS));<NEW_LINE>try {<NEW_LINE>futures = executor.invokeAll(Collections.singleton(new ThreadIdTask()));<NEW_LINE>fail("Able to invoke task despite maximum concurrency. " + futures);<NEW_LINE>} catch (InterruptedException x) {<NEW_LINE>}<NEW_LINE>// pass<NEW_LINE>// If using maxConcurrencyAppliesToCallerThread=false, we don't need a permit<NEW_LINE>executor.maxPolicy(MaxPolicy.loose);<NEW_LINE>futures = executor.invokeAll(Collections.singleton(new ThreadIdTask()));<NEW_LINE>assertEquals(1, futures.size());<NEW_LINE>assertEquals(Long.valueOf(threadId), futures.get(0).get(0, TimeUnit.MINUTES));<NEW_LINE>// Release the blocker and let the blocking task finish normally<NEW_LINE>blockingLatch.countDown();<NEW_LINE>assertTrue(blockingFuture.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));<NEW_LINE>List<Runnable> canceledFromQueue = executor.shutdownNow();<NEW_LINE>assertEquals(0, canceledFromQueue.size());<NEW_LINE>}
1, futures.size());
408,078
public double impliedVolatilityFromPresentValue(ResolvedSwaption swaption, RatesProvider ratesProvider, DayCount dayCount, double presentValue) {<NEW_LINE>double sign = swaption.getLongShort().sign();<NEW_LINE>ArgChecker.isTrue(presentValue * sign > 0, "Present value sign must be in line with the option Long/Short flag ");<NEW_LINE>validateSwaption(swaption);<NEW_LINE>LocalDate valuationDate = ratesProvider.getValuationDate();<NEW_LINE>LocalDate expiryDate = swaption.getExpiryDate();<NEW_LINE>ArgChecker.isTrue(expiryDate.isAfter(valuationDate), "Expiry must be after valuation date to compute an implied volatility");<NEW_LINE>double expiry = dayCount.yearFraction(valuationDate, expiryDate);<NEW_LINE>ResolvedSwap underlying = swaption.getUnderlying();<NEW_LINE>ResolvedSwapLeg fixedLeg = fixedLeg(underlying);<NEW_LINE>double forward = forwardRate(swaption, ratesProvider);<NEW_LINE>double pvbp = getSwapPricer().getLegPricer().pvbp(fixedLeg, ratesProvider);<NEW_LINE>double numeraire = Math.abs(pvbp);<NEW_LINE>double strike = getSwapPricer().getLegPricer().couponEquivalent(fixedLeg, ratesProvider, pvbp);<NEW_LINE>PutCall putCall = PutCall.ofPut(fixedLeg.getPayReceive().isReceive());<NEW_LINE>return NormalFormulaRepository.impliedVolatility(Math.abs(presentValue), forward, strike, <MASK><NEW_LINE>}
expiry, 0.01, numeraire, putCall);
408,552
private HttpURLConnection connect0(final URI ipUri, final String method, final byte[] entity, final Map<String, List<String>> headers, final String endpointHost) throws IOException {<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace("req: {} {} {} {} {} {}", method, ipUri, headers.size(), Joiner.on(',').withKeyValueSeparator("=").join(headers), entity.length, Json.asPrettyStringUnchecked(entity));<NEW_LINE>} else {<NEW_LINE>log.debug("req: {} {} {} {}", method, ipUri, headers.size(), entity.length);<NEW_LINE>}<NEW_LINE>final HttpURLConnection connection = (HttpURLConnection) ipUri.toURL().openConnection();<NEW_LINE>handleHttps(connection, endpointHost, hostnameVerifierProvider, extraHttpsHandler);<NEW_LINE>connection.setRequestProperty("Accept-Encoding", "gzip");<NEW_LINE>connection.setInstanceFollowRedirects(false);<NEW_LINE>connection.setConnectTimeout(httpTimeoutMillis);<NEW_LINE>connection.setReadTimeout(httpTimeoutMillis);<NEW_LINE>for (final Map.Entry<String, List<String>> header : headers.entrySet()) {<NEW_LINE>for (final String value : header.getValue()) {<NEW_LINE>connection.addRequestProperty(header.getKey(), value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (entity.length > 0) {<NEW_LINE>connection.setDoOutput(true);<NEW_LINE>connection.<MASK><NEW_LINE>}<NEW_LINE>setRequestMethod(connection, method, connection instanceof HttpsURLConnection);<NEW_LINE>return connection;<NEW_LINE>}
getOutputStream().write(entity);
1,040,014
final ListSatellitesResult executeListSatellites(ListSatellitesRequest listSatellitesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listSatellitesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListSatellitesRequest> request = null;<NEW_LINE>Response<ListSatellitesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListSatellitesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listSatellitesRequest));<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, "GroundStation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListSatellites");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListSatellitesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListSatellitesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,315,510
public void readFieldValue(JSONReader jsonReader, T object) {<NEW_LINE>ObjectReader objectReader;<NEW_LINE>if (this.fieldObjectReader != null) {<NEW_LINE>objectReader = this.fieldObjectReader;<NEW_LINE>} else {<NEW_LINE>ObjectReader formattedObjectReader = FieldReaderObject.createFormattedObjectReader(fieldType, fieldClass, format, locale);<NEW_LINE>if (formattedObjectReader != null) {<NEW_LINE>objectReader = this.fieldObjectReader = formattedObjectReader;<NEW_LINE>} else {<NEW_LINE>objectReader = this.fieldObjectReader = jsonReader.getContext().getObjectReader(fieldType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (jsonReader.isReference()) {<NEW_LINE>String reference = jsonReader.readReference();<NEW_LINE>if ("..".equals(reference)) {<NEW_LINE>accept(object, object);<NEW_LINE>} else {<NEW_LINE>addResolveTask(jsonReader, object, reference);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object value;<NEW_LINE>try {<NEW_LINE>if (jsonReader.isJSONB()) {<NEW_LINE>ObjectReader autoTypeReader = checkObjectAutoType(jsonReader);<NEW_LINE>if (autoTypeReader != null) {<NEW_LINE>value = autoTypeReader.readJSONBObject(<MASK><NEW_LINE>} else {<NEW_LINE>value = objectReader.readJSONBObject(jsonReader, fieldType, fieldName, features);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>value = objectReader.readObject(jsonReader, fieldType, fieldName, features);<NEW_LINE>}<NEW_LINE>} catch (JSONException ex) {<NEW_LINE>throw new JSONException(jsonReader.info("read field error : " + fieldName), ex);<NEW_LINE>}<NEW_LINE>accept(object, value);<NEW_LINE>}
jsonReader, fieldType, fieldName, features);
1,169,555
public void execute(SchemaModel sm) throws IOException {<NEW_LINE>DefaultSchemaGenerator.this.sm = sm;<NEW_LINE>DefaultSchemaGenerator.this.am = AXIModelFactory.getDefault().getModel(sm);<NEW_LINE>SchemaUpdate su = SchemaGeneratorUtil.getSchemaUpdate(am);<NEW_LINE>Collection<SchemaUpdate.UpdateUnit> us = su.getUpdateUnits();<NEW_LINE>try {<NEW_LINE>((AXIModelImpl) am).disableAutoSync();<NEW_LINE>sm.startTransaction();<NEW_LINE>for (SchemaUpdate.UpdateUnit u : us) {<NEW_LINE>AXIComponent source = u.getSource();<NEW_LINE>if (// skip mutating other model<NEW_LINE>source.getModel() != am)<NEW_LINE>continue;<NEW_LINE>SchemaUpdate.UpdateUnit.Type type = u.getType();<NEW_LINE>if (type == SchemaUpdate.UpdateUnit.Type.CHILD_ADDED)<NEW_LINE>addSchemaComponent(source, u);<NEW_LINE>else if (type == SchemaUpdate.UpdateUnit.Type.CHILD_DELETED)<NEW_LINE>SchemaGeneratorUtil.removeSchemaComponent(source, u, sm);<NEW_LINE>else if (type == SchemaUpdate.UpdateUnit.Type.CHILD_MODIFIED)<NEW_LINE>SchemaGeneratorUtil.modifySchemaComponent(source, u, sm, pc);<NEW_LINE>}<NEW_LINE>// addAllGlobals();<NEW_LINE>} finally {<NEW_LINE>clear();<NEW_LINE>sm.endTransaction();<NEW_LINE>((<MASK><NEW_LINE>}<NEW_LINE>}
AXIModelImpl) am).enableAutoSync();
789,442
public static DescribeGtmInstanceAddressPoolsResponse unmarshall(DescribeGtmInstanceAddressPoolsResponse describeGtmInstanceAddressPoolsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeGtmInstanceAddressPoolsResponse.setRequestId(_ctx.stringValue("DescribeGtmInstanceAddressPoolsResponse.RequestId"));<NEW_LINE>describeGtmInstanceAddressPoolsResponse.setTotalItems(_ctx.integerValue("DescribeGtmInstanceAddressPoolsResponse.TotalItems"));<NEW_LINE>describeGtmInstanceAddressPoolsResponse.setTotalPages(_ctx.integerValue("DescribeGtmInstanceAddressPoolsResponse.TotalPages"));<NEW_LINE>describeGtmInstanceAddressPoolsResponse.setPageNumber(_ctx.integerValue("DescribeGtmInstanceAddressPoolsResponse.PageNumber"));<NEW_LINE>describeGtmInstanceAddressPoolsResponse.setPageSize(_ctx.integerValue("DescribeGtmInstanceAddressPoolsResponse.PageSize"));<NEW_LINE>List<AddrPool> addrPools = new ArrayList<AddrPool>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools.Length"); i++) {<NEW_LINE>AddrPool addrPool = new AddrPool();<NEW_LINE>addrPool.setAddrPoolId(_ctx.stringValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].AddrPoolId"));<NEW_LINE>addrPool.setCreateTime(_ctx.stringValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].CreateTime"));<NEW_LINE>addrPool.setCreateTimestamp(_ctx.longValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].CreateTimestamp"));<NEW_LINE>addrPool.setUpdateTime(_ctx.stringValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].UpdateTime"));<NEW_LINE>addrPool.setUpdateTimestamp(_ctx.longValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].UpdateTimestamp"));<NEW_LINE>addrPool.setAddrCount(_ctx.integerValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].AddrCount"));<NEW_LINE>addrPool.setMinAvailableAddrNum(_ctx.integerValue<MASK><NEW_LINE>addrPool.setMonitorConfigId(_ctx.stringValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].MonitorConfigId"));<NEW_LINE>addrPool.setMonitorStatus(_ctx.stringValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].MonitorStatus"));<NEW_LINE>addrPool.setName(_ctx.stringValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].Name"));<NEW_LINE>addrPool.setStatus(_ctx.stringValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].Status"));<NEW_LINE>addrPool.setType(_ctx.stringValue("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].Type"));<NEW_LINE>addrPools.add(addrPool);<NEW_LINE>}<NEW_LINE>describeGtmInstanceAddressPoolsResponse.setAddrPools(addrPools);<NEW_LINE>return describeGtmInstanceAddressPoolsResponse;<NEW_LINE>}
("DescribeGtmInstanceAddressPoolsResponse.AddrPools[" + i + "].MinAvailableAddrNum"));
510,078
public boolean onPreferenceChange(Preference preference, Object newValue) {<NEW_LINE>int timeout = Util.objectToInt(newValue);<NEW_LINE>if (timeout > 0) {<NEW_LINE>Context context = preference.getContext();<NEW_LINE>boolean fromServer = coreKey.equals("delete_server_after");<NEW_LINE>int delCount = DcHelper.getContext(context).estimateDeletionCount(fromServer, timeout);<NEW_LINE>View gl = View.inflate(getActivity(), R.layout.dialog_with_checkbox, null);<NEW_LINE>CheckBox confirmCheckbox = gl.findViewById(R.id.dialog_checkbox);<NEW_LINE>TextView msg = gl.findViewById(R.id.dialog_message);<NEW_LINE>// If we'd use both `setMessage()` and `setView()` on the same AlertDialog, on small screens the<NEW_LINE>// "OK" and "Cancel" buttons would not be show. So, put the message into our custom view:<NEW_LINE>msg.setText(String.format(context.getString(fromServer ? R.string.autodel_server_ask : R.string.autodel_device_ask), delCount, <MASK><NEW_LINE>confirmCheckbox.setText(R.string.autodel_confirm);<NEW_LINE>new AlertDialog.Builder(context).setTitle(preference.getTitle()).setView(gl).setPositiveButton(android.R.string.ok, (dialog, whichButton) -> {<NEW_LINE>if (confirmCheckbox.isChecked()) {<NEW_LINE>dcContext.setConfigInt(coreKey, timeout);<NEW_LINE>initAutodelFromCore();<NEW_LINE>} else {<NEW_LINE>onPreferenceChange(preference, newValue);<NEW_LINE>}<NEW_LINE>}).setNegativeButton(android.R.string.cancel, // Enable the user to quickly cancel if they are intimidated by the warnings :)<NEW_LINE>(dialog, whichButton) -> initAutodelFromCore()).// Enable the user to quickly cancel if they are intimidated by the warnings :)<NEW_LINE>setCancelable(true).setOnCancelListener(dialog -> initAutodelFromCore()).show();<NEW_LINE>} else {<NEW_LINE>updateListSummary(preference, newValue);<NEW_LINE>dcContext.setConfigInt(coreKey, timeout);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
getSelectedSummary(preference, newValue)));
35,832
public void run(RegressionEnvironment env) {<NEW_LINE>if (env.isHA()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String epl = "@name('flow') create dataflow RollingTopWords\n" + "create objectarray schema WordEvent (word string),\n" + "Emitter -> wordstream<WordEvent> {name:'a'} // Produces word stream\n" + "Select(wordstream) -> wordcount { // Sliding time window count per word\n" + " select: (select word, count(*) as wordcount from wordstream#time(30) group by word)\n" + "}\n" + "Select(wordcount) -> wordranks { // Rank of words\n" + " select: (select window(*) as rankedWords from wordcount#sort(3, wordcount desc) output snapshot every 2 seconds)\n" + "}\n" + "DefaultSupportCaptureOp(wordranks) {}";<NEW_LINE>env.<MASK><NEW_LINE>env.compileDeploy(epl);<NEW_LINE>// prepare test<NEW_LINE>DefaultSupportCaptureOp capture = new DefaultSupportCaptureOp();<NEW_LINE>EPDataFlowInstantiationOptions options = new EPDataFlowInstantiationOptions();<NEW_LINE>options.operatorProvider(new DefaultSupportGraphOpProvider(capture));<NEW_LINE>EPDataFlowInstance instanceOne = env.runtime().getDataFlowService().instantiate(env.deploymentId("flow"), "RollingTopWords", options);<NEW_LINE>EPDataFlowEmitterOperator emitter = instanceOne.startCaptive().getEmitters().get("a");<NEW_LINE>for (String word : new String[] { "this", "is", "a", "test", "that", "is", "a", "word", "test" }) {<NEW_LINE>emitter.submit(new Object[] { word });<NEW_LINE>}<NEW_LINE>assertEquals(0, capture.getCurrentAndReset().length);<NEW_LINE>env.advanceTime(2000);<NEW_LINE>assertEquals(1, capture.getCurrent().length);<NEW_LINE>Object[] row = (Object[]) capture.getCurrent()[0];<NEW_LINE>Object[][] rows = (Object[][]) row[0];<NEW_LINE>EPAssertionUtil.assertPropsPerRow(rows, "word,count".split(","), new Object[][] { { "is", 2L }, { "a", 2L }, { "test", 2L } });<NEW_LINE>instanceOne.cancel();<NEW_LINE>env.undeployAll();<NEW_LINE>}
eventService().advanceTime(0);
1,630,981
final ListBuildBatchesResult executeListBuildBatches(ListBuildBatchesRequest listBuildBatchesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listBuildBatchesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListBuildBatchesRequest> request = null;<NEW_LINE>Response<ListBuildBatchesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListBuildBatchesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listBuildBatchesRequest));<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, "CodeBuild");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListBuildBatches");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListBuildBatchesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListBuildBatchesResultJsonUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig);
765,468
private RowExpression toRowExpression(Subfield subfield, List<Type> types) {<NEW_LINE>List<Subfield.PathElement> path = subfield.getPath();<NEW_LINE>if (path.isEmpty()) {<NEW_LINE>return new VariableReferenceExpression(Optional.empty(), subfield.getRootName(), types.get(0));<NEW_LINE>}<NEW_LINE>RowExpression base = toRowExpression(new Subfield(subfield.getRootName(), path.subList(0, path.size() - 1)), types.subList(0, types.size() - 1));<NEW_LINE>Type baseType = types.get(types.size() - 2);<NEW_LINE>Subfield.PathElement pathElement = path.get(path.size() - 1);<NEW_LINE>if (pathElement instanceof Subfield.LongSubscript) {<NEW_LINE>Type indexType = baseType instanceof MapType ? ((MapType) baseType).getKeyType() : BIGINT;<NEW_LINE>FunctionHandle functionHandle = functionResolution.subscriptFunction(baseType, indexType);<NEW_LINE>ConstantExpression index = new ConstantExpression(base.getSourceLocation(), ((Subfield.LongSubscript) pathElement).getIndex(), indexType);<NEW_LINE>return new CallExpression(base.getSourceLocation(), SUBSCRIPT.name(), functionHandle, types.get(types.size() - 1), ImmutableList.of(base, index));<NEW_LINE>}<NEW_LINE>if (pathElement instanceof Subfield.StringSubscript) {<NEW_LINE>Type indexType = ((MapType) baseType).getKeyType();<NEW_LINE>FunctionHandle functionHandle = functionResolution.subscriptFunction(baseType, indexType);<NEW_LINE>ConstantExpression index = new ConstantExpression(base.getSourceLocation(), Slices.utf8Slice(((Subfield.StringSubscript) pathElement)<MASK><NEW_LINE>return new CallExpression(base.getSourceLocation(), SUBSCRIPT.name(), functionHandle, types.get(types.size() - 1), ImmutableList.of(base, index));<NEW_LINE>}<NEW_LINE>if (pathElement instanceof Subfield.NestedField) {<NEW_LINE>Subfield.NestedField nestedField = (Subfield.NestedField) pathElement;<NEW_LINE>return new SpecialFormExpression(base.getSourceLocation(), DEREFERENCE, types.get(types.size() - 1), base, new ConstantExpression(base.getSourceLocation(), getFieldIndex((RowType) baseType, nestedField.getName()), INTEGER));<NEW_LINE>}<NEW_LINE>verify(false, "Unexpected path element: " + pathElement);<NEW_LINE>return null;<NEW_LINE>}
.getIndex()), indexType);
1,565,784
private HttpResponse patchVCMR(HttpRequest request, String vcmrId) {<NEW_LINE>var optionalChangeRequest = controller.curator().readChangeRequest(vcmrId);<NEW_LINE>if (optionalChangeRequest.isEmpty()) {<NEW_LINE>return ErrorResponse.notFoundError("No VCMR with id: " + vcmrId);<NEW_LINE>}<NEW_LINE>var changeRequest = optionalChangeRequest.get();<NEW_LINE>var inspector = inspectorOrThrow(request);<NEW_LINE>if (inspector.field("approval").valid()) {<NEW_LINE>var approval = ChangeRequest.Approval.valueOf(inspector.field("approval").asString());<NEW_LINE>changeRequest = changeRequest.withApproval(approval);<NEW_LINE>}<NEW_LINE>if (inspector.field("actionPlan").valid()) {<NEW_LINE>var actionPlan = ChangeRequestSerializer.readHostActionPlan(inspector.field("actionPlan"));<NEW_LINE>changeRequest = changeRequest.withActionPlan(actionPlan);<NEW_LINE>}<NEW_LINE>if (inspector.field("status").valid()) {<NEW_LINE>var status = VespaChangeRequest.Status.valueOf(inspector.field<MASK><NEW_LINE>changeRequest = changeRequest.withStatus(status);<NEW_LINE>}<NEW_LINE>try (var lock = controller.curator().lockChangeRequests()) {<NEW_LINE>controller.curator().writeChangeRequest(changeRequest);<NEW_LINE>}<NEW_LINE>var slime = new Slime();<NEW_LINE>var cursor = slime.setObject();<NEW_LINE>ChangeRequestSerializer.writeChangeRequest(cursor, changeRequest);<NEW_LINE>return new SlimeJsonResponse(slime);<NEW_LINE>}
("status").asString());
56,210
private static <T extends IPart> ColoredItemDefinition<ColoredPartItem<T>> constructColoredDefinition(String nameSuffix, String idSuffix, Class<T> partClass, Function<ColoredPartItem<T>, T> factory) {<NEW_LINE>PartModels.registerModels(PartModelsHelper.createModels(partClass));<NEW_LINE>var definition = new ColoredItemDefinition<ColoredPartItem<T>>();<NEW_LINE>for (AEColor color : AEColor.values()) {<NEW_LINE>var id <MASK><NEW_LINE>var name = color.englishName + " " + nameSuffix;<NEW_LINE>var itemDef = item(name, AppEng.makeId(id), props -> new ColoredPartItem<>(props, partClass, factory, color));<NEW_LINE>definition.add(color, AppEng.makeId(id), itemDef);<NEW_LINE>}<NEW_LINE>COLORED_PARTS.add(definition);<NEW_LINE>return definition;<NEW_LINE>}
= color.registryPrefix + '_' + idSuffix;
1,692,362
protected Object doInBackground() throws Exception {<NEW_LINE>downloadTaskRunning = true;<NEW_LINE>AndroidSdkHandler mHandler = AndroidSdkHandler.getInstance(sdkFolder);<NEW_LINE>FileSystemFileOp fop = (FileSystemFileOp) FileOpUtils.create();<NEW_LINE>CustomSettings settings = new CustomSettings();<NEW_LINE>Downloader downloader = new LegacyDownloader(fop, settings);<NEW_LINE>RepoManager mRepoManager = mHandler.getSdkManager(progress);<NEW_LINE>mRepoManager.loadSynchronously(<MASK><NEW_LINE>List<RemotePackage> remotes = new ArrayList<>();<NEW_LINE>for (String path : settings.getPaths(mRepoManager)) {<NEW_LINE>RemotePackage p = mRepoManager.getPackages().getRemotePackages().get(path);<NEW_LINE>if (p == null) {<NEW_LINE>// progress.logWarning(AndroidMode.getTextString("sdk_updater.warning_failed_finding_package", path));<NEW_LINE>progress.logWarning("Failed to find package " + path);<NEW_LINE>throw new SdkManagerCli.CommandFailedException();<NEW_LINE>}<NEW_LINE>remotes.add(p);<NEW_LINE>}<NEW_LINE>remotes = InstallerUtil.computeRequiredPackages(remotes, mRepoManager.getPackages(), progress);<NEW_LINE>if (remotes != null) {<NEW_LINE>for (RemotePackage p : remotes) {<NEW_LINE>Installer installer = SdkInstallerUtil.findBestInstallerFactory(p, mHandler).createInstaller(p, mRepoManager, downloader, mHandler.getFileOp());<NEW_LINE>if (!(installer.prepare(progress) && installer.complete(progress))) {<NEW_LINE>// there was an error, abort.<NEW_LINE>throw new SdkManagerCli.CommandFailedException();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// progress.logWarning(AndroidMode.getTextString("sdk_updater.warning_failed_computing_dependency_list"));<NEW_LINE>progress.logWarning("Unable to compute a complete list of dependencies.");<NEW_LINE>throw new SdkManagerCli.CommandFailedException();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
0, progress, downloader, settings);
1,666,070
/*<NEW_LINE>* @see com.sitewhere.grpc.service.BatchManagementGrpc.BatchManagementImplBase#<NEW_LINE>* listBatchElements(com.sitewhere.grpc.service.GListBatchElementsRequest,<NEW_LINE>* io.grpc.stub.StreamObserver)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void listBatchElements(GListBatchElementsRequest request, StreamObserver<GListBatchElementsResponse> responseObserver) {<NEW_LINE>try {<NEW_LINE>GrpcUtils.handleServerMethodEntry(this, BatchManagementGrpc.getListBatchElementsMethod());<NEW_LINE>IBatchElementSearchCriteria criteria = BatchModelConverter.asApiBatchElementSearchCriteria(request.getCriteria());<NEW_LINE>getMicroservice().getLogger().info("Batch element search criteria:\n" + MarshalUtils.marshalJsonAsPrettyString(criteria));<NEW_LINE>ISearchResults<? extends IBatchElement> apiResult = getBatchManagement().listBatchElements(CommonModelConverter.asApiUuid(request.getBatchOperationId()), criteria);<NEW_LINE>GListBatchElementsResponse.Builder response = GListBatchElementsResponse.newBuilder();<NEW_LINE>GBatchElementSearchResults.Builder results = GBatchElementSearchResults.newBuilder();<NEW_LINE>for (IBatchElement api : apiResult.getResults()) {<NEW_LINE>results.addBatchElements(BatchModelConverter.asGrpcBatchElement(api));<NEW_LINE>}<NEW_LINE>results.<MASK><NEW_LINE>response.setResults(results.build());<NEW_LINE>responseObserver.onNext(response.build());<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>GrpcUtils.handleServerMethodException(BatchManagementGrpc.getListBatchElementsMethod(), e, responseObserver);<NEW_LINE>} finally {<NEW_LINE>GrpcUtils.handleServerMethodExit(BatchManagementGrpc.getListBatchElementsMethod());<NEW_LINE>}<NEW_LINE>}
setCount(apiResult.getNumResults());
1,676,084
public void rollback(FlowRollback trigger, Map data) {<NEW_LINE>if (s) {<NEW_LINE>LocalStorageDirectlyDeleteBitsMsg msg = new LocalStorageDirectlyDeleteBitsMsg();<NEW_LINE>msg.setHostUuid(dstHostUuid);<NEW_LINE>msg.<MASK><NEW_LINE>msg.setPrimaryStorageUuid(vol.getPrimaryStorageUuid());<NEW_LINE>bus.makeTargetServiceIdByResourceUuid(msg, PrimaryStorageConstant.SERVICE_ID, vol.getPrimaryStorageUuid());<NEW_LINE>bus.send(msg, new CloudBusCallBack(null) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(MessageReply r) {<NEW_LINE>if (!r.isSuccess()) {<NEW_LINE>// TODO GC<NEW_LINE>logger.warn(String.format("failed to delete %s on the local primary storage[uuid:%s], host[uuid:%s], %s", vol.getInstallPath(), vol.getPrimaryStorageUuid(), dstHostUuid, r.getError()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>trigger.rollback();<NEW_LINE>}
setPath(vol.getInstallPath());
1,154,458
protected FilterResults performFiltering(CharSequence constraint) {<NEW_LINE>FilterResults results = new FilterResults();<NEW_LINE>String favorites = app.getString(R.string.shared_string_favorites).toLowerCase();<NEW_LINE>if (constraint == null || constraint.length() == 0) {<NEW_LINE>results.values = null;<NEW_LINE>results.count = 1;<NEW_LINE>} else {<NEW_LINE>Set<Object> filter = new HashSet<>();<NEW_LINE>String cs = constraint.toString().toLowerCase();<NEW_LINE>for (FavoriteGroup g : helper.getFavoriteGroups()) {<NEW_LINE>String gName;<NEW_LINE>if (Algorithms.isEmpty(g.getName())) {<NEW_LINE>gName = favorites;<NEW_LINE>} else {<NEW_LINE>gName = g.getName().toLowerCase();<NEW_LINE>}<NEW_LINE>if (gName.contains(cs)) {<NEW_LINE>filter.add(g);<NEW_LINE>} else {<NEW_LINE>for (FavouritePoint fp : g.getPoints()) {<NEW_LINE>if (fp.getName().toLowerCase().contains(cs)) {<NEW_LINE>filter.add(fp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>results.values = filter;<NEW_LINE>results<MASK><NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>}
.count = filter.size();
598,421
private void genInterfaceMethodDecl(StringBuilder sb, Method mi, Class ifaceType) {<NEW_LINE>if (mi.isDefault() || Modifier.isStatic(mi.getModifiers())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (mi.getAnnotation(ExtensionMethod.class) != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (StructuralTypeProxyGenerator.isObjectMethod(mi)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ActualName anno = mi.getAnnotation(ActualName.class);<NEW_LINE>String actualName = anno == null ? "null" : "\"" + anno.value() + "\"";<NEW_LINE>Class returnType = mi.getReturnType();<NEW_LINE>sb.append(" public ")./*append( getTypeVarList( mi ) ).append( ' ' ).*/<NEW_LINE>append(returnType.getCanonicalName()).append(' ').append(mi.getName()).append("(");<NEW_LINE>Class[] params = mi.getParameterTypes();<NEW_LINE>for (int i = 0; i < params.length; i++) {<NEW_LINE>if (i > 0) {<NEW_LINE>sb.append(", ");<NEW_LINE>}<NEW_LINE>Class pi = params[i];<NEW_LINE>sb.append(pi.getCanonicalName()).append<MASK><NEW_LINE>}<NEW_LINE>sb.append(") {\n").append(returnType == void.class ? " " : " return ").append(maybeCastReturnType(returnType));<NEW_LINE>// ## todo: maybe we need to explicitly parameterize if the method is generic for some cases?<NEW_LINE>if (returnType != void.class) {<NEW_LINE>sb.append(RuntimeMethods.class.getTypeName()).append(".coerce(");<NEW_LINE>}<NEW_LINE>handleCall(sb, mi, ifaceType, actualName, params);<NEW_LINE>if (returnType != void.class) {<NEW_LINE>sb.append(", ").append(mi.getReturnType().getCanonicalName()).append(".class);\n");<NEW_LINE>} else {<NEW_LINE>sb.append(";\n");<NEW_LINE>}<NEW_LINE>sb.append(" }\n");<NEW_LINE>}
(" p").append(i);
992,134
public void runAssertion(RegressionEnvironment env, String createSchemaEPL, Consumer<NullableObject<Map<String, String>>> sender) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy(createSchemaEPL, path);<NEW_LINE>env.compileDeploy("@name('s0') select * from LocalEvent", path).addListener("s0");<NEW_LINE>if (sender == null) {<NEW_LINE>env.assertStatement("s0", statement -> {<NEW_LINE>EventType eventType = statement.getEventType();<NEW_LINE>EventPropertyGetter g0 = eventType.getGetter("mapped('a')?");<NEW_LINE>EventPropertyGetter g1 = eventType.getGetter("mapped('b')?");<NEW_LINE>assertNull(g0);<NEW_LINE>assertNull(g1);<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String propepl = "@name('s1') select mapped('a')? as c0, mapped('b')? as c1," + "exists(mapped('a')?) as c2, exists(mapped('b')?) as c3, " + "typeof(mapped('a')?) as c4, typeof(mapped('b')?) as c5 from LocalEvent;\n";<NEW_LINE>env.compileDeploy(propepl, path).addListener("s1");<NEW_LINE>Map<String, String> values = new HashMap<>();<NEW_LINE>values.put("a", "x");<NEW_LINE>values.put("b", "y");<NEW_LINE>sender.accept(new NullableObject<>(values));<NEW_LINE>env.assertEventNew("s0", event -> assertGetters(event, true, "x", true, "y"));<NEW_LINE>assertProps(env, "x", "y");<NEW_LINE>sender.accept(new NullableObject<>(Collections.singletonMap("a", "x")));<NEW_LINE>env.assertEventNew("s0", event -> assertGetters(event, true, "x", false, null));<NEW_LINE>assertProps(env, "x", null);<NEW_LINE>sender.accept(new NullableObject<><MASK><NEW_LINE>env.assertEventNew("s0", event -> assertGetters(event, false, null, false, null));<NEW_LINE>assertProps(env, null, null);<NEW_LINE>sender.accept(new NullableObject<>(null));<NEW_LINE>env.assertEventNew("s0", event -> assertGetters(event, false, null, false, null));<NEW_LINE>assertProps(env, null, null);<NEW_LINE>sender.accept(null);<NEW_LINE>env.assertEventNew("s0", event -> assertGetters(event, false, null, false, null));<NEW_LINE>assertProps(env, null, null);<NEW_LINE>env.undeployAll();<NEW_LINE>}
(Collections.emptyMap()));
560,418
public void onPreviewFrame(byte[] data, Camera camera) {<NEW_LINE>Camera.Parameters parameters = camera.getParameters();<NEW_LINE>int width = parameters.getPreviewSize().width;<NEW_LINE>int height <MASK><NEW_LINE>int rotation = calculateCaptureRotation();<NEW_LINE>YuvOperator yuvOperator = new YuvOperator(data, width, height);<NEW_LINE>yuvOperator.rotate(rotation);<NEW_LINE>data = yuvOperator.getYuvData();<NEW_LINE>int yuvOutputWidth = width;<NEW_LINE>int yuvOutputHeight = height;<NEW_LINE>if (rotation == 90 || rotation == 270) {<NEW_LINE>yuvOutputWidth = height;<NEW_LINE>yuvOutputHeight = width;<NEW_LINE>}<NEW_LINE>YuvImage yuvImage = new YuvImage(data, parameters.getPreviewFormat(), yuvOutputWidth, yuvOutputHeight, null);<NEW_LINE>ByteArrayOutputStream out = new ByteArrayOutputStream();<NEW_LINE>yuvImage.compressToJpeg(new Rect(0, 0, yuvImage.getWidth(), yuvImage.getHeight()), 100, out);<NEW_LINE>callback.imageCaptured(out.toByteArray());<NEW_LINE>}
= parameters.getPreviewSize().height;
1,112,619
public static DescribeSlsProjectResponse unmarshall(DescribeSlsProjectResponse describeSlsProjectResponse, UnmarshallerContext context) {<NEW_LINE>describeSlsProjectResponse.setRequestId(context.stringValue("DescribeSlsProjectResponse.RequestId"));<NEW_LINE>List<SlsProjectDataItem> slsProjectData = new ArrayList<SlsProjectDataItem>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeSlsProjectResponse.SlsProjectData.Length"); i++) {<NEW_LINE>SlsProjectDataItem slsProjectDataItem = new SlsProjectDataItem();<NEW_LINE>slsProjectDataItem.setProject(context.stringValue("DescribeSlsProjectResponse.SlsProjectData[" + i + "].Project"));<NEW_LINE>List<String> logStore = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < context.lengthValue("DescribeSlsProjectResponse.SlsProjectData[" + i + "].LogStore.Length"); j++) {<NEW_LINE>logStore.add(context.stringValue("DescribeSlsProjectResponse.SlsProjectData[" + i <MASK><NEW_LINE>}<NEW_LINE>slsProjectDataItem.setLogStore(logStore);<NEW_LINE>slsProjectData.add(slsProjectDataItem);<NEW_LINE>}<NEW_LINE>describeSlsProjectResponse.setSlsProjectData(slsProjectData);<NEW_LINE>return describeSlsProjectResponse;<NEW_LINE>}
+ "].LogStore[" + j + "]"));
398,476
final DeleteJobResult executeDeleteJob(DeleteJobRequest deleteJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DeleteJobRequest> request = null;<NEW_LINE>Response<DeleteJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteJobRequest));<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, "drs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteJobResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,365,553
protected void onUpdateServer() {<NEW_LINE>super.onUpdateServer();<NEW_LINE>energySlot.drainContainer();<NEW_LINE>fuelSlot.fillOrBurn();<NEW_LINE>FloatingLong prev = getEnergyContainer().getEnergy().copyAsConst();<NEW_LINE>heatCapacitor.handleHeat(getBoost().doubleValue());<NEW_LINE>if (MekanismUtils.canFunction(this) && !getEnergyContainer().getNeeded().isZero()) {<NEW_LINE>int fluidRate = MekanismGeneratorsConfig.generators.heatGenerationFluidRate.get();<NEW_LINE>if (lavaTank.extract(fluidRate, Action.SIMULATE, AutomationType.INTERNAL).getAmount() == fluidRate) {<NEW_LINE>setActive(true);<NEW_LINE>lavaTank.extract(fluidRate, Action.EXECUTE, AutomationType.INTERNAL);<NEW_LINE>heatCapacitor.handleHeat(MekanismGeneratorsConfig.generators.heatGeneration.<MASK><NEW_LINE>} else {<NEW_LINE>setActive(false);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>setActive(false);<NEW_LINE>}<NEW_LINE>HeatTransfer loss = simulate();<NEW_LINE>lastTransferLoss = loss.adjacentTransfer();<NEW_LINE>lastEnvironmentLoss = loss.environmentTransfer();<NEW_LINE>producingEnergy = getEnergyContainer().getEnergy().subtract(prev);<NEW_LINE>}
get().doubleValue());
185,078
private void interpolateSegments(Vector<Double> f0) {<NEW_LINE>int i, n, interval;<NEW_LINE>double slope;<NEW_LINE>// check where there are zeros and interpolate<NEW_LINE>int[] index = new int[2];<NEW_LINE>double[] value = new double[2];<NEW_LINE>index[0] = 0;<NEW_LINE>value[0] = 0.0;<NEW_LINE>for (i = 0; i < f0.size(); i++) {<NEW_LINE>if (f0.get(i) > 0.0) {<NEW_LINE>index[1] = i;<NEW_LINE>value[1] = f0.get(i);<NEW_LINE>interval = index[1] - index[0];<NEW_LINE>if (interval > 1) {<NEW_LINE>// System.out.format("Interval to interpolate index[0]=%d index[1]=%d\n",index[0],index[1]);<NEW_LINE>slope = ((value[1] - <MASK><NEW_LINE>for (n = index[0]; n < index[1]; n++) {<NEW_LINE>double newVal = (slope * (n - index[0])) + value[0];<NEW_LINE>f0.set(n, newVal);<NEW_LINE>// System.out.format(" n=%d value:%.1f\n",n,newVal);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>index[0] = index[1];<NEW_LINE>value[0] = value[1];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
value[0]) / interval);
1,565,532
public void removeConversation(final Contact contact, final Integer channelKey, String response) {<NEW_LINE>if (getActivity() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if ("success".equals(response)) {<NEW_LINE>this.getActivity().runOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>Message message = null;<NEW_LINE>if (channelKey != null && channelKey != 0) {<NEW_LINE>message = latestMessageForEachContact.get(ConversationUIService.GROUP + channelKey);<NEW_LINE>} else {<NEW_LINE>message = latestMessageForEachContact.get(contact.getUserId());<NEW_LINE>}<NEW_LINE>if (message == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>messageList.remove(message);<NEW_LINE>if (channelKey != null && channelKey != 0) {<NEW_LINE>latestMessageForEachContact.remove(ConversationUIService.GROUP + channelKey);<NEW_LINE>} else {<NEW_LINE>latestMessageForEachContact.<MASK><NEW_LINE>}<NEW_LINE>recyclerAdapter.notifyDataSetChanged();<NEW_LINE>checkForEmptyConversations();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>if (!Utils.isInternetAvailable(getActivity())) {<NEW_LINE>Toast.makeText(ApplozicService.getContext(getActivity()), ApplozicService.getContext(getContext()).getString(R.string.you_need_network_access_for_delete), Toast.LENGTH_SHORT).show();<NEW_LINE>} else {<NEW_LINE>Toast.makeText(ApplozicService.getContext(getActivity()), ApplozicService.getContext(getContext()).getString(R.string.delete_conversation_failed), Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
remove(contact.getUserId());
1,530,083
public OverrideAction unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>OverrideAction overrideAction = new OverrideAction();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Count", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>overrideAction.setCount(CountActionJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("None", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>overrideAction.setNone(NoneActionJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return overrideAction;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,408,146
// prints BFS traversal from a given source s<NEW_LINE>void BFS(int s) {<NEW_LINE>// Mark all the vertices as not visited(By default<NEW_LINE>// set as false)<NEW_LINE>boolean[] visited = new boolean[V];<NEW_LINE>// Create a queue for BFS<NEW_LINE>LinkedList<Integer> queue = new LinkedList<Integer>();<NEW_LINE>// Mark the current node as visited and enqueue it<NEW_LINE>visited[s] = true;<NEW_LINE>queue.add(s);<NEW_LINE>while (queue.size() != 0) {<NEW_LINE>// Dequeue a vertex from queue and print it<NEW_LINE>s = queue.poll();<NEW_LINE>System.<MASK><NEW_LINE>// Get all adjacent vertices of the dequeued vertex s<NEW_LINE>// If a adjacent has not been visited, then mark it visited and enqueue it<NEW_LINE>Iterator<Integer> i = adj[s].listIterator();<NEW_LINE>while (i.hasNext()) {<NEW_LINE>int n = i.next();<NEW_LINE>if (!visited[n]) {<NEW_LINE>visited[n] = true;<NEW_LINE>queue.add(n);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
out.print(s + " ");
280,350
private void loadNode456() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_GetPosition_OutputArguments, new QualifiedName(0, "OutputArguments"), new LocalizedText("en", "OutputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_GetPosition_OutputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_GetPosition_OutputArguments, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_GetPosition_OutputArguments, Identifiers.HasProperty, Identifiers.ServerConfigurationType_CertificateGroups_DefaultApplicationGroup_TrustList_GetPosition.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>Position</Name><DataType><Identifier>i=9</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new <MASK><NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
DataValue(new Variant(o));
467,955
public void performOperation(final Random rnd, final Genome[] parents, final int parentIndex, final Genome[] offspring, final int offspringIndex) {<NEW_LINE>final EncogProgram parent1 = (EncogProgram) parents[0];<NEW_LINE>final EncogProgram parent2 = (EncogProgram) parents[1];<NEW_LINE>offspring[0] = null;<NEW_LINE>final <MASK><NEW_LINE>final int size1 = parent1.getRootNode().size();<NEW_LINE>final int size2 = parent2.getRootNode().size();<NEW_LINE>boolean done = false;<NEW_LINE>int tries = 100;<NEW_LINE>int pointsNeeded = this.points;<NEW_LINE>while (!done) {<NEW_LINE>final int p1Index = rnd.nextInt(size1);<NEW_LINE>final int p2Index = rnd.nextInt(size2);<NEW_LINE>final LevelHolder holder1 = new LevelHolder(p1Index);<NEW_LINE>final LevelHolder holder2 = new LevelHolder(p2Index);<NEW_LINE>final List<ValueType> types = new ArrayList<ValueType>();<NEW_LINE>types.add(context.getResult().getVariableType());<NEW_LINE>findNode(rnd, parent1.getRootNode(), types, holder1);<NEW_LINE>findNode(rnd, parent2.getRootNode(), types, holder2);<NEW_LINE>if (LevelHolder.compatibleTypes(holder1.getTypes(), holder2.getTypes())) {<NEW_LINE>final EncogProgram result = context.cloneProgram(parent1);<NEW_LINE>final ProgramNode resultNode = parent1.findNode(p1Index);<NEW_LINE>final ProgramNode p2Node = parent2.findNode(p2Index);<NEW_LINE>final ProgramNode newInsert = context.cloneBranch(result, p2Node);<NEW_LINE>result.replaceNode(resultNode, newInsert);<NEW_LINE>offspring[0] = result;<NEW_LINE>pointsNeeded--;<NEW_LINE>if (pointsNeeded < 1) {<NEW_LINE>done = true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>tries--;<NEW_LINE>if (tries < 0) {<NEW_LINE>done = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
EncogProgramContext context = parent1.getContext();
1,096,244
protected void frameStateChanged() {<NEW_LINE>if (window == null || rootPane.getWindowDecorationStyle() != JRootPane.FRAME)<NEW_LINE>return;<NEW_LINE>if (window instanceof Frame) {<NEW_LINE>Frame frame = (Frame) window;<NEW_LINE>boolean resizable = frame.isResizable();<NEW_LINE>boolean maximized = ((frame.getExtendedState() & Frame.MAXIMIZED_BOTH) != 0);<NEW_LINE>iconifyButton.setVisible(true);<NEW_LINE>maximizeButton.setVisible(resizable && !maximized);<NEW_LINE>restoreButton.setVisible(resizable && maximized);<NEW_LINE>if (maximized && rootPane.getClientProperty("_flatlaf.maximizedBoundsUpToDate") == null) {<NEW_LINE>rootPane.putClientProperty("_flatlaf.maximizedBoundsUpToDate", null);<NEW_LINE>// In case that frame was maximized from custom code (e.g. when restoring<NEW_LINE>// window state on application startup), then maximized bounds is not set<NEW_LINE>// and the window would overlap Windows task bar.<NEW_LINE>// To avoid this, update maximized bounds here and if it has changed<NEW_LINE>// re-maximize windows so that maximized bounds are used.<NEW_LINE>Rectangle oldMaximizedBounds = frame.getMaximizedBounds();<NEW_LINE>updateMaximizedBounds();<NEW_LINE>Rectangle newMaximizedBounds = frame.getMaximizedBounds();<NEW_LINE>if (newMaximizedBounds != null && !newMaximizedBounds.equals(oldMaximizedBounds)) {<NEW_LINE><MASK><NEW_LINE>frame.setExtendedState(oldExtendedState & ~Frame.MAXIMIZED_BOTH);<NEW_LINE>frame.setExtendedState(oldExtendedState);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// hide buttons because they are only supported in frames<NEW_LINE>iconifyButton.setVisible(false);<NEW_LINE>maximizeButton.setVisible(false);<NEW_LINE>restoreButton.setVisible(false);<NEW_LINE>revalidate();<NEW_LINE>repaint();<NEW_LINE>}<NEW_LINE>}
int oldExtendedState = frame.getExtendedState();
1,036,720
public void process(Element element, EComponentWithViewSupportHolder holder) throws Exception {<NEW_LINE>String methodName = element<MASK><NEW_LINE>ExecutableElement executableElement = (ExecutableElement) element;<NEW_LINE>List<? extends VariableElement> parameters = executableElement.getParameters();<NEW_LINE>int startParameterPosition = -1;<NEW_LINE>int countParameterPosition = -1;<NEW_LINE>int beforeParameterPosition = -1;<NEW_LINE>int charSequenceParameterPosition = -1;<NEW_LINE>int viewParameterPosition = -1;<NEW_LINE>TypeMirror viewParameterType = null;<NEW_LINE>for (int i = 0; i < parameters.size(); i++) {<NEW_LINE>VariableElement parameter = parameters.get(i);<NEW_LINE>String parameterName = parameter.toString();<NEW_LINE>TypeMirror parameterType = parameter.asType();<NEW_LINE>if (CanonicalNameConstants.CHAR_SEQUENCE.equals(parameterType.toString())) {<NEW_LINE>charSequenceParameterPosition = i;<NEW_LINE>} else if (parameterType.getKind() == TypeKind.INT || CanonicalNameConstants.INTEGER.equals(parameterType.toString())) {<NEW_LINE>if ("start".equals(parameterName)) {<NEW_LINE>startParameterPosition = i;<NEW_LINE>} else if ("count".equals(parameterName)) {<NEW_LINE>countParameterPosition = i;<NEW_LINE>} else if ("before".equals(parameterName)) {<NEW_LINE>beforeParameterPosition = i;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>TypeMirror textViewType = annotationHelper.typeElementFromQualifiedName(CanonicalNameConstants.TEXT_VIEW).asType();<NEW_LINE>if (annotationHelper.isSubtype(parameterType, textViewType)) {<NEW_LINE>viewParameterPosition = i;<NEW_LINE>viewParameterType = parameterType;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<JFieldRef> idsRefs = annotationHelper.extractAnnotationFieldRefs(element, IRClass.Res.ID, true);<NEW_LINE>for (JFieldRef idRef : idsRefs) {<NEW_LINE>TextWatcherHolder textWatcherHolder = holder.getTextWatcherHolder(idRef, viewParameterType);<NEW_LINE>JBlock methodBody = textWatcherHolder.getOnTextChangedBody();<NEW_LINE>IJExpression activityRef = holder.getGeneratedClass().staticRef("this");<NEW_LINE>JInvocation textChangeCall = methodBody.invoke(activityRef, methodName);<NEW_LINE>for (int i = 0; i < parameters.size(); i++) {<NEW_LINE>if (i == startParameterPosition) {<NEW_LINE>JVar startParameter = textWatcherHolder.getOnTextChangedStartParam();<NEW_LINE>textChangeCall.arg(startParameter);<NEW_LINE>} else if (i == countParameterPosition) {<NEW_LINE>JVar countParameter = textWatcherHolder.getOnTextChangedCountParam();<NEW_LINE>textChangeCall.arg(countParameter);<NEW_LINE>} else if (i == beforeParameterPosition) {<NEW_LINE>JVar beforeParameter = textWatcherHolder.getOnTextChangedBeforeParam();<NEW_LINE>textChangeCall.arg(beforeParameter);<NEW_LINE>} else if (i == charSequenceParameterPosition) {<NEW_LINE>JVar charSequenceParam = textWatcherHolder.getOnTextChangedCharSequenceParam();<NEW_LINE>textChangeCall.arg(charSequenceParam);<NEW_LINE>} else if (i == viewParameterPosition) {<NEW_LINE>JVar viewParameter = textWatcherHolder.getTextViewVariable();<NEW_LINE>textChangeCall.arg(viewParameter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getSimpleName().toString();
295,653
public void run() {<NEW_LINE>try {<NEW_LINE>SQLiteDatabase database = mSQLiteHelper.getDatabase();<NEW_LINE>if (database == null) {<NEW_LINE>callback.onError("Database Error");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String sql = "INSERT OR REPLACE INTO " + mSQLiteHelper.getTableName() + " VALUES (?, ?);";<NEW_LINE>SQLiteStatement statement = database.compileStatement(sql);<NEW_LINE>try {<NEW_LINE>database.beginTransaction();<NEW_LINE>for (HippyStorageKeyValue keyValue : keyValues) {<NEW_LINE>statement.clearBindings();<NEW_LINE>statement.bindString(1, keyValue.key);<NEW_LINE>statement.<MASK><NEW_LINE>statement.execute();<NEW_LINE>}<NEW_LINE>database.setTransactionSuccessful();<NEW_LINE>callback.onSuccess(null);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>callback.onError(e.getMessage());<NEW_LINE>} finally {<NEW_LINE>database.endTransaction();<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>callback.onError(e.getMessage());<NEW_LINE>}<NEW_LINE>}
bindString(2, keyValue.value);
834,427
public XContentBuilder doXContentBody(XContentBuilder builder) throws IOException {<NEW_LINE>builder.field(Job.ID.getPreferredName(), jobId);<NEW_LINE>builder.field(Result.RESULT_TYPE.getPreferredName(), RESULT_TYPE_VALUE);<NEW_LINE>builder.field(MODEL_BYTES_FIELD.getPreferredName(), modelBytes);<NEW_LINE>if (peakModelBytes != null) {<NEW_LINE>builder.field(PEAK_MODEL_BYTES_FIELD.getPreferredName(), peakModelBytes);<NEW_LINE>}<NEW_LINE>if (modelBytesExceeded != null) {<NEW_LINE>builder.field(MODEL_BYTES_EXCEEDED_FIELD.getPreferredName(), modelBytesExceeded);<NEW_LINE>}<NEW_LINE>if (modelBytesMemoryLimit != null) {<NEW_LINE>builder.field(MODEL_BYTES_MEMORY_LIMIT_FIELD.getPreferredName(), modelBytesMemoryLimit);<NEW_LINE>}<NEW_LINE>builder.field(TOTAL_BY_FIELD_COUNT_FIELD.getPreferredName(), totalByFieldCount);<NEW_LINE>builder.field(TOTAL_OVER_FIELD_COUNT_FIELD.getPreferredName(), totalOverFieldCount);<NEW_LINE>builder.field(<MASK><NEW_LINE>builder.field(BUCKET_ALLOCATION_FAILURES_COUNT_FIELD.getPreferredName(), bucketAllocationFailuresCount);<NEW_LINE>builder.field(MEMORY_STATUS_FIELD.getPreferredName(), memoryStatus);<NEW_LINE>if (assignmentMemoryBasis != null) {<NEW_LINE>builder.field(ASSIGNMENT_MEMORY_BASIS_FIELD.getPreferredName(), assignmentMemoryBasis);<NEW_LINE>}<NEW_LINE>builder.field(CATEGORIZED_DOC_COUNT_FIELD.getPreferredName(), categorizedDocCount);<NEW_LINE>builder.field(TOTAL_CATEGORY_COUNT_FIELD.getPreferredName(), totalCategoryCount);<NEW_LINE>builder.field(FREQUENT_CATEGORY_COUNT_FIELD.getPreferredName(), frequentCategoryCount);<NEW_LINE>builder.field(RARE_CATEGORY_COUNT_FIELD.getPreferredName(), rareCategoryCount);<NEW_LINE>builder.field(DEAD_CATEGORY_COUNT_FIELD.getPreferredName(), deadCategoryCount);<NEW_LINE>builder.field(FAILED_CATEGORY_COUNT_FIELD.getPreferredName(), failedCategoryCount);<NEW_LINE>builder.field(CATEGORIZATION_STATUS_FIELD.getPreferredName(), categorizationStatus);<NEW_LINE>builder.timeField(LOG_TIME_FIELD.getPreferredName(), LOG_TIME_FIELD.getPreferredName() + "_string", logTime.getTime());<NEW_LINE>if (timestamp != null) {<NEW_LINE>builder.timeField(TIMESTAMP_FIELD.getPreferredName(), TIMESTAMP_FIELD.getPreferredName() + "_string", timestamp.getTime());<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>}
TOTAL_PARTITION_FIELD_COUNT_FIELD.getPreferredName(), totalPartitionFieldCount);
1,058,729
protected void prepare() {<NEW_LINE>for (ProcessInfoParameter para : getParameter()) {<NEW_LINE>String name = para.getParameterName();<NEW_LINE>if (para.getParameter() == null)<NEW_LINE>;<NEW_LINE>else if (name.equals(X_M_Product.COLUMNNAME_M_Product_ID)) {<NEW_LINE>p_M_Product_ID = para.getParameterAsInt();<NEW_LINE>} else if (name.equals(X_M_Warehouse.COLUMNNAME_M_Warehouse_ID)) {<NEW_LINE>p_M_Warehouse_ID = para.getParameterAsInt();<NEW_LINE>} else if (name.equals("DateTrx")) {<NEW_LINE>p_DateTrx = (Timestamp) para.getParameter();<NEW_LINE>} else if (name.equals(X_PP_Order_BOMLine.COLUMNNAME_QtyRequired)) {<NEW_LINE>p_QtyRequiered = (BigDecimal) para.getParameter();<NEW_LINE>} else if (name.equals(X_PP_Product_BOMLine.COLUMNNAME_BackflushGroup)) {<NEW_LINE>p_BackflushGroup = <MASK><NEW_LINE>} else if (name.equals(X_T_BOMLine.COLUMNNAME_LevelNo)) {<NEW_LINE>p_LevelNo = para.getParameterAsInt();<NEW_LINE>} else<NEW_LINE>log.log(Level.SEVERE, "prepare - Unknown Parameter: " + name);<NEW_LINE>}<NEW_LINE>}
(String) para.getParameter();
802,682
private void writeSuiteGroups(XMLStringBuffer xmlBuffer, ISuite suite) {<NEW_LINE>xmlBuffer.push(XMLReporterConfig.TAG_GROUPS);<NEW_LINE>Map<String, Collection<ITestNGMethod>> methodsByGroups = suite.getMethodsByGroups();<NEW_LINE>for (Map.Entry<String, Collection<ITestNGMethod>> entry : methodsByGroups.entrySet()) {<NEW_LINE>Properties groupAttrs = new Properties();<NEW_LINE>groupAttrs.setProperty(XMLReporterConfig.ATTR_NAME, entry.getKey());<NEW_LINE>xmlBuffer.push(XMLReporterConfig.TAG_GROUP, groupAttrs);<NEW_LINE>Set<ITestNGMethod> groupMethods = <MASK><NEW_LINE>for (ITestNGMethod groupMethod : groupMethods) {<NEW_LINE>Properties methodAttrs = new Properties();<NEW_LINE>methodAttrs.setProperty(XMLReporterConfig.ATTR_NAME, groupMethod.getMethodName());<NEW_LINE>methodAttrs.setProperty(XMLReporterConfig.ATTR_METHOD_SIG, groupMethod.toString());<NEW_LINE>methodAttrs.setProperty(XMLReporterConfig.ATTR_CLASS, groupMethod.getRealClass().getName());<NEW_LINE>xmlBuffer.addEmptyElement(XMLReporterConfig.TAG_METHOD, methodAttrs);<NEW_LINE>}<NEW_LINE>xmlBuffer.pop();<NEW_LINE>}<NEW_LINE>xmlBuffer.pop();<NEW_LINE>}
getUniqueMethodSet(entry.getValue());
1,661,813
private void initHotkeys() {<NEW_LINE>// Don't change focus on TAB<NEW_LINE>setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, new HashSet<KeyStroke>());<NEW_LINE>final InputMap inputMap = this.getInputMap();<NEW_LINE>final ActionMap actionMap = getActionMap();<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0), "LEFT");<NEW_LINE>actionMap.put("LEFT", m_leftAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, InputEvent.SHIFT_DOWN_MASK), "shift LEFT");<NEW_LINE>actionMap.put("shift LEFT", m_leftAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0), "RIGHT");<NEW_LINE>actionMap.put("RIGHT", m_rightAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, InputEvent.SHIFT_DOWN_MASK), "shift RIGHT");<NEW_LINE>actionMap.put("shift RIGHT", m_rightAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0), "UP");<NEW_LINE>actionMap.put("UP", m_upAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.SHIFT_DOWN_MASK), "shift UP");<NEW_LINE>actionMap.put("shift UP", m_upAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0), "DOWN");<NEW_LINE>actionMap.put("DOWN", m_downAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.SHIFT_DOWN_MASK), "shift DOWN");<NEW_LINE>actionMap.put("shift DOWN", m_downAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "PAGE_DOWN");<NEW_LINE>actionMap.put("PAGE_DOWN", m_pageDownAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, InputEvent.SHIFT_DOWN_MASK), "shift PAGE_DOWN");<NEW_LINE>actionMap.put("shift PAGE_DOWN", m_pageDownAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "PAGE_UP");<NEW_LINE>actionMap.put("PAGE_UP", m_pageUpAction);<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, InputEvent.SHIFT_DOWN_MASK), "shift PAGE_UP");<NEW_LINE><MASK><NEW_LINE>inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0), "TAB");<NEW_LINE>actionMap.put("TAB", m_tabAction);<NEW_LINE>}
actionMap.put("shift PAGE_UP", m_pageUpAction);
136,917
private void init_custom_card_expand_inside() {<NEW_LINE>// Create a Card<NEW_LINE>Card card = new Card(getActivity());<NEW_LINE>// Create a CardHeader<NEW_LINE>CardHeader header = new CardHeader(getActivity());<NEW_LINE>// Set the header title<NEW_LINE>header.setTitle(getString<MASK><NEW_LINE>// Add Header to card<NEW_LINE>card.addCardHeader(header);<NEW_LINE>// This provides a simple (and useless) expand area<NEW_LINE>CardExpandInside expand = new CardExpandInside(getActivity());<NEW_LINE>card.addCardExpand(expand);<NEW_LINE>// Set card in the cardView<NEW_LINE>CardView cardView = (CardView) getActivity().findViewById(R.id.carddemo_example_card_expand5);<NEW_LINE>ViewToClickToExpand viewToClickToExpand = ViewToClickToExpand.builder().highlightView(false).setupView(cardView);<NEW_LINE>card.setViewToClickToExpand(viewToClickToExpand);<NEW_LINE>card.setOnExpandAnimatorEndListener(new Card.OnExpandAnimatorEndListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onExpandEnd(Card card) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>cardView.setCard(card);<NEW_LINE>}
(R.string.demo_header_expand_area_inside));
918,513
public LeaderPingResult pingLeaderWithUuid(UUID uuid) {<NEW_LINE>Optional<LeaderPingerContext<PingableLeader<MASK><NEW_LINE>if (!suspectedLeader.isPresent()) {<NEW_LINE>return LeaderPingResults.pingReturnedFalse();<NEW_LINE>}<NEW_LINE>LeaderPingerContext<PingableLeader> leader = suspectedLeader.get();<NEW_LINE>MultiplexingCompletionService<LeaderPingerContext<PingableLeader>, PingResult> multiplexingCompletionService = MultiplexingCompletionService.createFromCheckedExecutors(leaderPingExecutors);<NEW_LINE>LeaderPingResult pingResult = null;<NEW_LINE>if (shouldUsePingV2(leader)) {<NEW_LINE>pingResult = actuallyPingLeaderWithUuid(multiplexingCompletionService, uuid, leader, leader.pinger()::pingV2);<NEW_LINE>}<NEW_LINE>if (pingResult == null || pingResult.pingCallFailedDueToExecutionException()) {<NEW_LINE>pingV2StatusOnRemotes.putIfAbsent(leader, false);<NEW_LINE>pingResult = actuallyPingLeaderWithUuid(multiplexingCompletionService, uuid, leader, () -> getPingResultFromLegacyEndpoint(leader));<NEW_LINE>} else if (pingResult.pingCallWasSuccessfullyExecuted()) {<NEW_LINE>pingV2StatusOnRemotes.put(leader, true);<NEW_LINE>}<NEW_LINE>return pingResult;<NEW_LINE>}
>> suspectedLeader = getSuspectedLeader(uuid);
1,355,216
private void loadNode1249() {<NEW_LINE>SessionSecurityDiagnosticsTypeNode node = new SessionSecurityDiagnosticsTypeNode(this.context, Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics, new QualifiedName(0, "SessionSecurityDiagnostics"), new LocalizedText("en", "SessionSecurityDiagnostics"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.SessionSecurityDiagnosticsDataType, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics, Identifiers.HasComponent, Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics_SessionId.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics, Identifiers.HasComponent, Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics_ClientUserIdOfSession.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics, Identifiers.HasComponent, Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics_ClientUserIdHistory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics, Identifiers.HasComponent, Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics_AuthenticationMechanism<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics, Identifiers.HasComponent, Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics_Encoding.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics, Identifiers.HasComponent, Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics_TransportProtocol.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics, Identifiers.HasComponent, Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics_SecurityMode.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics, Identifiers.HasComponent, Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics_SecurityPolicyUri.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics, Identifiers.HasComponent, Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics_ClientCertificate.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics, Identifiers.HasTypeDefinition, Identifiers.SessionSecurityDiagnosticsType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder_SessionSecurityDiagnostics, Identifiers.HasComponent, Identifiers.SessionsDiagnosticsSummaryType_ClientName_Placeholder.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
593,204
public String encode(WeixinResponse response) throws WeixinException {<NEW_LINE>WeixinMessageTransfer messageTransfer = WeiXin4jContextAwareImpl<MASK><NEW_LINE>EncryptType encryptType = messageTransfer.getEncryptType();<NEW_LINE>StringBuilder content = new StringBuilder();<NEW_LINE>content.append(XML_START);<NEW_LINE>content.append(String.format(ELEMENT_TOUSERNAME, messageTransfer.getFromUserName()));<NEW_LINE>content.append(String.format(ELEMENT_FROMUSERNAME, messageTransfer.getToUserName()));<NEW_LINE>content.append(String.format(ELEMENT_CREATETIME, System.currentTimeMillis() / 1000l));<NEW_LINE>content.append(String.format(ELEMENT_MSGTYPE, response.getMsgType()));<NEW_LINE>content.append(response.toContent());<NEW_LINE>content.append(XML_END);<NEW_LINE>if (encryptType == EncryptType.AES) {<NEW_LINE>AesToken aesToken = messageTransfer.getAesToken();<NEW_LINE>String nonce = ServerToolkits.generateRandomString(32);<NEW_LINE>String timestamp = Long.toString(System.currentTimeMillis() / 1000l);<NEW_LINE>String encrtypt = MessageUtil.aesEncrypt(aesToken.getWeixinId(), aesToken.getAesKey(), content.toString());<NEW_LINE>String msgSignature = MessageUtil.signature(aesToken.getToken(), nonce, timestamp, encrtypt);<NEW_LINE>content.delete(0, content.length());<NEW_LINE>content.append(XML_START);<NEW_LINE>content.append(String.format(ELEMENT_NONCE, nonce));<NEW_LINE>content.append(String.format(ELEMENT_TIMESTAMP, timestamp));<NEW_LINE>content.append(String.format(ELEMENT_MSGSIGNATURE, msgSignature));<NEW_LINE>content.append(String.format(ELEMENT_ENCRYPT, encrtypt));<NEW_LINE>content.append(XML_END);<NEW_LINE>}<NEW_LINE>return content.toString();<NEW_LINE>}
.getWeixinMessageTransfer().get();
1,592,266
public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(source.getControllerId());<NEW_LINE>if (player == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (player.chooseUse(Outcome.PutCardInPlay, "Put a creature card from your hand onto the battlefield?", source, game)) {<NEW_LINE>TargetCardInHand target = new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE_A);<NEW_LINE>if (player.choose(Outcome.PutCardInPlay, target, source, game)) {<NEW_LINE>Card card = game.getCard(target.getFirstTarget());<NEW_LINE>if (card != null) {<NEW_LINE>Permanent blockedCreature = game.getPermanent(getTargetPointer().getFirst(game, source));<NEW_LINE>if (player.moveCards(card, Zone.BATTLEFIELD, source, game, false, false, false, null) && game.getCombat() != null && blockedCreature != null) {<NEW_LINE>CombatGroup attacker = game.getCombat().findGroup(blockedCreature.getId());<NEW_LINE>Permanent putIntoPlay = game.<MASK><NEW_LINE>if (putIntoPlay != null && putIntoPlay.isCreature(game) && attacker != null) {<NEW_LINE>game.getCombat().findGroup(blockedCreature.getId()).addBlocker(putIntoPlay.getId(), source.getControllerId(), game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
getPermanent(target.getFirstTarget());
71,956
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {<NEW_LINE>HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;<NEW_LINE>Subject subject = SecurityUtils.getSubject();<NEW_LINE>if (subject.isAuthenticated()) {<NEW_LINE>UserInfo loginUserInfo = (UserInfo) subject.getPrincipal();<NEW_LINE>doFilter(servletRequest, servletResponse, filterChain, loginUserInfo);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>UsernamePasswordToken token = getPasswordToken(servletRequest);<NEW_LINE>subject.login(token);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOGGER.error(<MASK><NEW_LINE>((HttpServletResponse) servletResponse).sendError(HttpServletResponse.SC_FORBIDDEN, ex.getMessage());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!subject.isAuthenticated()) {<NEW_LINE>log.error("Access denied for anonymous user:{}, path:{} ", subject.getPrincipal(), httpServletRequest.getServletPath());<NEW_LINE>((HttpServletResponse) servletResponse).sendError(HttpServletResponse.SC_FORBIDDEN);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>doFilter(servletRequest, servletResponse, filterChain, (UserInfo) subject.getPrincipal());<NEW_LINE>}
"login error, msg: {}", ex.getMessage());
89,650
public Frame decorrelateRel(Join rel) {<NEW_LINE>// For SEMI/ANTI join decorrelate it's input directly,<NEW_LINE>// because the correlate variables can only be propagated from<NEW_LINE>// the left side, which is not supported yet.<NEW_LINE>if (!rel.getJoinType().projectsRight()) {<NEW_LINE>return decorrelateRel((RelNode) rel);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Rewrite logic:<NEW_LINE>//<NEW_LINE>// 1. rewrite join condition.<NEW_LINE>// 2. map output positions and produce corVars if any.<NEW_LINE>//<NEW_LINE>final RelNode oldLeft = rel.getInput(0);<NEW_LINE>final RelNode oldRight = rel.getInput(1);<NEW_LINE>final Frame leftFrame = getInvoke(oldLeft, rel);<NEW_LINE>final Frame rightFrame = getInvoke(oldRight, rel);<NEW_LINE>if (leftFrame == null || rightFrame == null) {<NEW_LINE>// If any input has not been rewritten, do not rewrite this rel.<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final RelNode newJoin = relBuilder.push(leftFrame.r).push(rightFrame.r).join(rel.getJoinType(), decorrelateExpr(currentRel, map, cm, rel.getCondition()), ImmutableSet.of()).build();<NEW_LINE>// Create the mapping between the output of the old correlation rel<NEW_LINE>// and the new join rel<NEW_LINE>Map<Integer, Integer> mapOldToNewOutputs = new HashMap<>();<NEW_LINE>int oldLeftFieldCount = oldLeft<MASK><NEW_LINE>int newLeftFieldCount = leftFrame.r.getRowType().getFieldCount();<NEW_LINE>int oldRightFieldCount = oldRight.getRowType().getFieldCount();<NEW_LINE>// noinspection AssertWithSideEffects<NEW_LINE>assert rel.getRowType().getFieldCount() == oldLeftFieldCount + oldRightFieldCount;<NEW_LINE>// Left input positions are not changed.<NEW_LINE>mapOldToNewOutputs.putAll(leftFrame.oldToNewOutputs);<NEW_LINE>// Right input positions are shifted by newLeftFieldCount.<NEW_LINE>for (int i = 0; i < oldRightFieldCount; i++) {<NEW_LINE>mapOldToNewOutputs.put(i + oldLeftFieldCount, rightFrame.oldToNewOutputs.get(i) + newLeftFieldCount);<NEW_LINE>}<NEW_LINE>final SortedMap<CorDef, Integer> corDefOutputs = new TreeMap<>(leftFrame.corDefOutputs);<NEW_LINE>// Right input positions are shifted by newLeftFieldCount.<NEW_LINE>for (Map.Entry<CorDef, Integer> entry : rightFrame.corDefOutputs.entrySet()) {<NEW_LINE>corDefOutputs.put(entry.getKey(), entry.getValue() + newLeftFieldCount);<NEW_LINE>}<NEW_LINE>return register(rel, newJoin, mapOldToNewOutputs, corDefOutputs);<NEW_LINE>}
.getRowType().getFieldCount();
795,642
public VoidResponse unassignValidValueFromConsumer(String serverName, String userId, String validValueGUID, String consumerGUID, NullRequestBody requestBody) {<NEW_LINE>final String methodName = "unassignValidValueFromConsumer";<NEW_LINE>RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);<NEW_LINE>VoidResponse response = new VoidResponse();<NEW_LINE>AuditLog auditLog = null;<NEW_LINE>try {<NEW_LINE>auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);<NEW_LINE>ValidValuesHandler<ValidValueElement, ValidValueAssignmentConsumerElement, ValidValueAssignmentDefinitionElement, ValidValueImplAssetElement, ValidValueImplDefinitionElement, ValidValueMappingElement, ReferenceValueAssignmentDefinitionElement, ReferenceValueAssignmentItemElement> handler = instanceHandler.<MASK><NEW_LINE>handler.unassignValidValueFromConsumer(userId, null, null, validValueGUID, consumerGUID, null, methodName);<NEW_LINE>} catch (Exception error) {<NEW_LINE>restExceptionHandler.captureExceptions(response, error, methodName, auditLog);<NEW_LINE>}<NEW_LINE>restCallLogger.logRESTCallReturn(token, response.toString());<NEW_LINE>return response;<NEW_LINE>}
getValidValuesHandler(userId, serverName, methodName);
665,422
public MultipleObjectsBundle filter(MultipleObjectsBundle objects) {<NEW_LINE>final int size = objects.dataLength();<NEW_LINE>if (size == 0) {<NEW_LINE>return objects;<NEW_LINE>}<NEW_LINE>MultipleObjectsBundle bundle = new MultipleObjectsBundle();<NEW_LINE>for (int r = 0; r < objects.metaLength(); r++) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>SimpleTypeInformation<Object> type = (SimpleTypeInformation<Object>) objects.meta(r);<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final List<Object> column = (List<Object>) objects.getColumn(r);<NEW_LINE>if (!dist.getInputTypeRestriction().isAssignableFromType(type)) {<NEW_LINE>bundle.appendColumn(type, column);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Get the replacement type information<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final List<I> castColumn = (List<I>) column;<NEW_LINE>bundle.appendColumn(new VectorFieldTypeInformation<>(factory, tdim), castColumn);<NEW_LINE>StepProgress prog = LOG.isVerbose() ? new StepProgress("Classic MDS", 2) : null;<NEW_LINE>// Compute distance matrix.<NEW_LINE>LOG.beginStep(prog, 1, "Computing distance matrix");<NEW_LINE>double[][] mat = computeSquaredDistanceMatrix(castColumn, dist);<NEW_LINE>doubleCenterSymmetric(mat);<NEW_LINE>// Find eigenvectors.<NEW_LINE>{<NEW_LINE>LOG.beginStep(prog, 2, "Computing singular value decomposition");<NEW_LINE><MASK><NEW_LINE>double[][] u = svd.getU();<NEW_LINE>double[] lambda = svd.getSingularValues();<NEW_LINE>// Undo squared, unless we were given a squared distance function:<NEW_LINE>if (!dist.isSquared()) {<NEW_LINE>for (int i = 0; i < tdim; i++) {<NEW_LINE>lambda[i] = Math.sqrt(Math.abs(lambda[i]));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>double[] buf = new double[tdim];<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>double[] row = u[i];<NEW_LINE>for (int x = 0; x < buf.length; x++) {<NEW_LINE>buf[x] = lambda[x] * row[x];<NEW_LINE>}<NEW_LINE>column.set(i, factory.newNumberVector(buf));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.setCompleted(prog);<NEW_LINE>}<NEW_LINE>return bundle;<NEW_LINE>}
SingularValueDecomposition svd = new SingularValueDecomposition(mat);
142,414
public TimeSeriesDatabaseConnection deleteById(String id) {<NEW_LINE>String resourceGroupName = <MASK><NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String resourceName = Utils.getValueFromIdByName(id, "digitalTwinsInstances");<NEW_LINE>if (resourceName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'digitalTwinsInstances'.", id)));<NEW_LINE>}<NEW_LINE>String timeSeriesDatabaseConnectionName = Utils.getValueFromIdByName(id, "timeSeriesDatabaseConnections");<NEW_LINE>if (timeSeriesDatabaseConnectionName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment" + " 'timeSeriesDatabaseConnections'.", id)));<NEW_LINE>}<NEW_LINE>return this.delete(resourceGroupName, resourceName, timeSeriesDatabaseConnectionName, Context.NONE);<NEW_LINE>}
Utils.getValueFromIdByName(id, "resourceGroups");
1,375,642
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><MASK><NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return describeAlarmsForMetricResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("MetricAlarms", targetDepth)) {<NEW_LINE>describeAlarmsForMetricResult.withMetricAlarms(new ArrayList<MetricAlarm>());<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("MetricAlarms/member", targetDepth)) {<NEW_LINE>describeAlarmsForMetricResult.withMetricAlarms(MetricAlarmStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return describeAlarmsForMetricResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
XMLEvent xmlEvent = context.nextEvent();
1,026,754
public static void initType(PythonObjectSlowPathFactory factory, PythonLanguage language, Object klass, Descriptor desc) {<NEW_LINE>assert IsSubtypeNode.getUncached().execute(klass, PythonBuiltinClassType.PTuple);<NEW_LINE>// create descriptors for accessing named fields by their names<NEW_LINE>int unnamedFields = 0;<NEW_LINE>for (int idx = 0; idx < desc.fieldNames.length; ++idx) {<NEW_LINE>if (desc.fieldNames[idx] != null) {<NEW_LINE>createMember(factory, language, klass, desc.fieldNames[idx], desc.fieldDocStrings[idx], idx);<NEW_LINE>} else {<NEW_LINE>unnamedFields++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>createMethod(factory, language, klass, desc, ReprNode.class, ReprNodeGen::create);<NEW_LINE>createMethod(factory, language, klass, desc, ReduceNode.class, ReduceNodeGen::create);<NEW_LINE>WriteAttributeToObjectNode writeAttrNode = WriteAttributeToObjectNode.getUncached(true);<NEW_LINE>if (desc.docString != null) {<NEW_LINE>writeAttrNode.execute(klass, __DOC__, desc.docString);<NEW_LINE>}<NEW_LINE>writeAttrNode.execute(<MASK><NEW_LINE>writeAttrNode.execute(klass, N_FIELDS, desc.fieldNames.length);<NEW_LINE>writeAttrNode.execute(klass, N_UNNAMED_FIELDS, unnamedFields);<NEW_LINE>if (ReadAttributeFromObjectNode.getUncachedForceType().execute(klass, __NEW__) == PNone.NO_VALUE) {<NEW_LINE>if (desc.allowInstances) {<NEW_LINE>createConstructor(factory, language, klass, desc, NewNode.class, NewNodeGen::create);<NEW_LINE>} else {<NEW_LINE>createConstructor(factory, language, klass, desc, DisabledNewNode.class, d -> DisabledNewNodeGen.create());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
klass, N_SEQUENCE_FIELDS, desc.inSequence);
1,355,545
Expression optimize(Expression filterExpression) {<NEW_LINE><MASK><NEW_LINE>FilterKind filterKind = FilterKind.valueOf(filterFunction.getOperator());<NEW_LINE>List<Expression> operands = filterFunction.getOperands();<NEW_LINE>if (filterKind == FilterKind.AND || filterKind == FilterKind.OR || filterKind == FilterKind.NOT) {<NEW_LINE>// NOTE: We don't need to replace the children because all the changes are applied in-place<NEW_LINE>for (Expression operand : operands) {<NEW_LINE>optimize(operand);<NEW_LINE>}<NEW_LINE>} else if (filterKind.isRange() || filterKind == FilterKind.EQUALS) {<NEW_LINE>Expression expression = operands.get(0);<NEW_LINE>if (expression.getType() == ExpressionType.FUNCTION) {<NEW_LINE>Function expressionFunction = expression.getFunctionCall();<NEW_LINE>String functionName = StringUtils.remove(expressionFunction.getOperator(), '_');<NEW_LINE>if (functionName.equalsIgnoreCase(TimeConversionTransformFunction.FUNCTION_NAME)) {<NEW_LINE>optimizeTimeConvert(filterFunction, filterKind);<NEW_LINE>} else if (functionName.equalsIgnoreCase(DateTimeConversionTransformFunction.FUNCTION_NAME)) {<NEW_LINE>optimizeDateTimeConvert(filterFunction, filterKind);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return filterExpression;<NEW_LINE>}
Function filterFunction = filterExpression.getFunctionCall();
1,362,324
private void fireJSSnap(int x, int y, int w, int h) {<NEW_LINE>// System.out.println("[WebviewSnapshotter::fireJSSnap("+x+","+y+","+w+","+h);<NEW_LINE>if (!CN.isEdt()) {<NEW_LINE>CN.callSerially(() -> {<NEW_LINE>fireJSSnap(<MASK><NEW_LINE>});<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>web.execute("window.snapper = window.snapper || {}; " + "window.snapper.handleJSSnap = function(scrollX, scrollY, x, y, w, h) {" + " callback.onSuccess(JSON.stringify({scrollX:scrollX, scrollY:scrollY, x:x, y:y, w:w, h:h}));" + "}; window.getRectSnapshot(" + x + "," + y + "," + w + "," + h + ");", res -> {<NEW_LINE>try {<NEW_LINE>Result data = Result.fromContent(res.toString(), Result.JSON);<NEW_LINE>handleJSSnap(data.getAsInteger("scrollX"), data.getAsInteger("scrollY"), data.getAsInteger("x"), data.getAsInteger("y"), data.getAsInteger("w"), data.getAsInteger("h"));<NEW_LINE>} catch (Exception ex) {<NEW_LINE>Log.p("Failed to parse callback in fireJSSnap");<NEW_LINE>Log.e(ex);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
x, y, w, h);
1,240,630
public void assertAccountValid(final I_C_ValidCombination account, final I_GL_JournalLine glJournalLine) {<NEW_LINE>Check.assumeNotNull(account, "account not null");<NEW_LINE>Check.assume(account.getC_ValidCombination_ID() > 0, "account exists");<NEW_LINE>final I_C_ElementValue accountEV = account.getAccount();<NEW_LINE>Check.assumeNotNull(accountEV, "accountEV not null for {}", account);<NEW_LINE>Check.assumeNotNull(glJournalLine, "line not null");<NEW_LINE>final int lineNo = glJournalLine.getLine();<NEW_LINE>final I_GL_Journal glJournal = glJournalLine.getGL_Journal();<NEW_LINE>Check.assumeNotNull(glJournal, "glJournal not null");<NEW_LINE>final String postingType = glJournal.getPostingType();<NEW_LINE>Check.assumeNotNull(postingType, "postingType not null");<NEW_LINE>// bcahya, BF [2789319] No check of Actual, Budget, Statistical attribute<NEW_LINE>if (!accountEV.isActive()) {<NEW_LINE>throw new AdempiereException("@InActiveAccount@ - @Line@=" + lineNo + " - " + accountEV);<NEW_LINE>}<NEW_LINE>// Michael Judd (mjudd) BUG: [ 2678088 ] Allow posting to system accounts for non-actual postings<NEW_LINE>if (accountEV.isDocControlled() && (postingType.equals(X_GL_Journal.POSTINGTYPE_Actual)) || postingType.equals(X_GL_Journal.POSTINGTYPE_Commitment) || postingType.equals(X_GL_Journal.POSTINGTYPE_Reservation)) {<NEW_LINE>throw new AdempiereException("@DocControlledError@ - @Line@=" + lineNo + " - " + accountEV);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// bcahya, BF [2789319] No check of Actual, Budget, Statistical attribute<NEW_LINE>if (postingType.equals(X_GL_Journal.POSTINGTYPE_Actual) && !accountEV.isPostActual()) {<NEW_LINE>throw new AdempiereException(<MASK><NEW_LINE>}<NEW_LINE>if (postingType.equals(X_GL_Journal.POSTINGTYPE_Budget) && !accountEV.isPostBudget()) {<NEW_LINE>throw new AdempiereException("@PostingTypeBudgetError@ - @Line@=" + lineNo + " - " + accountEV);<NEW_LINE>}<NEW_LINE>if (postingType.equals(X_GL_Journal.POSTINGTYPE_Statistical) && !accountEV.isPostStatistical()) {<NEW_LINE>throw new AdempiereException("@PostingTypeStatisticalError@ - @Line@=" + lineNo + " - " + accountEV);<NEW_LINE>}<NEW_LINE>// end BF [2789319] No check of Actual, Budget, Statistical attribute<NEW_LINE>}
"@PostingTypeActualError@ - @Line@=" + lineNo + " - " + accountEV);