idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,025,688 | // ----- protected methods -----<NEW_LINE>protected void serializeObject(final DataOutputStream dos, final Object value) throws IOException {<NEW_LINE>if (value != null) {<NEW_LINE>final Integer typeKey = TypeMap.get(value.getClass());<NEW_LINE>if (typeKey != null) {<NEW_LINE>dos.writeInt(typeKey);<NEW_LINE>switch(typeKey) {<NEW_LINE>case 1:<NEW_LINE>dos.writeUTF((String) value);<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>dos.writeInt((Integer) value);<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>dos.writeLong((Long) value);<NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>dos.writeBoolean((Boolean) value);<NEW_LINE>break;<NEW_LINE>case 5:<NEW_LINE>dos.writeDouble((Double) value);<NEW_LINE>break;<NEW_LINE>case 6:<NEW_LINE>dos.writeFloat((Float) value);<NEW_LINE>break;<NEW_LINE>case 100:<NEW_LINE>serializeList(dos, (List<Object>) value);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>System.out.println("Unknown type " + <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>dos.writeInt(0);<NEW_LINE>}<NEW_LINE>} | value.getClass() + ", cannot serialize!"); |
504,504 | private static void buildMaps() {<NEW_LINE>map(AbstractBeamInter.class, BeamStemRelation.class, StemInter.class);<NEW_LINE>map(AbstractChordInter.class, ChordDynamicsRelation.class, DynamicsInter.class);<NEW_LINE>map(AbstractChordInter.class, ChordPedalRelation.class, PedalInter.class);<NEW_LINE>map(AbstractChordInter.class, ChordTupletRelation.class, TupletInter.class);<NEW_LINE>map(AbstractChordInter.class, ChordWedgeRelation.class, WedgeInter.class);<NEW_LINE>map(AlterInter.class, AlterHeadRelation.class, HeadInter.class);<NEW_LINE>map(AugmentationDotInter.class, AugmentationRelation.class, AbstractNoteInter.class);<NEW_LINE>map(AugmentationDotInter.class, DoubleDotRelation.class, AugmentationDotInter.class);<NEW_LINE>map(BeamInter.class, BeamRestRelation.class, RestInter.class);<NEW_LINE>// Old<NEW_LINE>map(EndingInter.class, EndingBarRelation.class, BarlineInter.class);<NEW_LINE>map(EndingInter.class, EndingBarRelation.class, StaffBarlineInter.class);<NEW_LINE>map(EndingInter.class, EndingSentenceRelation.class, SentenceInter.class);<NEW_LINE>// Temporary!<NEW_LINE>map(FermataDotInter.class, DotFermataRelation.class, FermataArcInter.class);<NEW_LINE>// Old<NEW_LINE>map(FermataInter.class, FermataBarRelation.class, BarlineInter.class);<NEW_LINE>map(FermataInter.class, FermataBarRelation.class, StaffBarlineInter.class);<NEW_LINE>map(FermataInter.class, FermataChordRelation.class, AbstractChordInter.class);<NEW_LINE>map(FlagInter.class, FlagStemRelation.class, StemInter.class);<NEW_LINE>map(SmallFlagInter.class, FlagStemRelation.class, StemInter.class);<NEW_LINE>map(HeadChordInter.class, ChordArpeggiatoRelation.class, ArpeggiatoInter.class);<NEW_LINE>map(HeadChordInter.class, ChordArticulationRelation.class, ArticulationInter.class);<NEW_LINE>map(HeadChordInter.class, ChordNameRelation.class, ChordNameInter.class);<NEW_LINE>map(HeadChordInter.class, ChordOrnamentRelation.class, OrnamentInter.class);<NEW_LINE>map(HeadChordInter.class, ChordSentenceRelation.class, SentenceInter.class);<NEW_LINE>map(HeadChordInter.class, <MASK><NEW_LINE>map(HeadChordInter.class, ChordSyllableRelation.class, LyricItemInter.class);<NEW_LINE>map(HeadInter.class, HeadStemRelation.class, StemInter.class);<NEW_LINE>// Old<NEW_LINE>map(MarkerInter.class, MarkerBarRelation.class, BarlineInter.class);<NEW_LINE>map(MarkerInter.class, MarkerBarRelation.class, StaffBarlineInter.class);<NEW_LINE>map(RepeatDotInter.class, RepeatDotBarRelation.class, BarlineInter.class);<NEW_LINE>map(RepeatDotInter.class, RepeatDotPairRelation.class, RepeatDotInter.class);<NEW_LINE>map(SlurInter.class, SlurHeadRelation.class, HeadInter.class);<NEW_LINE>map(TimeNumberInter.class, TimeTopBottomRelation.class, TimeNumberInter.class);<NEW_LINE>} | ChordStemRelation.class, StemInter.class); |
535,546 | public GetBackendStorageResourceConfig unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetBackendStorageResourceConfig getBackendStorageResourceConfig = new GetBackendStorageResourceConfig();<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("bucketName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getBackendStorageResourceConfig.setBucketName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("imported", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getBackendStorageResourceConfig.setImported(context.getUnmarshaller(Boolean.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("permissions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getBackendStorageResourceConfig.setPermissions(BackendStoragePermissionsJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("serviceName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getBackendStorageResourceConfig.setServiceName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getBackendStorageResourceConfig;<NEW_LINE>} | ().unmarshall(context)); |
1,816,226 | public static BufferedImage loadPGM(InputStream inputStream, @Nullable BufferedImage storage) throws IOException {<NEW_LINE>DataInputStream in = new DataInputStream(inputStream);<NEW_LINE>readLine(in);<NEW_LINE>String line = readLine(in);<NEW_LINE>while (line.charAt(0) == '#') line = readLine(in);<NEW_LINE>String[] s = line.split(" ");<NEW_LINE>int w = Integer.parseInt(s[0]);<NEW_LINE>int h = Integer.parseInt(s[1]);<NEW_LINE>readLine(in);<NEW_LINE>if (storage == null || storage.getWidth() != w || storage.getHeight() != h)<NEW_LINE>storage = new BufferedImage(<MASK><NEW_LINE>int length = w * h;<NEW_LINE>byte[] data = new byte[length];<NEW_LINE>read(in, data, length);<NEW_LINE>boolean useFailSafe = storage.getType() != BufferedImage.TYPE_BYTE_GRAY;<NEW_LINE>// try using the internal array for better performance<NEW_LINE>if (storage.getRaster().getDataBuffer().getDataType() == DataBuffer.TYPE_BYTE) {<NEW_LINE>byte[] gray = ((DataBufferByte) storage.getRaster().getDataBuffer()).getData();<NEW_LINE>int indexIn = 0;<NEW_LINE>int indexOut = 0;<NEW_LINE>for (int y = 0; y < h; y++) {<NEW_LINE>for (int x = 0; x < w; x++) {<NEW_LINE>gray[indexOut++] = data[indexIn++];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (useFailSafe) {<NEW_LINE>// use the slow setRGB() function<NEW_LINE>int indexIn = 0;<NEW_LINE>for (int y = 0; y < h; y++) {<NEW_LINE>for (int x = 0; x < w; x++) {<NEW_LINE>int gray = data[indexIn++] & 0xFF;<NEW_LINE>storage.setRGB(x, y, gray << 16 | gray << 8 | gray);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return storage;<NEW_LINE>} | w, h, BufferedImage.TYPE_BYTE_GRAY); |
1,363,497 | private boolean projectVertices(Model model, int localX, int localY, int localZ, final int vertexOrientation) {<NEW_LINE>final int vertexCount = model.getVerticesCount();<NEW_LINE>Perspective.modelToCanvas(client, vertexCount, localX, localY, localZ, vertexOrientation, model.getVerticesX(), model.getVerticesZ(), model.getVerticesY(), projectedVerticesX, projectedVerticesY);<NEW_LINE>boolean anyVisible = false;<NEW_LINE>for (int i = 0; i < vertexCount; i++) {<NEW_LINE>int x = projectedVerticesX[i];<NEW_LINE>int y = projectedVerticesY[i];<NEW_LINE>if (y != Integer.MIN_VALUE) {<NEW_LINE>boolean visibleX = x >= clipX1 && x < clipX2;<NEW_LINE>boolean visibleY = y >= clipY1 && y < clipY2;<NEW_LINE>anyVisible |= visibleX && visibleY;<NEW_LINE>croppedX1 = <MASK><NEW_LINE>croppedX2 = Math.max(croppedX2, x + 1);<NEW_LINE>croppedY1 = Math.min(croppedY1, y);<NEW_LINE>croppedY2 = Math.max(croppedY2, y + 1);<NEW_LINE>} else {<NEW_LINE>// Vertex is too close or behind camera and isn't rendered<NEW_LINE>projectedVerticesY[i] = Integer.MIN_VALUE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return anyVisible;<NEW_LINE>} | Math.min(croppedX1, x); |
1,048,093 | public VariableDeclarationNode transform(VariableDeclarationNode variableDeclarationNode) {<NEW_LINE>NodeList<AnnotationNode> annotationNodes = formatNodeList(variableDeclarationNode.annotations(), 0, 1, 0, 1);<NEW_LINE>Token finalToken = formatToken(variableDeclarationNode.finalKeyword().orElse(null), 1, 0);<NEW_LINE>TypedBindingPatternNode typedBindingPatternNode;<NEW_LINE>boolean hasInit = variableDeclarationNode.initializer().isPresent();<NEW_LINE>typedBindingPatternNode = formatNode(variableDeclarationNode.typedBindingPattern(), <MASK><NEW_LINE>Token equalToken = formatToken(variableDeclarationNode.equalsToken().orElse(null), 1, 0);<NEW_LINE>boolean previousInLineAnnotation = env.inLineAnnotation;<NEW_LINE>setInLineAnnotation(true);<NEW_LINE>ExpressionNode initializer = formatNode(variableDeclarationNode.initializer().orElse(null), 0, 0);<NEW_LINE>setInLineAnnotation(previousInLineAnnotation);<NEW_LINE>Token semicolonToken = formatToken(variableDeclarationNode.semicolonToken(), env.trailingWS, env.trailingNL);<NEW_LINE>return variableDeclarationNode.modify().withAnnotations(annotationNodes).withFinalKeyword(finalToken).withTypedBindingPattern(typedBindingPatternNode).withEqualsToken(equalToken).withInitializer(initializer).withSemicolonToken(semicolonToken).apply();<NEW_LINE>} | hasInit ? 1 : 0, 0); |
295,856 | public void print(ReadOnlyTStore<T> zs, ZooReader zk, ServiceLock.ServiceLockPath lockPath, Formatter fmt, Set<Long> filterTxid, EnumSet<TStatus> filterStatus) throws KeeperException, InterruptedException {<NEW_LINE>FateStatus fateStatus = getStatus(zs, zk, lockPath, filterTxid, filterStatus);<NEW_LINE>for (TransactionStatus txStatus : fateStatus.getTransactions()) {<NEW_LINE>fmt.format("txid: %s status: %-18s op: %-15s locked: %-15s locking: %-15s top: %-15s created: %s%n", txStatus.getTxid(), txStatus.getStatus(), txStatus.getDebug(), txStatus.getHeldLocks(), txStatus.getWaitingLocks(), txStatus.getTop(), txStatus.getTimeCreatedFormatted());<NEW_LINE>}<NEW_LINE>fmt.format(" %s transactions", fateStatus.getTransactions().size());<NEW_LINE>if (!fateStatus.getDanglingHeldLocks().isEmpty() || !fateStatus.getDanglingWaitingLocks().isEmpty()) {<NEW_LINE>fmt.format("%nThe following locks did not have an associated FATE operation%n");<NEW_LINE>for (Entry<String, List<String>> entry : fateStatus.getDanglingHeldLocks().entrySet()) fmt.format("txid: %s locked: %s%n", entry.getKey(<MASK><NEW_LINE>for (Entry<String, List<String>> entry : fateStatus.getDanglingWaitingLocks().entrySet()) fmt.format("txid: %s locking: %s%n", entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>} | ), entry.getValue()); |
359,851 | public void onError(java.lang.Exception e) {<NEW_LINE>byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;<NEW_LINE>org.apache.thrift.TSerializable msg;<NEW_LINE>getActiveTservers_result result = new getActiveTservers_result();<NEW_LINE>if (e instanceof org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException) {<NEW_LINE>result.sec = (org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException) e;<NEW_LINE>result.setSecIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException) {<NEW_LINE>result.tnase = (org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException) e;<NEW_LINE>result.setTnaseIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof org.apache.thrift.transport.TTransportException) {<NEW_LINE>_LOGGER.error("TTransportException inside handler", e);<NEW_LINE>fb.close();<NEW_LINE>return;<NEW_LINE>} else if (e instanceof org.apache.thrift.TApplicationException) {<NEW_LINE>_LOGGER.error("TApplicationException inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = (org.apache.thrift.TApplicationException) e;<NEW_LINE>} else {<NEW_LINE>_LOGGER.error("Exception inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fcall.sendResponse(fb, msg, msgType, seqid);<NEW_LINE>} catch (java.lang.Exception ex) {<NEW_LINE><MASK><NEW_LINE>fb.close();<NEW_LINE>}<NEW_LINE>} | _LOGGER.error("Exception writing to internal frame buffer", ex); |
437,505 | public ServiceResponse serviceImpl(Query call, HttpServletResponse response, Authorization authorization, final JsonObjectWithDefault permissions) throws APIException {<NEW_LINE>JSONObject json = new JSONObject();<NEW_LINE>JSONObject object = new JSONObject();<NEW_LINE>object.put("category", call.get("category", ""));<NEW_LINE>object.put("language", call.get("language", ""));<NEW_LINE>object.put("name", call.get("name", ""));<NEW_LINE>object.put("buildCode", call.get("buildCode", ""));<NEW_LINE>object.put("designCode", call.get("designCode", ""));<NEW_LINE>object.put("configCode", call.get("configCode", ""));<NEW_LINE>object.put("image", call.get("image", ""));<NEW_LINE>String id = <MASK><NEW_LINE>Iterator<String> keys = object.keys();<NEW_LINE>while (keys.hasNext()) {<NEW_LINE>String key = keys.next();<NEW_LINE>String value = object.getString(key);<NEW_LINE>// throw api exception if any of the keys have empty values<NEW_LINE>if (value.length() == 0) {<NEW_LINE>throw new APIException(422, "some values of object are empty");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (id.length() == 0) {<NEW_LINE>// generate an id.<NEW_LINE>id = Integer.toHexString(random.nextInt(Integer.MAX_VALUE)).toLowerCase();<NEW_LINE>}<NEW_LINE>DAO.storeDraft(authorization.getIdentity(), id, new DAO.Draft(object));<NEW_LINE>json.put("accepted", true);<NEW_LINE>json.put("message", "draft stored");<NEW_LINE>json.put("id", id);<NEW_LINE>return new ServiceResponse(json);<NEW_LINE>} | call.get("id", ""); |
965,479 | private Mono<PagedResponse<ConfigurationSetting>> listFirstPageSettings(SettingSelector selector, Context context) {<NEW_LINE>try {<NEW_LINE>if (selector == null) {<NEW_LINE>return service.listKeyValues(serviceEndpoint, null, null, apiVersion, null, null, context.addData(AZ_TRACING_NAMESPACE_KEY, APP_CONFIG_TRACING_NAMESPACE_VALUE)).doOnRequest(ignoredValue -> logger.verbose("Listing all ConfigurationSettings")).doOnSuccess(response -> logger.verbose("Listed all ConfigurationSettings")).doOnError(error -> logger<MASK><NEW_LINE>}<NEW_LINE>final String fields = CoreUtils.arrayToString(selector.getFields(), SettingFields::toStringMapper);<NEW_LINE>final String keyFilter = selector.getKeyFilter();<NEW_LINE>final String labelFilter = selector.getLabelFilter();<NEW_LINE>return service.listKeyValues(serviceEndpoint, keyFilter, labelFilter, apiVersion, fields, selector.getAcceptDateTime(), context.addData(AZ_TRACING_NAMESPACE_KEY, APP_CONFIG_TRACING_NAMESPACE_VALUE)).doOnSubscribe(ignoredValue -> logger.verbose("Listing ConfigurationSettings - {}", selector)).doOnSuccess(response -> logger.verbose("Listed ConfigurationSettings - {}", selector)).doOnError(error -> logger.warning("Failed to list ConfigurationSetting - {}", selector, error));<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>return monoError(logger, ex);<NEW_LINE>}<NEW_LINE>} | .warning("Failed to list all ConfigurationSetting", error)); |
508,018 | static BiFunction<String, String, Transport.Connection> buildConnectionLookup(String requestClusterAlias, Function<String, DiscoveryNode> localNodes, BiFunction<String, String, DiscoveryNode> remoteNodes, BiFunction<String, DiscoveryNode, Transport.Connection> nodeToConnection) {<NEW_LINE>return (clusterAlias, nodeId) -> {<NEW_LINE>final DiscoveryNode discoveryNode;<NEW_LINE>final boolean remoteCluster;<NEW_LINE>if (clusterAlias == null || requestClusterAlias != null) {<NEW_LINE>assert requestClusterAlias == null || requestClusterAlias.equals(clusterAlias);<NEW_LINE><MASK><NEW_LINE>remoteCluster = false;<NEW_LINE>} else {<NEW_LINE>discoveryNode = remoteNodes.apply(clusterAlias, nodeId);<NEW_LINE>remoteCluster = true;<NEW_LINE>}<NEW_LINE>if (discoveryNode == null) {<NEW_LINE>throw new IllegalStateException("no node found for id: " + nodeId);<NEW_LINE>}<NEW_LINE>return nodeToConnection.apply(remoteCluster ? clusterAlias : null, discoveryNode);<NEW_LINE>};<NEW_LINE>} | discoveryNode = localNodes.apply(nodeId); |
1,422,755 | public void marshall(SampledHTTPRequest sampledHTTPRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (sampledHTTPRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(sampledHTTPRequest.getRequest(), REQUEST_BINDING);<NEW_LINE>protocolMarshaller.marshall(sampledHTTPRequest.getWeight(), WEIGHT_BINDING);<NEW_LINE>protocolMarshaller.marshall(sampledHTTPRequest.getTimestamp(), TIMESTAMP_BINDING);<NEW_LINE>protocolMarshaller.marshall(sampledHTTPRequest.getAction(), ACTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(sampledHTTPRequest.getRuleNameWithinRuleGroup(), RULENAMEWITHINRULEGROUP_BINDING);<NEW_LINE>protocolMarshaller.marshall(sampledHTTPRequest.getRequestHeadersInserted(), REQUESTHEADERSINSERTED_BINDING);<NEW_LINE>protocolMarshaller.marshall(sampledHTTPRequest.getResponseCodeSent(), RESPONSECODESENT_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(sampledHTTPRequest.getCaptchaResponse(), CAPTCHARESPONSE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | sampledHTTPRequest.getLabels(), LABELS_BINDING); |
422,244 | protected Object decode(ChannelHandlerContext ctx, Channel channel, final Object msg) throws Exception {<NEW_LINE>if (decodeWorker != null) {<NEW_LINE>decodeWorker.execute(new decodeTask(msg));<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>if (msg == null) {<NEW_LINE>throw new NullPointerException("you cannot pass into an null to the decode");<NEW_LINE>}<NEW_LINE>ChannelBuffer frameBuffer;<NEW_LINE>if (frameDecoder != null) {<NEW_LINE>frameBuffer = frameDecoder.decode((ChannelBuffer) msg);<NEW_LINE>if (frameBuffer == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>frameBuffer = (ChannelBuffer) msg;<NEW_LINE>}<NEW_LINE>int size = frameBuffer.readableBytes();<NEW_LINE>logger.info("decode the frame size :{}", size);<NEW_LINE>// start to decode<NEW_LINE>IBuffer iBuffer = IBuffer.make(null, size);<NEW_LINE>IPacket iPacket = IPacket.make(iBuffer);<NEW_LINE>iPacket.getByteBuffer().put(frameBuffer.toByteBuffer());<NEW_LINE>// decode the packet<NEW_LINE>if (!iPacket.isComplete()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>IVideoPicture picture = IVideoPicture.make(IPixelFormat.Type.YUV420P, dimension.width, dimension.height);<NEW_LINE>try {<NEW_LINE>// decode the packet into the video picture<NEW_LINE>int postion = 0;<NEW_LINE>int packageSize = iPacket.getSize();<NEW_LINE>while (postion < packageSize) {<NEW_LINE>postion += iStreamCoder.decodeVideo(picture, iPacket, postion);<NEW_LINE>if (postion < 0) {<NEW_LINE>throw new RuntimeException("error " + " decoding video");<NEW_LINE>}<NEW_LINE>// if this is a complete picture, dispatch the picture<NEW_LINE>if (picture.isComplete()) {<NEW_LINE>IConverter converter = ConverterFactory.createConverter(type.getDescriptor(), picture);<NEW_LINE>BufferedImage image = converter.toImage(picture);<NEW_LINE>// BufferedImage convertedImage = ImageUtils.convertToType(image,<NEW_LINE>// BufferedImage.TYPE_3BYTE_BGR);<NEW_LINE>// here ,put out the image<NEW_LINE>if (streamFrameListener != null) {<NEW_LINE>streamFrameListener.onFrameReceived(image);<NEW_LINE>}<NEW_LINE>converter.delete();<NEW_LINE>} else {<NEW_LINE>picture.delete();<NEW_LINE>iPacket.delete();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// clean the picture and reuse it<NEW_LINE>picture<MASK><NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (picture != null) {<NEW_LINE>picture.delete();<NEW_LINE>}<NEW_LINE>iPacket.delete();<NEW_LINE>// ByteBufferUtil.destroy(data);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | .getByteBuffer().clear(); |
1,723,558 | public void doImageSave() {<NEW_LINE>if (!isGif) {<NEW_LINE>if (Reddit.appRestart.getString("imagelocation", "").isEmpty()) {<NEW_LINE>showFirstDialog();<NEW_LINE>} else if (!new File(Reddit.appRestart.getString("imagelocation", "")).exists()) {<NEW_LINE>showErrorDialog();<NEW_LINE>} else {<NEW_LINE>Intent i = new Intent(this, ImageDownloadNotificationService.class);<NEW_LINE>// always download the original file, or use the cached original if that is currently displayed<NEW_LINE>i.putExtra("actuallyLoaded", contentUrl);<NEW_LINE>if (subreddit != null && !subreddit.isEmpty())<NEW_LINE><MASK><NEW_LINE>if (submissionTitle != null)<NEW_LINE>i.putExtra(EXTRA_SUBMISSION_TITLE, submissionTitle);<NEW_LINE>i.putExtra("index", index);<NEW_LINE>startService(i);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>doOnClick.run();<NEW_LINE>}<NEW_LINE>} | i.putExtra("subreddit", subreddit); |
124,193 | public void run(RegressionEnvironment env) {<NEW_LINE>String text = "@name('s0') select * from SupportBean(2*intBoxed=doubleBoxed)";<NEW_LINE>env.compileDeployAddListenerMile(text, "s0", 0);<NEW_LINE>sendBeanIntDouble(env, 20, 50d);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>sendBeanIntDouble(env, 25, 50d);<NEW_LINE>env.assertListenerInvoked("s0");<NEW_LINE>text = "@name('s1') select * from SupportBean(2*intBoxed=doubleBoxed, theString='s')";<NEW_LINE>env.<MASK><NEW_LINE>sendBeanIntDoubleString(env, 25, 50d, "s");<NEW_LINE>env.assertListenerInvoked("s1");<NEW_LINE>sendBeanIntDoubleString(env, 25, 50d, "x");<NEW_LINE>env.assertListenerNotInvoked("s1");<NEW_LINE>env.undeployAll();<NEW_LINE>// test priority of equals and boolean<NEW_LINE>env.compileDeploy("@name('s0') select * from SupportBean(intPrimitive = 1 or intPrimitive = 2)").addListener("s0");<NEW_LINE>env.compileDeploy("@name('s1') select * from SupportBean(intPrimitive = 3, SupportStaticMethodLib.alwaysTrue())").addListener("s1");<NEW_LINE>SupportStaticMethodLib.getInvocations().clear();<NEW_LINE>env.sendEventBean(new SupportBean("E1", 1));<NEW_LINE>assertTrue(SupportStaticMethodLib.getInvocations().isEmpty());<NEW_LINE>env.undeployAll();<NEW_LINE>} | compileDeployAddListenerMile(text, "s1", 1); |
1,495,100 | public static String format(QualityGate.Condition condition) {<NEW_LINE>Metric<?> metric = CoreMetrics.<MASK><NEW_LINE>if (metric.getType() == Metric.ValueType.RATING) {<NEW_LINE>return String.format("%s %s (%s %s)", Rating.valueOf(Integer.parseInt(condition.getValue())), metric.getName(), condition.getOperator() == QualityGate.Operator.GREATER_THAN ? "is worse than" : "is better than", Rating.valueOf(Integer.parseInt(condition.getErrorThreshold())));<NEW_LINE>} else if (metric.getType() == Metric.ValueType.PERCENT) {<NEW_LINE>NumberFormat numberFormat = new DecimalFormat("#0.00", DecimalFormatSymbols.getInstance(Locale.ENGLISH));<NEW_LINE>return String.format("%s%% %s (%s %s%%)", numberFormat.format(new BigDecimal(condition.getValue())), metric.getName(), condition.getOperator() == QualityGate.Operator.GREATER_THAN ? "is greater than" : "is less than", numberFormat.format(new BigDecimal(condition.getErrorThreshold())));<NEW_LINE>} else {<NEW_LINE>return String.format("%s %s (%s %s)", condition.getValue(), metric.getName(), condition.getOperator() == QualityGate.Operator.GREATER_THAN ? "is greater than" : "is less than", condition.getErrorThreshold());<NEW_LINE>}<NEW_LINE>} | getMetric(condition.getMetricKey()); |
653,911 | private Object transformImpl(final GraphQLSchema schema, GraphQLSchemaElement schemaElement, GraphQLTypeVisitor visitor, Consumer<GraphQLSchema.Builder> postTransformation) {<NEW_LINE>DummyRoot dummyRoot;<NEW_LINE>GraphQLCodeRegistry.Builder codeRegistry = null;<NEW_LINE>if (schema != null) {<NEW_LINE>dummyRoot = new DummyRoot(schema);<NEW_LINE>codeRegistry = GraphQLCodeRegistry.newCodeRegistry(schema.getCodeRegistry());<NEW_LINE>} else {<NEW_LINE>dummyRoot = new DummyRoot(schemaElement);<NEW_LINE>}<NEW_LINE>final Map<String, GraphQLNamedType> <MASK><NEW_LINE>final Map<String, GraphQLTypeReference> typeReferences = new LinkedHashMap<>();<NEW_LINE>// first pass - general transformation<NEW_LINE>traverseAndTransform(dummyRoot, changedTypes, typeReferences, visitor, codeRegistry);<NEW_LINE>// if we have changed any named elements AND we have type references referring to them then<NEW_LINE>// we need to make a second pass to replace these type references to the new names<NEW_LINE>if (!changedTypes.isEmpty()) {<NEW_LINE>boolean hasTypeRefsForChangedTypes = changedTypes.keySet().stream().anyMatch(typeReferences::containsKey);<NEW_LINE>if (hasTypeRefsForChangedTypes) {<NEW_LINE>replaceTypeReferences(dummyRoot, codeRegistry, changedTypes);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (schema != null) {<NEW_LINE>GraphQLSchema graphQLSchema = dummyRoot.rebuildSchema(codeRegistry);<NEW_LINE>if (postTransformation != null) {<NEW_LINE>graphQLSchema = graphQLSchema.transform(postTransformation);<NEW_LINE>}<NEW_LINE>return graphQLSchema;<NEW_LINE>} else {<NEW_LINE>return dummyRoot.schemaElement;<NEW_LINE>}<NEW_LINE>} | changedTypes = new LinkedHashMap<>(); |
1,307,194 | private CompletableFuture<List<Wo>> searchScript(final Wi wi, final List<String> appIdList, final List<String> designerIdList) {<NEW_LINE>CompletableFuture<List<Wo>> cf = CompletableFuture.supplyAsync(() -> {<NEW_LINE>List<Wo> resWos = new ArrayList<>();<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>List<WoScript> woScripts;<NEW_LINE>if (ListTools.isNotEmpty(designerIdList)) {<NEW_LINE>woScripts = emc.fetchIn(Script.class, WoScript.copier, Script.id_FIELDNAME, designerIdList);<NEW_LINE>} else if (ListTools.isNotEmpty(appIdList)) {<NEW_LINE>woScripts = emc.fetchIn(Script.class, WoScript.copier, Script.portal_FIELDNAME, appIdList);<NEW_LINE>} else {<NEW_LINE>woScripts = emc.fetchAll(Script.class, WoScript.copier);<NEW_LINE>}<NEW_LINE>for (WoScript woScript : woScripts) {<NEW_LINE>Map<String, String> map = PropertyTools.fieldMatchKeyword(WoScript.copier.getCopyFields(), woScript, wi.getKeyword(), wi.getCaseSensitive(), wi.getMatchWholeWord(<MASK><NEW_LINE>if (!map.isEmpty()) {<NEW_LINE>Wo wo = new Wo();<NEW_LINE>Portal portal = emc.fetch(woScript.getPortal(), Portal.class, ListTools.toList(Portal.id_FIELDNAME, Portal.name_FIELDNAME));<NEW_LINE>if (portal != null) {<NEW_LINE>wo.setAppId(portal.getId());<NEW_LINE>wo.setAppName(portal.getName());<NEW_LINE>}<NEW_LINE>wo.setDesignerId(woScript.getId());<NEW_LINE>wo.setDesignerName(woScript.getName());<NEW_LINE>wo.setDesignerType(DesignerType.script.toString());<NEW_LINE>wo.setUpdateTime(woScript.getUpdateTime());<NEW_LINE>wo.setPatternList(map);<NEW_LINE>resWos.add(wo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>woScripts.clear();<NEW_LINE>woScripts = null;<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(e);<NEW_LINE>}<NEW_LINE>return resWos;<NEW_LINE>});<NEW_LINE>return cf;<NEW_LINE>} | ), wi.getMatchRegExp()); |
1,446,503 | private Partition storePartition0(final Partition partition) {<NEW_LINE>final PlainContextAware ctxAware = PlainContextAware.newWithThreadInheritedTrx(Env.getCtx());<NEW_LINE>//<NEW_LINE>// create and save the new partition record<NEW_LINE>final I_DLM_Partition partitionDB;<NEW_LINE>if (partition.getDLM_Partition_ID() > 0) {<NEW_LINE>partitionDB = InterfaceWrapperHelper.create(Env.getCtx(), partition.getDLM_Partition_ID(), I_DLM_Partition.class, ITrx.TRXNAME_ThreadInherited);<NEW_LINE>} else {<NEW_LINE>partitionDB = InterfaceWrapperHelper.newInstance(I_DLM_Partition.class, ctxAware);<NEW_LINE>}<NEW_LINE>if (partition.isConfigChanged() || partitionDB.getDLM_Partition_Config_ID() <= 0) {<NEW_LINE>final PartitionConfig storedConfig = storePartitionConfig(partition.getConfig());<NEW_LINE>partitionDB.setDLM_Partition_Config_ID(storedConfig.getDLM_Partition_Config_ID());<NEW_LINE>}<NEW_LINE>partitionDB.setCurrent_DLM_Level(partition.getCurrentDLMLevel());<NEW_LINE>partitionDB.setTarget_DLM_Level(partition.getTargetDLMLevel());<NEW_LINE>partitionDB.setDateNextInspection(partition.getNextInspectionDate());<NEW_LINE>partitionDB.setIsPartitionComplete(partition.isComplete());<NEW_LINE>InterfaceWrapperHelper.save(partitionDB);<NEW_LINE>// use intermediatePartition from here onwards.<NEW_LINE>Partition intermediatePartition = partition.withDLM_Partition_ID(partitionDB.getDLM_Partition_ID());<NEW_LINE>if (intermediatePartition.isRecordsChanged()) {<NEW_LINE>// update the partitioned data. note that here, intermediatePartition needs to have a DLM_Partition_ID<NEW_LINE>final boolean <MASK><NEW_LINE>if (recordsAdded) {<NEW_LINE>intermediatePartition.getRecordsFlat().forEach(tableRefordRef -> {<NEW_LINE>tableRefordRef.notifyModelStaled();<NEW_LINE>});<NEW_LINE>// the coordinator needs to reevaluate<NEW_LINE>partitionDB.setTarget_DLM_Level(IMigratorService.DLM_Level_NOT_SET);<NEW_LINE>partitionDB.setDateNextInspection(null);<NEW_LINE>InterfaceWrapperHelper.save(partitionDB);<NEW_LINE>intermediatePartition = intermediatePartition.withNextInspectionDate(null).withTargetDLMLevel(IMigratorService.DLM_Level_NOT_SET);<NEW_LINE>}<NEW_LINE>Services.get(IDLMService.class).updatePartitionSize(partitionDB);<NEW_LINE>}<NEW_LINE>final String msg = "Stored the partition {} with {} records; configChanged={}; recordsChanged={}";<NEW_LINE>final Object[] msgParameters = { partitionDB, intermediatePartition.getRecordsFlat().size(), intermediatePartition.isConfigChanged(), intermediatePartition.isRecordsChanged() };<NEW_LINE>logger.info(msg, msgParameters);<NEW_LINE>Loggables.addLog(msg, msgParameters);<NEW_LINE>final Partition result = intermediatePartition.withJustStored(partitionDB.getDLM_Partition_ID());<NEW_LINE>return result;<NEW_LINE>} | recordsAdded = storeRecordsPartitionID(ctxAware, intermediatePartition); |
237,282 | static void updateVideoInfo(final VideoFile thisVideo, final SecurityContext ctx) {<NEW_LINE>try (final Tx tx = StructrApp.getInstance(ctx).tx()) {<NEW_LINE>final Map<String, Object> info = AVConv.newInstance(ctx, thisVideo).getVideoInfo();<NEW_LINE>if (info != null && info.containsKey("streams")) {<NEW_LINE>final List<Map<String, Object>> streams = (List<Map<String, Object><MASK><NEW_LINE>for (final Map<String, Object> stream : streams) {<NEW_LINE>final String codecType = (String) stream.get("codec_type");<NEW_LINE>if (codecType != null) {<NEW_LINE>if ("video".equals(codecType)) {<NEW_LINE>VideoFile.setIfNotNull(thisVideo, StructrApp.key(VideoFile.class, "videoCodecName"), stream.get("codec_long_name"));<NEW_LINE>VideoFile.setIfNotNull(thisVideo, StructrApp.key(VideoFile.class, "videoCodec"), stream.get("codec_name"));<NEW_LINE>VideoFile.setIfNotNull(thisVideo, StructrApp.key(VideoFile.class, "pixelFormat"), stream.get("pix_fmt"));<NEW_LINE>VideoFile.setIfNotNull(thisVideo, StructrApp.key(VideoFile.class, "width"), VideoFile.toInt(stream.get("width")));<NEW_LINE>VideoFile.setIfNotNull(thisVideo, StructrApp.key(VideoFile.class, "height"), VideoFile.toInt(stream.get("height")));<NEW_LINE>VideoFile.setIfNotNull(thisVideo, StructrApp.key(VideoFile.class, "duration"), VideoFile.toDouble(stream.get("duration")));<NEW_LINE>} else if ("audio".equals(codecType)) {<NEW_LINE>VideoFile.setIfNotNull(thisVideo, StructrApp.key(VideoFile.class, "audioCodecName"), stream.get("codec_long_name"));<NEW_LINE>VideoFile.setIfNotNull(thisVideo, StructrApp.key(VideoFile.class, "audioCodec"), stream.get("codec_name"));<NEW_LINE>VideoFile.setIfNotNull(thisVideo, StructrApp.key(VideoFile.class, "sampleRate"), VideoFile.toInt(stream.get("sampleRate")));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tx.success();<NEW_LINE>} catch (FrameworkException fex) {<NEW_LINE>final Logger logger = LoggerFactory.getLogger(VideoFile.class);<NEW_LINE>logger.warn("", fex);<NEW_LINE>}<NEW_LINE>} | >) info.get("streams"); |
825,631 | static void lookupCodeInfo(CodeInfo info, long ip, SimpleCodeInfoQueryResult codeInfoQueryResult) {<NEW_LINE>long sizeEncoding = initialSizeEncoding();<NEW_LINE>long entryIP = lookupEntryIP(ip);<NEW_LINE>long entryOffset = loadEntryOffset(info, ip);<NEW_LINE>do {<NEW_LINE>int entryFlags = loadEntryFlags(info, entryOffset);<NEW_LINE>sizeEncoding = updateSizeEncoding(info, entryOffset, entryFlags, sizeEncoding);<NEW_LINE>if (entryIP == ip) {<NEW_LINE>codeInfoQueryResult.setEncodedFrameSize(sizeEncoding);<NEW_LINE>codeInfoQueryResult.setExceptionOffset(loadExceptionOffset(info, entryOffset, entryFlags));<NEW_LINE>codeInfoQueryResult.setReferenceMapIndex(loadReferenceMapIndex(info, entryOffset, entryFlags));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>entryIP = advanceIP(info, entryOffset, entryIP);<NEW_LINE><MASK><NEW_LINE>} while (entryIP <= ip);<NEW_LINE>codeInfoQueryResult.setEncodedFrameSize(sizeEncoding);<NEW_LINE>codeInfoQueryResult.setExceptionOffset(CodeInfoQueryResult.NO_EXCEPTION_OFFSET);<NEW_LINE>codeInfoQueryResult.setReferenceMapIndex(ReferenceMapIndex.NO_REFERENCE_MAP);<NEW_LINE>} | entryOffset = advanceOffset(entryOffset, entryFlags); |
289,751 | protected String run() throws Exception {<NEW_LINE>final Jenkins jenkins = Jenkins.get();<NEW_LINE>final Item item = getItemForCredentials(getContext());<NEW_LINE>final SlackNotifier.DescriptorImpl slackDesc = jenkins.<MASK><NEW_LINE>final String email = step.email;<NEW_LINE>final String tokenCredentialId = step.tokenCredentialId != null ? step.tokenCredentialId : slackDesc.getTokenCredentialId();<NEW_LINE>final boolean botUser = step.botUser || slackDesc.isBotUser();<NEW_LINE>final TaskListener listener = getContext().get(TaskListener.class);<NEW_LINE>Objects.requireNonNull(listener, "Listener is mandatory here");<NEW_LINE>if (!botUser) {<NEW_LINE>listener.getLogger().println("The slackUserIdFromEmail step requires bot user mode");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final String populatedToken;<NEW_LINE>try {<NEW_LINE>populatedToken = CredentialsObtainer.getTokenToUse(tokenCredentialId, item, null);<NEW_LINE>} catch (final IllegalArgumentException e) {<NEW_LINE>listener.error(Messages.notificationFailedWithException(e));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String slackUserId = null;<NEW_LINE>try (CloseableHttpClient client = getHttpClient()) {<NEW_LINE>slackUserId = new EmailSlackUserIdResolver(populatedToken, client).resolveUserIdForEmailAddress(email);<NEW_LINE>} catch (final IOException e) {<NEW_LINE>logger.log(Level.WARNING, "Error closing HttpClient", e);<NEW_LINE>}<NEW_LINE>return slackUserId;<NEW_LINE>} | getDescriptorByType(SlackNotifier.DescriptorImpl.class); |
718,919 | public BulkUpdateAdminsResult bulkUpdate(Username currentUser, List<String> usersToAdd, List<String> usersToRemove, List<String> rolesToAdd, List<String> rolesToRemove, String md5) {<NEW_LINE>Set<Admin> existingAdmins = new HashSet<>(systemAdmins());<NEW_LINE>BulkUpdateAdminsResult result = validateUsersAndRolesForBulkUpdate(usersToRemove, rolesToRemove, existingAdmins);<NEW_LINE>if (!result.isSuccessful()) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>usersToAdd.forEach(user -> existingAdmins.add(new AdminUser(user)));<NEW_LINE>rolesToAdd.forEach(role -> existingAdmins.add(new AdminRole(role)));<NEW_LINE>usersToRemove.forEach(user -> existingAdmins.remove(new AdminUser(<MASK><NEW_LINE>rolesToRemove.forEach(role -> existingAdmins.remove(new AdminRole(new CaseInsensitiveString(role))));<NEW_LINE>AdminsConfigUpdateCommand command = new AdminsConfigUpdateCommand(goConfigService, new AdminsConfig(existingAdmins), currentUser, result, entityHashingService, md5);<NEW_LINE>updateConfig(currentUser, result, command);<NEW_LINE>result.setAdminsConfig(command.getEntity());<NEW_LINE>return result;<NEW_LINE>} | new CaseInsensitiveString(user)))); |
841,681 | String replaceTokens(ComponentInfo info, String message) {<NEW_LINE>Map<String, String> tokens = new HashMap<>();<NEW_LINE>Path graalPath = input.getGraalHomePath().normalize();<NEW_LINE>Path archPath = SystemUtils.getRuntimeLibDir(graalPath, true);<NEW_LINE>tokens.put(CommonConstants.<MASK><NEW_LINE>// NOI18N<NEW_LINE>tokens.put(CommonConstants.TOKEN_GRAALVM_LANG_DIR, SystemUtils.getRuntimeBaseDir(graalPath).resolve("languages").toString());<NEW_LINE>tokens.put(CommonConstants.TOKEN_GRAALVM_RTLIB_ARCH_DIR, archPath.toString());<NEW_LINE>tokens.put(CommonConstants.TOKEN_GRAALVM_RTLIB_DIR, SystemUtils.getRuntimeLibDir(graalPath, false).toString());<NEW_LINE>tokens.putAll(info.getRequiredGraalValues());<NEW_LINE>tokens.putAll(input.getLocalRegistry().getGraalCapabilities());<NEW_LINE>Matcher m = TOKEN_PATTERN.matcher(message);<NEW_LINE>StringBuilder result = null;<NEW_LINE>int start = 0;<NEW_LINE>int last = 0;<NEW_LINE>while (m.find(start)) {<NEW_LINE>String token = m.group(1);<NEW_LINE>String val = tokens.get(token);<NEW_LINE>if (val != null) {<NEW_LINE>if (result == null) {<NEW_LINE>result = new StringBuilder(archPath.toString().length() * 2);<NEW_LINE>}<NEW_LINE>result.append(message.substring(last, m.start()));<NEW_LINE>result.append(val);<NEW_LINE>last = m.end();<NEW_LINE>}<NEW_LINE>start = m.end();<NEW_LINE>}<NEW_LINE>if (result == null) {<NEW_LINE>return message;<NEW_LINE>} else {<NEW_LINE>result.append(message.substring(last));<NEW_LINE>return result.toString();<NEW_LINE>}<NEW_LINE>} | TOKEN_GRAALVM_PATH, graalPath.toString()); |
1,551,221 | public char[] readableName(boolean showGenerics) /*java.lang.Object, p.X<T> */<NEW_LINE>{<NEW_LINE>char[] readableName;<NEW_LINE>if (isMemberType()) {<NEW_LINE>readableName = CharOperation.concat(enclosingType().readableName(showGenerics && hasEnclosingInstanceContext()), this.sourceName, '.');<NEW_LINE>} else {<NEW_LINE>readableName = CharOperation.<MASK><NEW_LINE>}<NEW_LINE>if (showGenerics) {<NEW_LINE>TypeVariableBinding[] typeVars;<NEW_LINE>if ((typeVars = typeVariables()) != Binding.NO_TYPE_VARIABLES) {<NEW_LINE>StringBuffer nameBuffer = new StringBuffer(10);<NEW_LINE>nameBuffer.append(readableName).append('<');<NEW_LINE>for (int i = 0, length = typeVars.length; i < length; i++) {<NEW_LINE>if (i > 0)<NEW_LINE>nameBuffer.append(',');<NEW_LINE>nameBuffer.append(typeVars[i].readableName());<NEW_LINE>}<NEW_LINE>nameBuffer.append('>');<NEW_LINE>int nameLength = nameBuffer.length();<NEW_LINE>readableName = new char[nameLength];<NEW_LINE>nameBuffer.getChars(0, nameLength, readableName, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return readableName;<NEW_LINE>} | concatWith(this.compoundName, '.'); |
1,136,160 | public static TransactionArguments processArguments(CallArguments argsParam, TransactionPool transactionPool, Account senderAccount, byte defaultChainId) {<NEW_LINE>TransactionArguments argsRet = new TransactionArguments();<NEW_LINE>argsRet.setFrom(argsParam.getFrom());<NEW_LINE>argsRet.setTo(stringHexToByteArray(argsParam.getTo()));<NEW_LINE>argsRet.setNonce(strHexOrStrNumberToBigInteger(argsParam.getNonce(), () -> transactionPool.getPendingState().getNonce(senderAccount.getAddress())));<NEW_LINE>argsRet.setValue(strHexOrStrNumberToBigInteger(argsParam.getValue(), () -> BigInteger.ZERO));<NEW_LINE>argsRet.setGasPrice(strHexOrStrNumberToBigInteger(argsParam.getGasPrice(), <MASK><NEW_LINE>argsRet.setGasLimit(strHexOrStrNumberToBigInteger(argsParam.getGas(), () -> null));<NEW_LINE>if (argsRet.getGasLimit() == null) {<NEW_LINE>argsRet.setGasLimit(strHexOrStrNumberToBigInteger(argsParam.getGasLimit(), () -> DEFAULT_GAS_LIMIT));<NEW_LINE>}<NEW_LINE>if (argsParam.getData() != null && argsParam.getData().startsWith("0x")) {<NEW_LINE>argsRet.setData(argsParam.getData().substring(2));<NEW_LINE>// needs to change the parameter because some places expect the changed value after sendTransaction call<NEW_LINE>argsParam.setData(argsRet.getData());<NEW_LINE>}<NEW_LINE>argsRet.setChainId(hexToChainId(argsParam.getChainId()));<NEW_LINE>if (argsRet.getChainId() == 0) {<NEW_LINE>argsRet.setChainId(defaultChainId);<NEW_LINE>}<NEW_LINE>return argsRet;<NEW_LINE>} | () -> BigInteger.ZERO)); |
1,516,779 | public void paint(Graphics g) {<NEW_LINE>if (grabbedImage != null) {<NEW_LINE>Frame frame = grabberConverter.convert(grabbedImage);<NEW_LINE>BufferedImage image = paintConverter.getBufferedImage(frame, 2.2 / grabber.getGamma());<NEW_LINE>Graphics2D g2 = image.createGraphics();<NEW_LINE>if (faces != null) {<NEW_LINE>g2.setColor(Color.RED);<NEW_LINE>g2.<MASK><NEW_LINE>int total = faces.total();<NEW_LINE>for (int i = 0; i < total; i++) {<NEW_LINE>CvRect r = new CvRect(cvGetSeqElem(faces, i));<NEW_LINE>g2.drawRect(r.x() * 4, r.y() * 4, r.width() * 4, r.height() * 4);<NEW_LINE>}<NEW_LINE>faces = null;<NEW_LINE>}<NEW_LINE>g.drawImage(image, 0, 0, null);<NEW_LINE>}<NEW_LINE>if (exception != null) {<NEW_LINE>int y = 0, h = g.getFontMetrics().getHeight();<NEW_LINE>g.drawString(exception.toString(), 5, y += h);<NEW_LINE>for (StackTraceElement e : exception.getStackTrace()) {<NEW_LINE>g.drawString(" at " + e.toString(), 5, y += h);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | setStroke(new BasicStroke(2)); |
721,299 | static void registerRenderers(EntityRenderersEvent.RegisterRenderers event) {<NEW_LINE>event.registerBlockEntityRenderer(TinkerSmeltery.tank.get(), TankBlockEntityRenderer::new);<NEW_LINE>event.registerBlockEntityRenderer(TinkerSmeltery.faucet.get(), FaucetBlockEntityRenderer::new);<NEW_LINE>event.registerBlockEntityRenderer(TinkerSmeltery.channel.get(), ChannelBlockEntityRenderer::new);<NEW_LINE>event.registerBlockEntityRenderer(TinkerSmeltery.table.get(), CastingBlockEntityRenderer::new);<NEW_LINE>event.registerBlockEntityRenderer(TinkerSmeltery.basin.get(), CastingBlockEntityRenderer::new);<NEW_LINE>event.registerBlockEntityRenderer(TinkerSmeltery.melter.<MASK><NEW_LINE>event.registerBlockEntityRenderer(TinkerSmeltery.alloyer.get(), TankBlockEntityRenderer::new);<NEW_LINE>event.registerBlockEntityRenderer(TinkerSmeltery.smeltery.get(), HeatingStructureBlockEntityRenderer::new);<NEW_LINE>event.registerBlockEntityRenderer(TinkerSmeltery.foundry.get(), HeatingStructureBlockEntityRenderer::new);<NEW_LINE>} | get(), MelterBlockEntityRenderer::new); |
1,749,294 | private int updateForecast() {<NEW_LINE>List<Object> parameters = new ArrayList<Object>();<NEW_LINE>StringBuilder update = new StringBuilder();<NEW_LINE>update.append("UPDATE "<MASK><NEW_LINE>update.append(" SET ");<NEW_LINE>update.append(" QtyCalculated = NVL(M_ForecastLine.QtyCalculated,0) + NVL(frr.QtyCalculated,0),");<NEW_LINE>update.append(" Qty = NVL(M_ForecastLine.Qty,0) + NVL(frr.QtyPlan,0) + NVL(frr.QtyAbnormal,0)");<NEW_LINE>update.append(" FROM PP_ForecastRunMaster frm ");<NEW_LINE>update.append(" INNER JOIN PP_ForecastRunResult frr ON (frr.PP_ForecastRunMaster_ID=frm.PP_ForecastRunMaster_ID) ");<NEW_LINE>update.append(" INNER JOIN PP_Period fp ON (fp.PP_Period_ID=frr.PP_Period_ID) ");<NEW_LINE>update.append(" INNER JOIN M_Product p ON (p.M_Product_ID=frm.M_Product_ID) ");<NEW_LINE>update.append(" INNER JOIN M_Product_Category pc ON (pc.M_Product_Category_ID=p.M_Product_Category_ID)");<NEW_LINE>update.append(" LEFT JOIN M_Product_Classification pcl ON (pcl.value=p.Classification) ");<NEW_LINE>update.append(" LEFT JOIN M_Product_Class pclass ON (pclass.value=p.Group1) ");<NEW_LINE>update.append(" LEFT JOIN M_Product_Group pg ON (p.value=p.Group2) ");<NEW_LINE>StringBuilder whereClause = new StringBuilder(" WHERE M_ForecastLine.M_Forecast_ID=? AND ");<NEW_LINE>whereClause.append(" M_ForecastLine.M_Product_ID = frm.M_Product_ID AND ");<NEW_LINE>whereClause.append(" M_ForecastLine.M_Warehouse_ID=frm.M_Warehouse_ID AND ");<NEW_LINE>whereClause.append(" M_ForecastLine.PP_Period_ID=frr.PP_Period_ID AND ");<NEW_LINE>parameters.add(p_M_Forecast_ID);<NEW_LINE>update.append(getWhere(whereClause.toString(), parameters));<NEW_LINE>return DB.executeUpdateEx(update.toString(), parameters.toArray(), get_TrxName());<NEW_LINE>} | ).append(MForecastLine.Table_Name); |
1,141,661 | public void unbind(Name name) throws NamingException {<NEW_LINE>checkWritable();<NEW_LINE>while ((!name.isEmpty()) && (name.get(0).length() == 0)) name = name.getSuffix(1);<NEW_LINE>if (name.isEmpty())<NEW_LINE>throw new NamingException(rb.getString(LogFacade.INVALID_NAME));<NEW_LINE>NamingEntry entry = bindings.get(name.get(0));<NEW_LINE>if (entry == null) {<NEW_LINE>throw new NameNotFoundException(MessageFormat.format(rb.getString(LogFacade.NAME_NOT_BOUND), name.get(0)));<NEW_LINE>}<NEW_LINE>if (name.size() > 1) {<NEW_LINE>if (entry.type == NamingEntry.CONTEXT) {<NEW_LINE>((Context) entry.value).unbind(name.getSuffix(1));<NEW_LINE>} else {<NEW_LINE>throw new NamingException(rb.getString(LogFacade.CONTEXT_EXPECTED));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>bindings.remove<MASK><NEW_LINE>}<NEW_LINE>} | (name.get(0)); |
1,173,408 | private static List<Archive> init() {<NEW_LINE>List<Archive> result = new ArrayList<>();<NEW_LINE>Path home = Paths.get(System.getProperty("java.home"));<NEW_LINE>try {<NEW_LINE>if (home.endsWith("jre")) {<NEW_LINE>// jar files in <javahome>/jre/lib<NEW_LINE>result.addAll(addJarFiles(<MASK><NEW_LINE>if (home.getParent() != null) {<NEW_LINE>// add tools.jar and other JDK jar files<NEW_LINE>Path lib = home.getParent().resolve("lib");<NEW_LINE>if (Files.exists(lib)) {<NEW_LINE>result.addAll(addJarFiles(lib));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (Files.exists(home.resolve("lib"))) {<NEW_LINE>// either a JRE or a jdk build image<NEW_LINE>Path classes = home.resolve("classes");<NEW_LINE>if (Files.isDirectory(classes)) {<NEW_LINE>// jdk build outputdir<NEW_LINE>result.add(new JDKArchive(classes));<NEW_LINE>}<NEW_LINE>// add other JAR files<NEW_LINE>result.addAll(addJarFiles(home.resolve("lib")));<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("\"" + home + "\" not a JDK home");<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new Error(e);<NEW_LINE>}<NEW_LINE>} | home.resolve("lib"))); |
1,548,070 | // important: inputs should not be reused<NEW_LINE>protected static MutableRoaringBitmap lazyor(final ImmutableRoaringBitmap x1, final ImmutableRoaringBitmap x2) {<NEW_LINE>final MutableRoaringBitmap answer = new MutableRoaringBitmap();<NEW_LINE>MappeableContainerPointer i1 = x1.highLowContainer.getContainerPointer();<NEW_LINE>MappeableContainerPointer i2 <MASK><NEW_LINE>main: if (i1.hasContainer() && i2.hasContainer()) {<NEW_LINE>while (true) {<NEW_LINE>if (i1.key() == i2.key()) {<NEW_LINE>answer.getMappeableRoaringArray().append(i1.key(), i1.getContainer().lazyOR(i2.getContainer()));<NEW_LINE>i1.advance();<NEW_LINE>i2.advance();<NEW_LINE>if (!i1.hasContainer() || !i2.hasContainer()) {<NEW_LINE>break main;<NEW_LINE>}<NEW_LINE>} else if (i1.key() < i2.key()) {<NEW_LINE>answer.getMappeableRoaringArray().appendCopy(i1.key(), i1.getContainer());<NEW_LINE>i1.advance();<NEW_LINE>if (!i1.hasContainer()) {<NEW_LINE>break main;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// i1.key() > i2.key()<NEW_LINE>answer.getMappeableRoaringArray().appendCopy(i2.key(), i2.getContainer());<NEW_LINE>i2.advance();<NEW_LINE>if (!i2.hasContainer()) {<NEW_LINE>break main;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!i1.hasContainer()) {<NEW_LINE>while (i2.hasContainer()) {<NEW_LINE>answer.getMappeableRoaringArray().appendCopy(i2.key(), i2.getContainer());<NEW_LINE>i2.advance();<NEW_LINE>}<NEW_LINE>} else if (!i2.hasContainer()) {<NEW_LINE>while (i1.hasContainer()) {<NEW_LINE>answer.getMappeableRoaringArray().appendCopy(i1.key(), i1.getContainer());<NEW_LINE>i1.advance();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return answer;<NEW_LINE>} | = x2.highLowContainer.getContainerPointer(); |
1,052,220 | public static ExecutionStatus tryCatchException(Exception e) {<NEW_LINE>ExecutionStatus responseResult = new ExecutionStatus();<NEW_LINE>if (e instanceof QueryProcessException) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(((QueryProcessException) e).getErrorCode());<NEW_LINE>} else if (e instanceof StorageGroupNotSetException) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(((StorageGroupNotSetException) e).getErrorCode());<NEW_LINE>} else if (e instanceof StorageEngineException) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(((StorageEngineException) e).getErrorCode());<NEW_LINE>} else if (e instanceof AuthException) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(Status.BAD_REQUEST.getStatusCode());<NEW_LINE>} else if (e instanceof IllegalPathException) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(((IllegalPathException) e).getErrorCode());<NEW_LINE>} else if (e instanceof MetadataException) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(((MetadataException) e).getErrorCode());<NEW_LINE>} else if (e instanceof IoTDBException) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(((IoTDBException<MASK><NEW_LINE>} else if (!(e instanceof IOException) && !(e instanceof NullPointerException)) {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(TSStatusCode.EXECUTE_STATEMENT_ERROR.getStatusCode());<NEW_LINE>} else {<NEW_LINE>responseResult.setMessage(e.getMessage());<NEW_LINE>responseResult.setCode(TSStatusCode.INTERNAL_SERVER_ERROR.getStatusCode());<NEW_LINE>}<NEW_LINE>LOGGER.warn(e.getMessage(), e);<NEW_LINE>return responseResult;<NEW_LINE>} | ) e).getErrorCode()); |
916,467 | public void eval(EvaluationContext ctx) {<NEW_LINE>for (int i = 0; i < variablesPositionCounts; i++) {<NEW_LINE>children[variablesPositions[i]].eval(ctx);<NEW_LINE>}<NEW_LINE>MutableChunk chunk = ctx.getPreAllocatedChunk();<NEW_LINE>int len = chunk.batchSize();<NEW_LINE>int[] sel = chunk.selection();<NEW_LINE>RandomAccessBlock outputSlot = chunk.slotIn(outputIndex, outputDataType);<NEW_LINE>if (chunk.isSelectionInUse()) {<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>for (int j = 0; j < variablesPositionCounts; j++) {<NEW_LINE>int k = variablesPositions[j];<NEW_LINE>args[k] = chunk.slotIn(children[k].getOutputIndex()).elementAt(sel[i]);<NEW_LINE>}<NEW_LINE>Object ret = scalarFunction.compute(args, executionContext);<NEW_LINE>Object convertedRet = scalarFunction.getReturnType().convertFrom(ret);<NEW_LINE>outputSlot.setElementAt(sel[i], convertedRet);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < len; i++) {<NEW_LINE>for (int j = 0; j < variablesPositionCounts; j++) {<NEW_LINE>int k = variablesPositions[j];<NEW_LINE>args[k] = chunk.slotIn(children[k].getOutputIndex()).elementAt(i);<NEW_LINE>}<NEW_LINE>Object ret = scalarFunction.compute(args, executionContext);<NEW_LINE>Object convertedRet = scalarFunction.getReturnType().convertFrom(ret);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | outputSlot.setElementAt(i, convertedRet); |
416,870 | private // if the required system property has been set then parse it and add the paths to the classloader search path<NEW_LINE>void configureSearchPath() {<NEW_LINE>// The search path can be set by a system property or environment variable with the sys prop taking precedence<NEW_LINE>// TODO handle quoted string, blanks in the file name<NEW_LINE>String <MASK><NEW_LINE>if (null == property) {<NEW_LINE>property = System.getenv(PLUGIN_ENV_VAR);<NEW_LINE>if (property == null) {<NEW_LINE>property = System.getenv(PLUGIN_ENV_VAR_ALT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((null == property) || (property.length() == 0)) {<NEW_LINE>// no plugin path was specified<NEW_LINE>logger.fine("No system property called " + PLUGIN_SYSTEM_PROPERTY + " was found");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>logger.fine("Plugins search path = " + property);<NEW_LINE>// break the path up and add to classloader search path<NEW_LINE>String[] parts = property.split(File.pathSeparator);<NEW_LINE>for (int i = 0; i < parts.length; i++) {<NEW_LINE>try {<NEW_LINE>File file = new File(parts[i]);<NEW_LINE>pluginSearchPath.add(file);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warning("Failed to create a URI or URL from " + parts[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | property = System.getProperty(PLUGIN_SYSTEM_PROPERTY); |
1,582,858 | public int best(final Object obj) {<NEW_LINE>if (obj instanceof Phi[]) {<NEW_LINE>return this.next();<NEW_LINE>}<NEW_LINE>final String label;<NEW_LINE>if (obj instanceof Long || obj instanceof String || obj instanceof Character || obj instanceof Double || obj instanceof Boolean) {<NEW_LINE>label = obj.toString();<NEW_LINE>} else if (obj instanceof Pattern) {<NEW_LINE>label = Pattern.class.cast(obj).pattern();<NEW_LINE>} else if (obj instanceof byte[]) {<NEW_LINE>label = Arrays.toString(byte[]<MASK><NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException(String.format("Unknown type for vertex allocation: %s", obj.getClass().getCanonicalName()));<NEW_LINE>}<NEW_LINE>final MessageDigest digest;<NEW_LINE>try {<NEW_LINE>digest = MessageDigest.getInstance("SHA-256");<NEW_LINE>} catch (final NoSuchAlgorithmException ex) {<NEW_LINE>throw new IllegalStateException(ex);<NEW_LINE>}<NEW_LINE>digest.update(String.format("%s %s", obj.getClass().getName(), label).getBytes());<NEW_LINE>final String hash = new String(digest.digest());<NEW_LINE>return this.seen.computeIfAbsent(hash, key -> this.seen.size() + 1);<NEW_LINE>} | .class.cast(obj)); |
1,785,874 | // Mirrors wkt<NEW_LINE>private static void exportPolygonToGeoJson_(int export_flags, Polygon polygon, JsonWriter json_writer) {<NEW_LINE>MultiPathImpl polygon_impl = (MultiPathImpl) (polygon._getImpl());<NEW_LINE>if ((export_flags & GeoJsonExportFlags.geoJsonExportFailIfNotSimple) != 0) {<NEW_LINE>int simple = polygon_impl.getIsSimple(0.0);<NEW_LINE>if (simple != MultiPathImpl.GeometryXSimple.Strong)<NEW_LINE>throw new GeometryException("corrupted geometry");<NEW_LINE>}<NEW_LINE>int point_count = polygon.getPointCount();<NEW_LINE>int polygon_count = polygon_impl.getOGCPolygonCount();<NEW_LINE>if (point_count > 0 && polygon_count == 0)<NEW_LINE>throw new GeometryException("corrupted geometry");<NEW_LINE>int precision = 17 - (31 & (export_flags >> 13));<NEW_LINE>boolean bFixedPoint = (GeoJsonExportFlags.geoJsonExportPrecisionFixedPoint & export_flags) != 0;<NEW_LINE>boolean b_export_zs = polygon_impl.hasAttribute(VertexDescription.Semantics.Z) && (export_flags & GeoJsonExportFlags.geoJsonExportStripZs) == 0;<NEW_LINE>boolean b_export_ms = polygon_impl.hasAttribute(VertexDescription.Semantics.M) && (export_flags & GeoJsonExportFlags.geoJsonExportStripMs) == 0;<NEW_LINE>if (!b_export_zs && b_export_ms)<NEW_LINE>throw new IllegalArgumentException("invalid argument");<NEW_LINE>int path_count = 0;<NEW_LINE>AttributeStreamOfDbl position = null;<NEW_LINE>AttributeStreamOfDbl zs = null;<NEW_LINE>AttributeStreamOfDbl ms = null;<NEW_LINE>AttributeStreamOfInt8 path_flags = null;<NEW_LINE>AttributeStreamOfInt32 paths = null;<NEW_LINE>if (point_count > 0) {<NEW_LINE>position = (AttributeStreamOfDbl) polygon_impl.getAttributeStreamRef(Semantics.POSITION);<NEW_LINE>path_flags = polygon_impl.getPathFlagsStreamRef();<NEW_LINE>paths = polygon_impl.getPathStreamRef();<NEW_LINE>path_count = polygon_impl.getPathCount();<NEW_LINE>if (b_export_zs) {<NEW_LINE>if (polygon_impl._attributeStreamIsAllocated(Semantics.Z))<NEW_LINE>zs = (AttributeStreamOfDbl) polygon_impl.getAttributeStreamRef(Semantics.Z);<NEW_LINE>}<NEW_LINE>if (b_export_ms) {<NEW_LINE>if (polygon_impl._attributeStreamIsAllocated(Semantics.M))<NEW_LINE>ms = (AttributeStreamOfDbl) <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ((export_flags & GeoJsonExportFlags.geoJsonExportPreferMultiGeometry) == 0 && polygon_count <= 1)<NEW_LINE>polygonTaggedText_(precision, bFixedPoint, b_export_zs, b_export_ms, zs, ms, position, paths, path_count, json_writer);<NEW_LINE>else<NEW_LINE>multiPolygonTaggedText_(precision, bFixedPoint, b_export_zs, b_export_ms, zs, ms, position, path_flags, paths, polygon_count, path_count, json_writer);<NEW_LINE>} | polygon_impl.getAttributeStreamRef(Semantics.M); |
385,935 | void writeKeys(XMLExtendedStreamWriter writer, ModelNode model) throws XMLStreamException {<NEW_LINE>if (!model.isDefined()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean contains = false;<NEW_LINE>for (Property key : model.asPropertyList()) {<NEW_LINE>if (!contains) {<NEW_LINE>writer.writeStartElement(Constants.XML.KEYS);<NEW_LINE>contains = true;<NEW_LINE>}<NEW_LINE>writer.writeStartElement(Constants.XML.KEY);<NEW_LINE>ModelNode keyAttributes = key.getValue();<NEW_LINE>for (SimpleAttributeDefinition attr : KeyDefinition.ATTRIBUTES) {<NEW_LINE>attr.getAttributeMarshaller().marshallAsAttribute(<MASK><NEW_LINE>}<NEW_LINE>for (SimpleAttributeDefinition attr : KeyDefinition.ELEMENTS) {<NEW_LINE>attr.getAttributeMarshaller().marshallAsElement(attr, keyAttributes, false, writer);<NEW_LINE>}<NEW_LINE>writeKeyStore(writer, keyAttributes.get(Constants.Model.KEY_STORE));<NEW_LINE>writer.writeEndElement();<NEW_LINE>}<NEW_LINE>if (contains) {<NEW_LINE>writer.writeEndElement();<NEW_LINE>}<NEW_LINE>} | attr, keyAttributes, false, writer); |
1,069,909 | public User updateUser(String userId, String password, String firstName, String middleName, String lastName, String nickName, boolean male, Date birthday, String emailAddress, String smsId, String aimId, String icqId, String msnId, String ymId, String favoriteActivity, String favoriteBibleVerse, String favoriteFood, String favoriteMovie, String favoriteMusic, String languageId, String timeZoneId, String skinId, boolean dottedSkins, boolean roundedSkins, String greeting, String resolution, String refreshRate, String comments) throws PortalException, SystemException {<NEW_LINE>User <MASK><NEW_LINE>if (!getUserId().equals(userId) && !hasAdministrator(user.getCompanyId())) {<NEW_LINE>throw new PrincipalException();<NEW_LINE>}<NEW_LINE>return UserLocalManagerUtil.updateUser(userId, password, firstName, middleName, lastName, nickName, male, birthday, emailAddress, smsId, aimId, icqId, msnId, ymId, favoriteActivity, favoriteBibleVerse, favoriteFood, favoriteMovie, favoriteMusic, languageId, timeZoneId, skinId, dottedSkins, roundedSkins, greeting, resolution, refreshRate, comments);<NEW_LINE>} | user = UserUtil.findByPrimaryKey(userId); |
1,611,448 | private void updatePushHooks() {<NEW_LINE>if (onto != null && upstream != null && origHead != null) {<NEW_LINE>Collection<GitHook> hooks = VCSHooks.getInstance(<MASK><NEW_LINE>if (!hooks.isEmpty() && !pm.isCanceled()) {<NEW_LINE>progress.setProgress(Bundle.MSG_RebaseAction_updatingHooks());<NEW_LINE>try {<NEW_LINE>GitHookContext.LogEntry[] originalEntries = getEntries(client, upstream, origHead, pm);<NEW_LINE>if (pm.isCanceled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GitHookContext.LogEntry[] newEntries = getEntries(client, onto, GitUtils.HEAD, pm);<NEW_LINE>if (pm.isCanceled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, String> mapping = findChangesetMapping(originalEntries, newEntries);<NEW_LINE>for (GitHook gitHook : hooks) {<NEW_LINE>gitHook.afterCommitReplace(new GitHookContext(new File[] { repository }, null, originalEntries), new GitHookContext(new File[] { repository }, null, newEntries), mapping);<NEW_LINE>}<NEW_LINE>} catch (GitException ex) {<NEW_LINE>LOG.log(Level.INFO, null, ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ).getHooks(GitHook.class); |
546,598 | private // Note that the keys stored in the BatchHolders are not moved around.<NEW_LINE>void resizeAndRehashIfNeeded() {<NEW_LINE>if (numEntries < threshold) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (EXTRA_DEBUG) {<NEW_LINE>logger.<MASK><NEW_LINE>}<NEW_LINE>// If the table size is already MAXIMUM_CAPACITY, don't resize<NEW_LINE>// the table, but set the threshold to Integer.MAX_VALUE such that<NEW_LINE>// future attempts to resize will return immediately.<NEW_LINE>if (tableSize == MAXIMUM_CAPACITY) {<NEW_LINE>threshold = Integer.MAX_VALUE;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int newTableSize = 2 * tableSize;<NEW_LINE>newTableSize = roundUpToPowerOf2(newTableSize);<NEW_LINE>// if not enough memory available to allocate the new hash-table, plus the new links and<NEW_LINE>// the new hash-values (to replace the existing ones - inside rehash() ), then OOM<NEW_LINE>if (4 * /* sizeof(int) */<NEW_LINE>(newTableSize + 2 * HashTable.BATCH_SIZE) >= allocator.getLimit() - allocator.getAllocatedMemory()) {<NEW_LINE>throw new OutOfMemoryException("Resize Hash Table");<NEW_LINE>}<NEW_LINE>tableSize = newTableSize;<NEW_LINE>if (tableSize > MAXIMUM_CAPACITY) {<NEW_LINE>tableSize = MAXIMUM_CAPACITY;<NEW_LINE>}<NEW_LINE>long t0 = System.currentTimeMillis();<NEW_LINE>// set the new threshold based on the new table size and load factor<NEW_LINE>threshold = (int) Math.ceil(tableSize * htConfig.getLoadFactor());<NEW_LINE>IntVector newStartIndices = allocMetadataVector(tableSize, EMPTY_SLOT);<NEW_LINE>for (int i = 0; i < batchHolders.size(); i++) {<NEW_LINE>BatchHolder bh = batchHolders.get(i);<NEW_LINE>int batchStartIdx = i * BATCH_SIZE;<NEW_LINE>bh.rehash(tableSize, newStartIndices, batchStartIdx);<NEW_LINE>}<NEW_LINE>startIndices.clear();<NEW_LINE>startIndices = newStartIndices;<NEW_LINE>if (EXTRA_DEBUG) {<NEW_LINE>logger.debug("After resizing and rehashing, dumping the hash table...");<NEW_LINE>logger.debug("Number of buckets = {}.", startIndices.getAccessor().getValueCount());<NEW_LINE>for (int i = 0; i < startIndices.getAccessor().getValueCount(); i++) {<NEW_LINE>logger.debug("Bucket: {}, startIdx[ {} ] = {}.", i, i, startIndices.getAccessor().get(i));<NEW_LINE>int startIdx = startIndices.getAccessor().get(i);<NEW_LINE>BatchHolder bh = batchHolders.get((startIdx >>> 16) & BATCH_MASK);<NEW_LINE>bh.dump(startIdx);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>resizingTime += System.currentTimeMillis() - t0;<NEW_LINE>numResizing++;<NEW_LINE>} | debug("Hash table numEntries = {}, threshold = {}; resizing the table...", numEntries, threshold); |
1,683,134 | public Explanation explain(LeafReaderContext context, int doc) throws IOException {<NEW_LINE>boolean match = false;<NEW_LINE>double max = 0;<NEW_LINE>double otherSum = 0;<NEW_LINE>List<Explanation> subs = new ArrayList<>();<NEW_LINE>for (Weight wt : weights) {<NEW_LINE>Explanation e = wt.explain(context, doc);<NEW_LINE>if (e.isMatch()) {<NEW_LINE>match = true;<NEW_LINE>subs.add(e);<NEW_LINE>double score = e.getValue().doubleValue();<NEW_LINE>if (score >= max) {<NEW_LINE>otherSum += max;<NEW_LINE>max = score;<NEW_LINE>} else {<NEW_LINE>otherSum += score;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (match) {<NEW_LINE>final float score = (float) (max + otherSum * tieBreakerMultiplier);<NEW_LINE>final String desc = tieBreakerMultiplier == 0.0f <MASK><NEW_LINE>return Explanation.match(score, desc, subs);<NEW_LINE>} else {<NEW_LINE>return Explanation.noMatch("No matching clause");<NEW_LINE>}<NEW_LINE>} | ? "max of:" : "max plus " + tieBreakerMultiplier + " times others of:"; |
1,698,225 | private void callExternalProgram() throws LoginException {<NEW_LINE>AtomicReference<Process> process = new AtomicReference<>();<NEW_LINE>try (Watchdog watchdog = new Watchdog(timeout_ms, () -> {<NEW_LINE>Process local_p = process.get();<NEW_LINE>if (local_p != null) {<NEW_LINE>local_p.destroyForcibly();<NEW_LINE>}<NEW_LINE>})) {<NEW_LINE>watchdog.arm();<NEW_LINE>Process p = Runtime.getRuntime().exec(cmdArray);<NEW_LINE>process.set(p);<NEW_LINE>ProcessConsumer.consume(p.getInputStream(), stdOutStr -> {<NEW_LINE>RepositoryManager.log(null, null, extProgramName + " STDOUT: " + stdOutStr, null);<NEW_LINE>});<NEW_LINE>ProcessConsumer.consume(p.getErrorStream(), errStr -> {<NEW_LINE>RepositoryManager.log(null, null, extProgramName + " STDERR: " + errStr, null);<NEW_LINE>});<NEW_LINE>PrintWriter outputWriter = new PrintWriter(p.getOutputStream());<NEW_LINE>outputWriter.write(username);<NEW_LINE>outputWriter.write("\n");<NEW_LINE>outputWriter.write(password);<NEW_LINE>outputWriter.write("\n");<NEW_LINE>outputWriter.flush();<NEW_LINE>int exitValue = p.waitFor();<NEW_LINE>if (exitValue != 0) {<NEW_LINE>throw new FailedLoginException("Login failed: external command exited with error " + exitValue);<NEW_LINE>}<NEW_LINE>} catch (IOException | InterruptedException e) {<NEW_LINE>RepositoryManager.log(null, null, "Exception when executing " + extProgramName + ":" + e.getMessage(), null);<NEW_LINE>throw new LoginException("Error executing external program");<NEW_LINE>} finally {<NEW_LINE>Arrays.fill(password, '\0');<NEW_LINE>password = null;<NEW_LINE><MASK><NEW_LINE>if (p != null && p.isAlive()) {<NEW_LINE>if (p.isAlive()) {<NEW_LINE>try {<NEW_LINE>p.waitFor(timeout_ms, TimeUnit.MILLISECONDS);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// ignore<NEW_LINE>} finally {<NEW_LINE>p.destroyForcibly();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Process p = process.get(); |
690,936 | private I_C_Flatrate_Term createNewTerm(@NonNull final ContractExtendingRequest context) {<NEW_LINE>final I_C_Flatrate_Term currentTerm = context.getContract();<NEW_LINE>final <MASK><NEW_LINE>Check.errorIf(currentTerm.getC_FlatrateTerm_Next_ID() > 0, "{} has C_FlatrateTerm_Next_ID = {} (should be <= 0)", currentTerm, currentTerm.getC_FlatrateTerm_Next_ID());<NEW_LINE>final I_C_Flatrate_Conditions conditions = currentTerm.getC_Flatrate_Conditions();<NEW_LINE>final I_C_Flatrate_Transition currentTransition = conditions.getC_Flatrate_Transition();<NEW_LINE>final I_C_Flatrate_Conditions nextConditions;<NEW_LINE>if (currentTransition.getC_Flatrate_Conditions_Next_ID() > 0) {<NEW_LINE>nextConditions = currentTransition.getC_Flatrate_Conditions_Next();<NEW_LINE>} else {<NEW_LINE>nextConditions = currentTerm.getC_Flatrate_Conditions();<NEW_LINE>}<NEW_LINE>final I_C_Flatrate_Term nextTerm = newInstance(I_C_Flatrate_Term.class, currentTerm);<NEW_LINE>nextTerm.setAD_Org_ID(currentTerm.getAD_Org_ID());<NEW_LINE>nextTerm.setC_Flatrate_Data_ID(currentTerm.getC_Flatrate_Data_ID());<NEW_LINE>nextTerm.setC_Flatrate_Conditions_ID(nextConditions.getC_Flatrate_Conditions_ID());<NEW_LINE>nextTerm.setPlannedQtyPerUnit(currentTerm.getPlannedQtyPerUnit());<NEW_LINE>nextTerm.setIsSimulation(currentTerm.isSimulation());<NEW_LINE>final BPartnerContactId billContactId = BPartnerContactId.ofRepoIdOrNull(currentTerm.getBill_BPartner_ID(), currentTerm.getBill_User_ID());<NEW_LINE>ContractDocumentLocationAdapterFactory.billLocationAdapter(nextTerm).setFrom(ContractLocationHelper.extractBillToLocationId(currentTerm), billContactId);<NEW_LINE>final BPartnerContactId dropshipContactId = BPartnerContactId.ofRepoIdOrNull(currentTerm.getDropShip_BPartner_ID(), currentTerm.getDropShip_User_ID());<NEW_LINE>ContractDocumentLocationAdapterFactory.dropShipLocationAdapter(nextTerm).setFrom(ContractLocationHelper.extractDropshipLocationId(currentTerm), dropshipContactId);<NEW_LINE>nextTerm.setAD_User_InCharge_ID(currentTerm.getAD_User_InCharge_ID());<NEW_LINE>final I_C_Flatrate_Transition nextTransition = nextConditions.getC_Flatrate_Transition();<NEW_LINE>final Timestamp firstDayOfNewTerm = computeStartDate(currentTerm, nextTermStartDate);<NEW_LINE>nextTerm.setStartDate(firstDayOfNewTerm);<NEW_LINE>nextTerm.setMasterStartDate(currentTerm.getMasterStartDate());<NEW_LINE>final OrderAndLineId orderAndLineTermId = OrderAndLineId.ofRepoIdsOrNull(currentTerm.getC_Order_Term_ID(), currentTerm.getC_OrderLine_Term_ID());<NEW_LINE>if (orderAndLineTermId != null) {<NEW_LINE>nextTerm.setC_OrderLine_Term_ID(orderAndLineTermId.getOrderLineRepoId());<NEW_LINE>nextTerm.setC_Order_Term_ID(orderAndLineTermId.getOrderRepoId());<NEW_LINE>}<NEW_LINE>updateEndDate(nextTransition, nextTerm);<NEW_LINE>updateNoticeDate(nextTransition, nextTerm);<NEW_LINE>nextTerm.setM_PricingSystem_ID(currentTerm.getM_PricingSystem_ID());<NEW_LINE>nextTerm.setM_Product_ID(currentTerm.getM_Product_ID());<NEW_LINE>Services.get(IAttributeSetInstanceBL.class).cloneASI(currentTerm, nextTerm);<NEW_LINE>nextTerm.setDeliveryRule(currentTerm.getDeliveryRule());<NEW_LINE>nextTerm.setDeliveryViaRule(currentTerm.getDeliveryViaRule());<NEW_LINE>nextTerm.setC_UOM_ID(currentTerm.getC_UOM_ID());<NEW_LINE>nextTerm.setC_Currency_ID(currentTerm.getC_Currency_ID());<NEW_LINE>nextTerm.setC_Flatrate_Term_Master_ID(currentTerm.getC_Flatrate_Term_Master_ID());<NEW_LINE>final IFlatrateTermEventService flatrateHandlersService = Services.get(IFlatrateTermEventService.class);<NEW_LINE>// nextterm is not saved yet, so type will be null in this moment<NEW_LINE>flatrateHandlersService.// nextterm is not saved yet, so type will be null in this moment<NEW_LINE>getHandler(nextConditions.getType_Conditions()).beforeSaveOfNextTermForPredecessor(nextTerm, currentTerm);<NEW_LINE>nextTerm.setDocAction(X_C_Flatrate_Term.DOCACTION_Prepare);<NEW_LINE>nextTerm.setDocStatus(X_C_Flatrate_Term.DOCSTATUS_Drafted);<NEW_LINE>InterfaceWrapperHelper.save(nextTerm);<NEW_LINE>return nextTerm;<NEW_LINE>} | Timestamp nextTermStartDate = context.getNextTermStartDate(); |
1,047,419 | public void process(Operator operator, List<COSBase> arguments) throws IOException {<NEW_LINE>if (arguments.size() < 2) {<NEW_LINE>throw new MissingOperandException(operator, arguments);<NEW_LINE>}<NEW_LINE>COSBase base0 = arguments.get(0);<NEW_LINE>COSBase base1 = arguments.get(1);<NEW_LINE>if (!(base0 instanceof COSName)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!(base1 instanceof COSNumber)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>COSName fontName = (COSName) base0;<NEW_LINE>float fontSize = ((COSNumber) base1).floatValue();<NEW_LINE>context.getGraphicsState().getTextState().setFontSize(fontSize);<NEW_LINE>PDFont font = context.<MASK><NEW_LINE>if (font == null) {<NEW_LINE>Log.w("PdfBox-Android", "font '" + fontName.getName() + "' not found in resources");<NEW_LINE>}<NEW_LINE>context.getGraphicsState().getTextState().setFont(font);<NEW_LINE>} | getResources().getFont(fontName); |
295,604 | protected String doIt() throws Exception {<NEW_LINE>Optional<MProjectType> projectTypeFromOptiional = Optional.of(new MProjectType(getCtx(), getProjectTypeId(), get_TrxName()));<NEW_LINE>projectTypeFromOptiional.ifPresent(projectTypeFrom -> {<NEW_LINE>projectTypeFrom.getPhases().stream().forEach(fromPhase -> {<NEW_LINE>MProjectTypePhase projectTypePhase = new MProjectTypePhase(getCtx(), 0, get_TrxName());<NEW_LINE>projectTypePhase.setC_ProjectType_ID(getRecord_ID());<NEW_LINE>projectTypePhase.setSeqNo(fromPhase.getSeqNo());<NEW_LINE>projectTypePhase.setName(fromPhase.getName());<NEW_LINE>projectTypePhase.setDescription(fromPhase.getDescription());<NEW_LINE>projectTypePhase.setHelp(fromPhase.getHelp());<NEW_LINE>projectTypePhase.setM_Product_ID(fromPhase.getM_Product_ID());<NEW_LINE>projectTypePhase.setStandardQty(fromPhase.getStandardQty());<NEW_LINE>projectTypePhase.setR_StandardRequestType_ID(fromPhase.getR_StandardRequestType_ID());<NEW_LINE>projectTypePhase.saveEx();<NEW_LINE>fromPhase.getTasks().stream().forEach(task -> {<NEW_LINE>MProjectTypeTask projectTypeTask = new MProjectTypeTask(getCtx(), 0, get_TrxName());<NEW_LINE>projectTypeTask.<MASK><NEW_LINE>projectTypeTask.setSeqNo(task.getSeqNo());<NEW_LINE>projectTypeTask.setName(task.getName());<NEW_LINE>projectTypeTask.setDescription(task.getDescription());<NEW_LINE>projectTypeTask.setHelp(task.getHelp());<NEW_LINE>projectTypeTask.setM_Product_ID(task.getM_Product_ID());<NEW_LINE>projectTypeTask.setStandardQty(task.getStandardQty());<NEW_LINE>projectTypeTask.setR_StandardRequestType_ID(task.getR_StandardRequestType_ID());<NEW_LINE>projectTypeTask.saveEx();<NEW_LINE>});<NEW_LINE>});<NEW_LINE>});<NEW_LINE>return "@OK@";<NEW_LINE>} | setC_Phase_ID(projectTypePhase.getC_Phase_ID()); |
1,366,620 | /*<NEW_LINE>* Check that the signature timestamp applies to this signature.<NEW_LINE>* Match the hash present in the signature timestamp token against the hash<NEW_LINE>* of this signature.<NEW_LINE>*/<NEW_LINE>private void verifyTimestamp(TimestampToken token) throws NoSuchAlgorithmException, SignatureException {<NEW_LINE><MASK><NEW_LINE>algorithms.put(digestAlgId, "TimestampToken digestAlgorithm field");<NEW_LINE>MessageDigest md = MessageDigest.getInstance(digestAlgId.getName());<NEW_LINE>if (!MessageDigest.isEqual(token.getHashedMessage(), md.digest(encryptedDigest))) {<NEW_LINE>throw new SignatureException("Signature timestamp (#" + token.getSerialNumber() + ") generated on " + token.getDate() + " is inapplicable");<NEW_LINE>}<NEW_LINE>if (debug != null) {<NEW_LINE>debug.println();<NEW_LINE>debug.println("Detected signature timestamp (#" + token.getSerialNumber() + ") generated on " + token.getDate());<NEW_LINE>debug.println();<NEW_LINE>}<NEW_LINE>} | AlgorithmId digestAlgId = token.getHashAlgorithm(); |
335,835 | public CloseableIterator<E> createIterator(int skip, int take) {<NEW_LINE>try {<NEW_LINE>StatementListener listener = configuration.getStatementListener();<NEW_LINE>listener.<MASK><NEW_LINE>ResultSet results = statement.executeQuery();<NEW_LINE>listener.afterExecuteQuery(statement);<NEW_LINE>// read the result meta data<NEW_LINE>ResultSetMetaData metadata = results.getMetaData();<NEW_LINE>// map of entity column names to attributes<NEW_LINE>Map<String, Attribute<E, ?>> map = new HashMap<>();<NEW_LINE>for (Attribute<E, ?> attribute : type.getAttributes()) {<NEW_LINE>map.put(attribute.getName().toLowerCase(Locale.ROOT), attribute);<NEW_LINE>}<NEW_LINE>Set<Attribute<E, ?>> attributes = new LinkedHashSet<>();<NEW_LINE>for (int i = 0; i < metadata.getColumnCount(); i++) {<NEW_LINE>String name = metadata.getColumnName(i + 1);<NEW_LINE>Attribute<E, ?> attribute = map.get(name.toLowerCase(Locale.ROOT));<NEW_LINE>if (attribute != null) {<NEW_LINE>attributes.add(attribute);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Attribute[] array = Attributes.toArray(attributes, new Predicate<Attribute<E, ?>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean test(Attribute<E, ?> value) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>EntityResultReader<E, S> entityReader = new EntityResultReader<>(reader, array);<NEW_LINE>return new ResultSetIterator<>(entityReader, results, null, true, true);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new PersistenceException(e);<NEW_LINE>}<NEW_LINE>} | beforeExecuteQuery(statement, sql, boundParameters); |
1,025,006 | protected void execute(Terminal terminal, OptionSet options, Environment env) throws UserException {<NEW_LINE>if (options.nonOptionArguments().isEmpty() == false) {<NEW_LINE>throw new UserException(ExitCodes.USAGE, "Positional arguments not allowed, found " + options.nonOptionArguments());<NEW_LINE>}<NEW_LINE>if (options.has(versionOption)) {<NEW_LINE>final String versionOutput = String.format(Locale.ROOT, "Version: %s, Build: %s/%s/%s, JVM: %s", Build.CURRENT.getQualifiedVersion(), Build.CURRENT.type().displayName(), Build.CURRENT.hash(), Build.CURRENT.date(), JvmInfo.jvmInfo().version());<NEW_LINE>terminal.println(versionOutput);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final boolean daemonize = options.has(daemonizeOption);<NEW_LINE>final Path pidFile = pidfileOption.value(options);<NEW_LINE>final boolean quiet = options.has(quietOption);<NEW_LINE>// a misconfigured java.io.tmpdir can cause hard-to-diagnose problems later, so reject it immediately<NEW_LINE>try {<NEW_LINE>env.validateTmpFile();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UserException(ExitCodes.CONFIG, e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>init(<MASK><NEW_LINE>} catch (NodeValidationException e) {<NEW_LINE>throw new UserException(ExitCodes.CONFIG, e.getMessage());<NEW_LINE>}<NEW_LINE>} | daemonize, pidFile, quiet, env); |
1,099,574 | protected void addSlots() {<NEW_LINE>int xoff = 0, x = 0, y = 0;<NEW_LINE>EntityEquipmentSlot last = null;<NEW_LINE>for (int i = 0; i < getItemHandler().getSlots(); i++) {<NEW_LINE>EntityEquipmentSlot current = getItemHandler().getHandlerFromSlot(i).getEquipmentSlot();<NEW_LINE>if (current != last) {<NEW_LINE>xoff = (9 - StorageUpgrade.cols(current)) / 2;<NEW_LINE>x = 0;<NEW_LINE>y = 0;<NEW_LINE>last = current;<NEW_LINE>}<NEW_LINE>addSlotToContainer(new BaseSlotItemHandler(getItemHandler(), i, X0 + 18 * (x + xoff), Y0 + 18 * y) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isEnabled() {<NEW_LINE>return activeTab == ((EIOCombinedInvWrapper<StorageCap>) getItemHandler()).getHandlerFromSlot(<MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean isItemValid(@Nonnull ItemStack stack) {<NEW_LINE>// stops shift-clicking items in. at least while activeTab is in sync between client and server<NEW_LINE>return isEnabled() && super.isItemValid(stack);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>x++;<NEW_LINE>if (x >= StorageUpgrade.cols(current)) {<NEW_LINE>x = 0;<NEW_LINE>y++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getSlotIndex()).getEquipmentSlot(); |
6,979 | final GetVpnConnectionDeviceSampleConfigurationResult executeGetVpnConnectionDeviceSampleConfiguration(GetVpnConnectionDeviceSampleConfigurationRequest getVpnConnectionDeviceSampleConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getVpnConnectionDeviceSampleConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetVpnConnectionDeviceSampleConfigurationRequest> request = null;<NEW_LINE>Response<GetVpnConnectionDeviceSampleConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetVpnConnectionDeviceSampleConfigurationRequestMarshaller().marshall(super.beforeMarshalling(getVpnConnectionDeviceSampleConfigurationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetVpnConnectionDeviceSampleConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetVpnConnectionDeviceSampleConfigurationResult> responseHandler = new StaxResponseHandler<GetVpnConnectionDeviceSampleConfigurationResult>(new GetVpnConnectionDeviceSampleConfigurationResultStaxUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
653,853 | private void createDispatcherCallingInitCtors() {<NEW_LINE>MethodMember[] ctors = typeDescriptor.getConstructors();<NEW_LINE>for (MethodMember ctor : ctors) {<NEW_LINE>String desc = ctor.getDescriptor();<NEW_LINE>MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "___init___", desc, null, null);<NEW_LINE>mv.visitFieldInsn(GETSTATIC, slashedname, fReloadableTypeFieldName, lReloadableType);<NEW_LINE>mv.visitInsn(ICONST_1);<NEW_LINE>mv.visitMethodInsn(INVOKEVIRTUAL, tReloadableType, "getLatestDispatcherInstance", "(Z)Ljava/lang/Object;");<NEW_LINE>mv.visitTypeInsn(CHECKCAST, Utils.getInterfaceName(slashedname));<NEW_LINE>String desc2 = new StringBuffer("(L").append(slashedname).append(";").append(desc.substring(1)).toString();<NEW_LINE><MASK><NEW_LINE>Utils.createLoadsBasedOnDescriptor(mv, desc, 1);<NEW_LINE>mv.visitMethodInsn(INVOKEINTERFACE, Utils.getInterfaceName(slashedname), "___init___", desc2);<NEW_LINE>mv.visitInsn(RETURN);<NEW_LINE>mv.visitMaxs(3, Utils.getParameterCount(desc) + 1);<NEW_LINE>mv.visitEnd();<NEW_LINE>}<NEW_LINE>} | mv.visitVarInsn(ALOAD, 0); |
611,204 | // Suppress unclosed resource warning<NEW_LINE>@SuppressWarnings("squid:S2095")<NEW_LINE>@Override<NEW_LINE>public SyncStatus checkDataDigest(String digestOfSender) {<NEW_LINE>String digestOfReceiver = (new BigInteger(1, messageDigest.get().digest())).toString(16);<NEW_LINE>try {<NEW_LINE>if (currentFileWriter.get() != null) {<NEW_LINE>currentFileWriter.get().close();<NEW_LINE>}<NEW_LINE>if (!digestOfSender.equals(digestOfReceiver)) {<NEW_LINE>currentFile.get().delete();<NEW_LINE>currentFileWriter.set(new FileOutputStream<MASK><NEW_LINE>return getErrorResult(String.format("Digest of the sender is differ from digest of the receiver of the file %s.", currentFile.get().getAbsolutePath()));<NEW_LINE>} else {<NEW_LINE>if (currentFile.get().getName().endsWith(MetadataConstant.METADATA_LOG)) {<NEW_LINE>loadMetadata();<NEW_LINE>} else {<NEW_LINE>if (!currentFile.get().getName().endsWith(TsFileResource.RESOURCE_SUFFIX)) {<NEW_LINE>logger.info("Receiver has received {} successfully.", currentFile.get());<NEW_LINE>FileLoaderManager.getInstance().checkAndUpdateDeviceOwner(new TsFileResource(new File(currentFile.get() + TsFileResource.RESOURCE_SUFFIX)));<NEW_LINE>syncLog.get().finishSyncTsfile(currentFile.get());<NEW_LINE>FileLoaderManager.getInstance().getFileLoader(senderName.get()).addTsfile(currentFile.get());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error("Can not check data digest for file {}", currentFile.get().getAbsoluteFile(), e);<NEW_LINE>return getErrorResult(String.format("Can not check data digest for file %s because %s", currentFile.get().getName(), e.getMessage()));<NEW_LINE>} catch (SyncDeviceOwnerConflictException e) {<NEW_LINE>logger.error("Device owner has conflicts, skip all other tsfiles in the sg {}.", currentSG.get());<NEW_LINE>return new SyncStatus(SyncConstant.CONFLICT_CODE, String.format("Device owner has conflicts, skip all other tsfiles in the same sg %s because %s", currentSG.get(), e.getMessage()));<NEW_LINE>}<NEW_LINE>return new SyncStatus(SyncConstant.SUCCESS_CODE, digestOfReceiver);<NEW_LINE>} | (currentFile.get())); |
436,273 | public boolean process(@Nonnull VirtualFile file, IntList list) {<NEW_LINE>for (int i = 0, len = list.size(); i < len; i += 2) {<NEW_LINE>ProgressManager.checkCanceled();<NEW_LINE>if (list.get(i + 1) != myHash2)<NEW_LINE>continue;<NEW_LINE>int <MASK><NEW_LINE>if (myFileIndex.isInSourceContent(virtualFile)) {<NEW_LINE>if (!myFileIndex.isInSourceContent(file))<NEW_LINE>return true;<NEW_LINE>if (!TestSourcesFilter.isTestSources(virtualFile, project) && TestSourcesFilter.isTestSources(file, project))<NEW_LINE>return true;<NEW_LINE>if (mySkipGeneratedCode) {<NEW_LINE>if (!myFileWithinGeneratedCode && GeneratedSourcesFilter.isGeneratedSourceByAnyFilter(file, project))<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} else if (myFileIndex.isInSourceContent(file)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>final int startOffset = getStartOffset(myNode);<NEW_LINE>final int endOffset = getEndOffset(myNode);<NEW_LINE>if (file.equals(virtualFile) && offset >= startOffset && offset < endOffset)<NEW_LINE>continue;<NEW_LINE>PsiElement target = getPsi(myNode);<NEW_LINE>TextRange rangeInElement = getRangeInElement(myNode);<NEW_LINE>Integer fragmentStartOffsetInteger = startOffset;<NEW_LINE>SortedMap<Integer, TextRange> map = reportedRanges.subMap(fragmentStartOffsetInteger, endOffset);<NEW_LINE>int newFragmentSize = !map.isEmpty() ? 0 : 1;<NEW_LINE>Iterator<Integer> iterator = map.keySet().iterator();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Integer next = iterator.next();<NEW_LINE>iterator.remove();<NEW_LINE>reportedFiles.remove(next);<NEW_LINE>reportedOffsetInOtherFiles.remove(next);<NEW_LINE>reportedPsi.remove(next);<NEW_LINE>newFragmentSize += fragmentSize.remove(next);<NEW_LINE>}<NEW_LINE>reportedRanges.put(fragmentStartOffsetInteger, rangeInElement);<NEW_LINE>reportedFiles.put(fragmentStartOffsetInteger, file);<NEW_LINE>reportedOffsetInOtherFiles.put(fragmentStartOffsetInteger, offset);<NEW_LINE>reportedPsi.put(fragmentStartOffsetInteger, target);<NEW_LINE>fragmentSize.put(fragmentStartOffsetInteger, newFragmentSize);<NEW_LINE>if (newFragmentSize >= MIN_FRAGMENT_SIZE || isLightProfile()) {<NEW_LINE>fragmentHash.put(fragmentStartOffsetInteger, (myHash & 0xFFFFFFFFL) | ((long) myHash2 << 32));<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | offset = list.get(i); |
138,692 | public Description matchCompilationUnit(CompilationUnitTree tree, VisitorState state) {<NEW_LINE>if (!ASTHelpers.getGeneratedBy(state).isEmpty()) {<NEW_LINE>return NO_MATCH;<NEW_LINE>}<NEW_LINE>ImmutableRangeSet<Long> linesWithComments = linesWithComments(state);<NEW_LINE>new SuppressibleTreePathScanner<Void, Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void visitAnnotation(AnnotationTree annotationTree, Void unused) {<NEW_LINE>if (!SUPPRESS_WARNINGS.matches(annotationTree, state)) {<NEW_LINE>return super.visitAnnotation(annotationTree, null);<NEW_LINE>}<NEW_LINE>LineMap lineMap = state.getPath().getCompilationUnit().getLineMap();<NEW_LINE>Tree parent = getCurrentPath().getParentPath().getLeaf();<NEW_LINE>// Expand by +/- one to accept comments either before or after the suppression.<NEW_LINE>Range<Long> linesCovered = Range.closed(lineMap.getLineNumber(getStartPosition(parent)) - 1, lineMap.getLineNumber(state.<MASK><NEW_LINE>if (!linesWithComments.intersects(linesCovered)) {<NEW_LINE>state.reportMatch(describeMatch(annotationTree, emitDummyFixes ? SuggestedFix.postfixWith(annotationTree, " // Safe because...") : SuggestedFix.emptyFix()));<NEW_LINE>}<NEW_LINE>return super.visitAnnotation(annotationTree, null);<NEW_LINE>}<NEW_LINE>}.scan(tree, null);<NEW_LINE>return NO_MATCH;<NEW_LINE>} | getEndPosition(parent)) + 1); |
776,477 | public static DescribeCrossRegionLogBackupFilesResponse unmarshall(DescribeCrossRegionLogBackupFilesResponse describeCrossRegionLogBackupFilesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeCrossRegionLogBackupFilesResponse.setRequestId(_ctx.stringValue("DescribeCrossRegionLogBackupFilesResponse.RequestId"));<NEW_LINE>describeCrossRegionLogBackupFilesResponse.setRegionId(_ctx.stringValue("DescribeCrossRegionLogBackupFilesResponse.RegionId"));<NEW_LINE>describeCrossRegionLogBackupFilesResponse.setDBInstanceId(_ctx.stringValue("DescribeCrossRegionLogBackupFilesResponse.DBInstanceId"));<NEW_LINE>describeCrossRegionLogBackupFilesResponse.setStartTime(_ctx.stringValue("DescribeCrossRegionLogBackupFilesResponse.StartTime"));<NEW_LINE>describeCrossRegionLogBackupFilesResponse.setEndTime(_ctx.stringValue("DescribeCrossRegionLogBackupFilesResponse.EndTime"));<NEW_LINE>describeCrossRegionLogBackupFilesResponse.setTotalRecordCount(_ctx.integerValue("DescribeCrossRegionLogBackupFilesResponse.TotalRecordCount"));<NEW_LINE>describeCrossRegionLogBackupFilesResponse.setPageRecordCount(_ctx.integerValue("DescribeCrossRegionLogBackupFilesResponse.PageRecordCount"));<NEW_LINE>describeCrossRegionLogBackupFilesResponse.setPageNumber(_ctx.integerValue("DescribeCrossRegionLogBackupFilesResponse.PageNumber"));<NEW_LINE>List<Item> items = new ArrayList<Item>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeCrossRegionLogBackupFilesResponse.Items.Length"); i++) {<NEW_LINE>Item item = new Item();<NEW_LINE>item.setCrossLogBackupId(_ctx.integerValue("DescribeCrossRegionLogBackupFilesResponse.Items[" + i + "].CrossLogBackupId"));<NEW_LINE>item.setCrossBackupRegion(_ctx.stringValue<MASK><NEW_LINE>item.setCrossLogBackupSize(_ctx.longValue("DescribeCrossRegionLogBackupFilesResponse.Items[" + i + "].CrossLogBackupSize"));<NEW_LINE>item.setLogBeginTime(_ctx.stringValue("DescribeCrossRegionLogBackupFilesResponse.Items[" + i + "].LogBeginTime"));<NEW_LINE>item.setLogEndTime(_ctx.stringValue("DescribeCrossRegionLogBackupFilesResponse.Items[" + i + "].LogEndTime"));<NEW_LINE>item.setCrossDownloadLink(_ctx.stringValue("DescribeCrossRegionLogBackupFilesResponse.Items[" + i + "].CrossDownloadLink"));<NEW_LINE>item.setCrossIntranetDownloadLink(_ctx.stringValue("DescribeCrossRegionLogBackupFilesResponse.Items[" + i + "].CrossIntranetDownloadLink"));<NEW_LINE>item.setLinkExpiredTime(_ctx.stringValue("DescribeCrossRegionLogBackupFilesResponse.Items[" + i + "].LinkExpiredTime"));<NEW_LINE>item.setLogFileName(_ctx.stringValue("DescribeCrossRegionLogBackupFilesResponse.Items[" + i + "].LogFileName"));<NEW_LINE>item.setInstanceId(_ctx.integerValue("DescribeCrossRegionLogBackupFilesResponse.Items[" + i + "].InstanceId"));<NEW_LINE>items.add(item);<NEW_LINE>}<NEW_LINE>describeCrossRegionLogBackupFilesResponse.setItems(items);<NEW_LINE>return describeCrossRegionLogBackupFilesResponse;<NEW_LINE>} | ("DescribeCrossRegionLogBackupFilesResponse.Items[" + i + "].CrossBackupRegion")); |
91,135 | // endregion private helpers<NEW_LINE>// region converting map to bundle<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>static Bundle mapToBundle(Map<String, Object> map) {<NEW_LINE>Bundle bundle = new Bundle();<NEW_LINE>for (Map.Entry<String, Object> entry : map.entrySet()) {<NEW_LINE>Object value = entry.getValue();<NEW_LINE>String key = entry.getKey();<NEW_LINE>if (value instanceof Double) {<NEW_LINE>bundle.putDouble(key, (Double) value);<NEW_LINE>} else if (value instanceof Integer) {<NEW_LINE>bundle.putInt(key, (Integer) value);<NEW_LINE>} else if (value instanceof String) {<NEW_LINE>bundle.putString(key, (String) value);<NEW_LINE>} else if (value instanceof Boolean) {<NEW_LINE>bundle.putBoolean(key, (Boolean) value);<NEW_LINE>} else if (value instanceof List) {<NEW_LINE>List<Object> list <MASK><NEW_LINE>Object first = list.get(0);<NEW_LINE>if (first == null || first instanceof Double) {<NEW_LINE>bundle.putDoubleArray(key, listToDoubleArray(list));<NEW_LINE>} else if (first instanceof Integer) {<NEW_LINE>bundle.putIntArray(key, listToIntArray(list));<NEW_LINE>} else if (first instanceof String) {<NEW_LINE>bundle.putStringArray(key, listToStringArray(list));<NEW_LINE>} else if (first instanceof Map) {<NEW_LINE>bundle.putParcelableArrayList(key, listToParcelableArrayList(list));<NEW_LINE>}<NEW_LINE>} else if (value instanceof Map) {<NEW_LINE>bundle.putBundle(key, mapToBundle((Map<String, Object>) value));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return bundle;<NEW_LINE>} | = (List<Object>) value; |
835,466 | private void createSky() {<NEW_LINE>Texture west = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_west.jpg");<NEW_LINE>Texture east = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_east.jpg");<NEW_LINE>Texture north = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_north.jpg");<NEW_LINE>Texture south = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_south.jpg");<NEW_LINE>Texture up = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_up.jpg");<NEW_LINE>Texture down = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_down.jpg");<NEW_LINE>Spatial sky = SkyFactory.createSky(assetManager, west, east, <MASK><NEW_LINE>rootNode.attachChild(sky);<NEW_LINE>} | north, south, up, down); |
1,345,347 | public static void dexoatAndDisableInline(String dexFilePath, String oatFilePath) throws IOException {<NEW_LINE>final File oatFile = new File(oatFilePath);<NEW_LINE>if (!oatFile.exists()) {<NEW_LINE>oatFile.getParentFile().mkdirs();<NEW_LINE>}<NEW_LINE>final List<String> commandAndParams = new ArrayList<>();<NEW_LINE>commandAndParams.add("dex2oat");<NEW_LINE>// for 7.1.1, duplicate class fix<NEW_LINE>if (SandHookConfig.SDK_INT >= 24) {<NEW_LINE>commandAndParams.add("--runtime-arg");<NEW_LINE>commandAndParams.add("-classpath");<NEW_LINE>commandAndParams.add("--runtime-arg");<NEW_LINE>commandAndParams.add("&");<NEW_LINE>}<NEW_LINE>commandAndParams.add("--dex-file=" + dexFilePath);<NEW_LINE>commandAndParams.add("--oat-file=" + oatFilePath);<NEW_LINE>commandAndParams.add("--instruction-set=" + (SandHook.is64Bit() ? "arm64" : "arm"));<NEW_LINE>commandAndParams.add("--compiler-filter=everything");<NEW_LINE>if (SandHookConfig.SDK_INT >= 22 && SandHookConfig.SDK_INT < 29) {<NEW_LINE>commandAndParams.add("--compile-pic");<NEW_LINE>}<NEW_LINE>if (SandHookConfig.SDK_INT > 25) {<NEW_LINE>commandAndParams.add("--inline-max-code-units=0");<NEW_LINE>} else {<NEW_LINE>if (Build.VERSION.SDK_INT >= 23) {<NEW_LINE>commandAndParams.add("--inline-depth-limit=0");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final ProcessBuilder pb = new ProcessBuilder(commandAndParams);<NEW_LINE>pb.redirectErrorStream(true);<NEW_LINE>final Process dex2oatProcess = pb.start();<NEW_LINE>StreamConsumer.<MASK><NEW_LINE>StreamConsumer.consumeInputStream(dex2oatProcess.getErrorStream());<NEW_LINE>try {<NEW_LINE>final int ret = dex2oatProcess.waitFor();<NEW_LINE>if (ret != 0) {<NEW_LINE>throw new IOException("dex2oat works unsuccessfully, exit code: " + ret);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>throw new IOException("dex2oat is interrupted, msg: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | consumeInputStream(dex2oatProcess.getInputStream()); |
691,247 | private static void decode9(DataInput in, long[] tmp, long[] longs) throws IOException {<NEW_LINE>in.readLongs(tmp, 0, 18);<NEW_LINE>shiftLongs(tmp, 18, longs, 0, 7, MASK16_9);<NEW_LINE>for (int iter = 0, tmpIdx = 0, longsIdx = 18; iter < 2; ++iter, tmpIdx += 9, longsIdx += 7) {<NEW_LINE>long l0 = (tmp[tmpIdx + 0] & MASK16_7) << 2;<NEW_LINE>l0 |= (tmp[tmpIdx + 1] >>> 5) & MASK16_2;<NEW_LINE>longs[longsIdx + 0] = l0;<NEW_LINE>long l1 = (tmp[tmpIdx + 1] & MASK16_5) << 4;<NEW_LINE>l1 |= (tmp[tmpIdx + 2] >>> 3) & MASK16_4;<NEW_LINE>longs[longsIdx + 1] = l1;<NEW_LINE>long l2 = (tmp[tmpIdx + 2] & MASK16_3) << 6;<NEW_LINE>l2 |= (tmp[tmpIdx + 3] >>> 1) & MASK16_6;<NEW_LINE>longs[longsIdx + 2] = l2;<NEW_LINE>long l3 = (tmp[tmpIdx + 3] & MASK16_1) << 8;<NEW_LINE>l3 |= (tmp[tmpIdx + 4] & MASK16_7) << 1;<NEW_LINE>l3 |= (tmp[tmpIdx + 5] >>> 6) & MASK16_1;<NEW_LINE>longs[longsIdx + 3] = l3;<NEW_LINE>long l4 = (tmp[tmpIdx <MASK><NEW_LINE>l4 |= (tmp[tmpIdx + 6] >>> 4) & MASK16_3;<NEW_LINE>longs[longsIdx + 4] = l4;<NEW_LINE>long l5 = (tmp[tmpIdx + 6] & MASK16_4) << 5;<NEW_LINE>l5 |= (tmp[tmpIdx + 7] >>> 2) & MASK16_5;<NEW_LINE>longs[longsIdx + 5] = l5;<NEW_LINE>long l6 = (tmp[tmpIdx + 7] & MASK16_2) << 7;<NEW_LINE>l6 |= (tmp[tmpIdx + 8] & MASK16_7) << 0;<NEW_LINE>longs[longsIdx + 6] = l6;<NEW_LINE>}<NEW_LINE>} | + 5] & MASK16_6) << 3; |
756,839 | public void sendMessageToAllEdges(Vertex<OID_T, VDATA_T, EDATA_T> vertex, OUT_MSG_T message) {<NEW_LINE>VertexImpl<OID_T, VDATA_T, EDATA_T> vertexImpl = (VertexImpl<OID_T, VDATA_T, EDATA_T>) vertex;<NEW_LINE>long lid = vertexImpl.getLocalId();<NEW_LINE>long <MASK><NEW_LINE>long oeBeginOffset = JavaRuntime.getLong(offsetBeginPtrFirstAddr + offset * 8);<NEW_LINE>long oeEndOffset = JavaRuntime.getLong(offsetEndPtrFirstAddr + offset * 8);<NEW_LINE>long curAddress = nbrUnitInitAddress + nbrUnitEleSize * oeBeginOffset;<NEW_LINE>long endAddress = nbrUnitInitAddress + nbrUnitEleSize * oeEndOffset;<NEW_LINE>while (curAddress < endAddress) {<NEW_LINE>nbrUnit.setAddress(curAddress);<NEW_LINE>grapeVertex.SetValue((GS_VID_T) nbrUnit.vid());<NEW_LINE>sendMessage(grapeVertex, message);<NEW_LINE>curAddress += nbrUnitEleSize;<NEW_LINE>}<NEW_LINE>// send msg through outgoing adjlist<NEW_LINE>// AdjList<GS_VID_T, ?> adaptorAdjList = fragment.getOutgoingAdjList(grapeVertex);<NEW_LINE>//<NEW_LINE>// for (NbrBase<GS_VID_T, ?> nbr : adaptorAdjList.nbrBases()) {<NEW_LINE>// com.alibaba.graphscope.ds.Vertex<GS_VID_T> curVertex = nbr.neighbor();<NEW_LINE>// sendMessage(curVertex, message);<NEW_LINE>// }<NEW_LINE>} | offset = idParser.getOffset(lid); |
861,644 | public ListMilestonesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListMilestonesResult listMilestonesResult = new ListMilestonesResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listMilestonesResult;<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("WorkloadId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listMilestonesResult.setWorkloadId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("MilestoneSummaries", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listMilestonesResult.setMilestoneSummaries(new ListUnmarshaller<MilestoneSummary>(MilestoneSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listMilestonesResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listMilestonesResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,499,608 | public void purchaseOrderProcess(Invoice invoice) throws AxelorException {<NEW_LINE>PurchaseOrder invoicePurchaseOrder = invoice.getPurchaseOrder();<NEW_LINE>if (invoicePurchaseOrder != null) {<NEW_LINE>log.debug("Update the invoiced amount of the purchase order : {}", invoicePurchaseOrder.getPurchaseOrderSeq());<NEW_LINE>invoicePurchaseOrder.setAmountInvoiced(purchaseOrderInvoiceService.getInvoicedAmount(invoicePurchaseOrder, invoice.getId(), true));<NEW_LINE>} else {<NEW_LINE>// Get all different purchaseOrders from invoice<NEW_LINE>List<PurchaseOrder> purchaseOrderList = Lists.newArrayList();<NEW_LINE>;<NEW_LINE>for (InvoiceLine invoiceLine : invoice.getInvoiceLineList()) {<NEW_LINE>PurchaseOrder purchaseOrder = this.purchaseOrderLineProcess(invoice, invoiceLine);<NEW_LINE>if (purchaseOrder != null && !purchaseOrderList.contains(purchaseOrder)) {<NEW_LINE>purchaseOrderList.add(purchaseOrder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (PurchaseOrder purchaseOrder : purchaseOrderList) {<NEW_LINE>log.debug("Update the invoiced amount of the purchase order : {}", purchaseOrder.getPurchaseOrderSeq());<NEW_LINE>purchaseOrder.setAmountInvoiced(purchaseOrderInvoiceService.getInvoicedAmount(purchaseOrder, invoice<MASK><NEW_LINE>purchaseOrderRepository.save(purchaseOrder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getId(), true)); |
275,291 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(source.getControllerId());<NEW_LINE>if (player == null || player.getHand().count(StaticFilters.FILTER_CARD_CREATURE, game) < 1 || !player.chooseUse(Outcome.PutCardInPlay, "Put a creature card " + "from your hand onto the battlefield?", source, game)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>TargetCardInHand target = new TargetCardInHand(StaticFilters.FILTER_CARD_CREATURE);<NEW_LINE>player.choose(Outcome.PutCreatureInPlay, player.getHand(), target, game);<NEW_LINE>Card card = game.<MASK><NEW_LINE>if (card == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>player.moveCards(card, Zone.BATTLEFIELD, source, game);<NEW_LINE>Permanent creature = game.getPermanent(card.getId());<NEW_LINE>if (creature == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>game.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn).setTargetPointer(new FixedTarget(creature, game)), source);<NEW_LINE>game.addDelayedTriggeredAbility(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new ShiftyDoppelgangerReturnEffect(creature, source, game)), source);<NEW_LINE>return true;<NEW_LINE>} | getCard(target.getFirstTarget()); |
102,312 | void listTimeSeriesReduce() throws IOException {<NEW_LINE>// [START monitoring_read_timeseries_reduce]<NEW_LINE>MetricServiceClient metricServiceClient = MetricServiceClient.create();<NEW_LINE>String projectId = System.getProperty("projectId");<NEW_LINE>ProjectName <MASK><NEW_LINE>// Restrict time to last 20 minutes<NEW_LINE>long startMillis = System.currentTimeMillis() - ((60 * 20) * 1000);<NEW_LINE>TimeInterval interval = TimeInterval.newBuilder().setStartTime(Timestamps.fromMillis(startMillis)).setEndTime(Timestamps.fromMillis(System.currentTimeMillis())).build();<NEW_LINE>Aggregation aggregation = Aggregation.newBuilder().setAlignmentPeriod(Duration.newBuilder().setSeconds(600).build()).setPerSeriesAligner(Aggregation.Aligner.ALIGN_MEAN).setCrossSeriesReducer(Aggregation.Reducer.REDUCE_MEAN).build();<NEW_LINE>ListTimeSeriesRequest.Builder requestBuilder = ListTimeSeriesRequest.newBuilder().setName(name.toString()).setFilter("metric.type=\"compute.googleapis.com/instance/cpu/utilization\"").setInterval(interval).setAggregation(aggregation);<NEW_LINE>ListTimeSeriesRequest request = requestBuilder.build();<NEW_LINE>ListTimeSeriesPagedResponse response = metricServiceClient.listTimeSeries(request);<NEW_LINE>System.out.println("Got timeseries: ");<NEW_LINE>for (TimeSeries ts : response.iterateAll()) {<NEW_LINE>System.out.println(ts);<NEW_LINE>}<NEW_LINE>// [END monitoring_read_timeseries_reduce]<NEW_LINE>} | name = ProjectName.of(projectId); |
459,103 | public JPanel buildOverviewPanel(HttpTestRequestStep testStep) {<NEW_LINE>HttpTestRequestInterface<?> request = testStep.getTestRequest();<NEW_LINE>JPropertiesTable<HttpTestRequestInterface<?>> table = new JPropertiesTable<HttpTestRequestInterface<?>>("HTTP TestRequest Properties");<NEW_LINE>// basic properties<NEW_LINE>table.addProperty("Name", "name", true);<NEW_LINE>table.addProperty("Description", "description", true);<NEW_LINE>// table.addProperty( "Message Size", "contentLength", false );<NEW_LINE>table.addProperty("Encoding", "encoding", new String[] <MASK><NEW_LINE>table.addProperty("Endpoint", "endpoint", true);<NEW_LINE>table.addProperty("Timeout", "timeout", true);<NEW_LINE>table.addProperty("Bind Address", "bindAddress", true);<NEW_LINE>table.addProperty("Follow Redirects", "followRedirects", JPropertiesTable.BOOLEAN_OPTIONS);<NEW_LINE>// security / authentication<NEW_LINE>table.addProperty("Username", "username", true);<NEW_LINE>table.addPropertyShadow("Password", "password", true);<NEW_LINE>table.addProperty("Domain", "domain", true);<NEW_LINE>table.addProperty("Authentication Type", "authType", new String[] { AuthType.GLOBAL_HTTP_SETTINGS.toString(), AuthType.PREEMPTIVE.toString(), AuthType.SPNEGO_KERBEROS.toString(), AuthType.NTLM.toString() });<NEW_LINE>StringList keystores = new StringList(((WsdlProject) request.getTestStep().getTestCase().getTestSuite().getProject()).getWssContainer().getCryptoNames());<NEW_LINE>keystores.add("");<NEW_LINE>table.addProperty("SSL Keystore", "sslKeystore", keystores.toStringArray());<NEW_LINE>table.addProperty("Strip whitespaces", "stripWhitespaces", JPropertiesTable.BOOLEAN_OPTIONS);<NEW_LINE>table.addProperty("Remove Empty Content", "removeEmptyContent", JPropertiesTable.BOOLEAN_OPTIONS);<NEW_LINE>table.addProperty("Entitize Properties", "entitizeProperties", JPropertiesTable.BOOLEAN_OPTIONS);<NEW_LINE>table.addProperty("Multi-Value Delimiter", "multiValueDelimiter", true);<NEW_LINE>// post-processing<NEW_LINE>table.addProperty("Pretty Print", "prettyPrint", JPropertiesTable.BOOLEAN_OPTIONS);<NEW_LINE>table.addProperty("Dump File", "dumpFile", true).setDescription("Dumps response message to specified file");<NEW_LINE>table.addProperty("Max Size", "maxSize", true).setDescription("The maximum number of bytes to receive");<NEW_LINE>table.addProperty("Discard Response", "discardResponse", JPropertiesTable.BOOLEAN_OPTIONS);<NEW_LINE>table.addProperty("Send Empty Parameters", "sendEmptyParameters", JPropertiesTable.BOOLEAN_OPTIONS);<NEW_LINE>table.setPropertyObject(request);<NEW_LINE>return table;<NEW_LINE>} | { null, "UTF-8", "iso-8859-1" }); |
1,369,057 | // ~ Methods ----------------------------------------------------------------<NEW_LINE>public void onMatch(RelOptRuleCall call) {<NEW_LINE>final Intersect intersect = call.rel(0);<NEW_LINE>if (intersect.all) {<NEW_LINE>// nothing we can do<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final RelOptCluster cluster = intersect.getCluster();<NEW_LINE>final RexBuilder rexBuilder = cluster.getRexBuilder();<NEW_LINE>final RelBuilder relBuilder = call.builder();<NEW_LINE>// 1st level GB: create a GB (col0, col1, count() as c) for each branch<NEW_LINE>for (RelNode input : intersect.getInputs()) {<NEW_LINE>relBuilder.push(input);<NEW_LINE>relBuilder.aggregate(relBuilder.groupKey(relBuilder.fields())<MASK><NEW_LINE>}<NEW_LINE>// create a union above all the branches<NEW_LINE>final int branchCount = intersect.getInputs().size();<NEW_LINE>relBuilder.union(true, branchCount);<NEW_LINE>final RelNode union = relBuilder.peek();<NEW_LINE>// 2nd level GB: create a GB (col0, col1, count(c)) for each branch<NEW_LINE>// the index of c is union.getRowType().getFieldList().size() - 1<NEW_LINE>final int fieldCount = union.getRowType().getFieldCount();<NEW_LINE>final ImmutableBitSet groupSet = ImmutableBitSet.range(fieldCount - 1);<NEW_LINE>relBuilder.aggregate(relBuilder.groupKey(groupSet), relBuilder.countStar(null));<NEW_LINE>// add a filter count(c) = #branches<NEW_LINE>relBuilder.filter(relBuilder.equals(relBuilder.field(fieldCount - 1), rexBuilder.makeBigintLiteral(new BigDecimal(branchCount))));<NEW_LINE>// Project all but the last field<NEW_LINE>relBuilder.project(Util.skipLast(relBuilder.fields()));<NEW_LINE>// the schema for intersect distinct is like this<NEW_LINE>// R3 on all attributes + count(c) as cnt<NEW_LINE>// finally add a project to project out the last column<NEW_LINE>call.transformTo(relBuilder.build());<NEW_LINE>} | , relBuilder.countStar(null)); |
69,874 | private // Also write out what sort of message we think we have (first).<NEW_LINE>void dumpJmfMessage(IncidentStream is, JMFMessage jmfMsg, Object msg) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "dumpJmfMessage");<NEW_LINE>if (msg != null) {<NEW_LINE>is.writeLine("Message is of class: ", msg.getClass().getName());<NEW_LINE>}<NEW_LINE>if (jmfMsg != null) {<NEW_LINE>try {<NEW_LINE>String buffer = JSFormatter.format(jmfMsg);<NEW_LINE>is.writeLine("JMF message", buffer);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// No FFDC code needed - we are FFDCing!<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>SibTr.debug(tc, "dumpJmfMessage failed: " + e);<NEW_LINE>}<NEW_LINE>} else<NEW_LINE><MASK><NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "dumpJmfMessage");<NEW_LINE>} | is.writeLine("No JMF message available", ""); |
791,499 | private void generateRSS1(final CreativeCommons module, final Element element) {<NEW_LINE>// throw new RuntimeException( "Generating RSS1 Feeds not currently Supported.");<NEW_LINE>LOG.debug(element.getName());<NEW_LINE>if (element.getName().equals("channel")) {<NEW_LINE>// Do all licenses list.<NEW_LINE>final License[] all = module.getAllLicenses();<NEW_LINE>for (final License element2 : all) {<NEW_LINE>final Element license = new Element("License", RSS1);<NEW_LINE>license.setAttribute("about", element2.getValue(), RDF);<NEW_LINE>final License.Behaviour[] permits = element2.getPermits();<NEW_LINE>for (int j = 0; permits != null && j < permits.length; j++) {<NEW_LINE>final Element permit = new Element("permits", RSS1);<NEW_LINE>permit.setAttribute("resource", permits[j].toString(), RDF);<NEW_LINE>license.addContent(permit);<NEW_LINE>}<NEW_LINE>final License.Behaviour[] requires = element2.getPermits();<NEW_LINE>for (int j = 0; requires != null && j < requires.length; j++) {<NEW_LINE>final Element permit = new Element("requires", RSS1);<NEW_LINE>permit.setAttribute("resource", permits[j].toString(), RDF);<NEW_LINE>license.addContent(permit);<NEW_LINE>}<NEW_LINE>LOG.debug("Is Root? {}", element.getParentElement());<NEW_LINE>element.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Do local licenses<NEW_LINE>final License[] licenses = module.getLicenses();<NEW_LINE>for (final License license2 : licenses) {<NEW_LINE>final Element license = new Element("license", RSS1);<NEW_LINE>license.setAttribute("resource", license2.getValue(), RDF);<NEW_LINE>element.addContent(license);<NEW_LINE>}<NEW_LINE>} | getParentElement().addContent(license); |
1,506,389 | final SetLoadBalancerListenerSSLCertificateResult executeSetLoadBalancerListenerSSLCertificate(SetLoadBalancerListenerSSLCertificateRequest setLoadBalancerListenerSSLCertificateRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(setLoadBalancerListenerSSLCertificateRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SetLoadBalancerListenerSSLCertificateRequest> request = null;<NEW_LINE>Response<SetLoadBalancerListenerSSLCertificateResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new SetLoadBalancerListenerSSLCertificateRequestMarshaller().marshall(super.beforeMarshalling(setLoadBalancerListenerSSLCertificateRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Elastic Load Balancing");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SetLoadBalancerListenerSSLCertificate");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<SetLoadBalancerListenerSSLCertificateResult> responseHandler = new StaxResponseHandler<SetLoadBalancerListenerSSLCertificateResult>(new SetLoadBalancerListenerSSLCertificateResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
952,373 | public void onDataReceived(@NonNull final BluetoothDevice device, @NonNull final Data data) {<NEW_LINE>super.onDataReceived(device, data);<NEW_LINE>if (data.size() < 1) {<NEW_LINE>onInvalidDataReceived(device, data);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Decode the new data<NEW_LINE>int offset = 0;<NEW_LINE>final int flags = data.getByte(offset);<NEW_LINE>offset += 1;<NEW_LINE>final boolean wheelRevPresent = (flags & 0x01) != 0;<NEW_LINE>final boolean crankRevPreset = (flags & 0x02) != 0;<NEW_LINE>if (data.size() < 1 + (wheelRevPresent ? 6 : 0) + (crankRevPreset ? 4 : 0)) {<NEW_LINE>onInvalidDataReceived(device, data);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (wheelRevPresent) {<NEW_LINE>final long wheelRevolutions = data.getIntValue(<MASK><NEW_LINE>offset += 4;<NEW_LINE>// 1/1024 s<NEW_LINE>final int lastWheelEventTime = data.getIntValue(Data.FORMAT_UINT16_LE, offset);<NEW_LINE>offset += 2;<NEW_LINE>if (mInitialWheelRevolutions < 0)<NEW_LINE>mInitialWheelRevolutions = wheelRevolutions;<NEW_LINE>// Notify listener about the new measurement<NEW_LINE>onWheelMeasurementReceived(device, wheelRevolutions, lastWheelEventTime);<NEW_LINE>}<NEW_LINE>if (crankRevPreset) {<NEW_LINE>final int crankRevolutions = data.getIntValue(Data.FORMAT_UINT16_LE, offset);<NEW_LINE>offset += 2;<NEW_LINE>final int lastCrankEventTime = data.getIntValue(Data.FORMAT_UINT16_LE, offset);<NEW_LINE>// offset += 2;<NEW_LINE>// Notify listener about the new measurement<NEW_LINE>onCrankMeasurementReceived(device, crankRevolutions, lastCrankEventTime);<NEW_LINE>}<NEW_LINE>} | Data.FORMAT_UINT32_LE, offset) & 0xFFFFFFFFL; |
629,574 | public AuthenticatedClientSessionModel createClientSession(RealmModel realm, ClientModel client, UserSessionModel userSession) {<NEW_LINE>MapAuthenticatedClientSessionEntity entity = new MapAuthenticatedClientSessionEntity(null, userSession.getId(), realm.getId(), client.getId(), false);<NEW_LINE>entity.getNotes().put(AuthenticatedClientSessionModel.STARTED_AT_NOTE, String.valueOf(entity.getTimestamp()));<NEW_LINE>setClientSessionExpiration(entity, realm, client);<NEW_LINE>LOG.tracef("createClientSession(%s, %s, %s)%s", realm, client, userSession, getShortStackTrace());<NEW_LINE><MASK><NEW_LINE>MapUserSessionEntity userSessionEntity = getUserSessionById(userSession.getId());<NEW_LINE>if (userSessionEntity == null) {<NEW_LINE>throw new IllegalStateException("User session entity does not exist: " + userSession.getId());<NEW_LINE>}<NEW_LINE>userSessionEntity.addAuthenticatedClientSession(client.getId(), entity.getId());<NEW_LINE>return clientEntityToAdapterFunc(realm, client, userSession).apply(entity);<NEW_LINE>} | entity = clientSessionTx.create(entity); |
926,361 | final UpdateStudioSessionMappingResult executeUpdateStudioSessionMapping(UpdateStudioSessionMappingRequest updateStudioSessionMappingRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateStudioSessionMappingRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<UpdateStudioSessionMappingRequest> request = null;<NEW_LINE>Response<UpdateStudioSessionMappingResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateStudioSessionMappingRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateStudioSessionMappingRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "EMR");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateStudioSessionMapping");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateStudioSessionMappingResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateStudioSessionMappingResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
959,143 | protected void encodeMarkup(FacesContext context, InputMask inputMask) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String clientId = inputMask.getClientId(context);<NEW_LINE>String styleClass = createStyleClass(inputMask, InputMask.STYLE_CLASS);<NEW_LINE>writer.startElement("input", null);<NEW_LINE>writer.writeAttribute("id", clientId, null);<NEW_LINE>writer.writeAttribute("name", clientId, null);<NEW_LINE>writer.writeAttribute("type", <MASK><NEW_LINE>String valueToRender = ComponentUtils.getValueToRender(context, inputMask);<NEW_LINE>if (valueToRender != null) {<NEW_LINE>writer.writeAttribute("value", valueToRender, null);<NEW_LINE>}<NEW_LINE>renderAccessibilityAttributes(context, inputMask);<NEW_LINE>renderPassThruAttributes(context, inputMask, HTML.INPUT_TEXT_ATTRS_WITHOUT_EVENTS);<NEW_LINE>renderDomEvents(context, inputMask, HTML.INPUT_TEXT_EVENTS);<NEW_LINE>if (inputMask.getStyle() != null) {<NEW_LINE>writer.writeAttribute("style", inputMask.getStyle(), "style");<NEW_LINE>}<NEW_LINE>writer.writeAttribute("class", styleClass, "styleClass");<NEW_LINE>renderValidationMetadata(context, inputMask);<NEW_LINE>writer.endElement("input");<NEW_LINE>} | inputMask.getType(), "text"); |
287,117 | private void doOpenHelper(String filename) {<NEW_LINE>File file = new File(filename);<NEW_LINE>if (!file.exists()) {<NEW_LINE>Notifier.getInstance().showError(filename + " does not exist");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Config.getInstance().setOpenFileHome(file.getAbsoluteFile().getParent());<NEW_LINE>DiagramHandler handler = getDiagramHandlerForFile(filename);<NEW_LINE>if (handler != null) {<NEW_LINE>// File is already opened -> jump to the tab<NEW_LINE>CurrentGui.getInstance().<MASK><NEW_LINE>Notifier.getInstance().showInfo("switched to " + filename);<NEW_LINE>} else {<NEW_LINE>if (lastTabIsEmpty()) {<NEW_LINE>// if only the new tab is visible, close it (because the newly opened diagram replaces the empty new one)<NEW_LINE>diagrams.get(diagrams.size() - 1).doClose();<NEW_LINE>}<NEW_LINE>// must be set to null here, otherwise the change listener of the property panel will change element text to help_text of diagram (see google code Issue 174)<NEW_LINE>editedGridElement = null;<NEW_LINE>DiagramHandler diagram = new DiagramHandler(file);<NEW_LINE>diagrams.add(diagram);<NEW_LINE>CurrentGui.getInstance().getGui().open(diagram);<NEW_LINE>if (diagrams.size() == 1) {<NEW_LINE>setPropertyPanelToGridElement(null);<NEW_LINE>}<NEW_LINE>RecentlyUsedFilesList.getInstance().add(filename);<NEW_LINE>Notifier.getInstance().showInfo(filename + " opened");<NEW_LINE>}<NEW_LINE>} | getGui().jumpTo(handler); |
710,910 | private void internalRegionCompareAndPutAll(final Region region, final List<CASEntry> subEntries, final CompletableFuture<Boolean> future, final int retriesLeft, final Errors lastCause) {<NEW_LINE>final RegionEngine regionEngine = getRegionEngine(region.getId(), true);<NEW_LINE>final RetryRunner retryRunner = retryCause -> internalRegionCompareAndPutAll(region, subEntries, future, retriesLeft - 1, retryCause);<NEW_LINE>final FailoverClosure<Boolean> closure = new FailoverClosureImpl<>(future, false, retriesLeft, retryRunner);<NEW_LINE>if (regionEngine != null) {<NEW_LINE>if (ensureOnValidEpoch(region, regionEngine, closure)) {<NEW_LINE>final RawKVStore rawKVStore = getRawKVStore(regionEngine);<NEW_LINE>if (this.kvDispatcher == null) {<NEW_LINE>rawKVStore.compareAndPutAll(subEntries, closure);<NEW_LINE>} else {<NEW_LINE>this.kvDispatcher.execute(() -> rawKVStore.compareAndPutAll(subEntries, closure));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final CASAllRequest request = new CASAllRequest();<NEW_LINE>request.setCasEntries(subEntries);<NEW_LINE>request.<MASK><NEW_LINE>request.setRegionEpoch(region.getRegionEpoch());<NEW_LINE>this.rheaKVRpcService.callAsyncWithRpc(request, closure, lastCause);<NEW_LINE>}<NEW_LINE>} | setRegionId(region.getId()); |
937,358 | private void bondAction(JSONArray args, CallbackContext callbackContext) {<NEW_LINE>if (!isBondReceiverRegistered) {<NEW_LINE>cordova.getActivity().registerReceiver(mBondReceiver, new IntentFilter(BluetoothDevice.ACTION_BOND_STATE_CHANGED));<NEW_LINE>isBondReceiverRegistered = true;<NEW_LINE>}<NEW_LINE>if (isNotInitialized(callbackContext, true)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JSONObject obj = getArgsObject(args);<NEW_LINE>if (isNotArgsObject(obj, callbackContext)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String address = getAddress(obj);<NEW_LINE>if (isNotAddress(address, callbackContext)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BluetoothDevice device = bluetoothAdapter.getRemoteDevice(address);<NEW_LINE>if (device == null) {<NEW_LINE>JSONObject returnObj = new JSONObject();<NEW_LINE>addProperty(returnObj, keyError, errorBond);<NEW_LINE>addProperty(returnObj, keyMessage, logNoDevice);<NEW_LINE>addProperty(returnObj, keyAddress, address);<NEW_LINE>callbackContext.error(returnObj);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CallbackContext checkCallback = (CallbackContext) bonds.get(address);<NEW_LINE>if (checkCallback != null) {<NEW_LINE>JSONObject returnObj = new JSONObject();<NEW_LINE>addDevice(returnObj, device);<NEW_LINE>addProperty(returnObj, keyError, errorBond);<NEW_LINE>addProperty(returnObj, keyMessage, logBonding);<NEW_LINE>callbackContext.error(returnObj);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int bondState = device.getBondState();<NEW_LINE>if (bondState == BluetoothDevice.BOND_BONDED || bondState == BluetoothDevice.BOND_BONDING) {<NEW_LINE>JSONObject returnObj = new JSONObject();<NEW_LINE>addDevice(returnObj, device);<NEW_LINE>addProperty(returnObj, keyError, errorBond);<NEW_LINE>addProperty(returnObj, keyMessage, bondState == BluetoothDevice.BOND_BONDED ? logBonded : logBonding);<NEW_LINE>callbackContext.error(returnObj);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>bonds.put(address, callbackContext);<NEW_LINE>boolean result = device.createBond();<NEW_LINE>if (!result) {<NEW_LINE>JSONObject returnObj = new JSONObject();<NEW_LINE>addDevice(returnObj, device);<NEW_LINE><MASK><NEW_LINE>addProperty(returnObj, keyMessage, logBondFail);<NEW_LINE>callbackContext.error(returnObj);<NEW_LINE>bonds.remove(address);<NEW_LINE>}<NEW_LINE>} | addProperty(returnObj, keyError, errorBond); |
897,986 | public boolean updateAlarm(SonosAlarm alarm) {<NEW_LINE>if (alarm != null && isConfigured()) {<NEW_LINE>Service service = device.findService(new UDAServiceId("AlarmClock"));<NEW_LINE>Action action = service.getAction("ListAlarms");<NEW_LINE>ActionInvocation invocation = new ActionInvocation(action);<NEW_LINE>DateTimeFormatter formatter = DateTimeFormat.forPattern("HH:mm:ss");<NEW_LINE>PeriodFormatter pFormatter = new PeriodFormatterBuilder().printZeroAlways().appendHours().appendSeparator(":").appendMinutes().appendSeparator(":").appendSeconds().toFormatter();<NEW_LINE>try {<NEW_LINE>invocation.setInput("ID", Integer.toString<MASK><NEW_LINE>invocation.setInput("StartLocalTime", formatter.print(alarm.getStartTime()));<NEW_LINE>invocation.setInput("Duration", pFormatter.print(alarm.getDuration()));<NEW_LINE>invocation.setInput("Recurrence", alarm.getRecurrence());<NEW_LINE>invocation.setInput("RoomUUID", alarm.getRoomUUID());<NEW_LINE>invocation.setInput("ProgramURI", alarm.getProgramURI());<NEW_LINE>invocation.setInput("ProgramMetaData", alarm.getProgramMetaData());<NEW_LINE>invocation.setInput("PlayMode", alarm.getPlayMode());<NEW_LINE>invocation.setInput("Volume", Integer.toString(alarm.getVolume()));<NEW_LINE>if (alarm.getIncludeLinkedZones()) {<NEW_LINE>invocation.setInput("IncludeLinkedZones", "1");<NEW_LINE>} else {<NEW_LINE>invocation.setInput("IncludeLinkedZones", "0");<NEW_LINE>}<NEW_LINE>if (alarm.getEnabled()) {<NEW_LINE>invocation.setInput("Enabled", "1");<NEW_LINE>} else {<NEW_LINE>invocation.setInput("Enabled", "0");<NEW_LINE>}<NEW_LINE>} catch (InvalidValueException ex) {<NEW_LINE>logger.error("Action Invalid Value Exception {}", ex.getMessage());<NEW_LINE>} catch (NumberFormatException ex) {<NEW_LINE>logger.error("Action Invalid Value Format Exception {}", ex.getMessage());<NEW_LINE>}<NEW_LINE>executeActionInvocation(invocation);<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | (alarm.getID())); |
1,326,254 | private ArrayList<MatOfPoint> findContours(Mat src) {<NEW_LINE>Mat grayImage = null;<NEW_LINE>Mat cannedImage = null;<NEW_LINE>Mat resizedImage = null;<NEW_LINE>double ratio = src.size().height / 500;<NEW_LINE>int height = Double.valueOf(src.size().height / ratio).intValue();<NEW_LINE>int width = Double.valueOf(src.size().width / ratio).intValue();<NEW_LINE>Size size <MASK><NEW_LINE>resizedImage = new Mat(size, CvType.CV_8UC4);<NEW_LINE>grayImage = new Mat(size, CvType.CV_8UC4);<NEW_LINE>cannedImage = new Mat(size, CvType.CV_8UC1);<NEW_LINE>Imgproc.resize(src, resizedImage, size);<NEW_LINE>Imgproc.cvtColor(resizedImage, grayImage, Imgproc.COLOR_RGBA2GRAY, 4);<NEW_LINE>Imgproc.GaussianBlur(grayImage, grayImage, new Size(5, 5), 0);<NEW_LINE>Imgproc.Canny(grayImage, cannedImage, 75, 200);<NEW_LINE>ArrayList<MatOfPoint> contours = new ArrayList<MatOfPoint>();<NEW_LINE>Mat hierarchy = new Mat();<NEW_LINE>Imgproc.findContours(cannedImage, contours, hierarchy, Imgproc.RETR_LIST, Imgproc.CHAIN_APPROX_SIMPLE);<NEW_LINE>hierarchy.release();<NEW_LINE>Collections.sort(contours, (lhs, rhs) -> Double.valueOf(Imgproc.contourArea(rhs)).compareTo(Imgproc.contourArea(lhs)));<NEW_LINE>resizedImage.release();<NEW_LINE>grayImage.release();<NEW_LINE>cannedImage.release();<NEW_LINE>return contours;<NEW_LINE>} | = new Size(width, height); |
1,566,237 | public static void dexpatchUpdate(Context context, UpdateInfo updateInfo, File patchFile, final IDexpatchMonitor coldMonitor, boolean enableHot, IDexpatchMonitor hotMonitor) throws Exception {<NEW_LINE>if (null == updateInfo || !updateInfo.dexPatch) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String versionName = null;<NEW_LINE>try {<NEW_LINE>Context c = RuntimeVariables.androidApplication;<NEW_LINE>versionName = c.getPackageManager().getPackageInfo(c.getPackageName(), 0).versionName;<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>if (TextUtils.isEmpty(versionName) || !versionName.equals(updateInfo.baseVersion)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (enableHot) {<NEW_LINE>List<UpdateInfo.Item> needPatchHotBundles = DexPatchUpdater.filterNeedHotPatchList(UpdateBundleDivider.dividePatchInfo(updateInfo.updateBundles, Item.PATCH_DEX_HOT));<NEW_LINE>DexPatchUpdater.installHotPatch(updateInfo.updateVersion, needPatchHotBundles, patchFile, hotMonitor);<NEW_LINE>}<NEW_LINE>updateInfo.updateBundles = DexPatchUpdater.filterNeedColdPatchList(UpdateBundleDivider.dividePatchInfo(updateInfo.updateBundles, Item.PATCH_DEX_COLD));<NEW_LINE>DexPatchUpdater.<MASK><NEW_LINE>} | installColdPatch(updateInfo, patchFile, coldMonitor); |
942,097 | private PixelReader parseMetaData(int bytesOfKeyValueData, DataInput in) throws IOException {<NEW_LINE>PixelReader pixelReader = null;<NEW_LINE>for (int i = 0; i < bytesOfKeyValueData; ) {<NEW_LINE>// reading key values<NEW_LINE>int keyAndValueByteSize = in.readInt();<NEW_LINE>byte[] keyValue = new byte[keyAndValueByteSize];<NEW_LINE>in.readFully(keyValue);<NEW_LINE>// parsing key values<NEW_LINE>String[] kv = new String(keyValue).split("\0");<NEW_LINE>for (int j = 0; j < kv.length; j += 2) {<NEW_LINE>System.err.println("key : " + kv[j]);<NEW_LINE>System.err.println("value : " + kv[j + 1]);<NEW_LINE>if (kv[j].equalsIgnoreCase("KTXorientation")) {<NEW_LINE>if (kv[j + 1].startsWith("S=r,T=d")) {<NEW_LINE>pixelReader = new SrTdRiPixelReader();<NEW_LINE>} else {<NEW_LINE>pixelReader = new SrTuRoPixelReader();<NEW_LINE>}<NEW_LINE>if (kv[j + 1].contains("R=i")) {<NEW_LINE>slicesInside = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// padding<NEW_LINE>int padding = 3 - (<MASK><NEW_LINE>if (padding > 0) {<NEW_LINE>in.skipBytes(padding);<NEW_LINE>}<NEW_LINE>i += 4 + keyAndValueByteSize + padding;<NEW_LINE>}<NEW_LINE>return pixelReader;<NEW_LINE>} | (keyAndValueByteSize + 3) % 4); |
1,052,236 | private void isFoundInDataOrNot(SearchPatternsSequential searchPatterns, boolean positiveSearch) throws Exception {<NEW_LINE>String thisMethod = "isFoundInDataOrNot";<NEW_LINE>boolean searchedOnce = false;<NEW_LINE>String firstSearchedSequenceNum, lastSearchedSequenceNum = "noneSearched";<NEW_LINE>if (positiveSearch) {<NEW_LINE>Log.info(logClass, thisMethod, "====== Verifying that audit log contains all of the expected test patterns in this sequence of patterns:\n" + searchPatterns.toString());<NEW_LINE>} else {<NEW_LINE>Log.info(logClass, thisMethod, "====== Verifying that the audit log does NOT contain any pattern in this sequence of patterns:\n" + searchPatterns.toString());<NEW_LINE>}<NEW_LINE>for (String auditEntry : auditResults.read()) {<NEW_LINE>if (searchPatterns.allMatched())<NEW_LINE>return;<NEW_LINE>//<NEW_LINE>JSONObject jsonRecord = JSONObject.parse(auditEntry);<NEW_LINE>lastSearchedSequenceNum = (jsonRecord.get("eventSequenceNumber") == null ? "none" : jsonRecord.get("eventSequenceNumber").toString());<NEW_LINE>if (!searchedOnce) {<NEW_LINE>searchedOnce = true;<NEW_LINE>firstSearchedSequenceNum = (jsonRecord.get("eventSequenceNumber") == null ? "none" : jsonRecord.get("eventSequenceNumber").toString());<NEW_LINE>Log.info(<MASK><NEW_LINE>}<NEW_LINE>// check for specified searchPattern within JSON audit record<NEW_LINE>if (searchPatterns.matchedCurrent(jsonRecord)) {<NEW_LINE>if (positiveSearch) {<NEW_LINE>Log.info(logClass, thisMethod, "\n Audit Expected: Match should be found for pattern:" + searchPatterns.mostRecentlyMatchedPattern() + "\n Audit Result: Pattern matched in audit log at eventSequenceNumber " + jsonRecord.get("eventSequenceNumber").toString());<NEW_LINE>} else {<NEW_LINE>Log.info(logClass, thisMethod, "\n Audit Expected: No match should be found for pattern, but unexpected match found:" + searchPatterns.mostRecentlyMatchedPattern() + "\n Audit Result: Unexpected pattern match found in audit log at eventSequenceNumber " + jsonRecord.get("eventSequenceNumber").toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Log.info(logClass, thisMethod, "----- Stopped searching audit log at eventSequenceNumber: " + lastSearchedSequenceNum);<NEW_LINE>} | logClass, thisMethod, "----- Started searching audit log at eventSequenceNumber: " + firstSearchedSequenceNum); |
1,001,989 | public int compareTo(archive_args other) {<NEW_LINE>if (!getClass().equals(other.getClass())) {<NEW_LINE>return getClass().getName().compareTo(other.getClass().getName());<NEW_LINE>}<NEW_LINE>int lastComparison = 0;<NEW_LINE>lastComparison = java.lang.Boolean.valueOf(isSetMid()).compareTo(other.isSetMid());<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetMid()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mid, other.mid);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>lastComparison = java.lang.Boolean.valueOf(isSetOffset()).<MASK><NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>if (isSetOffset()) {<NEW_LINE>lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.offset, other.offset);<NEW_LINE>if (lastComparison != 0) {<NEW_LINE>return lastComparison;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>} | compareTo(other.isSetOffset()); |
447,252 | void connectNode(LatticeNodeImpl rNode) {<NEW_LINE>int begin = rNode.begin;<NEW_LINE>// connection matrix needs to be in the current stack frame to elide field<NEW_LINE>// accesses in the hot loop<NEW_LINE>final Connection conn = grammar.getConnection();<NEW_LINE>int leftId = rNode.leftId;<NEW_LINE>// elide some compiler checks by calling this method<NEW_LINE>conn.validate(leftId);<NEW_LINE>// all heavy accessed variables must be on stack<NEW_LINE>// and written to fields only at the end of the function<NEW_LINE>ArrayList<LatticeNodeImpl> endNodes = endLists.get(begin);<NEW_LINE>LatticeNodeImpl bestPrevNode = null;<NEW_LINE>int minLeftCost = Integer.MAX_VALUE;<NEW_LINE>// Using a plain loop decreases the code footprint of this method<NEW_LINE>// Do not use iterator-based for-loop here<NEW_LINE>// noinspection ForLoopReplaceableByForEach<NEW_LINE>for (int i = 0; i < endNodes.size(); ++i) {<NEW_LINE>LatticeNodeImpl lNode = endNodes.get(i);<NEW_LINE>if (!lNode.isConnectedToBOS) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int connectCost = conn.cost(lNode.rightId, leftId);<NEW_LINE>if (connectCost == Grammar.INHIBITED_CONNECTION) {<NEW_LINE>// this connection is not allowed<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int cost = lNode.totalCost + connectCost;<NEW_LINE>if (cost < minLeftCost) {<NEW_LINE>minLeftCost = cost;<NEW_LINE>bestPrevNode = lNode;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rNode.isConnectedToBOS = (bestPrevNode != null);<NEW_LINE>rNode<MASK><NEW_LINE>rNode.bestPreviousNode = bestPrevNode;<NEW_LINE>} | .totalCost = minLeftCost + rNode.cost; |
255,198 | public Container createContainer(MediaFile item) {<NEW_LINE>MusicAlbum container = new MusicAlbum();<NEW_LINE>if (item.isAlbum()) {<NEW_LINE>container.setAlbumArtURIs(new URI[] { getDispatcher().getAlbumProcessor().getAlbumArtURI(item.getId()) });<NEW_LINE>if (item.getArtist() != null) {<NEW_LINE>container.setArtists(getDispatcher().getAlbumProcessor().getAlbumArtists(item.getArtist()));<NEW_LINE>}<NEW_LINE>container.setDescription(item.getComment());<NEW_LINE>}<NEW_LINE>container.setId(DispatchingContentDirectory.CONTAINER_ID_FOLDER_PREFIX + DispatchingContentDirectory.SEPARATOR + item.getId());<NEW_LINE>container.setTitle(item.getName());<NEW_LINE>List<<MASK><NEW_LINE>container.setChildCount(children.size());<NEW_LINE>if (!getMediaFileService().isRoot(item)) {<NEW_LINE>MediaFile parent = getMediaFileService().getParentOf(item);<NEW_LINE>if (parent != null) {<NEW_LINE>container.setParentID(String.valueOf(parent.getId()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>container.setParentID(DispatchingContentDirectory.CONTAINER_ID_FOLDER_PREFIX);<NEW_LINE>}<NEW_LINE>return container;<NEW_LINE>} | MediaFile> children = getChildren(item); |
717,486 | final DescribeEventSubscriptionsResult executeDescribeEventSubscriptions(DescribeEventSubscriptionsRequest describeEventSubscriptionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeEventSubscriptionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeEventSubscriptionsRequest> request = null;<NEW_LINE>Response<DescribeEventSubscriptionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeEventSubscriptionsRequestMarshaller().marshall(super.beforeMarshalling(describeEventSubscriptionsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Redshift");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeEventSubscriptions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeEventSubscriptionsResult> responseHandler = new StaxResponseHandler<<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | DescribeEventSubscriptionsResult>(new DescribeEventSubscriptionsResultStaxUnmarshaller()); |
1,730,212 | public static void appendXmlEscaped(StringBuilder buf, String src, boolean supportUTF8) {<NEW_LINE>char c;<NEW_LINE>int i = 0;<NEW_LINE>while (i < src.length()) {<NEW_LINE>c = src.charAt(i++);<NEW_LINE>if (c > '~') {<NEW_LINE>// 126<NEW_LINE>if (!supportUTF8) {<NEW_LINE>int codepoint = c;<NEW_LINE>// surrogate characters are not allowed in XML<NEW_LINE>if (Character.isHighSurrogate(c)) {<NEW_LINE>char low = src.charAt(i++);<NEW_LINE>codepoint = <MASK><NEW_LINE>}<NEW_LINE>buf.append("&#x").append(Integer.toHexString(codepoint)).append(';');<NEW_LINE>} else {<NEW_LINE>buf.append(c);<NEW_LINE>}<NEW_LINE>} else if (c == '&') {<NEW_LINE>buf.append("&");<NEW_LINE>} else if (c == '"') {<NEW_LINE>buf.append(""");<NEW_LINE>} else if (c == '<') {<NEW_LINE>buf.append("<");<NEW_LINE>} else if (c == '>') {<NEW_LINE>buf.append(">");<NEW_LINE>} else {<NEW_LINE>buf.append(c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Character.toCodePoint(c, low); |
1,318,591 | public boolean visualizationVarStatus(ModStatusVar pchkInput, Command cmd, Item item, EventPublisher eventPublisher) {<NEW_LINE>// We are actually not meant to visualize anything.<NEW_LINE>// But (just in case) someone is really lazy in doing the item-definitions, we try to be helpful by implementing<NEW_LINE>// some ON/OFF logic.<NEW_LINE>LcnDefs.Var var = this.regId == 0 ? LcnDefs.Var.R1VARSETPOINT : LcnDefs.Var.R2VARSETPOINT;<NEW_LINE>if (pchkInput.getLogicalSourceAddr().equals(this.addr) && pchkInput.getVar() == var && item.getAcceptedDataTypes().contains(OnOffType.class)) {<NEW_LINE>State reportedState = pchkInput.getValue().isLockedRegulator() <MASK><NEW_LINE>// Only update if the state we are bound to is equal to the reported one<NEW_LINE>if (cmd == reportedState) {<NEW_LINE>eventPublisher.postUpdate(item.getName(), reportedState);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | ? OnOffType.ON : OnOffType.OFF; |
582,231 | private void readPublicResolversMd(String path, List<String> lines) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>boolean lockServer = false;<NEW_LINE>boolean lockMD = false;<NEW_LINE>boolean lockTOML = false;<NEW_LINE>boolean lockRoutes = false;<NEW_LINE>ArrayList<String> dnsServerNames = new ArrayList<>();<NEW_LINE>ArrayList<String> dnsServerDescr = new ArrayList<>();<NEW_LINE>ArrayList<String> dnsServerSDNS = new ArrayList<>();<NEW_LINE>ArrayList<String> dnscrypt_proxy_toml = new ArrayList<>();<NEW_LINE>ArrayList<String> dnscrypt_servers = new ArrayList<>();<NEW_LINE>ArrayList<DNSServerRelays> <MASK><NEW_LINE>if (lines != null) {<NEW_LINE>for (String line : lines) {<NEW_LINE>if (path.contains("public-resolvers.md")) {<NEW_LINE>lockMD = true;<NEW_LINE>lockTOML = false;<NEW_LINE>}<NEW_LINE>if (path.contains("dnscrypt-proxy.toml")) {<NEW_LINE>lockMD = false;<NEW_LINE>lockTOML = true;<NEW_LINE>}<NEW_LINE>if ((line.contains("##") || lockServer) && lockMD && !line.trim().isEmpty()) {<NEW_LINE>lockServer = fillDNSServersLists(line, dnsServerNames, dnsServerDescr, dnsServerSDNS, sb, lockServer);<NEW_LINE>}<NEW_LINE>if (lockTOML && !line.isEmpty()) {<NEW_LINE>dnscrypt_proxy_toml.add(line);<NEW_LINE>lockRoutes = parseCurrentDNSServersAndRoutes(line, dnscrypt_servers, routes, lockRoutes);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>checkEqualsServerNames(dnsServerNames);<NEW_LINE>openDNSServersFragmentIfDataReady(dnsServerNames, dnsServerDescr, dnsServerSDNS, dnscrypt_proxy_toml, dnscrypt_servers, routes);<NEW_LINE>}<NEW_LINE>} | routes = new ArrayList<>(); |
1,831,588 | public static DescribeProjectAttachmentsResponse unmarshall(DescribeProjectAttachmentsResponse describeProjectAttachmentsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeProjectAttachmentsResponse.setRequestId(_ctx.stringValue("DescribeProjectAttachmentsResponse.RequestId"));<NEW_LINE>describeProjectAttachmentsResponse.setSuccess(_ctx.booleanValue("DescribeProjectAttachmentsResponse.Success"));<NEW_LINE>List<ProjectAttachment> result = new ArrayList<ProjectAttachment>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeProjectAttachmentsResponse.Result.Length"); i++) {<NEW_LINE>ProjectAttachment projectAttachment = new ProjectAttachment();<NEW_LINE>projectAttachment.setFileLinkGmtExpired(_ctx.longValue("DescribeProjectAttachmentsResponse.Result[" + i + "].FileLinkGmtExpired"));<NEW_LINE>projectAttachment.setStepNo(_ctx.integerValue("DescribeProjectAttachmentsResponse.Result[" + i + "].StepNo"));<NEW_LINE>projectAttachment.setAttachmentToken(_ctx.stringValue("DescribeProjectAttachmentsResponse.Result[" + i + "].AttachmentToken"));<NEW_LINE>projectAttachment.setFileName(_ctx.stringValue("DescribeProjectAttachmentsResponse.Result[" + i + "].FileName"));<NEW_LINE>projectAttachment.setOperatorRole(_ctx.stringValue("DescribeProjectAttachmentsResponse.Result[" + i + "].OperatorRole"));<NEW_LINE>projectAttachment.setNodeName(_ctx.stringValue("DescribeProjectAttachmentsResponse.Result[" + i + "].NodeName"));<NEW_LINE>projectAttachment.setOperatorName(_ctx.stringValue("DescribeProjectAttachmentsResponse.Result[" + i + "].OperatorName"));<NEW_LINE>projectAttachment.setFileLink(_ctx.stringValue("DescribeProjectAttachmentsResponse.Result[" + i + "].FileLink"));<NEW_LINE>projectAttachment.setGmtCreate(_ctx.longValue("DescribeProjectAttachmentsResponse.Result[" + i + "].GmtCreate"));<NEW_LINE>projectAttachment.setFileSuffix(_ctx.stringValue("DescribeProjectAttachmentsResponse.Result[" + i + "].FileSuffix"));<NEW_LINE>projectAttachment.setOperator(_ctx.longValue("DescribeProjectAttachmentsResponse.Result[" + i + "].Operator"));<NEW_LINE>projectAttachment.setContent(_ctx.stringValue<MASK><NEW_LINE>projectAttachment.setNodeId(_ctx.longValue("DescribeProjectAttachmentsResponse.Result[" + i + "].NodeId"));<NEW_LINE>projectAttachment.setAttachmentType(_ctx.stringValue("DescribeProjectAttachmentsResponse.Result[" + i + "].AttachmentType"));<NEW_LINE>projectAttachment.setFileSize(_ctx.longValue("DescribeProjectAttachmentsResponse.Result[" + i + "].FileSize"));<NEW_LINE>result.add(projectAttachment);<NEW_LINE>}<NEW_LINE>describeProjectAttachmentsResponse.setResult(result);<NEW_LINE>return describeProjectAttachmentsResponse;<NEW_LINE>} | ("DescribeProjectAttachmentsResponse.Result[" + i + "].Content")); |
1,106,357 | private void authorise(Match curMatch, User webUser, Handler<AsyncResult<Boolean>> handler) {<NEW_LINE>// step 1: match against the raw user, if a AuthZ handler is in the path it could have already<NEW_LINE>// loaded the authorizations<NEW_LINE>if (curMatch.requiredAuthority.match(webUser)) {<NEW_LINE>handler.handle(Future.succeededFuture(true));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (authzProvider == null) {<NEW_LINE>// can't load, there's no provider<NEW_LINE>handler.handle(Future.succeededFuture(false));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// step 2: load authorizations<NEW_LINE>authzProvider.getAuthorizations(webUser, res -> {<NEW_LINE>if (res.succeeded()) {<NEW_LINE>if (curMatch.requiredAuthority.match(webUser)) {<NEW_LINE>handler.handle(Future.succeededFuture(true));<NEW_LINE>} else {<NEW_LINE>handler.handle(Future.succeededFuture(false));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>handler.handle(Future.failedFuture<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | (res.cause())); |
1,517,192 | public SeekableStreamSequenceNumbers<PartitionIdType, SequenceOffsetType> minus(SeekableStreamSequenceNumbers<PartitionIdType, SequenceOffsetType> other) {<NEW_LINE>if (this.getClass() != other.getClass()) {<NEW_LINE>throw new IAE("Expected instance of %s, got %s", this.getClass().getName(), other.getClass().getName());<NEW_LINE>}<NEW_LINE>final SeekableStreamStartSequenceNumbers<PartitionIdType, SequenceOffsetType> otherStart = (SeekableStreamStartSequenceNumbers<PartitionIdType, SequenceOffsetType>) other;<NEW_LINE>if (stream.equals(otherStart.stream)) {<NEW_LINE>// Same stream, remove partitions present in "that" from "this"<NEW_LINE>final Map<PartitionIdType, SequenceOffsetType> <MASK><NEW_LINE>final Set<PartitionIdType> newExclusivePartitions = new HashSet<>();<NEW_LINE>for (Entry<PartitionIdType, SequenceOffsetType> entry : partitionSequenceNumberMap.entrySet()) {<NEW_LINE>if (!otherStart.partitionSequenceNumberMap.containsKey(entry.getKey())) {<NEW_LINE>newMap.put(entry.getKey(), entry.getValue());<NEW_LINE>// A partition is exclusive if it's exclusive in "this" and not in "other"'s partitionSequenceNumberMap<NEW_LINE>if (exclusivePartitions.contains(entry.getKey())) {<NEW_LINE>newExclusivePartitions.add(entry.getKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new SeekableStreamStartSequenceNumbers<>(stream, newMap, newExclusivePartitions);<NEW_LINE>} else {<NEW_LINE>// Different stream, prefer "this".<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>} | newMap = new HashMap<>(); |
229,000 | private MenuItem addElementAction(Menu menu, final EClass type) {<NEW_LINE>final MenuItem item = new MenuItem(menu, SWT.CASCADE);<NEW_LINE>item.setText(ArchiLabelProvider.INSTANCE.getDefaultName(type));<NEW_LINE>item.setImage(ArchiLabelProvider.INSTANCE.getImage(type));<NEW_LINE>// Add arm listener to notify Hints View and also set element if elements first<NEW_LINE>item.addArmListener(new ArmListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetArmed(ArmEvent e) {<NEW_LINE>if (!fSetRelationshipTypeWhenHoveringOnConnectionMenuItem) {<NEW_LINE>// User will hover over element, then connection<NEW_LINE>getFactory().setElementType(type);<NEW_LINE>}<NEW_LINE>ComponentSelectionManager.INSTANCE.fireSelectionEvent(item, type);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>item.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>return item;<NEW_LINE>} | getFactory().setElementType(type); |
799,596 | public IBundleProvider encounterInstanceEverything(HttpServletRequest theServletRequest, IIdType theId, IPrimitiveType<Integer> theCount, IPrimitiveType<Integer> theOffset, DateRangeParam theLastUpdated, SortSpec theSort) {<NEW_LINE>SearchParameterMap paramMap = new SearchParameterMap();<NEW_LINE>if (theCount != null) {<NEW_LINE>paramMap.setCount(theCount.getValue());<NEW_LINE>}<NEW_LINE>if (theOffset != null) {<NEW_LINE>throw new IllegalArgumentException(Msg.code(1107) + "Everything operation does not support offset searching");<NEW_LINE>}<NEW_LINE>// paramMap.setRevIncludes(Collections.singleton(IResource.INCLUDE_ALL.asRecursive()));<NEW_LINE>paramMap.setIncludes(Collections.singleton(IResource<MASK><NEW_LINE>paramMap.setEverythingMode(theId != null ? EverythingModeEnum.ENCOUNTER_INSTANCE : EverythingModeEnum.ENCOUNTER_TYPE);<NEW_LINE>paramMap.setSort(theSort);<NEW_LINE>paramMap.setLastUpdated(theLastUpdated);<NEW_LINE>if (theId != null) {<NEW_LINE>paramMap.add("_id", new StringParam(theId.getIdPart()));<NEW_LINE>}<NEW_LINE>IBundleProvider retVal = search(paramMap);<NEW_LINE>return retVal;<NEW_LINE>} | .INCLUDE_ALL.asRecursive())); |
1,707,091 | final ListAvailableResourceMetricsResult executeListAvailableResourceMetrics(ListAvailableResourceMetricsRequest listAvailableResourceMetricsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listAvailableResourceMetricsRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListAvailableResourceMetricsRequest> request = null;<NEW_LINE>Response<ListAvailableResourceMetricsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListAvailableResourceMetricsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAvailableResourceMetricsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "PI");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAvailableResourceMetrics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListAvailableResourceMetricsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListAvailableResourceMetricsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
825,973 | public static void main(String[] args) throws Exception {<NEW_LINE>Logger.configure(new LoggerConfig());<NEW_LINE>Logger.addOutput(new ConsoleOutput(), LoggerLevel.DEBUG);<NEW_LINE>var server = new NetService().newUDPServer(55555);<NEW_LINE>server.setOnConnected(connection -> {<NEW_LINE>connection.addMessageHandler((conn, message) -> {<NEW_LINE>System.out.println("Server got: " + message);<NEW_LINE>if (message.getName().equals("Bye!!!")) {<NEW_LINE>System.out.println("Stopping now");<NEW_LINE>server.stop();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>var client = new NetService(<MASK><NEW_LINE>client.setOnConnected(connection -> {<NEW_LINE>connection.addMessageHandler((conn, message) -> {<NEW_LINE>System.out.println("Client got: " + message);<NEW_LINE>conn.send(new Bundle("Bye!!!"));<NEW_LINE>client.disconnect();<NEW_LINE>});<NEW_LINE>});<NEW_LINE>new Thread(() -> {<NEW_LINE>try {<NEW_LINE>Thread.sleep(2000);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>System.out.println("Client connecting");<NEW_LINE>client.connectTask().run();<NEW_LINE>}).start();<NEW_LINE>new Thread(() -> {<NEW_LINE>try {<NEW_LINE>Thread.sleep(3000);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>System.out.println("Broadcasting hello");<NEW_LINE>server.broadcast(new Bundle("HELLO!"));<NEW_LINE>}).start();<NEW_LINE>server.startTask().run();<NEW_LINE>} | ).newUDPClient("localhost", 55555); |
1,362,256 | public void draw(PoseStack matrices) {<NEW_LINE>// draw fire<NEW_LINE>int fuel = fuelModule.getFuel();<NEW_LINE>int fuelQuality = fuelModule.getFuelQuality();<NEW_LINE>if (fuel > 0 && fuelQuality > 0) {<NEW_LINE>FIRE.drawScaledYUp(matrices, fireX + screen.leftPos, fireY + screen.topPos, 14 * fuel / fuelQuality);<NEW_LINE>}<NEW_LINE>// draw tank second, it changes the image<NEW_LINE>// store fuel info into a field for other methods, this one updates most often<NEW_LINE>if (!hasFuelSlot) {<NEW_LINE>fuelInfo = fuelModule.getFuelInfo();<NEW_LINE>if (!fuelInfo.isEmpty()) {<NEW_LINE>GuiUtil.renderFluidTank(matrices, screen, fuelInfo.getFluid(), fuelInfo.getTotalAmount(), fuelInfo.getCapacity(), x, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | y, width, height, 100); |
1,731,255 | public void deleteWorkflowTaskByLanguage(final Language language) throws DotDataException {<NEW_LINE>final List<WorkflowTask> tasksToClearFromCache = this.convertListToObjects(new DotConnect().setSQL("SELECT * FROM workflow_task WHERE language_id=?").addParam(language.getId()).loadObjectResults(), WorkflowTask.class);<NEW_LINE>new DotConnect().setSQL("delete from workflow_comment where workflowtask_id in (select id from workflow_task where language_id=?)").addParam(language.getId()).loadResult();<NEW_LINE>new DotConnect().setSQL("delete from workflow_history where workflowtask_id in (select id from workflow_task where language_id=?)").addParam(language.getId()).loadResult();<NEW_LINE>new DotConnect().setSQL("delete from workflowtask_files where workflowtask_id in (select id from workflow_task where language_id=?)").addParam(language.<MASK><NEW_LINE>new DotConnect().setSQL("delete from workflow_task where language_id=?").addParam(language.getId()).loadResult();<NEW_LINE>tasksToClearFromCache.forEach(cache::remove);<NEW_LINE>} | getId()).loadResult(); |
212,497 | private static UnionDataSchema buildUnionDataSchemaByProjection(UnionDataSchema unionDataSchema, DataMap maskMap, Collection<String> nonSchemaFieldsToAllowInProjectionMask) {<NEW_LINE>List<UnionDataSchema.Member> newUnionMembers = new ArrayList<>();<NEW_LINE>StringBuilder errorMessageBuilder = new StringBuilder();<NEW_LINE>// Get the wildcard mask if one is available<NEW_LINE>Object wildcardMask = maskMap.get(FilterConstants.WILDCARD);<NEW_LINE>for (UnionDataSchema.Member member : unionDataSchema.getMembers()) {<NEW_LINE>Object maskValue = maskMap.get(Escaper.escape(member.getUnionMemberKey()));<NEW_LINE>// If a mask is available for this specific member use that, else use the wildcard mask if that is available<NEW_LINE>UnionDataSchema.Member newMember = null;<NEW_LINE>if (maskValue != null) {<NEW_LINE>newMember = new UnionDataSchema.Member(reuseOrBuildDataSchema(member.getType(), maskValue, nonSchemaFieldsToAllowInProjectionMask));<NEW_LINE>} else if (wildcardMask != null) {<NEW_LINE>newMember = new UnionDataSchema.Member(reuseOrBuildDataSchema(member.getType<MASK><NEW_LINE>}<NEW_LINE>if (newMember != null) {<NEW_LINE>if (member.hasAlias()) {<NEW_LINE>newMember.setAlias(member.getAlias(), errorMessageBuilder);<NEW_LINE>}<NEW_LINE>newMember.setDeclaredInline(member.isDeclaredInline());<NEW_LINE>newMember.setDoc(member.getDoc());<NEW_LINE>newMember.setProperties(member.getProperties());<NEW_LINE>newUnionMembers.add(newMember);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>UnionDataSchema newUnionDataSchema = new UnionDataSchema();<NEW_LINE>newUnionDataSchema.setMembers(newUnionMembers, errorMessageBuilder);<NEW_LINE>if (unionDataSchema.getMembers().size() > newUnionMembers.size()) {<NEW_LINE>newUnionDataSchema.setPartialSchema(true);<NEW_LINE>}<NEW_LINE>if (unionDataSchema.getProperties() != null) {<NEW_LINE>newUnionDataSchema.setProperties(unionDataSchema.getProperties());<NEW_LINE>}<NEW_LINE>return newUnionDataSchema;<NEW_LINE>} | (), wildcardMask, nonSchemaFieldsToAllowInProjectionMask)); |
1,587,733 | public static int[] HSLtoRGB(final float h, final float s, final float l, final float alpha) {<NEW_LINE>if (s < 0.0f || s > 100.0f) {<NEW_LINE>Timber.w("Color parameter outside of expected range - Saturation");<NEW_LINE>}<NEW_LINE>if (l < 0.0f || l > 100.0f) {<NEW_LINE>Timber.w("Color parameter outside of expected range - Luminance");<NEW_LINE>}<NEW_LINE>if (alpha < 0.0f || alpha > 1.0f) {<NEW_LINE>Timber.w("Color parameter outside of expected range - Alpha");<NEW_LINE>}<NEW_LINE>// Formula needs all values between 0 - 1.<NEW_LINE>final float hr = (h % 360.0f) / 360f;<NEW_LINE>final float sr = fixRawHSLValue(s, 100f, 1 / 100f);<NEW_LINE>final float lr = fixRawHSLValue(s, 100f, 1 / 100f);<NEW_LINE>final float q = (lr < 0.5) ? lr * (1 + sr) : (lr + sr) - (lr * sr);<NEW_LINE>final float p = 2 * lr - q;<NEW_LINE>final int r = Math.round(Math.max(0, HueToRGB(p, q, hr + (1.0f / 3.0f)) * 256));<NEW_LINE>final int g = Math.round(Math.max(0, HueToRGB(p, <MASK><NEW_LINE>final int b = Math.round(Math.max(0, HueToRGB(p, q, hr - (1.0f / 3.0f)) * 256));<NEW_LINE>return new int[] { r, g, b };<NEW_LINE>} | q, hr) * 256)); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.