idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,072,647
public ExitOrRestartOrPowerOff displayQRCode(String encodedData) throws IOException {<NEW_LINE>System.out.println("Displaying QR code. Data: " + encodedData);<NEW_LINE>String message = "We are done. Please scan the following QR-code with the blue scanner.\n" + "Then type 'exit' + <enter> or 'restart' + <enter>.\n" + "To turn off the machine type 'poweroff' + <enter>.";<NEW_LINE>framebuffer.draw((Graphics2D g) -> {<NEW_LINE>baseScreenLayout(g, "QR Code Output", message, Color.white);<NEW_LINE>// Draw the QR Code<NEW_LINE>QRCodeWriter qrCodeWriter = new QRCodeWriter();<NEW_LINE>BitMatrix matrix;<NEW_LINE>try {<NEW_LINE>matrix = qrCodeWriter.encode(encodedData, BarcodeFormat.QR_CODE, 1, 1);<NEW_LINE>} catch (WriterException w) {<NEW_LINE>throw new RuntimeException(w);<NEW_LINE>}<NEW_LINE>BufferedImage img = MatrixToImageWriter.toBufferedImage(matrix);<NEW_LINE>// aim to have the QR code fill 50% of the screen height<NEW_LINE>int scale = (framebuffer.getHeight() / 2) / img.getHeight();<NEW_LINE>if (scale < 1) {<NEW_LINE>scale = 1;<NEW_LINE>}<NEW_LINE>if (scale > 4) {<NEW_LINE>scale = 4;<NEW_LINE>}<NEW_LINE>AffineTransform at = new AffineTransform();<NEW_LINE>at.scale(scale, scale);<NEW_LINE>AffineTransformOp scaleOp = new AffineTransformOp(at, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);<NEW_LINE>g.drawImage(img, scaleOp, framebuffer.getWidth() / 2 - (scale * img.getWidth()) / 2, framebuffer.getHeight() / 2 - (scale * img.getHeight()) / 2);<NEW_LINE>});<NEW_LINE>int offset = framebuffer.getHeight() - 60;<NEW_LINE>framebuffer.text("Type 'exit' or 'restart' or 'poweroff'", 18, offset);<NEW_LINE>while (true) {<NEW_LINE>String command = framebuffer.prompt(<MASK><NEW_LINE>if (command.equalsIgnoreCase("restart")) {<NEW_LINE>return ExitOrRestartOrPowerOff.Restart;<NEW_LINE>} else if (command.equalsIgnoreCase("exit")) {<NEW_LINE>return ExitOrRestartOrPowerOff.Exit;<NEW_LINE>} else if (command.equalsIgnoreCase("poweroff")) {<NEW_LINE>return ExitOrRestartOrPowerOff.PowerOff;<NEW_LINE>}<NEW_LINE>framebuffer.text("That wasn't 'exit' or 'restart' or 'poweroff'. Try again.", 18, offset);<NEW_LINE>}<NEW_LINE>}
18, offset + 20, false);
588,862
// The phase concept please refer to AggregateInfo::AggPhase<NEW_LINE>private LogicalAggregationOperator createDistinctAggForFirstPhase(ColumnRefFactory columnRefFactory, List<ColumnRefOperator> groupKeys, Map<ColumnRefOperator, CallOperator> aggregationMap, AggType type) {<NEW_LINE>Set<ColumnRefOperator> newGroupKeys = Sets.newHashSet(groupKeys);<NEW_LINE>Map<ColumnRefOperator, CallOperator> localAggMap = Maps.newHashMap();<NEW_LINE>for (Map.Entry<ColumnRefOperator, CallOperator> entry : aggregationMap.entrySet()) {<NEW_LINE>ColumnRefOperator column = entry.getKey();<NEW_LINE>CallOperator aggregation = entry.getValue();<NEW_LINE>// Add distinct column to group by column<NEW_LINE>if (aggregation.isDistinct()) {<NEW_LINE>for (int i = 0; i < aggregation.getUsedColumns().cardinality(); ++i) {<NEW_LINE>newGroupKeys.add(columnRefFactory.getColumnRef(aggregation.getUsedColumns().getColumnIds()[i]));<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Type intermediateType = getIntermediateType(aggregation);<NEW_LINE>CallOperator callOperator;<NEW_LINE>if (!type.isLocal()) {<NEW_LINE>callOperator = new CallOperator(aggregation.getFnName(), aggregation.getType(), Lists.newArrayList(new ColumnRefOperator(column.getId(), aggregation.getType(), column.getName(), aggregation.isNullable())), aggregation.getFunction());<NEW_LINE>} else {<NEW_LINE>callOperator = new CallOperator(aggregation.getFnName(), intermediateType, aggregation.getChildren(), aggregation.getFunction());<NEW_LINE>}<NEW_LINE>localAggMap.put(new ColumnRefOperator(column.getId(), intermediateType, column.getName(), column.isNullable()), callOperator);<NEW_LINE>}<NEW_LINE>return new LogicalAggregationOperator(type, Lists<MASK><NEW_LINE>}
.newArrayList(newGroupKeys), localAggMap);
1,055,015
void applyRotation(PdfDictionary pageN, ByteBuffer out) {<NEW_LINE>if (!cstp.rotateContents) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Rectangle page = reader.getPageSizeWithRotation(pageN);<NEW_LINE>int rotation = page.getRotation();<NEW_LINE>switch(rotation) {<NEW_LINE>case 90:<NEW_LINE>out.append(PdfContents.ROTATE90);<NEW_LINE>out.append(page.getTop());<NEW_LINE>out.append(' ').append('0').append(PdfContents.ROTATEFINAL);<NEW_LINE>break;<NEW_LINE>case 180:<NEW_LINE><MASK><NEW_LINE>out.append(page.getRight());<NEW_LINE>out.append(' ');<NEW_LINE>out.append(page.getTop());<NEW_LINE>out.append(PdfContents.ROTATEFINAL);<NEW_LINE>break;<NEW_LINE>case 270:<NEW_LINE>out.append(PdfContents.ROTATE270);<NEW_LINE>out.append('0').append(' ');<NEW_LINE>out.append(page.getRight());<NEW_LINE>out.append(PdfContents.ROTATEFINAL);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
out.append(PdfContents.ROTATE180);
957,170
// Returns true if polyline_a crosses envelope_b.<NEW_LINE>private static boolean polylineCrossesEnvelope_(Polyline polyline_a, Envelope envelope_b, double tolerance, ProgressTracker progress_tracker) {<NEW_LINE>Envelope2D env_a = new Envelope2D(), env_b = new Envelope2D();<NEW_LINE>polyline_a.queryEnvelope2D(env_a);<NEW_LINE>envelope_b.queryEnvelope2D(env_b);<NEW_LINE>if (envelopeInfContainsEnvelope_(env_b, env_a, tolerance))<NEW_LINE>return false;<NEW_LINE>if (env_b.getHeight() <= tolerance && env_b.getWidth() <= tolerance)<NEW_LINE>// when treated as a point, lines cannot cross points.<NEW_LINE>return false;<NEW_LINE>if (env_b.getHeight() <= tolerance || env_b.getWidth() <= tolerance) {<NEW_LINE>// Treat<NEW_LINE>// as<NEW_LINE>// polyline<NEW_LINE>Polyline polyline_b = new Polyline();<NEW_LINE>Point p = new Point();<NEW_LINE>envelope_b.queryCornerByVal(0, p);<NEW_LINE>polyline_b.startPath(p);<NEW_LINE>envelope_b.queryCornerByVal(2, p);<NEW_LINE>polyline_b.lineTo(p);<NEW_LINE>return polylineCrossesPolyline_(<MASK><NEW_LINE>}<NEW_LINE>// Treat env_b as area<NEW_LINE>SegmentIterator seg_iter_a = polyline_a.querySegmentIterator();<NEW_LINE>Envelope2D env_b_inflated = new Envelope2D(), env_b_deflated = new Envelope2D();<NEW_LINE>env_b_deflated.setCoords(env_b);<NEW_LINE>env_b_inflated.setCoords(env_b);<NEW_LINE>env_b_deflated.inflate(-tolerance, -tolerance);<NEW_LINE>env_b_inflated.inflate(tolerance, tolerance);<NEW_LINE>boolean b_interior = false, b_exterior = false;<NEW_LINE>Envelope2D env_segment_a = new Envelope2D();<NEW_LINE>Envelope2D env_inter = new Envelope2D();<NEW_LINE>while (seg_iter_a.nextPath()) {<NEW_LINE>while (seg_iter_a.hasNextSegment()) {<NEW_LINE>Segment segment_a = seg_iter_a.nextSegment();<NEW_LINE>segment_a.queryEnvelope2D(env_segment_a);<NEW_LINE>if (!b_exterior) {<NEW_LINE>if (!env_b_inflated.contains(env_segment_a))<NEW_LINE>b_exterior = true;<NEW_LINE>}<NEW_LINE>if (!b_interior) {<NEW_LINE>env_inter.setCoords(env_b_deflated);<NEW_LINE>env_inter.intersect(env_segment_a);<NEW_LINE>if (!env_inter.isEmpty() && (env_inter.getHeight() > tolerance || env_inter.getWidth() > tolerance))<NEW_LINE>b_interior = true;<NEW_LINE>}<NEW_LINE>if (b_interior && b_exterior)<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
polyline_a, polyline_b, tolerance, progress_tracker);
1,681,022
public Object postProcessAfterInitialization(@Nonnull final Object bean, @Nonnull final String beanName) throws BeansException {<NEW_LINE>// noinspection ConstantConditions<NEW_LINE>if (bean instanceof FactoryBean || (beanName != null && !isNullBean(bean) && beanFactory.containsBean(beanName) && !beanFactory.isSingleton(beanName))) {<NEW_LINE>return bean;<NEW_LINE>}<NEW_LINE>Class<?> targetClass = bean.getClass();<NEW_LINE>final ClassLoader classLoader = targetClass.getClassLoader();<NEW_LINE>if (parameterResolverFactory == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (handlerDefinition == null) {<NEW_LINE>handlerDefinition = ClasspathHandlerDefinition.forClassLoader(classLoader);<NEW_LINE>}<NEW_LINE>if (isPostProcessingCandidate(targetClass)) {<NEW_LINE>T adapter = initializeAdapterFor(bean, parameterResolverFactory, handlerDefinition);<NEW_LINE>return createAdapterProxy(bean, adapter, getAdapterInterfaces(), true, classLoader);<NEW_LINE>} else if (!isInstance(bean, getAdapterInterfaces()) && isPostProcessingCandidate(AopProxyUtils.ultimateTargetClass(bean))) {<NEW_LINE>// Java Proxy, find target and inspect that instance<NEW_LINE>try {<NEW_LINE>Object targetBean = ((Advised) bean).getTargetSource().getTarget();<NEW_LINE>// we want to invoke the Java Proxy if possible, so we create a CGLib proxy that does that for us<NEW_LINE>Object proxyInvokingBean = createJavaProxyInvoker(bean, targetBean);<NEW_LINE>T adapter = initializeAdapterFor(proxyInvokingBean, parameterResolverFactory, handlerDefinition);<NEW_LINE>return createAdapterProxy(proxyInvokingBean, adapter, getAdapterInterfaces(), false, classLoader);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new AxonConfigurationException("Unable to wrap annotated handler.", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return bean;<NEW_LINE>}
parameterResolverFactory = ClasspathParameterResolverFactory.forClassLoader(classLoader);
1,373,243
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {<NEW_LINE>super.onActivityResult(requestCode, resultCode, intent);<NEW_LINE>logDebug("onActivityResult");<NEW_LINE>if (intent == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (nodeSaver.handleActivityResult(this, requestCode, resultCode, intent)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (requestCode == REQUEST_CODE_SELECT_IMPORT_FOLDER && resultCode == RESULT_OK) {<NEW_LINE>if (!isOnline(this)) {<NEW_LINE>try {<NEW_LINE>statusDialog.dismiss();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>}<NEW_LINE>showSnackbar(SNACKBAR_TYPE, getString(R.string.error_server_connection_problem));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>toHandle = <MASK><NEW_LINE>fragmentHandle = intent.getLongExtra("fragmentH", -1);<NEW_LINE>MegaNode target = megaApi.getNodeByHandle(toHandle);<NEW_LINE>if (target == null) {<NEW_LINE>if (megaApi.getRootNode() != null) {<NEW_LINE>target = megaApi.getRootNode();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>statusDialog = MegaProgressDialogUtil.createProgressDialog(this, getString(R.string.general_importing));<NEW_LINE>statusDialog.show();<NEW_LINE>if (adapterList != null && adapterList.isMultipleSelect()) {<NEW_LINE>logDebug("Is multiple select");<NEW_LINE>List<MegaNode> nodes = adapterList.getSelectedNodes();<NEW_LINE>if (nodes.size() != 0) {<NEW_LINE>if (target != null) {<NEW_LINE>logDebug("Target node: " + target.getHandle());<NEW_LINE>for (MegaNode node : nodes) {<NEW_LINE>node = megaApiFolder.authorizeNode(node);<NEW_LINE>if (node != null) {<NEW_LINE>cont++;<NEW_LINE>importLinkMultipleListener = new MultipleRequestListenerLink(this, cont, cont, FOLDER_LINK);<NEW_LINE>megaApi.copyNode(node, target, importLinkMultipleListener);<NEW_LINE>} else {<NEW_LINE>showSnackbar(SNACKBAR_TYPE, getString(R.string.context_no_copied));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>showSnackbar(SNACKBAR_TYPE, getString(R.string.context_no_copied));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logWarning("No selected nodes");<NEW_LINE>showSnackbar(SNACKBAR_TYPE, getString(R.string.context_no_copied));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logDebug("No multiple select");<NEW_LINE>if (selectedNode != null) {<NEW_LINE>if (target != null) {<NEW_LINE>logDebug("Target node: " + target.getHandle());<NEW_LINE>selectedNode = megaApiFolder.authorizeNode(selectedNode);<NEW_LINE>if (selectedNode != null) {<NEW_LINE>cont++;<NEW_LINE>importLinkMultipleListener = new MultipleRequestListenerLink(this, cont, cont, FOLDER_LINK);<NEW_LINE>megaApi.copyNode(selectedNode, target, importLinkMultipleListener);<NEW_LINE>} else {<NEW_LINE>showSnackbar(SNACKBAR_TYPE, getString(R.string.context_no_copied));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>showSnackbar(SNACKBAR_TYPE, getString(R.string.context_no_copied));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logWarning("Selected Node is NULL");<NEW_LINE>showSnackbar(SNACKBAR_TYPE, getString(R.string.context_no_copied));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
intent.getLongExtra("IMPORT_TO", 0);
271,389
private static boolean polygonContainsPolygonImpl_(Polygon polygon_a, Polygon polygon_b, double tolerance, ProgressTracker progressTracker) {<NEW_LINE>boolean[<MASK><NEW_LINE>b_result_known[0] = false;<NEW_LINE>boolean res = polygonContainsMultiPath_(polygon_a, polygon_b, tolerance, b_result_known, progressTracker);<NEW_LINE>if (b_result_known[0])<NEW_LINE>return res;<NEW_LINE>// We can clip polygon_a to the extent of polyline_b<NEW_LINE>Envelope2D envBInflated = new Envelope2D();<NEW_LINE>polygon_b.queryEnvelope2D(envBInflated);<NEW_LINE>envBInflated.inflate(1000.0 * tolerance, 1000.0 * tolerance);<NEW_LINE>Polygon _polygonA = null;<NEW_LINE>if (polygon_a.getPointCount() > 10) {<NEW_LINE>_polygonA = (Polygon) Clipper.clip(polygon_a, envBInflated, tolerance, 0.0);<NEW_LINE>if (_polygonA.isEmpty())<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>_polygonA = polygon_a;<NEW_LINE>}<NEW_LINE>boolean bContains = RelationalOperationsMatrix.polygonContainsPolygon_(_polygonA, polygon_b, tolerance, progressTracker);<NEW_LINE>return bContains;<NEW_LINE>}
] b_result_known = new boolean[1];
1,368,387
public List<GlobalSession> findGlobalSessionByPage(int pageNum, int pageSize, boolean withBranchSessions) {<NEW_LINE>List<GlobalSession> globalSessions = new ArrayList<>();<NEW_LINE>int start = Math.max((pageNum - 1) * pageSize, 0);<NEW_LINE>int end = pageNum * pageSize - 1;<NEW_LINE>List<String> statusKeys = convertStatusKeys(GlobalStatus.values());<NEW_LINE>Map<String, Integer> stringLongMap = calculateStatuskeysHasData(statusKeys);<NEW_LINE>List<List<String>> list = dogetXidsForTargetMap(stringLongMap, start, end, pageSize);<NEW_LINE>if (CollectionUtils.isNotEmpty(list)) {<NEW_LINE>List<String> xids = list.stream().flatMap(Collection::stream).<MASK><NEW_LINE>xids.forEach(xid -> {<NEW_LINE>if (globalSessions.size() < pageSize) {<NEW_LINE>GlobalSession globalSession = this.readSession(xid, withBranchSessions);<NEW_LINE>if (globalSession != null) {<NEW_LINE>globalSessions.add(globalSession);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return globalSessions;<NEW_LINE>}
collect(Collectors.toList());
618,094
private void insertCastOrBoxingCode(Local lhs, Local rhs, Chain<Unit> newUnits) {<NEW_LINE>final Type lhsType = lhs.getType();<NEW_LINE>// if assigning to a primitive type then there's nothing to do<NEW_LINE>if (lhsType instanceof RefLikeType) {<NEW_LINE>final Type rhsType = rhs.getType();<NEW_LINE>if (rhsType instanceof RefLikeType) {<NEW_LINE>// insert cast<NEW_LINE>newUnits.add(Jimple.v().newAssignStmt(lhs, Jimple.v().newCastExpr(rhs, lhsType)));<NEW_LINE>} else {<NEW_LINE>// primitive type in rhs; insert boxing code<NEW_LINE>RefType boxedType = ((PrimType) rhsType).boxedType();<NEW_LINE>SootMethodRef ref = Scene.v().makeMethodRef(boxedType.getSootClass(), "valueOf", Collections.singletonList<MASK><NEW_LINE>newUnits.add(Jimple.v().newAssignStmt(lhs, Jimple.v().newStaticInvokeExpr(ref, rhs)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(rhsType), boxedType, true);
238,146
public final void initValues() {<NEW_LINE>// NOI18N<NEW_LINE>tDictionary.setText(System.getProperty("user.home"));<NEW_LINE>Set<String> set = Charset.availableCharsets().keySet();<NEW_LINE>cEncoding.setModel(new javax.swing.DefaultComboBoxModel(set.toArray(new String[set<MASK><NEW_LINE>// NOI18N<NEW_LINE>cEncoding.setSelectedItem("ISO-8859-1");<NEW_LINE>// NOI18N<NEW_LINE>tLocale.setText("");<NEW_LINE>// rAllUsers.setEnabled (availHomedir);<NEW_LINE>// rCurrentUser.setEnabled (availUserdir);<NEW_LINE>// if (availHomedir)<NEW_LINE>// rAllUsers.setSelected (true);<NEW_LINE>// else if (availUserdir)<NEW_LINE>// rCurrentUser.setSelected (true);<NEW_LINE>// else {<NEW_LINE>// rAllUsers.setSelected (false);<NEW_LINE>// rCurrentUser.setSelected (false);<NEW_LINE>// }<NEW_LINE>}
.size()])));
1,272,657
public void writeBytes(@NotNull final BytesStore bytes) {<NEW_LINE>throwExceptionIfClosed();<NEW_LINE>checkAppendLock();<NEW_LINE>writeLock.lock();<NEW_LINE>try {<NEW_LINE>int cycle = queue.cycle();<NEW_LINE>if (wire == null)<NEW_LINE>setWireIfNull(cycle);<NEW_LINE>if (this.cycle != cycle)<NEW_LINE>rollCycleTo(cycle);<NEW_LINE>// writeHeader sets wire.byte().writePosition<NEW_LINE>this.positionOfHeader = writeHeader(wire, (int) queue.overlapSize());<NEW_LINE>assert ((AbstractWire) wire).isInsideHeader();<NEW_LINE>beforeAppend(wire, wire.headerNumber() + 1);<NEW_LINE>Bytes<?> wireBytes = wire.bytes();<NEW_LINE>wireBytes.write(bytes);<NEW_LINE>wire.updateHeader(positionOfHeader, false, 0);<NEW_LINE><MASK><NEW_LINE>lastPosition = positionOfHeader;<NEW_LINE>lastCycle = cycle;<NEW_LINE>store.writePosition(positionOfHeader);<NEW_LINE>writeIndexForPosition(lastIndex, positionOfHeader);<NEW_LINE>} catch (StreamCorruptedException e) {<NEW_LINE>throw new AssertionError(e);<NEW_LINE>} finally {<NEW_LINE>writeLock.unlock();<NEW_LINE>}<NEW_LINE>}
lastIndex(wire.headerNumber());
842,013
static TypeSpecDataHolder generateGetEventHandlerMethod(SpecModel specModel, EventDeclarationModel eventDeclaration) {<NEW_LINE>final String scopeMethodName = specModel.getScopeMethodName();<NEW_LINE>final ClassName eventClassName = ClassName.bestGuess(eventDeclaration.getRawName().toString());<NEW_LINE>final List<TypeVariableName> typeVariables;<NEW_LINE>if (eventDeclaration.name instanceof ParameterizedTypeName) {<NEW_LINE>typeVariables = new ArrayList<>();<NEW_LINE>for (TypeName name : ((ParameterizedTypeName) eventDeclaration.name).typeArguments) {<NEW_LINE>typeVariables<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>typeVariables = Collections.emptyList();<NEW_LINE>}<NEW_LINE>return TypeSpecDataHolder.newBuilder().addMethod(MethodSpec.methodBuilder("get" + eventClassName.simpleName() + "Handler").addModifiers(Modifier.PUBLIC, Modifier.STATIC).addAnnotation(ClassNames.NULLABLE).addTypeVariables(typeVariables).returns(ParameterizedTypeName.get(ClassNames.EVENT_HANDLER, eventDeclaration.name)).addParameter(specModel.getContextClass(), "context").addCode(CodeBlock.builder().beginControlFlow("if (context.$L() == null)", scopeMethodName).addStatement("return null").endControlFlow().build()).addStatement("return (($L) context.$L()).$L", specModel.getComponentName(), scopeMethodName, ComponentBodyGenerator.getEventHandlerInstanceName(eventDeclaration)).build()).build();<NEW_LINE>}
.add((TypeVariableName) name);
1,390,183
private org.opendope.xpaths.Xpaths.Xpath createNewXPathObject(String newPath, org.opendope.xpaths.Xpaths.Xpath xpathObj, int index) {<NEW_LINE>// org.opendope.xpaths.Xpaths.Xpath newXPathObj = XmlUtils<NEW_LINE>// .deepCopy(xpathObj);<NEW_LINE>org.opendope.xpaths.Xpaths.Xpath newXPathObj = new org.opendope.xpaths.Xpaths.Xpath();<NEW_LINE>String newXPathId = xpathObj<MASK><NEW_LINE>newXPathObj.setId(newXPathId);<NEW_LINE>org.opendope.xpaths.Xpaths.Xpath.DataBinding dataBinding = new org.opendope.xpaths.Xpaths.Xpath.DataBinding();<NEW_LINE>newXPathObj.setDataBinding(dataBinding);<NEW_LINE>dataBinding.setXpath(newPath);<NEW_LINE>dataBinding.setStoreItemID(xpathObj.getDataBinding().getStoreItemID());<NEW_LINE>dataBinding.setPrefixMappings(xpathObj.getDataBinding().getPrefixMappings());<NEW_LINE>Xpath oldKey = xpathsMap.put(newXPathId, newXPathObj);<NEW_LINE>if (oldKey != null) {<NEW_LINE>if (oldKey.getDataBinding().getXpath().equals(newPath)) {<NEW_LINE>// OK<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("New xpath entry overwrites existing identical xpath " + newXPathId);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// bad<NEW_LINE>log.warn("New xpath entry overwrites existing different xpath " + newXPathId);<NEW_LINE>log.warn("Old: " + oldKey.getDataBinding().getXpath());<NEW_LINE>log.warn("New: " + newPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return newXPathObj;<NEW_LINE>}
.getId() + "_" + index;
156,569
private void sqliteReadString(boolean useTransaction) {<NEW_LINE>long startTime = System.nanoTime();<NEW_LINE>SQLIteKV sqlIteKV = new SQLIteKV(m_context);<NEW_LINE>if (useTransaction) {<NEW_LINE>sqlIteKV.beginTransaction();<NEW_LINE>}<NEW_LINE>for (int index = 0; index < m_loops; index++) {<NEW_LINE>final String key = m_arrKeys[index];<NEW_LINE>final String tmp = sqlIteKV.getString(key);<NEW_LINE>}<NEW_LINE>if (useTransaction) {<NEW_LINE>sqlIteKV.endTransaction();<NEW_LINE>}<NEW_LINE>double endTime = (System.nanoTime() - startTime) / 1000000.0;<NEW_LINE>final <MASK><NEW_LINE>Log.i(TAG, msg + " read String: loop[" + m_loops + "]: " + m_formatter.format(endTime) + " ms");<NEW_LINE>}
String msg = useTransaction ? "sqlite transaction" : "sqlite";
392,102
public StartThingRegistrationTaskResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>StartThingRegistrationTaskResult startThingRegistrationTaskResult = new StartThingRegistrationTaskResult();<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 startThingRegistrationTaskResult;<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("taskId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>startThingRegistrationTaskResult.setTaskId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return startThingRegistrationTaskResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,349,910
public CreateAssociationBatchResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateAssociationBatchResult createAssociationBatchResult = new CreateAssociationBatchResult();<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 createAssociationBatchResult;<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("Successful", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createAssociationBatchResult.setSuccessful(new ListUnmarshaller<AssociationDescription>(AssociationDescriptionJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Failed", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createAssociationBatchResult.setFailed(new ListUnmarshaller<FailedCreateAssociation>(FailedCreateAssociationJsonUnmarshaller.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 createAssociationBatchResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,220,031
public static DescribeCapacityReservationsResponse unmarshall(DescribeCapacityReservationsResponse describeCapacityReservationsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeCapacityReservationsResponse.setRequestId(_ctx.stringValue("DescribeCapacityReservationsResponse.RequestId"));<NEW_LINE>describeCapacityReservationsResponse.setNextToken(_ctx.stringValue("DescribeCapacityReservationsResponse.NextToken"));<NEW_LINE>describeCapacityReservationsResponse.setTotalCount(_ctx.integerValue("DescribeCapacityReservationsResponse.TotalCount"));<NEW_LINE>describeCapacityReservationsResponse.setMaxResults(_ctx.integerValue("DescribeCapacityReservationsResponse.MaxResults"));<NEW_LINE>List<CapacityReservationItem> capacityReservationSet = new ArrayList<CapacityReservationItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeCapacityReservationsResponse.CapacityReservationSet.Length"); i++) {<NEW_LINE>CapacityReservationItem capacityReservationItem = new CapacityReservationItem();<NEW_LINE>capacityReservationItem.setStatus(_ctx.stringValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].Status"));<NEW_LINE>capacityReservationItem.setTimeSlot(_ctx.stringValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].TimeSlot"));<NEW_LINE>capacityReservationItem.setPrivatePoolOptionsMatchCriteria(_ctx.stringValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].PrivatePoolOptionsMatchCriteria"));<NEW_LINE>capacityReservationItem.setPrivatePoolOptionsId(_ctx.stringValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].PrivatePoolOptionsId"));<NEW_LINE>capacityReservationItem.setPrivatePoolOptionsName(_ctx.stringValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].PrivatePoolOptionsName"));<NEW_LINE>capacityReservationItem.setRegionId(_ctx.stringValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].RegionId"));<NEW_LINE>capacityReservationItem.setInstanceChargeType(_ctx.stringValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].InstanceChargeType"));<NEW_LINE>capacityReservationItem.setEndTime(_ctx.stringValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].EndTime"));<NEW_LINE>capacityReservationItem.setStartTime(_ctx.stringValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].StartTime"));<NEW_LINE>capacityReservationItem.setDescription(_ctx.stringValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].Description"));<NEW_LINE>capacityReservationItem.setEndTimeType(_ctx.stringValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].EndTimeType"));<NEW_LINE>capacityReservationItem.setResourceGroupId(_ctx.stringValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].ResourceGroupId"));<NEW_LINE>capacityReservationItem.setPlatform(_ctx.stringValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].Platform"));<NEW_LINE>capacityReservationItem.setStartTimeType(_ctx.stringValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].StartTimeType"));<NEW_LINE>List<AllocatedResource> allocatedResources = new ArrayList<AllocatedResource>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].AllocatedResources.Length"); j++) {<NEW_LINE>AllocatedResource allocatedResource = new AllocatedResource();<NEW_LINE>allocatedResource.setUsedAmount(_ctx.integerValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].AllocatedResources[" + j + "].UsedAmount"));<NEW_LINE>allocatedResource.setTotalAmount(_ctx.integerValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].AllocatedResources[" + j + "].TotalAmount"));<NEW_LINE>allocatedResource.setZoneId(_ctx.stringValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].AllocatedResources[" + j + "].zoneId"));<NEW_LINE>allocatedResource.setInstanceType(_ctx.stringValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].AllocatedResources[" + j + "].InstanceType"));<NEW_LINE>allocatedResources.add(allocatedResource);<NEW_LINE>}<NEW_LINE>capacityReservationItem.setAllocatedResources(allocatedResources);<NEW_LINE>List<Tag> tags <MASK><NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].Tags.Length"); j++) {<NEW_LINE>Tag tag = new Tag();<NEW_LINE>tag.setTagValue(_ctx.stringValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].Tags[" + j + "].TagValue"));<NEW_LINE>tag.setTagKey(_ctx.stringValue("DescribeCapacityReservationsResponse.CapacityReservationSet[" + i + "].Tags[" + j + "].TagKey"));<NEW_LINE>tags.add(tag);<NEW_LINE>}<NEW_LINE>capacityReservationItem.setTags(tags);<NEW_LINE>capacityReservationSet.add(capacityReservationItem);<NEW_LINE>}<NEW_LINE>describeCapacityReservationsResponse.setCapacityReservationSet(capacityReservationSet);<NEW_LINE>return describeCapacityReservationsResponse;<NEW_LINE>}
= new ArrayList<Tag>();
971,513
public void open(Configuration parameters) {<NEW_LINE>List<Long> bcDivisibleIndices = getRuntimeContext().getBroadcastVariable(DIVISIBLE_INDICES);<NEW_LINE>divisibleIndices = new HashSet<>(bcDivisibleIndices);<NEW_LINE>List<Tuple1<IterInfo>> bcIterInfo = getRuntimeContext().getBroadcastVariable(ITER_INFO);<NEW_LINE>shouldUpdateState = bcIterInfo.get(0).f0.atLastInnerIterStep();<NEW_LINE>shouldInitState = getIterationRuntimeContext().getSuperstepNumber() == 1;<NEW_LINE>List<Tuple2<Long, DenseVector>> bcNewClusterCenters = <MASK><NEW_LINE>newClusterCenters = new HashMap<>(0);<NEW_LINE>bcNewClusterCenters.forEach(t -> newClusterCenters.put(t.f0, t.f1));<NEW_LINE>if (distance instanceof EuclideanDistance) {<NEW_LINE>middlePlanes = new HashMap<>(0);<NEW_LINE>divisibleIndices.forEach(parentIndex -> {<NEW_LINE>long lchild = leftChildIndex(parentIndex);<NEW_LINE>long rchild = rightChildIndex(parentIndex);<NEW_LINE>DenseVector m = newClusterCenters.get(rchild).plus(newClusterCenters.get(lchild));<NEW_LINE>DenseVector v = newClusterCenters.get(rchild).minus(newClusterCenters.get(lchild));<NEW_LINE>BLAS.scal(0.5, m);<NEW_LINE>double length = BLAS.dot(m, v);<NEW_LINE>middlePlanes.put(parentIndex, Tuple2.of(v, length));<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (shouldInitState) {<NEW_LINE>assignmentInState = new ArrayList<>();<NEW_LINE>}<NEW_LINE>}
getRuntimeContext().getBroadcastVariable(NEW_CLUSTER_CENTERS);
736,817
public static Exception writeGpx(Writer output, GPXFile file, IProgress progress) {<NEW_LINE>if (progress != null) {<NEW_LINE>progress.startWork(file.getItemsToWriteSize());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>XmlSerializer serializer = PlatformUtil.newSerializer();<NEW_LINE>serializer.setOutput(output);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>serializer.setFeature("http://xmlpull.org/v1/doc/features.html#indent-output", true);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>serializer.startDocument("UTF-8", true);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>serializer.startTag(null, "gpx");<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>serializer.<MASK><NEW_LINE>if (file.author != null) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>serializer.attribute(null, "creator", file.author);<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>serializer.attribute(null, "xmlns", "http://www.topografix.com/GPX/1/1");<NEW_LINE>serializer.attribute(null, "xmlns:osmand", "https://osmand.net");<NEW_LINE>serializer.attribute(null, "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");<NEW_LINE>serializer.attribute(null, "xsi:schemaLocation", "http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd");<NEW_LINE>writeMetadata(serializer, file, progress);<NEW_LINE>writePoints(serializer, file, progress);<NEW_LINE>writeRoutes(serializer, file, progress);<NEW_LINE>writeTracks(serializer, file, progress);<NEW_LINE>writeExtensions(serializer, file, progress);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>serializer.endTag(null, "gpx");<NEW_LINE>serializer.endDocument();<NEW_LINE>serializer.flush();<NEW_LINE>} catch (Exception e) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>log.error("Error saving gpx", e);<NEW_LINE>return e;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
attribute(null, "version", "1.1");
34,339
protected void handleMessage(final Message message) {<NEW_LINE>final MessageData messageData = message.getData();<NEW_LINE>switch(messageData.getCode()) {<NEW_LINE>case IbftV2.PROPOSAL:<NEW_LINE>consumeMessage(message, ProposalMessageData.fromMessageData(messageData).decode(), currentHeightManager::handleProposalPayload);<NEW_LINE>break;<NEW_LINE>case IbftV2.PREPARE:<NEW_LINE>consumeMessage(message, PrepareMessageData.fromMessageData(messageData).decode(), currentHeightManager::handlePreparePayload);<NEW_LINE>break;<NEW_LINE>case IbftV2.COMMIT:<NEW_LINE>consumeMessage(message, CommitMessageData.fromMessageData(messageData).decode(), currentHeightManager::handleCommitPayload);<NEW_LINE>break;<NEW_LINE>case IbftV2.ROUND_CHANGE:<NEW_LINE>consumeMessage(message, RoundChangeMessageData.fromMessageData(messageData).<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException(String.format("Received message with messageCode=%d does not conform to any recognised IBFT message structure", message.getData().getCode()));<NEW_LINE>}<NEW_LINE>}
decode(), currentHeightManager::handleRoundChangePayload);
1,281,203
private void addMaterialRecipes(Consumer<FinishedRecipe> consumer) {<NEW_LINE>String folder = "common/materials/";<NEW_LINE>// ores<NEW_LINE>metalCrafting(consumer, TinkerMaterials.cobalt, folder);<NEW_LINE>// tier 3<NEW_LINE>metalCrafting(consumer, TinkerMaterials.slimesteel, folder);<NEW_LINE>metalCrafting(consumer, TinkerMaterials.amethystBronze, folder);<NEW_LINE>metalCrafting(consumer, TinkerMaterials.roseGold, folder);<NEW_LINE>metalCrafting(consumer, TinkerMaterials.pigIron, folder);<NEW_LINE>// tier 4<NEW_LINE>metalCrafting(<MASK><NEW_LINE>metalCrafting(consumer, TinkerMaterials.manyullyn, folder);<NEW_LINE>metalCrafting(consumer, TinkerMaterials.hepatizon, folder);<NEW_LINE>// registerMineralRecipes(consumer, TinkerMaterials.soulsteel, folder);<NEW_LINE>packingRecipe(consumer, "ingot", Items.COPPER_INGOT, "nugget", TinkerMaterials.copperNugget, TinkerTags.Items.NUGGETS_COPPER, folder);<NEW_LINE>packingRecipe(consumer, "ingot", Items.NETHERITE_INGOT, "nugget", TinkerMaterials.netheriteNugget, TinkerTags.Items.NUGGETS_NETHERITE, folder);<NEW_LINE>// tier 5<NEW_LINE>// registerMineralRecipes(consumer, TinkerMaterials.knightslime, folder);<NEW_LINE>// smelt ore into ingots, must use a blast furnace for nether ores<NEW_LINE>Item cobaltIngot = TinkerMaterials.cobalt.getIngot();<NEW_LINE>SimpleCookingRecipeBuilder.blasting(Ingredient.of(TinkerWorld.rawCobalt, TinkerWorld.cobaltOre), cobaltIngot, 1.5f, 200).unlockedBy("has_item", has(TinkerWorld.rawCobalt)).save(consumer, wrap(cobaltIngot, folder, "_smelting"));<NEW_LINE>// pack raw cobalt<NEW_LINE>packingRecipe(consumer, "raw_block", TinkerWorld.rawCobaltBlock, "raw", TinkerWorld.rawCobalt, TinkerTags.Items.RAW_COBALT, folder);<NEW_LINE>}
consumer, TinkerMaterials.queensSlime, folder);
1,614,073
public Object read() {<NEW_LINE>skipWhitespace();<NEW_LINE>Object o = null;<NEW_LINE>switch(current()) {<NEW_LINE>case '{':<NEW_LINE>o = readObject();<NEW_LINE>break;<NEW_LINE>case '[':<NEW_LINE>o = readArray();<NEW_LINE>break;<NEW_LINE>case '"':<NEW_LINE>case '\'':<NEW_LINE>o = readString();<NEW_LINE>break;<NEW_LINE>case 't':<NEW_LINE>case 'f':<NEW_LINE>o = readBoolean();<NEW_LINE>break;<NEW_LINE>case 'n':<NEW_LINE>o = readNull();<NEW_LINE>break;<NEW_LINE>case -1:<NEW_LINE>throw new EndOfFileException();<NEW_LINE>default:<NEW_LINE>if (Character.isDigit(current()) || current() == '-') {<NEW_LINE>o = readNumber();<NEW_LINE>} else {<NEW_LINE>throw new SerializationException("Unacceptable initial character " + currentChar() + " found when parsing object at line " + getCurrentLineNumber(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>skipWhitespace();<NEW_LINE>return o;<NEW_LINE>}
) + " character " + getCurrentLineOffset());
688,126
public static MOrder copyFrom(MOrder from, Timestamp dateDoc, int C_DocTypeTarget_ID, boolean isSOTrx, boolean counter, boolean copyASI, String trxName) {<NEW_LINE>MOrder to = new MOrder(from.getCtx(), 0, trxName);<NEW_LINE>to.set_TrxName(trxName);<NEW_LINE>PO.copyValues(from, to, from.getAD_Client_ID(), from.getAD_Org_ID());<NEW_LINE>to.set_ValueNoCheck("C_Order_ID", I_ZERO);<NEW_LINE>to.set_ValueNoCheck("DocumentNo", null);<NEW_LINE>//<NEW_LINE>// Draft<NEW_LINE>to.setDocStatus(DOCSTATUS_Drafted);<NEW_LINE>to.setDocAction(DOCACTION_Complete);<NEW_LINE>//<NEW_LINE>to.setC_DocType_ID(0);<NEW_LINE>to.setC_DocTypeTarget_ID(C_DocTypeTarget_ID);<NEW_LINE>to.setIsSOTrx(isSOTrx);<NEW_LINE>to.setC_Opportunity_ID(from.getC_Opportunity_ID());<NEW_LINE>//<NEW_LINE>to.setIsSelected(false);<NEW_LINE>to.setDateOrdered(dateDoc);<NEW_LINE>to.setDateAcct(dateDoc);<NEW_LINE>// assumption<NEW_LINE>to.setDatePromised(dateDoc);<NEW_LINE>to.setDatePrinted(null);<NEW_LINE>to.setIsPrinted(false);<NEW_LINE>//<NEW_LINE>to.setIsApproved(false);<NEW_LINE>to.setIsCreditApproved(false);<NEW_LINE>to.setC_Payment_ID(0);<NEW_LINE>to.setC_CashLine_ID(0);<NEW_LINE>// Amounts are updated when adding lines<NEW_LINE>to.setGrandTotal(Env.ZERO);<NEW_LINE>to.setTotalLines(Env.ZERO);<NEW_LINE>//<NEW_LINE>to.setIsDelivered(false);<NEW_LINE>to.setIsInvoiced(false);<NEW_LINE>to.setIsSelfService(false);<NEW_LINE>to.setIsTransferred(false);<NEW_LINE>to.setPosted(false);<NEW_LINE>to.setProcessed(false);<NEW_LINE>if (counter)<NEW_LINE>to.<MASK><NEW_LINE>else<NEW_LINE>to.setRef_Order_ID(0);<NEW_LINE>//<NEW_LINE>to.saveEx(trxName);<NEW_LINE>if (counter)<NEW_LINE>from.setRef_Order_ID(to.getC_Order_ID());<NEW_LINE>if (to.copyLinesFrom(from, counter, copyASI) == 0)<NEW_LINE>throw new IllegalStateException("Could not create Order Lines");<NEW_LINE>// don't copy linked PO/SO<NEW_LINE>to.setLink_Order_ID(0);<NEW_LINE>return to;<NEW_LINE>}
setRef_Order_ID(from.getC_Order_ID());
50,550
private Set<Inter> checkSlurOnTuplet() {<NEW_LINE>logger.debug("S#{} checkSlurOnTuplet", system.getId());<NEW_LINE>Set<Inter> <MASK><NEW_LINE>final int maxSlurWidth = scale.toPixels(constants.maxTupletSlurWidth);<NEW_LINE>final List<Inter> slurs = sig.inters((Inter inter) -> !inter.isRemoved() && (inter instanceof SlurInter) && (inter.getBounds().width <= maxSlurWidth));<NEW_LINE>final List<Inter> tuplets = sig.inters((Inter inter) -> !inter.isRemoved() && !inter.isImplicit() && (inter instanceof TupletInter) && (inter.isContextuallyGood()));<NEW_LINE>for (Inter slurInter : slurs) {<NEW_LINE>final SlurInter slur = (SlurInter) slurInter;<NEW_LINE>// Look for a tuplet sign embraced<NEW_LINE>final int above = slur.isAbove() ? 1 : (-1);<NEW_LINE>Rectangle box = slur.getBounds();<NEW_LINE>box.translate(0, above * box.height);<NEW_LINE>for (Inter tuplet : tuplets) {<NEW_LINE>if (box.intersects(tuplet.getBounds())) {<NEW_LINE>if (slur.isVip()) {<NEW_LINE>logger.info("VIP deleting tuplet-slur {}", slur);<NEW_LINE>}<NEW_LINE>slur.remove();<NEW_LINE>deleted.add(slur);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return deleted;<NEW_LINE>}
deleted = new LinkedHashSet<>();
85,871
public void handleOutbound(Context ctx) throws ServletException, IOException {<NEW_LINE>Model model = new Model(ctx);<NEW_LINE>Payload payload = ctx.getPayload();<NEW_LINE>normalize(model, payload);<NEW_LINE>StorageReport storageReport = null;<NEW_LINE>StorageReport rawReport = null;<NEW_LINE>switch(payload.getAction()) {<NEW_LINE>case HOURLY_STORAGE:<NEW_LINE>storageReport = queryHourlyReport(payload);<NEW_LINE>model.setOriginalReport(storageReport);<NEW_LINE>rawReport = filterReport(payload, model, storageReport);<NEW_LINE>storageReport = mergeReport(payload, rawReport);<NEW_LINE>model.setReport(storageReport);<NEW_LINE>buildDepartments(payload, model, storageReport);<NEW_LINE>break;<NEW_LINE>case HOURLY_STORAGE_GRAPH:<NEW_LINE>storageReport = queryHourlyReport(payload);<NEW_LINE>rawReport = filterReport(payload, model, storageReport);<NEW_LINE>if (Constants.ALL.equals(payload.getIpAddress())) {<NEW_LINE>buildPieCharts(model, payload, rawReport);<NEW_LINE>}<NEW_LINE>storageReport = mergeReport(payload, rawReport);<NEW_LINE>model.setReport(storageReport);<NEW_LINE>buildLineCharts(model, payload, storageReport);<NEW_LINE>buildDepartments(payload, model, storageReport);<NEW_LINE>break;<NEW_LINE>case HISTORY_STORAGE:<NEW_LINE>storageReport = queryHistoryReport(payload);<NEW_LINE>model.setOriginalReport(storageReport);<NEW_LINE>rawReport = filterReport(payload, model, storageReport);<NEW_LINE>storageReport = mergeReport(payload, rawReport);<NEW_LINE>model.setReport(storageReport);<NEW_LINE>buildDepartments(payload, model, storageReport);<NEW_LINE>break;<NEW_LINE>case DASHBOARD:<NEW_LINE><MASK><NEW_LINE>long time = payload.getDate();<NEW_LINE>long end = time + model.getMinute() * TimeHelper.ONE_MINUTE;<NEW_LINE>Date startDate = new Date(end - (minuteCounts - 1) * TimeHelper.ONE_MINUTE);<NEW_LINE>Date endDate = new Date(end);<NEW_LINE>String type = payload.getType();<NEW_LINE>List<Alert> alerts = m_alertService.query(new Date(startDate.getTime() + TimeHelper.ONE_MINUTE), new Date(endDate.getTime() + TimeHelper.ONE_MINUTE), type);<NEW_LINE>Map<String, StorageAlertInfo> alertInfos = m_alertInfoBuilder.buildStorageAlertInfos(startDate, endDate, minuteCounts, type, alerts);<NEW_LINE>alertInfos = sortAlertInfos(alertInfos);<NEW_LINE>model.setLinks(buildAlertLinks(alertInfos, type));<NEW_LINE>model.setAlertInfos(alertInfos);<NEW_LINE>model.setReportStart(new Date(time));<NEW_LINE>model.setReportEnd(new Date(time + TimeHelper.ONE_HOUR - 1));<NEW_LINE>model.setAlterations(buildAlterations(startDate, endDate, type));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>model.setPage(ReportPage.STORAGE);<NEW_LINE>if (!ctx.isProcessStopped()) {<NEW_LINE>m_jspViewer.view(ctx, model);<NEW_LINE>}<NEW_LINE>}
int minuteCounts = payload.getMinuteCounts();
754,981
public static String makeCsv(String configName) {<NEW_LINE>var wayPropertySet = new WayPropertySet();<NEW_LINE>var <MASK><NEW_LINE>source.populateProperties(wayPropertySet);<NEW_LINE>var buf = new CsvReportBuilder(",");<NEW_LINE>buf.addHeader("OSM tags for osmWayPropertySet " + configName, "mixin", "permissions", "safety penalty there", "safety penalty back");<NEW_LINE>wayPropertySet.getWayProperties().forEach(p -> {<NEW_LINE>buf.addText(p.getSpecifier().toString());<NEW_LINE>buf.addBoolean(p.isSafetyMixin());<NEW_LINE>buf.addText(p.getProperties().getPermission().toString());<NEW_LINE>var safetyProps = p.getProperties().getSafetyFeatures();<NEW_LINE>buf.addNumber(safetyProps.first);<NEW_LINE>buf.addNumber(safetyProps.second);<NEW_LINE>buf.newLine();<NEW_LINE>});<NEW_LINE>return buf.toString();<NEW_LINE>}
source = WayPropertySetSource.fromConfig(configName);
586,320
public synchronized void updateLocation(Location location) {<NEW_LINE>currentLocation = location;<NEW_LINE>if (autoAnnounce && app.accessibilityEnabled()) {<NEW_LINE>final TargetPoint point = app.getTargetPointsHelper().getPointToNavigate();<NEW_LINE>if (point != null) {<NEW_LINE>if ((currentLocation != null) && currentLocation.hasBearing() && !MapViewTrackingUtilities.isSmallSpeedForCompass(currentLocation)) {<NEW_LINE>final long now = SystemClock.uptimeMillis();<NEW_LINE>if ((now - lastNotificationTime) >= settings.ACCESSIBILITY_AUTOANNOUNCE_PERIOD.get()) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE><MASK><NEW_LINE>destination.setLatitude(point.getLatitude());<NEW_LINE>destination.setLongitude(point.getLongitude());<NEW_LINE>if (lastDirection.update(destination) || !settings.ACCESSIBILITY_SMART_AUTOANNOUNCE.get()) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>final String notification = distanceString(destination) + " " + lastDirection.getString();<NEW_LINE>lastNotificationTime = now;<NEW_LINE>app.runInUIThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>app.showToastMessage(notification);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>lastDirection.clear();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Location destination = new Location("map");
1,510,187
public void marshall(Decision decision, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (decision == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(decision.getDecisionType(), DECISIONTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(decision.getScheduleActivityTaskDecisionAttributes(), SCHEDULEACTIVITYTASKDECISIONATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(decision.getRequestCancelActivityTaskDecisionAttributes(), REQUESTCANCELACTIVITYTASKDECISIONATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(decision.getCompleteWorkflowExecutionDecisionAttributes(), COMPLETEWORKFLOWEXECUTIONDECISIONATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(decision.getFailWorkflowExecutionDecisionAttributes(), FAILWORKFLOWEXECUTIONDECISIONATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(decision.getCancelWorkflowExecutionDecisionAttributes(), CANCELWORKFLOWEXECUTIONDECISIONATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(decision.getContinueAsNewWorkflowExecutionDecisionAttributes(), CONTINUEASNEWWORKFLOWEXECUTIONDECISIONATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(decision.getRecordMarkerDecisionAttributes(), RECORDMARKERDECISIONATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(decision.getStartTimerDecisionAttributes(), STARTTIMERDECISIONATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(decision.getCancelTimerDecisionAttributes(), CANCELTIMERDECISIONATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(decision.getSignalExternalWorkflowExecutionDecisionAttributes(), SIGNALEXTERNALWORKFLOWEXECUTIONDECISIONATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(decision.getRequestCancelExternalWorkflowExecutionDecisionAttributes(), REQUESTCANCELEXTERNALWORKFLOWEXECUTIONDECISIONATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(decision.getStartChildWorkflowExecutionDecisionAttributes(), STARTCHILDWORKFLOWEXECUTIONDECISIONATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
decision.getScheduleLambdaFunctionDecisionAttributes(), SCHEDULELAMBDAFUNCTIONDECISIONATTRIBUTES_BINDING);
508,850
public void addDesktopSharingComponents() {<NEW_LINE>OperationSetDesktopSharingServer opSetDesktopSharingServer = callPeer.getProtocolProvider().getOperationSet(OperationSetDesktopSharingServer.class);<NEW_LINE>if (opSetDesktopSharingServer != null && opSetDesktopSharingServer.isRemoteControlAvailable(callPeer)) {<NEW_LINE>if (logger.isTraceEnabled())<NEW_LINE>logger.trace("Add desktop sharing related components.");<NEW_LINE>if (enableDesktopRemoteControl == null) {<NEW_LINE>enableDesktopRemoteControl = new JCheckBox(GuiActivator.getResources().getI18NString("service.gui.ENABLE_DESKTOP_REMOTE_CONTROL"));<NEW_LINE>southPanel = new TransparentPanel(new FlowLayout(FlowLayout.CENTER));<NEW_LINE>southPanel.add(enableDesktopRemoteControl);<NEW_LINE>enableDesktopRemoteControl.setAlignmentX(CENTER_ALIGNMENT);<NEW_LINE>enableDesktopRemoteControl.setOpaque(false);<NEW_LINE>enableDesktopRemoteControl.addItemListener(new ItemListener() {<NEW_LINE><NEW_LINE>public void itemStateChanged(ItemEvent e) {<NEW_LINE>CallManager.enableDesktopRemoteControl(callPeer, e.getStateChange() == ItemEvent.SELECTED);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (OSUtils.IS_MAC) {<NEW_LINE>southPanel.setOpaque(true);<NEW_LINE>southPanel.setBackground(new Color(GuiActivator.getResources(<MASK><NEW_LINE>}<NEW_LINE>add(southPanel, BorderLayout.SOUTH);<NEW_LINE>}<NEW_LINE>revalidate();<NEW_LINE>repaint();<NEW_LINE>}
).getColor("service.gui.MAC_PANEL_BACKGROUND")));
871,754
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>Permanent permanent = game.getPermanent(source.getFirstTarget());<NEW_LINE>if (controller != null && permanent != null) {<NEW_LINE>Player player = game.getPlayer(permanent.getControllerId());<NEW_LINE>// if the zone change to exile gets replaced does not prevent the target controller to be able to search<NEW_LINE>controller.moveCardToExileWithInfo(permanent, null, "", source, game, Zone.BATTLEFIELD, true);<NEW_LINE>if (player.chooseUse(Outcome.PutCardInPlay, "Search your library for a basic land card?", source, game)) {<NEW_LINE>TargetCardInLibrary target = new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND);<NEW_LINE>if (player.searchLibrary(target, source, game)) {<NEW_LINE>Card card = player.getLibrary().getCard(<MASK><NEW_LINE>if (card != null) {<NEW_LINE>player.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>player.shuffleLibrary(source, game);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
target.getFirstTarget(), game);
1,559,945
// TODO Recursion to same type will result in endless loop<NEW_LINE>public SServiceType createSServiceType(SClass sClass, boolean recurse) throws UserException, ServerException {<NEW_LINE>if (sClass == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SServiceType sServiceType = new SServiceType();<NEW_LINE>sServiceType.setName(sClass.getName());<NEW_LINE>sServiceType.<MASK><NEW_LINE>sServiceType.setSimpleType(SServiceSimpleType.valueOf(sClass.getSimpleType().name()));<NEW_LINE>for (SField field : sClass.getOwnFields()) {<NEW_LINE>SServiceField sServiceField = new SServiceField();<NEW_LINE>sServiceField.setName(field.getName());<NEW_LINE>if (recurse) {<NEW_LINE>sServiceField.setType(createSServiceType(field.getType(), recurse));<NEW_LINE>sServiceField.setGenericType(createSServiceType(field.getGenericType(), recurse));<NEW_LINE>}<NEW_LINE>sServiceField.setDoc(field.getDoc());<NEW_LINE>sServiceType.getFields().add(sServiceField);<NEW_LINE>}<NEW_LINE>return sServiceType;<NEW_LINE>}
setSimpleName(sClass.getSimpleName());
587,140
protected void encodeHiddenInput(FacesContext context, InputNumber inputNumber, String clientId, String valueToRender) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String inputId = clientId + "_hinput";<NEW_LINE>writer.startElement("input", null);<NEW_LINE>writer.writeAttribute("id", inputId, null);<NEW_LINE>writer.writeAttribute("name", inputId, null);<NEW_LINE>writer.writeAttribute("type", "hidden", null);<NEW_LINE>writer.writeAttribute("autocomplete", "off", null);<NEW_LINE>writer.<MASK><NEW_LINE>if (inputNumber.getOnchange() != null) {<NEW_LINE>writer.writeAttribute("onchange", inputNumber.getOnchange(), null);<NEW_LINE>}<NEW_LINE>if (inputNumber.getOnkeydown() != null) {<NEW_LINE>writer.writeAttribute("onkeydown", inputNumber.getOnkeydown(), null);<NEW_LINE>}<NEW_LINE>if (inputNumber.getOnkeyup() != null) {<NEW_LINE>writer.writeAttribute("onkeyup", inputNumber.getOnkeyup(), null);<NEW_LINE>}<NEW_LINE>renderValidationMetadata(context, inputNumber);<NEW_LINE>writer.endElement("input");<NEW_LINE>}
writeAttribute("value", valueToRender, null);
1,460,564
public okhttp3.Call readNamespacedPodDisruptionBudgetCall(String name, String namespace, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())).replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, <MASK><NEW_LINE>}
localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
1,838,808
public void drawTo(Graphic graphic, Style heighLight) {<NEW_LINE>if (graphic.isFlagSet(Graphic.Flag.smallIO)) {<NEW_LINE>Vector center = new Vector(-LATEX_RAD.x, 0);<NEW_LINE>graphic.drawCircle(center.sub(LATEX_RAD), center.add(LATEX_RAD), Style.NORMAL);<NEW_LINE>Vector textPos = new Vector(-SIZE2 - LATEX_RAD.x, 0);<NEW_LINE>graphic.drawText(textPos, label, Orientation.RIGHTCENTER, Style.INOUT);<NEW_LINE>} else {<NEW_LINE>int <MASK><NEW_LINE>Style style = OutputShape.getOutStyle(small);<NEW_LINE>final Polygon box = new Polygon(true).add(-outSize * 2 - 1, -outSize).add(-1, -outSize).add(-1, outSize).add(-outSize * 2 - 1, outSize);<NEW_LINE>if (value != null) {<NEW_LINE>style = Style.getWireStyle(value);<NEW_LINE>if (value.getBits() > 1) {<NEW_LINE>Value v = value;<NEW_LINE>if (inValue != null)<NEW_LINE>v = inValue;<NEW_LINE>Vector textPos = new Vector(-1 - outSize, -4 - outSize);<NEW_LINE>graphic.drawText(textPos, formatter.formatToView(v), Orientation.CENTERBOTTOM, Style.NORMAL);<NEW_LINE>} else {<NEW_LINE>if (inValue != null && !inValue.isEqual(value))<NEW_LINE>graphic.drawPolygon(box, Style.getWireStyle(inValue));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>graphic.drawPolygon(box, Style.NORMAL);<NEW_LINE>Vector center = new Vector(-1 - outSize, 0);<NEW_LINE>Vector rad = OutputShape.getOutRad(small);<NEW_LINE>graphic.drawCircle(center.sub(rad), center.add(rad), style);<NEW_LINE>Vector textPos = new Vector(-outSize * 3, 0);<NEW_LINE>graphic.drawText(textPos, label, Orientation.RIGHTCENTER, Style.INOUT);<NEW_LINE>}<NEW_LINE>}
outSize = OutputShape.getOutSize(small);
83,564
final CreateDataCatalogResult executeCreateDataCatalog(CreateDataCatalogRequest createDataCatalogRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createDataCatalogRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateDataCatalogRequest> request = null;<NEW_LINE>Response<CreateDataCatalogResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateDataCatalogRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createDataCatalogRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Athena");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateDataCatalog");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateDataCatalogResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateDataCatalogResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,477,772
private static <T> boolean intersects(T[] firstSortedArr, T[] secondSortedArr, Comparator<? super T> comparator) {<NEW_LINE>for (int i = 0, l = firstSortedArr.length, j = 0, k = secondSortedArr.length; i < l && j < k; ) {<NEW_LINE>T firstElement = firstSortedArr[i];<NEW_LINE>T secondElement = secondSortedArr[j];<NEW_LINE>int compare = comparator.compare(firstElement, secondElement);<NEW_LINE>if (compare == 0) {<NEW_LINE>return true;<NEW_LINE>} else if (compare < 0) {<NEW_LINE>i++;<NEW_LINE>if (l - i > SortedCharArrays.BINARY_SEARCH_THRESHOLD) {<NEW_LINE>i = Arrays.binarySearch(firstSortedArr, i, l, secondElement, comparator);<NEW_LINE>if (i >= 0) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>i = -(i + 1);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>j++;<NEW_LINE>if (k - j > SortedCharArrays.BINARY_SEARCH_THRESHOLD) {<NEW_LINE>j = Arrays.binarySearch(secondSortedArr, <MASK><NEW_LINE>if (j >= 0) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>j = -(j + 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
j, k, firstElement, comparator);
193,941
protected void buildActionMapping() {<NEW_LINE>mapping.clear();<NEW_LINE>Class<?> dc;<NEW_LINE>InterceptorManager interMan = InterceptorManager.me();<NEW_LINE>for (Routes routes : getRoutesList()) {<NEW_LINE>for (Route route : routes.getRouteItemList()) {<NEW_LINE>Class<? extends Controller> controllerClass = route.getControllerClass();<NEW_LINE>Interceptor[] controllerInters = interMan.createControllerInterceptor(controllerClass);<NEW_LINE>boolean declaredMethods = routes.getMappingSuperClass() ? controllerClass.getSuperclass() == Controller.class : true;<NEW_LINE>Method[] methods = (declaredMethods ? controllerClass.getDeclaredMethods(<MASK><NEW_LINE>for (Method method : methods) {<NEW_LINE>if (declaredMethods) {<NEW_LINE>if (!Modifier.isPublic(method.getModifiers()))<NEW_LINE>continue;<NEW_LINE>} else {<NEW_LINE>dc = method.getDeclaringClass();<NEW_LINE>if (dc == Controller.class || dc == Object.class)<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (method.getAnnotation(NotAction.class) != null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Interceptor[] actionInters = interMan.buildControllerActionInterceptor(routes.getInterceptors(), controllerInters, controllerClass, method);<NEW_LINE>String controllerPath = route.getControllerPath();<NEW_LINE>String methodName = method.getName();<NEW_LINE>ActionKey ak = method.getAnnotation(ActionKey.class);<NEW_LINE>String actionKey;<NEW_LINE>if (ak != null) {<NEW_LINE>actionKey = ak.value().trim();<NEW_LINE>if ("".equals(actionKey))<NEW_LINE>throw new IllegalArgumentException(controllerClass.getName() + "." + methodName + "(): The argument of ActionKey can not be blank.");<NEW_LINE>if (!actionKey.startsWith(SLASH))<NEW_LINE>actionKey = SLASH + actionKey;<NEW_LINE>} else if (methodName.equals("index")) {<NEW_LINE>actionKey = controllerPath;<NEW_LINE>} else {<NEW_LINE>actionKey = controllerPath.equals(SLASH) ? SLASH + methodName : controllerPath + SLASH + methodName;<NEW_LINE>}<NEW_LINE>Action action = new Action(controllerPath, actionKey, controllerClass, method, methodName, actionInters, route.getFinalViewPath(routes.getBaseViewPath()));<NEW_LINE>if (mapping.put(actionKey, action) != null) {<NEW_LINE>throw new RuntimeException(buildMsg(actionKey, controllerClass, method));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>routes.clear();<NEW_LINE>// support url = controllerPath + urlParas with "/" of controllerPath<NEW_LINE>Action action = mapping.get("/");<NEW_LINE>if (action != null) {<NEW_LINE>mapping.put("", action);<NEW_LINE>}<NEW_LINE>}
) : controllerClass.getMethods());
117,532
private static <K, InputT, AccumT, OutputT> DoFnInfo<?, ?> createDoFnInfo(AppliedCombineFn<K, InputT, AccumT, OutputT> combineFn, SideInputReader sideInputReader) {<NEW_LINE>GlobalCombineFnRunner<InputT, AccumT, OutputT> combineFnRunner = GlobalCombineFnRunners.create(combineFn.getFn());<NEW_LINE>DoFn<KV<K, Iterable<InputT>>, KV<K, OutputT>> doFn = new CombineValuesDoFn<>(combineFnRunner, sideInputReader);<NEW_LINE>Coder<KV<K, Iterable<MASK><NEW_LINE>if (combineFn.getKvCoder() != null) {<NEW_LINE>inputCoder = KvCoder.of(combineFn.getKvCoder().getKeyCoder(), IterableCoder.of(combineFn.getKvCoder().getValueCoder()));<NEW_LINE>}<NEW_LINE>return // Not needed here.<NEW_LINE>DoFnInfo.// Not needed here.<NEW_LINE>forFn(// Not needed here.<NEW_LINE>doFn, // Not needed here.<NEW_LINE>combineFn.getWindowingStrategy(), // Not needed here.<NEW_LINE>combineFn.getSideInputViews(), // Not needed here.<NEW_LINE>inputCoder, Collections.emptyMap(), new TupleTag<>(PropertyNames.OUTPUT), DoFnSchemaInformation.create(), Collections.emptyMap());<NEW_LINE>}
<InputT>>> inputCoder = null;
1,517,691
final EventSubscription executeModifyEventSubscription(ModifyEventSubscriptionRequest modifyEventSubscriptionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyEventSubscriptionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyEventSubscriptionRequest> request = null;<NEW_LINE>Response<EventSubscription> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifyEventSubscriptionRequestMarshaller().marshall<MASK><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, "Neptune");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyEventSubscription");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<EventSubscription> responseHandler = new StaxResponseHandler<EventSubscription>(new EventSubscriptionStaxUnmarshaller());<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>}
(super.beforeMarshalling(modifyEventSubscriptionRequest));
1,728,431
public Clustering<Model> run(Relation<? extends NumberVector> relation) {<NEW_LINE>// current dimensionality associated with each seed<NEW_LINE>int dim_c = RelationUtil.dimensionality(relation);<NEW_LINE>if (dim_c < l) {<NEW_LINE>throw new IllegalStateException("Dimensionality of data < parameter l! " + "(" + <MASK><NEW_LINE>}<NEW_LINE>// current number of seeds<NEW_LINE>int k_c = Math.min(relation.size(), k_i * k);<NEW_LINE>// pick k0 > k points from the database<NEW_LINE>List<ORCLUSCluster> clusters = initialSeeds(relation, k_c);<NEW_LINE>double beta = FastMath.exp(-FastMath.log(dim_c / (double) l) * FastMath.log(1 / alpha) / FastMath.log(k_c / (double) k));<NEW_LINE>IndefiniteProgress cprogress = LOG.isVerbose() ? new IndefiniteProgress("Current number of clusters:", LOG) : null;<NEW_LINE>while (k_c > k) {<NEW_LINE>// find partitioning induced by the seeds of the clusters<NEW_LINE>assign(relation, clusters);<NEW_LINE>// determine current subspace associated with each cluster<NEW_LINE>for (ORCLUSCluster cluster : clusters) {<NEW_LINE>if (cluster.objectIDs.size() > 0) {<NEW_LINE>cluster.basis = findBasis(relation, cluster, dim_c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// reduce number of seeds and dimensionality associated with<NEW_LINE>// each seed<NEW_LINE>k_c = (int) Math.max(k, k_c * alpha);<NEW_LINE>dim_c = (int) Math.max(l, dim_c * beta);<NEW_LINE>merge(relation, clusters, k_c, dim_c, cprogress);<NEW_LINE>if (cprogress != null) {<NEW_LINE>cprogress.setProcessed(clusters.size(), LOG);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assign(relation, clusters);<NEW_LINE>LOG.setCompleted(cprogress);<NEW_LINE>// get the result<NEW_LINE>Clustering<Model> result = new Clustering<>();<NEW_LINE>Metadata.of(result).setLongName("ORCLUS Clustering");<NEW_LINE>for (ORCLUSCluster c : clusters) {<NEW_LINE>result.addToplevelCluster(new Cluster<Model>(c.objectIDs, ClusterModel.CLUSTER));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
dim_c + " < " + l + ")");
1,055,560
public void levelOrderInput() {<NEW_LINE>LinkedList<Integer> inputData = new LinkedList<>();<NEW_LINE>LinkedList<Node> nodes = new LinkedList<>();<NEW_LINE>Node root = new Node();<NEW_LINE><MASK><NEW_LINE>root.data = data;<NEW_LINE>nodes.addLast(root);<NEW_LINE>int flag = 1;<NEW_LINE>int total = 1;<NEW_LINE>while (flag <= total) {<NEW_LINE>data = scan.nextInt();<NEW_LINE>inputData.addLast(data);<NEW_LINE>if (data != -1)<NEW_LINE>total += 1;<NEW_LINE>data = scan.nextInt();<NEW_LINE>inputData.addLast(data);<NEW_LINE>if (data != -1)<NEW_LINE>total += 1;<NEW_LINE>Node pos = nodes.removeFirst();<NEW_LINE>Node lchild = new Node();<NEW_LINE>Node rchild = new Node();<NEW_LINE>int ldata = inputData.removeFirst();<NEW_LINE>int rdata = inputData.removeFirst();<NEW_LINE>if (ldata == -1)<NEW_LINE>lchild = null;<NEW_LINE>else<NEW_LINE>lchild.data = ldata;<NEW_LINE>if (rdata == -1)<NEW_LINE>rchild = null;<NEW_LINE>else<NEW_LINE>rchild.data = rdata;<NEW_LINE>pos.left = lchild;<NEW_LINE>pos.right = rchild;<NEW_LINE>if (lchild != null)<NEW_LINE>nodes.addLast(lchild);<NEW_LINE>if (rchild != null)<NEW_LINE>nodes.addLast(rchild);<NEW_LINE>flag++;<NEW_LINE>}<NEW_LINE>this.root = root;<NEW_LINE>}
int data = scan.nextInt();
1,159,525
protected boolean areAllModuleOptionsEqual(ClasspathLocation other) {<NEW_LINE>if (this.patchModuleName != null) {<NEW_LINE>if (other.patchModuleName == null)<NEW_LINE>return false;<NEW_LINE>if (!this.patchModuleName.equals(other.patchModuleName))<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>if (other.patchModuleName != null)<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (this.limitModuleNames != null) {<NEW_LINE>if (other.limitModuleNames == null)<NEW_LINE>return false;<NEW_LINE>if (other.limitModuleNames.size() != this.limitModuleNames.size())<NEW_LINE>return false;<NEW_LINE>if (!this.limitModuleNames.containsAll(other.limitModuleNames))<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>if (other.limitModuleNames != null)<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (this.updates != null) {<NEW_LINE>if (other.updates == null)<NEW_LINE>return false;<NEW_LINE>List<Consumer<IUpdatableModule>> packageUpdates = this.updates.getList(UpdateKind.PACKAGE, false);<NEW_LINE>List<Consumer<IUpdatableModule>> otherPackageUpdates = other.updates.getList(UpdateKind.PACKAGE, false);<NEW_LINE>if (packageUpdates != null) {<NEW_LINE>if (otherPackageUpdates == null)<NEW_LINE>return false;<NEW_LINE>if (packageUpdates.size() != otherPackageUpdates.size())<NEW_LINE>return false;<NEW_LINE>if (!packageUpdates.containsAll(otherPackageUpdates))<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>if (otherPackageUpdates != null)<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>List<Consumer<IUpdatableModule>> moduleUpdates = this.updates.<MASK><NEW_LINE>List<Consumer<IUpdatableModule>> otherModuleUpdates = other.updates.getList(UpdateKind.MODULE, false);<NEW_LINE>if (moduleUpdates != null) {<NEW_LINE>if (otherModuleUpdates == null)<NEW_LINE>return false;<NEW_LINE>if (moduleUpdates.size() != otherModuleUpdates.size())<NEW_LINE>return false;<NEW_LINE>if (!moduleUpdates.containsAll(otherModuleUpdates))<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>if (otherModuleUpdates != null)<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (other.updates != null)<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
getList(UpdateKind.MODULE, false);
380,639
public Map<String, Object> buildHiveReader() {<NEW_LINE>DataxHivePojo dataxHivePojo = new DataxHivePojo();<NEW_LINE>dataxHivePojo.setJdbcDatasource(readerDatasource);<NEW_LINE>List<Map<String, Object>> columns = Lists.newArrayList();<NEW_LINE>readerColumns.forEach(c -> {<NEW_LINE>Map<String, Object<MASK><NEW_LINE>column.put("index", c.split(Constants.SPLIT_SCOLON)[0]);<NEW_LINE>column.put("type", c.split(Constants.SPLIT_SCOLON)[2]);<NEW_LINE>columns.add(column);<NEW_LINE>});<NEW_LINE>dataxHivePojo.setColumns(columns);<NEW_LINE>dataxHivePojo.setReaderDefaultFS(hiveReaderDto.getReaderDefaultFS());<NEW_LINE>dataxHivePojo.setReaderFieldDelimiter(hiveReaderDto.getReaderFieldDelimiter());<NEW_LINE>dataxHivePojo.setReaderFileType(hiveReaderDto.getReaderFileType());<NEW_LINE>dataxHivePojo.setReaderPath(hiveReaderDto.getReaderPath());<NEW_LINE>dataxHivePojo.setSkipHeader(hiveReaderDto.getReaderSkipHeader());<NEW_LINE>return readerPlugin.buildHive(dataxHivePojo);<NEW_LINE>}
> column = Maps.newLinkedHashMap();
583,323
final CreateContactFlowModuleResult executeCreateContactFlowModule(CreateContactFlowModuleRequest createContactFlowModuleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createContactFlowModuleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateContactFlowModuleRequest> request = null;<NEW_LINE>Response<CreateContactFlowModuleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateContactFlowModuleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createContactFlowModuleRequest));<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, "Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateContactFlowModule");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateContactFlowModuleResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateContactFlowModuleResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
93,987
// Identity link related history<NEW_LINE>@Override<NEW_LINE>public void recordIdentityLinkCreated(IdentityLinkEntity identityLink) {<NEW_LINE>// It makes no sense storing historic counterpart for an identity link that is related<NEW_LINE>// to a process definition only as this is never kept in history<NEW_LINE>if (getHistoryConfigurationSettings().isHistoryEnabledForIdentityLink(identityLink) && (identityLink.getProcessInstanceId() != null || identityLink.getTaskId() != null)) {<NEW_LINE>HistoricIdentityLinkService historicIdentityLinkService = processEngineConfiguration.getIdentityLinkServiceConfiguration().getHistoricIdentityLinkService();<NEW_LINE>HistoricIdentityLinkEntity historicIdentityLinkEntity = historicIdentityLinkService.createHistoricIdentityLink();<NEW_LINE>historicIdentityLinkEntity.<MASK><NEW_LINE>historicIdentityLinkEntity.setGroupId(identityLink.getGroupId());<NEW_LINE>historicIdentityLinkEntity.setProcessInstanceId(identityLink.getProcessInstanceId());<NEW_LINE>historicIdentityLinkEntity.setTaskId(identityLink.getTaskId());<NEW_LINE>historicIdentityLinkEntity.setType(identityLink.getType());<NEW_LINE>historicIdentityLinkEntity.setUserId(identityLink.getUserId());<NEW_LINE>historicIdentityLinkService.insertHistoricIdentityLink(historicIdentityLinkEntity, false);<NEW_LINE>}<NEW_LINE>}
setId(identityLink.getId());
581,986
private void loadNode515() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ServerConfiguration_CertificateGroups_DefaultUserTokenGroup_TrustList_CloseAndUpdate_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.ServerConfiguration_CertificateGroups_DefaultUserTokenGroup_TrustList_CloseAndUpdate_OutputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfiguration_CertificateGroups_DefaultUserTokenGroup_TrustList_CloseAndUpdate_OutputArguments, Identifiers.HasProperty, Identifiers.ServerConfiguration_CertificateGroups_DefaultUserTokenGroup_TrustList_CloseAndUpdate.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>ApplyChangesRequired</Name><DataType><Identifier>i=1</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()).<MASK><NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
setInput(new StringReader(xml));
1,685,151
public ApiResponse<RecycleBinContents> recycleBinGetRecycleBinContentsWithHttpInfo(Integer pageIndex, Integer pageSize, String sortExpression) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'pageIndex' is set<NEW_LINE>if (pageIndex == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'pageIndex' when calling recycleBinGetRecycleBinContents");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'pageSize' is set<NEW_LINE>if (pageSize == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'pageSize' when calling recycleBinGetRecycleBinContents");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/recyclebin";<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs<MASK><NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "pageSize", pageSize));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "sortExpression", sortExpression));<NEW_LINE>final String[] localVarAccepts = { "application/json", "text/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<RecycleBinContents> localVarReturnType = new GenericType<RecycleBinContents>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
("", "pageIndex", pageIndex));
447,521
public void innerComplete(InnerSubscriber<R> sender) {<NEW_LINE>sender.setDone();<NEW_LINE>if (get() == 0 && compareAndSet(0, 1)) {<NEW_LINE>Queue<R<MASK><NEW_LINE>if (innerQueue == null || innerQueue.isEmpty()) {<NEW_LINE>subscribers.remove(sender);<NEW_LINE>boolean done = upstreamDone;<NEW_LINE>Queue<InnerSubscriber<R>> mainQueue = queue.get();<NEW_LINE>boolean mainQueueEmpty = mainQueue == null || mainQueue.isEmpty();<NEW_LINE>boolean noMoreSubscribers = subscribers.isEmpty();<NEW_LINE>if (done && mainQueueEmpty && noMoreSubscribers) {<NEW_LINE>Throwable ex = errors.get();<NEW_LINE>if (ex == null) {<NEW_LINE>downstream.onComplete();<NEW_LINE>} else {<NEW_LINE>downstream.onError(ex);<NEW_LINE>}<NEW_LINE>canceled = true;<NEW_LINE>} else {<NEW_LINE>if (!done) {<NEW_LINE>upstream.request(1L);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>getOrCreateQueue().offer(sender);<NEW_LINE>}<NEW_LINE>if (decrementAndGet() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>getOrCreateQueue().offer(sender);<NEW_LINE>if (getAndIncrement() != 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>drainLoop();<NEW_LINE>}
> innerQueue = sender.getQueue();
621,095
public void load(PolicyMappings policyMappings) {<NEW_LINE>ASN1Sequence policyMappingsSeq = (ASN1Sequence) policyMappings.toASN1Primitive();<NEW_LINE>// convert and sort<NEW_LINE>ASN1Encodable[] asn1EncArray = policyMappingsSeq.toArray();<NEW_LINE>PolicyMapping[] policyMappingsArray <MASK><NEW_LINE>for (int i = 0; i < asn1EncArray.length; i++) {<NEW_LINE>policyMappingsArray[i] = PolicyMapping.getInstance(asn1EncArray[i]);<NEW_LINE>}<NEW_LINE>Arrays.sort(policyMappingsArray, new IssuerDomainPolicyComparator());<NEW_LINE>data = new Object[policyMappingsArray.length][2];<NEW_LINE>int i = 0;<NEW_LINE>for (PolicyMapping policyMapping : policyMappingsArray) {<NEW_LINE>data[i][0] = policyMapping;<NEW_LINE>data[i][1] = policyMapping;<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>fireTableDataChanged();<NEW_LINE>}
= new PolicyMapping[asn1EncArray.length];
608,033
public void addParent(MProductBOM bom, DefaultMutableTreeNode parent) {<NEW_LINE>MProduct M_Product = MProduct.get(getCtx(), bom.getM_Product_ID());<NEW_LINE>Vector<Object> line = new Vector<Object>(17);<NEW_LINE>// 0 Select<NEW_LINE>line.add(new Boolean(false));<NEW_LINE>// 1 IsActive<NEW_LINE>line.add(new Boolean(M_Product.isActive()));<NEW_LINE>// 2 Line<NEW_LINE>line.add(new Integer(bom.getLine()));<NEW_LINE>KeyNamePair pp = new KeyNamePair(M_Product.getM_Product_ID(), M_Product.getValue().concat("_").concat(M_Product.getName()));<NEW_LINE>// 3 M_Product_ID<NEW_LINE>line.add(pp);<NEW_LINE>MUOM u = new MUOM(M_Product.getCtx(), M_Product.getC_UOM_ID(), M_Product.get_TrxName());<NEW_LINE>KeyNamePair uom = new KeyNamePair(M_Product.getC_UOM_ID(<MASK><NEW_LINE>// 6 C_UOM_ID<NEW_LINE>line.add(uom);<NEW_LINE>// 9 QtyBOM<NEW_LINE>line.add((BigDecimal) ((bom.getBOMQty() != null) ? bom.getBOMQty() : new BigDecimal(0)));<NEW_LINE>dataBOM.add(line);<NEW_LINE>DefaultMutableTreeNode child = new DefaultMutableTreeNode(line);<NEW_LINE>parent.add(child);<NEW_LINE>if (reload)<NEW_LINE>return;<NEW_LINE>for (MProductBOM bomline : getParentBOMs(bom.getM_Product_ID())) {<NEW_LINE>addParent(bomline, child);<NEW_LINE>}<NEW_LINE>// dataBOM.add(line);<NEW_LINE>}
), u.getUOMSymbol());
1,207,042
public static void init(GameContainer container, StateBasedGame game) {<NEW_LINE>input = container.getInput();<NEW_LINE>int width = container.getWidth();<NEW_LINE>int height = container.getHeight();<NEW_LINE>// game settings<NEW_LINE>container.setTargetFrameRate(Options.getTargetFPS());<NEW_LINE>container.setVSync(Options.getTargetFPS() == 60);<NEW_LINE>container.setMusicVolume(Options.getMusicVolume() * Options.getMasterVolume());<NEW_LINE>container.setShowFPS(false);<NEW_LINE>container.getInput().enableKeyRepeat();<NEW_LINE>container.setAlwaysRender(true);<NEW_LINE>container.setUpdateOnlyWhenVisible(false);<NEW_LINE>// record OpenGL version<NEW_LINE>ErrorHandler.setGlString();<NEW_LINE>// calculate UI scale<NEW_LINE>GameImage.init(width, height);<NEW_LINE>// create fonts<NEW_LINE>try {<NEW_LINE>Fonts.init();<NEW_LINE>} catch (Exception e) {<NEW_LINE>ErrorHandler.error("Failed to load fonts.", e, true);<NEW_LINE>}<NEW_LINE>// load skin<NEW_LINE>Options.loadSkin();<NEW_LINE>// initialize game images<NEW_LINE>for (GameImage img : GameImage.values()) {<NEW_LINE>if (img.isPreload())<NEW_LINE>img.setDefaultImage();<NEW_LINE>}<NEW_LINE>// initialize game mods<NEW_LINE>GameMod.init(width, height);<NEW_LINE>// initialize playback buttons<NEW_LINE>PlaybackSpeed.init(width, height);<NEW_LINE>// initialize hit objects<NEW_LINE>HitObject.init(width, height);<NEW_LINE>// initialize download nodes<NEW_LINE><MASK><NEW_LINE>// initialize UI components<NEW_LINE>UI.init(container, game);<NEW_LINE>// build user list<NEW_LINE>UserList.create();<NEW_LINE>// initialize user button<NEW_LINE>UserButton.init(width, height);<NEW_LINE>// warn about software mode<NEW_LINE>if (((Container) container).isSoftwareMode()) {<NEW_LINE>UI.getNotificationManager().sendNotification("WARNING:\n" + "Running in OpenGL software mode.\n" + "You may experience severely degraded performance.\n\n" + "This can usually be resolved by updating your graphics drivers.", Color.red);<NEW_LINE>}<NEW_LINE>}
DownloadNode.init(width, height);
1,449,812
public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException {<NEW_LINE>final AttributedList<ch.cyberduck.core.Path> paths = new AttributedList<>();<NEW_LINE>try (DirectoryStream<java.nio.file.Path> stream = Files.newDirectoryStream(session.toPath(directory))) {<NEW_LINE>final Class<? extends BasicFileAttributes> provider = session.isPosixFilesystem() ? PosixFileAttributes.class : DosFileAttributes.class;<NEW_LINE>for (java.nio.file.Path n : stream) {<NEW_LINE>if (null == n.getFileName()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final PathAttributes attributes = feature.toAttributes(n);<NEW_LINE>final EnumSet<Path.Type> type = EnumSet.noneOf(Path.Type.class);<NEW_LINE>if (Files.isDirectory(n)) {<NEW_LINE>type.<MASK><NEW_LINE>} else {<NEW_LINE>type.add(Path.Type.file);<NEW_LINE>}<NEW_LINE>final Path file = new Path(directory, n.getFileName().toString(), type, attributes);<NEW_LINE>if (this.post(n, file)) {<NEW_LINE>paths.add(file);<NEW_LINE>listener.chunk(directory, paths);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.warn(String.format("Failure reading attributes for %s", n));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new LocalExceptionMappingService().map("Listing directory {0} failed", ex, directory);<NEW_LINE>}<NEW_LINE>return paths;<NEW_LINE>}
add(Path.Type.directory);
1,574,763
Map<ImportEntry, Collection<ImportComment>> reassignComments(Collection<ImportEntry> resultantImports) {<NEW_LINE>Map<ImportEntry, Collection<OriginalImportEntry>> importAssignments = assignRemovedImports(resultantImports);<NEW_LINE>Map<ImportEntry, Collection<ImportComment>> commentAssignments = new HashMap<ImportEntry, Collection<ImportComment>>();<NEW_LINE>for (Map.Entry<ImportEntry, Collection<OriginalImportEntry>> importAssignment : importAssignments.entrySet()) {<NEW_LINE>ImportEntry targetImport = importAssignment.getKey();<NEW_LINE>if (targetImport != null) {<NEW_LINE>Deque<ImportComment> assignedComments = new ArrayDeque<ImportComment>();<NEW_LINE>Collection<OriginalImportEntry> assignedImports = importAssignment.getValue();<NEW_LINE>Iterator<OriginalImportEntry> nextAssignedImportIterator = assignedImports.iterator();<NEW_LINE>if (nextAssignedImportIterator.hasNext()) {<NEW_LINE>nextAssignedImportIterator.next();<NEW_LINE>}<NEW_LINE>Iterator<OriginalImportEntry<MASK><NEW_LINE>while (assignedImportIterator.hasNext()) {<NEW_LINE>OriginalImportEntry currentAssignedImport = assignedImportIterator.next();<NEW_LINE>OriginalImportEntry nextAssignedImport = nextAssignedImportIterator.hasNext() ? nextAssignedImportIterator.next() : null;<NEW_LINE>assignedComments.addAll(currentAssignedImport.comments);<NEW_LINE>if (nextAssignedImport != null && hasFloatingComment(nextAssignedImport)) {<NEW_LINE>// Ensure that a blank line separates this removed import's comments<NEW_LINE>// from the next removed import's floating comments.<NEW_LINE>ImportComment lastComment = assignedComments.removeLast();<NEW_LINE>ImportComment lastCommentWithTrailingBlankLine = new ImportComment(lastComment.region, 2);<NEW_LINE>assignedComments.add(lastCommentWithTrailingBlankLine);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>commentAssignments.put(targetImport, assignedComments);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return commentAssignments;<NEW_LINE>}
> assignedImportIterator = assignedImports.iterator();
57,701
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>View root = inflater.inflate(R.layout.fragment_wallet, container, false);<NEW_LINE>loadingRecentContainer = root.findViewById(R.id.wallet_loading_recent_container);<NEW_LINE>layoutAccountRecommended = root.findViewById(R.id.wallet_account_recommended_container);<NEW_LINE>layoutSdkInitializing = root.findViewById(R.id.container_sdk_initializing);<NEW_LINE>linkSkipAccount = root.findViewById(R.id.wallet_skip_account_link);<NEW_LINE>buttonSignUp = root.findViewById(R.id.wallet_sign_up_button);<NEW_LINE>inlineBalanceContainer = root.findViewById(R.id.wallet_inline_balance_container);<NEW_LINE>textWalletInlineBalance = root.findViewById(R.id.wallet_inline_balance_value);<NEW_LINE>walletSendProgress = root.findViewById(R.id.wallet_send_progress);<NEW_LINE>walletTotalBalanceView = root.findViewById(R.id.wallet_total_balance);<NEW_LINE>walletSpendableBalanceView = root.findViewById(R.id.wallet_spendable_balance);<NEW_LINE>walletSupportingBalanceView = root.<MASK><NEW_LINE>textWalletBalanceUSD = root.findViewById(R.id.wallet_balance_usd_value);<NEW_LINE>textWalletBalanceDesc = root.findViewById(R.id.total_balance_desc);<NEW_LINE>textWalletHintSyncStatus = root.findViewById(R.id.wallet_hint_sync_status);<NEW_LINE>buttonViewMore = root.findViewById(R.id.view_more_button);<NEW_LINE>detailListView = root.findViewById(R.id.balance_detail_listview);<NEW_LINE>recentTransactionsList = root.findViewById(R.id.wallet_recent_transactions_list);<NEW_LINE>linkViewAll = root.findViewById(R.id.wallet_link_view_all);<NEW_LINE>textNoRecentTransactions = root.findViewById(R.id.wallet_no_recent_transactions);<NEW_LINE>buttonBuyLBC = root.findViewById(R.id.wallet_buy_lbc_button);<NEW_LINE>textConvertCredits = root.findViewById(R.id.wallet_hint_convert_credits);<NEW_LINE>textConvertCreditsBittrex = root.findViewById(R.id.wallet_hint_convert_credits_bittrex);<NEW_LINE>textWhatSyncMeans = root.findViewById(R.id.wallet_hint_what_sync_means);<NEW_LINE>textWalletReceiveAddress = root.findViewById(R.id.wallet_receive_address);<NEW_LINE>buttonCopyReceiveAddress = root.findViewById(R.id.wallet_copy_receive_address);<NEW_LINE>buttonGetNewAddress = root.findViewById(R.id.wallet_get_new_address);<NEW_LINE>inputSendAddress = root.findViewById(R.id.wallet_input_send_address);<NEW_LINE>buttonQRScanAddress = root.findViewById(R.id.wallet_qr_scan_address);<NEW_LINE>inputSendAmount = root.findViewById(R.id.wallet_input_amount);<NEW_LINE>buttonSend = root.findViewById(R.id.wallet_send);<NEW_LINE>textConnectedEmail = root.findViewById(R.id.wallet_connected_email);<NEW_LINE>switchSyncStatus = root.findViewById(R.id.wallet_switch_sync_status);<NEW_LINE>linkManualBackup = root.findViewById(R.id.wallet_link_manual_backup);<NEW_LINE>linkSyncFAQ = root.findViewById(R.id.wallet_link_sync_faq);<NEW_LINE>initUi();<NEW_LINE>return root;<NEW_LINE>}
findViewById(R.id.wallet_supporting_balance);
703,998
private void checkParentProject(final NbMavenProjectImpl project, final String newName) throws IOException {<NEW_LINE>Project[] prjs = OpenProjects.getDefault().getOpenProjects();<NEW_LINE>for (Project prj : prjs) {<NEW_LINE>if (prj.getProjectDirectory().equals(project.getProjectDirectory())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final NbMavenProjectImpl parentProject = prj.getLookup(<MASK><NEW_LINE>if (parentProject != null) {<NEW_LINE>List<String> modules = parentProject.getOriginalMavenProject().getModules();<NEW_LINE>if (modules != null && !modules.isEmpty()) {<NEW_LINE>String oldName = project.getProjectDirectory().getNameExt();<NEW_LINE>if (modules.contains(oldName)) {<NEW_LINE>rename(parentProject, oldName, newName);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File projectDir = project.getPOMFile().getParentFile();<NEW_LINE>File parentDir = parentProject.getPOMFile().getParentFile();<NEW_LINE>oldName = FileUtilities.relativizeFile(parentDir, projectDir);<NEW_LINE>if (modules.contains(oldName)) {<NEW_LINE>String relNewName = FileUtilities.relativizeFile(parentDir, new File(projectDir.getParent(), newName));<NEW_LINE>rename(parentProject, oldName, relNewName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
).lookup(NbMavenProjectImpl.class);
1,587,674
// TODO-BQ: this function may be refactored<NEW_LINE>private void updateBaseInfo(final BaseInfo baseInfo, final ResolveOptions resOpt) {<NEW_LINE>if (this.getExtendsTrait() != null) {<NEW_LINE>baseInfo.setTrait(this.getExtendsTrait<MASK><NEW_LINE>if (baseInfo.getTrait() != null) {<NEW_LINE>baseInfo.setRts(this.getExtendsTrait().fetchResolvedTraits(resOpt));<NEW_LINE>if (baseInfo.getRts() != null && baseInfo.getRts().getSize() == 1) {<NEW_LINE>final ParameterValueSet basePv = baseInfo.getRts().get(baseInfo.getTrait()) != null ? baseInfo.getRts().get(baseInfo.getTrait()).getParameterValues() : null;<NEW_LINE>if (basePv != null) {<NEW_LINE>baseInfo.setValues(basePv.getValues());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().fetchObjectDefinition(resOpt));
491,746
public static Set<ITargetSelector> parse(Iterable<?> selectors, ISelectorContext context, Set<ITargetSelector> parsed) {<NEW_LINE>if (parsed == null) {<NEW_LINE>parsed = new LinkedHashSet<ITargetSelector>();<NEW_LINE>}<NEW_LINE>if (selectors != null) {<NEW_LINE>for (Object selector : selectors) {<NEW_LINE>if (selector instanceof IAnnotationHandle) {<NEW_LINE>parsed.add(TargetSelector.parse((IAnnotationHandle) selector, context));<NEW_LINE>} else if (selector instanceof AnnotationNode) {<NEW_LINE>parsed.add(TargetSelector.parse(Annotations.handleOf(selector), context));<NEW_LINE>} else if (selector instanceof String) {<NEW_LINE>parsed.add(TargetSelector.parse((String) selector, context));<NEW_LINE>} else if (selector instanceof Class) {<NEW_LINE>String desc = Type.getType((Class<?>) selector).getDescriptor();<NEW_LINE>parsed.add(TargetSelector<MASK><NEW_LINE>} else if (selector != null) {<NEW_LINE>parsed.add(TargetSelector.parse(selector.toString(), context));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return parsed;<NEW_LINE>}
.parse(desc, context));
1,723,715
private void load(int AD_User_ID) {<NEW_LINE>log.info("ID=" + AD_User_ID + ", AD_Client_ID=" + m_AD_Client_ID);<NEW_LINE>String sql <MASK><NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, null);<NEW_LINE>pstmt.setInt(1, m_AD_Client_ID);<NEW_LINE>pstmt.setInt(2, AD_User_ID);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>if (rs.next()) {<NEW_LINE>m_bpc = new MUser(m_ctx, rs, null);<NEW_LINE>log.fine("= found BPC=" + m_bpc);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.log(Level.SEVERE, sql, e);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>// Password not entered<NEW_LINE>m_passwordOK = false;<NEW_LINE>m_loggedIn = false;<NEW_LINE>// Load BPartner<NEW_LINE>if (m_bpc != null) {<NEW_LINE>m_bp = new MBPartner(m_ctx, m_bpc.getC_BPartner_ID(), null);<NEW_LINE>log.fine("= Found BP=" + m_bp);<NEW_LINE>} else<NEW_LINE>m_bp = null;<NEW_LINE>// Load Loacation<NEW_LINE>if (m_bpc != null) {<NEW_LINE>if (m_bpc.getC_BPartner_Location_ID() != 0) {<NEW_LINE>m_bpl = new MBPartnerLocation(m_ctx, m_bpc.getC_BPartner_Location_ID(), null);<NEW_LINE>log.fine("= Found BPL=" + m_bpl);<NEW_LINE>} else {<NEW_LINE>MBPartnerLocation[] bpls = m_bp.getLocations(false);<NEW_LINE>if (bpls != null && bpls.length > 0) {<NEW_LINE>m_bpl = bpls[0];<NEW_LINE>log.fine("= Found BPL=" + m_bpl);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (m_bpl != null) {<NEW_LINE>m_loc = MLocation.get(m_ctx, m_bpl.getC_Location_ID(), null);<NEW_LINE>log.fine("= Found LOC=" + m_loc);<NEW_LINE>} else<NEW_LINE>m_loc = null;<NEW_LINE>} else {<NEW_LINE>m_bpl = null;<NEW_LINE>m_loc = null;<NEW_LINE>}<NEW_LINE>// Make sure that all entities exist<NEW_LINE>if (m_bpc == null) {<NEW_LINE>m_bpc = new MUser(m_ctx, 0, null);<NEW_LINE>m_bpc.setEMail("?");<NEW_LINE>m_bpc.setPassword("?");<NEW_LINE>}<NEW_LINE>if (m_bp == null) {<NEW_LINE>// template<NEW_LINE>m_bp = new MBPartner(m_ctx);<NEW_LINE>m_bp.setIsCustomer(true);<NEW_LINE>}<NEW_LINE>if (m_bpl == null)<NEW_LINE>m_bpl = new MBPartnerLocation(m_bp);<NEW_LINE>if (m_loc == null)<NEW_LINE>m_loc = new MLocation(m_ctx, 0, null);<NEW_LINE>//<NEW_LINE>log.info("= " + m_bp + " - " + m_bpc);<NEW_LINE>}
= "SELECT * " + "FROM AD_User " + "WHERE AD_Client_ID=?" + " AND AD_User_ID=?";
1,316,339
public void added(VisualizerEvent.Added ev) {<NEW_LINE>if (this != parent.getChildren()) {<NEW_LINE>// children were replaced, quit processing event<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>snapshot = ev.getSnapshot();<NEW_LINE>ListIterator<VisualizerNode> it = getVisNodes(true).listIterator();<NEW_LINE>int[] indxs = ev.getArray();<NEW_LINE>int current = 0;<NEW_LINE>int inIndxs = 0;<NEW_LINE>while (inIndxs < indxs.length) {<NEW_LINE>while (current++ < indxs[inIndxs]) {<NEW_LINE>it.next();<NEW_LINE>}<NEW_LINE>it.add(null);<NEW_LINE>inIndxs++;<NEW_LINE>}<NEW_LINE>recomputeIndexes(null);<NEW_LINE>VisualizerNode p = this.parent;<NEW_LINE>while (p != null) {<NEW_LINE>Object[] listeners = p.getListenerList();<NEW_LINE>for (int i = listeners.length - 1; i >= 0; i -= 2) {<NEW_LINE>((NodeModel) listeners[i]).added(ev);<NEW_LINE>}<NEW_LINE>p = <MASK><NEW_LINE>}<NEW_LINE>}
(VisualizerNode) p.getParent();
150,247
protected Optional<String> lookup(Path developerDir) {<NEW_LINE>return cache.computeIfAbsent(developerDir, ignored -> {<NEW_LINE>Path versionPlist = developerDir.getParent().resolve("version.plist");<NEW_LINE>NSString result;<NEW_LINE>try {<NEW_LINE>NSDictionary dict = (NSDictionary) PropertyListParser.parse(Files.readAllBytes(versionPlist));<NEW_LINE>result = (NSString) dict.get("ProductBuildVersion");<NEW_LINE>} catch (IOException | ClassCastException | SAXException | PropertyListFormatException | ParseException e) {<NEW_LINE>LOG.warn(e, "%s: Cannot find xcode build version, file is in an invalid format.", versionPlist);<NEW_LINE>return Optional.empty();<NEW_LINE>} catch (ParserConfigurationException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (result != null) {<NEW_LINE>return Optional.of(result.toString());<NEW_LINE>} else {<NEW_LINE>LOG.warn("%s: Cannot find xcode build version, file is in an invalid format.", versionPlist);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
throw new IllegalStateException("plist parser threw unexpected exception", e);
392,386
public void fillMenu(String sColumnName, Menu menu) {<NEW_LINE>List<Object<MASK><NEW_LINE>final List<ChatInstance> chats = new ArrayList<>();<NEW_LINE>for (Object obj : ds) {<NEW_LINE>if (obj instanceof ChatInstance) {<NEW_LINE>chats.add((ChatInstance) obj);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// show in sidebar<NEW_LINE>MenuItem itemSiS = new MenuItem(menu, SWT.PUSH);<NEW_LINE>Messages.setLanguageText(itemSiS, Utils.isAZ2UI() ? "label.show.in.tab" : "label.show.in.sidebar");<NEW_LINE>itemSiS.setEnabled(chats.size() > 0);<NEW_LINE>itemSiS.addListener(SWT.Selection, new Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEvent(Event event) {<NEW_LINE>MultipleDocumentInterface mdi = UIFunctionsManager.getUIFunctions().getMDI();<NEW_LINE>for (int i = 0, chatsSize = chats.size(); i < chatsSize; i++) {<NEW_LINE>ChatInstance chat = chats.get(i);<NEW_LINE>try {<NEW_LINE>mdi.loadEntryByID("Chat_", i == 0, false, chat.getClone());<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.out(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>MenuItem itemRemove = new MenuItem(menu, SWT.PUSH);<NEW_LINE>Messages.setLanguageText(itemRemove, "MySharesView.menu.remove");<NEW_LINE>Utils.setMenuItemImage(itemRemove, "delete");<NEW_LINE>itemRemove.setEnabled(chats.size() > 0);<NEW_LINE>itemRemove.addListener(SWT.Selection, new Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEvent(Event e) {<NEW_LINE>for (ChatInstance chat : chats) {<NEW_LINE>chat.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>new MenuItem(menu, SWT.SEPARATOR);<NEW_LINE>}
> ds = tv.getSelectedDataSources();
1,389,180
private void dealMessage(FlatDhcpAcquireDhcpServerIpMsg msg) {<NEW_LINE>FlatDhcpAcquireDhcpServerIpReply reply = new FlatDhcpAcquireDhcpServerIpReply();<NEW_LINE>L3NetworkVO l3NetworkVO = dbf.findByUuid(msg.getL3NetworkUuid(), L3NetworkVO.class);<NEW_LINE>for (int ipVersion : l3NetworkVO.getIpVersions()) {<NEW_LINE>String ip = allocateDhcpIp(msg.getL3NetworkUuid(), ipVersion);<NEW_LINE>if (ip != null) {<NEW_LINE>List<NormalIpRangeVO> iprs = Q.New(NormalIpRangeVO.class).eq(NormalIpRangeVO_.l3NetworkUuid, msg.getL3NetworkUuid()).eq(NormalIpRangeVO_.ipVersion, ipVersion).list();<NEW_LINE>if (iprs == null || iprs.isEmpty()) {<NEW_LINE>logger.warn(String.format("there is no ip range for dhcp server ip [%s]", ip));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>FlatDhcpAcquireDhcpServerIpReply.DhcpServerIpStruct struct = new FlatDhcpAcquireDhcpServerIpReply.DhcpServerIpStruct();<NEW_LINE>struct.setIp(ip);<NEW_LINE>struct.setNetmask(iprs.get(0).getNetmask());<NEW_LINE>struct.setIpr(IpRangeInventory.valueOf(iprs.get(0)));<NEW_LINE>struct.setIpVersion(iprs.get(0).getIpVersion());<NEW_LINE>reply.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>bus.reply(msg, reply);<NEW_LINE>}
getDhcpServerList().add(struct);
493,486
private static synchronized FDBigInt big5pow(int p) {<NEW_LINE>if (p < 0)<NEW_LINE>throw new RuntimeException("Assertion botch: negative power of 5");<NEW_LINE>if (b5p == null) {<NEW_LINE>b5p = new FDBigInt[p + 1];<NEW_LINE>} else if (b5p.length <= p) {<NEW_LINE>FDBigInt[] t <MASK><NEW_LINE>System.arraycopy(b5p, 0, t, 0, b5p.length);<NEW_LINE>b5p = t;<NEW_LINE>}<NEW_LINE>if (b5p[p] != null)<NEW_LINE>return b5p[p];<NEW_LINE>else if (p < small5pow.length)<NEW_LINE>return b5p[p] = new FDBigInt(small5pow[p]);<NEW_LINE>else if (p < long5pow.length)<NEW_LINE>return b5p[p] = new FDBigInt(long5pow[p]);<NEW_LINE>else {<NEW_LINE>// construct the value.<NEW_LINE>// recursively.<NEW_LINE>int q, r;<NEW_LINE>// in order to compute 5^p,<NEW_LINE>// compute its square root, 5^(p/2) and square.<NEW_LINE>// or, let q = p / 2, r = p -q, then<NEW_LINE>// 5^p = 5^(q+r) = 5^q * 5^r<NEW_LINE>q = p >> 1;<NEW_LINE>r = p - q;<NEW_LINE>FDBigInt bigq = b5p[q];<NEW_LINE>if (bigq == null)<NEW_LINE>bigq = big5pow(q);<NEW_LINE>if (r < small5pow.length) {<NEW_LINE>return (b5p[p] = bigq.mult(small5pow[r]));<NEW_LINE>} else {<NEW_LINE>FDBigInt bigr = b5p[r];<NEW_LINE>if (bigr == null)<NEW_LINE>bigr = big5pow(r);<NEW_LINE>return (b5p[p] = bigq.mult(bigr));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= new FDBigInt[p + 1];
1,577,845
public boolean eIsSet(int featureID) {<NEW_LINE>switch(featureID) {<NEW_LINE>case ModelPackage.COLOR_LED__LOGGER:<NEW_LINE>return LOGGER_EDEFAULT == null ? logger != null : !LOGGER_EDEFAULT.equals(logger);<NEW_LINE>case ModelPackage.COLOR_LED__UID:<NEW_LINE>return UID_EDEFAULT == null ? uid != null : !UID_EDEFAULT.equals(uid);<NEW_LINE>case ModelPackage.COLOR_LED__POLL:<NEW_LINE>return poll != POLL_EDEFAULT;<NEW_LINE>case ModelPackage.COLOR_LED__ENABLED_A:<NEW_LINE>return ENABLED_A_EDEFAULT == null ? enabledA != null : !ENABLED_A_EDEFAULT.equals(enabledA);<NEW_LINE>case ModelPackage.COLOR_LED__SUB_ID:<NEW_LINE>return SUB_ID_EDEFAULT == null ? subId != null : !SUB_ID_EDEFAULT.equals(subId);<NEW_LINE>case ModelPackage.COLOR_LED__MBRICK:<NEW_LINE>return basicGetMbrick() != null;<NEW_LINE>case ModelPackage.COLOR_LED__DIGITAL_STATE:<NEW_LINE>return DIGITAL_STATE_EDEFAULT == null ? digitalState != null <MASK><NEW_LINE>case ModelPackage.COLOR_LED__DEVICE_TYPE:<NEW_LINE>return DEVICE_TYPE_EDEFAULT == null ? deviceType != null : !DEVICE_TYPE_EDEFAULT.equals(deviceType);<NEW_LINE>}<NEW_LINE>return super.eIsSet(featureID);<NEW_LINE>}
: !DIGITAL_STATE_EDEFAULT.equals(digitalState);
132,663
public void run(RegressionEnvironment env) {<NEW_LINE>String expression = "@name('s0') select * from pattern " + "[every A=SupportCallEvent -> every B=SupportCallEvent(dest=A.dest, startTime in [A.startTime:A.endTime]) where timer:within (7200000)]" + "where B.source != A.source";<NEW_LINE>env.compileDeploy(expression);<NEW_LINE>env.addListener("s0");<NEW_LINE>SupportCallEvent eventOne = sendEvent(env, 2000002601, "18", "123456789014795", dateToLong("2005-09-26 13:02:53.200"), dateToLong("2005-09-26 13:03:34.400"));<NEW_LINE>SupportCallEvent eventTwo = sendEvent(env, 2000002607, "20", "123456789014795", dateToLong("2005-09-26 13:03:17.300"), dateToLong("2005-09-26 13:03:58.600"));<NEW_LINE>env.assertEventNew("s0", theEvent -> {<NEW_LINE>assertSame(eventOne, theEvent.get("A"));<NEW_LINE>assertSame(eventTwo, theEvent.get("B"));<NEW_LINE>});<NEW_LINE>SupportCallEvent eventThree = sendEvent(env, 2000002610, "22", "123456789014795", dateToLong("2005-09-26 13:03:31.300"), dateToLong("2005-09-26 13:04:12.100"));<NEW_LINE>env.assertListener("s0", listener -> {<NEW_LINE>assertEquals(1, listener.<MASK><NEW_LINE>assertEquals(2, listener.getLastNewData().length);<NEW_LINE>EventBean theEvent = listener.getLastNewData()[0];<NEW_LINE>assertSame(eventOne, theEvent.get("A"));<NEW_LINE>assertSame(eventThree, theEvent.get("B"));<NEW_LINE>theEvent = listener.getLastNewData()[1];<NEW_LINE>assertSame(eventTwo, theEvent.get("A"));<NEW_LINE>assertSame(eventThree, theEvent.get("B"));<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>}
getNewDataList().size());
1,682,133
public PlatformToolProvider select(NativeLanguage sourceLanguage, NativePlatformInternal targetMachine) {<NEW_LINE>PlatformToolProvider toolProvider = getProviderForPlatform(targetMachine);<NEW_LINE>switch(sourceLanguage) {<NEW_LINE>case CPP:<NEW_LINE>if (toolProvider instanceof UnsupportedPlatformToolProvider) {<NEW_LINE>return toolProvider;<NEW_LINE>}<NEW_LINE>ToolSearchResult cppCompiler = toolProvider.locateTool(ToolType.CPP_COMPILER);<NEW_LINE>if (cppCompiler.isAvailable()) {<NEW_LINE>return toolProvider;<NEW_LINE>}<NEW_LINE>// No C++ compiler, complain about it<NEW_LINE>return new UnavailablePlatformToolProvider(targetMachine.getOperatingSystem(), cppCompiler);<NEW_LINE>case ANY:<NEW_LINE>if (toolProvider instanceof UnsupportedPlatformToolProvider) {<NEW_LINE>return toolProvider;<NEW_LINE>}<NEW_LINE>ToolSearchResult cCompiler = <MASK><NEW_LINE>if (cCompiler.isAvailable()) {<NEW_LINE>return toolProvider;<NEW_LINE>}<NEW_LINE>ToolSearchResult compiler = toolProvider.locateTool(ToolType.CPP_COMPILER);<NEW_LINE>if (compiler.isAvailable()) {<NEW_LINE>return toolProvider;<NEW_LINE>}<NEW_LINE>compiler = toolProvider.locateTool(ToolType.OBJECTIVEC_COMPILER);<NEW_LINE>if (compiler.isAvailable()) {<NEW_LINE>return toolProvider;<NEW_LINE>}<NEW_LINE>compiler = toolProvider.locateTool(ToolType.OBJECTIVECPP_COMPILER);<NEW_LINE>if (compiler.isAvailable()) {<NEW_LINE>return toolProvider;<NEW_LINE>}<NEW_LINE>// No compilers available, complain about the missing C compiler<NEW_LINE>return new UnavailablePlatformToolProvider(targetMachine.getOperatingSystem(), cCompiler);<NEW_LINE>default:<NEW_LINE>return new UnsupportedPlatformToolProvider(targetMachine.getOperatingSystem(), String.format("Don't know how to compile language %s.", sourceLanguage));<NEW_LINE>}<NEW_LINE>}
toolProvider.locateTool(ToolType.C_COMPILER);
642,230
private void loadLanguageProviders() {<NEW_LINE>LOGGER.debug(CORE, "Found {} language providers", ServiceLoaderUtils.streamServiceLoader(() -> serviceLoader, sce -> LOGGER.fatal("Problem with language loaders")).count());<NEW_LINE>serviceLoader.forEach(languageProviders::add);<NEW_LINE>languageProviders.forEach(lp -> {<NEW_LINE>final Path lpPath;<NEW_LINE>try {<NEW_LINE>lpPath = Paths.get(lp.getClass().getProtectionDomain().getCodeSource().getLocation().toURI());<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>Optional<String> implementationVersion = JarVersionLookupHandler.getImplementationVersion(lp.getClass());<NEW_LINE>String impl = implementationVersion.orElse(Files.isDirectory(lpPath) ? FMLLoader.versionInfo().forgeVersion().split("\\.")[0] : null);<NEW_LINE>if (impl == null) {<NEW_LINE>LOGGER.fatal(CORE, "Found unversioned language provider {}", lp.name());<NEW_LINE>throw new RuntimeException("Failed to find implementation version for language provider " + lp.name());<NEW_LINE>}<NEW_LINE>LOGGER.debug(CORE, "Found language provider {}, version {}", lp.name(), impl);<NEW_LINE>StartupMessageManager.modLoaderConsumer().ifPresent(c -> c.accept("Loaded language provider " + lp.name() + " " + impl));<NEW_LINE>languageProviderMap.put(lp.name(), new ModLanguageWrapper(lp, new DefaultArtifactVersion(impl)));<NEW_LINE>});<NEW_LINE>}
throw new RuntimeException("Huh?", e);
1,330,109
public void onRecordStopped() {<NEW_LINE>Log.i(TAG, "record stop time: " + System.currentTimeMillis());<NEW_LINE>long sectionRecordDurationMs = System.currentTimeMillis() - mSectionBeginMs;<NEW_LINE>long totalRecordDurationMs = sectionRecordDurationMs + (mDurationRecordStack.isEmpty() ? <MASK><NEW_LINE>double totalVideoDurationMs = (double) sectionRecordDurationMs + (mDurationVideoStack.isEmpty() ? 0 : mDurationVideoStack.peek());<NEW_LINE>mDurationRecordStack.push(totalRecordDurationMs);<NEW_LINE>mDurationVideoStack.push(totalVideoDurationMs);<NEW_LINE>if (mRecordSetting.IsRecordSpeedVariable()) {<NEW_LINE>Log.d(TAG, "SectionRecordDuration: " + sectionRecordDurationMs + "; sectionVideoDuration: " + (double) sectionRecordDurationMs + "; totalVideoDurationMs: " + totalVideoDurationMs + "Section count: " + mDurationVideoStack.size());<NEW_LINE>mSectionProgressBar.addBreakPointTime((long) totalVideoDurationMs);<NEW_LINE>} else {<NEW_LINE>mSectionProgressBar.addBreakPointTime(totalRecordDurationMs);<NEW_LINE>}<NEW_LINE>mSectionBegan = false;<NEW_LINE>mSectionProgressBar.setCurrentState(SectionProgressBar.State.PAUSE);<NEW_LINE>runOnUiThread(() -> updateRecordingBtns(false));<NEW_LINE>}
0 : mDurationRecordStack.peek());
1,079,947
public Map<PathItem.HttpMethod, Operation> readOperationsMap() {<NEW_LINE>Map<PathItem.HttpMethod, Operation> result = new LinkedHashMap<>();<NEW_LINE>if (this.get != null) {<NEW_LINE>result.put(PathItem.HttpMethod.GET, this.get);<NEW_LINE>}<NEW_LINE>if (this.put != null) {<NEW_LINE>result.put(PathItem.HttpMethod.PUT, this.put);<NEW_LINE>}<NEW_LINE>if (this.post != null) {<NEW_LINE>result.put(PathItem.<MASK><NEW_LINE>}<NEW_LINE>if (this.delete != null) {<NEW_LINE>result.put(PathItem.HttpMethod.DELETE, this.delete);<NEW_LINE>}<NEW_LINE>if (this.patch != null) {<NEW_LINE>result.put(PathItem.HttpMethod.PATCH, this.patch);<NEW_LINE>}<NEW_LINE>if (this.head != null) {<NEW_LINE>result.put(PathItem.HttpMethod.HEAD, this.head);<NEW_LINE>}<NEW_LINE>if (this.options != null) {<NEW_LINE>result.put(PathItem.HttpMethod.OPTIONS, this.options);<NEW_LINE>}<NEW_LINE>if (this.trace != null) {<NEW_LINE>result.put(PathItem.HttpMethod.TRACE, this.trace);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
HttpMethod.POST, this.post);
1,014,933
public void marshall(PutAlarmRequest putAlarmRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (putAlarmRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(putAlarmRequest.getAlarmName(), ALARMNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(putAlarmRequest.getMetricName(), METRICNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(putAlarmRequest.getComparisonOperator(), COMPARISONOPERATOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(putAlarmRequest.getThreshold(), THRESHOLD_BINDING);<NEW_LINE>protocolMarshaller.marshall(putAlarmRequest.getEvaluationPeriods(), EVALUATIONPERIODS_BINDING);<NEW_LINE>protocolMarshaller.marshall(putAlarmRequest.getDatapointsToAlarm(), DATAPOINTSTOALARM_BINDING);<NEW_LINE>protocolMarshaller.marshall(putAlarmRequest.getTreatMissingData(), TREATMISSINGDATA_BINDING);<NEW_LINE>protocolMarshaller.marshall(putAlarmRequest.getContactProtocols(), CONTACTPROTOCOLS_BINDING);<NEW_LINE>protocolMarshaller.marshall(putAlarmRequest.getNotificationTriggers(), NOTIFICATIONTRIGGERS_BINDING);<NEW_LINE>protocolMarshaller.marshall(putAlarmRequest.getNotificationEnabled(), NOTIFICATIONENABLED_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
putAlarmRequest.getMonitoredResourceName(), MONITOREDRESOURCENAME_BINDING);
89,242
public void onRegisterDevice(int status, @Nullable String message, @Nullable BackupError error) {<NEW_LINE>FragmentActivity activity = getActivity();<NEW_LINE>if (AndroidUtils.isActivityNotDestroyed(activity)) {<NEW_LINE>int errorCode = error != null ? error.getCode() : -1;<NEW_LINE>if (dialogType == LoginDialogType.VERIFY_EMAIL) {<NEW_LINE>progressBar.setVisibility(View.INVISIBLE);<NEW_LINE>if (status == BackupHelper.STATUS_SUCCESS) {<NEW_LINE>FragmentManager fragmentManager = activity.getSupportFragmentManager();<NEW_LINE>if (!fragmentManager.isStateSaved()) {<NEW_LINE>fragmentManager.popBackStack(BaseSettingsFragment.SettingsScreenType.BACKUP_AUTHORIZATION.name(), FragmentManager.POP_BACK_STACK_INCLUSIVE);<NEW_LINE>}<NEW_LINE>BackupAndRestoreFragment.showInstance(fragmentManager, signIn ? LoginDialogType.SIGN_IN : LoginDialogType.SIGN_UP);<NEW_LINE>} else {<NEW_LINE>errorText.setText(error != null ? error.getLocalizedError(app) : message);<NEW_LINE>buttonContinue.setEnabled(false);<NEW_LINE>AndroidUiHelper.updateVisibility(errorText, true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (errorCode == dialogType.permittedErrorCode) {<NEW_LINE>registerUser();<NEW_LINE>} else if (errorCode != -1) {<NEW_LINE><MASK><NEW_LINE>if (errorCode == dialogType.warningErrorCode) {<NEW_LINE>errorText.setText(dialogType.warningId);<NEW_LINE>AndroidUiHelper.updateVisibility(buttonAuthorize, !promoCodeSupported());<NEW_LINE>} else {<NEW_LINE>errorText.setText(error.getLocalizedError(app));<NEW_LINE>}<NEW_LINE>buttonContinue.setEnabled(false);<NEW_LINE>AndroidUiHelper.updateVisibility(errorText, true);<NEW_LINE>}<NEW_LINE>AndroidUiHelper.updateVisibility(buttonChoosePlan, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
progressBar.setVisibility(View.INVISIBLE);
510,601
public static List<Field> createFields(String fieldName, Object value, Field.Store store, Boolean sort) {<NEW_LINE>List<Field> fields = new ArrayList<>();<NEW_LINE>if (value instanceof Number) {<NEW_LINE>Number number = (Number) value;<NEW_LINE>if (value instanceof Long) {<NEW_LINE>fields.add(new NumericDocValuesField(fieldName, number.longValue()));<NEW_LINE>fields.add(new LongPoint(fieldName, number.longValue()));<NEW_LINE>return fields;<NEW_LINE>} else if (value instanceof Float) {<NEW_LINE>fields.add(new FloatDocValuesField(fieldName, number.floatValue()));<NEW_LINE>fields.add(new FloatPoint(fieldName, number.floatValue()));<NEW_LINE>return fields;<NEW_LINE>} else if (value instanceof Double) {<NEW_LINE>fields.add(new DoubleDocValuesField(fieldName, number.doubleValue()));<NEW_LINE>fields.add(new DoublePoint(fieldName, number.doubleValue()));<NEW_LINE>return fields;<NEW_LINE>}<NEW_LINE>fields.add(new NumericDocValuesField(fieldName, number.longValue()));<NEW_LINE>fields.add(new IntPoint(fieldName, number.intValue()));<NEW_LINE>return fields;<NEW_LINE>} else if (value instanceof Date) {<NEW_LINE>Date date = (Date) value;<NEW_LINE>fields.add(new NumericDocValuesField(fieldName<MASK><NEW_LINE>fields.add(new LongPoint(fieldName, date.getTime()));<NEW_LINE>return fields;<NEW_LINE>}<NEW_LINE>if (Boolean.TRUE.equals(sort)) {<NEW_LINE>fields.add(new SortedDocValuesField(fieldName, new BytesRef(value.toString())));<NEW_LINE>}<NEW_LINE>fields.add(new TextField(fieldName, value.toString(), Field.Store.YES));<NEW_LINE>return fields;<NEW_LINE>}
, date.getTime()));
180,757
// Development assistance in seeing into the algorithms.<NEW_LINE>private static void print(Set<String> inUsePrefixURIs, PrefixMapping prefixMapping) {<NEW_LINE>// Convert to prefixes.<NEW_LINE>Set<String> inUsePrefixes = urisToPrefixes(prefixMapping, inUsePrefixURIs);<NEW_LINE>// ----- Analysis<NEW_LINE>System.out.println("In use: " + inUsePrefixURIs);<NEW_LINE>System.out.println("In use: " + inUsePrefixes);<NEW_LINE>inUsePrefixURIs.forEach((u) -> System.out.printf(" %s: -> <%s>\n", prefixMapping.getNsURIPrefix(u), u));<NEW_LINE>// Calc not needed to be efficient.<NEW_LINE>Map<String, String> pmap = prefixMapping.getNsPrefixMap();<NEW_LINE>Set<String> prefixURIs = new HashSet<>(pmap.values());<NEW_LINE>Set<String> notInUseURIs = <MASK><NEW_LINE>Set<String> notInUsePrefixes = SetUtils.difference(pmap.keySet(), inUsePrefixes);<NEW_LINE>System.out.println("Not in use: " + notInUseURIs);<NEW_LINE>System.out.println("Not in use: " + notInUsePrefixes);<NEW_LINE>notInUseURIs.forEach((u) -> System.out.printf(" %s: -> <%s>\n", prefixMapping.getNsURIPrefix(u), u));<NEW_LINE>}
SetUtils.difference(prefixURIs, inUsePrefixURIs);
1,797,267
void propagate() {<NEW_LINE>if (this.parent != null) {<NEW_LINE>// Propagate the lowest death level of any descendants:<NEW_LINE>if (this.propagatedLowestChildSplitLevel == Double.MAX_VALUE) {<NEW_LINE>this.propagatedLowestChildSplitLevel = this.splitLevel;<NEW_LINE>}<NEW_LINE>if (this.propagatedLowestChildSplitLevel < this.parent.propagatedLowestChildSplitLevel) {<NEW_LINE>this.parent.propagatedLowestChildSplitLevel = this.propagatedLowestChildSplitLevel;<NEW_LINE>}<NEW_LINE>// If this cluster has no children, it must propagate itself:<NEW_LINE>if (!this.hasChildren) {<NEW_LINE>this.parent.propagatedStability += this.stability;<NEW_LINE>this.parent.propagatedDescendants.add(this);<NEW_LINE>} else {<NEW_LINE>// Chose the parent over descendants if there is a tie in stability:<NEW_LINE>if (this.stability >= this.propagatedStability) {<NEW_LINE>this.parent.propagatedStability += this.stability;<NEW_LINE>this.parent.propagatedDescendants.add(this);<NEW_LINE>} else {<NEW_LINE>this.parent.propagatedStability += this.propagatedStability;<NEW_LINE>this.parent.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
propagatedDescendants.addAll(this.propagatedDescendants);
5,887
private void validateUnicodePoints(String text, Location pos) {<NEW_LINE>Matcher matcher = Utils.UNICODE_PATTERN.matcher(text);<NEW_LINE>while (matcher.find()) {<NEW_LINE>String leadingBackSlashes = matcher.group(1);<NEW_LINE>if (Utils.isEscapedNumericEscape(leadingBackSlashes)) {<NEW_LINE>// e.g. \\u{61}, \\\\u{61}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String <MASK><NEW_LINE>int decimalCodePoint = Integer.parseInt(hexCodePoint, 16);<NEW_LINE>if ((decimalCodePoint >= Constants.MIN_UNICODE && decimalCodePoint <= Constants.MIDDLE_LIMIT_UNICODE) || decimalCodePoint > Constants.MAX_UNICODE) {<NEW_LINE>int offset = matcher.end(1);<NEW_LINE>offset += "\\u{".length();<NEW_LINE>BLangDiagnosticLocation numericEscapePos = new BLangDiagnosticLocation(currentCompUnitName, pos.lineRange().startLine().line(), pos.lineRange().endLine().line(), pos.lineRange().startLine().offset() + offset, pos.lineRange().startLine().offset() + offset + hexCodePoint.length());<NEW_LINE>dlog.error(numericEscapePos, DiagnosticErrorCode.INVALID_UNICODE, hexCodePoint);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
hexCodePoint = matcher.group(2);
281,167
public void show(Activity activity) {<NEW_LINE>if (picker != null) {<NEW_LINE>picker.show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// prompt for input params<NEW_LINE>AlertDialog.Builder builder <MASK><NEW_LINE>View view = View.inflate(activity, R.layout.milstd2525list, null);<NEW_LINE>milstd_search_affil_f = view.findViewById(R.id.milstd_search_affil_f);<NEW_LINE>milstd_search_affil_h = view.findViewById(R.id.milstd_search_affil_h);<NEW_LINE>milstd_search_affil_n = view.findViewById(R.id.milstd_search_affil_n);<NEW_LINE>milstd_search_affil_u = view.findViewById(R.id.milstd_search_affil_u);<NEW_LINE>milstd_search_affil_f.setOnClickListener(this);<NEW_LINE>milstd_search_affil_h.setOnClickListener(this);<NEW_LINE>milstd_search_affil_n.setOnClickListener(this);<NEW_LINE>milstd_search_affil_u.setOnClickListener(this);<NEW_LINE>milstd_search = view.findViewById(R.id.milstd_search);<NEW_LINE>milstd_search.addTextChangedListener(this);<NEW_LINE>milstd_search_results = view.findViewById(R.id.milstd_search_results);<NEW_LINE>milstd_search_results.setAdapter(new MilStdAdapter(activity));<NEW_LINE>milstd_search_results.setOnItemClickListener(this);<NEW_LINE>milstd_search_cancel = view.findViewById(R.id.milstd_search_cancel);<NEW_LINE>milstd_search_cancel.setOnClickListener(this);<NEW_LINE>builder.setView(view);<NEW_LINE>builder.setCancelable(true);<NEW_LINE>builder.setOnCancelListener(new DialogInterface.OnCancelListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCancel(DialogInterface dialog) {<NEW_LINE>picker.dismiss();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>picker = builder.create();<NEW_LINE>picker.show();<NEW_LINE>}
= new AlertDialog.Builder(activity);
1,023,957
private void decodeExtras(Position position, Parser parser) {<NEW_LINE>int mask = parser.nextInt();<NEW_LINE>String[] data = parser.next().split(",");<NEW_LINE>int index = 0;<NEW_LINE>if (BitUtil.check(mask, 0)) {<NEW_LINE>// pulse counter 3<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>if (BitUtil.check(mask, 1)) {<NEW_LINE>position.set(Position.KEY_POWER, Integer.parseInt(data[index++]));<NEW_LINE>}<NEW_LINE>if (BitUtil.check(mask, 2)) {<NEW_LINE>position.set(Position.KEY_BATTERY, Integer.parseInt(data[index++]));<NEW_LINE>}<NEW_LINE>if (BitUtil.check(mask, 3)) {<NEW_LINE>position.set(Position.KEY_OBD_SPEED, Integer.parseInt(data[index++]));<NEW_LINE>}<NEW_LINE>if (BitUtil.check(mask, 4)) {<NEW_LINE>position.set(Position.KEY_RPM, Integer.parseInt(data[index++]));<NEW_LINE>}<NEW_LINE>if (BitUtil.check(mask, 5)) {<NEW_LINE>position.set(Position.KEY_RSSI, Integer.parseInt<MASK><NEW_LINE>}<NEW_LINE>if (BitUtil.check(mask, 6)) {<NEW_LINE>// pulse counter 2<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>if (BitUtil.check(mask, 7)) {<NEW_LINE>// magnetic rotation sensor rpm<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>}
(data[index++]));
585,524
public void clear() {<NEW_LINE>Path path = new Path();<NEW_LINE><MASK><NEW_LINE>path.addRect(0F, 0F, 1000F, 1000F, Path.Direction.CCW);<NEW_LINE>path.close();<NEW_LINE>Paint paint = new Paint();<NEW_LINE>paint.setColor(Color.parseColor("#303030"));<NEW_LINE>paint.setStyle(Paint.Style.FILL);<NEW_LINE>if (this.historyPointer == this.pathLists.size()) {<NEW_LINE>this.pathLists.add(path);<NEW_LINE>this.paintLists.add(paint);<NEW_LINE>this.historyPointer++;<NEW_LINE>} else {<NEW_LINE>// On the way of Undo or Redo<NEW_LINE>this.pathLists.set(this.historyPointer, path);<NEW_LINE>this.paintLists.set(this.historyPointer, paint);<NEW_LINE>this.historyPointer++;<NEW_LINE>for (int i = this.historyPointer, size = this.paintLists.size(); i < size; i++) {<NEW_LINE>this.pathLists.remove(this.historyPointer);<NEW_LINE>this.paintLists.remove(this.historyPointer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.text = "";<NEW_LINE>// Clear<NEW_LINE>this.invalidate();<NEW_LINE>}
path.moveTo(0F, 0F);
1,602,922
public static void deferredTick() {<NEW_LINE>deferTick = false;<NEW_LINE>Minecraft instance = Minecraft.getInstance();<NEW_LINE>Screen currentScreen = instance.screen;<NEW_LINE>if (hoveredStack.isEmpty() || trackingStack.isEmpty()) {<NEW_LINE>trackingStack = ItemStack.EMPTY;<NEW_LINE>holdWProgress.startWithValue(0);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>float value = holdWProgress.getValue();<NEW_LINE>int keyCode = ponderKeybind().getKey().getValue();<NEW_LINE>long window = instance.getWindow().getWindow();<NEW_LINE>if (!subject && InputConstants.isKeyDown(window, keyCode)) {<NEW_LINE>if (value >= 1) {<NEW_LINE>if (currentScreen instanceof NavigatableSimiScreen)<NEW_LINE>((NavigatableSimiScreen) currentScreen).centerScalingOnMouse();<NEW_LINE>ScreenOpener.transitionTo(PonderUI.of(trackingStack));<NEW_LINE>holdWProgress.startWithValue(0);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>holdWProgress.setValue(Math.min(1, value + Math.max(<MASK><NEW_LINE>} else<NEW_LINE>holdWProgress.setValue(Math.max(0, value - .05f));<NEW_LINE>hoveredStack = ItemStack.EMPTY;<NEW_LINE>}
.25f, value) * .25f));
1,769,611
public static void fetchViewers(final SiteModel site, final int offset, final FetchViewersCallback callback) {<NEW_LINE>RestRequest.Listener listener = new RestRequest.Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(JSONObject jsonObject) {<NEW_LINE>if (jsonObject != null && callback != null) {<NEW_LINE>try {<NEW_LINE>JSONArray jsonArray = jsonObject.getJSONArray("viewers");<NEW_LINE>List<Person> people = peopleListFromJSON(jsonArray, site.getId(<MASK><NEW_LINE>int numberOfUsers = jsonObject.optInt("found");<NEW_LINE>boolean isEndOfList = (people.size() + offset) >= numberOfUsers;<NEW_LINE>callback.onSuccess(people, isEndOfList);<NEW_LINE>} catch (JSONException e) {<NEW_LINE>AppLog.e(T.API, "JSON exception occurred while parsing the response for " + "sites/%s/viewers: " + e);<NEW_LINE>callback.onError();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>RestRequest.ErrorListener errorListener = new RestRequest.ErrorListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onErrorResponse(VolleyError volleyError) {<NEW_LINE>AppLog.e(T.API, volleyError);<NEW_LINE>if (callback != null) {<NEW_LINE>callback.onError();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>int page = (offset / FETCH_LIMIT) + 1;<NEW_LINE>Map<String, String> params = new HashMap<>();<NEW_LINE>params.put("number", Integer.toString(FETCH_LIMIT));<NEW_LINE>params.put("page", Integer.toString(page));<NEW_LINE>String path = String.format(Locale.US, "sites/%d/viewers", site.getSiteId());<NEW_LINE>WordPress.getRestClientUtilsV1_1().get(path, params, null, listener, errorListener);<NEW_LINE>}
), Person.PersonType.VIEWER);
197,832
private void processParam(Element element, T holder) {<NEW_LINE>ExecutableElement method = (ExecutableElement) element.getEnclosingElement();<NEW_LINE>List<? extends VariableElement> parameters = method.getParameters();<NEW_LINE>List<ParamHelper> parameterList = methodParameterMap.get(method);<NEW_LINE>JBlock targetBlock = methodBlockMap.get(method);<NEW_LINE>int paramCount = parameters.size();<NEW_LINE>if (parameterList == null) {<NEW_LINE>parameterList = new ArrayList<>();<NEW_LINE>methodParameterMap.put(method, parameterList);<NEW_LINE>}<NEW_LINE>if (targetBlock == null) {<NEW_LINE>targetBlock = createBlock(holder, true);<NEW_LINE>methodBlockMap.put(method, targetBlock);<NEW_LINE>}<NEW_LINE>for (int paramIndex = 0; paramIndex < paramCount; paramIndex++) {<NEW_LINE>VariableElement param = parameters.get(paramIndex);<NEW_LINE>if (param.equals(element)) {<NEW_LINE>AbstractJClass type = codeModelHelper.typeMirrorToJClass(param.asType());<NEW_LINE>JVar fieldRef = targetBlock.decl(type, param.getSimpleName().toString(), getDefault(param.asType()));<NEW_LINE>handler.assignValue(targetBlock, fieldRef, holder, param, param);<NEW_LINE>parameterList.add(new ParamHelper(fieldRef, paramIndex, param));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (parameterList.size() == paramCount) {<NEW_LINE>String methodName = method.getSimpleName().toString();<NEW_LINE>Collections.sort(parameterList);<NEW_LINE>JInvocation invocation = JExpr.invoke(methodName);<NEW_LINE>for (ParamHelper parameter : parameterList) {<NEW_LINE>invocation.arg(parameter.beanInstance);<NEW_LINE>}<NEW_LINE>targetBlock.add(invocation);<NEW_LINE>if (handler instanceof MethodInjectionHandler.AfterAllParametersInjectedHandler<?>) {<NEW_LINE>((MethodInjectionHandler.AfterAllParametersInjectedHandler<T>) handler).<MASK><NEW_LINE>}<NEW_LINE>methodParameterMap.remove(method);<NEW_LINE>}<NEW_LINE>}
afterAllParametersInjected(holder, method, parameterList);
1,742,313
public SidewalkListDevice unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SidewalkListDevice sidewalkListDevice = new SidewalkListDevice();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("AmazonId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sidewalkListDevice.setAmazonId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("SidewalkId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sidewalkListDevice.setSidewalkId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("SidewalkManufacturingSn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sidewalkListDevice.setSidewalkManufacturingSn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("DeviceCertificates", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sidewalkListDevice.setDeviceCertificates(new ListUnmarshaller<CertificateList>(CertificateListJsonUnmarshaller.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 sidewalkListDevice;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,359,648
public static String restoreDatabaseInternal(final Context context, final Uri databaseUri) {<NEW_LINE>final File tmpFile = ContentStorage.get().writeUriToTempFile(databaseUri, "backup_db.tmp");<NEW_LINE>DBRestoreResult result = DBRestoreResult.RESTORE_FAILED_GENERAL;<NEW_LINE>try {<NEW_LINE>final SQLiteDatabase backup = SQLiteDatabase.openDatabase(tmpFile.getPath(), null, SQLiteDatabase.OPEN_READONLY);<NEW_LINE>final int backupDbVersion = backup.getVersion();<NEW_LINE>final int expectedDbVersion = DataStore.getExpectedDBVersion();<NEW_LINE>if (!DataStore.versionsAreCompatible(backup, backupDbVersion, expectedDbVersion)) {<NEW_LINE>return String.format(context.getString(R.string.init_restore_version_error), expectedDbVersion, backupDbVersion);<NEW_LINE>}<NEW_LINE>closeDb();<NEW_LINE>result = FileUtils.copy(tmpFile, databasePath()) <MASK><NEW_LINE>init();<NEW_LINE>if (newlyCreatedDatabase) {<NEW_LINE>result = DBRestoreResult.RESTORE_FAILED_DBRECREATED;<NEW_LINE>Log.e("restored DB seems to be corrupt, needed to recreate database from scratch");<NEW_LINE>}<NEW_LINE>if (result == DBRestoreResult.RESTORE_SUCCESSFUL) {<NEW_LINE>Log.i("Database successfully restored from " + tmpFile.getPath());<NEW_LINE>} else {<NEW_LINE>Log.e("Could not restore database from " + tmpFile.getPath());<NEW_LINE>}<NEW_LINE>} catch (SQLiteException e) {<NEW_LINE>Log.e("error while restoring database: ", e);<NEW_LINE>} finally {<NEW_LINE>tmpFile.delete();<NEW_LINE>}<NEW_LINE>return context.getString(result.res);<NEW_LINE>}
? DBRestoreResult.RESTORE_SUCCESSFUL : DBRestoreResult.RESTORE_FAILED_GENERAL;
995,755
private static Map<Long, ECPublicKey> parsePublicKeysJson(String publicKeysJson) throws GeneralSecurityException {<NEW_LINE>Map<Long, ECPublicKey> publicKeys = new HashMap<>();<NEW_LINE>try {<NEW_LINE>JsonArray keys = JsonParser.parseString(publicKeysJson).getAsJsonObject().get("keys").getAsJsonArray();<NEW_LINE>for (int i = 0; i < keys.size(); i++) {<NEW_LINE>JsonObject key = keys.get(i).getAsJsonObject();<NEW_LINE>publicKeys.put(key.get("keyId").getAsLong(), EllipticCurves.getEcPublicKey(Base64.decode(key.get("base64"<MASK><NEW_LINE>}<NEW_LINE>} catch (JsonParseException | IllegalStateException e) {<NEW_LINE>throw new GeneralSecurityException("failed to extract trusted signing public keys", e);<NEW_LINE>}<NEW_LINE>if (publicKeys.isEmpty()) {<NEW_LINE>throw new GeneralSecurityException("no trusted keys are available for this protocol version");<NEW_LINE>}<NEW_LINE>return publicKeys;<NEW_LINE>}
).getAsString())));
1,810,690
protected ObjectNode createPropertiesNode(FlowElement flowElement, ObjectNode flowElementNode, ObjectMapper objectMapper) {<NEW_LINE>UserTask userTask = (UserTask) flowElement;<NEW_LINE>ObjectNode taskNameNode = objectMapper.createObjectNode();<NEW_LINE>putPropertyValue(BPMN_MODEL_VALUE, userTask.getName(), taskNameNode);<NEW_LINE>putPropertyValue(DYNAMIC_VALUE, flowElementNode.path(USER_TASK_NAME), taskNameNode);<NEW_LINE>ObjectNode assigneeNode = objectMapper.createObjectNode();<NEW_LINE>putPropertyValue(BPMN_MODEL_VALUE, userTask.getAssignee(), assigneeNode);<NEW_LINE>putPropertyValue(DYNAMIC_VALUE, flowElementNode.path(USER_TASK_ASSIGNEE), assigneeNode);<NEW_LINE>ObjectNode candidateUsersNode = objectMapper.createObjectNode();<NEW_LINE>putPropertyValue(BPMN_MODEL_VALUE, userTask.getCandidateUsers(), candidateUsersNode);<NEW_LINE>putPropertyValue(DYNAMIC_VALUE, flowElementNode.path(USER_TASK_CANDIDATE_USERS), candidateUsersNode);<NEW_LINE>ObjectNode candidateGroupsNode = objectMapper.createObjectNode();<NEW_LINE>putPropertyValue(BPMN_MODEL_VALUE, <MASK><NEW_LINE>putPropertyValue(DYNAMIC_VALUE, flowElementNode.path(USER_TASK_CANDIDATE_GROUPS), candidateGroupsNode);<NEW_LINE>ObjectNode propertiesNode = objectMapper.createObjectNode();<NEW_LINE>propertiesNode.set(USER_TASK_NAME, taskNameNode);<NEW_LINE>propertiesNode.set(USER_TASK_ASSIGNEE, assigneeNode);<NEW_LINE>propertiesNode.set(USER_TASK_CANDIDATE_USERS, candidateUsersNode);<NEW_LINE>propertiesNode.set(USER_TASK_CANDIDATE_GROUPS, candidateGroupsNode);<NEW_LINE>return propertiesNode;<NEW_LINE>}
userTask.getCandidateGroups(), candidateGroupsNode);
1,663,974
public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@public @buseventtype create objectarray schema MyEventTwo (g1 String, d1 String, d2 String, val int);\n" + "@name('s0') select sum(val) as c0, sum(val, group_by: d1) as c1, sum(val, group_by: d2) as c2 from MyEventTwo group by g1";<NEW_LINE>env.compileDeploy(epl, new RegressionPath()).addListener("s0");<NEW_LINE>String[] <MASK><NEW_LINE>env.sendEventObjectArray(new Object[] { "E1", "E1", "E1", 10 }, "MyEventTwo");<NEW_LINE>env.assertPropsNew("s0", cols, new Object[] { 10, 10, 10 });<NEW_LINE>env.sendEventObjectArray(new Object[] { "E1", "E1", "E2", 11 }, "MyEventTwo");<NEW_LINE>env.assertPropsNew("s0", cols, new Object[] { 21, 21, 11 });<NEW_LINE>env.sendEventObjectArray(new Object[] { "E1", "E2", "E1", 12 }, "MyEventTwo");<NEW_LINE>env.assertPropsNew("s0", cols, new Object[] { 33, 12, 22 });<NEW_LINE>env.sendEventObjectArray(new Object[] { "X", "E1", "E1", 13 }, "MyEventTwo");<NEW_LINE>env.assertPropsNew("s0", cols, new Object[] { 13, 10 + 11 + 13, 10 + 12 + 13 });<NEW_LINE>env.sendEventObjectArray(new Object[] { "E1", "E2", "E3", 14 }, "MyEventTwo");<NEW_LINE>env.assertPropsNew("s0", cols, new Object[] { 10 + 11 + 12 + 14, 12 + 14, 14 });<NEW_LINE>env.undeployAll();<NEW_LINE>}
cols = "c0,c1,c2".split(",");
83,991
public byte[] serialize(String json) {<NEW_LINE>try {<NEW_LINE>JSONObject jsonObject = new JSONObject(json);<NEW_LINE>jsonSchema.validate(jsonObject);<NEW_LINE>} catch (JsonProcessingException e) {<NEW_LINE>String errorMsg = String.format("Provided json [%s] is not valid according to schema", json);<NEW_LINE>log.error(errorMsg);<NEW_LINE>throw new RuntimeException(errorMsg, e);<NEW_LINE>} catch (ValidationException e) {<NEW_LINE>String validationErrorMsg = String.format("Provided json message is not valid according to jsonSchema (id=%d): %s", schemaId, e.getMessage());<NEW_LINE>throw new IllegalArgumentException(validationErrorMsg);<NEW_LINE>}<NEW_LINE>try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {<NEW_LINE>out.write(schemaRegistryType.getMagicByte());<NEW_LINE>out.write(ByteBuffer.allocate(idSize).putInt<MASK><NEW_LINE>out.write(json.getBytes(StandardCharsets.UTF_8));<NEW_LINE>byte[] bytes = out.toByteArray();<NEW_LINE>out.close();<NEW_LINE>return bytes;<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(String.format("Could not serialize json [%s]", json), e);<NEW_LINE>}<NEW_LINE>}
(schemaId).array());
1,830,547
public void sendNotificationScheduled(Bundle bundle) {<NEW_LINE>String intentClassName = getMainActivityClassName();<NEW_LINE>if (intentClassName == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String notificationId = bundle.getString("id");<NEW_LINE>if (notificationId == null) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Long fireDate = bundle.getLong("fire_date", -1);<NEW_LINE>if (fireDate == -1) {<NEW_LINE>fireDate = (long) bundle.getDouble("fire_date", -1);<NEW_LINE>}<NEW_LINE>if (fireDate == -1) {<NEW_LINE>Log.e(TAG, "failed to schedule notification because fire date is missing");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Intent notificationIntent = new Intent(mContext, FIRLocalMessagingPublisher.class);<NEW_LINE>notificationIntent.putExtras(bundle);<NEW_LINE>PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, notificationId.hashCode(), notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);<NEW_LINE>Long interval = null;<NEW_LINE>switch(bundle.getString("repeat_interval", "")) {<NEW_LINE>case "minute":<NEW_LINE>interval = (long) 60000;<NEW_LINE>break;<NEW_LINE>case "hour":<NEW_LINE>interval = AlarmManager.INTERVAL_HOUR;<NEW_LINE>break;<NEW_LINE>case "day":<NEW_LINE>interval = AlarmManager.INTERVAL_DAY;<NEW_LINE>break;<NEW_LINE>case "week":<NEW_LINE>interval = AlarmManager.INTERVAL_DAY * 7;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (interval != null) {<NEW_LINE>getAlarmManager().setRepeating(AlarmManager.RTC_WAKEUP, fireDate, interval, pendingIntent);<NEW_LINE>} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {<NEW_LINE>getAlarmManager().setExact(AlarmManager.RTC_WAKEUP, fireDate, pendingIntent);<NEW_LINE>} else {<NEW_LINE>getAlarmManager().set(AlarmManager.RTC_WAKEUP, fireDate, pendingIntent);<NEW_LINE>}<NEW_LINE>// store intent<NEW_LINE>SharedPreferences.Editor editor = sharedPreferences.edit();<NEW_LINE>try {<NEW_LINE>JSONObject json = BundleJSONConverter.convertToJSON(bundle);<NEW_LINE>editor.putString(notificationId, json.toString());<NEW_LINE>editor.apply();<NEW_LINE>} catch (JSONException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
Log.e(TAG, "failed to schedule notification because id is missing");
1,740,572
private String build(AppConsole console) throws Exception {<NEW_LINE>String[] imageIds = new String[BUILT_IMAGE_MESSAGE_PATS.length];<NEW_LINE>File directory = new File(project.getLocation().toString());<NEW_LINE>String[] command = getBuildCommand(directory);<NEW_LINE>ProcessBuilder builder = new ProcessBuilder(command).directory(directory);<NEW_LINE>String jhome = getJavaHome();<NEW_LINE>builder.environment(<MASK><NEW_LINE>console.write("build.env.JAVA_HOME=" + jhome, LogType.STDOUT);<NEW_LINE>console.write("build.directory=" + directory, LogType.STDOUT);<NEW_LINE>console.logCommand(CommandUtil.escape(command));<NEW_LINE>Process process = builder.start();<NEW_LINE>LineBasedStreamGobler outputGobler = new LineBasedStreamGobler(process.getInputStream(), (line) -> {<NEW_LINE>System.out.println(line);<NEW_LINE>for (int i = 0; i < BUILT_IMAGE_MESSAGE_PATS.length; i++) {<NEW_LINE>Matcher matcher = BUILT_IMAGE_MESSAGE_PATS[i].matcher(line);<NEW_LINE>if (matcher.find()) {<NEW_LINE>imageIds[i] = matcher.group(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>console.write(line, LogType.APP_OUT);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.log(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>new LineBasedStreamGobler(process.getErrorStream(), (line) -> {<NEW_LINE>try {<NEW_LINE>console.write(line, LogType.APP_ERROR);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.log(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>int exitCode = process.waitFor();<NEW_LINE>if (exitCode != 0) {<NEW_LINE>throw new IOException("Command execution failed!");<NEW_LINE>}<NEW_LINE>outputGobler.join();<NEW_LINE>String imageTag = null;<NEW_LINE>for (String found : imageIds) {<NEW_LINE>if (found != null) {<NEW_LINE>imageTag = found;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (imageTag == null) {<NEW_LINE>throw new MissingBuildTagException(BUILT_IMAGE_MESSAGE_PATS);<NEW_LINE>}<NEW_LINE>if (imageTag.startsWith(DOCKER_IO_LIBRARY)) {<NEW_LINE>imageTag = imageTag.substring(DOCKER_IO_LIBRARY.length());<NEW_LINE>}<NEW_LINE>// List<Image> images = client.listImagesCmd().withImageNameFilter(imageTag).exec();<NEW_LINE>ListImagesCmd listImagesCmd = client.listImagesCmd();<NEW_LINE>listImagesCmd.getFilters().put("reference", Arrays.asList(imageTag));<NEW_LINE>List<Image> images = listImagesCmd.exec();<NEW_LINE>if (images.isEmpty()) {<NEW_LINE>// maybe the 'imageTag' is not actually a tag but an id/hash.<NEW_LINE>InspectImageResponse inspect = client.inspectImageCmd(imageTag).exec();<NEW_LINE>addPersistedImage(inspect.getId());<NEW_LINE>} else {<NEW_LINE>for (Image img : images) {<NEW_LINE>addPersistedImage(img.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return imageTag;<NEW_LINE>}
).put("JAVA_HOME", jhome);
278,116
public static void checkNeedForEnclosingInstanceCast(BlockScope scope, Expression enclosingInstance, TypeBinding enclosingInstanceType, TypeBinding memberType) {<NEW_LINE>if (scope.compilerOptions().getSeverity(CompilerOptions.UnnecessaryTypeCheck) == ProblemSeverities.Ignore)<NEW_LINE>return;<NEW_LINE>TypeBinding castedExpressionType = ((<MASK><NEW_LINE>// cannot do better<NEW_LINE>if (castedExpressionType == null)<NEW_LINE>return;<NEW_LINE>// obvious identity cast<NEW_LINE>if (TypeBinding.equalsEquals(castedExpressionType, enclosingInstanceType)) {<NEW_LINE>scope.problemReporter().unnecessaryCast((CastExpression) enclosingInstance);<NEW_LINE>} else if (castedExpressionType == TypeBinding.NULL) {<NEW_LINE>// tolerate null enclosing instance cast<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>TypeBinding alternateEnclosingInstanceType = castedExpressionType;<NEW_LINE>// error case<NEW_LINE>if (castedExpressionType.isBaseType() || castedExpressionType.isArrayType())<NEW_LINE>return;<NEW_LINE>if (TypeBinding.equalsEquals(memberType, scope.getMemberType(memberType.sourceName(), (ReferenceBinding) alternateEnclosingInstanceType))) {<NEW_LINE>scope.problemReporter().unnecessaryCast((CastExpression) enclosingInstance);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
CastExpression) enclosingInstance).expression.resolvedType;
1,020,177
protected static String[] handleNodeLabeling(String[] argArray) {<NEW_LINE>// HadoopSparkJob will set env var on this process if we enable node labeling policy for spark jobtype.<NEW_LINE>// We also detect the yarn cluster settings has enable node labeling<NEW_LINE>// Enabling node labeling policy for spark job type is different from enabling node labeling<NEW_LINE>// feature for Yarn. This config inside Spark job type is to enforce node labeling feature for all<NEW_LINE>// Spark applications submitted via Azkaban Spark job type.<NEW_LINE>Configuration conf = new Configuration();<NEW_LINE>boolean nodeLabelingYarn = conf.getBoolean(YARN_CONF_NODE_LABELING_ENABLED, false);<NEW_LINE>String nodeLabelingProp = System.getenv(HadoopSparkJob.SPARK_NODE_LABELING_ENV_VAR);<NEW_LINE>boolean nodeLabelingPolicy = nodeLabelingProp != null && nodeLabelingProp.equals(Boolean.TRUE.toString());<NEW_LINE>String autoNodeLabelProp = System.getenv(HadoopSparkJob.SPARK_AUTO_NODE_LABELING_ENV_VAR);<NEW_LINE>boolean autoNodeLabeling = autoNodeLabelProp != null && autoNodeLabelProp.equals(Boolean.TRUE.toString());<NEW_LINE>String desiredNodeLabel = System.getenv(HadoopSparkJob.SPARK_DESIRED_NODE_LABEL_ENV_VAR);<NEW_LINE>SparkConf sparkConf = getSparkProperties();<NEW_LINE>if (nodeLabelingYarn && nodeLabelingPolicy) {<NEW_LINE>ignoreUserSpecifiedNodeLabelParameter(argArray, autoNodeLabeling);<NEW_LINE>// If auto node labeling is enabled, automatically sets spark.yarn.executor.nodeLabelExpression<NEW_LINE>// config based on user requested resources.<NEW_LINE>if (autoNodeLabeling) {<NEW_LINE>if (isLargeContainerRequired(argArray, conf, sparkConf)) {<NEW_LINE>LinkedList<String> argList = new LinkedList<String>(Arrays.asList(argArray));<NEW_LINE>argList.<MASK><NEW_LINE>argList.addFirst(SparkJobArg.SPARK_CONF_PREFIX.sparkParamName);<NEW_LINE>argArray = argList.toArray(new String[argList.size()]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return argArray;<NEW_LINE>}
addFirst(SPARK_EXECUTOR_NODE_LABEL_EXP + "=" + desiredNodeLabel);
421,551
static Geometry symmetricDifference(Geometry geometry_a, Geometry geometry_b, SpatialReference spatial_reference, ProgressTracker progress_tracker) {<NEW_LINE>int dim_a = geometry_a.getDimension();<NEW_LINE>int dim_b = geometry_b.getDimension();<NEW_LINE>if (geometry_a.isEmpty() && geometry_b.isEmpty())<NEW_LINE>return dim_a > dim_b ? geometry_a : geometry_b;<NEW_LINE>if (geometry_a.isEmpty())<NEW_LINE>return geometry_b;<NEW_LINE>if (geometry_b.isEmpty())<NEW_LINE>return geometry_a;<NEW_LINE>Envelope2D env_a = new Envelope2D(), env_b = new Envelope2D(), env_merged = new Envelope2D();<NEW_LINE>geometry_a.queryEnvelope2D(env_a);<NEW_LINE>geometry_b.queryEnvelope2D(env_b);<NEW_LINE>env_merged.setCoords(env_a);<NEW_LINE>env_merged.merge(env_b);<NEW_LINE>double tolerance = InternalUtils.calculateToleranceFromGeometry(spatial_reference, env_merged, false);<NEW_LINE>int type_a = geometry_a.getType().value();<NEW_LINE>int type_b = geometry_b.getType().value();<NEW_LINE>if (type_a == Geometry.GeometryType.Point && type_b == Geometry.GeometryType.Point)<NEW_LINE>return pointSymDiffPoint_((Point) (geometry_a), (Point) (geometry_b), tolerance, progress_tracker);<NEW_LINE>if (type_a != type_b) {<NEW_LINE>if (dim_a > 0 || dim_b > 0)<NEW_LINE>return dim_a > dim_b ? geometry_a : geometry_b;<NEW_LINE>// Multi_point/Point case<NEW_LINE>if (type_a == Geometry.GeometryType.MultiPoint)<NEW_LINE>return multiPointSymDiffPoint_((MultiPoint) (geometry_a), (Point) (geometry_b), tolerance, progress_tracker);<NEW_LINE>return multiPointSymDiffPoint_((MultiPoint) (geometry_b), (Point) (geometry_a), tolerance, progress_tracker);<NEW_LINE>}<NEW_LINE>return TopologicalOperations.symmetricDifference(<MASK><NEW_LINE>}
geometry_a, geometry_b, spatial_reference, progress_tracker);
9,052
public ASTNode generateWhitespaceBetweenTokens(ASTNode left, ASTNode right) {<NEW_LINE>Language l = PsiUtilCore.getNotAnyLanguage(left);<NEW_LINE>Language rightLang = PsiUtilCore.getNotAnyLanguage(right);<NEW_LINE>if (rightLang.isKindOf(l)) {<NEW_LINE>// get more precise lexer<NEW_LINE>l = rightLang;<NEW_LINE>}<NEW_LINE>final ParserDefinition parserDefinition = LanguageParserDefinitions.INSTANCE.forLanguage(l);<NEW_LINE>if (parserDefinition != null) {<NEW_LINE>PsiManager manager = right.getTreeParent().getPsi().getManager();<NEW_LINE>ASTNode generatedWhitespace;<NEW_LINE>switch(parserDefinition.spaceExistenceTypeBetweenTokens(left, right)) {<NEW_LINE>case MUST:<NEW_LINE>generatedWhitespace = Factory.createSingleLeafElement(TokenType.WHITE_SPACE, " ", 0, 1, null, manager);<NEW_LINE>break;<NEW_LINE>case MUST_LINE_BREAK:<NEW_LINE>generatedWhitespace = Factory.createSingleLeafElement(TokenType.WHITE_SPACE, "\n", <MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>generatedWhitespace = null;<NEW_LINE>}<NEW_LINE>return generatedWhitespace;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
0, 1, null, manager);
1,228,415
public static List<String> prepareQueries(List<PublishQueueElement> bundle) {<NEW_LINE>StringBuilder assetBuffer = new StringBuilder();<NEW_LINE>List<String> assets;<NEW_LINE>assets = new ArrayList<String>();<NEW_LINE>if (bundle.size() == 1 && bundle.get(0).getType().equals("contentlet")) {<NEW_LINE>assetBuffer.append("+" + IDENTIFIER).append(bundle.get(0).getAsset());<NEW_LINE>assets.add(assetBuffer.toString() + " +live:true");<NEW_LINE>assets.add(<MASK><NEW_LINE>} else {<NEW_LINE>int counter = 1;<NEW_LINE>PublishQueueElement c;<NEW_LINE>for (int ii = 0; ii < bundle.size(); ii++) {<NEW_LINE>c = bundle.get(ii);<NEW_LINE>if (!c.getType().equals("contentlet")) {<NEW_LINE>if ((counter == _ASSET_LENGTH_LIMIT || (ii + 1 == bundle.size())) && !assetBuffer.toString().isEmpty()) {<NEW_LINE>assets.add("+(" + assetBuffer.toString() + ") +live:true");<NEW_LINE>assets.add("+(" + assetBuffer.toString() + ") +working:true");<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>assetBuffer.append(IDENTIFIER).append(c.getAsset());<NEW_LINE>assetBuffer.append(" ");<NEW_LINE>if (counter == _ASSET_LENGTH_LIMIT || (ii + 1 == bundle.size())) {<NEW_LINE>assets.add("+(" + assetBuffer.toString() + ") +live:true");<NEW_LINE>assets.add("+(" + assetBuffer.toString() + ") +working:true");<NEW_LINE>assetBuffer = new StringBuilder();<NEW_LINE>counter = 0;<NEW_LINE>} else<NEW_LINE>counter++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return assets;<NEW_LINE>}
assetBuffer.toString() + " +working:true");
1,450,788
private static EventType resolveOrCreateType(EPTypeClass clazz, StatementCompileTimeServices services) {<NEW_LINE>services.getEventTypeCompileTimeResolver();<NEW_LINE>// find module-own type<NEW_LINE>Collection<EventType> moduleTypes = services.getEventTypeCompileTimeRegistry().getNewTypesAdded();<NEW_LINE>for (EventType eventType : moduleTypes) {<NEW_LINE>if (matches(eventType, clazz)) {<NEW_LINE>return eventType;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// find path types<NEW_LINE>PathRegistry<String, EventType> pathRegistry = services.getEventTypeCompileTimeResolver().getPath();<NEW_LINE>List<EventType> found = new ArrayList<>();<NEW_LINE>pathRegistry.traverse(eventType -> {<NEW_LINE>if (matches(eventType, clazz)) {<NEW_LINE>found.add(eventType);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (found.size() > 1) {<NEW_LINE>throw new EPException("Found multiple parent types in path for classs '" + clazz + "'");<NEW_LINE>}<NEW_LINE>if (!found.isEmpty()) {<NEW_LINE>return found.get(0);<NEW_LINE>}<NEW_LINE>return services.getBeanEventTypeFactoryPrivate(<MASK><NEW_LINE>}
).getCreateBeanType(clazz, false);
417,421
public ModelAndView handle(Request request, Response response) {<NEW_LINE>String username = request.session().attribute("username");<NEW_LINE>String currentPassword = request.queryParams("password");<NEW_LINE>String <MASK><NEW_LINE>String newPasswordRepeat = request.queryParams("new_password_repeat");<NEW_LINE>if (newPassword.equals(newPasswordRepeat)) {<NEW_LINE>if (username != null && GameServer.INSTANCE.getUserManager().validateUser(username, currentPassword)) {<NEW_LINE>try {<NEW_LINE>GameServer.INSTANCE.getUserManager().changePassword(username, newPassword);<NEW_LINE>AlertMessage[] messages = { new AlertMessage("Changed password", AlertType.SUCCESS) };<NEW_LINE>request.session().attribute("messages", messages);<NEW_LINE>} catch (RegistrationException e) {<NEW_LINE>AlertMessage[] messages = { new AlertMessage(e.getMessage(), AlertType.DANGER) };<NEW_LINE>request.session().attribute("messages", messages);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>AlertMessage[] messages = { new AlertMessage("Invalid password", AlertType.DANGER) };<NEW_LINE>request.session().attribute("messages", messages);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>AlertMessage[] messages = { new AlertMessage("Passwords did not match", AlertType.DANGER) };<NEW_LINE>request.session().attribute("messages", messages);<NEW_LINE>}<NEW_LINE>response.redirect("/account");<NEW_LINE>return null;<NEW_LINE>}
newPassword = request.queryParams("new_password");
244,300
final DescribeScriptResult executeDescribeScript(DescribeScriptRequest describeScriptRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeScriptRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeScriptRequest> request = null;<NEW_LINE>Response<DescribeScriptResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeScriptRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeScriptRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GameLift");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeScript");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeScriptResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeScriptResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
257,991
public void preparedData() {<NEW_LINE>AlterTableGroupDropPartition alterTableGroupDropPartition = (AlterTableGroupDropPartition) relDdl;<NEW_LINE>String tableGroupName = alterTableGroupDropPartition.getTableGroupName();<NEW_LINE>String tableName = alterTableGroupDropPartition.getTableName().toString();<NEW_LINE>SqlAlterTableGroup sqlAlterTableGroup = (SqlAlterTableGroup) alterTableGroupDropPartition.getAst();<NEW_LINE>SqlAlterTableDropPartition sqlAlterTableDropPartition = (SqlAlterTableDropPartition) sqlAlterTableGroup.getAlters().get(0);<NEW_LINE>List<GroupDetailInfoExRecord> <MASK><NEW_LINE>preparedData = new AlterTableGroupDropPartitionPreparedData();<NEW_LINE>preparedData.setTableGroupName(tableGroupName);<NEW_LINE>preparedData.setSchemaName(schemaName);<NEW_LINE>preparedData.setTableName(tableName);<NEW_LINE>preparedData.setWithHint(targetTablesHintCache != null);<NEW_LINE>preparedData.setTargetGroupDetailInfoExRecords(targetGroupDetailInfoExRecords);<NEW_LINE>preparedData.setOldPartitionNames(sqlAlterTableDropPartition.getPartitionNames().stream().map(o -> ((SqlIdentifier) o).getSimple()).collect(Collectors.toList()));<NEW_LINE>preparedData.prepareInvisiblePartitionGroup();<NEW_LINE>List<String> newPartitionNames = preparedData.getInvisiblePartitionGroups().stream().map(o -> o.getPartition_name()).collect(Collectors.toList());<NEW_LINE>preparedData.setNewPartitionNames(newPartitionNames);<NEW_LINE>preparedData.setTaskType(ComplexTaskMetaManager.ComplexTaskType.DROP_PARTITION);<NEW_LINE>}
targetGroupDetailInfoExRecords = TableGroupLocation.getOrderedGroupList(schemaName);
353,903
public void onPrepareOptionsMenu(@NonNull Menu menu) {<NEW_LINE>super.onPrepareOptionsMenu(menu);<NEW_LINE>CollapsingToolbarLayout collapsingToolbarLayout = requireView().findViewById(R.id.collapsingtoolbarlayout);<NEW_LINE>@SuppressWarnings("RestrictTo")<NEW_LINE>int maxLines = collapsingToolbarLayout.getMaxLines();<NEW_LINE>for (int i = 0; i < linesMap.size(); i++) {<NEW_LINE>int <MASK><NEW_LINE>int itemId = linesMap.keyAt(i);<NEW_LINE>MenuItem item = menu.findItem(itemId);<NEW_LINE>CharSequence title = getString(R.string.menu_max_lines, value);<NEW_LINE>if (maxLines == value) {<NEW_LINE>SpannableString spannable = new SpannableString(title);<NEW_LINE>spannable.setSpan(new ForegroundColorSpan(colorPrimary), 0, title.length(), 0);<NEW_LINE>title = spannable;<NEW_LINE>}<NEW_LINE>item.setTitle(title);<NEW_LINE>}<NEW_LINE>}
value = linesMap.valueAt(i);
1,633,040
public void handleCreationDict(KrollDict dict) {<NEW_LINE>// only supported on Android 7.1 and above<NEW_LINE>if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N_MR1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String id = null;<NEW_LINE>if (dict.containsKey(TiC.PROPERTY_ID)) {<NEW_LINE>id = dict.getString(TiC.PROPERTY_ID);<NEW_LINE>shortcutBuilder = new ShortcutInfo.Builder(context, id);<NEW_LINE>} else {<NEW_LINE>throw new Error("id is required to create a shortcut!");<NEW_LINE>}<NEW_LINE>// create shortcut intent<NEW_LINE>Intent intent = new Intent(TiApplication.getAppRootOrCurrentActivity().getIntent());<NEW_LINE>intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>intent.setAction(Intent.ACTION_VIEW);<NEW_LINE>intent.putExtra("shortcut", id);<NEW_LINE>shortcutBuilder.setIntent(intent);<NEW_LINE>if (dict.containsKey(TiC.PROPERTY_TITLE)) {<NEW_LINE>shortcutBuilder.setShortLabel(dict.getString(TiC.PROPERTY_TITLE));<NEW_LINE>}<NEW_LINE>if (dict.containsKey(TiC.PROPERTY_DESCRIPTION)) {<NEW_LINE>shortcutBuilder.setLongLabel(dict.getString(TiC.PROPERTY_DESCRIPTION));<NEW_LINE>}<NEW_LINE>if (dict.containsKey(TiC.PROPERTY_ICON)) {<NEW_LINE>Object icon = dict.get(TiC.PROPERTY_ICON);<NEW_LINE>try {<NEW_LINE>if (icon instanceof Number) {<NEW_LINE>int resId = ((Number) icon).intValue();<NEW_LINE>shortcutBuilder.setIcon(Icon.createWithResource(context, resId));<NEW_LINE>} else if (icon instanceof String) {<NEW_LINE>final String uri = resolveUrl(null, (String) icon);<NEW_LINE>final TiBlob blob = TiBlob.blobFromFile(TiFileFactory.createTitaniumFile(uri, false));<NEW_LINE>final <MASK><NEW_LINE>if (bitmap != null) {<NEW_LINE>shortcutBuilder.setIcon(Icon.createWithBitmap(bitmap));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Log.w(TAG, "icon invalid, expecting resourceId (Number) or path (String)!");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Log.w(TAG, e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>shortcut = shortcutBuilder.build();<NEW_LINE>// obtain and update any pre-existing shortcuts<NEW_LINE>for (ShortcutInfo shortcut : new ArrayList<>(ShortcutItemProxy.shortcuts)) {<NEW_LINE>if (shortcut.getId().equals(this.shortcut.getId())) {<NEW_LINE>ShortcutItemProxy.shortcuts.remove(shortcut);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ShortcutItemProxy.shortcuts.add(shortcut);<NEW_LINE>super.handleCreationDict(dict);<NEW_LINE>}
Bitmap bitmap = blob.getImage();