idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
998,258
private void createEdges(int origEdgeKey, int origRevEdgeKey, GHPoint3D prevSnapped, int prevWayIndex, boolean isPillar, GHPoint3D currSnapped, int wayIndex, PointList fullPL, EdgeIteratorState closestEdge, int prevNodeId, int nodeId) {<NEW_LINE>int max = wayIndex + 1;<NEW_LINE>PointList basePoints = new PointList(max - prevWayIndex + 1, is3D);<NEW_LINE>basePoints.add(prevSnapped.lat, prevSnapped.lon, prevSnapped.ele);<NEW_LINE>for (int i = prevWayIndex; i < max; i++) {<NEW_LINE>basePoints.add(fullPL, i);<NEW_LINE>}<NEW_LINE>if (!isPillar) {<NEW_LINE>basePoints.add(currSnapped.lat, currSnapped.lon, currSnapped.ele);<NEW_LINE>}<NEW_LINE>// basePoints must have at least the size of 2 to make sure fetchWayGeometry(FetchMode.ALL) returns at least 2<NEW_LINE>assert basePoints.size() >= 2 : "basePoints must have at least two points";<NEW_LINE>PointList baseReversePoints = basePoints.clone(true);<NEW_LINE>double baseDistance = DistancePlaneProjection.DIST_PLANE.calcDistance(basePoints);<NEW_LINE>int virtEdgeId = firstVirtualEdgeId + queryOverlay.getNumVirtualEdges() / 2;<NEW_LINE>boolean reverse = closestEdge.get(EdgeIteratorState.REVERSE_STATE);<NEW_LINE>// edges between base and snapped point<NEW_LINE>VirtualEdgeIteratorState baseEdge = new VirtualEdgeIteratorState(origEdgeKey, GHUtility.createEdgeKey(virtEdgeId, false), prevNodeId, nodeId, baseDistance, closestEdge.getFlags(), closestEdge.getName(), basePoints, reverse);<NEW_LINE>VirtualEdgeIteratorState baseReverseEdge = new VirtualEdgeIteratorState(origRevEdgeKey, GHUtility.createEdgeKey(virtEdgeId, true), nodeId, prevNodeId, baseDistance, IntsRef.deepCopyOf(closestEdge.getFlags()), closestEdge.getName<MASK><NEW_LINE>baseEdge.setReverseEdge(baseReverseEdge);<NEW_LINE>baseReverseEdge.setReverseEdge(baseEdge);<NEW_LINE>queryOverlay.addVirtualEdge(baseEdge);<NEW_LINE>queryOverlay.addVirtualEdge(baseReverseEdge);<NEW_LINE>}
(), baseReversePoints, !reverse);
260,760
public void run() {<NEW_LINE>String configInfo;<NEW_LINE>try {<NEW_LINE>configInfo = HttpUtils.doGet(url, ImmutableMap.<String, String>builder().put(AUTHORIZATION, authorization).build());<NEW_LINE>List<List<String>> configs = GsonUtils.GSON.fromJson(configInfo, new TypeToken<List<List<String>>>() {<NEW_LINE>}.getType());<NEW_LINE>for (List<String> conf : configs) {<NEW_LINE>if (confNames == null || confNames.isEmpty() || confNames.contains(conf.get(0))) {<NEW_LINE>addConfig(conf);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>configRequestDoneSignal.markedCountDown(hostPort.first + ":" + hostPort.second, -1);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.warn("get config from {}:{} failed.", hostPort.<MASK><NEW_LINE>configRequestDoneSignal.countDown();<NEW_LINE>}<NEW_LINE>}
first, hostPort.second, e);
1,177,232
public StreamCopier create(String configuredSchema, AzureBlobStorageConfig azureBlobConfig, String stagingFolder, ConfiguredAirbyteStream configuredStream, ExtendedNameTransformer nameTransformer, JdbcDatabase db, SqlOperations sqlOperations) {<NEW_LINE>try {<NEW_LINE>AirbyteStream stream = configuredStream.getStream();<NEW_LINE>DestinationSyncMode syncMode = configuredStream.getDestinationSyncMode();<NEW_LINE>String schema = StreamCopierFactory.getSchema(stream.<MASK><NEW_LINE>String streamName = stream.getName();<NEW_LINE>final SpecializedBlobClientBuilder specializedBlobClientBuilder = new SpecializedBlobClientBuilder().endpoint(azureBlobConfig.getEndpointUrl()).sasToken(azureBlobConfig.getSasToken()).containerName(azureBlobConfig.getContainerName());<NEW_LINE>return create(stagingFolder, syncMode, schema, streamName, specializedBlobClientBuilder, db, azureBlobConfig, nameTransformer, sqlOperations);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}
getNamespace(), configuredSchema, nameTransformer);
535,506
final DBSecurityGroup executeCreateDBSecurityGroup(CreateDBSecurityGroupRequest createDBSecurityGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createDBSecurityGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateDBSecurityGroupRequest> request = null;<NEW_LINE>Response<DBSecurityGroup> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateDBSecurityGroupRequestMarshaller().marshall(super.beforeMarshalling(createDBSecurityGroupRequest));<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, "RDS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateDBSecurityGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DBSecurityGroup> responseHandler = new StaxResponseHandler<DBSecurityGroup>(new DBSecurityGroupStaxUnmarshaller());<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());
347,599
public boolean convert(String inputFile, String toName, boolean fixHTML, Map<String, String> notes) {<NEW_LINE>try {<NEW_LINE>final FileOutputStream out = new FileOutputStream(new File(toName));<NEW_LINE>ZipOutputStream zos = new ZipOutputStream(out);<NEW_LINE>zos.setLevel(0);<NEW_LINE><MASK><NEW_LINE>writeToZip(zos, "META-INF/container.xml", container_xml);<NEW_LINE>writeToZip(zos, "OEBPS/content.opf", content_opf);<NEW_LINE>String encoding = findHeaderEncoding(inputFile);<NEW_LINE>List<String> titles = getFb2Titles(inputFile, encoding);<NEW_LINE>String ncx = genetateNCX(titles);<NEW_LINE>writeToZip(zos, "OEBPS/fb2.ncx", ncx);<NEW_LINE>ByteArrayOutputStream generateFb2File = generateFb2File(inputFile, encoding, fixHTML, notes);<NEW_LINE>writeToZip(zos, "OEBPS/fb2.fb2", new ByteArrayInputStream(generateFb2File.toByteArray()));<NEW_LINE>LOG.d("Fb2Context convert true");<NEW_LINE>zos.close();<NEW_LINE>out.close();<NEW_LINE>return true;<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.d("Fb2Context convert false error");<NEW_LINE>LOG.e(e);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>LOG.e(e);<NEW_LINE>}<NEW_LINE>LOG.d("Fb2Context convert false");<NEW_LINE>return false;<NEW_LINE>}
writeToZip(zos, "mimetype", "application/epub+zip");
1,763,571
private void drawSample(String _title, String[] _xAxisLabels, String _xAxisTitle, String _yAxisTitle, double[][] _data, int _width, int _height, Graphics g) {<NEW_LINE>try {<NEW_LINE>if (_width == 0) {<NEW_LINE>_width = 450;<NEW_LINE>}<NEW_LINE>if (_height == 0) {<NEW_LINE>_height = 250;<NEW_LINE>}<NEW_LINE>this.setPreferredSize(new Dimension(_width, _height));<NEW_LINE>DataSeries dataSeries = new DataSeries(_xAxisLabels, _xAxisTitle, _yAxisTitle, _title);<NEW_LINE>String[] legendLabels = yAxisLabel;<NEW_LINE>Paint[] paints = this.createPaint(_data.length);<NEW_LINE>Shape[] shapes = createShapes(_data.length);<NEW_LINE>Stroke[] lstrokes = createStrokes(_data.length);<NEW_LINE>LineChartProperties lineChartProperties = new LineChartProperties(lstrokes, shapes);<NEW_LINE>AxisChartDataSet axisChartDataSet = new AxisChartDataSet(_data, legendLabels, paints, ChartType.LINE, lineChartProperties);<NEW_LINE>dataSeries.addIAxisPlotDataSet(axisChartDataSet);<NEW_LINE>ChartProperties chartProperties = new ChartProperties();<NEW_LINE>AxisProperties axisProperties = new AxisProperties();<NEW_LINE>// show the grid lines, to turn it off, set it to zero<NEW_LINE>axisProperties.getYAxisProperties().setShowGridLines(1);<NEW_LINE>axisProperties.setXAxisLabelsAreVertical(true);<NEW_LINE>// set the Y Axis to round<NEW_LINE>DataAxisProperties daxp = (DataAxisProperties) axisProperties.getYAxisProperties();<NEW_LINE>daxp.setRoundToNearest(1);<NEW_LINE>LegendProperties legendProperties = new LegendProperties();<NEW_LINE>AxisChart axisChart = new AxisChart(dataSeries, chartProperties, <MASK><NEW_LINE>axisChart.setGraphics2D((Graphics2D) g);<NEW_LINE>axisChart.render();<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Error while rendering axis chart. {}", e.getMessage());<NEW_LINE>}<NEW_LINE>}
axisProperties, legendProperties, _width, _height);
142,831
public void drawAnchor(UGraphic ug, CommonTile tile1, CommonTile tile2, ISkinParam skinParam) {<NEW_LINE>final double y1 = tile1.getY<MASK><NEW_LINE>final double y2 = tile2.getY() + tile2.getContactPointRelative();<NEW_LINE>final double xx1 = tile1.getMiddleX();<NEW_LINE>final double xx2 = tile2.getMiddleX();<NEW_LINE>final double x = (xx1 + xx2) / 2;<NEW_LINE>final double ymin = Math.min(y1, y2);<NEW_LINE>final double ymax = Math.max(y1, y2);<NEW_LINE>final HColor color;<NEW_LINE>final FontConfiguration fontConfiguration;<NEW_LINE>if (UseStyle.useBetaStyle()) {<NEW_LINE>final StyleSignatureBasic signature = StyleSignatureBasic.of(SName.root, SName.element, SName.sequenceDiagram, SName.arrow);<NEW_LINE>final Style style = signature.getMergedStyle(skinParam.getCurrentStyleBuilder());<NEW_LINE>color = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());<NEW_LINE>fontConfiguration = FontConfiguration.create(skinParam, style);<NEW_LINE>} else {<NEW_LINE>color = new Rose().getHtmlColor(skinParam, ColorParam.arrow);<NEW_LINE>fontConfiguration = FontConfiguration.create(skinParam, FontParam.ARROW, null);<NEW_LINE>}<NEW_LINE>final Rainbow rainbow = Rainbow.fromColor(color, null);<NEW_LINE>final Display display = Display.getWithNewlines(message);<NEW_LINE>final TextBlock title = display.create(fontConfiguration, HorizontalAlignment.CENTER, skinParam);<NEW_LINE>final Snake snake = Snake.create(skinParam, Arrows.asToUp(), rainbow, Arrows.asToDown()).withLabel(title, HorizontalAlignment.CENTER);<NEW_LINE>snake.addPoint(x, ymin + 2);<NEW_LINE>snake.addPoint(x, ymax - 2);<NEW_LINE>snake.drawInternal(ug);<NEW_LINE>}
() + tile1.getContactPointRelative();
593,651
public void executeAttack() {<NEW_LINE>// needs to execute the isVulnerable method to configure the workflow<NEW_LINE>// type<NEW_LINE>boolean vulnerable = isVulnerable();<NEW_LINE>LOGGER.info("Using the following oracle type: {}", vulnerableType);<NEW_LINE>if (!vulnerable) {<NEW_LINE>LOGGER.warn("The server is not vulnerable to the Bleichenbacher attack");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Config tlsConfig = getTlsConfig();<NEW_LINE>RSAPublicKey publicKey = (RSAPublicKey) CertificateFetcher.fetchServerPublicKey(tlsConfig);<NEW_LINE>if (publicKey == null) {<NEW_LINE>LOGGER.info("Could not retrieve PublicKey from Server - is the Server running?");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (config.getEncryptedPremasterSecret() == null) {<NEW_LINE>throw new ConfigurationException("You have to set the encrypted premaster secret you are " + "going to decrypt");<NEW_LINE>}<NEW_LINE>LOGGER.info("Fetched the following server public key: " + publicKey);<NEW_LINE>byte[] pms = ArrayConverter.hexStringToByteArray(config.getEncryptedPremasterSecret());<NEW_LINE>if ((pms.length * Bits.IN_A_BYTE) != publicKey.getModulus().bitLength()) {<NEW_LINE>throw new ConfigurationException("The length of the encrypted premaster secret you have " + "is not equal to the server public key length. Have you selected the correct value?");<NEW_LINE>}<NEW_LINE>RealDirectMessagePkcs1Oracle oracle = new RealDirectMessagePkcs1Oracle(publicKey, getTlsConfig(), extractValidFingerprint(publicKey, tlsConfig.getDefaultHighestClientProtocolVersion()), null, vulnerableType);<NEW_LINE>Bleichenbacher attacker = new Bleichenbacher(pms, <MASK><NEW_LINE>attacker.attack();<NEW_LINE>BigInteger solution = attacker.getSolution();<NEW_LINE>CONSOLE.info(solution.toString(16));<NEW_LINE>if (selfShutdown) {<NEW_LINE>executor.shutdown();<NEW_LINE>}<NEW_LINE>}
oracle, config.isMsgPkcsConform());
909,166
protected final Number openNonAssetNative(int cookie, String fileName, int accessMode) throws FileNotFoundException {<NEW_LINE>CppAssetManager am = assetManagerForJavaObject();<NEW_LINE>if (am == null) {<NEW_LINE>return RuntimeEnvironment.castNativePtr(0);<NEW_LINE>}<NEW_LINE>ALOGV(<MASK><NEW_LINE>String fileName8 = fileName;<NEW_LINE>if (fileName8 == null) {<NEW_LINE>return RuntimeEnvironment.castNativePtr(-1);<NEW_LINE>}<NEW_LINE>AccessMode mode = AccessMode.fromInt(accessMode);<NEW_LINE>if (mode != Asset.AccessMode.ACCESS_UNKNOWN && mode != Asset.AccessMode.ACCESS_RANDOM && mode != Asset.AccessMode.ACCESS_STREAMING && mode != Asset.AccessMode.ACCESS_BUFFER) {<NEW_LINE>throw new IllegalArgumentException("Bad access mode");<NEW_LINE>}<NEW_LINE>Asset a = isTruthy(cookie) ? am.openNonAsset(cookie, fileName8, mode) : am.openNonAsset(fileName8, mode, null);<NEW_LINE>if (a == null) {<NEW_LINE>throw new FileNotFoundException(fileName8);<NEW_LINE>}<NEW_LINE>long assetId = Registries.NATIVE_ASSET_REGISTRY.register(a);<NEW_LINE>// todo: something better than this [xw]<NEW_LINE>a.onClose = () -> destroyAsset(assetId);<NEW_LINE>// printf("Created Asset Stream: %p\n", a);<NEW_LINE>return RuntimeEnvironment.castNativePtr(assetId);<NEW_LINE>}
"openNonAssetNative in %s (Java object %s)\n", am, AssetManager.class);
962,257
/*<NEW_LINE>* Type entries are encoded as:<NEW_LINE>* simpleTypeName / packageName / enclosingTypeName / modifiers<NEW_LINE>* e.g. Object/java.lang//0<NEW_LINE>* e.g. Cloneable/java.lang//512<NEW_LINE>* e.g. LazyValue/javax.swing/UIDefaults/0<NEW_LINE>* or for secondary types as:<NEW_LINE>* simpleTypeName / packageName / enclosingTypeName / modifiers / S<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void decodeIndexKey(char[] key) {<NEW_LINE>int slash = CharOperation.indexOf(SEPARATOR, key, 0);<NEW_LINE>this.simpleName = CharOperation.subarray(key, 0, slash);<NEW_LINE>int start = ++slash;<NEW_LINE>if (key[start] == SEPARATOR) {<NEW_LINE>this.pkg = CharOperation.NO_CHAR;<NEW_LINE>} else {<NEW_LINE>slash = CharOperation.indexOf(SEPARATOR, key, start);<NEW_LINE>this.pkg = internedPackageNames.add(CharOperation.subarray(key, start, slash));<NEW_LINE>}<NEW_LINE>// Continue key read by the end to decode modifiers<NEW_LINE>int last = key.length - 1;<NEW_LINE>this.secondary = key[last] == 'S';<NEW_LINE>if (this.secondary) {<NEW_LINE>last -= 2;<NEW_LINE>}<NEW_LINE>this.modifiers = key[last - 1] + (key[last] << 16);<NEW_LINE>decodeModifiers();<NEW_LINE>// Retrieve enclosing type names<NEW_LINE>start = slash + 1;<NEW_LINE>// position of ending slash<NEW_LINE>last -= 2;<NEW_LINE>if (start == last) {<NEW_LINE>this.enclosingTypeNames = CharOperation.NO_CHAR_CHAR;<NEW_LINE>} else {<NEW_LINE>if (last == (start + 1) && key[start] == ZERO_CHAR) {<NEW_LINE>this.enclosingTypeNames = ONE_ZERO_CHAR;<NEW_LINE>} else {<NEW_LINE>this.enclosingTypeNames = CharOperation.splitOn(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
'.', key, start, last);
1,504,792
private static List<? extends TypeMirror> computeNewClass(Set<ElementKind> types, CompilationInfo info, TreePath parent, Tree error, int offset) {<NEW_LINE>NewClassTree nct = (NewClassTree) parent.getLeaf();<NEW_LINE>boolean errorInRealArguments = false;<NEW_LINE>for (Tree param : nct.getArguments()) {<NEW_LINE>errorInRealArguments |= param == error;<NEW_LINE>}<NEW_LINE>if (errorInRealArguments) {<NEW_LINE>List<TypeMirror> proposedTypes = new ArrayList<TypeMirror>();<NEW_LINE>int[] proposedIndex = new int[1];<NEW_LINE>List<ExecutableElement> ee = fuzzyResolveMethodInvocation(info, parent, proposedTypes, proposedIndex);<NEW_LINE>if (ee.isEmpty()) {<NEW_LINE>// cannot be resolved<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>types.add(ElementKind.PARAMETER);<NEW_LINE><MASK><NEW_LINE>types.add(ElementKind.FIELD);<NEW_LINE>return proposedTypes;<NEW_LINE>}<NEW_LINE>Tree id = nct.getIdentifier();<NEW_LINE>if (id.getKind() == Kind.PARAMETERIZED_TYPE) {<NEW_LINE>id = ((ParameterizedTypeTree) id).getType();<NEW_LINE>}<NEW_LINE>if (id == error) {<NEW_LINE>return resolveType(EnumSet.noneOf(ElementKind.class), info, parent.getParentPath(), nct, offset, null, null);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
types.add(ElementKind.LOCAL_VARIABLE);
1,645,255
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {<NEW_LINE>Constant cst = this.left.optimizedBooleanConstant();<NEW_LINE>boolean isLeftOptimizedTrue = cst != Constant.NotAConstant && cst.booleanValue() == true;<NEW_LINE>boolean isLeftOptimizedFalse = cst != Constant.NotAConstant && cst.booleanValue() == false;<NEW_LINE>if (isLeftOptimizedTrue) {<NEW_LINE>// TRUE && anything<NEW_LINE>// need to be careful of scenario:<NEW_LINE>// (x && y) && !z, if passing the left info to the right, it would<NEW_LINE>// be swapped by the !<NEW_LINE>FlowInfo mergedInfo = this.left.analyseCode(currentScope, flowContext, flowInfo).unconditionalInits();<NEW_LINE>mergedInfo = this.right.analyseCode(currentScope, flowContext, mergedInfo);<NEW_LINE>this.mergedInitStateIndex = currentScope.methodScope().recordInitializationStates(mergedInfo);<NEW_LINE>return mergedInfo;<NEW_LINE>}<NEW_LINE>FlowInfo leftInfo = this.left.analyseCode(currentScope, flowContext, flowInfo);<NEW_LINE>if ((flowContext.tagBits & FlowContext.INSIDE_NEGATION) != 0)<NEW_LINE>flowContext.expireNullCheckedFieldInfo();<NEW_LINE>// need to be careful of scenario:<NEW_LINE>// (x && y) && !z, if passing the left info to the right, it would be<NEW_LINE>// swapped by the !<NEW_LINE>FlowInfo rightInfo = leftInfo.initsWhenTrue().unconditionalCopy();<NEW_LINE>this.rightInitStateIndex = currentScope.methodScope().recordInitializationStates(rightInfo);<NEW_LINE>int previousMode = rightInfo.reachMode();<NEW_LINE>if (isLeftOptimizedFalse) {<NEW_LINE>if ((rightInfo.reachMode() & FlowInfo.UNREACHABLE) == 0) {<NEW_LINE>currentScope.problemReporter().fakeReachable(this.right);<NEW_LINE>rightInfo.setReachMode(FlowInfo.UNREACHABLE_OR_DEAD);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rightInfo = this.right.analyseCode(currentScope, flowContext, rightInfo);<NEW_LINE>if ((flowContext.tagBits & FlowContext.INSIDE_NEGATION) != 0)<NEW_LINE>flowContext.expireNullCheckedFieldInfo();<NEW_LINE>this.left.checkNPEbyUnboxing(currentScope, flowContext, flowInfo);<NEW_LINE>this.right.checkNPEbyUnboxing(currentScope, flowContext, leftInfo.initsWhenTrue());<NEW_LINE>FlowInfo mergedInfo = FlowInfo.conditional(rightInfo.safeInitsWhenTrue(), leftInfo.initsWhenFalse().unconditionalInits().mergedWith(rightInfo.initsWhenFalse().setReachMode(<MASK><NEW_LINE>// reset after trueMergedInfo got extracted<NEW_LINE>this.mergedInitStateIndex = currentScope.methodScope().recordInitializationStates(mergedInfo);<NEW_LINE>return mergedInfo;<NEW_LINE>}
previousMode).unconditionalInits()));
936,129
private void checkForCycles() {<NEW_LINE>final TIntObjectHashMap<TIntHashSet> transitivePredecessors = new TIntObjectHashMap<>();<NEW_LINE>myRegisteredPassFactories.forEachEntry(new TIntObjectProcedure<PassConfig>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean execute(int passId, PassConfig config) {<NEW_LINE>TIntHashSet allPredecessors = new TIntHashSet(config.completionPredecessorIds);<NEW_LINE>allPredecessors.addAll(config.startingPredecessorIds);<NEW_LINE><MASK><NEW_LINE>allPredecessors.forEach(new TIntProcedure() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean execute(int predecessorId) {<NEW_LINE>PassConfig predecessor = myRegisteredPassFactories.get(predecessorId);<NEW_LINE>if (predecessor == null)<NEW_LINE>return true;<NEW_LINE>TIntHashSet transitives = transitivePredecessors.get(predecessorId);<NEW_LINE>if (transitives == null) {<NEW_LINE>transitives = new TIntHashSet();<NEW_LINE>transitivePredecessors.put(predecessorId, transitives);<NEW_LINE>}<NEW_LINE>transitives.addAll(predecessor.completionPredecessorIds);<NEW_LINE>transitives.addAll(predecessor.startingPredecessorIds);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>transitivePredecessors.forEachKey(new TIntProcedure() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean execute(int passId) {<NEW_LINE>if (transitivePredecessors.get(passId).contains(passId)) {<NEW_LINE>throw new IllegalArgumentException("There is a cycle introduced involving pass " + myRegisteredPassFactories.get(passId).passFactory);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
transitivePredecessors.put(passId, allPredecessors);
455,719
public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {<NEW_LINE>renderBackground(matrixStack);<NEW_LINE>Matrix4f matrix = matrixStack.peek().getPositionMatrix();<NEW_LINE>BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();<NEW_LINE>RenderSystem.setShader(GameRenderer::getPositionShader);<NEW_LINE>// skin preview<NEW_LINE>AltRenderer.drawAltBack(matrixStack, nameOrEmailBox.getText(), (width / 2 - 100) / 2 - 64, height / 2 - 128, 128, 256);<NEW_LINE>AltRenderer.drawAltBody(matrixStack, nameOrEmailBox.getText(), width - (width / 2 - 100) / 2 - 64, height / 2 - 128, 128, 256);<NEW_LINE>// text<NEW_LINE>drawStringWithShadow(matrixStack, textRenderer, "Name (for cracked alts), or", width / 2 - 100, 37, 10526880);<NEW_LINE>drawStringWithShadow(matrixStack, textRenderer, "E-Mail (for premium alts)", width / 2 - 100, 47, 10526880);<NEW_LINE>drawStringWithShadow(matrixStack, textRenderer, "Password (leave blank for cracked alts)", width / <MASK><NEW_LINE>String[] lines = message.split("\n");<NEW_LINE>for (int i = 0; i < lines.length; i++) drawCenteredText(matrixStack, textRenderer, lines[i], width / 2, 142 + 10 * i, 16777215);<NEW_LINE>// text boxes<NEW_LINE>nameOrEmailBox.render(matrixStack, mouseX, mouseY, partialTicks);<NEW_LINE>passwordBox.render(matrixStack, mouseX, mouseY, partialTicks);<NEW_LINE>// red flash for errors<NEW_LINE>if (errorTimer > 0) {<NEW_LINE>GL11.glDisable(GL11.GL_CULL_FACE);<NEW_LINE>GL11.glEnable(GL11.GL_BLEND);<NEW_LINE>RenderSystem.setShaderColor(1, 0, 0, errorTimer / 16F);<NEW_LINE>bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION);<NEW_LINE>bufferBuilder.vertex(matrix, 0, 0, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, width, 0, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, width, height, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, 0, height, 0).next();<NEW_LINE>bufferBuilder.end();<NEW_LINE>BufferRenderer.draw(bufferBuilder);<NEW_LINE>GL11.glEnable(GL11.GL_CULL_FACE);<NEW_LINE>GL11.glDisable(GL11.GL_BLEND);<NEW_LINE>errorTimer--;<NEW_LINE>}<NEW_LINE>super.render(matrixStack, mouseX, mouseY, partialTicks);<NEW_LINE>}
2 - 100, 87, 10526880);
876,034
protected Control createContents(Composite parent) {<NEW_LINE>Composite area = new Composite(parent, SWT.NONE);<NEW_LINE>GridLayoutFactory.fillDefaults().numColumns(2).applyTo(area);<NEW_LINE>Label label = new Label(area, SWT.NONE);<NEW_LINE><MASK><NEW_LINE>languageCombo = new ComboViewer(area, SWT.READ_ONLY);<NEW_LINE>languageCombo.setContentProvider(ArrayContentProvider.getInstance());<NEW_LINE>languageCombo.setInput(Language.values());<NEW_LINE>languageCombo.addSelectionChangedListener(event -> {<NEW_LINE>Language l = (Language) event.getStructuredSelection().getFirstElement();<NEW_LINE>if (l != null) {<NEW_LINE>if (l == Language.AUTOMATIC) {<NEW_LINE>countryCombo.getCombo().setEnabled(false);<NEW_LINE>countryCombo.setInput(Collections.emptyList());<NEW_LINE>countryCombo.setSelection(StructuredSelection.EMPTY);<NEW_LINE>} else {<NEW_LINE>countryCombo.getCombo().setEnabled(true);<NEW_LINE>countryCombo.setInput(getCountriesForLanguage(l));<NEW_LINE>countryCombo.setSelection(new StructuredSelection(new Locale(l.getCode())));<NEW_LINE>}<NEW_LINE>area.layout();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>label = new Label(area, SWT.NONE);<NEW_LINE>label.setText(Messages.LabelCountry);<NEW_LINE>countryCombo = new ComboViewer(area, SWT.READ_ONLY);<NEW_LINE>countryCombo.setContentProvider(ArrayContentProvider.getInstance());<NEW_LINE>countryCombo.setLabelProvider(new LabelProvider() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getText(Object element) {<NEW_LINE>return ((Locale) element).getDisplayCountry();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>createSampleArea(area);<NEW_LINE>updateSelection(userProperties.getProperty(OSGI_NL));<NEW_LINE>return area;<NEW_LINE>}
label.setText(Messages.LabelLanguage);
722,244
public void updated(Dictionary<String, ?> config) throws ConfigurationException {<NEW_LINE>logger.trace("updated() is called!");<NEW_LINE>if (config != null) {<NEW_LINE>startWatchdog();<NEW_LINE>port = DEFAULT_PORT;<NEW_LINE>host = (String) config.get("host");<NEW_LINE>password = (String) config.get("password");<NEW_LINE>String portString = (String) config.get("port");<NEW_LINE>if (StringUtils.isNotBlank(portString)) {<NEW_LINE>port = Integer.parseInt(portString);<NEW_LINE>}<NEW_LINE>eventCache = new LinkedHashMap<String, Channel>();<NEW_LINE>mwiCache = new HashMap<String, FreeswitchBinding.MWIModel>();<NEW_LINE>itemMap = new LinkedHashMap<String<MASK><NEW_LINE>try {<NEW_LINE>connect();<NEW_LINE>} catch (InboundConnectionFailure e) {<NEW_LINE>logger.error("Could not connect to freeswitch server", e);<NEW_LINE>// clean up<NEW_LINE>disconnect();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// if we no longer have a config, make sure we are not connected and<NEW_LINE>// that our watchdog thread is not running.<NEW_LINE>stopWatchdog();<NEW_LINE>disconnect();<NEW_LINE>}<NEW_LINE>}
, LinkedList<FreeswitchBindingConfig>>();
1,770,325
protected ByteBuf[] serialize(WriteRequest message) throws IOException {<NEW_LINE>if (message.hasCommand()) {<NEW_LINE>byte[] command = new byte[message.getSerializedSize()];<NEW_LINE>CodedOutputStream stream = CodedOutputStream.newInstance(command);<NEW_LINE>message.writeTo(stream);<NEW_LINE>return new ByteBuf[] { Unpooled.wrappedBuffer(command) };<NEW_LINE>}<NEW_LINE>DataBuffer chunkBuffer = pollBuffer(message);<NEW_LINE>if (chunkBuffer == null) {<NEW_LINE>if (!message.hasChunk() || !message.getChunk().hasData()) {<NEW_LINE>// nothing to serialize<NEW_LINE>return new ByteBuf[0];<NEW_LINE>}<NEW_LINE>// attempts to fallback to read chunk from message<NEW_LINE>chunkBuffer = new NettyDataBuffer(Unpooled.wrappedBuffer(message.getChunk().getData().asReadOnlyByteBuffer()));<NEW_LINE>}<NEW_LINE>int headerSize = message.getSerializedSize() - chunkBuffer.readableBytes();<NEW_LINE>byte[] header = new byte[headerSize];<NEW_LINE>CodedOutputStream <MASK><NEW_LINE>stream.writeTag(WriteRequest.CHUNK_FIELD_NUMBER, WireFormat.WIRETYPE_LENGTH_DELIMITED);<NEW_LINE>stream.writeUInt32NoTag(message.getChunk().getSerializedSize());<NEW_LINE>stream.writeTag(Chunk.DATA_FIELD_NUMBER, WireFormat.WIRETYPE_LENGTH_DELIMITED);<NEW_LINE>stream.writeUInt32NoTag(chunkBuffer.readableBytes());<NEW_LINE>return new ByteBuf[] { Unpooled.wrappedBuffer(header), (ByteBuf) chunkBuffer.getNettyOutput() };<NEW_LINE>}
stream = CodedOutputStream.newInstance(header);
1,257,085
public static GetRepositoryTagV2Response unmarshall(GetRepositoryTagV2Response getRepositoryTagV2Response, UnmarshallerContext _ctx) {<NEW_LINE>getRepositoryTagV2Response.setRequestId(_ctx.stringValue("GetRepositoryTagV2Response.RequestId"));<NEW_LINE>getRepositoryTagV2Response.setErrorCode(_ctx.stringValue("GetRepositoryTagV2Response.ErrorCode"));<NEW_LINE>getRepositoryTagV2Response.setErrorMessage(_ctx.stringValue("GetRepositoryTagV2Response.ErrorMessage"));<NEW_LINE>getRepositoryTagV2Response.setSuccess(_ctx.booleanValue("GetRepositoryTagV2Response.Success"));<NEW_LINE>Result result = new Result();<NEW_LINE>result.setId(_ctx.stringValue("GetRepositoryTagV2Response.Result.Id"));<NEW_LINE>result.setMessage(_ctx.stringValue("GetRepositoryTagV2Response.Result.Message"));<NEW_LINE>result.setName(_ctx.stringValue("GetRepositoryTagV2Response.Result.Name"));<NEW_LINE>Commit commit = new Commit();<NEW_LINE>commit.setAuthorEmail(_ctx.stringValue("GetRepositoryTagV2Response.Result.Commit.AuthorEmail"));<NEW_LINE>commit.setAuthorName(_ctx.stringValue("GetRepositoryTagV2Response.Result.Commit.AuthorName"));<NEW_LINE>commit.setAuthoredDate(_ctx.stringValue("GetRepositoryTagV2Response.Result.Commit.AuthoredDate"));<NEW_LINE>commit.setCommittedDate(_ctx.stringValue("GetRepositoryTagV2Response.Result.Commit.CommittedDate"));<NEW_LINE>commit.setCommitterEmail(_ctx.stringValue("GetRepositoryTagV2Response.Result.Commit.CommitterEmail"));<NEW_LINE>commit.setCommitterName(_ctx.stringValue("GetRepositoryTagV2Response.Result.Commit.CommitterName"));<NEW_LINE>commit.setCreatedAt(_ctx.stringValue("GetRepositoryTagV2Response.Result.Commit.CreatedAt"));<NEW_LINE>commit.setId(_ctx.stringValue("GetRepositoryTagV2Response.Result.Commit.Id"));<NEW_LINE>commit.setMessage(_ctx.stringValue("GetRepositoryTagV2Response.Result.Commit.Message"));<NEW_LINE>commit.setShortId<MASK><NEW_LINE>commit.setTitle(_ctx.stringValue("GetRepositoryTagV2Response.Result.Commit.Title"));<NEW_LINE>List<String> parentIds = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetRepositoryTagV2Response.Result.Commit.ParentIds.Length"); i++) {<NEW_LINE>parentIds.add(_ctx.stringValue("GetRepositoryTagV2Response.Result.Commit.ParentIds[" + i + "]"));<NEW_LINE>}<NEW_LINE>commit.setParentIds(parentIds);<NEW_LINE>Signature1 signature1 = new Signature1();<NEW_LINE>signature1.setGpgKeyId(_ctx.stringValue("GetRepositoryTagV2Response.Result.Commit.Signature.GpgKeyId"));<NEW_LINE>signature1.setVerificationStatus(_ctx.stringValue("GetRepositoryTagV2Response.Result.Commit.Signature.VerificationStatus"));<NEW_LINE>commit.setSignature1(signature1);<NEW_LINE>result.setCommit(commit);<NEW_LINE>Signature signature = new Signature();<NEW_LINE>signature.setGpgKeyId(_ctx.stringValue("GetRepositoryTagV2Response.Result.Signature.GpgKeyId"));<NEW_LINE>signature.setVerificationStatus(_ctx.stringValue("GetRepositoryTagV2Response.Result.Signature.VerificationStatus"));<NEW_LINE>result.setSignature(signature);<NEW_LINE>getRepositoryTagV2Response.setResult(result);<NEW_LINE>return getRepositoryTagV2Response;<NEW_LINE>}
(_ctx.stringValue("GetRepositoryTagV2Response.Result.Commit.ShortId"));
197,740
public void load() {<NEW_LINE>this.resetComponents();<NEW_LINE>try {<NEW_LINE>// Get a working copy of the interesting files set definitions and sort<NEW_LINE>// by set name.<NEW_LINE>if (panelType == PANEL_TYPE.FILE_INGEST_FILTERS) {<NEW_LINE>this.filesSets = new TreeMap<>(FilesSetsManager.<MASK><NEW_LINE>} else {<NEW_LINE>this.filesSets = new TreeMap<>(FilesSetsManager.getInstance().getInterestingFilesSets());<NEW_LINE>}<NEW_LINE>} catch (FilesSetsManager.FilesSetsManagerException ex) {<NEW_LINE>MessageNotifyUtil.Message.error(Bundle.FilesSetDefsPanel_loadError());<NEW_LINE>logger.log(Level.WARNING, Bundle.FilesSetDefsPanel_loadError(), ex);<NEW_LINE>this.filesSets = new TreeMap<>();<NEW_LINE>}<NEW_LINE>// Populate the list model for the interesting files sets list<NEW_LINE>// component.<NEW_LINE>this.filesSets.values().forEach((set) -> {<NEW_LINE>this.setsListModel.addElement(set);<NEW_LINE>});<NEW_LINE>if (!this.filesSets.isEmpty()) {<NEW_LINE>// Select the first files set by default. The list selections<NEW_LINE>// listeners will then populate the other components.<NEW_LINE>EventQueue.invokeLater(() -> {<NEW_LINE>FilesSetDefsPanel.this.setsList.setSelectedIndex(0);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
getInstance().getCustomFileIngestFilters());
1,580,668
private Text createFileLink(String pathToFile) {<NEW_LINE>LinkedFile linkedFile = new LinkedFile("", Path.of(pathToFile), "pdf");<NEW_LINE>Text fileLinkText = new Text(Localization.lang("Found match in %0", pathToFile) + System.lineSeparator() + System.lineSeparator());<NEW_LINE>fileLinkText.setStyle("-fx-font-weight: bold;");<NEW_LINE>ContextMenu fileContextMenu = getFileContextMenu(linkedFile);<NEW_LINE>Path resolvedPath = linkedFile.findIn(stateManager.getActiveDatabase().get(), preferencesService.getFilePreferences()).orElse(Path.of(pathToFile));<NEW_LINE>Tooltip fileLinkTooltip = new Tooltip(resolvedPath.<MASK><NEW_LINE>Tooltip.install(fileLinkText, fileLinkTooltip);<NEW_LINE>fileLinkText.setOnMouseClicked(event -> {<NEW_LINE>if (MouseButton.PRIMARY.equals(event.getButton())) {<NEW_LINE>try {<NEW_LINE>JabRefDesktop.openBrowser(resolvedPath.toUri());<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.error("Cannot open {}.", resolvedPath.toString(), e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>fileContextMenu.show(fileLinkText, event.getScreenX(), event.getScreenY());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return fileLinkText;<NEW_LINE>}
toAbsolutePath().toString());
942,854
public void readSpanValue(Buffer buffer, SpanBo span, SpanDecodingContext decodingContext) {<NEW_LINE>final byte version = buffer.readByte();<NEW_LINE>span.setVersion(version);<NEW_LINE>final SpanBitFiled bitFiled = new SpanBitFiled(buffer.readByte());<NEW_LINE>final short serviceType = buffer.readShort();<NEW_LINE>span.setServiceType(serviceType);<NEW_LINE>switch(bitFiled.getApplicationServiceTypeEncodingStrategy()) {<NEW_LINE>case PREV_EQUALS:<NEW_LINE>span.setApplicationServiceType(serviceType);<NEW_LINE>break;<NEW_LINE>case RAW:<NEW_LINE>span.setApplicationServiceType(buffer.readShort());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("applicationServiceType");<NEW_LINE>}<NEW_LINE>if (!bitFiled.isRoot()) {<NEW_LINE>span.setParentSpanId(buffer.readLong());<NEW_LINE>} else {<NEW_LINE>span.setParentSpanId(-1);<NEW_LINE>}<NEW_LINE>final long startTimeDelta = buffer.readVLong();<NEW_LINE>final long startTime = span.getCollectorAcceptTime() - startTimeDelta;<NEW_LINE>span.setStartTime(startTime);<NEW_LINE>span.setElapsed(buffer.readVInt());<NEW_LINE>span.setRpc(buffer.readPrefixedString());<NEW_LINE>span.setEndPoint(buffer.readPrefixedString());<NEW_LINE>span.setRemoteAddr(buffer.readPrefixedString());<NEW_LINE>span.setApiId(buffer.readSVInt());<NEW_LINE>if (bitFiled.isSetErrorCode()) {<NEW_LINE>span.setErrCode(buffer.readInt());<NEW_LINE>}<NEW_LINE>if (bitFiled.isSetHasException()) {<NEW_LINE>int exceptionId = buffer.readSVInt();<NEW_LINE>String exceptionMessage = buffer.readPrefixedString();<NEW_LINE>span.setExceptionInfo(exceptionId, exceptionMessage);<NEW_LINE>}<NEW_LINE>if (bitFiled.isSetFlag()) {<NEW_LINE>span.setFlag(buffer.readShort());<NEW_LINE>}<NEW_LINE>if (bitFiled.isSetLoggingTransactionInfo()) {<NEW_LINE>span.setLoggingTransactionInfo(buffer.readByte());<NEW_LINE>}<NEW_LINE>span.<MASK><NEW_LINE>if (bitFiled.isSetAnnotation()) {<NEW_LINE>List<AnnotationBo> annotationBoList = readAnnotationList(buffer, decodingContext);<NEW_LINE>span.setAnnotationBoList(annotationBoList);<NEW_LINE>}<NEW_LINE>List<SpanEventBo> spanEventBoList = readSpanEvent(buffer, decodingContext, SEQUENCE_SPAN_EVENT_FILTER);<NEW_LINE>span.addSpanEventBoList(spanEventBoList);<NEW_LINE>}
setAcceptorHost(buffer.readPrefixedString());
347,731
protected void put(int[][] mbPix, byte[][] buf, int stride, int chromaFormat, int mbX, int mbY, int width, int height, int vertOff, int vertStep) {<NEW_LINE>int chromaStride = (stride + (1 << SQUEEZE_X[chromaFormat]) - 1) >> SQUEEZE_X[chromaFormat];<NEW_LINE>int chromaMBW = 3 - SQUEEZE_X[chromaFormat];<NEW_LINE>int chromaMBH = 3 - SQUEEZE_Y[chromaFormat];<NEW_LINE>putSub(buf[0], (mbY << 3) * (stride << vertStep) + vertOff * stride + (mbX << 3), stride << vertStep, mbPix<MASK><NEW_LINE>putSub(buf[1], (mbY << chromaMBH) * (chromaStride << vertStep) + vertOff * chromaStride + (mbX << chromaMBW), chromaStride << vertStep, mbPix[1], chromaMBW, chromaMBH);<NEW_LINE>putSub(buf[2], (mbY << chromaMBH) * (chromaStride << vertStep) + vertOff * chromaStride + (mbX << chromaMBW), chromaStride << vertStep, mbPix[2], chromaMBW, chromaMBH);<NEW_LINE>}
[0], 3, 3);
1,851,541
public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {<NEW_LINE>TranslationHelpers.checkTranslationArguments(environment, instruction, instructions, "divu");<NEW_LINE>final String sourceRegister1 = instruction.getOperands().get(0).getRootNode().getChildren().get(0).getValue();<NEW_LINE>final String sourceRegister2 = instruction.getOperands().get(1).getRootNode().getChildren().get(0).getValue();<NEW_LINE>final OperandSize dw = OperandSize.DWORD;<NEW_LINE>final String quotient = environment.getNextVariableString();<NEW_LINE>final String reminder = environment.getNextVariableString();<NEW_LINE>final long baseOffset = ReilHelpers.toReilAddress(instruction.getAddress()).toLong();<NEW_LINE>long offset = baseOffset;<NEW_LINE>instructions.add(ReilHelpers.createDiv(offset++, dw, sourceRegister1, dw, sourceRegister2, dw, quotient));<NEW_LINE>instructions.add(ReilHelpers.createMod(offset++, dw, sourceRegister1, dw, sourceRegister2, dw, reminder));<NEW_LINE>instructions.add(ReilHelpers.createStr(offset++, dw, quotient, dw, "LO"));<NEW_LINE>instructions.add(ReilHelpers.createStr(offset, dw<MASK><NEW_LINE>}
, reminder, dw, "HI"));
439,449
private MethodTree createMethodDefinition(boolean mustStatic) {<NEW_LINE>// if all the statements are contained within a Block, get just the block, it will be processed recursively<NEW_LINE>List<VariableTree> formalArguments = IntroduceHint.createVariables(copy, parameters, pathToClass, statementPaths.subList(from, to + 1));<NEW_LINE>if (formalArguments == null) {<NEW_LINE>// XXX<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<ExpressionTree> thrown = IntroduceHint.typeHandleToTree(copy, thrownTypes);<NEW_LINE>if (thrown == null) {<NEW_LINE>// XXX<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<TypeParameterTree> typeVars <MASK><NEW_LINE>for (TreePathHandle tph : IntroduceMethodFix.this.typeVars) {<NEW_LINE>typeVars.add((TypeParameterTree) tph.resolve(copy).getLeaf());<NEW_LINE>}<NEW_LINE>List<StatementTree> methodStatements = new ArrayList<StatementTree>();<NEW_LINE>generateMethodContents(methodStatements);<NEW_LINE>makeReturnsFromExtractedMethod(methodStatements);<NEW_LINE>Set<Modifier> modifiers = EnumSet.noneOf(Modifier.class);<NEW_LINE>modifiers.addAll(access);<NEW_LINE>if (target.iface) {<NEW_LINE>modifiers.add(Modifier.DEFAULT);<NEW_LINE>} else if (mustStatic) {<NEW_LINE>modifiers.add(Modifier.STATIC);<NEW_LINE>}<NEW_LINE>ModifiersTree mods = make.Modifiers(modifiers);<NEW_LINE>MethodTree method = make.Method(mods, name, returnTypeTree, typeVars, formalArguments, thrown, make.Block(methodStatements, false), null);<NEW_LINE>copy.tag(returnTypeTree, TYPE_TAG);<NEW_LINE>return method;<NEW_LINE>}
= new LinkedList<TypeParameterTree>();
1,788,372
public void verifyEJBMethodInjection() throws Exception {<NEW_LINE>String envName = null;<NEW_LINE>assertNotNull("Injected Method Field is set : " + ivMethodInjected, ivMethodInjected);<NEW_LINE>ivMethodInjected.tx_Default();<NEW_LINE>svLogger.info("Method called successfully on Injected Method Field");<NEW_LINE>// Next, ensure the above may be looked up in the global namespace<NEW_LINE>Context initCtx = new InitialContext();<NEW_LINE>Context myEnv = (Context) initCtx.lookup("java:comp/env");<NEW_LINE>envName = CLASS_NAME + "/ivMethodInjected";<NEW_LINE>ivMethodInjected = (BasicCMTStatelessRemote) myEnv.lookup(envName);<NEW_LINE>assertNotNull("global lookup(" + <MASK><NEW_LINE>ivMethodInjected.tx_Default();<NEW_LINE>svLogger.info("Method called successfully on looked up method");<NEW_LINE>// Next, ensure the above may be looked up from the SessionContext<NEW_LINE>envName = CLASS_NAME + "/ivMethodInjected";<NEW_LINE>ivMethodInjected = (BasicCMTStatelessRemote) ivContext.lookup(envName);<NEW_LINE>assertNotNull("context lookup(" + envName + ") not null :" + ivMethodInjected, ivMethodInjected);<NEW_LINE>ivMethodInjected.tx_Default();<NEW_LINE>svLogger.info("Method called successfully on looked up method");<NEW_LINE>// Finally, reset all of the fields to ensure injection does not occur<NEW_LINE>// when object is re-used from the pool.<NEW_LINE>ivMethodInjected = null;<NEW_LINE>}
envName + ") not null :" + ivMethodInjected, ivMethodInjected);
417,730
public AuditableRestAction<Void> transferOwnership(@Nonnull Member newOwner) {<NEW_LINE>Checks.notNull(newOwner, "Member");<NEW_LINE>checkGuild(newOwner.getGuild(), "Member");<NEW_LINE>if (!getSelfMember().isOwner())<NEW_LINE>throw new PermissionException("The logged in account must be the owner of this Guild to be able to transfer ownership");<NEW_LINE>Checks.check(!getSelfMember().equals(newOwner), "The member provided as the newOwner is the currently logged in account. Provide a different member to give ownership to.");<NEW_LINE>Checks.check(!newOwner.getUser().isBot(), "Cannot transfer ownership of a Guild to a Bot!");<NEW_LINE>DataObject body = DataObject.empty().put("owner_id", newOwner.getUser().getId());<NEW_LINE>Route.CompiledRoute route = Route.Guilds.<MASK><NEW_LINE>return new AuditableRestActionImpl<>(getJDA(), route, body);<NEW_LINE>}
MODIFY_GUILD.compile(getId());
440,046
private boolean killDecision(Entity e, List<String> thingsToKill, boolean negateAnimals, boolean negateMonsters, boolean specifiedAnimals, boolean specifiedMonsters) {<NEW_LINE>boolean negate = false;<NEW_LINE>boolean specified = false;<NEW_LINE>if (e instanceof Golem || e instanceof Squid || e instanceof Animals || (ambientClass != null && ambientClass.isInstance(e))) {<NEW_LINE>// it's an animal<NEW_LINE>if (specifiedAnimals && !negateAnimals) {<NEW_LINE>Logging.finest("Removing an entity because I was told to remove all animals in world %s: %s", e.getWorld().getName(), e);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (specifiedAnimals)<NEW_LINE>specified = true;<NEW_LINE>negate = negateAnimals;<NEW_LINE>} else if (e instanceof Monster || e instanceof Ghast || e instanceof Slime || e instanceof Phantom) {<NEW_LINE>// it's a monster<NEW_LINE>if (specifiedMonsters && !negateMonsters) {<NEW_LINE>Logging.finest("Removing an entity because I was told to remove all monsters in world %s: %s", e.getWorld(<MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (specifiedMonsters)<NEW_LINE>specified = true;<NEW_LINE>negate = negateMonsters;<NEW_LINE>}<NEW_LINE>for (String s : thingsToKill) {<NEW_LINE>EntityType type = EntityType.fromName(s);<NEW_LINE>if (type != null && type.equals(e.getType())) {<NEW_LINE>specified = true;<NEW_LINE>if (!negate) {<NEW_LINE>Logging.finest("Removing an entity because it WAS specified and we are NOT negating in world %s: %s", e.getWorld().getName(), e);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!specified && negate) {<NEW_LINE>Logging.finest("Removing an entity because it was NOT specified and we ARE negating in world %s: %s", e.getWorld().getName(), e);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
).getName(), e);
1,834,560
public static Query newSetQuery(String field, InetAddress... values) {<NEW_LINE>// We must compare the encoded form (InetAddress doesn't implement Comparable, and even if it<NEW_LINE>// did, we do our own thing with ipv4 addresses):<NEW_LINE>// NOTE: we could instead convert-per-comparison and save this extra array, at cost of slower<NEW_LINE>// sort:<NEW_LINE>byte[][] sortedValues = new <MASK><NEW_LINE>for (int i = 0; i < values.length; i++) {<NEW_LINE>sortedValues[i] = encode(values[i]);<NEW_LINE>}<NEW_LINE>Arrays.sort(sortedValues, new Comparator<byte[]>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(byte[] a, byte[] b) {<NEW_LINE>return Arrays.compareUnsigned(a, 0, BYTES, b, 0, BYTES);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>final BytesRef encoded = new BytesRef(new byte[BYTES]);<NEW_LINE>return new PointInSetQuery(field, 1, BYTES, new PointInSetQuery.Stream() {<NEW_LINE><NEW_LINE>int upto;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public BytesRef next() {<NEW_LINE>if (upto == sortedValues.length) {<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>encoded.bytes = sortedValues[upto];<NEW_LINE>assert encoded.bytes.length == encoded.length;<NEW_LINE>upto++;<NEW_LINE>return encoded;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected String toString(byte[] value) {<NEW_LINE>assert value.length == BYTES;<NEW_LINE>return decode(value).getHostAddress();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
byte[values.length][];
1,413,637
public void marshall(CreateFlowDefinitionRequest createFlowDefinitionRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createFlowDefinitionRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createFlowDefinitionRequest.getFlowDefinitionName(), FLOWDEFINITIONNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createFlowDefinitionRequest.getHumanLoopRequestSource(), HUMANLOOPREQUESTSOURCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createFlowDefinitionRequest.getHumanLoopConfig(), HUMANLOOPCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(createFlowDefinitionRequest.getOutputConfig(), OUTPUTCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(createFlowDefinitionRequest.getRoleArn(), ROLEARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createFlowDefinitionRequest.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
createFlowDefinitionRequest.getHumanLoopActivationConfig(), HUMANLOOPACTIVATIONCONFIG_BINDING);
782,623
static String fixupGuardedBlocks(String indentedLine) {<NEW_LINE>int <MASK><NEW_LINE>if (offset == -1)<NEW_LINE>return indentedLine;<NEW_LINE>// move the guarded block at the end of the first line in the string<NEW_LINE>// NOI18N<NEW_LINE>int firstLineEnd = indentedLine.indexOf('\n');<NEW_LINE>if (firstLineEnd == -1 || firstLineEnd > offset)<NEW_LINE>// already on the first line.<NEW_LINE>return indentedLine;<NEW_LINE>// NOI18N<NEW_LINE>int guardedLineEnd = indentedLine.indexOf('\n', offset);<NEW_LINE>StringBuffer sb = new StringBuffer(indentedLine.length());<NEW_LINE>sb.append(indentedLine.substring(0, firstLineEnd));<NEW_LINE>if (guardedLineEnd != -1) {<NEW_LINE>sb.append(indentedLine.substring(offset, guardedLineEnd));<NEW_LINE>} else {<NEW_LINE>sb.append(indentedLine.substring(offset));<NEW_LINE>}<NEW_LINE>sb.append(indentedLine.substring(firstLineEnd, offset));<NEW_LINE>if (guardedLineEnd != -1)<NEW_LINE>sb.append(indentedLine.substring(guardedLineEnd));<NEW_LINE>return sb.toString();<NEW_LINE>}
offset = indentedLine.indexOf(MAGIC_PREFIX);
1,748,402
private static JScrollPane createScrollableTreeAddOnsNotRunnable(final AddOnCollection availableAddOns, AddOn... addOnsNotRunnable) {<NEW_LINE>AddOnSearcher addOnSearcher = new AddOnSearcher() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public AddOn searchAddOn(String id) {<NEW_LINE>return availableAddOns.getAddOn(id);<NEW_LINE>}<NEW_LINE>};<NEW_LINE><MASK><NEW_LINE>for (AddOn addOn : addOnsNotRunnable) {<NEW_LINE>DefaultMutableTreeNode addOnNode = new DefaultMutableTreeNode(addOn.getName());<NEW_LINE>AddOn.AddOnRunRequirements requirements = addOn.calculateRunRequirements(availableAddOns.getAddOns());<NEW_LINE>List<String> issues = getUiRunningIssues(requirements, addOnSearcher);<NEW_LINE>if (issues.isEmpty()) {<NEW_LINE>issues.addAll(getUiExtensionsRunningIssues(requirements, addOnSearcher));<NEW_LINE>}<NEW_LINE>for (String issue : issues) {<NEW_LINE>addOnNode.add(new DefaultMutableTreeNode(issue));<NEW_LINE>}<NEW_LINE>rootNode.add(addOnNode);<NEW_LINE>}<NEW_LINE>JXTree tree = new JXTree(new DefaultTreeModel(rootNode));<NEW_LINE>tree.setVisibleRowCount(5);<NEW_LINE>tree.setEditable(false);<NEW_LINE>tree.setRootVisible(false);<NEW_LINE>tree.setShowsRootHandles(true);<NEW_LINE>tree.expandAll();<NEW_LINE>return new JScrollPane(tree);<NEW_LINE>}
DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode("");
1,508,416
private void checkGradients() {<NEW_LINE>List<NDArray> grads = new ArrayList<>();<NEW_LINE>model.getBlock().getParameters().values().stream().filter(Parameter::requiresGradient).forEach(param -> grads.add(parameterStore.getValue(param, devices[0], <MASK><NEW_LINE>try (NDManager scoped = manager.newSubManager()) {<NEW_LINE>scoped.tempAttachAll(new NDList(grads));<NEW_LINE>NDList list = new NDList(grads.stream().map(NDArray::sum).toArray(NDArray[]::new));<NEW_LINE>float gradSum = NDArrays.stack(list).sum().getFloat();<NEW_LINE>if (gradSum == 0f) {<NEW_LINE>throw new IllegalStateException("Gradient values are all zeros, please call gradientCollector.backward() on" + "your target NDArray (usually loss), before calling step() ");<NEW_LINE>}<NEW_LINE>gradientsChecked = true;<NEW_LINE>}<NEW_LINE>}
true).getGradient()));
915,850
private Switch createPlayerButtons() {<NEW_LINE>final Switch playerItemSwitch = SitemapFactory.eINSTANCE.createSwitch();<NEW_LINE>final List<Mapping> mappings = playerItemSwitch.getMappings();<NEW_LINE>Mapping commandMapping;<NEW_LINE>mappings.add(commandMapping = SitemapFactory.eINSTANCE.createMapping());<NEW_LINE>commandMapping.setCmd(NextPreviousType.PREVIOUS.name());<NEW_LINE>commandMapping.setLabel("<<");<NEW_LINE>mappings.add(commandMapping = SitemapFactory.eINSTANCE.createMapping());<NEW_LINE>commandMapping.setCmd(<MASK><NEW_LINE>commandMapping.setLabel("||");<NEW_LINE>mappings.add(commandMapping = SitemapFactory.eINSTANCE.createMapping());<NEW_LINE>commandMapping.setCmd(PlayPauseType.PLAY.name());<NEW_LINE>commandMapping.setLabel(">");<NEW_LINE>mappings.add(commandMapping = SitemapFactory.eINSTANCE.createMapping());<NEW_LINE>commandMapping.setCmd(NextPreviousType.NEXT.name());<NEW_LINE>commandMapping.setLabel(">>");<NEW_LINE>return playerItemSwitch;<NEW_LINE>}
PlayPauseType.PAUSE.name());
895,152
private static void genArticle(final String permalink) throws Exception {<NEW_LINE>if (!StringUtils.endsWithIgnoreCase(permalink, ".html") && !StringUtils.endsWithIgnoreCase(permalink, ".htm")) {<NEW_LINE>FileUtils.forceMkdir(<MASK><NEW_LINE>final String html = Mocks.mockRequest(permalink, scheme, host);<NEW_LINE>final OutputStream outputStream = new FileOutputStream(staticSitePath + permalink + "/index.html");<NEW_LINE>IOUtils.write(html, outputStream, StandardCharsets.UTF_8);<NEW_LINE>outputStream.close();<NEW_LINE>} else {<NEW_LINE>FileUtils.forceMkdirParent(new File(staticSitePath + permalink));<NEW_LINE>final String html = Mocks.mockRequest(permalink, scheme, host);<NEW_LINE>final OutputStream outputStream = new FileOutputStream(staticSitePath + permalink);<NEW_LINE>IOUtils.write(html, outputStream, StandardCharsets.UTF_8);<NEW_LINE>outputStream.close();<NEW_LINE>}<NEW_LINE>LOGGER.log(Level.INFO, "Generated an article [" + permalink + "]");<NEW_LINE>}
new File(staticSitePath + permalink));
955,727
public Map<String, Object> invoke() {<NEW_LINE>final Map<String, Object> result = new HashMap<>();<NEW_LINE>if (sentinelProperties.isEnabled()) {<NEW_LINE>result.put("appName", AppNameUtil.getAppName());<NEW_LINE>result.put("logDir", LogBase.getLogBaseDir());<NEW_LINE>result.put("logUsePid", LogBase.isLogNameUsePid());<NEW_LINE>result.put("blockPage", SentinelConfig.getConfig(BLOCK_PAGE_URL_CONF_KEY));<NEW_LINE>result.put("metricsFileSize", SentinelConfig.singleMetricFileSize());<NEW_LINE>result.put("metricsFileCharset", SentinelConfig.charset());<NEW_LINE>result.put("totalMetricsFileCount", SentinelConfig.totalMetricFileCount());<NEW_LINE>result.put("consoleServer", TransportConfig.getConsoleServerList());<NEW_LINE>result.put("clientIp", TransportConfig.getHeartbeatClientIp());<NEW_LINE>result.put("heartbeatIntervalMs", TransportConfig.getHeartbeatIntervalMs());<NEW_LINE>result.put("clientPort", TransportConfig.getPort());<NEW_LINE>result.put("coldFactor", sentinelProperties.getFlow().getColdFactor());<NEW_LINE>result.put("filter", sentinelProperties.getFilter());<NEW_LINE>result.put("datasource", sentinelProperties.getDatasource());<NEW_LINE>final Map<String, Object> rules = new HashMap<>();<NEW_LINE>result.put("rules", rules);<NEW_LINE>rules.put("flowRules", FlowRuleManager.getRules());<NEW_LINE>rules.put("degradeRules", DegradeRuleManager.getRules());<NEW_LINE>rules.put(<MASK><NEW_LINE>rules.put("authorityRule", AuthorityRuleManager.getRules());<NEW_LINE>rules.put("paramFlowRule", ParamFlowRuleManager.getRules());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
"systemRules", SystemRuleManager.getRules());
405,550
public void exportSection(PrintPageFormat pageFormat, JRGridLayout pageGridLayout, boolean lastPage) {<NEW_LINE>if (!lastPage) {<NEW_LINE>write(" <w:p>\n");<NEW_LINE>write(" <w:pPr>\n");<NEW_LINE>}<NEW_LINE>write(" <w:sectPr>\n");<NEW_LINE>write(" <w:pgSz w:w=\"" + LengthUtil.twip(pageFormat.getPageWidth()) + "\" w:h=\"" + LengthUtil.twip(pageFormat.getPageHeight()) + "\"");<NEW_LINE>write(" w:orient=\"" + (pageFormat.getOrientation() == OrientationEnum.LANDSCAPE ? "landscape" : "portrait") + "\"");<NEW_LINE>if (OoxmlUtils.getSuitablePaperSize(pageFormat) == PaperSizeEnum.UNDEFINED) {<NEW_LINE>// unique identifier for the paper size<NEW_LINE>write(" w:code=\"" + (1000 + pageFormat.getPageWidth() + pageFormat.getPageHeight()) + "\"");<NEW_LINE>}<NEW_LINE>write("/>\n");<NEW_LINE>CutsInfo xCuts = pageGridLayout.getXCuts();<NEW_LINE>Cut leftCut = xCuts.getCut(0);<NEW_LINE>int gridLeftPadding = leftCut.isCutNotEmpty() ? 0 : pageGridLayout.getColumnWidth(0);<NEW_LINE>int leftMargin = Math.min(gridLeftPadding, pageFormat.getLeftMargin());<NEW_LINE>Cut rightCut = xCuts.getCut(xCuts.size() - 2);<NEW_LINE>int gridRightPadding = rightCut.isCutNotEmpty() ? 0 : pageGridLayout.getColumnWidth(xCuts.size() - 2);<NEW_LINE>int rightMargin = Math.min(gridRightPadding, pageFormat.getRightMargin());<NEW_LINE>CutsInfo yCuts = pageGridLayout.getYCuts();<NEW_LINE>int topMargin = pageFormat.getTopMargin();<NEW_LINE>if (yCuts.size() > 1) {<NEW_LINE>Cut topCut = yCuts.getCut(0);<NEW_LINE>int gridTopPadding = topCut.isCutNotEmpty() ? 0 : pageGridLayout.getRowHeight(0);<NEW_LINE>topMargin = Math.min(gridTopPadding, pageFormat.getTopMargin());<NEW_LINE>}<NEW_LINE>// last y cut is from bottom element, not page height<NEW_LINE>int gridBottomPadding = pageFormat.getPageHeight() - yCuts.getLastCutOffset();<NEW_LINE>int bottomMargin = LengthUtil.twip(Math.min(gridBottomPadding, pageFormat.getBottomMargin())) - DEFAULT_LINE_PITCH;<NEW_LINE>bottomMargin = bottomMargin < 0 ? 0 : bottomMargin;<NEW_LINE>write(" <w:pgMar w:top=\"" + LengthUtil.twip(topMargin) + "\" w:right=\"" + LengthUtil.twip(rightMargin) + "\" w:bottom=\"" + bottomMargin + "\" w:left=\"" + LengthUtil<MASK><NEW_LINE>// write(" <w:cols w:space=\"720\" />\n");<NEW_LINE>write(" <w:docGrid w:linePitch=\"" + DEFAULT_LINE_PITCH + "\" />\n");<NEW_LINE>write(" </w:sectPr>\n");<NEW_LINE>if (!lastPage) {<NEW_LINE>write(" </w:pPr>\n");<NEW_LINE>write(" </w:p>\n");<NEW_LINE>}<NEW_LINE>}
.twip(leftMargin) + "\" w:header=\"0\" w:footer=\"0\" w:gutter=\"0\" />\n");
1,444,124
private static org.netbeans.modules.web.jsps.parserapi.PageInfo convertPageInfo(PageInfo pageInfo, String xmlView, JspCompilationContext ctxt) throws JspException {<NEW_LINE>PageInfoImpl nbPageInfo = new PageInfoImpl(getTaglibsMapReflect(pageInfo, ctxt), getJSPPrefixMapperReflect(pageInfo), getXMLPrefixMapperReflect(pageInfo), ((CompilerHacks.HackPageInfo) pageInfo).getApproxXmlPrefixMapper(), pageInfo.getImports(), pageInfo.getDependants(), pageInfo.getIncludePrelude(), pageInfo.getIncludeCoda(), getPluginDclsReflect(pageInfo), getPrefixesReflect(pageInfo));<NEW_LINE>nbPageInfo.setLanguage(pageInfo.getLanguage());<NEW_LINE>nbPageInfo.setExtends(pageInfo.getExtends());<NEW_LINE>nbPageInfo.setContentType(pageInfo.getContentType());<NEW_LINE>nbPageInfo.setSession(pageInfo.getSession());<NEW_LINE>nbPageInfo.setBufferValue(pageInfo.getBufferValue());<NEW_LINE>nbPageInfo.setAutoFlush(pageInfo.getAutoFlush());<NEW_LINE>nbPageInfo.setIsThreadSafe(pageInfo.getIsThreadSafe());<NEW_LINE>nbPageInfo.setIsErrorPage(pageInfo.getIsErrorPage());<NEW_LINE>nbPageInfo.<MASK><NEW_LINE>nbPageInfo.setScriptless(pageInfo.isScriptless());<NEW_LINE>nbPageInfo.setScriptingInvalid(pageInfo.isScriptingInvalid());<NEW_LINE>nbPageInfo.setELIgnored(pageInfo.isELIgnored());<NEW_LINE>nbPageInfo.setOmitXmlDecl(pageInfo.getOmitXmlDecl());<NEW_LINE>nbPageInfo.setIsJspPrefixHijacked(pageInfo.isJspPrefixHijacked());<NEW_LINE>nbPageInfo.setDoctypeName(pageInfo.getDoctypeName());<NEW_LINE>nbPageInfo.setDoctypeSystem(pageInfo.getDoctypeSystem());<NEW_LINE>nbPageInfo.setDoctypePublic(pageInfo.getDoctypePublic());<NEW_LINE>nbPageInfo.setHasJspRoot(pageInfo.hasJspRoot());<NEW_LINE>nbPageInfo.setBeans(createBeanData(pageInfo.getBeanRepository()));<NEW_LINE>// the xml view<NEW_LINE>nbPageInfo.setXMLView(xmlView);<NEW_LINE>nbPageInfo.setTagFile(ctxt.isTagFile());<NEW_LINE>nbPageInfo.setTagInfo(ctxt.getTagInfo());<NEW_LINE>return nbPageInfo;<NEW_LINE>}
setErrorPage(pageInfo.getErrorPage());
544,001
private void handleActionUpdate(String url) {<NEW_LINE>manager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);<NEW_LINE>builder = new NotificationCompat.Builder(this);<NEW_LINE>builder.setContentTitle(CheckForUpdateUtil.getStringRes(R.string.update_downloading)).setContentText(CheckForUpdateUtil.getStringRes(R.string.update_progress) + " 0%").setTicker(CheckForUpdateUtil.getStringRes(R.string.update_downloading)).setWhen(System.currentTimeMillis()).setPriority(Notification.PRIORITY_DEFAULT).setSmallIcon(R.mipmap.ic_launcher).setProgress(100, 0, false);<NEW_LINE>manager.notify(NOTIFY_ID, builder.build());<NEW_LINE>WXLogUtils.e("Update", "start download");<NEW_LINE>Downloader.download(url, new Downloader.DownloadCallback(getCacheDir().getAbsolutePath(), "playground.apk") {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onProgress(float progress) {<NEW_LINE>if (progress * 100 - progress >= 1) {<NEW_LINE>int p = (int) (progress * 100);<NEW_LINE>builder.setContentText(CheckForUpdateUtil.getStringRes(R.string.update_progress) + p + "%");<NEW_LINE>builder.setProgress(100, p, false);<NEW_LINE>manager.notify(NOTIFY_ID, builder.build());<NEW_LINE>WXLogUtils.d("Update", "progress:" + p);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(File file) {<NEW_LINE>WXLogUtils.d("Update", "success: " + file.getAbsolutePath());<NEW_LINE>manager.cancel(NOTIFY_ID);<NEW_LINE>Uri uri = Uri.fromFile(file);<NEW_LINE>Intent installIntent = new Intent(Intent.ACTION_VIEW);<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {<NEW_LINE>installIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);<NEW_LINE>Uri contentUri = FileProvider.getUriForFile(WXEnvironment.getApplication(), <MASK><NEW_LINE>installIntent.setDataAndType(contentUri, "application/vnd.android.package-archive");<NEW_LINE>} else {<NEW_LINE>installIntent.setDataAndType(uri, "application/vnd.android.package-archive");<NEW_LINE>installIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>}<NEW_LINE>startActivity(installIntent);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(final Exception e) {<NEW_LINE>WXSDKManager.getInstance().getWXRenderManager().postOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>Toast.makeText(UpdateService.this, "Failed to update:" + e.getMessage(), Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>}, 0);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
BuildConfig.APPLICATION_ID + ".fileprovider", file);
1,211,371
public boolean handle(KeyEvent event) {<NEW_LINE>event = mTranslator.doTranslateKeys(event);<NEW_LINE>setDispatchEvent(event);<NEW_LINE>boolean isUpAction = event.getAction() == DEFAULT_ACTION;<NEW_LINE>boolean isDownAction = event.getAction() == KeyEvent.ACTION_DOWN;<NEW_LINE>// user opens the video and continue to hold the ok button<NEW_LINE>boolean stillHoldingOk = mDisable && isOkKey(event);<NEW_LINE>if (isVolumeEvent(event) || stillHoldingOk) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (isBackKey(event) && !uiVisible) {<NEW_LINE>if (isUpAction) {<NEW_LINE>mFragment.onBackPressed();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (isBackKey(event) || isOutFakeKey(event)) {<NEW_LINE>return hideUI(event);<NEW_LINE>}<NEW_LINE>if (applyMediaKeys(event)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Show the controls on any key event.<NEW_LINE>if (!uiVisible && isDownAction) {<NEW_LINE>mFragment.getExoPlayerView().showController();<NEW_LINE>}<NEW_LINE>if (uiVisible && isMenuKey(event) && isDownAction) {<NEW_LINE>mFragment.getExoPlayerView().hideController();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (applySeekAction(event, uiVisible) || isNonOKAction(event, uiVisible)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (uiVisible) {<NEW_LINE>// reset controller auto-hide timeout<NEW_LINE>mFragment.getExoPlayerView().showController();<NEW_LINE>}<NEW_LINE>// // Fix focus lost after Suggestions<NEW_LINE>// if (mFragment.getExoPlayerView().findFocus() == null) {<NEW_LINE>// mFragment.getExoPlayerView().findViewById(R.id.exo_suggestions).requestFocus();<NEW_LINE>// }<NEW_LINE>// If the event was not handled then see if the player view can handle it as a media key event.<NEW_LINE>return mFragment.getExoPlayerView().dispatchKeyEvent(event);<NEW_LINE>}
boolean uiVisible = mFragment.isUiVisible();
76,962
private void appendObjectStringify(Writer writer, HollowDataAccess dataAccess, HollowObjectTypeDataAccess typeDataAccess, int ordinal, int indentation) throws IOException {<NEW_LINE>HollowObjectSchema schema = typeDataAccess.getSchema();<NEW_LINE>if (schema.numFields() == 1 && (collapseAllSingleFieldObjects || collapseObjectTypes.contains(schema.getName()))) {<NEW_LINE>appendFieldStringify(writer, dataAccess, indentation, schema, typeDataAccess, ordinal, 0);<NEW_LINE>} else {<NEW_LINE>writer.append("{");<NEW_LINE>boolean firstField = true;<NEW_LINE>indentation++;<NEW_LINE>for (int i = 0; i < schema.numFields(); i++) {<NEW_LINE>String fieldName = schema.getFieldName(i);<NEW_LINE>if (!typeDataAccess.isNull(ordinal, i)) {<NEW_LINE>if (firstField)<NEW_LINE>firstField = false;<NEW_LINE>else<NEW_LINE>writer.append(",");<NEW_LINE>if (prettyPrint) {<NEW_LINE>writer.append(NEWLINE);<NEW_LINE>appendIndentation(writer, indentation);<NEW_LINE>}<NEW_LINE>writer.append("\"").append<MASK><NEW_LINE>appendFieldStringify(writer, dataAccess, indentation, schema, typeDataAccess, ordinal, i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (prettyPrint && !firstField) {<NEW_LINE>writer.append(NEWLINE);<NEW_LINE>appendIndentation(writer, indentation - 1);<NEW_LINE>}<NEW_LINE>writer.append("}");<NEW_LINE>}<NEW_LINE>}
(fieldName).append("\": ");
1,206,738
public static ListDataSourcesResponse unmarshall(ListDataSourcesResponse listDataSourcesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDataSourcesResponse.setRequestId(_ctx.stringValue("ListDataSourcesResponse.RequestId"));<NEW_LINE>listDataSourcesResponse.setSuccess(_ctx.booleanValue("ListDataSourcesResponse.Success"));<NEW_LINE>listDataSourcesResponse.setTotalCount(_ctx.integerValue("ListDataSourcesResponse.TotalCount"));<NEW_LINE>List<DataSource> dataSources = new ArrayList<DataSource>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDataSourcesResponse.DataSources.Length"); i++) {<NEW_LINE>DataSource dataSource = new DataSource();<NEW_LINE>dataSource.setConnectionInfo(_ctx.stringValue("ListDataSourcesResponse.DataSources[" + i + "].ConnectionInfo"));<NEW_LINE>dataSource.setDataSourceId(_ctx.stringValue("ListDataSourcesResponse.DataSources[" + i + "].DataSourceId"));<NEW_LINE>dataSource.setDataSourceType(_ctx.stringValue("ListDataSourcesResponse.DataSources[" + i + "].DataSourceType"));<NEW_LINE>dataSource.setGmtCreate(_ctx.stringValue("ListDataSourcesResponse.DataSources[" + i + "].GmtCreate"));<NEW_LINE>dataSource.setGmtModified(_ctx.stringValue<MASK><NEW_LINE>dataSource.setName(_ctx.stringValue("ListDataSourcesResponse.DataSources[" + i + "].Name"));<NEW_LINE>dataSources.add(dataSource);<NEW_LINE>}<NEW_LINE>listDataSourcesResponse.setDataSources(dataSources);<NEW_LINE>return listDataSourcesResponse;<NEW_LINE>}
("ListDataSourcesResponse.DataSources[" + i + "].GmtModified"));
1,501,039
private void updateLightListUniforms(Matrix4f viewMatrix, Shader shader, LightList lights) {<NEW_LINE>Uniform ambientColor = shader.getUniform("g_AmbientLightColor");<NEW_LINE>ambientColor.setValue(VarType.Vector4, getAmbientColor(lights, true, ambientLightColor));<NEW_LINE>Uniform lightData = shader.getUniform("g_LightData");<NEW_LINE>int totalSize = tempDirLights.size() * 2 + tempPointLights.size() * 2 + tempSpotLights.size() * 3;<NEW_LINE>lightData.setVector4Length(totalSize);<NEW_LINE>int index = 0;<NEW_LINE>for (DirectionalLight light : tempDirLights) {<NEW_LINE>ColorRGBA color = light.getColor();<NEW_LINE>tempDirection.set(light.getDirection());<NEW_LINE>transformDirection(viewMatrix, tempDirection);<NEW_LINE>lightData.setVector4InArray(color.r, color.g, color.b, 1f, index++);<NEW_LINE>lightData.setVector4InArray(tempDirection.x, tempDirection.y, tempDirection.z, 1f, index++);<NEW_LINE>}<NEW_LINE>for (PointLight light : tempPointLights) {<NEW_LINE>ColorRGBA color = light.getColor();<NEW_LINE>tempPosition.set(light.getPosition());<NEW_LINE><MASK><NEW_LINE>transformPosition(viewMatrix, tempPosition);<NEW_LINE>lightData.setVector4InArray(color.r, color.g, color.b, 1f, index++);<NEW_LINE>lightData.setVector4InArray(tempPosition.x, tempPosition.y, tempPosition.z, invRadius, index++);<NEW_LINE>}<NEW_LINE>for (SpotLight light : tempSpotLights) {<NEW_LINE>ColorRGBA color = light.getColor();<NEW_LINE>Vector3f pos = light.getPosition();<NEW_LINE>Vector3f dir = light.getDirection();<NEW_LINE>tempPosition.set(light.getPosition());<NEW_LINE>tempDirection.set(light.getDirection());<NEW_LINE>transformPosition(viewMatrix, tempPosition);<NEW_LINE>transformDirection(viewMatrix, tempDirection);<NEW_LINE>float invRange = light.getInvSpotRange();<NEW_LINE>float spotAngleCos = light.getPackedAngleCos();<NEW_LINE>lightData.setVector4InArray(color.r, color.g, color.b, 1f, index++);<NEW_LINE>lightData.setVector4InArray(tempPosition.x, tempPosition.y, tempPosition.z, invRange, index++);<NEW_LINE>lightData.setVector4InArray(tempDirection.x, tempDirection.y, tempDirection.z, spotAngleCos, index++);<NEW_LINE>}<NEW_LINE>}
float invRadius = light.getInvRadius();
505,776
public void marshall(SignUpRequest signUpRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (signUpRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(signUpRequest.getClientId(), CLIENTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(signUpRequest.getSecretHash(), SECRETHASH_BINDING);<NEW_LINE>protocolMarshaller.marshall(signUpRequest.getUsername(), USERNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(signUpRequest.getPassword(), PASSWORD_BINDING);<NEW_LINE>protocolMarshaller.marshall(signUpRequest.getUserAttributes(), USERATTRIBUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(signUpRequest.getValidationData(), VALIDATIONDATA_BINDING);<NEW_LINE>protocolMarshaller.marshall(signUpRequest.getAnalyticsMetadata(), ANALYTICSMETADATA_BINDING);<NEW_LINE>protocolMarshaller.marshall(signUpRequest.getUserContextData(), USERCONTEXTDATA_BINDING);<NEW_LINE>protocolMarshaller.marshall(signUpRequest.getClientMetadata(), CLIENTMETADATA_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + <MASK><NEW_LINE>}<NEW_LINE>}
e.getMessage(), e);
1,733,068
public ApiResponse<Subscription> subscriptionGetSubscriptionWithHttpInfo() throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/subscription";<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>final String[] localVarAccepts = { "application/json", "text/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String <MASK><NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<Subscription> localVarReturnType = new GenericType<Subscription>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
1,460,083
public void saveToFile() {<NEW_LINE>// create properties<NEW_LINE>Properties properties = new Properties();<NEW_LINE>// get parameters<NEW_LINE>properties.setProperty("param_migrationMode_isUpgrade", booleanToString(isUpgrade()));<NEW_LINE>if (getLogLevel() != null)<NEW_LINE>properties.setProperty("param_maxLogLevel", getLogLevel().toString());<NEW_LINE>properties.setProperty("param_attemptTranslation", booleanToString(isAttemptTranslation()));<NEW_LINE>properties.setProperty("param_preserveTableID", booleanToString(isPreserveTableID()));<NEW_LINE>properties.setProperty("param_dropSource"<MASK><NEW_LINE>properties.setProperty("param_optimizeDatabase", booleanToString(isOptimizeDatabase()));<NEW_LINE>if (getSourceVendor() != null)<NEW_LINE>properties.setProperty("param_sourceDB_vendor", getSourceVendor());<NEW_LINE>if (getSourceHost() != null)<NEW_LINE>properties.setProperty("param_sourceDB_host", getSourceHost());<NEW_LINE>if (getSourcePort() != null)<NEW_LINE>properties.setProperty("param_sourceDB_port", getSourcePort());<NEW_LINE>if (getSourceName() != null)<NEW_LINE>properties.setProperty("param_sourceDB_name", getSourceName());<NEW_LINE>if (getSourceCatalog() != null)<NEW_LINE>properties.setProperty("param_sourceDB_catalog", getSourceCatalog());<NEW_LINE>if (getSourceSchema() != null)<NEW_LINE>properties.setProperty("param_sourceDB_schema", getSourceSchema());<NEW_LINE>if (getSourceUser() != null)<NEW_LINE>properties.setProperty("param_sourceDB_user", getSourceUser());<NEW_LINE>if (getSourcePasswd() != null)<NEW_LINE>properties.setProperty("param_sourceDB_passwd", getSourcePasswd());<NEW_LINE>if (getSourceSystemUser() != null)<NEW_LINE>properties.setProperty("param_sourceDB_systemUser", getSourceSystemUser());<NEW_LINE>if (getSourceSystemPasswd() != null)<NEW_LINE>properties.setProperty("param_sourceDB_systemPasswd", getSourceSystemPasswd());<NEW_LINE>if (getTargetVendor() != null)<NEW_LINE>properties.setProperty("param_targetDB_vendor", getTargetVendor());<NEW_LINE>if (getTargetHost() != null)<NEW_LINE>properties.setProperty("param_targetDB_host", getTargetHost());<NEW_LINE>if (getTargetPort() != null)<NEW_LINE>properties.setProperty("param_targetDB_port", getTargetPort());<NEW_LINE>if (getTargetName() != null)<NEW_LINE>properties.setProperty("param_targetDB_name", getTargetName());<NEW_LINE>if (getTargetCatalog() != null)<NEW_LINE>properties.setProperty("param_targetDB_catalog", getTargetCatalog());<NEW_LINE>if (getTargetSchema() != null)<NEW_LINE>properties.setProperty("param_targetDB_schema", getTargetSchema());<NEW_LINE>if (getTargetUser() != null)<NEW_LINE>properties.setProperty("param_targetDB_user", getTargetUser());<NEW_LINE>if (getTargetPasswd() != null)<NEW_LINE>properties.setProperty("param_targetDB_passwd", getTargetPasswd());<NEW_LINE>if (getTargetSystemUser() != null)<NEW_LINE>properties.setProperty("param_targetDB_systemUser", getTargetSystemUser());<NEW_LINE>if (getTargetSystemPasswd() != null)<NEW_LINE>properties.setProperty("param_targetDB_systemPasswd", getTargetSystemPasswd());<NEW_LINE>// save properties to file<NEW_LINE>FileOutputStream out;<NEW_LINE>try {<NEW_LINE>out = new FileOutputStream(getConfigFileName());<NEW_LINE>properties.store(out, "---ADEMPIERE MIGRATION PARAMETERS---");<NEW_LINE>out.close();<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>out = null;<NEW_LINE>// release properties<NEW_LINE>properties.clear();<NEW_LINE>}
, booleanToString(isDropSource()));
1,695,279
public void testAsyncInvoker_post3(Map<String, String> param, StringBuilder ret) {<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE><MASK><NEW_LINE>Client c = cb.build();<NEW_LINE>WebTarget t = c.target("http://" + serverIP + ":" + serverPort + "/bookstore/bookstore2/asyncpost3");<NEW_LINE>Builder builder = t.request();<NEW_LINE>builder.accept("application/xml");<NEW_LINE>AsyncInvoker asyncInvoker = builder.async();<NEW_LINE>GenericType<List<Book>> genericResponseType = new GenericType<List<Book>>() {<NEW_LINE>};<NEW_LINE>Book book = new Book("Test book3", 102);<NEW_LINE>Future<List<Book>> future = asyncInvoker.post(Entity.xml(book), genericResponseType);<NEW_LINE>try {<NEW_LINE>List<Book> response = future.get();<NEW_LINE>ret.append(response.get(response.size() - 1).getName());<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>c.close();<NEW_LINE>}
ClientBuilder cb = ClientBuilder.newBuilder();
1,254,107
private static void adjustTypeDescriptions(Map<Class<?>, ExpandedTypeDescription> types) {<NEW_LINE>ExpandedTypeDescription pathItemTD = types.get(PathItem.class);<NEW_LINE>for (PathItem.HttpMethod m : PathItem.HttpMethod.values()) {<NEW_LINE>pathItemTD.substituteProperty(m.name().toLowerCase(), Operation.class, getter(m), setter(m));<NEW_LINE>pathItemTD.addExcludes(m.name());<NEW_LINE>}<NEW_LINE>Set.<Class<?>>of(Schema.class, ServerVariable.class).forEach(c -> {<NEW_LINE>ExpandedTypeDescription tdWithEnumeration = types.get(c);<NEW_LINE>tdWithEnumeration.substituteProperty("enum", List.class, "getEnumeration", "setEnumeration");<NEW_LINE>tdWithEnumeration.<MASK><NEW_LINE>tdWithEnumeration.addExcludes("enumeration");<NEW_LINE>});<NEW_LINE>for (ExpandedTypeDescription td : types.values()) {<NEW_LINE>if (Extensible.class.isAssignableFrom(td.getType())) {<NEW_LINE>td.addExtensions();<NEW_LINE>}<NEW_LINE>if (td.hasDefaultProperty()) {<NEW_LINE>td.substituteProperty("default", Object.class, "getDefaultValue", "setDefaultValue");<NEW_LINE>td.addExcludes("defaultValue");<NEW_LINE>}<NEW_LINE>if (isRef(td)) {<NEW_LINE>td.addRef();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
addPropertyParameters("enum", String.class);
947,419
protected void parseIntent(Context ctx, String action, Bundle bundle) throws IllegalArgumentException {<NEW_LINE>boolean playing = bundle.getBoolean("playing", false);<NEW_LINE>if (!playing) {<NEW_LINE>// if not playing, there is no guarantee the bundle will contain any track info<NEW_LINE>setState(MicroService.State.UNKNOWN_NONPLAYING);<NEW_LINE>setIsSameAsCurrentTrack();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Artist artist = Artist.get(bundle.getString("artist"));<NEW_LINE>Album album = null;<NEW_LINE>if (bundle.getString("album") != null) {<NEW_LINE>album = Album.get(bundle.getString("album"), artist);<NEW_LINE>}<NEW_LINE>Track track = Track.get(bundle.getString("track"), album, artist);<NEW_LINE>String source = bundle.getString("source");<NEW_LINE>if (source == null || source.length() > 1) {<NEW_LINE>source = "P";<NEW_LINE>}<NEW_LINE>setSource(source);<NEW_LINE>setTimestamp(System.currentTimeMillis());<NEW_LINE>// optional<NEW_LINE>String <MASK><NEW_LINE>setMbid(mbid);<NEW_LINE>// optional unless source<NEW_LINE>int duration = bundle.getInt("secs", -1);<NEW_LINE>// is P, but we don't care<NEW_LINE>if (duration != -1) {<NEW_LINE>track.setDuration(duration * 1000);<NEW_LINE>}<NEW_LINE>// optional<NEW_LINE>int tnr = bundle.getInt("tracknumber", -1);<NEW_LINE>if (tnr != -1) {<NEW_LINE>track.setAlbumPos(tnr);<NEW_LINE>}<NEW_LINE>// we've handled stopping/pausing at the top<NEW_LINE>setState(MicroService.State.RESUME);<NEW_LINE>setTrack(track);<NEW_LINE>}
mbid = bundle.getString("mb-trackid");
352,066
public static ClientMessage encodeRequest(java.lang.String name, com.hazelcast.internal.serialization.Data key, com.hazelcast.internal.serialization.Data value, long threadId, long ttl, long maxIdle) {<NEW_LINE>ClientMessage clientMessage = ClientMessage.createForEncode();<NEW_LINE>clientMessage.setRetryable(false);<NEW_LINE>clientMessage.setOperationName("Map.PutWithMaxIdle");<NEW_LINE>ClientMessage.Frame initialFrame = new ClientMessage.Frame(new byte[REQUEST_INITIAL_FRAME_SIZE], UNFRAGMENTED_MESSAGE);<NEW_LINE>encodeInt(initialFrame.content, TYPE_FIELD_OFFSET, REQUEST_MESSAGE_TYPE);<NEW_LINE>encodeInt(initialFrame.content, PARTITION_ID_FIELD_OFFSET, -1);<NEW_LINE>encodeLong(initialFrame.content, REQUEST_THREAD_ID_FIELD_OFFSET, threadId);<NEW_LINE>encodeLong(initialFrame.content, REQUEST_TTL_FIELD_OFFSET, ttl);<NEW_LINE>encodeLong(<MASK><NEW_LINE>clientMessage.add(initialFrame);<NEW_LINE>StringCodec.encode(clientMessage, name);<NEW_LINE>DataCodec.encode(clientMessage, key);<NEW_LINE>DataCodec.encode(clientMessage, value);<NEW_LINE>return clientMessage;<NEW_LINE>}
initialFrame.content, REQUEST_MAX_IDLE_FIELD_OFFSET, maxIdle);
245,886
public void process(int row, int[] scores) {<NEW_LINE>int indexDisparity = imageDisparity.startIndex + row * imageDisparity.stride;<NEW_LINE>// Mark all pixels as invalid which can't be estimate due to disparityMin<NEW_LINE>for (int col = 0; col < disparityMin; col++) {<NEW_LINE>imageDisparity.data[<MASK><NEW_LINE>}<NEW_LINE>// Select the best disparity from all the rest<NEW_LINE>for (int col = disparityMin; col < imageWidth; col++) {<NEW_LINE>int localRange = disparityMaxAtColumnL2R(col) - disparityMin + 1;<NEW_LINE>int indexScore = col - disparityMin;<NEW_LINE>int bestDisparity = 0;<NEW_LINE>int scoreBest = scores[indexScore];<NEW_LINE>indexScore += imageWidth;<NEW_LINE>for (int disparity = 1; disparity < localRange; disparity++, indexScore += imageWidth) {<NEW_LINE>int s = scores[indexScore];<NEW_LINE>if (s < scoreBest) {<NEW_LINE>scoreBest = s;<NEW_LINE>bestDisparity = disparity;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>imageDisparity.data[indexDisparity++] = (byte) bestDisparity;<NEW_LINE>}<NEW_LINE>}
indexDisparity++] = (byte) disparityRange;
599,831
// hmm, one listener can be added more times but should not be problem since frameworks in project do not change often...<NEW_LINE>private void listenOnFrameworks() {<NEW_LINE>List<PhpFrameworkProvider> frameworks = project.getFrameworks();<NEW_LINE>List<ImportantFilesImplementation> newConfigFiles = new ArrayList<>(frameworks.size());<NEW_LINE>PhpModule phpModule = project.getPhpModule();<NEW_LINE>for (PhpFrameworkProvider framework : frameworks) {<NEW_LINE>ImportantFilesImplementation configurationFiles = framework.getConfigurationFiles2(phpModule);<NEW_LINE>if (configurationFiles != null) {<NEW_LINE>newConfigFiles.add(configurationFiles);<NEW_LINE>configurationFiles.addChangeListener(WeakListeners.change(this, configurationFiles));<NEW_LINE>} else {<NEW_LINE>File[] files = framework.getConfigurationFiles(phpModule);<NEW_LINE>if (files.length > 0) {<NEW_LINE>LOGGER.log(Level.INFO, <MASK><NEW_LINE>ImportantFilesImplementation dummyConfigFiles = new ImportantFilesImplementationImpl(project, framework.getIdentifier(), files);<NEW_LINE>newConfigFiles.add(dummyConfigFiles);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>configFiles.clear();<NEW_LINE>configFiles.addAll(newConfigFiles);<NEW_LINE>}
"PHP framework {0} uses deprecated method, switch to PhpFrameworkProvider.getConfigurationFiles2()", framework.getIdentifier());
250,101
protected static Media readMedia(JsonNode node) {<NEW_LINE>Media media = new Media();<NEW_LINE>JsonNode bitrate = node.get("bitrate");<NEW_LINE>if (bitrate != null && !bitrate.isNull()) {<NEW_LINE>media.bitrate = bitrate.intValue();<NEW_LINE>media.hasBitrate = true;<NEW_LINE>}<NEW_LINE>media.copyright = node.path("copyright").textValue();<NEW_LINE>media.duration = node.path("duration").longValue();<NEW_LINE>media.format = node.path("format").textValue();<NEW_LINE>media.height = node.path("height").intValue();<NEW_LINE>media.player = Media.Player.valueOf(node.get("player").textValue());<NEW_LINE>ArrayNode personsArrayNode = (ArrayNode) node.get("persons");<NEW_LINE>int size = personsArrayNode.size();<NEW_LINE>List<String> persons = new ArrayList<String>(size);<NEW_LINE>for (JsonNode person : personsArrayNode) {<NEW_LINE>persons.<MASK><NEW_LINE>}<NEW_LINE>media.persons = persons;<NEW_LINE>media.size = node.get("size").intValue();<NEW_LINE>media.title = node.get("title").textValue();<NEW_LINE>media.uri = node.get("uri").textValue();<NEW_LINE>media.width = node.get("width").intValue();<NEW_LINE>return media;<NEW_LINE>}
add(person.textValue());
1,329,826
protected boolean shouldSkipOverrideProperty(P property) {<NEW_LINE>P existingProperty = entity.getPersistentProperty(property.getName());<NEW_LINE>if (existingProperty == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Class<?> declaringClass = getDeclaringClass(property);<NEW_LINE>Class<?> existingDeclaringClass = getDeclaringClass(existingProperty);<NEW_LINE>Class<?> propertyType = getPropertyType(property);<NEW_LINE>Class<<MASK><NEW_LINE>if (!propertyType.isAssignableFrom(existingPropertyType)) {<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.warn(String.format("Offending property declaration in '%s %s.%s' shadowing '%s %s.%s' in '%s'. ", propertyType.getSimpleName(), declaringClass.getName(), property.getName(), existingPropertyType.getSimpleName(), existingDeclaringClass.getName(), existingProperty.getName(), entity.getType().getSimpleName()));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
?> existingPropertyType = getPropertyType(existingProperty);
271,212
public static DescribeAppGroupDataReportResponse unmarshall(DescribeAppGroupDataReportResponse describeAppGroupDataReportResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeAppGroupDataReportResponse.setRequestId(_ctx.stringValue("DescribeAppGroupDataReportResponse.requestId"));<NEW_LINE>Result result = new Result();<NEW_LINE>result.setReceivedCount(_ctx.integerValue("DescribeAppGroupDataReportResponse.result.receivedCount"));<NEW_LINE>List<ReceivedSampleItem> receivedSample = new ArrayList<ReceivedSampleItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeAppGroupDataReportResponse.result.receivedSample.Length"); i++) {<NEW_LINE>ReceivedSampleItem receivedSampleItem = new ReceivedSampleItem();<NEW_LINE>receivedSampleItem.setReceivedTimeMs(_ctx.longValue<MASK><NEW_LINE>Message message = new Message();<NEW_LINE>message.setClientIp(_ctx.stringValue("DescribeAppGroupDataReportResponse.result.receivedSample[" + i + "].message.clientIp"));<NEW_LINE>message.setArg3(_ctx.stringValue("DescribeAppGroupDataReportResponse.result.receivedSample[" + i + "].message.arg3"));<NEW_LINE>message.setUserId(_ctx.stringValue("DescribeAppGroupDataReportResponse.result.receivedSample[" + i + "].message.userId"));<NEW_LINE>message.setArgs(_ctx.stringValue("DescribeAppGroupDataReportResponse.result.receivedSample[" + i + "].message.args"));<NEW_LINE>message.setArg1(_ctx.stringValue("DescribeAppGroupDataReportResponse.result.receivedSample[" + i + "].message.arg1"));<NEW_LINE>message.setSdkType(_ctx.stringValue("DescribeAppGroupDataReportResponse.result.receivedSample[" + i + "].message.sdkType"));<NEW_LINE>message.setSessionId(_ctx.stringValue("DescribeAppGroupDataReportResponse.result.receivedSample[" + i + "].message.sessionId"));<NEW_LINE>message.setEventId(_ctx.integerValue("DescribeAppGroupDataReportResponse.result.receivedSample[" + i + "].message.eventId"));<NEW_LINE>message.setSdkVersion(_ctx.stringValue("DescribeAppGroupDataReportResponse.result.receivedSample[" + i + "].message.sdkVersion"));<NEW_LINE>message.setPage(_ctx.stringValue("DescribeAppGroupDataReportResponse.result.receivedSample[" + i + "].message.page"));<NEW_LINE>receivedSampleItem.setMessage(message);<NEW_LINE>receivedSample.add(receivedSampleItem);<NEW_LINE>}<NEW_LINE>result.setReceivedSample(receivedSample);<NEW_LINE>describeAppGroupDataReportResponse.setResult(result);<NEW_LINE>return describeAppGroupDataReportResponse;<NEW_LINE>}
("DescribeAppGroupDataReportResponse.result.receivedSample[" + i + "].receivedTimeMs"));
1,165,285
public OutlierResult run(Relation<O> relation) {<NEW_LINE><MASK><NEW_LINE>QueryBuilder<O> qb = new QueryBuilder<>(relation, distance);<NEW_LINE>// Phase one: KNN and k-dist<NEW_LINE>WritableDoubleDataStore kdists = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_DB);<NEW_LINE>WritableDataStore<KNNList> knns = DataStoreUtil.makeStorage(ids, DataStoreFactory.HINT_DB, KNNList.class);<NEW_LINE>{<NEW_LINE>// Compute kNN<NEW_LINE>KNNProcessor knnm = new KNNProcessor(kplus, () -> qb.kNNByDBID(kplus));<NEW_LINE>SharedObject<KNNList> knnv = new SharedObject<>();<NEW_LINE>WriteDataStoreProcessor<KNNList> storek = new WriteDataStoreProcessor<>(knns);<NEW_LINE>knnm.connectKNNOutput(knnv);<NEW_LINE>storek.connectInput(knnv);<NEW_LINE>// Compute k-dist<NEW_LINE>KDistanceProcessor kdistm = new KDistanceProcessor(kplus);<NEW_LINE>SharedDouble kdistv = new SharedDouble();<NEW_LINE>WriteDoubleDataStoreProcessor storem = new WriteDoubleDataStoreProcessor(kdists);<NEW_LINE>kdistm.connectKNNInput(knnv);<NEW_LINE>kdistm.connectOutput(kdistv);<NEW_LINE>storem.connectInput(kdistv);<NEW_LINE>ParallelExecutor.run(ids, knnm, storek, kdistm, storem);<NEW_LINE>}<NEW_LINE>// Phase two: lrd<NEW_LINE>WritableDoubleDataStore lrds = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_DB);<NEW_LINE>{<NEW_LINE>LRDProcessor lrdm = new LRDProcessor(knns, kdists);<NEW_LINE>SharedDouble lrdv = new SharedDouble();<NEW_LINE>WriteDoubleDataStoreProcessor storelrd = new WriteDoubleDataStoreProcessor(lrds);<NEW_LINE>lrdm.connectOutput(lrdv);<NEW_LINE>storelrd.connectInput(lrdv);<NEW_LINE>ParallelExecutor.run(ids, lrdm, storelrd);<NEW_LINE>}<NEW_LINE>// No longer needed.<NEW_LINE>kdists.destroy();<NEW_LINE>kdists = null;<NEW_LINE>// Phase three: LOF<NEW_LINE>WritableDoubleDataStore lofs = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_DB);<NEW_LINE>DoubleMinMax minmax;<NEW_LINE>{<NEW_LINE>LOFProcessor lofm = new LOFProcessor(knns, lrds, true);<NEW_LINE>SharedDouble lofv = new SharedDouble();<NEW_LINE>DoubleMinMaxProcessor mmm = new DoubleMinMaxProcessor();<NEW_LINE>WriteDoubleDataStoreProcessor storelof = new WriteDoubleDataStoreProcessor(lofs);<NEW_LINE>lofm.connectOutput(lofv);<NEW_LINE>mmm.connectInput(lofv);<NEW_LINE>storelof.connectInput(lofv);<NEW_LINE>ParallelExecutor.run(ids, lofm, storelof, mmm);<NEW_LINE>minmax = mmm.getMinMax();<NEW_LINE>}<NEW_LINE>DoubleRelation scoreres = new MaterializedDoubleRelation("Local Outlier Factor", ids, lofs);<NEW_LINE>OutlierScoreMeta meta = new BasicOutlierScoreMeta(minmax.getMin(), minmax.getMax(), 0.0, Double.POSITIVE_INFINITY, 1.0);<NEW_LINE>return new OutlierResult(meta, scoreres);<NEW_LINE>}
DBIDs ids = relation.getDBIDs();
1,299,990
public InputDefinition unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>InputDefinition inputDefinition = new InputDefinition();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("attributes", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>inputDefinition.setAttributes(new ListUnmarshaller<Attribute>(AttributeJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return inputDefinition;<NEW_LINE>}
)).unmarshall(context));
1,348,576
public org.python.Object __imul__(org.python.Object other) {<NEW_LINE>if (other instanceof org.python.types.Int) {<NEW_LINE>long count = ((org.python.types.Int) other).value;<NEW_LINE>org.python.types.List result = new org.python.types.List();<NEW_LINE>for (long i = 0; i < count; i++) {<NEW_LINE>result.value.addAll(this.value);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} else if (other instanceof org.python.types.Bool) {<NEW_LINE>boolean bool = ((org.python.<MASK><NEW_LINE>if (bool) {<NEW_LINE>return this;<NEW_LINE>} else {<NEW_LINE>return new org.python.types.List();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new org.python.exceptions.TypeError("can't multiply sequence by non-int of type '" + other.typeName() + "'");<NEW_LINE>}<NEW_LINE>}
types.Bool) other).value;
1,144,500
public DeleteMessageBatchRequestEntry unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DeleteMessageBatchRequestEntry deleteMessageBatchRequestEntry = new DeleteMessageBatchRequestEntry();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return deleteMessageBatchRequestEntry;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("Id", targetDepth)) {<NEW_LINE>deleteMessageBatchRequestEntry.setId(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("ReceiptHandle", targetDepth)) {<NEW_LINE>deleteMessageBatchRequestEntry.setReceiptHandle(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return deleteMessageBatchRequestEntry;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
122,231
private void registerCommands(CommandDispatcher<CommandSourceStack> dispatcher, boolean dedicated) {<NEW_LINE>WorldEdit.getInstance().getEventBus().post(new PlatformsRegisteredEvent());<NEW_LINE>PlatformManager manager = WorldEdit.getInstance().getPlatformManager();<NEW_LINE>Platform commandsPlatform = <MASK><NEW_LINE>if (commandsPlatform != platform || !platform.isHookingEvents()) {<NEW_LINE>// We're not in control of commands/events -- do not register.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Command> commands = manager.getPlatformCommandManager().getCommandManager().getAllCommands().collect(toList());<NEW_LINE>for (Command command : commands) {<NEW_LINE>CommandWrapper.register(dispatcher, command);<NEW_LINE>Set<String> perms = command.getCondition().as(PermissionCondition.class).map(PermissionCondition::getPermissions).orElseGet(Collections::emptySet);<NEW_LINE>if (!perms.isEmpty()) {<NEW_LINE>perms.forEach(getPermissionsProvider()::registerPermission);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
manager.queryCapability(Capability.USER_COMMANDS);
771,683
public synchronized Future start() throws IllegalStateException {<NEW_LINE>if (isStopping() || isStopped() || isFailed()) {<NEW_LINE>throw new IllegalStateException(getIdentifier() + " is stopping or stopped, can not start again");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (isStarting() || isStarted()) {<NEW_LINE>return startFuture;<NEW_LINE>}<NEW_LINE>onModuleStarting();<NEW_LINE>// initialize<NEW_LINE>applicationDeployer.initialize();<NEW_LINE>initialize();<NEW_LINE>// export services<NEW_LINE>exportServices();<NEW_LINE>// prepare application instance<NEW_LINE>// exclude internal module to avoid wait itself<NEW_LINE>if (moduleModel != moduleModel.getApplicationModel().getInternalModule()) {<NEW_LINE>applicationDeployer.prepareInternalModule();<NEW_LINE>}<NEW_LINE>// refer services<NEW_LINE>referServices();<NEW_LINE>// if no async export/refer services, just set started<NEW_LINE>if (asyncExportingFutures.isEmpty() && asyncReferringFutures.isEmpty()) {<NEW_LINE>onModuleStarted();<NEW_LINE>} else {<NEW_LINE>frameworkExecutorRepository.getSharedExecutor().submit(() -> {<NEW_LINE>try {<NEW_LINE>// wait for export finish<NEW_LINE>waitExportFinish();<NEW_LINE>// wait for refer finish<NEW_LINE>waitReferFinish();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>logger.warn("wait for export/refer services occurred an exception", e);<NEW_LINE>} finally {<NEW_LINE>onModuleStarted();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>onModuleFailed(getIdentifier(<MASK><NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>return startFuture;<NEW_LINE>}
) + " start failed: " + e, e);
1,715,820
static <T, M extends Regression<T>> RegressionMetrics regression(T[] x, double[] y, BiFunction<T[], double[], M> trainer) {<NEW_LINE>int n = x.length;<NEW_LINE>int[][] train = LOOCV.of(n);<NEW_LINE>double[] prediction = new double[n];<NEW_LINE>long fitTime = 0;<NEW_LINE>long scoreTime = 0;<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>T[] trainx = MathEx.slice(x, train[i]);<NEW_LINE>double[] trainy = MathEx.slice(y, train[i]);<NEW_LINE><MASK><NEW_LINE>M model = trainer.apply(trainx, trainy);<NEW_LINE>fitTime += System.nanoTime() - start;<NEW_LINE>start = System.nanoTime();<NEW_LINE>prediction[i] = model.predict(x[i]);<NEW_LINE>scoreTime += System.nanoTime() - start;<NEW_LINE>}<NEW_LINE>return new RegressionMetrics(fitTime / (n * 1E6), scoreTime / (n * 1E6), n, RSS.of(y, prediction), MSE.of(y, prediction), RMSE.of(y, prediction), MAD.of(y, prediction), R2.of(y, prediction));<NEW_LINE>}
long start = System.nanoTime();
1,094,346
private void onIsolinesStateChanged(@NonNull IsolinesState type) {<NEW_LINE>if (type != IsolinesState.EXPIREDDATA) {<NEW_LINE>type.activate(this, findViewById(R.id.coordinator), findViewById(R.id.menu_frame));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>com.mapswithme.maps.dialog.AlertDialog dialog = new com.mapswithme.maps.dialog.AlertDialog.Builder().setTitleId(R.string.downloader_update_maps).setMessageId(R.string.isolines_activation_error_dialog).setPositiveBtnId(R.string.ok).setNegativeBtnId(R.string.cancel).setFragManagerStrategyType(com.mapswithme.maps.dialog.AlertDialog.FragManagerStrategyType.ACTIVITY_FRAGMENT_MANAGER).setReqCode(REQ_CODE_ISOLINES_ERROR).build();<NEW_LINE><MASK><NEW_LINE>}
dialog.show(this, ISOLINES_ERROR_DIALOG_TAG);
800,550
protected Expression transformDeclarationExpression(final DeclarationExpression de) {<NEW_LINE>visitAnnotations(de);<NEW_LINE>Expression oldLeft = de.getLeftExpression();<NEW_LINE>checkingVariableTypeInDeclaration = true;<NEW_LINE>Expression left = transform(oldLeft);<NEW_LINE>checkingVariableTypeInDeclaration = false;<NEW_LINE>if (left instanceof ClassExpression) {<NEW_LINE>ClassExpression ce = (ClassExpression) left;<NEW_LINE>addError("you tried to assign a value to the class " + ce.getType().getName(), oldLeft);<NEW_LINE>return de;<NEW_LINE>}<NEW_LINE>Expression right = transform(de.getRightExpression());<NEW_LINE>if (right == de.getRightExpression()) {<NEW_LINE>fixDeclaringClass(de);<NEW_LINE>return de;<NEW_LINE>}<NEW_LINE>DeclarationExpression newDeclExpr = new DeclarationExpression(left, de.getOperation(), right);<NEW_LINE>newDeclExpr.<MASK><NEW_LINE>newDeclExpr.addAnnotations(de.getAnnotations());<NEW_LINE>newDeclExpr.copyNodeMetaData(de);<NEW_LINE>fixDeclaringClass(newDeclExpr);<NEW_LINE>return newDeclExpr;<NEW_LINE>}
setDeclaringClass(de.getDeclaringClass());
1,145,013
public static GetQualityResultResponse unmarshall(GetQualityResultResponse getQualityResultResponse, UnmarshallerContext _ctx) {<NEW_LINE>getQualityResultResponse.setRequestId(_ctx.stringValue("GetQualityResultResponse.RequestId"));<NEW_LINE>getQualityResultResponse.setMessage(_ctx.stringValue("GetQualityResultResponse.Message"));<NEW_LINE>getQualityResultResponse.setCode(_ctx.stringValue("GetQualityResultResponse.Code"));<NEW_LINE>getQualityResultResponse.setChannelTypeName(_ctx.stringValue("GetQualityResultResponse.ChannelTypeName"));<NEW_LINE>getQualityResultResponse.setSuccess(_ctx.booleanValue("GetQualityResultResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNo(_ctx.integerValue("GetQualityResultResponse.Data.PageNo"));<NEW_LINE>data.setPageSize(_ctx.integerValue("GetQualityResultResponse.Data.PageSize"));<NEW_LINE>data.setTotalNum(_ctx.integerValue("GetQualityResultResponse.Data.TotalNum"));<NEW_LINE>List<QualityResultResponseListItem> qualityResultResponseList = new ArrayList<QualityResultResponseListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetQualityResultResponse.Data.QualityResultResponseList.Length"); i++) {<NEW_LINE>QualityResultResponseListItem qualityResultResponseListItem = new QualityResultResponseListItem();<NEW_LINE>qualityResultResponseListItem.setTouchId(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].TouchId"));<NEW_LINE>qualityResultResponseListItem.setServicerName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].ServicerName"));<NEW_LINE>qualityResultResponseListItem.setMemberName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].MemberName"));<NEW_LINE>qualityResultResponseListItem.setProjectName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].ProjectName"));<NEW_LINE>qualityResultResponseListItem.setProjectId(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].ProjectId"));<NEW_LINE>qualityResultResponseListItem.setChannelType(_ctx.stringValue<MASK><NEW_LINE>qualityResultResponseListItem.setChannelTypeName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].ChannelTypeName"));<NEW_LINE>qualityResultResponseListItem.setTouchStartTime(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].TouchStartTime"));<NEW_LINE>qualityResultResponseListItem.setServicerId(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].ServicerId"));<NEW_LINE>qualityResultResponseListItem.setRuleName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].RuleName"));<NEW_LINE>qualityResultResponseListItem.setRuleId(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].RuleId"));<NEW_LINE>qualityResultResponseListItem.setGroupName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].GroupName"));<NEW_LINE>qualityResultResponseListItem.setGroupId(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].GroupId"));<NEW_LINE>qualityResultResponseListItem.setInstanceName(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].InstanceName"));<NEW_LINE>qualityResultResponseListItem.setHitStatus(_ctx.booleanValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].HitStatus"));<NEW_LINE>qualityResultResponseListItem.setHitDetail(_ctx.stringValue("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].HitDetail"));<NEW_LINE>qualityResultResponseList.add(qualityResultResponseListItem);<NEW_LINE>}<NEW_LINE>data.setQualityResultResponseList(qualityResultResponseList);<NEW_LINE>getQualityResultResponse.setData(data);<NEW_LINE>return getQualityResultResponse;<NEW_LINE>}
("GetQualityResultResponse.Data.QualityResultResponseList[" + i + "].ChannelType"));
1,751,547
public static void main(String[] args) {<NEW_LINE>Loader.loadNativeLibraries();<NEW_LINE>// [START solver]<NEW_LINE>// Create the linear solver with the GLOP backend.<NEW_LINE>MPSolver solver = MPSolver.createSolver("GLOP");<NEW_LINE>// [END solver]<NEW_LINE>// [START variables]<NEW_LINE>// Create the variables x and y.<NEW_LINE>MPVariable x = solver.makeNumVar(0.0, 1.0, "x");<NEW_LINE>MPVariable y = solver.makeNumVar(0.0, 2.0, "y");<NEW_LINE>System.out.println("Number of variables = " + solver.numVariables());<NEW_LINE>// [END variables]<NEW_LINE>// [START constraints]<NEW_LINE>// Create a linear constraint, 0 <= x + y <= 2.<NEW_LINE>MPConstraint ct = solver.makeConstraint(0.0, 2.0, "ct");<NEW_LINE>ct.setCoefficient(x, 1);<NEW_LINE>ct.setCoefficient(y, 1);<NEW_LINE>System.out.println("Number of constraints = " + solver.numConstraints());<NEW_LINE>// [END constraints]<NEW_LINE>// [START objective]<NEW_LINE>// Create the objective function, 3 * x + y.<NEW_LINE>MPObjective objective = solver.objective();<NEW_LINE>objective.setCoefficient(x, 3);<NEW_LINE>objective.setCoefficient(y, 1);<NEW_LINE>objective.setMaximization();<NEW_LINE>// [END objective]<NEW_LINE>// [START solve]<NEW_LINE>solver.solve();<NEW_LINE>// [END solve]<NEW_LINE>// [START print_solution]<NEW_LINE>System.out.println("Solution:");<NEW_LINE>System.out.println(<MASK><NEW_LINE>System.out.println("x = " + x.solutionValue());<NEW_LINE>System.out.println("y = " + y.solutionValue());<NEW_LINE>// [END print_solution]<NEW_LINE>}
"Objective value = " + objective.value());
5,189
public final void signedFactor() throws RecognitionException, TokenStreamException {<NEW_LINE>returnAST = null;<NEW_LINE>ASTPair currentAST = new ASTPair();<NEW_LINE>PascalAST signedFactor_AST = null;<NEW_LINE>{<NEW_LINE>switch(LA(1)) {<NEW_LINE>case PLUS:<NEW_LINE>{<NEW_LINE>PascalAST tmp123_AST = null;<NEW_LINE>tmp123_AST = (PascalAST) astFactory.create(LT(1));<NEW_LINE>astFactory.makeASTRoot(currentAST, tmp123_AST);<NEW_LINE>match(PLUS);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case MINUS:<NEW_LINE>{<NEW_LINE>PascalAST tmp124_AST = null;<NEW_LINE>tmp124_AST = (PascalAST) astFactory<MASK><NEW_LINE>astFactory.makeASTRoot(currentAST, tmp124_AST);<NEW_LINE>match(MINUS);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case LPAREN:<NEW_LINE>case IDENT:<NEW_LINE>case CHR:<NEW_LINE>case NUM_INT:<NEW_LINE>case NUM_REAL:<NEW_LINE>case STRING_LITERAL:<NEW_LINE>case LBRACK:<NEW_LINE>case LBRACK2:<NEW_LINE>case AT:<NEW_LINE>case NOT:<NEW_LINE>case NIL:<NEW_LINE>{<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>throw new NoViableAltException(LT(1), getFilename());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>factor();<NEW_LINE>astFactory.addASTChild(currentAST, returnAST);<NEW_LINE>signedFactor_AST = (PascalAST) currentAST.root;<NEW_LINE>returnAST = signedFactor_AST;<NEW_LINE>}
.create(LT(1));
1,501,646
public BDDDomain[] extDomain(BigInteger[] domainSizes) {<NEW_LINE>int offset = fdvarnum;<NEW_LINE>int binoffset;<NEW_LINE>int extravars = 0;<NEW_LINE>int n, bn;<NEW_LINE>boolean more;<NEW_LINE>int num = domainSizes.length;<NEW_LINE>{<NEW_LINE>domain = new BDDDomain[num];<NEW_LINE>} else /* Allocated before */<NEW_LINE>{<NEW_LINE>if (fdvarnum + num > domain.length) {<NEW_LINE>int fdvaralloc = domain.length + Math.max(num, domain.length);<NEW_LINE>BDDDomain[<MASK><NEW_LINE>System.arraycopy(domain, 0, d2, 0, domain.length);<NEW_LINE>domain = d2;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (bn = 0, more = true; more; bn++) {<NEW_LINE>more = false;<NEW_LINE>for (n = 0; n < num; n++) {<NEW_LINE>if (bn < domain[n + fdvarnum].varNum()) {<NEW_LINE>more = true;<NEW_LINE>domain[n + fdvarnum].ivar[bn] = binoffset++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (n = 0; n < num; n++) {<NEW_LINE>domain[n + fdvarnum].var = makeSet(domain[n + fdvarnum].ivar);<NEW_LINE>}<NEW_LINE>fdvarnum += num;<NEW_LINE>firstbddvar += extravars;<NEW_LINE>BDDDomain[] r = new BDDDomain[num];<NEW_LINE>System.arraycopy(domain, offset, r, 0, num);<NEW_LINE>return r;<NEW_LINE>}
] d2 = new BDDDomain[fdvaralloc];
965,208
public void visitFor(SFor userForNode, ScriptScope scriptScope) {<NEW_LINE>ForLoopNode irForLoopNode = new ForLoopNode(userForNode.getLocation());<NEW_LINE>irForLoopNode.setInitializerNode(visit(userForNode.getInitializerNode(), scriptScope));<NEW_LINE>irForLoopNode.setConditionNode(injectCast(userForNode.getConditionNode(), scriptScope));<NEW_LINE>irForLoopNode.setAfterthoughtNode((ExpressionNode) visit(userForNode.getAfterthoughtNode(), scriptScope));<NEW_LINE>irForLoopNode.setBlockNode((BlockNode) visit(userForNode<MASK><NEW_LINE>if (scriptScope.getCondition(userForNode, ContinuousLoop.class)) {<NEW_LINE>irForLoopNode.attachCondition(IRCContinuous.class);<NEW_LINE>}<NEW_LINE>scriptScope.putDecoration(userForNode, new IRNodeDecoration(irForLoopNode));<NEW_LINE>}
.getBlockNode(), scriptScope));
1,346,742
public static long parseFromSize(String str) {<NEW_LINE>if (str == null || str.isEmpty()) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>str = str.toLowerCase();<NEW_LINE>long fromScale = BYTE_SIZE;<NEW_LINE>try {<NEW_LINE>if (str.endsWith("kb")) {<NEW_LINE>str = str.substring(0, str.length() - 2).trim();<NEW_LINE>fromScale = KB_SIZE;<NEW_LINE>}<NEW_LINE>if (str.endsWith("k")) {<NEW_LINE>str = str.substring(0, str.length() - 1).trim();<NEW_LINE>fromScale = KB_SIZE;<NEW_LINE>} else if (str.endsWith("mb")) {<NEW_LINE>str = str.substring(0, str.length() - 2).trim();<NEW_LINE>fromScale = MB_SIZE;<NEW_LINE>} else if (str.endsWith("m")) {<NEW_LINE>str = str.substring(0, str.length() - 1).trim();<NEW_LINE>fromScale = MB_SIZE;<NEW_LINE>} else if (str.endsWith("gb")) {<NEW_LINE>str = str.substring(0, str.length() - 2).trim();<NEW_LINE>fromScale = GB_SIZE;<NEW_LINE>} else if (str.endsWith("g")) {<NEW_LINE>str = str.substring(0, str.length() - 1).trim();<NEW_LINE>fromScale = GB_SIZE;<NEW_LINE>} else if (str.endsWith("tb")) {<NEW_LINE>str = str.substring(0, str.length(<MASK><NEW_LINE>fromScale = TB_SIZE;<NEW_LINE>} else if (str.endsWith("t")) {<NEW_LINE>str = str.substring(0, str.length() - 1).trim();<NEW_LINE>fromScale = TB_SIZE;<NEW_LINE>} else if (str.endsWith("bytes")) {<NEW_LINE>str = str.substring(0, str.length() - "bytes".length()).trim();<NEW_LINE>fromScale = BYTE_SIZE;<NEW_LINE>}<NEW_LINE>str = str.replace(",", "");<NEW_LINE>long value = (long) Double.parseDouble(str);<NEW_LINE>return value * fromScale;<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>}
) - 2).trim();
1,499,656
public final void scheduledTrigger() {<NEW_LINE>AgentInstanceContext agentInstanceContext = observerEventEvaluator.getContext().getAgentInstanceContext();<NEW_LINE>agentInstanceContext.getInstrumentationProvider().qPatternObserverScheduledEval();<NEW_LINE>agentInstanceContext.getAuditProvider().scheduleFire(agentInstanceContext, ScheduleObjectType.pattern, NAME_AUDITPROVIDER_SCHEDULE);<NEW_LINE>// compute reschedule time<NEW_LINE>isTimerActive = false;<NEW_LINE>SchedulingService schedulingService = agentInstanceContext.getSchedulingService();<NEW_LINE>long nextScheduledTime = computeNextSetLastScheduled(schedulingService.getTime(), agentInstanceContext.<MASK><NEW_LINE>boolean quit = !isFilterChildNonQuitting || nextScheduledTime == -1;<NEW_LINE>observerEventEvaluator.observerEvaluateTrue(beginState, quit);<NEW_LINE>// handle no more invocations planned<NEW_LINE>if (nextScheduledTime == -1) {<NEW_LINE>stopObserve();<NEW_LINE>observerEventEvaluator.observerEvaluateFalse(false);<NEW_LINE>agentInstanceContext.getInstrumentationProvider().aPatternObserverScheduledEval();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>agentInstanceContext.getAuditProvider().scheduleAdd(nextScheduledTime, agentInstanceContext, scheduleHandle, ScheduleObjectType.pattern, NAME_AUDITPROVIDER_SCHEDULE);<NEW_LINE>schedulingService.add(nextScheduledTime, scheduleHandle, scheduleSlot);<NEW_LINE>isTimerActive = true;<NEW_LINE>agentInstanceContext.getInstrumentationProvider().aPatternObserverScheduledEval();<NEW_LINE>}
getClasspathImportServiceRuntime().getTimeAbacus());
1,630,513
public boolean amiiboFastWrite(int addr, int bank, byte[] data) {<NEW_LINE>if (null == data) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return internalFastWrite((startAddr, bank1, data1) -> {<NEW_LINE>byte[] req = new byte[(data1.length + 4)];<NEW_LINE>req[0] = (byte) NfcByte.N2_FAST_WRITE;<NEW_LINE>req[1] = (byte) (startAddr & 0xFF);<NEW_LINE>req[2] = <MASK><NEW_LINE>req[3] = (byte) (data1.length & 0xFF);<NEW_LINE>try {<NEW_LINE>System.arraycopy(data1, 0, req, 4, data1.length);<NEW_LINE>this.transceive(req);<NEW_LINE>return true;<NEW_LINE>} catch (Exception e) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}, addr, bank, data);<NEW_LINE>}
(byte) (bank1 & 0xFF);
150,979
private void rewriteAgentConfigTablePart1() throws Exception {<NEW_LINE>dropTableIfExists("agent_config_temp");<NEW_LINE>session.updateSchemaWithRetry("create table if not exists agent_config_temp" + " (agent_rollup_id varchar, config blob, config_update boolean," + " config_update_token uuid, primary key (agent_rollup_id))");<NEW_LINE>PreparedStatement insertTempPS = session.prepare("insert into agent_config_temp" + " (agent_rollup_id, config, config_update, config_update_token) values" + " (?, ?, ?, ?)");<NEW_LINE>ResultSet results = session.read("select agent_rollup_id, config, config_update," + " config_update_token from agent_config");<NEW_LINE>for (Row row : results) {<NEW_LINE>BoundStatement boundStatement = insertTempPS.bind();<NEW_LINE>boundStatement.setString(0, row.getString(0));<NEW_LINE>boundStatement.setBytes(1, row.getBytes(1));<NEW_LINE>boundStatement.setBool(2, row.getBool(2));<NEW_LINE>boundStatement.setUUID(3<MASK><NEW_LINE>session.write(boundStatement);<NEW_LINE>}<NEW_LINE>}
, row.getUUID(3));
1,359,264
public void read(org.apache.thrift.protocol.TProtocol prot, FetchRuleKeyLogsRequest struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet incoming = iprot.readBitSet(3);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>{<NEW_LINE>org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());<NEW_LINE>struct.ruleKeys = new java.util.ArrayList<java.lang<MASK><NEW_LINE>@org.apache.thrift.annotation.Nullable<NEW_LINE>java.lang.String _elem30;<NEW_LINE>for (int _i31 = 0; _i31 < _list29.size; ++_i31) {<NEW_LINE>_elem30 = iprot.readString();<NEW_LINE>struct.ruleKeys.add(_elem30);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>struct.setRuleKeysIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>struct.repository = iprot.readString();<NEW_LINE>struct.setRepositoryIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(2)) {<NEW_LINE>struct.scheduleType = iprot.readString();<NEW_LINE>struct.setScheduleTypeIsSet(true);<NEW_LINE>}<NEW_LINE>}
.String>(_list29.size);
1,799,704
public K lastKey() {<NEW_LINE>atomicOperationsManager.acquireReadLock(this);<NEW_LINE>try {<NEW_LINE>acquireSharedLock();<NEW_LINE>try {<NEW_LINE>final <MASK><NEW_LINE>final BucketSearchResult searchResult = lastItem(atomicOperation);<NEW_LINE>if (searchResult == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final OCacheEntry cacheEntry = loadPageForRead(atomicOperation, fileId, searchResult.pageIndex, false);<NEW_LINE>try {<NEW_LINE>final CellBTreeBucketSingleValueV1<K> bucket = new CellBTreeBucketSingleValueV1<>(cacheEntry);<NEW_LINE>return bucket.getKey(searchResult.itemIndex, encryption, keySerializer);<NEW_LINE>} finally {<NEW_LINE>releasePageFromRead(atomicOperation, cacheEntry);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>releaseSharedLock();<NEW_LINE>}<NEW_LINE>} catch (final IOException e) {<NEW_LINE>throw OException.wrapException(new OCellBTreeSingleValueV1Exception("Error during finding last key in sbtree [" + getName() + "]", this), e);<NEW_LINE>} finally {<NEW_LINE>atomicOperationsManager.releaseReadLock(this);<NEW_LINE>}<NEW_LINE>}
OAtomicOperation atomicOperation = atomicOperationsManager.getCurrentOperation();
95,522
private void initWindow() {<NEW_LINE>logger.info("Initializing display (if last line in log then likely the game crashed from an issue with your " + "video card)");<NEW_LINE>// set opengl core profile to 3.3<NEW_LINE>GLFW.glfwWindowHint(GLFW.GLFW_CONTEXT_VERSION_MAJOR, 3);<NEW_LINE>GLFW.glfwWindowHint(GLFW.GLFW_CONTEXT_VERSION_MINOR, 3);<NEW_LINE>GLFW.glfwWindowHint(GLFW.GLFW_OPENGL_PROFILE, GLFW.GLFW_OPENGL_CORE_PROFILE);<NEW_LINE>long window = GLFW.glfwCreateWindow(config.getWindowWidth(), config.getWindowHeight(), "Terasology Alpha", 0, 0);<NEW_LINE>if (window == 0) {<NEW_LINE>throw new RuntimeException("Failed to create window");<NEW_LINE>}<NEW_LINE>GLFW.glfwMakeContextCurrent(window);<NEW_LINE>if (!config.isVSync()) {<NEW_LINE>GLFW.glfwSwapInterval(0);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String root = "org/terasology/engine/icons/";<NEW_LINE>ClassLoader classLoader <MASK><NEW_LINE>BufferedImage icon16 = ImageIO.read(classLoader.getResourceAsStream(root + "gooey_sweet_16.png"));<NEW_LINE>BufferedImage icon32 = ImageIO.read(classLoader.getResourceAsStream(root + "gooey_sweet_32.png"));<NEW_LINE>BufferedImage icon64 = ImageIO.read(classLoader.getResourceAsStream(root + "gooey_sweet_64.png"));<NEW_LINE>BufferedImage icon128 = ImageIO.read(classLoader.getResourceAsStream(root + "gooey_sweet_128.png"));<NEW_LINE>GLFWImage.Buffer buffer = GLFWImage.create(4);<NEW_LINE>buffer.put(0, LwjglGraphicsUtil.convertToGLFWFormat(icon16));<NEW_LINE>buffer.put(1, LwjglGraphicsUtil.convertToGLFWFormat(icon32));<NEW_LINE>buffer.put(2, LwjglGraphicsUtil.convertToGLFWFormat(icon64));<NEW_LINE>buffer.put(3, LwjglGraphicsUtil.convertToGLFWFormat(icon128));<NEW_LINE>GLFW.glfwSetWindowIcon(window, buffer);<NEW_LINE>} catch (IOException | IllegalArgumentException e) {<NEW_LINE>logger.warn("Could not set icon", e);<NEW_LINE>}<NEW_LINE>lwjglDisplay.setDisplayModeSetting(config.getDisplayModeSetting(), false);<NEW_LINE>GLFW.glfwShowWindow(window);<NEW_LINE>}
= getClass().getClassLoader();
1,639,401
private void addStaticInitializer(ClassWriter cw) {<NEW_LINE>MethodVisitor mv = cw.visitMethod(ACC_STATIC, "<clinit>", "()V", null, null);<NEW_LINE>mv.visitCode();<NEW_LINE>if (pluginId != null) {<NEW_LINE>mv.visitLdcInsn(pluginId);<NEW_LINE>mv.visitMethodInsn(INVOKESTATIC, "org/glowroot/agent/plugin/api/Agent", "getConfigService", "(Ljava/lang/String;)Lorg/glowroot/agent/plugin/api/config/ConfigService;", false);<NEW_LINE>mv.visitFieldInsn(<MASK><NEW_LINE>}<NEW_LINE>if (config.isTimerOrGreater()) {<NEW_LINE>mv.visitLdcInsn(Type.getObjectType(adviceInternalName));<NEW_LINE>mv.visitMethodInsn(INVOKESTATIC, "org/glowroot/agent/plugin/api/Agent", "getTimerName", "(Ljava/lang/Class;)Lorg/glowroot/agent/plugin/api/TimerName;", false);<NEW_LINE>mv.visitFieldInsn(PUTSTATIC, adviceInternalName, "timerName", "Lorg/glowroot/agent/plugin/api/TimerName;");<NEW_LINE>}<NEW_LINE>if (!config.enabledProperty().isEmpty() && pluginId != null) {<NEW_LINE>mv.visitFieldInsn(GETSTATIC, adviceInternalName, "configService", "Lorg/glowroot/agent/plugin/api/config/ConfigService;");<NEW_LINE>mv.visitLdcInsn(config.enabledProperty());<NEW_LINE>mv.visitMethodInsn(INVOKEINTERFACE, "org/glowroot/agent/plugin/api/config/ConfigService", "getBooleanProperty", "(Ljava/lang/String;)Lorg/glowroot/agent/plugin/api/config/BooleanProperty;", true);<NEW_LINE>mv.visitFieldInsn(PUTSTATIC, adviceInternalName, "enabled", "Lorg/glowroot/agent/plugin/api/config/BooleanProperty;");<NEW_LINE>}<NEW_LINE>if (!config.traceEntryEnabledProperty().isEmpty() && pluginId != null) {<NEW_LINE>mv.visitFieldInsn(GETSTATIC, adviceInternalName, "configService", "Lorg/glowroot/agent/plugin/api/config/ConfigService;");<NEW_LINE>mv.visitLdcInsn(config.traceEntryEnabledProperty());<NEW_LINE>mv.visitMethodInsn(INVOKEINTERFACE, "org/glowroot/agent/plugin/api/config/ConfigService", "getBooleanProperty", "(Ljava/lang/String;)Lorg/glowroot/agent/plugin/api/config/BooleanProperty;", true);<NEW_LINE>mv.visitFieldInsn(PUTSTATIC, adviceInternalName, "entryEnabled", "Lorg/glowroot/agent/plugin/api/config/BooleanProperty;");<NEW_LINE>}<NEW_LINE>mv.visitInsn(RETURN);<NEW_LINE>mv.visitMaxs(0, 0);<NEW_LINE>mv.visitEnd();<NEW_LINE>}
PUTSTATIC, adviceInternalName, "configService", "Lorg/glowroot/agent/plugin/api/config/ConfigService;");
671,621
protected ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, String sectionName, String subjectType) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<List<Wo>> result = new ActionResult<>();<NEW_LINE>EntityManager em = emc.get(BBSSubjectInfo.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Wo> cq = cb.createQuery(Wo.class);<NEW_LINE>Root<BBSSubjectInfo> root = cq.from(BBSSubjectInfo.class);<NEW_LINE>Predicate p = cb.equal(root.get<MASK><NEW_LINE>p = cb.and(p, cb.equal(root.get(BBSSubjectInfo_.type), subjectType));<NEW_LINE>Path<Integer> grade = root.get(BBSSubjectInfo_.grade);<NEW_LINE>cq.multiselect(grade, cb.count(root).as(Integer.class)).where(p).groupBy(grade).orderBy(cb.desc(grade));<NEW_LINE>List<Wo> wos = em.createQuery(cq).getResultList();<NEW_LINE>result.setData(wos);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
(BBSSubjectInfo_.sectionName), sectionName);
124,868
protected <RESULT extends ClickLog> RESULT createEntity(Map<String, Object> source, Class<? extends RESULT> entityType) {<NEW_LINE>try {<NEW_LINE>final RESULT result = entityType.newInstance();<NEW_LINE>result.setUrlId(DfTypeUtil.toString(source.get("urlId")));<NEW_LINE>result.setDocId(DfTypeUtil.toString(source.get("docId")));<NEW_LINE>result.setOrder(DfTypeUtil.toInteger(source.get("order")));<NEW_LINE>result.setQueryId(DfTypeUtil.toString(source.get("queryId")));<NEW_LINE>result.setQueryRequestedAt(toLocalDateTime(source.get("queryRequestedAt")));<NEW_LINE>result.setRequestedAt(toLocalDateTime(source.get("requestedAt")));<NEW_LINE>result.setUrl(DfTypeUtil.toString(source.get("url")));<NEW_LINE>result.setUserSessionId(DfTypeUtil.toString(source.get("userSessionId")));<NEW_LINE>return updateEntity(source, result);<NEW_LINE>} catch (InstantiationException | IllegalAccessException e) {<NEW_LINE>final String msg = "Cannot create a new instance: " + entityType.getName();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
throw new IllegalBehaviorStateException(msg, e);
1,623,711
private boolean rebalanceByMovingLeadershipIn(Broker broker, ClusterModel clusterModel, Set<Goal> optimizedGoals, OptimizationOptions optimizationOptions) {<NEW_LINE>long moveStartTimeMs = System.currentTimeMillis();<NEW_LINE>if (!clusterModel.deadBrokers().isEmpty() || optimizationOptions.excludedBrokersForLeadership().contains(broker.id())) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>int numLeaderReplicas = broker.leaderReplicas().size();<NEW_LINE>Set<Broker> <MASK><NEW_LINE>Set<String> excludedTopics = optimizationOptions.excludedTopics();<NEW_LINE>boolean fastMode = optimizationOptions.fastMode();<NEW_LINE>for (Replica replica : broker.replicas()) {<NEW_LINE>if (fastMode && remainingTimeMs(_balancingConstraint.fastModePerBrokerMoveTimeoutMs(), moveStartTimeMs) <= 0) {<NEW_LINE>LOG.debug("Move leadership in timeout in fast mode for broker {}.", broker.id());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (replica.isLeader() || replica.isCurrentOffline() || excludedTopics.contains(replica.topicPartition().topic())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Broker b = maybeApplyBalancingAction(clusterModel, clusterModel.partition(replica.topicPartition()).leader(), candidateBrokers, ActionType.LEADERSHIP_MOVEMENT, optimizedGoals, optimizationOptions);<NEW_LINE>// Only check if we successfully moved something.<NEW_LINE>if (b != null) {<NEW_LINE>if (++numLeaderReplicas >= _balanceLowerLimit) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
candidateBrokers = Collections.singleton(broker);
888,677
private String generateExtractRvalue(TypeData data, Messager messager, String member) {<NEW_LINE><MASK><NEW_LINE>if (valueExtractFormatter.isEmpty()) {<NEW_LINE>if (data.isInterface()) {<NEW_LINE>Console.error(messager, "Interface %s cannot be parsed without a valueExtractFormatter " + "on either the interface's JsonType or field's JsonField annotation. (%s.%s)", data.getParsableType(), mSimpleClassName, member);<NEW_LINE>}<NEW_LINE>if (data.getMapping() == JsonField.TypeMapping.EXACT) {<NEW_LINE>valueExtractFormatter = sExactFormatters.get(data.getJsonAdapterOrParseType());<NEW_LINE>} else if (data.getMapping() == JsonField.TypeMapping.COERCED) {<NEW_LINE>valueExtractFormatter = sCoercedFormatters.get(data.getJsonAdapterOrParseType());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>StrFormat strFormat = StrFormat.createStringFormatter(valueExtractFormatter).addParam("parser_object", "jp").addParam("subobject_class", data.getParsableType());<NEW_LINE>if (!StringUtil.isNullOrEmpty(data.getParsableTypeParserClass())) {<NEW_LINE>strFormat.addParam("subobject_helper_class", data.getParsableTypeParserClass() + JsonAnnotationProcessorConstants.HELPER_CLASS_SUFFIX);<NEW_LINE>}<NEW_LINE>String rValue = strFormat.format();<NEW_LINE>if (data.getJsonAdapterFromJsonMethod() != null) {<NEW_LINE>// If we have a from json method, we call that method with the value<NEW_LINE>rValue = data.getJsonAdapterFromJsonMethod() + "(" + rValue + ")";<NEW_LINE>}<NEW_LINE>return rValue;<NEW_LINE>}
CodeFormatter valueExtractFormatter = data.getValueExtractFormatter();
1,690,470
public static void horizontal(Kernel1D_S32 kernel, GrayS16 src, GrayI16 dst) {<NEW_LINE>final short[] dataSrc = src.data;<NEW_LINE>final <MASK><NEW_LINE>final int[] dataKer = kernel.data;<NEW_LINE>final int offset = kernel.getOffset();<NEW_LINE>final int kernelWidth = kernel.getWidth();<NEW_LINE>final int width = src.getWidth();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, src.height, i -> {<NEW_LINE>for (int i = 0; i < src.height; i++) {<NEW_LINE>int indexDst = dst.startIndex + i * dst.stride + offset;<NEW_LINE>int j = src.startIndex + i * src.stride;<NEW_LINE>final int jEnd = j + width - (kernelWidth - 1);<NEW_LINE>for (; j < jEnd; j++) {<NEW_LINE>int total = 0;<NEW_LINE>int indexSrc = j;<NEW_LINE>for (int k = 0; k < kernelWidth; k++) {<NEW_LINE>total += (dataSrc[indexSrc++]) * dataKer[k];<NEW_LINE>}<NEW_LINE>dataDst[indexDst++] = (short) total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
short[] dataDst = dst.data;
180,456
public TemplateActiveVersionRequest unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>TemplateActiveVersionRequest templateActiveVersionRequest = new TemplateActiveVersionRequest();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Version", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>templateActiveVersionRequest.setVersion(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return templateActiveVersionRequest;<NEW_LINE>}
class).unmarshall(context));
351,346
private void checkSyncUpstreamsState(LoadBalancerRequestId loadBalancerRequestId, String singularityRequestId) {<NEW_LINE>Retryer<SingularityLoadBalancerUpdate> syncingRetryer = RetryerBuilder.<SingularityLoadBalancerUpdate>newBuilder().retryIfException().withWaitStrategy(WaitStrategies.fixedWait(1, TimeUnit.SECONDS)).retryIfResult(IS_WAITING_STATE::test).build();<NEW_LINE>try {<NEW_LINE>LOG.debug("Checking load balancer request to sync upstreams for service {} using a retryer until the request state is no longer waiting.", singularityRequestId);<NEW_LINE>SingularityLoadBalancerUpdate syncUpstreamsState = syncingRetryer.call(() -> lbClient.getState(loadBalancerRequestId));<NEW_LINE>if (syncUpstreamsState.getLoadBalancerState() == LoadBalancerRequestState.SUCCESS) {<NEW_LINE>LOG.debug("Syncing upstreams for singularity request {} is {}.", singularityRequestId, syncUpstreamsState);<NEW_LINE>} else {<NEW_LINE>LOG.error("Syncing upstreams for singularity request {} is {}.", singularityRequestId, syncUpstreamsState);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.<MASK><NEW_LINE>}<NEW_LINE>}
error("Could not check sync upstream state for singularity request {}. ", singularityRequestId, e);
969,008
public static IStatus waitForFolderAccess(String dir, long timeToWait) {<NEW_LINE>int retries = (int) (timeToWait / 500L) + 1;<NEW_LINE>Throwable lastException = null;<NEW_LINE>boolean isLocked = true;<NEW_LINE>// $NON-NLS-1$<NEW_LINE>File tempFile = new File(dir, ".tmp");<NEW_LINE>while (isLocked) {<NEW_LINE>try {<NEW_LINE>// fileLock = channel.lock(0L, Long.MAX_VALUE, true);<NEW_LINE><MASK><NEW_LINE>lastException = null;<NEW_LINE>} catch (Exception e) {<NEW_LINE>lastException = e;<NEW_LINE>}<NEW_LINE>if (isLocked) {<NEW_LINE>retries--;<NEW_LINE>if (retries == 0) {<NEW_LINE>// give up<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Thread.sleep(500L);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isLocked) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>IdeLog.// $NON-NLS-1$<NEW_LINE>logError(// $NON-NLS-1$<NEW_LINE>CoreIOPlugin.getDefault(), // $NON-NLS-1$<NEW_LINE>MessageFormat.format("Failed to write to {0}", dir), lastException);<NEW_LINE>return new Status(IStatus.ERROR, CoreIOPlugin.PLUGIN_ID, Messages.LockUtils_failedToWrite + dir + Messages.LockUtils_seeErrorLog, lastException);<NEW_LINE>}<NEW_LINE>if (tempFile != null) {<NEW_LINE>tempFile.delete();<NEW_LINE>}<NEW_LINE>return Status.OK_STATUS;<NEW_LINE>}
isLocked = !tempFile.createNewFile();
873,591
private static DataArrays trimDataArrays(final DataArrays da, final long thetaLong, final int numValues) {<NEW_LINE>final <MASK><NEW_LINE>final double[] valuesArrIn = da.valuesArr;<NEW_LINE>final int count = count(hashArrIn, thetaLong);<NEW_LINE>final long[] hashArrOut = new long[count];<NEW_LINE>final double[] valuesArrOut = new double[count * numValues];<NEW_LINE>int haInIdx;<NEW_LINE>int vaInIdx = 0;<NEW_LINE>int haOutIdx = 0;<NEW_LINE>int vaOutIdx = 0;<NEW_LINE>for (haInIdx = 0; haInIdx < count; haInIdx++, vaInIdx += numValues) {<NEW_LINE>final long hash = hashArrIn[haInIdx];<NEW_LINE>if (continueCondition(thetaLong, hash)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>hashArrOut[haOutIdx] = hashArrIn[haInIdx];<NEW_LINE>System.arraycopy(valuesArrIn, vaInIdx, valuesArrOut, vaOutIdx, numValues);<NEW_LINE>haOutIdx++;<NEW_LINE>vaOutIdx += numValues;<NEW_LINE>}<NEW_LINE>return new DataArrays(hashArrOut, valuesArrOut, count);<NEW_LINE>}
long[] hashArrIn = da.hashArr;
782,193
/*<NEW_LINE>@Override<NEW_LINE>public void onMapEvent(Event event, MapPosition position) {<NEW_LINE>// place.viewport = GmsMapsTypeHelper.toLatLngBounds(mapView.map().viewport().getBBox(null, 0));<NEW_LINE>// resultIntent.putExtra(LocationConstants.EXTRA_FINAL_BOUNDS, place.viewport);<NEW_LINE>// place.latLng = GmsMapsTypeHelper.toLatLng(position.getGeoPoint());<NEW_LINE>place.name = "";<NEW_LINE>place.address = "";<NEW_LINE>updateInfoText();<NEW_LINE>if (geocoderInProgress.compareAndSet(false, true)) {<NEW_LINE>new Thread(new Runnable() {<NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>LatLng ll = null;<NEW_LINE>while (ll != place.latLng) {<NEW_LINE>ll = place.latLng;<NEW_LINE>Thread.sleep(1000);<NEW_LINE>}<NEW_LINE>Geocoder geocoder = new Geocoder(PlacePickerActivity.this);<NEW_LINE>List<Address> addresses = geocoder.getFromLocation(place.latLng.latitude, place.latLng.longitude, 1);<NEW_LINE>if (addresses != null && !addresses.isEmpty() && addresses.get(0).getMaxAddressLineIndex() > 0) {<NEW_LINE>Address address = addresses.get(0);<NEW_LINE>StringBuilder sb = new StringBuilder(address.getAddressLine(0));<NEW_LINE>for (int i = 1; i < address.getMaxAddressLineIndex(); ++i) {<NEW_LINE>if (i == 1 && sb.toString().equals(address.getFeatureName())) {<NEW_LINE>sb = new StringBuilder<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>sb.append(", ").append(address.getAddressLine(i));<NEW_LINE>}<NEW_LINE>if (place.latLng == ll) {<NEW_LINE>place.address = sb.toString();<NEW_LINE>place.name = address.getFeatureName();<NEW_LINE>runOnUiThread(new Runnable() {<NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>updateInfoText();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ignored) {<NEW_LINE>Log.w(TAG, ignored);<NEW_LINE>} finally {<NEW_LINE>geocoderInProgress.lazySet(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}).start();<NEW_LINE>}<NEW_LINE>}*/<NEW_LINE>private void updateInfoText() {<NEW_LINE>if (TextUtils.isEmpty(place.address)) {<NEW_LINE>((TextView) findViewById(R.id.place_picker_info)).setText(getString(R.string.place_picker_location_lat_lng, place.latLng.latitude, place.latLng.longitude));<NEW_LINE>} else if (TextUtils.isEmpty(place.name)) {<NEW_LINE>((TextView) findViewById(R.id.place_picker_info)).setText(place.address);<NEW_LINE>} else {<NEW_LINE>((TextView) findViewById(R.id.place_picker_info)).setText(Html.fromHtml("<b>" + place.name + "</b>, " + place.address));<NEW_LINE>}<NEW_LINE>}
(address.getAddressLine(i));
1,500,141
private void doTokenize() throws AuraValidationException {<NEW_LINE>if (!StringUtils.isBlank(text)) {<NEW_LINE>int lastMatch = 0;<NEW_LINE>Matcher <MASK><NEW_LINE>while (matcher.find()) {<NEW_LINE>int start = matcher.start();<NEW_LINE>int end = matcher.end();<NEW_LINE>// All text before the currently found expression<NEW_LINE>if (lastMatch != start) {<NEW_LINE>maybeAddPlainText(lastMatch, start);<NEW_LINE>}<NEW_LINE>tokens.add(new Token(TokenType.EXPRESSION, start, end));<NEW_LINE>lastMatch = end;<NEW_LINE>}<NEW_LINE>// The remainder text after the last expression<NEW_LINE>int length = text.length();<NEW_LINE>if (lastMatch < length) {<NEW_LINE>maybeAddPlainText(lastMatch, length);<NEW_LINE>}<NEW_LINE>} else if (text != null) {<NEW_LINE>// Allow creation of whitespace or empty text components.<NEW_LINE>// If the caller doesn't want this behavior, it should make that<NEW_LINE>// decision externally before calling parse<NEW_LINE>maybeAddPlainText(0, text.length());<NEW_LINE>}<NEW_LINE>}
matcher = EXPRESSION_PATTERN.matcher(text);
1,590,803
public <B, R> Free<F, R> zip(Functor<F> f, Free<F, B> b, BiFunction<? super T, ? super B, ? extends R> zipper) {<NEW_LINE>Either<Higher<F, Free<F, T>>, T> first = resume(f);<NEW_LINE>Either<Higher<F, Free<F, B>>, B> <MASK><NEW_LINE>if (first.isLeft() && second.isLeft()) {<NEW_LINE>return suspend(f.map_(first.leftOrElse(null), a1 -> {<NEW_LINE>return suspend(f.map_(second.leftOrElse(null), b1 -> a1.zip(f, b1, zipper)));<NEW_LINE>}));<NEW_LINE>}<NEW_LINE>if (first.isRight() && second.isRight()) {<NEW_LINE>return done(zipper.apply(first.orElse(null), second.orElse(null)));<NEW_LINE>}<NEW_LINE>if (first.isLeft() && second.isRight()) {<NEW_LINE>return suspend(f.map_(first.leftOrElse(null), a1 -> a1.zip(f, b, zipper)));<NEW_LINE>}<NEW_LINE>if (first.isRight() && second.isLeft()) {<NEW_LINE>return suspend(f.map_(second.leftOrElse(null), a1 -> Free.<F, T>done(first.orElse(null)).zip(f, b, zipper)));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
second = b.resume(f);
1,211,996
private void updateOrganizations(OpenIdAlfioUser alfioUser) {<NEW_LINE>int userId = userRepository.findIdByUserName(alfioUser.getEmail()).orElseThrow();<NEW_LINE>var databaseOrganizationIds = organizationRepository.findAllForUser(alfioUser.getEmail()).stream().map(Organization::getId).collect(Collectors.toSet());<NEW_LINE>if (alfioUser.isAdmin()) {<NEW_LINE>if (!databaseOrganizationIds.isEmpty()) {<NEW_LINE>userOrganizationRepository.removeOrganizationUserLinks(userId, databaseOrganizationIds);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Integer> organizationIds;<NEW_LINE>var userOrg = alfioUser.getAlfioOrganizationAuthorizations().keySet();<NEW_LINE>if (!userOrg.isEmpty()) {<NEW_LINE>organizationIds = organizationRepository.findOrganizationIdsByExternalId(userOrg);<NEW_LINE>} else {<NEW_LINE>organizationIds = List.of();<NEW_LINE>}<NEW_LINE>var organizationsToUnlink = databaseOrganizationIds.stream().filter(orgId -> !organizationIds.contains(orgId)).collect(Collectors.toSet());<NEW_LINE>if (!organizationsToUnlink.isEmpty()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (organizationIds.isEmpty()) {<NEW_LINE>throw new IllegalStateException("The user needs to be ADMIN or have at least one organization linked");<NEW_LINE>}<NEW_LINE>var params = organizationIds.stream().filter(orgId -> !databaseOrganizationIds.contains(orgId)).map(id -> new MapSqlParameterSource("userId", userId).addValue("organizationId", id)).toArray(MapSqlParameterSource[]::new);<NEW_LINE>jdbcTemplate.batchUpdate(userOrganizationRepository.bulkCreate(), params);<NEW_LINE>}
userOrganizationRepository.removeOrganizationUserLinks(userId, organizationsToUnlink);
1,829,852
public double convexityFromYield(ResolvedFixedCouponBond bond, LocalDate settlementDate, double yield) {<NEW_LINE>ImmutableList<FixedCouponBondPaymentPeriod> payments = bond.getPeriodicPayments();<NEW_LINE>int nCoupon = payments.size() - couponIndex(payments, settlementDate);<NEW_LINE>FixedCouponBondYieldConvention yieldConv = bond.getYieldConvention();<NEW_LINE>if (nCoupon == 1) {<NEW_LINE>if (yieldConv.equals(US_STREET) || yieldConv.equals(DE_BONDS)) {<NEW_LINE>double couponPerYear = bond.getFrequency().eventsPerYear();<NEW_LINE>double factorToNextCoupon = factorToNextCoupon(bond, settlementDate);<NEW_LINE>double timeToPay = factorToNextCoupon / couponPerYear;<NEW_LINE>double disc = (<MASK><NEW_LINE>return 2d * timeToPay * timeToPay / (disc * disc);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (yieldConv.equals(US_STREET) || yieldConv.equals(GB_BUMP_DMO) || yieldConv.equals(DE_BONDS)) {<NEW_LINE>return convexityFromYieldStandard(bond, settlementDate, yield);<NEW_LINE>}<NEW_LINE>if (yieldConv.equals(JP_SIMPLE)) {<NEW_LINE>LocalDate maturityDate = bond.getUnadjustedEndDate();<NEW_LINE>if (settlementDate.isAfter(maturityDate)) {<NEW_LINE>return 0d;<NEW_LINE>}<NEW_LINE>double maturity = bond.getDayCount().relativeYearFraction(settlementDate, maturityDate);<NEW_LINE>double num = 1d + bond.getFixedRate() * maturity;<NEW_LINE>double den = 1d + yield * maturity;<NEW_LINE>double dirtyPrice = dirtyPriceFromCleanPrice(bond, settlementDate, num / den);<NEW_LINE>return 2d * num * pow2(maturity) * Math.pow(den, -3) / dirtyPrice;<NEW_LINE>}<NEW_LINE>throw new UnsupportedOperationException("The convention " + yieldConv.name() + " is not supported.");<NEW_LINE>}
1d + factorToNextCoupon * yield / couponPerYear);
230,016
public IBaseParameters diff(@Description(value = "The resource ID and version to diff from", example = "Patient/example/version/1") @OperationParam(name = ProviderConstants.DIFF_FROM_PARAMETER, typeName = "id", min = 1, max = 1) IIdType theFromVersion, @Description(value = "The resource ID and version to diff to", example = "Patient/example/version/2") @OperationParam(name = ProviderConstants.DIFF_TO_PARAMETER, typeName = "id", min = 1, max = 1) IIdType theToVersion, @Description(value = "Should differences in the Resource.meta element be included in the diff", example = "false") @OperationParam(name = ProviderConstants.DIFF_INCLUDE_META_PARAMETER, typeName = "boolean", min = 0, max = 1) IPrimitiveType<Boolean> theIncludeMeta, RequestDetails theRequestDetails) {<NEW_LINE>if (!Objects.equal(theFromVersion.getResourceType(), theToVersion.getResourceType())) {<NEW_LINE>String msg = myContext.getLocalizer().getMessage(DiffProvider.class, "cantDiffDifferentTypes");<NEW_LINE>throw new InvalidRequestException(Msg<MASK><NEW_LINE>}<NEW_LINE>IFhirResourceDao<?> dao = myDaoRegistry.getResourceDao(theFromVersion.getResourceType());<NEW_LINE>IBaseResource sourceResource = dao.read(theFromVersion, theRequestDetails);<NEW_LINE>IBaseResource targetResource = dao.read(theToVersion, theRequestDetails);<NEW_LINE>FhirPatch fhirPatch = newPatch(theIncludeMeta);<NEW_LINE>return fhirPatch.diff(sourceResource, targetResource);<NEW_LINE>}
.code(1129) + msg);
1,643,013
public DescribeHostsResult unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeHostsResult describeHostsResult = new DescribeHostsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return describeHostsResult;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("hostSet", targetDepth)) {<NEW_LINE>describeHostsResult.withHosts(<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("hostSet/item", targetDepth)) {<NEW_LINE>describeHostsResult.withHosts(HostStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>describeHostsResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return describeHostsResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
new ArrayList<Host>());
168,215
private void drawSettingsArrow(MatrixStack matrixStack, int x2, int x3, int y1, int y2, boolean hSettings) {<NEW_LINE>float xa1 = x3 + 1;<NEW_LINE>float xa2 = (x3 + x2) / 2.0F;<NEW_LINE>float xa3 = x2 - 1;<NEW_LINE>float ya1;<NEW_LINE>float ya2;<NEW_LINE>Matrix4f matrix = matrixStack.peek().getPositionMatrix();<NEW_LINE>BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();<NEW_LINE>if (isSettingsWindowOpen()) {<NEW_LINE>ya1 = y2 - 3.5F;<NEW_LINE>ya2 = y1 + 3;<NEW_LINE>RenderSystem.setShaderColor(hSettings ? 1 : 0.85F, 0, 0, 1);<NEW_LINE>} else {<NEW_LINE>ya1 = y1 + 3.5F;<NEW_LINE>ya2 = y2 - 3;<NEW_LINE>RenderSystem.setShaderColor(0, hSettings ? 1 : 0.85F, 0, 1);<NEW_LINE>}<NEW_LINE>// arrow<NEW_LINE>bufferBuilder.begin(VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION);<NEW_LINE>bufferBuilder.vertex(matrix, xa1, ya1, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, xa3, ya1, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, xa2, ya2, 0).next();<NEW_LINE>bufferBuilder.end();<NEW_LINE>BufferRenderer.draw(bufferBuilder);<NEW_LINE>// outline<NEW_LINE>RenderSystem.setShaderColor(0.0625F, 0.0625F, 0.0625F, 0.5F);<NEW_LINE>bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINE_STRIP, VertexFormats.POSITION);<NEW_LINE>bufferBuilder.vertex(matrix, xa1, ya1, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, xa3, ya1, 0).next();<NEW_LINE>bufferBuilder.vertex(matrix, xa2, <MASK><NEW_LINE>bufferBuilder.vertex(matrix, xa1, ya1, 0).next();<NEW_LINE>bufferBuilder.end();<NEW_LINE>BufferRenderer.draw(bufferBuilder);<NEW_LINE>}
ya2, 0).next();
1,591,471
private static int readSimpleHuffmanCode(int alphabetSizeMax, int alphabetSizeLimit, int[] tableGroup, int tableIdx, State s) {<NEW_LINE>// TODO(eustas): Avoid allocation?<NEW_LINE>int[] codeLengths = new int[alphabetSizeLimit];<NEW_LINE>int[] symbols = new int[4];<NEW_LINE>int maxBits = 1 + log2floor(alphabetSizeMax - 1);<NEW_LINE>int numSymbols = BitReader.readFewBits(s, 2) + 1;<NEW_LINE>for (int i = 0; i < numSymbols; i++) {<NEW_LINE>BitReader.fillBitWindow(s);<NEW_LINE>int symbol = BitReader.readFewBits(s, maxBits);<NEW_LINE>if (symbol >= alphabetSizeLimit) {<NEW_LINE>// COV_NF_LINE<NEW_LINE>throw new BrotliRuntimeException("Can't readHuffmanCode");<NEW_LINE>}<NEW_LINE>symbols[i] = symbol;<NEW_LINE>}<NEW_LINE>checkDupes(symbols, numSymbols);<NEW_LINE>int histogramId = numSymbols;<NEW_LINE>if (numSymbols == 4) {<NEW_LINE>histogramId += <MASK><NEW_LINE>}<NEW_LINE>switch(histogramId) {<NEW_LINE>case 1:<NEW_LINE>codeLengths[symbols[0]] = 1;<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>codeLengths[symbols[0]] = 1;<NEW_LINE>codeLengths[symbols[1]] = 1;<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>codeLengths[symbols[0]] = 1;<NEW_LINE>codeLengths[symbols[1]] = 2;<NEW_LINE>codeLengths[symbols[2]] = 2;<NEW_LINE>break;<NEW_LINE>case // uniform 4-symbol histogram<NEW_LINE>4:<NEW_LINE>codeLengths[symbols[0]] = 2;<NEW_LINE>codeLengths[symbols[1]] = 2;<NEW_LINE>codeLengths[symbols[2]] = 2;<NEW_LINE>codeLengths[symbols[3]] = 2;<NEW_LINE>break;<NEW_LINE>case // prioritized 4-symbol histogram<NEW_LINE>5:<NEW_LINE>codeLengths[symbols[0]] = 1;<NEW_LINE>codeLengths[symbols[1]] = 2;<NEW_LINE>codeLengths[symbols[2]] = 3;<NEW_LINE>codeLengths[symbols[3]] = 3;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// TODO(eustas): Use specialized version?<NEW_LINE>return Huffman.buildHuffmanTable(tableGroup, tableIdx, HUFFMAN_TABLE_BITS, codeLengths, alphabetSizeLimit);<NEW_LINE>}
BitReader.readFewBits(s, 1);
1,023,336
private void generateSplitPoints(final SplitStoreFromRDDOfElements operation, final Context context, final AccumuloStore store) throws OperationException {<NEW_LINE>final byte[] schemaAsJson = store<MASK><NEW_LINE>final String keyConverterClassName = store.getKeyPackage().getKeyConverter().getClass().getName();<NEW_LINE>final RDD<Text> rows = operation.getInput().mapPartitions(new ElementIteratorToPairIteratorFunction(keyConverterClassName, schemaAsJson), PRESERVE_PARTITIONING, PAIR_CLASS_TAG).flatMap(new KeyPairToRowFunction(), TEXT_CLASS_TAG);<NEW_LINE>final double fractionToSample = super.adjustFractionToSampleForSize(operation.getFractionToSample(), operation.getMaxSampleSize(), rows.count());<NEW_LINE>final Random seed = new Random(System.currentTimeMillis());<NEW_LINE>final List<String> sample = rows.sample(WITHOUT_REPLACEMENT, fractionToSample, seed.nextLong()).map(new TextToStringFunction(), STRING_CLASS_TAG).toJavaRDD().collect();<NEW_LINE>super.createSplitPoints(store, context, sample);<NEW_LINE>}
.getSchema().toCompactJson();
1,679,836
protected Mono<HttpClientResponse> doRequest(final ServerWebExchange exchange, final String httpMethod, final URI uri, final HttpHeaders httpHeaders, final Flux<DataBuffer> body) {<NEW_LINE>return Mono.from(httpClient.headers(headers -> httpHeaders.forEach(headers::add)).request(HttpMethod.valueOf(httpMethod)).uri(uri.toASCIIString()).send((req, nettyOutbound) -> nettyOutbound.send(body.map(dataBuffer -> ((NettyDataBuffer) dataBuffer).getNativeBuffer()))).responseConnection((res, connection) -> {<NEW_LINE>exchange.getAttributes().put(Constants.CLIENT_RESPONSE_ATTR, res);<NEW_LINE>exchange.getAttributes().put(Constants.CLIENT_RESPONSE_CONN_ATTR, connection);<NEW_LINE>ServerHttpResponse response = exchange.getResponse();<NEW_LINE>HttpHeaders headers = new HttpHeaders();<NEW_LINE>res.responseHeaders().forEach(entry -> headers.add(entry.getKey()<MASK><NEW_LINE>String contentTypeValue = headers.getFirst(HttpHeaders.CONTENT_TYPE);<NEW_LINE>if (StringUtils.isNotBlank(contentTypeValue)) {<NEW_LINE>exchange.getAttributes().put(Constants.ORIGINAL_RESPONSE_CONTENT_TYPE_ATTR, contentTypeValue);<NEW_LINE>}<NEW_LINE>HttpStatus status = HttpStatus.resolve(res.status().code());<NEW_LINE>if (status != null) {<NEW_LINE>response.setStatusCode(status);<NEW_LINE>} else if (response instanceof AbstractServerHttpResponse) {<NEW_LINE>response.setRawStatusCode(res.status().code());<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Unable to set status code on response: " + res.status().code() + ", " + response.getClass());<NEW_LINE>}<NEW_LINE>response.getHeaders().putAll(headers);<NEW_LINE>return Mono.just(res);<NEW_LINE>}));<NEW_LINE>}
, entry.getValue()));
503,862
// TODO(olsona): can we guarantee that <VCARDPROPERTY>.getPref() will always return a value?<NEW_LINE>@VisibleForTesting<NEW_LINE>static Person convert(VCard vCard) {<NEW_LINE>Person person = new Person();<NEW_LINE>Preconditions.checkArgument(atLeastOneNamePresent(vCard), "At least one name must be present");<NEW_LINE>person.setNames(Collections.singletonList(getPrimaryGoogleName(vCard.getStructuredNames())));<NEW_LINE>// TODO(olsona): nicknames for other source-typed names?<NEW_LINE>// TODO(olsona): can we *actually* add more than one name?<NEW_LINE>// No two names from the same source can be uploaded, and only names with source type CONTACT<NEW_LINE>// can be uploaded, but what about names with source type null?<NEW_LINE>if (vCard.getAddresses() != null) {<NEW_LINE>person.setAddresses(vCard.getAddresses().stream().map(GoogleContactsImporter::convertToGoogleAddress).collect(Collectors.toList()));<NEW_LINE>}<NEW_LINE>if (vCard.getTelephoneNumbers() != null) {<NEW_LINE>person.setPhoneNumbers(vCard.getTelephoneNumbers().stream().map(GoogleContactsImporter::convertToGooglePhoneNumber).collect(Collectors.toList()));<NEW_LINE>}<NEW_LINE>if (vCard.getEmails() != null) {<NEW_LINE>person.setEmailAddresses(vCard.getEmails().stream().map(GoogleContactsImporter::convertToGoogleEmail).collect<MASK><NEW_LINE>}<NEW_LINE>return person;<NEW_LINE>}
(Collectors.toList()));
38,364
synchronized public void writeMetadata(@NonNull BackupFiles.BackupFile backupFile) throws IOException {<NEW_LINE>if (metadata == null) {<NEW_LINE>throw new RuntimeException("Metadata not set for path " + backupFile.getBackupPath());<NEW_LINE>}<NEW_LINE>Path metadataFile = backupFile.getMetadataFile();<NEW_LINE>try (OutputStream outputStream = metadataFile.openOutputStream()) {<NEW_LINE>JSONObject rootObject = new JSONObject();<NEW_LINE>rootObject.put("label", metadata.label);<NEW_LINE>rootObject.put("package_name", metadata.packageName);<NEW_LINE>rootObject.put("version_name", metadata.versionName);<NEW_LINE>rootObject.put("version_code", metadata.versionCode);<NEW_LINE>rootObject.put("data_dirs", JSONUtils.getJSONArray(metadata.dataDirs));<NEW_LINE>rootObject.put("is_system", metadata.isSystem);<NEW_LINE>rootObject.put("is_split_apk", metadata.isSplitApk);<NEW_LINE>rootObject.put("split_configs", JSONUtils.getJSONArray(metadata.splitConfigs));<NEW_LINE>rootObject.put("has_rules", metadata.hasRules);<NEW_LINE>rootObject.put("backup_time", metadata.backupTime);<NEW_LINE>rootObject.put("checksum_algo", metadata.checksumAlgo);<NEW_LINE>rootObject.put("crypto", metadata.crypto);<NEW_LINE>rootObject.put("key_ids", metadata.keyIds);<NEW_LINE>rootObject.put("iv", metadata.iv == null ? null : HexEncoding.encodeToString(metadata.iv));<NEW_LINE>rootObject.put("aes", metadata.aes == null ? null : HexEncoding.encodeToString(metadata.aes));<NEW_LINE>rootObject.put("version", metadata.version);<NEW_LINE>rootObject.put("apk_name", metadata.apkName);<NEW_LINE>rootObject.<MASK><NEW_LINE>rootObject.put("flags", metadata.flags.getFlags());<NEW_LINE>rootObject.put("user_handle", metadata.userHandle);<NEW_LINE>rootObject.put("tar_type", metadata.tarType);<NEW_LINE>rootObject.put("key_store", metadata.keyStore);<NEW_LINE>rootObject.put("installer", metadata.installer);<NEW_LINE>outputStream.write(rootObject.toString(4).getBytes());<NEW_LINE>} catch (JSONException e) {<NEW_LINE>throw new IOException(e.getMessage() + " for path " + backupFile.getBackupPath());<NEW_LINE>}<NEW_LINE>}
put("instruction_set", metadata.instructionSet);
851,182
public void run(Arguments arguments, Instrumentation instrumentation, Collection<AutoCloseable> objectsToCloseOnShutdown) {<NEW_LINE>if (arguments.isNoop()) {<NEW_LINE>LOGGER.info("Agent noop is true, do not run anything");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Reporter reporter = arguments.getReporter();<NEW_LINE>String processUuid = UUID.randomUUID().toString();<NEW_LINE>String appId = null;<NEW_LINE>String appIdVariable = arguments.getAppIdVariable();<NEW_LINE>if (appIdVariable != null && !appIdVariable.isEmpty()) {<NEW_LINE>appId = System.getenv(appIdVariable);<NEW_LINE>}<NEW_LINE>if (appId == null || appId.isEmpty()) {<NEW_LINE>appId = SparkUtils.probeAppId(arguments.getAppIdRegex());<NEW_LINE>}<NEW_LINE>if (!arguments.getDurationProfiling().isEmpty() || !arguments.getArgumentProfiling().isEmpty()) {<NEW_LINE>instrumentation.addTransformer(new JavaAgentFileTransformer(arguments.getDurationProfiling(), arguments.getArgumentProfiling()));<NEW_LINE>}<NEW_LINE>List<Profiler> profilers = createProfilers(<MASK><NEW_LINE>ProfilerGroup profilerGroup = startProfilers(profilers);<NEW_LINE>Thread shutdownHook = new Thread(new ShutdownHookRunner(profilerGroup.getPeriodicProfilers(), Arrays.asList(reporter), objectsToCloseOnShutdown));<NEW_LINE>Runtime.getRuntime().addShutdownHook(shutdownHook);<NEW_LINE>}
reporter, arguments, processUuid, appId);
921,531
public static void takeSignature(IMethodResult result, String imgFormat, Bitmap bitmap, String filePath, int penColor, int bgColor) {<NEW_LINE>Logger.D(TAG, "takeSignature+");<NEW_LINE>try {<NEW_LINE>String outputFilePath;<NEW_LINE>if (imgFormat.equals("jpg")) {<NEW_LINE>outputFilePath = saveJpg(bitmap, filePath);<NEW_LINE>} else if (imgFormat.equals("png")) {<NEW_LINE>outputFilePath = savePng(bitmap, filePath);<NEW_LINE>} else if (imgFormat.equals("bmp")) {<NEW_LINE>outputFilePath = saveBmp(bitmap, filePath, penColor, bgColor);<NEW_LINE>} else if (imgFormat.equals("datauri")) {<NEW_LINE>outputFilePath = generateDataUri(bitmap);<NEW_LINE>} else {<NEW_LINE>Logger.E(TAG, "Unknown image format: " + imgFormat);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Do Callback<NEW_LINE>Map<String, Object> results = new HashMap<String, Object>(3);<NEW_LINE>if (outputFilePath.contains("sdcard") && (Capabilities.READ_SDCARD_ENABLED == true)) {<NEW_LINE><MASK><NEW_LINE>results.put("imageUri", "only read sdcard permission is there in build.yml");<NEW_LINE>if (imgFormat.equals("datauri"))<NEW_LINE>results.put("signature_uri", "");<NEW_LINE>else<NEW_LINE>results.put("signature_uri", "");<NEW_LINE>} else {<NEW_LINE>results.put("status", "ok");<NEW_LINE>results.put("imageUri", outputFilePath);<NEW_LINE>if (imgFormat.equals("datauri"))<NEW_LINE>results.put("signature_uri", "");<NEW_LINE>else<NEW_LINE>results.put("signature_uri", outputFilePath);<NEW_LINE>}<NEW_LINE>result.set(results);<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>result.setError("FileNotFoundException: " + e);<NEW_LINE>Logger.E(TAG, "FNFE:" + e.getMessage());<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>result.setError("Illegal characters in filePath: " + filePath);<NEW_LINE>Logger.E(TAG, "Illegal characters in filePath: " + filePath);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>result.setError("IOException: " + ex);<NEW_LINE>Logger.E(TAG, "IOEX " + ex.getMessage());<NEW_LINE>ex.printStackTrace();<NEW_LINE>} catch (Exception e) {<NEW_LINE>result.setError("Could not capture due to exception");<NEW_LINE>Logger.E(TAG, e.getMessage());<NEW_LINE>}<NEW_LINE>Logger.D(TAG, "takeSignature-");<NEW_LINE>}
results.put("status", "error");