idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
937,384
public Comment comment(String text) {<NEW_LINE>comment = new Comment(text);<NEW_LINE>comment.id = TicketModel.getSHA1(date.toString() + author + text);<NEW_LINE>// parse comment looking for ref #n<NEW_LINE>// TODO: Ideally set via settings<NEW_LINE>String x = "(?:ref|task|issue|bug)?[\\s-]*#(\\d+)";<NEW_LINE>try {<NEW_LINE>Pattern p = Pattern.compile(x, Pattern.CASE_INSENSITIVE);<NEW_LINE>Matcher m = p.matcher(text);<NEW_LINE>while (m.find()) {<NEW_LINE>String <MASK><NEW_LINE>long targetTicketId = Long.parseLong(val);<NEW_LINE>if (targetTicketId > 0) {<NEW_LINE>if (pendingLinks == null) {<NEW_LINE>pendingLinks = new ArrayList<TicketLink>();<NEW_LINE>}<NEW_LINE>pendingLinks.add(new TicketLink(targetTicketId, TicketAction.Comment));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Pattern mentions = Pattern.compile(Constants.REGEX_TICKET_MENTION);<NEW_LINE>Matcher m = mentions.matcher(text);<NEW_LINE>while (m.find()) {<NEW_LINE>String username = m.group("user");<NEW_LINE>plusList(Field.mentions, username);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>return comment;<NEW_LINE>}
val = m.group(1);
1,641,898
public static IntLongVector mergeSparseLongVector(IndexGetParam param, List<PartitionGetResult> partResults) {<NEW_LINE>int dim = (int) PSAgentContext.get().getMatrixMetaManager().getMatrixMeta(param.getMatrixId()).getColNum();<NEW_LINE>IntLongVector vector = VFactory.sparseLongVector(dim, param.size());<NEW_LINE>for (PartitionGetResult part : partResults) {<NEW_LINE>PartitionKey partKey = ((IndexPartGetLongResult) part).getPartKey();<NEW_LINE>int[] indexes = param.getPartKeyToIndexesMap().get(partKey);<NEW_LINE>long[] values = ((IndexPartGetLongResult) part).getValues();<NEW_LINE>for (int i = 0; i < indexes.length; i++) {<NEW_LINE>if (i < 10) {<NEW_LINE>LOG.debug("merge index = " + indexes[i] + ", value = " + values[i]);<NEW_LINE>}<NEW_LINE>vector.set(indexes[i], values[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>vector.setMatrixId(param.getMatrixId());<NEW_LINE>vector.<MASK><NEW_LINE>return vector;<NEW_LINE>}
setRowId(param.getRowId());
1,520,431
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>botaoAbrir = new com.alee.laf.button.WebButton();<NEW_LINE>botaoNovoArquivo = new com.alee.laf.button.WebButton();<NEW_LINE>titulo = new javax.swing.JLabel();<NEW_LINE>// NOI18N<NEW_LINE>botaoAbrir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/univali/ps/ui/icones/Dark/pequeno/folder_closed.png")));<NEW_LINE>botaoAbrir.setHideActionText(true);<NEW_LINE>// NOI18N<NEW_LINE>botaoNovoArquivo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/univali/ps/ui/icones/Dark/pequeno/page_white_add.png")));<NEW_LINE>botaoNovoArquivo.setHideActionText(true);<NEW_LINE>setBorder(javax.swing.BorderFactory.createEmptyBorder(3, 3, 3, 3));<NEW_LINE>setFocusable(false);<NEW_LINE>setPreferredSize(new java.awt.Dimension(135, 30));<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>// NOI18N<NEW_LINE>titulo.setFont(new java.awt.Font("Tahoma", 1, 11));<NEW_LINE>titulo.setForeground(new java.awt.Color(62, 62, 62));<NEW_LINE>titulo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);<NEW_LINE>// NOI18N<NEW_LINE>titulo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/br/univali/ps/ui/icones/Portugol/pequeno/light_pix_off.png")));<NEW_LINE>titulo.setText("Portugol Studio");<NEW_LINE>titulo.setBorder(javax.swing.BorderFactory.createEmptyBorder(0<MASK><NEW_LINE>titulo.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);<NEW_LINE>titulo.setMinimumSize(new java.awt.Dimension(100, 16));<NEW_LINE>// NOI18N<NEW_LINE>titulo.setName("labelTitulo");<NEW_LINE>titulo.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.weighty = 1.0;<NEW_LINE>add(titulo, gridBagConstraints);<NEW_LINE>}
, 4, 0, 4));
309,910
public void deleteTopics(final Collection<String> topicsToDelete) {<NEW_LINE>if (topicsToDelete.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final DeleteTopicsResult deleteTopicsResult = adminClient.get().deleteTopics(topicsToDelete);<NEW_LINE>final Map<String, KafkaFuture<Void>> results = deleteTopicsResult.topicNameValues();<NEW_LINE>final List<String> failList = Lists.newArrayList();<NEW_LINE>final List<Pair<String, Throwable>> exceptionList = Lists.newArrayList();<NEW_LINE>for (final Map.Entry<String, KafkaFuture<Void>> entry : results.entrySet()) {<NEW_LINE>try {<NEW_LINE>entry.getValue().get(30, TimeUnit.SECONDS);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>final Throwable <MASK><NEW_LINE>if (rootCause instanceof TopicDeletionDisabledException) {<NEW_LINE>throw new TopicDeletionDisabledException("Topic deletion is disabled. " + "To delete the topic, you must set '" + DELETE_TOPIC_ENABLE + "' to true in " + "the Kafka broker configuration.");<NEW_LINE>} else if (rootCause instanceof TopicAuthorizationException) {<NEW_LINE>throw new KsqlTopicAuthorizationException(AclOperation.DELETE, Collections.singleton(entry.getKey()));<NEW_LINE>} else if (!(rootCause instanceof UnknownTopicOrPartitionException)) {<NEW_LINE>LOG.error(String.format("Could not delete topic '%s'", entry.getKey()), e);<NEW_LINE>failList.add(entry.getKey());<NEW_LINE>exceptionList.add(new Pair<>(entry.getKey(), rootCause));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!failList.isEmpty()) {<NEW_LINE>throw new KafkaDeleteTopicsException("Failed to clean up topics: " + String.join(",", failList), exceptionList);<NEW_LINE>}<NEW_LINE>}
rootCause = ExceptionUtils.getRootCause(e);
1,005,079
private List<NameValueCountPair> groupByStartTimeMonth(Business business, Predicate predicate) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer(<MASK><NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Tuple> cq = cb.createQuery(Tuple.class);<NEW_LINE>Root<ReadCompleted> root = cq.from(ReadCompleted.class);<NEW_LINE>Path<String> pathStartTimeMonth = root.get(ReadCompleted_.startTimeMonth);<NEW_LINE>cq.multiselect(pathStartTimeMonth, cb.count(root)).where(predicate).groupBy(pathStartTimeMonth);<NEW_LINE>List<Tuple> os = em.createQuery(cq).getResultList();<NEW_LINE>List<NameValueCountPair> list = new ArrayList<>();<NEW_LINE>NameValueCountPair pair = null;<NEW_LINE>for (Tuple o : os) {<NEW_LINE>pair = new NameValueCountPair();<NEW_LINE>pair.setName(o.get(pathStartTimeMonth));<NEW_LINE>pair.setValue(o.get(pathStartTimeMonth));<NEW_LINE>pair.setCount(o.get(1, Long.class));<NEW_LINE>list.add(pair);<NEW_LINE>}<NEW_LINE>return list.stream().sorted((o1, o2) -> Objects.toString(o2.getName(), "").compareTo(Objects.toString(o1.getName(), ""))).collect(Collectors.toList());<NEW_LINE>}
).get(ReadCompleted.class);
669,991
public HashMap parse_vorbis_comment(RandomAccessFile fh, PageInfo.PageParser pp, long offset, long payload_len) throws IOException {<NEW_LINE>HashMap tags = new HashMap();<NEW_LINE>long last_byte = offset + payload_len;<NEW_LINE>// skip vendor string in format: [LEN][VENDOR_STRING] -> 4 = LEN = 32bit int<NEW_LINE>offset += 4 + raf2le32(fh, offset);<NEW_LINE>// we can now read the number of comments in this file, we will also<NEW_LINE>// adjust offset to point to the value after this 32bit int<NEW_LINE>int comments = raf2le32(fh, offset);<NEW_LINE>offset += 4;<NEW_LINE>for (; comments > 0; comments--) {<NEW_LINE>int comment_len = raf2le32(fh, offset);<NEW_LINE>offset += 4;<NEW_LINE>// indicates the last byte of this page<NEW_LINE>long can_read = last_byte - offset;<NEW_LINE>// how much data is readable in this page<NEW_LINE>int do_read = (int) (can_read > comment_len ? comment_len : can_read);<NEW_LINE>if (do_read >= 3) {<NEW_LINE>int bsize = (do_read > MAX_COMMENT_SIZE ? MAX_COMMENT_SIZE : do_read);<NEW_LINE>byte[] data = new byte[bsize];<NEW_LINE>fh.seek(offset);<NEW_LINE>fh.read(data);<NEW_LINE>String tag_raw = new String(data);<NEW_LINE>String[] tag_vec = <MASK><NEW_LINE>String tag_key = tag_vec[0].toUpperCase();<NEW_LINE>addTagEntry(tags, tag_key, tag_vec[1]);<NEW_LINE>}<NEW_LINE>// set offset to begin of next tag (OR the end of this page!)<NEW_LINE>offset += do_read;<NEW_LINE>// We hit the end of a stream<NEW_LINE>// this is most likely due to the fact that we cropped do_read to not cross<NEW_LINE>// the page boundary -> we must now calculate the position of the next tag<NEW_LINE>if (offset == last_byte) {<NEW_LINE>// how many bytes we did not read<NEW_LINE>int partial_cruft = comment_len - do_read;<NEW_LINE>while (partial_cruft > 0) {<NEW_LINE>PageInfo pi = pp.parse_stream_page(fh, last_byte);<NEW_LINE>if (pi.header_len < 1 || pi.payload_len < 1)<NEW_LINE>xdie("Data from callback doesnt make much sense");<NEW_LINE>// move position behind page header<NEW_LINE>offset += pi.header_len;<NEW_LINE>// and adjust the last byte to pos + payload_size<NEW_LINE>last_byte = offset + pi.payload_len;<NEW_LINE>if (offset + partial_cruft < last_byte) {<NEW_LINE>// partial data ends in this block: just adjust the ofset<NEW_LINE>offset += partial_cruft;<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>// this page just contains data from the partial tag -> skip to next one<NEW_LINE>offset = last_byte;<NEW_LINE>partial_cruft -= pi.payload_len;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return tags;<NEW_LINE>}
tag_raw.split("=", 2);
1,399,167
private void addDataToTable(Packet packet, int networkType, RowSetLoader rowWriter) {<NEW_LINE>rowWriter.start();<NEW_LINE>typeWriter.setString(packet.getPacketType());<NEW_LINE>timestampWriter.setTimestamp(Instant.ofEpochMilli(packet.getTimestamp()));<NEW_LINE>timestampMicroWriter.setLong(packet.getTimestampMicro());<NEW_LINE>networkWriter.setInt(networkType);<NEW_LINE>srcMacAddressWriter.setString(packet.getEthernetSource());<NEW_LINE>dstMacAddressWriter.setString(packet.getEthernetDestination());<NEW_LINE>String destinationIp = packet.getDestinationIpAddressString();<NEW_LINE>if (destinationIp == null) {<NEW_LINE>dstIPWriter.setNull();<NEW_LINE>} else {<NEW_LINE>dstIPWriter.setString(destinationIp);<NEW_LINE>}<NEW_LINE>String sourceIp = packet.getSourceIpAddressString();<NEW_LINE>if (sourceIp == null) {<NEW_LINE>srcIPWriter.setNull();<NEW_LINE>} else {<NEW_LINE>srcIPWriter.setString(sourceIp);<NEW_LINE>}<NEW_LINE>srcPortWriter.<MASK><NEW_LINE>dstPortWriter.setInt(packet.getDst_port());<NEW_LINE>packetLengthWriter.setInt(packet.getPacketLength());<NEW_LINE>// TCP Only Packet Data<NEW_LINE>tcpSessionWriter.setLong(packet.getSessionHash());<NEW_LINE>tcpSequenceWriter.setInt(packet.getSequenceNumber());<NEW_LINE>tcpAckNumberWriter.setInt(packet.getAckNumber());<NEW_LINE>tcpFlagsWriter.setInt(packet.getFlags());<NEW_LINE>tcpParsedFlagsWriter.setString(packet.getParsedFlags());<NEW_LINE>// TCP Flags<NEW_LINE>tcpNsWriter.setBoolean((packet.getFlags() & 0x100) != 0);<NEW_LINE>tcpCwrWriter.setBoolean((packet.getFlags() & 0x80) != 0);<NEW_LINE>tcpEceWriter.setBoolean((packet.getFlags() & 0x40) != 0);<NEW_LINE>tcpFlagsEceEcnCapableWriter.setBoolean((packet.getFlags() & 0x42) == 0x42);<NEW_LINE>tcpFlagsCongestionWriter.setBoolean((packet.getFlags() & 0x42) == 0x40);<NEW_LINE>tcpUrgWriter.setBoolean((packet.getFlags() & 0x20) != 0);<NEW_LINE>tcpAckWriter.setBoolean((packet.getFlags() & 0x10) != 0);<NEW_LINE>tcpPshWriter.setBoolean((packet.getFlags() & 0x8) != 0);<NEW_LINE>tcpRstWriter.setBoolean((packet.getFlags() & 0x4) != 0);<NEW_LINE>tcpSynWriter.setBoolean((packet.getFlags() & 0x2) != 0);<NEW_LINE>tcpFinWriter.setBoolean((packet.getFlags() & 0x1) != 0);<NEW_LINE>// Note: getData() MUST be called before isCorrupt<NEW_LINE>dataWriter.setString(parseBytesToASCII(packet.getData()));<NEW_LINE>isCorruptWriter.setBoolean(packet.isCorrupt());<NEW_LINE>rowWriter.save();<NEW_LINE>// TODO Parse Data Packet Here:<NEW_LINE>// Description of work in<NEW_LINE>// DRILL-7400: Add Packet Decoders with Interface to Drill<NEW_LINE>}
setInt(packet.getSrc_port());
1,096,359
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException {<NEW_LINE>String username = StringUtils.trimToNull(request.getParameter("u"));<NEW_LINE>String password = decrypt(StringUtils.trimToNull(request.getParameter("p")));<NEW_LINE>String salt = StringUtils.trimToNull(request.getParameter("s"));<NEW_LINE>String token = StringUtils.trimToNull(request.getParameter("t"));<NEW_LINE>String version = StringUtils.trimToNull(request.getParameter("v"));<NEW_LINE>String client = StringUtils.trimToNull(request.getParameter("c"));<NEW_LINE>// The username and credentials parameters are not required if the user<NEW_LINE>// was previously authenticated, for example using Basic Auth.<NEW_LINE>Authentication previousAuth = SecurityContextHolder.getContext().getAuthentication();<NEW_LINE>if (previousAuth != null && previousAuth.isAuthenticated()) {<NEW_LINE>return previousAuth;<NEW_LINE>}<NEW_LINE>boolean passwordOrTokenPresent = password != null || (salt != null && token != null);<NEW_LINE>boolean missingCredentials = <MASK><NEW_LINE>if (missingCredentials || version == null || client == null) {<NEW_LINE>throw new AuthenticationServiceException("", new APIException(ErrorCode.MISSING_PARAMETER));<NEW_LINE>}<NEW_LINE>checkAPIVersion(version);<NEW_LINE>UsernamePasswordAuthenticationToken authRequest = null;<NEW_LINE>if (salt != null && token != null) {<NEW_LINE>authRequest = new UsernameSaltedTokenAuthenticationToken(username, salt, token);<NEW_LINE>} else if (password != null) {<NEW_LINE>authRequest = new UsernamePasswordAuthenticationToken(username, password);<NEW_LINE>}<NEW_LINE>authRequest.setDetails(authenticationDetailsSource.buildDetails(request));<NEW_LINE>return this.getAuthenticationManager().authenticate(authRequest);<NEW_LINE>}
(username == null || !passwordOrTokenPresent);
1,085,761
public void turnSwitch(OnOffValue state) {<NEW_LINE>logger.debug("setSwitchState called on: {}", MDualRelayImpl.class);<NEW_LINE>try {<NEW_LINE>if (state == OnOffValue.OFF) {<NEW_LINE>logger.debug("setSwitchState off");<NEW_LINE>getMbrick().getTinkerforgeDevice().setSelectedState(relayNum, false);<NEW_LINE>} else if (state == OnOffValue.ON) {<NEW_LINE>logger.debug("setSwitchState on");<NEW_LINE>getMbrick().getTinkerforgeDevice().setSelectedState(relayNum, true);<NEW_LINE>} else {<NEW_LINE>logger.error("{} unknown switchstate {}", LoggerConstants.TFMODELUPDATE, state);<NEW_LINE>}<NEW_LINE>setSwitchState(state);<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>TinkerforgeErrorHandler.handleError(this, TinkerforgeErrorHandler.TF_TIMEOUT_EXCEPTION, e);<NEW_LINE>} catch (NotConnectedException e) {<NEW_LINE>TinkerforgeErrorHandler.handleError(<MASK><NEW_LINE>}<NEW_LINE>}
this, TinkerforgeErrorHandler.TF_NOT_CONNECTION_EXCEPTION, e);
247,736
public TrackSourceSettings unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>TrackSourceSettings trackSourceSettings = new TrackSourceSettings();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("trackNumber", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>trackSourceSettings.setTrackNumber(context.getUnmarshaller(Integer.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 trackSourceSettings;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
690,541
protected ShardStats shardOperation(IndicesStatsRequest request, ShardRouting shardRouting) {<NEW_LINE>IndexService indexService = indicesService.indexServiceSafe(shardRouting.shardId().getIndex());<NEW_LINE>IndexShard indexShard = indexService.getShard(shardRouting.shardId().id());<NEW_LINE>// if we don't have the routing entry yet, we need it stats wise, we treat it as if the shard is not ready yet<NEW_LINE>if (indexShard.routingEntry() == null) {<NEW_LINE>throw new ShardNotFoundException(indexShard.shardId());<NEW_LINE>}<NEW_LINE>CommonStatsFlags flags = new CommonStatsFlags().clear();<NEW_LINE>if (request.docs()) {<NEW_LINE>flags.<MASK><NEW_LINE>}<NEW_LINE>if (request.store()) {<NEW_LINE>flags.set(CommonStatsFlags.Flag.Store);<NEW_LINE>}<NEW_LINE>CommitStats commitStats;<NEW_LINE>SeqNoStats seqNoStats;<NEW_LINE>RetentionLeaseStats retentionLeaseStats;<NEW_LINE>try {<NEW_LINE>commitStats = indexShard.commitStats();<NEW_LINE>seqNoStats = indexShard.seqNoStats();<NEW_LINE>retentionLeaseStats = indexShard.getRetentionLeaseStats();<NEW_LINE>} catch (AlreadyClosedException e) {<NEW_LINE>// shard is closed - no stats is fine<NEW_LINE>commitStats = null;<NEW_LINE>seqNoStats = null;<NEW_LINE>retentionLeaseStats = null;<NEW_LINE>}<NEW_LINE>return new ShardStats(indexShard.routingEntry(), indexShard.shardPath(), new CommonStats(indexShard, flags), commitStats, seqNoStats, retentionLeaseStats);<NEW_LINE>}
set(CommonStatsFlags.Flag.Docs);
34,662
public Request<DetectKeyPhrasesRequest> marshall(DetectKeyPhrasesRequest detectKeyPhrasesRequest) {<NEW_LINE>if (detectKeyPhrasesRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(DetectKeyPhrasesRequest)");<NEW_LINE>}<NEW_LINE>Request<DetectKeyPhrasesRequest> request = new DefaultRequest<DetectKeyPhrasesRequest>(detectKeyPhrasesRequest, "AmazonComprehend");<NEW_LINE>String target = "Comprehend_20171127.DetectKeyPhrases";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (detectKeyPhrasesRequest.getText() != null) {<NEW_LINE>String text = detectKeyPhrasesRequest.getText();<NEW_LINE>jsonWriter.name("Text");<NEW_LINE>jsonWriter.value(text);<NEW_LINE>}<NEW_LINE>if (detectKeyPhrasesRequest.getLanguageCode() != null) {<NEW_LINE>String languageCode = detectKeyPhrasesRequest.getLanguageCode();<NEW_LINE>jsonWriter.name("LanguageCode");<NEW_LINE>jsonWriter.value(languageCode);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.<MASK><NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
setContent(new StringInputStream(snippet));
1,511,019
public void connectionClose(@NotNull AbstractService service, String reason) {<NEW_LINE>pauseTime((MySQLResponseService) service);<NEW_LINE>TraceManager.TraceObject traceObject = TraceManager.serviceTrace(service, "get-connection-closed");<NEW_LINE>TraceManager.finishSpan(service, traceObject);<NEW_LINE>if (checkClosedConn((MySQLResponseService) service)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LOGGER.warn(<MASK><NEW_LINE>ErrorPacket errPacket = new ErrorPacket();<NEW_LINE>errPacket.setErrNo(ErrorCode.ER_ABORTING_CONNECTION);<NEW_LINE>reason = "Connection {dbInstance[" + service.getConnection().getHost() + ":" + service.getConnection().getPort() + "],Schema[" + ((MySQLResponseService) service).getConnection().getSchema() + "],threadID[" + ((MySQLResponseService) service).getConnection().getThreadId() + "]} was closed ,reason is [" + reason + "]";<NEW_LINE>errPacket.setMessage(StringUtil.encode(reason, session.getShardingService().getCharset().getResults()));<NEW_LINE>err = errPacket;<NEW_LINE>session.resetMultiStatementStatus();<NEW_LINE>lock.lock();<NEW_LINE>try {<NEW_LINE>session.getSource().setSkipCheck(false);<NEW_LINE>RouteResultsetNode rNode = (RouteResultsetNode) ((MySQLResponseService) service).getAttachment();<NEW_LINE>dnSet.add(rNode.getName());<NEW_LINE>removeNode(rNode.getName());<NEW_LINE>rNode.setLoadDataRrnStatus((byte) 1);<NEW_LINE>session.getTargetMap().remove(rNode);<NEW_LINE>((MySQLResponseService) service).setResponseHandler(null);<NEW_LINE>executeError((MySQLResponseService) service);<NEW_LINE>} finally {<NEW_LINE>lock.unlock();<NEW_LINE>}<NEW_LINE>}
"backend connect " + reason + ", conn info:" + service);
781,293
public Bitmap transform(Bitmap source) {<NEW_LINE>int size = Math.min(source.getWidth(), source.getHeight());<NEW_LINE>int x = (source.getWidth() - size) / 2;<NEW_LINE>int y = (source.getHeight() - size) / 2;<NEW_LINE>Bitmap squaredBitmap = Bitmap.createBitmap(source, <MASK><NEW_LINE>if (!squaredBitmap.equals(source)) {<NEW_LINE>source.recycle();<NEW_LINE>}<NEW_LINE>Bitmap.Config config = source.getConfig() != null ? source.getConfig() : Bitmap.Config.ARGB_8888;<NEW_LINE>Bitmap bitmap = Bitmap.createBitmap(size, size, config);<NEW_LINE>Canvas canvas = new Canvas(bitmap);<NEW_LINE>Paint paint = new Paint();<NEW_LINE>BitmapShader shader = new BitmapShader(squaredBitmap, BitmapShader.TileMode.CLAMP, BitmapShader.TileMode.CLAMP);<NEW_LINE>paint.setShader(shader);<NEW_LINE>paint.setAntiAlias(true);<NEW_LINE>float r = size / 2f;<NEW_LINE>canvas.drawCircle(r, r, r, paint);<NEW_LINE>squaredBitmap.recycle();<NEW_LINE>return bitmap;<NEW_LINE>}
x, y, size, size);
1,299,026
private Identity checkIdentity(Business business, PullResult result, Person person, Unit unit, User user) throws Exception {<NEW_LINE><MASK><NEW_LINE>EntityManager em = emc.get(Identity.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Identity> cq = cb.createQuery(Identity.class);<NEW_LINE>Root<Identity> root = cq.from(Identity.class);<NEW_LINE>Predicate p = cb.equal(root.get(Identity_.person), person.getId());<NEW_LINE>p = cb.and(p, cb.equal(root.get(Identity_.unit), unit.getId()));<NEW_LINE>List<Identity> os = em.createQuery(cq.select(root).where(p)).setMaxResults(1).getResultList();<NEW_LINE>Identity identity = null;<NEW_LINE>if (os.size() == 0) {<NEW_LINE>identity = this.createIdentity(business, result, person, unit, user);<NEW_LINE>} else {<NEW_LINE>identity = os.get(0);<NEW_LINE>if (null != user.getOrderInOrgs()) {<NEW_LINE>Long order = user.getOrderInOrgs().get(unit.getZhengwuDingdingId());<NEW_LINE>if (null != order) {<NEW_LINE>if (!StringUtils.equals(Objects.toString(identity.getOrderNumber(), ""), Objects.toString(order, ""))) {<NEW_LINE>identity = this.updateIdentity(business, result, unit, identity, user);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return identity;<NEW_LINE>}
EntityManagerContainer emc = business.entityManagerContainer();
862,135
public RecommendedList[] joinTransform(RecommendedList thatList, int topN) {<NEW_LINE>int contextIdx = 0;<NEW_LINE>this.elementData.parallelStream().forEach(keyValue -> keyValue = null);<NEW_LINE>thatList.elementData.parallelStream().forEach(keyValue -> keyValue = null);<NEW_LINE>for (Integer key : contextMultimap.keySet()) {<NEW_LINE>int valueIdx = 0;<NEW_LINE>NavigableSet<KeyValue<Integer, Double>> thatValue = thatList.getContextMultimap().get(key);<NEW_LINE>if (thatValue != null) {<NEW_LINE>Iterator<KeyValue<Integer, Double>> contextIte = contextMultimap.get(key).iterator();<NEW_LINE>Iterator<KeyValue<Integer, Double>> thatContextIte = thatValue.iterator();<NEW_LINE>while (contextIte.hasNext() && thatContextIte.hasNext()) {<NEW_LINE>KeyValue<Integer, Double> contextValue = contextIte.next();<NEW_LINE>KeyValue<Integer, Double> thatContextValue = thatContextIte.next();<NEW_LINE>this.addList(new ArrayList<>());<NEW_LINE>thatList.addList(new ArrayList<>());<NEW_LINE>if (topN < 0) {<NEW_LINE>add(contextIdx, valueIdx, contextValue.getValue());<NEW_LINE>thatList.add(contextIdx, valueIdx, thatContextValue.getValue());<NEW_LINE>valueIdx++;<NEW_LINE>} else {<NEW_LINE>if (topN > valueIdx) {<NEW_LINE>add(contextIdx, valueIdx, contextValue.getValue());<NEW_LINE>thatList.add(contextIdx, valueIdx, thatContextValue.getValue());<NEW_LINE>valueIdx++;<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>contextIdx++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new <MASK><NEW_LINE>}
RecommendedList[] { this, thatList };
1,212,613
ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>Business business = new Business(emc);<NEW_LINE>View view = emc.find(id, View.class);<NEW_LINE>if (null == view) {<NEW_LINE>throw new ExceptionViewNotExist(id);<NEW_LINE>}<NEW_LINE>Query query = emc.find(view.getQuery(), Query.class);<NEW_LINE>if (null == query) {<NEW_LINE>throw new ExceptionQueryNotExist(view.getQuery());<NEW_LINE>}<NEW_LINE>if (!effectivePerson.isSecurityManager() && !business.editable(effectivePerson, query)) {<NEW_LINE>throw new ExceptionQueryAccessDenied(effectivePerson.getDistinguishedName(), query.getName());<NEW_LINE>}<NEW_LINE>emc.beginTransaction(View.class);<NEW_LINE>Wi.copier.copy(wi, view);<NEW_LINE>emc.check(view, CheckPersistType.all);<NEW_LINE>emc.commit();<NEW_LINE>CacheManager.notify(View.class);<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.<MASK><NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
setId(view.getId());
1,820,756
public void finishDelete(ConnectorSession session, ConnectorTableHandle tableHandle, Collection<Slice> fragments) {<NEW_LINE>HiveTableHandle handle = (HiveTableHandle) tableHandle;<NEW_LINE>checkArgument(handle.isAcidDelete(), "handle should be a delete handle, but is %s", handle);<NEW_LINE>requireNonNull(fragments, "fragments is null");<NEW_LINE>SchemaTableName tableName = handle.getSchemaTableName();<NEW_LINE>Table table = metastore.getTable(tableName.getSchemaName(), tableName.getTableName()).orElseThrow(() -> new TableNotFoundException(tableName));<NEW_LINE>ensureTableSupportsDelete(table);<NEW_LINE>List<PartitionAndStatementId> partitionAndStatementIds = fragments.stream().map(Slice::getBytes).map(PartitionAndStatementId.CODEC::fromJson).collect(toImmutableList());<NEW_LINE>HdfsContext context = new HdfsContext(session);<NEW_LINE>for (PartitionAndStatementId ps : partitionAndStatementIds) {<NEW_LINE>createOrcAcidVersionFile(context, new Path(ps.getDeleteDeltaDirectory()));<NEW_LINE>}<NEW_LINE>LocationHandle locationHandle = locationService.forExistingTable(metastore, session, table);<NEW_LINE>WriteInfo writeInfo = locationService.getQueryWriteInfo(locationHandle);<NEW_LINE>metastore.finishRowLevelDelete(session, table.getDatabaseName(), table.getTableName(), <MASK><NEW_LINE>}
writeInfo.getWritePath(), partitionAndStatementIds);
1,477,270
public static com.liferay.portal.model.User updateUser(java.lang.String userId, java.lang.String password, java.lang.String firstName, java.lang.String middleName, java.lang.String lastName, java.lang.String nickName, boolean male, java.util.Date birthday, java.lang.String emailAddress, java.lang.String smsId, java.lang.String aimId, java.lang.String icqId, java.lang.String msnId, java.lang.String ymId, java.lang.String favoriteActivity, java.lang.String favoriteBibleVerse, java.lang.String favoriteFood, java.lang.String favoriteMovie, java.lang.String favoriteMusic, java.lang.String languageId, java.lang.String timeZoneId, java.lang.String skinId, boolean dottedSkins, boolean roundedSkins, java.lang.String greeting, java.lang.String resolution, java.lang.String refreshRate, java.lang.String comments) throws com.liferay.portal.PortalException, com.liferay.portal.SystemException {<NEW_LINE>try {<NEW_LINE>UserManager userManager = UserManagerFactory.getManager();<NEW_LINE>return userManager.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>} catch (com.liferay.portal.PortalException pe) {<NEW_LINE>throw pe;<NEW_LINE>} catch (com.liferay.portal.SystemException se) {<NEW_LINE>throw se;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new com.<MASK><NEW_LINE>}<NEW_LINE>}
liferay.portal.SystemException(e);
206,977
public String uploadRecordsToStage(final JdbcDatabase database, final SerializableBuffer recordsData, final String namespace, final String stageName, final String stagingPath) throws IOException {<NEW_LINE>AirbyteSentry.executeWithTracing("UploadRecordsToStage", () -> {<NEW_LINE>final List<Exception> exceptionsThrown = new ArrayList<>();<NEW_LINE>boolean succeeded = false;<NEW_LINE>while (exceptionsThrown.size() < UPLOAD_RETRY_LIMIT && !succeeded) {<NEW_LINE>try {<NEW_LINE>loadDataIntoStage(database, stageName, stagingPath, recordsData);<NEW_LINE>succeeded = true;<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LOGGER.error("Failed to upload records into stage {}", stagingPath, e);<NEW_LINE>exceptionsThrown.add(e);<NEW_LINE>}<NEW_LINE>if (!succeeded) {<NEW_LINE>LOGGER.info("Retrying to upload records into stage {} ({}/{}})", stagingPath, exceptionsThrown.size(), UPLOAD_RETRY_LIMIT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!succeeded) {<NEW_LINE>throw new RuntimeException(String.format("Exceptions thrown while uploading records into stage: %s", Strings.<MASK><NEW_LINE>}<NEW_LINE>}, Map.of("stage", stageName, "path", stagingPath));<NEW_LINE>return recordsData.getFilename();<NEW_LINE>}
join(exceptionsThrown, "\n")));
1,189,724
// Not set as Trivial: We want to trace intern calls.<NEW_LINE>@Override<NEW_LINE>public String intern(String value, boolean doForce) {<NEW_LINE>if (value == null) {<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>if (checkValues) {<NEW_LINE>String vMsgId = validate(value, valueType);<NEW_LINE>if (vMsgId != null) {<NEW_LINE>Tr.warning(tc, vMsgId, getHashText(), value, valueType);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String priorIntern = internMap.get(value);<NEW_LINE>if ((priorIntern != null) || !doForce) {<NEW_LINE>return priorIntern;<NEW_LINE>}<NEW_LINE>priorIntern = value;<NEW_LINE><MASK><NEW_LINE>totalLength += value.length();<NEW_LINE>if ((totalLength - lastReportedLength) > logThreshHold) {<NEW_LINE>lastReportedLength = totalLength;<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, MessageFormat.format("[ {0} ] Total [ {1} ]", hashText, Integer.valueOf(totalLength)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return priorIntern;<NEW_LINE>}
internMap.put(value, value);
1,838,042
private void writeRelationshipGroupExtendedRecord(WritableChannel channel, RelationshipGroupRecord record) throws IOException {<NEW_LINE>byte flags = bitFlags(bitFlag(record.inUse(), Record.IN_USE.byteValue()), bitFlag(record.requiresSecondaryUnit(), Record.REQUIRE_SECONDARY_UNIT), bitFlag(record.hasSecondaryUnitId(), Record.HAS_SECONDARY_UNIT), bitFlag(record.isUseFixedReferences(), Record.USES_FIXED_REFERENCE_FORMAT));<NEW_LINE>channel.put(flags);<NEW_LINE>channel.putShort((short) record.getType());<NEW_LINE>channel.put((byte) (record.getType() >>> Short.SIZE));<NEW_LINE>channel.putLong(record.getNext());<NEW_LINE>channel.<MASK><NEW_LINE>channel.putLong(record.getFirstIn());<NEW_LINE>channel.putLong(record.getFirstLoop());<NEW_LINE>channel.putLong(record.getOwningNode());<NEW_LINE>if (record.hasSecondaryUnitId()) {<NEW_LINE>channel.putLong(record.getSecondaryUnitId());<NEW_LINE>}<NEW_LINE>}
putLong(record.getFirstOut());
992,748
private Violation isFieldImmutable(Optional<Tree> tree, ImmutableSet<String> immutableTyParams, ClassSymbol classSym, ClassType classType, VarSymbol var, ViolationReporter reporter) {<NEW_LINE>if (bugChecker.isSuppressed(var)) {<NEW_LINE>return Violation.absent();<NEW_LINE>}<NEW_LINE>if (!var.getModifiers().contains(Modifier.FINAL) && !ASTHelpers.hasAnnotation(var, LazyInit.class, state)) {<NEW_LINE>Violation info = Violation.of(String.format("'%s' has non-final field '%s'", threadSafety.getPrettyName(classSym), var.getSimpleName()));<NEW_LINE>if (tree.isPresent()) {<NEW_LINE>// If we have a tree to attach diagnostics to, report the error immediately instead of<NEW_LINE>// accumulating the path to the error from the top-level class being checked<NEW_LINE>state.reportMatch(reporter.report(tree.get(), info, SuggestedFixes.addModifiers(tree.get(), <MASK><NEW_LINE>return Violation.absent();<NEW_LINE>}<NEW_LINE>return info;<NEW_LINE>}<NEW_LINE>Type varType = state.getTypes().memberType(classType, var);<NEW_LINE>Violation info = threadSafety.isThreadSafeType(/* allowContainerTypeParameters= */<NEW_LINE>true, immutableTyParams, varType);<NEW_LINE>if (info.isPresent()) {<NEW_LINE>info = info.plus(String.format("'%s' has field '%s' of type '%s'", threadSafety.getPrettyName(classSym), var.getSimpleName(), varType));<NEW_LINE>if (tree.isPresent()) {<NEW_LINE>// If we have a tree to attach diagnostics to, report the error immediately instead of<NEW_LINE>// accumulating the path to the error from the top-level class being checked<NEW_LINE>state.reportMatch(reporter.report(tree.get(), info, Optional.empty()));<NEW_LINE>return Violation.absent();<NEW_LINE>}<NEW_LINE>return info;<NEW_LINE>}<NEW_LINE>return Violation.absent();<NEW_LINE>}
state, Modifier.FINAL)));
662,540
private // lowestAsciiValue]<NEW_LINE>void buildText() {<NEW_LINE>verifyMinAndMaxAsciiValues();<NEW_LINE>text = new int[textLength];<NEW_LINE>int sentinel = 0;<NEW_LINE>// Construct the new text with the shifted values and the sentinels<NEW_LINE>for (int i = 0, k = 0; i < strings.length; i++) {<NEW_LINE>String str = strings[i];<NEW_LINE>for (int j = 0; j < str.length(); j++) {<NEW_LINE>text[k++] = ((int) str.charAt(j)) + shift;<NEW_LINE>if (!(numSentinels <= text[k - 1] && text[k - 1] <= (numSentinels + highestAsciiValue - lowestAsciiValue))) {<NEW_LINE>throw new IllegalStateException(String.format("Unexpected character range. Was: %d, wanted between [%d, %d]", text[k - 1], numSentinels, (numSentinels + highestAsciiValue - lowestAsciiValue)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>text[k++] = sentinel++;<NEW_LINE>if (!(0 <= text[k - 1] && text[k - 1] < numSentinels)) {<NEW_LINE>throw new IllegalStateException(String.format("Unexpected character range. Was: %d, wanted between [%d, %d)", text[k - <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
1], 0, numSentinels));
963,457
public static int run(String[] args) {<NEW_LINE>Args parameters = new Args();<NEW_LINE>JCommander jc = JCommander.newBuilder().addObject(parameters).build();<NEW_LINE>jc.parse(args);<NEW_LINE>if (parameters.help) {<NEW_LINE>jc.usage();<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>File dbDirectory = new File(parameters.databaseDirectory);<NEW_LINE>if (!dbDirectory.exists()) {<NEW_LINE>logger.info("Directory {} does not exist.", parameters.databaseDirectory);<NEW_LINE>return 404;<NEW_LINE>}<NEW_LINE>List<File> files = Arrays.stream(Objects.requireNonNull(dbDirectory.listFiles())).filter(File::isDirectory).collect(Collectors.toList());<NEW_LINE>if (files.isEmpty()) {<NEW_LINE>logger.info("Directory {} does not contain any database.", parameters.databaseDirectory);<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>final long time = System.currentTimeMillis();<NEW_LINE>final List<Future<Boolean>> <MASK><NEW_LINE>final ThreadPoolExecutor executor = new ThreadPoolExecutor(CPUS, 16 * CPUS, 1, TimeUnit.MINUTES, new ArrayBlockingQueue<>(CPUS, true), Executors.defaultThreadFactory(), new ThreadPoolExecutor.CallerRunsPolicy());<NEW_LINE>executor.allowCoreThreadTimeOut(true);<NEW_LINE>files.forEach(f -> res.add(executor.submit(new ArchiveManifest(parameters.databaseDirectory, f.getName(), parameters.maxManifestSize, parameters.maxBatchSize))));<NEW_LINE>int fails = res.size();<NEW_LINE>for (Future<Boolean> re : res) {<NEW_LINE>try {<NEW_LINE>if (Boolean.TRUE.equals(re.get())) {<NEW_LINE>fails--;<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.error("{}", e);<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>logger.error("{}", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>executor.shutdown();<NEW_LINE>logger.info("DatabaseDirectory:{}, maxManifestSize:{}, maxBatchSize:{}," + "database reopen use {} seconds total.", parameters.databaseDirectory, parameters.maxManifestSize, parameters.maxBatchSize, (System.currentTimeMillis() - time) / 1000);<NEW_LINE>if (fails > 0) {<NEW_LINE>logger.error("Failed!!!!!!!!!!!!!!!!!!!!!!!! size:{}", fails);<NEW_LINE>}<NEW_LINE>return fails;<NEW_LINE>}
res = new ArrayList<>();
802,839
public static Expression expandAssignmentExpression(BinaryExpression binaryExpression) {<NEW_LINE>checkArgument(binaryExpression.getOperator() == BinaryOperator.ASSIGN);<NEW_LINE>List<VariableDeclarationFragment> temporaryVariables = new ArrayList<>();<NEW_LINE>Expression newLhs = decomposeLhs(binaryExpression.getLeftOperand(), temporaryVariables);<NEW_LINE>Variable returnedVariable;<NEW_LINE>Expression newRhs = binaryExpression.getRightOperand();<NEW_LINE>if (newLhs instanceof VariableReference) {<NEW_LINE>// No need to introduce a temporary variable for the result since even if the rhs modifies it,<NEW_LINE>// it will be overwritten by the assignment operation itself.<NEW_LINE>returnedVariable = ((VariableReference) newLhs).getTarget();<NEW_LINE>} else {<NEW_LINE>returnedVariable = createTemporaryVariableDeclaration(newLhs.getTypeDescriptor(), "$value", binaryExpression.getRightOperand(), temporaryVariables);<NEW_LINE>newRhs = returnedVariable.createReference();<NEW_LINE>}<NEW_LINE>return constructReturnedExpression(temporaryVariables, BinaryExpression.Builder.asAssignmentTo(newLhs).setRightOperand(newRhs).build(<MASK><NEW_LINE>}
), returnedVariable.createReference());
1,788,513
public PolicyExecutor maxQueueSize(int max) {<NEW_LINE>if (max == -1)<NEW_LINE>max = Integer.MAX_VALUE;<NEW_LINE>else if (max < 1)<NEW_LINE>throw new IllegalArgumentException(Integer.toString(max));<NEW_LINE>int increase;<NEW_LINE>synchronized (configLock) {<NEW_LINE>if (state.get() != State.ACTIVE)<NEW_LINE>throw new IllegalStateException(Tr.formatMessage(tc, "CWWKE1203.config.update.after.shutdown", "maxQueueSize", identifier));<NEW_LINE>increase = max - maxQueueSize;<NEW_LINE>if (increase > 0)<NEW_LINE>maxQueueSizeConstraint.release(increase);<NEW_LINE>else if (increase < 0)<NEW_LINE>maxQueueSizeConstraint.reducePermits(-increase);<NEW_LINE>maxQueueSize = max;<NEW_LINE>}<NEW_LINE>if (increase < 0) {<NEW_LINE>Callback callback = cbQueueSize.get();<NEW_LINE>if (callback != null && maxQueueSizeConstraint.availablePermits() < callback.threshold && cbQueueSize.compareAndSet(callback, null)) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>Tr.debug(this, tc, "callback: queue capacity < " + callback.threshold, callback.runnable);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
globalExecutor.submit(callback.runnable);
1,843,105
private void validateProperKeyArgument(Object data, ASTPrimaryPrefix firstArgumentExpression) {<NEW_LINE>if (firstArgumentExpression == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// named variable<NEW_LINE>ASTName namedVar = firstArgumentExpression.getFirstDescendantOfType(ASTName.class);<NEW_LINE>// find where it's declared, if possible<NEW_LINE>if (namedVar != null && namedVar.getNameDeclaration() instanceof VariableNameDeclaration && !checkedVars.contains(namedVar.getNameDeclaration())) {<NEW_LINE>VariableNameDeclaration varDecl = (VariableNameDeclaration) namedVar.getNameDeclaration();<NEW_LINE>checkedVars.add(varDecl);<NEW_LINE>ASTVariableInitializer initializer = varDecl.getAccessNodeParent(<MASK><NEW_LINE>if (initializer != null) {<NEW_LINE>validateProperKeyArgument(data, initializer.getFirstDescendantOfType(ASTPrimaryPrefix.class));<NEW_LINE>}<NEW_LINE>List<NameOccurrence> usages = varDecl.getDeclaratorId().getUsages();<NEW_LINE>for (NameOccurrence occurrence : usages) {<NEW_LINE>ASTStatementExpression parentExpr = occurrence.getLocation().getFirstParentOfType(ASTStatementExpression.class);<NEW_LINE>if (isAssignment(occurrence.getLocation(), parentExpr)) {<NEW_LINE>validateProperKeyArgument(data, parentExpr.getChild(2).getFirstDescendantOfType(ASTPrimaryPrefix.class));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// hard coded array<NEW_LINE>ASTArrayInitializer arrayInit = firstArgumentExpression.getFirstDescendantOfType(ASTArrayInitializer.class);<NEW_LINE>if (arrayInit != null) {<NEW_LINE>addViolation(data, arrayInit);<NEW_LINE>}<NEW_LINE>// string literal<NEW_LINE>ASTLiteral literal = firstArgumentExpression.getFirstDescendantOfType(ASTLiteral.class);<NEW_LINE>if (literal != null && literal.isStringLiteral()) {<NEW_LINE>addViolation(data, literal);<NEW_LINE>}<NEW_LINE>}
).getFirstDescendantOfType(ASTVariableInitializer.class);
450,818
public ActionResult changeSecret(@PathVariable String client_id, @RequestBody SecretChangeRequest change) {<NEW_LINE>ClientDetails clientDetails;<NEW_LINE>try {<NEW_LINE>clientDetails = clientDetailsService.retrieve(client_id, IdentityZoneHolder.get().getId());<NEW_LINE>} catch (InvalidClientException e) {<NEW_LINE>throw new NoSuchClientException("No such client: " + client_id);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>checkPasswordChangeIsAllowed(clientDetails, change.getOldSecret());<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>throw new InvalidClientDetailsException(e.getMessage());<NEW_LINE>}<NEW_LINE>ActionResult result;<NEW_LINE>switch(change.getChangeMode()) {<NEW_LINE>case ADD:<NEW_LINE>if (!validateCurrentClientSecretAdd(clientDetails.getClientSecret())) {<NEW_LINE>throw new InvalidClientDetailsException("client secret is either empty or client already has two secrets.");<NEW_LINE>}<NEW_LINE>clientDetailsValidator.getClientSecretValidator().validate(change.getSecret());<NEW_LINE>clientRegistrationService.addClientSecret(client_id, change.getSecret(), IdentityZoneHolder.get().getId());<NEW_LINE>result = new ActionResult("ok", "Secret is added");<NEW_LINE>break;<NEW_LINE>case DELETE:<NEW_LINE>if (!validateCurrentClientSecretDelete(clientDetails.getClientSecret())) {<NEW_LINE>throw new InvalidClientDetailsException("client secret is either empty or client has only one secret.");<NEW_LINE>}<NEW_LINE>clientRegistrationService.deleteClientSecret(client_id, IdentityZoneHolder.<MASK><NEW_LINE>result = new ActionResult("ok", "Secret is deleted");<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>clientDetailsValidator.getClientSecretValidator().validate(change.getSecret());<NEW_LINE>clientRegistrationService.updateClientSecret(client_id, change.getSecret(), IdentityZoneHolder.get().getId());<NEW_LINE>result = new ActionResult("ok", "secret updated");<NEW_LINE>}<NEW_LINE>clientSecretChanges.incrementAndGet();<NEW_LINE>return result;<NEW_LINE>}
get().getId());
1,524,780
private static boolean isConvertibleToMapType(Object sourceValue, BMapType targetType, List<TypeValuePair> unresolvedValues, String varName, List<String> errors, boolean allowAmbiguity) {<NEW_LINE>if (!(sourceValue instanceof MapValueImpl)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean returnVal = true;<NEW_LINE>for (Object object : ((MapValueImpl) sourceValue).entrySet()) {<NEW_LINE>Map.Entry valueEntry = (Map.Entry) object;<NEW_LINE>String fieldNameLong = getLongFieldName(varName, valueEntry.getKey().toString());<NEW_LINE><MASK><NEW_LINE>if (getConvertibleTypes(valueEntry.getValue(), targetType.getConstrainedType(), fieldNameLong, false, unresolvedValues, errors, allowAmbiguity).size() != 1) {<NEW_LINE>addErrorMessage(errors.size() - initialErrorCount, errors, "map field '" + fieldNameLong + "' should be of type '" + targetType.getConstrainedType() + "', found '" + getShortSourceValue(valueEntry.getValue()) + "'");<NEW_LINE>if (errors.size() >= MAX_CONVERSION_ERROR_COUNT + 1) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>returnVal = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return returnVal;<NEW_LINE>}
int initialErrorCount = errors.size();
996,145
void loadProject() throws IOException {<NEW_LINE>File fileProject = getFile();<NEW_LINE>try (BufferedReader fileReader = Files.newBufferedReader(fileProject.toPath(), StandardCharsets.UTF_8)) {<NEW_LINE>Gson gson = GsonTools.getInstance();<NEW_LINE>JsonObject element = gson.fromJson(fileReader, JsonObject.class);<NEW_LINE>creationTimestamp = element.get("createTimestamp").getAsLong();<NEW_LINE>modificationTimestamp = element.get("modifyTimestamp").getAsLong();<NEW_LINE>if (element.has("uri")) {<NEW_LINE>try {<NEW_LINE>previousURI = new URI(element.get("uri").getAsString());<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>logger.warn("Error parsing previous URI: " + e.getLocalizedMessage(), e);<NEW_LINE>}<NEW_LINE>} else<NEW_LINE>logger.debug("No previous URI found in project");<NEW_LINE>if (element.has("version"))<NEW_LINE>version = element.<MASK><NEW_LINE>if (Arrays.asList("v0.2.0-m2", "v0.2.0-m1").contains(version)) {<NEW_LINE>throw new IOException("Older projects written with " + version + " are not compatible with this version of QuPath, sorry!");<NEW_LINE>}<NEW_LINE>if (version == null && !element.has("lastID")) {<NEW_LINE>throw new IOException("QuPath project is missing a version number and last ID (was it written with an old version?)");<NEW_LINE>}<NEW_LINE>long lastID = 0;<NEW_LINE>List<DefaultProjectImageEntry> images = element.has("images") ? gson.fromJson(element.get("images"), new TypeToken<ArrayList<DefaultProjectImageEntry>>() {<NEW_LINE>}.getType()) : Collections.emptyList();<NEW_LINE>for (DefaultProjectImageEntry entry : images) {<NEW_LINE>// Need to construct a new one to ensure project is set<NEW_LINE>addImage(new DefaultProjectImageEntry(entry));<NEW_LINE>lastID = Math.max(lastID, entry.entryID);<NEW_LINE>}<NEW_LINE>if (element.has("lastID")) {<NEW_LINE>lastID = Math.max(lastID, element.get("lastID").getAsLong());<NEW_LINE>}<NEW_LINE>counter.set(lastID);<NEW_LINE>pathClasses.addAll(loadPathClasses());<NEW_LINE>// List<String> troublesome = validateLocalPaths(true);<NEW_LINE>// if (!troublesome.isEmpty()) {<NEW_LINE>// logger.warn("Could not find {} image(s): {}", troublesome.size(), troublesome);<NEW_LINE>// }<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IOException(e);<NEW_LINE>}<NEW_LINE>}
get("version").getAsString();
1,674,594
private Operation completeFileUploadOperation(final FileUploadToken token, final boolean commit) {<NEW_LINE>return new Operation() {<NEW_LINE><NEW_LINE>public void execute() {<NEW_LINE>String msg = constants_.fileUploadMessage((commit ? constants_.completingLabel() : constants_.cancellingLabel()));<NEW_LINE>final Command dismissProgress = globalDisplay_.showProgress(msg);<NEW_LINE>server_.completeUpload(token, commit, new ServerRequestCallback<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponseReceived(Void response) {<NEW_LINE>dismissProgress.execute();<NEW_LINE>FileUploadEvent event = new FileUploadEvent(false);<NEW_LINE>eventBus_.fireEvent(event);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(ServerError error) {<NEW_LINE>dismissProgress.execute();<NEW_LINE>globalDisplay_.showErrorMessage(constants_.fileUploadErrorMessage(<MASK><NEW_LINE>FileUploadEvent event = new FileUploadEvent(false);<NEW_LINE>eventBus_.fireEvent(event);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
), error.getUserMessage());
1,501,481
public void update(Command command) throws IllegalArgumentException {<NEW_LINE>BigDecimal newValue = null;<NEW_LINE>if (command instanceof DecimalType) {<NEW_LINE>newValue = ((<MASK><NEW_LINE>} else if (command instanceof IncreaseDecreaseType || command instanceof UpDownType) {<NEW_LINE>BigDecimal oldValue = getOldValue();<NEW_LINE>if (command == IncreaseDecreaseType.INCREASE || command == UpDownType.UP) {<NEW_LINE>newValue = oldValue.add(step);<NEW_LINE>} else {<NEW_LINE>newValue = oldValue.subtract(step);<NEW_LINE>}<NEW_LINE>} else if (command instanceof QuantityType<?>) {<NEW_LINE>newValue = getQuantityTypeAsDecimal((QuantityType<?>) command);<NEW_LINE>} else {<NEW_LINE>newValue = new BigDecimal(command.toString());<NEW_LINE>}<NEW_LINE>if (!checkConditions(newValue)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// items with units specified in the label in the UI but no unit on mqtt are stored as<NEW_LINE>// DecimalType to avoid conversions (e.g. % expects 0-1 rather than 0-100)<NEW_LINE>if (!Units.ONE.equals(unit)) {<NEW_LINE>state = new QuantityType<>(newValue, unit);<NEW_LINE>} else {<NEW_LINE>state = new DecimalType(newValue);<NEW_LINE>}<NEW_LINE>}
DecimalType) command).toBigDecimal();
1,552,875
public static int pickBestTransparency(Image image) {<NEW_LINE>// Take a shortcut if possible<NEW_LINE>if (image instanceof BufferedImage) {<NEW_LINE>return pickBestTransparency((BufferedImage) image);<NEW_LINE>}<NEW_LINE>// Legacy method<NEW_LINE>// NOTE: This is a horrible memory hog<NEW_LINE>int width = image.getWidth(null);<NEW_LINE>int <MASK><NEW_LINE>int[] pixelArray = new int[width * height];<NEW_LINE>PixelGrabber pg = new PixelGrabber(image, 0, 0, width, height, pixelArray, 0, width);<NEW_LINE>try {<NEW_LINE>pg.grabPixels();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>System.err.println("interrupted waiting for pixels!");<NEW_LINE>return Transparency.OPAQUE;<NEW_LINE>}<NEW_LINE>if ((pg.getStatus() & ImageObserver.ABORT) != 0) {<NEW_LINE>log.error("image fetch aborted or errored");<NEW_LINE>System.err.println("image fetch aborted or errored");<NEW_LINE>return Transparency.OPAQUE;<NEW_LINE>}<NEW_LINE>// Look for specific pixels<NEW_LINE>boolean foundTransparent = false;<NEW_LINE>for (int y = 0; y < height; y++) {<NEW_LINE>for (int x = 0; x < width; x++) {<NEW_LINE>// Get the next pixel<NEW_LINE>int pixel = pixelArray[y * width + x];<NEW_LINE>int alpha = (pixel >> 24) & 0xff;<NEW_LINE>// Is there translucency or just pure transparency ?<NEW_LINE>if (alpha > 0 && alpha < 255) {<NEW_LINE>return Transparency.TRANSLUCENT;<NEW_LINE>}<NEW_LINE>if (alpha == 0 && !foundTransparent) {<NEW_LINE>foundTransparent = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return foundTransparent ? Transparency.BITMASK : Transparency.OPAQUE;<NEW_LINE>}
height = image.getHeight(null);
1,656,945
public synchronized void drawGlyphVector(SunGraphics2D sg2d, GlyphVector glyphVector, float x, float y) {<NEW_LINE>OSXSurfaceData surfaceData = (OSXSurfaceData) sg2d.getSurfaceData();<NEW_LINE>Shape shape = glyphVector.getOutline(x, y);<NEW_LINE>// get final destination compositing bounds (after all transformations if needed)<NEW_LINE>Rectangle2D compositingBounds = padBounds(sg2d, shape);<NEW_LINE>// constrain the bounds to be within surface bounds<NEW_LINE>clipBounds(sg2d, compositingBounds);<NEW_LINE>// if the compositing region is empty we skip all remaining compositing work:<NEW_LINE>if (compositingBounds.isEmpty() == false) {<NEW_LINE>BufferedImage srcPixels;<NEW_LINE>{<NEW_LINE>// create matching image into which we'll render the primitive to be composited<NEW_LINE>srcPixels = surfaceData.getCompositingSrcImage((int) compositingBounds.getWidth(), (int) compositingBounds.getHeight());<NEW_LINE>Graphics2D g = srcPixels.createGraphics();<NEW_LINE>// sync up graphics state<NEW_LINE>ShapeTM.setToTranslation(-compositingBounds.getX(), -compositingBounds.getY());<NEW_LINE>ShapeTM.concatenate(sg2d.transform);<NEW_LINE>g.setTransform(ShapeTM);<NEW_LINE>g.setPaint(sg2d.getPaint());<NEW_LINE>g.<MASK><NEW_LINE>g.setFont(sg2d.getFont());<NEW_LINE>g.setRenderingHints(sg2d.getRenderingHints());<NEW_LINE>// render the primitive to be composited<NEW_LINE>g.drawGlyphVector(glyphVector, x, y);<NEW_LINE>g.dispose();<NEW_LINE>}<NEW_LINE>composite(sg2d, surfaceData, srcPixels, compositingBounds);<NEW_LINE>}<NEW_LINE>}
setStroke(sg2d.getStroke());
240,670
private void handleTagChange(Content content, BlackboardArtifact bbArtifact) {<NEW_LINE>Case openCase;<NEW_LINE>try {<NEW_LINE>openCase = Case.getCurrentCaseThrows();<NEW_LINE>} catch (NoCurrentCaseException ex) {<NEW_LINE>LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (isKnownFile(content)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TagsManager tagsManager = openCase.getServices().getTagsManager();<NEW_LINE>List<BlackboardArtifactTag> tags = tagsManager.getBlackboardArtifactTagsByArtifact(bbArtifact);<NEW_LINE>if (hasNotableTag(tags)) {<NEW_LINE>setArtifactKnownStatus(dbManager, <MASK><NEW_LINE>} else {<NEW_LINE>setArtifactKnownStatus(dbManager, bbArtifact, TskData.FileKnown.UNKNOWN);<NEW_LINE>}<NEW_LINE>} catch (TskCoreException ex) {<NEW_LINE>LOGGER.log(Level.SEVERE, "Failed to obtain tags manager for case.", ex);<NEW_LINE>}<NEW_LINE>}
bbArtifact, TskData.FileKnown.BAD);
1,240,356
public VirtualMachineTO implement(VirtualMachineProfile vm) {<NEW_LINE>BootloaderType bt = BootloaderType.PyGrub;<NEW_LINE>if (vm.getBootLoaderType() == BootloaderType.CD) {<NEW_LINE>bt = vm.getBootLoaderType();<NEW_LINE>}<NEW_LINE>VirtualMachineTO to = toVirtualMachineTO(vm);<NEW_LINE>UserVmVO userVmVO = userVmDao.findById(vm.getId());<NEW_LINE>if (userVmVO != null) {<NEW_LINE>HostVO host = hostDao.findById(userVmVO.getHostId());<NEW_LINE>if (host != null) {<NEW_LINE>List<HostVO> clusterHosts = hostDao.listByClusterAndHypervisorType(host.getClusterId(), host.getHypervisorType());<NEW_LINE>HostVO hostWithMinSocket = clusterHosts.stream().min(Comparator.comparing(HostVO::<MASK><NEW_LINE>Integer vCpus = MaxNumberOfVCPUSPerVM.valueIn(host.getClusterId());<NEW_LINE>if (hostWithMinSocket != null && hostWithMinSocket.getCpuSockets() != null && hostWithMinSocket.getCpuSockets() < vCpus) {<NEW_LINE>vCpus = hostWithMinSocket.getCpuSockets();<NEW_LINE>}<NEW_LINE>to.setVcpuMaxLimit(vCpus);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>to.setBootloader(bt);<NEW_LINE>// Determine the VM's OS description<NEW_LINE>GuestOSVO guestOS = guestOsDao.findByIdIncludingRemoved(vm.getVirtualMachine().getGuestOSId());<NEW_LINE>Map<String, String> guestOsDetails = guestOsDetailsDao.listDetailsKeyPairs(vm.getVirtualMachine().getGuestOSId());<NEW_LINE>to.setGuestOsDetails(guestOsDetails);<NEW_LINE>to.setOs(guestOS.getDisplayName());<NEW_LINE>HostVO host = hostDao.findById(vm.getVirtualMachine().getHostId());<NEW_LINE>GuestOSHypervisorVO guestOsMapping = null;<NEW_LINE>if (host != null) {<NEW_LINE>guestOsMapping = guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(), getHypervisorType().toString(), host.getHypervisorVersion());<NEW_LINE>}<NEW_LINE>if (guestOsMapping == null || host == null) {<NEW_LINE>to.setPlatformEmulator(null);<NEW_LINE>} else {<NEW_LINE>to.setPlatformEmulator(guestOsMapping.getGuestOsName());<NEW_LINE>}<NEW_LINE>return to;<NEW_LINE>}
getCpuSockets)).orElse(null);
188,989
static String removePadding(String encodedValue, Type parameter) {<NEW_LINE>if (parameter instanceof NumericType) {<NEW_LINE>if (parameter instanceof Ufixed || parameter instanceof Fixed) {<NEW_LINE>return encodedValue;<NEW_LINE>}<NEW_LINE>return encodedValue.substring(64 - ((NumericType) parameter).<MASK><NEW_LINE>} else if (parameter instanceof Address) {<NEW_LINE>return encodedValue.substring(64 - ((Address) parameter).toUint().getBitSize() / 4, 64);<NEW_LINE>} else if (parameter instanceof Bool) {<NEW_LINE>return encodedValue.substring(62, 64);<NEW_LINE>}<NEW_LINE>if (parameter instanceof Bytes) {<NEW_LINE>return encodedValue.substring(0, ((BytesType) parameter).getValue().length * 2);<NEW_LINE>}<NEW_LINE>if (parameter instanceof Utf8String) {<NEW_LINE>int length = ((Utf8String) parameter).getValue().getBytes(StandardCharsets.UTF_8).length;<NEW_LINE>return encodedValue.substring(64, 64 + length * 2);<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedOperationException("Type cannot be encoded: " + parameter.getClass());<NEW_LINE>}<NEW_LINE>}
getBitSize() / 4, 64);
1,109,469
public Collection<Object> convert(MappingContext<Object, Collection<Object>> context) {<NEW_LINE>Object source = context.getSource();<NEW_LINE>if (source == null)<NEW_LINE>return null;<NEW_LINE>Collection<Object> originalDestination = context.getDestination();<NEW_LINE>Collection<Object> destination = MappingContextHelper.createCollection(context);<NEW_LINE>Class<?> elementType = MappingContextHelper.resolveDestinationGenericType(context);<NEW_LINE>int index = 0;<NEW_LINE>for (Iterator<Object> iterator = Iterables.iterator(source); iterator.hasNext(); index++) {<NEW_LINE><MASK><NEW_LINE>Object element = null;<NEW_LINE>if (originalDestination != null)<NEW_LINE>element = Iterables.getElement(originalDestination, index);<NEW_LINE>if (sourceElement != null) {<NEW_LINE>MappingContext<?, ?> elementContext = element == null ? context.create(sourceElement, elementType) : context.create(sourceElement, element);<NEW_LINE>element = context.getMappingEngine().map(elementContext);<NEW_LINE>}<NEW_LINE>destination.add(element);<NEW_LINE>}<NEW_LINE>return destination;<NEW_LINE>}
Object sourceElement = iterator.next();
62,257
private Request prepareRequest(CoapClient client, long c) {<NEW_LINE>if (!config.multipleObserveRequests && overallRequestsDownCounter.get() <= 0) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>countDown(overallRequestsDownCounter);<NEW_LINE>Request request;<NEW_LINE>int accept = TEXT_PLAIN;<NEW_LINE>byte[] payload = config.payload == null ? null : config.payload.payloadBytes;<NEW_LINE>if (config.hono) {<NEW_LINE>request = secure ? Request.newPost() : Request.newPut();<NEW_LINE>if (payload == null) {<NEW_LINE>accept = APPLICATION_JSON;<NEW_LINE>payload = "{\"temp\": %1$d }".getBytes();<NEW_LINE>}<NEW_LINE>} else if (config.observe != null) {<NEW_LINE>request = Request.newGet();<NEW_LINE>request.setObserve();<NEW_LINE>} else {<NEW_LINE>request = Request.newPost();<NEW_LINE>}<NEW_LINE>if (config.contentType != null) {<NEW_LINE>accept = config.contentType.contentType;<NEW_LINE>}<NEW_LINE>request.getOptions().setAccept(accept);<NEW_LINE>if (config.messageType != null) {<NEW_LINE>request.<MASK><NEW_LINE>}<NEW_LINE>request.getOptions().setBlock2(block2);<NEW_LINE>if (request.isIntendedPayload()) {<NEW_LINE>request.getOptions().setContentFormat(accept);<NEW_LINE>if (payload != null) {<NEW_LINE>if (config.payloadFormat) {<NEW_LINE>String text = new String(payload, CoAP.UTF8_CHARSET);<NEW_LINE>text = String.format(text, c, System.currentTimeMillis() / 1000);<NEW_LINE>request.setPayload(text);<NEW_LINE>} else {<NEW_LINE>request.setPayload(payload);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (config.proxy != null) {<NEW_LINE>request.setDestinationContext(new AddressEndpointContext(config.proxy.destination));<NEW_LINE>if (config.proxy.scheme != null) {<NEW_LINE>request.getOptions().setProxyScheme(config.proxy.scheme);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>EndpointContext destinationContext = client.getDestinationContext();<NEW_LINE>if (destinationContext != null) {<NEW_LINE>request.setDestinationContext(destinationContext);<NEW_LINE>}<NEW_LINE>request.setURI(client.getURI());<NEW_LINE>ResponseTimeout timeout = new ResponseTimeout(request, responseTimeout, executorService);<NEW_LINE>request.addMessageObserver(timeout);<NEW_LINE>request.addMessageObserver(retransmissionDetector);<NEW_LINE>return request;<NEW_LINE>}
setConfirmable(config.messageType.con);
1,655,360
public void generate(final Module module, final Element element) {<NEW_LINE>if (!(module instanceof SimpleListExtension)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final SimpleListExtension sle = (SimpleListExtension) module;<NEW_LINE>addNotNullElement(element, <MASK><NEW_LINE>final Group[] groups = sle.getGroupFields();<NEW_LINE>final Element listInfo = new Element("listinfo", ModuleParser.NS);<NEW_LINE>for (int i = 0; groups != null && i < groups.length; i++) {<NEW_LINE>final Element group = new Element("group", ModuleParser.NS);<NEW_LINE>if (groups[i].getNamespace() != Namespace.NO_NAMESPACE) {<NEW_LINE>addNotNullAttribute(group, "ns", groups[i].getNamespace().getURI());<NEW_LINE>}<NEW_LINE>addNotNullAttribute(group, "element", groups[i].getElement());<NEW_LINE>addNotNullAttribute(group, "label", groups[i].getLabel());<NEW_LINE>listInfo.addContent(group);<NEW_LINE>}<NEW_LINE>final Sort[] sorts = sle.getSortFields();<NEW_LINE>for (int i = 0; sorts != null && i < sorts.length; i++) {<NEW_LINE>final Element sort = new Element("sort", ModuleParser.NS);<NEW_LINE>if (sorts[i].getNamespace() != Namespace.NO_NAMESPACE) {<NEW_LINE>addNotNullAttribute(sort, "ns", sorts[i].getNamespace().getURI());<NEW_LINE>}<NEW_LINE>addNotNullAttribute(sort, "element", sorts[i].getElement());<NEW_LINE>addNotNullAttribute(sort, "label", sorts[i].getLabel());<NEW_LINE>addNotNullAttribute(sort, "data-type", sorts[i].getDataType());<NEW_LINE>if (sorts[i].getDefaultOrder()) {<NEW_LINE>addNotNullAttribute(sort, "default", "true");<NEW_LINE>}<NEW_LINE>listInfo.addContent(sort);<NEW_LINE>}<NEW_LINE>if (!listInfo.getChildren().isEmpty()) {<NEW_LINE>element.addContent(listInfo);<NEW_LINE>}<NEW_LINE>}
"treatAs", sle.getTreatAs());
645,658
private boolean execute(WorkItem wItem, @Nullable FileWriter outWriter) {<NEW_LINE>_logger.infof("work-id is %s\n", wItem.getId());<NEW_LINE>wItem.addRequestParam(BfConsts.ARG_LOG_LEVEL, _settings.getBatfishLogLevel());<NEW_LINE>wItem.addRequestParam(BfConsts.ARG_ALWAYS_INCLUDE_ANSWER_IN_WORK_JSON_LOG, "true");<NEW_LINE>for (String option : _additionalBatfishOptions.keySet()) {<NEW_LINE>wItem.addRequestParam(option, _additionalBatfishOptions.get(option));<NEW_LINE>}<NEW_LINE>boolean queueWorkResult = _workHelper.queueWork(wItem);<NEW_LINE><MASK><NEW_LINE>if (!queueWorkResult) {<NEW_LINE>return queueWorkResult;<NEW_LINE>}<NEW_LINE>boolean result = pollWorkAndGetAnswer(wItem, outWriter);<NEW_LINE>return result;<NEW_LINE>}
_logger.infof("Queuing result: %s\n", queueWorkResult);
499,989
private void sendRequest(Request request, RequestContext requestContext, Map<String, String> wireAttrs, TransportCallback<StreamResponse> callback) {<NEW_LINE>final TransportCallback<StreamResponse> decoratedCallback = decorateUserCallback(request, callback);<NEW_LINE>final NettyClientState state = _state.get();<NEW_LINE>if (state != NettyClientState.RUNNING) {<NEW_LINE>decoratedCallback.onResponse(TransportResponseImpl.error(new IllegalStateException("Client is not running")));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final long resolvedRequestTimeout = resolveRequestTimeout(requestContext, _requestTimeout);<NEW_LINE>// Timeout ensures the request callback is always invoked and is cancelled before the<NEW_LINE>// responsibility of invoking the callback is handed over to the pipeline.<NEW_LINE>final Timeout<None> timeout = new Timeout<>(_scheduler, resolvedRequestTimeout, TimeUnit.MILLISECONDS, None.none());<NEW_LINE>timeout.addTimeoutTask(() -> decoratedCallback.onResponse(TransportResponseImpl.error(new TimeoutException("Exceeded request timeout of " + resolvedRequestTimeout + "ms"))));<NEW_LINE>// resolve address<NEW_LINE>final SocketAddress address;<NEW_LINE>try {<NEW_LINE>TimingContextUtil.markTiming(requestContext, TIMING_KEY);<NEW_LINE>address = resolveAddress(request, requestContext);<NEW_LINE>TimingContextUtil.markTiming(requestContext, TIMING_KEY);<NEW_LINE>} catch (Exception e) {<NEW_LINE>decoratedCallback.onResponse(TransportResponseImpl.error(e));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Serialize wire attributes<NEW_LINE>final Request requestWithWireAttrHeaders;<NEW_LINE>if (request instanceof StreamRequest) {<NEW_LINE>requestWithWireAttrHeaders = buildRequestWithWireAttributes((StreamRequest) request, wireAttrs);<NEW_LINE>} else {<NEW_LINE>MessageType.setMessageType(<MASK><NEW_LINE>requestWithWireAttrHeaders = buildRequestWithWireAttributes((RestRequest) request, wireAttrs);<NEW_LINE>}<NEW_LINE>// Gets channel pool<NEW_LINE>final AsyncPool<Channel> pool;<NEW_LINE>try {<NEW_LINE>pool = getChannelPoolManagerPerRequest(requestWithWireAttrHeaders).getPoolForAddress(address);<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>decoratedCallback.onResponse(TransportResponseImpl.error(e));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Saves protocol version in request context<NEW_LINE>requestContext.putLocalAttr(R2Constants.HTTP_PROTOCOL_VERSION, _protocolVersion);<NEW_LINE>final Cancellable pendingGet = pool.get(new ChannelPoolGetCallback(pool, requestWithWireAttrHeaders, requestContext, decoratedCallback, timeout, resolvedRequestTimeout, _streamingTimeout));<NEW_LINE>if (pendingGet != null) {<NEW_LINE>timeout.addTimeoutTask(pendingGet::cancel);<NEW_LINE>}<NEW_LINE>}
MessageType.Type.REST, wireAttrs);
587,424
public RelWriter explainTermsForDisplay(RelWriter pw) {<NEW_LINE>pw.item(RelDrdsWriter.REL_NAME, "MysqlTableScan");<NEW_LINE>pw.item("name", getTable().getQualifiedName());<NEW_LINE>if (!filters.isEmpty()) {<NEW_LINE>RexExplainVisitor visitor <MASK><NEW_LINE>filters.get(0).accept(visitor);<NEW_LINE>pw.item("filter", visitor.toSqlString());<NEW_LINE>}<NEW_LINE>RelMetadataQuery mq = this.getCluster().getMetadataQuery();<NEW_LINE>List<Index> accessIndexList = getAccessIndexList(mq);<NEW_LINE>boolean hasJoinIndex = false;<NEW_LINE>if (join != null) {<NEW_LINE>Index index = IndexUtil.selectJoinIndex(join);<NEW_LINE>if (index != null) {<NEW_LINE>pw.item("joinIndex", index.getIndexMeta().getPhysicalIndexName());<NEW_LINE>hasJoinIndex = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!hasJoinIndex && accessIndexList != null && !accessIndexList.isEmpty()) {<NEW_LINE>Set<String> indexNameSet = accessIndexList.stream().map(x -> x.getIndexMeta().getPhysicalIndexName()).collect(Collectors.toSet());<NEW_LINE>StringBuilder stringBuilder = new StringBuilder();<NEW_LINE>boolean first = true;<NEW_LINE>for (String indexName : indexNameSet) {<NEW_LINE>if (!first) {<NEW_LINE>stringBuilder.append(",");<NEW_LINE>}<NEW_LINE>first = false;<NEW_LINE>stringBuilder.append(indexName);<NEW_LINE>}<NEW_LINE>pw.item("index", stringBuilder.toString());<NEW_LINE>}<NEW_LINE>return pw;<NEW_LINE>}
= new RexExplainVisitor(getNodeForMetaQuery());
1,481,090
public static QueryCrackEventResponse unmarshall(QueryCrackEventResponse queryCrackEventResponse, UnmarshallerContext context) {<NEW_LINE>queryCrackEventResponse.setRequestId(context.stringValue("QueryCrackEventResponse.requestId"));<NEW_LINE>queryCrackEventResponse.setCode(context.stringValue("QueryCrackEventResponse.Code"));<NEW_LINE>queryCrackEventResponse.setSuccess(context.booleanValue("QueryCrackEventResponse.Success"));<NEW_LINE>queryCrackEventResponse.setMessage(context.stringValue("QueryCrackEventResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>PageInfo pageInfo = new PageInfo();<NEW_LINE>pageInfo.setCurrentPage(context.integerValue("QueryCrackEventResponse.Data.PageInfo.CurrentPage"));<NEW_LINE>pageInfo.setPageSize(context.integerValue("QueryCrackEventResponse.Data.PageInfo.PageSize"));<NEW_LINE>pageInfo.setTotalCount(context.integerValue("QueryCrackEventResponse.Data.PageInfo.TotalCount"));<NEW_LINE>pageInfo.setCount(context.integerValue("QueryCrackEventResponse.Data.PageInfo.Count"));<NEW_LINE>data.setPageInfo(pageInfo);<NEW_LINE>List<Entity> list = new ArrayList<Entity>();<NEW_LINE>for (int i = 0; i < context.lengthValue("QueryCrackEventResponse.Data.List.Length"); i++) {<NEW_LINE>Entity entity = new Entity();<NEW_LINE>entity.setUuid(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].Uuid"));<NEW_LINE>entity.setAttackTime(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].AttackTime"));<NEW_LINE>entity.setAttackType(context.integerValue("QueryCrackEventResponse.Data.List[" + i + "].AttackType"));<NEW_LINE>entity.setAttackTypeName(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].AttackTypeName"));<NEW_LINE>entity.setBuyVersion(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].BuyVersion"));<NEW_LINE>entity.setCrackSourceIp(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].CrackSourceIp"));<NEW_LINE>entity.setCrackTimes(context.integerValue("QueryCrackEventResponse.Data.List[" + i + "].CrackTimes"));<NEW_LINE>entity.setGroupId(context.integerValue("QueryCrackEventResponse.Data.List[" + i + "].GroupId"));<NEW_LINE>entity.setInstanceName(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].InstanceName"));<NEW_LINE>entity.setInstanceId(context.stringValue<MASK><NEW_LINE>entity.setIp(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].Ip"));<NEW_LINE>entity.setRegion(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].Region"));<NEW_LINE>entity.setStatus(context.integerValue("QueryCrackEventResponse.Data.List[" + i + "].Status"));<NEW_LINE>entity.setStatusName(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].StatusName"));<NEW_LINE>entity.setLocation(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].Location"));<NEW_LINE>entity.setInWhite(context.integerValue("QueryCrackEventResponse.Data.List[" + i + "].InWhite"));<NEW_LINE>entity.setUserName(context.stringValue("QueryCrackEventResponse.Data.List[" + i + "].UserName"));<NEW_LINE>list.add(entity);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>queryCrackEventResponse.setData(data);<NEW_LINE>return queryCrackEventResponse;<NEW_LINE>}
("QueryCrackEventResponse.Data.List[" + i + "].InstanceId"));
512,050
private Table buildTable(RestRequest request, ClusterStateResponse clusterStateResponse, String patternString) {<NEW_LINE>Table table = getTableWithHeader(request);<NEW_LINE>Metadata metadata = clusterStateResponse.getState().metadata();<NEW_LINE>for (ObjectObjectCursor<String, IndexTemplateMetadata> entry : metadata.templates()) {<NEW_LINE>IndexTemplateMetadata indexData = entry.value;<NEW_LINE>if (patternString == null || Regex.simpleMatch(patternString, indexData.name())) {<NEW_LINE>table.startRow();<NEW_LINE>table.addCell(indexData.name());<NEW_LINE>table.addCell("[" + String.join(", ", indexData.patterns()) + "]");<NEW_LINE>table.addCell(indexData.getOrder());<NEW_LINE>table.addCell(indexData.getVersion());<NEW_LINE>table.addCell("");<NEW_LINE>table.endRow();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, ComposableIndexTemplate> entry : metadata.templatesV2().entrySet()) {<NEW_LINE>String name = entry.getKey();<NEW_LINE><MASK><NEW_LINE>if (patternString == null || Regex.simpleMatch(patternString, name)) {<NEW_LINE>table.startRow();<NEW_LINE>table.addCell(name);<NEW_LINE>table.addCell("[" + String.join(", ", template.indexPatterns()) + "]");<NEW_LINE>table.addCell(template.priorityOrZero());<NEW_LINE>table.addCell(template.version());<NEW_LINE>table.addCell("[" + String.join(", ", template.composedOf()) + "]");<NEW_LINE>table.endRow();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return table;<NEW_LINE>}
ComposableIndexTemplate template = entry.getValue();
363,163
public void updateFlatrateTermBillBPartner(@NonNull final FlatrateTermBillPartnerRequest request) {<NEW_LINE>final I_C_Flatrate_Term term = flatrateDAO.getById(request.getFlatrateTermId());<NEW_LINE>final int bPartnerId = request.getBillBPartnerId().getRepoId();<NEW_LINE>term.setBill_BPartner_ID(bPartnerId);<NEW_LINE>term.setBill_Location_ID(request.getBillLocationId().getRepoId());<NEW_LINE>term.setBill_User_ID(BPartnerContactId.toRepoId(request.getBillUserId()));<NEW_LINE>final int oldFlatrateDataId = term.getC_Flatrate_Data_ID();<NEW_LINE>// disable it because C_Flatrate_Data_ID is not updateable<NEW_LINE>InterfaceWrapperHelper.disableReadOnlyColumnCheck(term);<NEW_LINE>final I_C_Flatrate_Data data = flatrateDAO.retrieveOrCreateFlatrateData<MASK><NEW_LINE>final int newFlatrateDataId = data.getC_Flatrate_Data_ID();<NEW_LINE>term.setC_Flatrate_Data_ID(newFlatrateDataId);<NEW_LINE>flatrateDAO.save(term);<NEW_LINE>if (!request.isTermHasInvoices()) {<NEW_LINE>updateBillBPartnerForInvoiceCandidate(request);<NEW_LINE>invoiceCandidateHandlerBL.invalidateCandidatesFor(term);<NEW_LINE>}<NEW_LINE>modelCacheInvalidationService.invalidate(CacheInvalidateMultiRequest.of(CacheInvalidateRequest.rootRecord(I_C_Flatrate_Data.Table_Name, oldFlatrateDataId), CacheInvalidateRequest.allChildRecords(I_C_Flatrate_Data.Table_Name, oldFlatrateDataId, I_C_Flatrate_Term.Table_Name)), ModelCacheInvalidationTiming.CHANGE);<NEW_LINE>modelCacheInvalidationService.invalidate(CacheInvalidateMultiRequest.of(CacheInvalidateRequest.rootRecord(I_C_Flatrate_Data.Table_Name, newFlatrateDataId), CacheInvalidateRequest.allChildRecords(I_C_Flatrate_Data.Table_Name, newFlatrateDataId, I_C_Flatrate_Term.Table_Name)), ModelCacheInvalidationTiming.CHANGE);<NEW_LINE>}
(bPartnerDAO.getById(bPartnerId));
197,430
private void generateRelayConfig(String schemaRegistryLocation, String dbName, String uri, String outputDir) throws Exception {<NEW_LINE>List<String> srcs = _manager.getManagedSourcesForDB(dbName.trim().toLowerCase(Locale.ENGLISH));<NEW_LINE>if (null == srcs) {<NEW_LINE>String error = "No Sources found for database (" + dbName + "). Available sources are :" + _manager.getDbToSrcMap();<NEW_LINE>System.out.println(error);<NEW_LINE>throw new DatabusException(error);<NEW_LINE>}<NEW_LINE>List<String> addSrcs = new ArrayList<String>();<NEW_LINE>for (String src : srcs) {<NEW_LINE>boolean add = promptForYesOrNoQuestion("Do you want to add the src (" + src + ") to the relay config ");<NEW_LINE>if (add)<NEW_LINE>addSrcs.add(src);<NEW_LINE>}<NEW_LINE>DevRelayConfigGenerator.generateRelayConfig(schemaRegistryLocation, dbName, <MASK><NEW_LINE>}
uri, outputDir, addSrcs, _manager);
1,205,410
public void execute() {<NEW_LINE>EntityPlayer player <MASK><NEW_LINE>if (DarkSteelController.isNightVisionUpgradeEquipped(player)) {<NEW_LINE>boolean isActive = !StateController.isActive(player, NightVisionUpgrade.INSTANCE);<NEW_LINE>if (isActive) {<NEW_LINE>SoundHelper.playSound(player.world, player, SoundRegistry.NIGHTVISION_ON, 0.1f, player.world.rand.nextFloat() * 0.4f - 0.2f + 1.0f);<NEW_LINE>} else {<NEW_LINE>SoundHelper.playSound(player.world, player, SoundRegistry.NIGHTVISION_OFF, 0.1f, 1.0f);<NEW_LINE>}<NEW_LINE>StateController.setActive(player, NightVisionUpgrade.INSTANCE, isActive);<NEW_LINE>StringUtil.sendEnabledChatMessage(Minecraft.getMinecraft().player, NightVisionUpgrade.INSTANCE.getUnlocalizedName(), isActive);<NEW_LINE>}<NEW_LINE>}
= Minecraft.getMinecraft().player;
17,702
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>// Views<NEW_LINE>mStatusTextView = findViewById(R.id.status);<NEW_LINE>// Button listeners<NEW_LINE>findViewById(R.id.sign_in_button).setOnClickListener(this);<NEW_LINE>findViewById(R.id.sign_out_button).setOnClickListener(this);<NEW_LINE>findViewById(R.id.disconnect_button).setOnClickListener(this);<NEW_LINE>// [START configure_signin]<NEW_LINE>// Configure sign-in to request the user's ID, email address, and basic<NEW_LINE>// profile. ID and basic profile are included in DEFAULT_SIGN_IN.<NEW_LINE>GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN).requestEmail().build();<NEW_LINE>// [END configure_signin]<NEW_LINE>// [START build_client]<NEW_LINE>// Build a GoogleSignInClient with the options specified by gso.<NEW_LINE>mGoogleSignInClient = GoogleSignIn.getClient(this, gso);<NEW_LINE>// [END build_client]<NEW_LINE>// [START customize_button]<NEW_LINE>// Set the dimensions of the sign-in button.<NEW_LINE>SignInButton signInButton = findViewById(R.id.sign_in_button);<NEW_LINE><MASK><NEW_LINE>signInButton.setColorScheme(SignInButton.COLOR_LIGHT);<NEW_LINE>// [END customize_button]<NEW_LINE>}
signInButton.setSize(SignInButton.SIZE_STANDARD);
1,084,874
@Consumes(MediaType.APPLICATION_JSON)<NEW_LINE>@Produces(MediaType.APPLICATION_JSON)<NEW_LINE>@Operation(description = "Set the specified service metadata. Caller must have update privileges on the sys.auth domain.")<NEW_LINE>public void putServiceIdentitySystemMeta(@Parameter(description = "name of the domain", required = true) @PathParam("domain") String domain, @Parameter(description = "name of the service", required = true) @PathParam("service") String service, @Parameter(description = "name of the system attribute to be modified", required = true) @PathParam("attribute") String attribute, @Parameter(description = "Audit param required(not empty) if domain auditEnabled is true.", required = true) @HeaderParam("Y-Audit-Ref") String auditRef, @Parameter(description = "ServiceIdentitySystemMeta object with updated attribute values", required = true) ServiceIdentitySystemMeta detail) {<NEW_LINE>int code = ResourceException.OK;<NEW_LINE>ResourceContext context = null;<NEW_LINE>try {<NEW_LINE>context = this.delegate.newResourceContext(this.request, this.response, "putServiceIdentitySystemMeta");<NEW_LINE>context.authorize("update", "sys.auth:meta.service." + attribute + <MASK><NEW_LINE>this.delegate.putServiceIdentitySystemMeta(context, domain, service, attribute, auditRef, detail);<NEW_LINE>} catch (ResourceException e) {<NEW_LINE>code = e.getCode();<NEW_LINE>switch(code) {<NEW_LINE>case ResourceException.BAD_REQUEST:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.CONFLICT:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.FORBIDDEN:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.NOT_FOUND:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.TOO_MANY_REQUESTS:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>case ResourceException.UNAUTHORIZED:<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>default:<NEW_LINE>System.err.println("*** Warning: undeclared exception (" + code + ") for resource putServiceIdentitySystemMeta");<NEW_LINE>throw typedException(code, e, ResourceError.class);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>this.delegate.publishChangeMessage(context, code);<NEW_LINE>this.delegate.recordMetrics(context, code);<NEW_LINE>}<NEW_LINE>}
"." + domain + "", null);
642,101
public static MDLocalVariable create38(long[] args, MetadataValueList md) {<NEW_LINE>// this apparently exists for historical reasons...<NEW_LINE>final int argOffset = (args.length > OFFSET_INDICATOR && ((args[ARGINDEX_38_TAG_ALIGNMENT] & ALIGNMENT_INDICATOR) <MASK><NEW_LINE>final long line = args[ARGINDEX_38_LINE + argOffset];<NEW_LINE>final long arg = args[ARGINDEX_38_ARG + argOffset];<NEW_LINE>final long flags = args[ARGINDEX_38_FLAGS + argOffset];<NEW_LINE>final MDLocalVariable localVariable = new MDLocalVariable(line, arg, flags);<NEW_LINE>localVariable.setScope(md.getNullable(args[ARGINDEX_38_SCOPE + argOffset], localVariable));<NEW_LINE>localVariable.setName(md.getNullable(args[ARGINDEX_38_NAME + argOffset], localVariable));<NEW_LINE>localVariable.setFile(md.getNullable(args[ARGINDEX_38_FILE + argOffset], localVariable));<NEW_LINE>localVariable.setType(md.getNullable(args[ARGINDEX_38_TYPE + argOffset], localVariable));<NEW_LINE>return localVariable;<NEW_LINE>}
== 0)) ? 1 : 0;
816,528
private static boolean isImmutableType(CompilationInfo info, TypeMirror m, Preferences p) {<NEW_LINE>if (m == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (m.getKind().isPrimitive() || !isValidType(m)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (Utilities.isPrimitiveWrapperType(m)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (m.getKind() != TypeKind.DECLARED) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Element e = ((<MASK><NEW_LINE>if (e == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (e.getKind() == ElementKind.ENUM) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (e.getKind() != ElementKind.CLASS) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String qn = ((TypeElement) e).getQualifiedName().toString();<NEW_LINE>if (IMMUTABLE_JDK_CLASSES.contains(qn)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>List<String> classes = getImmutableTypes(p);<NEW_LINE>return classes.contains(qn);<NEW_LINE>}
DeclaredType) m).asElement();
1,734,906
// End of variables declaration//GEN-END:variables<NEW_LINE>private void initAccesibility() {<NEW_LINE>addFriendButton.getAccessibleContext().setAccessibleDescription(getMessage("ACSD_AddFriendButton"));<NEW_LINE>removeFriendButton.getAccessibleContext().setAccessibleDescription(getMessage("ACSD_RemoveFriendButton"));<NEW_LINE>cnbValue.getAccessibleContext().setAccessibleDescription(getMessage("ACSD_CnbValue"));<NEW_LINE>majorRelVerValue.getAccessibleContext().setAccessibleDescription(getMessage("ACSD_MajorRelVerValue"));<NEW_LINE>specificationVerValue.getAccessibleContext().setAccessibleDescription(getMessage("ACSD_SpecificationVerValuea"));<NEW_LINE>appendImpl.getAccessibleContext().setAccessibleDescription(getMessage("ACSD_AppendImpl"));<NEW_LINE>implVerValue.getAccessibleContext().setAccessibleDescription(getMessage("ACSD_ImplVerValue"));<NEW_LINE>regularMod.getAccessibleContext().setAccessibleDescription(getMessage("ACSD_RegularMod"));<NEW_LINE>autoloadMod.getAccessibleContext().setAccessibleDescription(getMessage("ACSD_AutoloadMod"));<NEW_LINE>eagerMod.getAccessibleContext()<MASK><NEW_LINE>publicPkgsTable.getAccessibleContext().setAccessibleDescription(getMessage("ACSD_PublicPkgsTable"));<NEW_LINE>tokensValue.getAccessibleContext().setAccessibleDescription(getMessage("ACSD_TokensValue"));<NEW_LINE>}
.setAccessibleDescription(getMessage("ACSD_EagerMod"));
793,668
final DescribePartnerEventSourceResult executeDescribePartnerEventSource(DescribePartnerEventSourceRequest describePartnerEventSourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describePartnerEventSourceRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribePartnerEventSourceRequest> request = null;<NEW_LINE>Response<DescribePartnerEventSourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribePartnerEventSourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describePartnerEventSourceRequest));<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, "CloudWatch Events");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribePartnerEventSource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribePartnerEventSourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribePartnerEventSourceResultJsonUnmarshaller());<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();
520,842
public void applyEnterCodegen(CodegenMethod method, CodegenClassScope classScope, CodegenNamedMethods namedMethods, AggregationClassNames classNames) {<NEW_LINE>method.getBlock().apply(instblock(classScope, "qAggregationGroupedApplyEnterLeave", constantTrue(), constant(aggGroupByDesc.getNumMethods()), constant(aggGroupByDesc.getNumAccess()), REF_GROUPKEY));<NEW_LINE>if (aggGroupByDesc.isReclaimAged()) {<NEW_LINE>AggSvcGroupByReclaimAgedImpl.applyEnterCodegenSweep(method, classScope, classNames);<NEW_LINE>}<NEW_LINE>if (hasRefCounting()) {<NEW_LINE>method.getBlock().localMethod(handleRemovedKeysCodegen(method, classScope));<NEW_LINE>}<NEW_LINE>CodegenBlock block = method.getBlock().assignRef(MEMBER_CURRENTROW, cast(classNames.getRowTop(), exprDotMethod(<MASK><NEW_LINE>block.ifCondition(equalsNull(MEMBER_CURRENTROW)).assignRef(MEMBER_CURRENTROW, CodegenExpressionBuilder.newInstance(classNames.getRowTop())).exprDotMethod(MEMBER_AGGREGATORSPERGROUP, "put", REF_GROUPKEY, MEMBER_CURRENTROW);<NEW_LINE>if (hasRefCounting()) {<NEW_LINE>block.exprDotMethod(MEMBER_CURRENTROW, "increaseRefcount");<NEW_LINE>}<NEW_LINE>if (aggGroupByDesc.isReclaimAged()) {<NEW_LINE>block.exprDotMethod(MEMBER_CURRENTROW, "setLastUpdateTime", ref("currentTime"));<NEW_LINE>}<NEW_LINE>block.exprDotMethod(MEMBER_CURRENTROW, "applyEnter", REF_EPS, REF_EXPREVALCONTEXT).apply(instblock(classScope, "aAggregationGroupedApplyEnterLeave", constantTrue()));<NEW_LINE>}
MEMBER_AGGREGATORSPERGROUP, "get", REF_GROUPKEY)));
696,550
public boolean checkAndApply(SameDiff sd, OptimizationHelper helper, SameDiffOp op, ArrayHolder constantArrays, ArrayHolder variablesArrays) {<NEW_LINE>if (!(op.getOp() instanceof Permute))<NEW_LINE>return false;<NEW_LINE>List<String> inputs = op.getInputsToOp();<NEW_LINE>String input = inputs.get(0);<NEW_LINE>List<String> <MASK><NEW_LINE>toFuse.add(op.getName());<NEW_LINE>String currInput = input;<NEW_LINE>while (currInput != null) {<NEW_LINE>Variable v = sd.getVariables().get(currInput);<NEW_LINE>// In order to fuse permute operations, we require:<NEW_LINE>// (a) the intermediate variable is ONLY needed by the next permute<NEW_LINE>// (b) the permute dimensions are constant,<NEW_LINE>if (v.getInputsForOp().size() > 1)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (toFuse.size() > 1) {<NEW_LINE>// Fuse the permute ops<NEW_LINE>// return true;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
toFuse = new ArrayList<>();
63,945
private boolean addWayTag(OSMTag osmTag, String[] equivalentValues) {<NEW_LINE>if (this.stringToWayTag.containsKey(osmTag.tagKey())) {<NEW_LINE>LOGGER.warning("duplicate osm-tag found in tag-mapping configuration (ignoring): " + osmTag);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>LOGGER.finest("adding way: " + osmTag);<NEW_LINE>this.stringToWayTag.put(<MASK><NEW_LINE>if (equivalentValues != null) {<NEW_LINE>for (String equivalentValue : equivalentValues) {<NEW_LINE>this.stringToWayTag.put(OSMTag.tagKey(osmTag.getKey(), equivalentValue), osmTag);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.idToWayTag.put(Short.valueOf(this.wayID), osmTag);<NEW_LINE>// also fill optimization mapping with identity<NEW_LINE>this.optimizedWayIds.put(Short.valueOf(this.wayID), Short.valueOf(this.wayID));<NEW_LINE>return true;<NEW_LINE>}
osmTag.tagKey(), osmTag);
253,831
static Stream<Edge> generateRules_PreOutVrf_PreOutInterfaceDisposition(Predicate<String> includedNode, Map<String, Map<String, Map<String, BDD>>> dispositionBddMap, StateExprConstructor2 preOutVrfConstructor, StateExprConstructor2 preOutInterfaceDispositionConstructor, BiFunction<String, String, BDD> interfaceOutConstraint) {<NEW_LINE>return dispositionBddMap.entrySet().stream().filter(byNodeEntry -> includedNode.test(byNodeEntry.getKey())).flatMap(nodeEntry -> {<NEW_LINE>String hostname = nodeEntry.getKey();<NEW_LINE>return nodeEntry.getValue().entrySet().stream().flatMap(vrfEntry -> {<NEW_LINE>String vrfName = vrfEntry.getKey();<NEW_LINE>StateExpr preState = <MASK><NEW_LINE>return vrfEntry.getValue().entrySet().stream().filter(e -> !e.getValue().isZero()).map(ifaceEntry -> {<NEW_LINE>String ifaceName = ifaceEntry.getKey();<NEW_LINE>BDD bdd = ifaceEntry.getValue();<NEW_LINE>BDD forIface = interfaceOutConstraint.apply(hostname, ifaceName);<NEW_LINE>return new Edge(preState, preOutInterfaceDispositionConstructor.apply(hostname, ifaceName), forIface.and(bdd));<NEW_LINE>});<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
preOutVrfConstructor.apply(hostname, vrfName);
939,448
private String refreshAccessToken(Account account) {<NEW_LINE>String refreshToken = mRedditDataRoomDatabase.accountDao().getCurrentAccount().getRefreshToken();<NEW_LINE>RedditAPI api = mRetrofit.create(RedditAPI.class);<NEW_LINE>Map<String, String> params = new HashMap<>();<NEW_LINE>params.put(APIUtils.GRANT_TYPE_KEY, APIUtils.GRANT_TYPE_REFRESH_TOKEN);<NEW_LINE>params.put(APIUtils.REFRESH_TOKEN_KEY, refreshToken);<NEW_LINE>Call<String> accessTokenCall = api.getAccessToken(APIUtils.getHttpBasicAuthHeader(), params);<NEW_LINE>try {<NEW_LINE>retrofit2.Response<String> response = accessTokenCall.execute();<NEW_LINE>if (response.isSuccessful() && response.body() != null) {<NEW_LINE>JSONObject jsonObject = new JSONObject(response.body());<NEW_LINE>String newAccessToken = jsonObject.getString(APIUtils.ACCESS_TOKEN_KEY);<NEW_LINE>String newRefreshToken = jsonObject.has(APIUtils.REFRESH_TOKEN_KEY) ? jsonObject.getString(APIUtils.REFRESH_TOKEN_KEY) : null;<NEW_LINE>if (newRefreshToken == null) {<NEW_LINE>mRedditDataRoomDatabase.accountDao().updateAccessToken(<MASK><NEW_LINE>} else {<NEW_LINE>mRedditDataRoomDatabase.accountDao().updateAccessTokenAndRefreshToken(account.getAccountName(), newAccessToken, newRefreshToken);<NEW_LINE>}<NEW_LINE>if (mCurrentAccountSharedPreferences.getString(SharedPreferencesUtils.ACCOUNT_NAME, "").equals(account.getAccountName())) {<NEW_LINE>mCurrentAccountSharedPreferences.edit().putString(SharedPreferencesUtils.ACCESS_TOKEN, newAccessToken).apply();<NEW_LINE>}<NEW_LINE>return newAccessToken;<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>} catch (IOException | JSONException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>}
account.getAccountName(), newAccessToken);
665,400
public S3LogsConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>S3LogsConfiguration s3LogsConfiguration = new S3LogsConfiguration();<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("enable", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>s3LogsConfiguration.setEnable(context.getUnmarshaller(Boolean.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return s3LogsConfiguration;<NEW_LINE>}
class).unmarshall(context));
421,550
public void testQueueNameQUEUE_B(HttpServletRequest request, HttpServletResponse response) throws Throwable {<NEW_LINE><MASK><NEW_LINE>Queue queue = jmsContext.createQueue("QUEUE/queue");<NEW_LINE>JMSProducer jmsProducer = jmsContext.createProducer();<NEW_LINE>String text = "testQueueNameQUEUE_B";<NEW_LINE>jmsProducer.send(queue, text);<NEW_LINE>JMSConsumer jmsConsumer = jmsContext.createConsumer(queue);<NEW_LINE>TextMessage m = (TextMessage) jmsConsumer.receive(30000);<NEW_LINE>String failureReason = null;<NEW_LINE>if (m == null) {<NEW_LINE>failureReason = "Null message; expected [ " + text + " ]";<NEW_LINE>} else if (m.getText() == null) {<NEW_LINE>failureReason = "Null message text; exected [ " + text + " ]";<NEW_LINE>} else if (!m.getText().equals(text)) {<NEW_LINE>failureReason = "Received [ " + m.getText() + " ]; expected [ " + text + " ]";<NEW_LINE>}<NEW_LINE>jmsConsumer.close();<NEW_LINE>jmsContext.close();<NEW_LINE>if (failureReason != null) {<NEW_LINE>throw new Exception("testQueueNameQUEUE_B failed: " + failureReason);<NEW_LINE>}<NEW_LINE>}
JMSContext jmsContext = jmsQCFBindings.createContext();
1,437,928
private void onClickList(View v) {<NEW_LINE>final String[] files = getFileList();<NEW_LINE>if (files == null || files.length < 1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (mIsRunning) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mIsRunning = true;<NEW_LINE>setButtonsEnabledState();<NEW_LINE>final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());<NEW_LINE>builder.<MASK><NEW_LINE>final ListView listView = new ListView(getActivity());<NEW_LINE>registerForContextMenu(listView);<NEW_LINE>final ArrayAdapter<String> modeAdapter = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1, android.R.id.text1, files);<NEW_LINE>listView.setAdapter(modeAdapter);<NEW_LINE>builder.setView(listView);<NEW_LINE>mListFileDialog = builder.create();<NEW_LINE>mListFileDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onDismiss(DialogInterface dialog) {<NEW_LINE>mIsRunning = false;<NEW_LINE>setButtonsEnabledState();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onItemClick(AdapterView<?> parent, View view, int position, long id) {<NEW_LINE>File file = new File(getActivity().getExternalFilesDir(null), files[position]);<NEW_LINE>shareFile(file);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mListFileDialog.show();<NEW_LINE>}
setTitle(R.string.select_file);
566,859
public LineWrapper append(CharSequence cs) {<NEW_LINE>Mode mode = Mode.INIT;<NEW_LINE>int b = 0;<NEW_LINE>for (int f = 0; f < cs.length(); f++) {<NEW_LINE>char c = cs.charAt(f);<NEW_LINE>if (c == '\n') {<NEW_LINE>if (mode == Mode.SPACE) {<NEW_LINE>appendSpace(cs.subSequence(b, f));<NEW_LINE>} else if (mode == Mode.WORD) {<NEW_LINE>appendWord(cs.subSequence(b, f));<NEW_LINE>}<NEW_LINE>mode = Mode.INIT;<NEW_LINE>appendLinesep();<NEW_LINE>b = f + 1;<NEW_LINE>} else if (Character.isWhitespace(c)) {<NEW_LINE>if (mode == Mode.WORD) {<NEW_LINE>appendWord(cs.subSequence(b, f));<NEW_LINE>b = f;<NEW_LINE>}<NEW_LINE>mode = Mode.SPACE;<NEW_LINE>} else {<NEW_LINE>if (mode == Mode.SPACE) {<NEW_LINE>appendSpace(cs<MASK><NEW_LINE>b = f;<NEW_LINE>}<NEW_LINE>mode = Mode.WORD;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mode == Mode.WORD) {<NEW_LINE>appendWord(cs.subSequence(b, cs.length()));<NEW_LINE>} else if (mode == Mode.SPACE) {<NEW_LINE>appendSpace(cs.subSequence(b, cs.length()));<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
.subSequence(b, f));
589,760
public void printSum(ImageType.Family family) {<NEW_LINE>String bitWise = input.getBitWise();<NEW_LINE>String columns = family == ImageType.Family.INTERLEAVED ? "*img.numBands" : "";<NEW_LINE><MASK><NEW_LINE>String numTo = input.getSumNumberToType();<NEW_LINE>out.print("\tpublic static " + sumType + " sum( " + input.getImageName(family) + " img ) {\n" + "\n" + "\t\tfinal int rows = img.height;\n" + "\t\tfinal int columns = img.width" + columns + ";\n" + "\n" + "\t\t//CONCURRENT_REMOVE_BELOW\n" + "\t\t" + sumType + " total = 0;\n" + "\n" + "\t\t//CONCURRENT_INLINE return BoofConcurrency.sum(0,img.height," + sumType + ".class,y->{\n" + "\t\t\t//CONCURRENT_BELOW " + sumType + " total = 0;\n" + "\t\tfor (int y = 0; y < rows; y++) {\n" + "\t\t\tint index = img.startIndex + y * img.stride;\n" + "\t\t\t\n" + "\t\t\tint indexEnd = index+columns;\n" + "\t\t\tfor (; index < indexEnd; index++ ) {\n" + "\t\t\t\ttotal += img.data[index] " + bitWise + ";\n" + "\t\t\t}\n" + "\t\t} return total;\n" + "\t\t//CONCURRENT_ABOVE return total;})." + numTo + ";\n" + "\t}\n\n");<NEW_LINE>}
String sumType = input.getSumType();
468,465
private List<Cctop119V> createCctop119VList(final List<EDICctop119VType> xmlCctop119VList, final DecimalFormat decimalFormat) {<NEW_LINE>final List<Cctop119V> cctop119VList = new ArrayList<>();<NEW_LINE>for (final EDICctop119VType xmlCctop119V : xmlCctop119VList) {<NEW_LINE>if (isEmpty(xmlCctop119V.getGLN())) {<NEW_LINE>throw new RuntimeCamelException(xmlCctop119V + " must have a GLN");<NEW_LINE>}<NEW_LINE>if (isEmpty(xmlCctop119V.getVATaxID())) {<NEW_LINE>throw new RuntimeCamelException(xmlCctop119V + " must have a VATTaxID");<NEW_LINE>}<NEW_LINE>final Cctop119V cctop119V = new Cctop119V();<NEW_LINE>cctop119V.setCbPartnerLocationID(formatNumber(xmlCctop119V.getCBPartnerLocationID(), decimalFormat));<NEW_LINE>cctop119V.setcInvoiceID(formatNumber(xmlCctop119V.getCInvoiceID(), decimalFormat));<NEW_LINE>cctop119V.setmInOutID(formatNumber(xmlCctop119V.getMInOutID(), decimalFormat));<NEW_LINE>if (!isEmpty(xmlCctop119V.getAddress1())) {<NEW_LINE>cctop119V.setAddress1(normalize(xmlCctop119V.getAddress1()));<NEW_LINE>} else {<NEW_LINE>if (isEmpty(xmlCctop119V.getAddress2())) {<NEW_LINE>throw new RuntimeCamelException(xmlCctop119V + " must have at least one filled address");<NEW_LINE>}<NEW_LINE>cctop119V.setAddress1(normalize(xmlCctop119V.getAddress2()));<NEW_LINE>}<NEW_LINE>cctop119V.setAddress2(normalize(xmlCctop119V.getAddress2()));<NEW_LINE>cctop119V.setCity(xmlCctop119V.getCity());<NEW_LINE>cctop119V.setCountryCode(xmlCctop119V.getCountryCode());<NEW_LINE>cctop119V.setEancomLocationtype(xmlCctop119V.getEancomLocationtype());<NEW_LINE>cctop119V.setFax(xmlCctop119V.getFax());<NEW_LINE>cctop119V.<MASK><NEW_LINE>cctop119V.setName(normalize(xmlCctop119V.getName()));<NEW_LINE>cctop119V.setName2(normalize(xmlCctop119V.getName2()));<NEW_LINE>cctop119V.setPhone(xmlCctop119V.getPhone());<NEW_LINE>cctop119V.setPostal(xmlCctop119V.getPostal());<NEW_LINE>cctop119V.setValue(xmlCctop119V.getValue());<NEW_LINE>cctop119V.setVaTaxID(xmlCctop119V.getVATaxID().trim());<NEW_LINE>cctop119V.setReferenceNo(xmlCctop119V.getReferenceNo());<NEW_LINE>cctop119VList.add(cctop119V);<NEW_LINE>}<NEW_LINE>return cctop119VList;<NEW_LINE>}
setGln(xmlCctop119V.getGLN());
1,729,663
void fcfs(int[] arr, int head, int size) {<NEW_LINE>int seek_count = 0;<NEW_LINE>int distance, cur_track;<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>cur_track = arr[i];<NEW_LINE>// calculate absolute distance<NEW_LINE>distance = Math.abs(cur_track - head);<NEW_LINE>System.out.println("Head movement: " + cur_track + "-" + head + " = " + distance);<NEW_LINE>// increment the total count<NEW_LINE>seek_count += distance;<NEW_LINE>// accessed track is now new head<NEW_LINE>head = cur_track;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>System.out.println("Total Seek Time :" + seek_count);<NEW_LINE>System.out.println(" ");<NEW_LINE>// Seek sequence would be the same as request array sequence<NEW_LINE>System.out.print("Seek Sequence is :" + " ");<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>System.out.print(arr[i] + " ");<NEW_LINE>}<NEW_LINE>System.out.println(" ");<NEW_LINE>}
System.out.println(" ");
553,222
public void draw(GenericCrafterBuild build) {<NEW_LINE>Draw.rect(build.block.region, <MASK><NEW_LINE>Drawf.liquid(middle, build.x, build.y, build.warmup, plantColor);<NEW_LINE>Draw.color(bottomColor, plantColorLight, build.warmup);<NEW_LINE>rand.setSeed(build.pos());<NEW_LINE>for (int i = 0; i < bubbles; i++) {<NEW_LINE>float x = rand.range(spread), y = rand.range(spread);<NEW_LINE>float life = 1f - ((Time.time / timeScl + rand.random(recurrence)) % recurrence);<NEW_LINE>if (life > 0) {<NEW_LINE>Lines.stroke(build.warmup * (life + strokeMin));<NEW_LINE>Lines.poly(build.x + x, build.y + y, sides, (1f - life) * radius);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Draw.color();<NEW_LINE>Draw.rect(top, build.x, build.y);<NEW_LINE>}
build.x, build.y);
718,749
private void updateStats() {<NEW_LINE>final Runtime runtime = Runtime.getRuntime();<NEW_LINE>final long heapMemory = runtime.totalMemory() - runtime.freeMemory();<NEW_LINE>final StringBuilder sb = new StringBuilder(DEFAULT_MESSAGE_SIZE);<NEW_LINE>// When changing format of output below, make sure to sync "run_comparison.py" as well<NEW_LINE>sb.append("Heap: ");<NEW_LINE>appendSize(sb, heapMemory);<NEW_LINE>sb.append(" Java ");<NEW_LINE>appendSize(sb, Debug.getNativeHeapSize());<NEW_LINE>sb.append(" native\n");<NEW_LINE>appendTime(sb, "Avg wait time: ", mPerfListener.getAverageWaitTime(), "\n");<NEW_LINE>appendNumber(sb, "Requests: ", mPerfListener.getOutstandingRequests(), " outsdng ");<NEW_LINE>appendNumber(sb, "", <MASK><NEW_LINE>final String message = sb.toString();<NEW_LINE>mStatsDisplay.setText(message);<NEW_LINE>FLog.i(TAG, message);<NEW_LINE>}
mPerfListener.getCancelledRequests(), " cncld\n");
1,352,491
public com.amazonaws.services.costexplorer.model.UnresolvableUsageUnitException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.costexplorer.model.UnresolvableUsageUnitException unresolvableUsageUnitException = new com.amazonaws.services.costexplorer.model.UnresolvableUsageUnitException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} 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 unresolvableUsageUnitException;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,587,832
public ApplicationLayerAutomaticResponseConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ApplicationLayerAutomaticResponseConfiguration applicationLayerAutomaticResponseConfiguration = new ApplicationLayerAutomaticResponseConfiguration();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Status", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>applicationLayerAutomaticResponseConfiguration.setStatus(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Action", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>applicationLayerAutomaticResponseConfiguration.setAction(ResponseActionJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return applicationLayerAutomaticResponseConfiguration;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,039,416
public static void decompress(DataInput in, byte[] out, int len) throws IOException {<NEW_LINE>final int saved = len >>> 2;<NEW_LINE>int compressedLen = len - saved;<NEW_LINE>// 1. Copy the packed bytes<NEW_LINE>in.<MASK><NEW_LINE>// 2. Restore the leading 2 bits of each packed byte into whole bytes<NEW_LINE>for (int i = 0; i < saved; ++i) {<NEW_LINE>out[compressedLen + i] = (byte) (((out[i] & 0xC0) >>> 2) | ((out[saved + i] & 0xC0) >>> 4) | ((out[(saved << 1) + i] & 0xC0) >>> 6));<NEW_LINE>}<NEW_LINE>// 3. Move back to the original range. This loop gets auto-vectorized on JDK13+.<NEW_LINE>for (int i = 0; i < len; ++i) {<NEW_LINE>final byte b = out[i];<NEW_LINE>out[i] = (byte) (((b & 0x1F) | 0x20 | ((b & 0x20) << 1)) - 1);<NEW_LINE>}<NEW_LINE>// 4. Restore exceptions<NEW_LINE>final int numExceptions = in.readVInt();<NEW_LINE>int i = 0;<NEW_LINE>for (int exception = 0; exception < numExceptions; ++exception) {<NEW_LINE>i += in.readByte() & 0xFF;<NEW_LINE>out[i] = in.readByte();<NEW_LINE>}<NEW_LINE>}
readBytes(out, 0, compressedLen);
1,189,069
private void resizeChildOfContent() {<NEW_LINE>int newHeight = calculateUsedHeight();<NEW_LINE>if (newHeight != oldHeight && mChild != null && frameLayoutParams != null) {<NEW_LINE>int sipHeight = mChild.getRootView().getHeight();<NEW_LINE>int heightDiff = sipHeight - newHeight;<NEW_LINE>if (heightDiff > (sipHeight / 4)) {<NEW_LINE>// keyboard probably just became visible<NEW_LINE>frameLayoutParams.height = sipHeight - heightDiff;<NEW_LINE>} else {<NEW_LINE>// keyboard probably just became hidden<NEW_LINE>frameLayoutParams.height = sipHeight;<NEW_LINE>}<NEW_LINE>if (!BaseActivity.getFullScreenMode()) {<NEW_LINE>frameLayoutParams.height = frameLayoutParams.height - notificationBarHeight;<NEW_LINE>if (heightDiff > (sipHeight / 4)) {<NEW_LINE>frameLayoutParams<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>mChild.requestLayout();<NEW_LINE>oldHeight = newHeight;<NEW_LINE>}<NEW_LINE>}
.height = frameLayoutParams.height + notificationBarHeight;
154,018
private String applySubstitutions(String originalValue, Iterable<Substitution> substitutions, Object[] methodArguments) {<NEW_LINE>String result = originalValue;<NEW_LINE>if (methodArguments == null) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>for (Substitution substitution : substitutions) {<NEW_LINE>final int substitutionParameterIndex = substitution.getMethodParameterIndex();<NEW_LINE>if (0 <= substitutionParameterIndex && substitutionParameterIndex < methodArguments.length) {<NEW_LINE>final Object methodArgument = methodArguments[substitutionParameterIndex];<NEW_LINE>String substitutionValue = serialize(serializer, methodArgument);<NEW_LINE>if (substitutionValue != null && !substitutionValue.isEmpty() && substitution.shouldEncode()) {<NEW_LINE>substitutionValue = <MASK><NEW_LINE>}<NEW_LINE>// if a parameter is null, we treat it as empty string. This is<NEW_LINE>// assuming no {...} will be allowed otherwise in a path template<NEW_LINE>if (substitutionValue == null) {<NEW_LINE>substitutionValue = "";<NEW_LINE>}<NEW_LINE>result = result.replace("{" + substitution.getUrlParameterName() + "}", substitutionValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
UrlEscapers.PATH_ESCAPER.escape(substitutionValue);
626,034
public GetAnomalyMonitorsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetAnomalyMonitorsResult getAnomalyMonitorsResult = new GetAnomalyMonitorsResult();<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 getAnomalyMonitorsResult;<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("AnomalyMonitors", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getAnomalyMonitorsResult.setAnomalyMonitors(new ListUnmarshaller<AnomalyMonitor>(AnomalyMonitorJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("NextPageToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getAnomalyMonitorsResult.setNextPageToken(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 getAnomalyMonitorsResult;<NEW_LINE>}
)).unmarshall(context));
1,359,579
private List<ReplicaId> createNewInstance(DataNodeConfig dataNodeConfig) throws Exception {<NEW_LINE>String instanceName = dataNodeConfig.getInstanceName();<NEW_LINE>logger.<MASK><NEW_LINE>AmbryDataNode datanode = new AmbryServerDataNode(dataNodeConfig.getDatacenterName(), clusterMapConfig, dataNodeConfig.getHostName(), dataNodeConfig.getPort(), dataNodeConfig.getRackId(), dataNodeConfig.getSslPort(), dataNodeConfig.getHttp2Port(), DEFAULT_XID, helixClusterManagerCallback);<NEW_LINE>// for new instance, we first set it to unavailable and rely on its participation to update its liveness<NEW_LINE>if (!instanceName.equals(selfInstanceName)) {<NEW_LINE>datanode.setState(HardwareState.UNAVAILABLE);<NEW_LINE>}<NEW_LINE>List<ReplicaId> addedReplicas = initializeDisksAndReplicasOnNode(datanode, dataNodeConfig);<NEW_LINE>instanceNameToAmbryDataNode.put(instanceName, datanode);<NEW_LINE>return addedReplicas;<NEW_LINE>}
info("Adding node {} and its disks and replicas in {}", instanceName, dcName);
685,775
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>mRootView = inflater.inflate(R.layout.fragment_main, container, false);<NEW_LINE>mRootView.findViewById(R.id.btnScanQRCode).setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>mRootView.findViewById(R.id.progressBar1).setVisibility(View.VISIBLE);<NEW_LINE>Intent i = new Intent(getActivity(), CaptureActivity.class);<NEW_LINE>i.setAction("com.google.zxing.client.android.SCAN");<NEW_LINE>getActivity().startActivityForResult(i, 0);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mRootView.findViewById(R.id.btnShowQR).setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>getActivity().startActivityForResult(Kp2aControl<MASK><NEW_LINE>Log.d("QR", "ShowqR");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mRootView.findViewById(R.id.btnConfigPlugins).setOnClickListener(new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>try {<NEW_LINE>Intent i = new Intent(Strings.ACTION_EDIT_PLUGIN_SETTINGS);<NEW_LINE>i.putExtra(Strings.EXTRA_PLUGIN_PACKAGE, getActivity().getPackageName());<NEW_LINE>startActivityForResult(i, 123);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return mRootView;<NEW_LINE>}
.getQueryEntryIntent(null), 124);
1,111,034
public ExitCode runWithoutHelp(CommandRunnerParams params) throws Exception {<NEW_LINE>// Input validation<NEW_LINE>if (remoteRepo != null && toMavenCentral) {<NEW_LINE>throw new CommandLineException("please specify only a single remote repository to publish to.\n" + "Use " + REMOTE_REPO_LONG_ARG + " <URL> or " + TO_MAVEN_CENTRAL_LONG_ARG + " but not both.");<NEW_LINE>}<NEW_LINE>if (remoteRepo == null && !toMavenCentral) {<NEW_LINE>throw new CommandLineException("please specify a remote repository to publish to.\n" + "Use " + REMOTE_REPO_LONG_ARG + " <URL> or " + TO_MAVEN_CENTRAL_LONG_ARG);<NEW_LINE>}<NEW_LINE>// Build the specified target(s).<NEW_LINE>assertArguments(params);<NEW_LINE>BuildRunResult buildRunResult;<NEW_LINE>try (CommandThreadManager pool = new CommandThreadManager("Publish", getConcurrencyLimit(params.getBuckConfig()))) {<NEW_LINE>buildRunResult = super.run(params, pool, this::enhanceFlavorsForPublishing, ImmutableSet.of());<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (exitCode != ExitCode.SUCCESS) {<NEW_LINE>return exitCode;<NEW_LINE>}<NEW_LINE>// Publish starting with the given targets.<NEW_LINE>publishTargets(buildRunResult.getBuildTargets(), params);<NEW_LINE>return ExitCode.SUCCESS;<NEW_LINE>}
ExitCode exitCode = buildRunResult.getExitCode();
486,243
private int fillMetaDbDataSourceInfo(ArrayResultCursor result, int index) {<NEW_LINE>DataSource dataSource = MetaDbDataSource.getInstance().getDataSource();<NEW_LINE>if (dataSource instanceof MetaDbDataSource.MetaDbDataSourceHaWrapper) {<NEW_LINE>MetaDbDataSource.MetaDbDataSourceHaWrapper dsHaWrapper = (MetaDbDataSource.MetaDbDataSourceHaWrapper) dataSource;<NEW_LINE>final DataSource phyDataSource = dsHaWrapper.getRawDataSource();<NEW_LINE>String appName = "None";<NEW_LINE>String grpName = "MetaDB";<NEW_LINE>String dbKey = "MetaDbKey";<NEW_LINE>String storageInstId = StorageHaManager.getInstance().getMetaDbStorageInstId();<NEW_LINE>if (phyDataSource instanceof XDataSource) {<NEW_LINE>final <MASK><NEW_LINE>final XDataSource x = (XDataSource) phyDataSource;<NEW_LINE>final XClientPool.XStatus s = x.getStatus();<NEW_LINE>result.addRow(new Object[] { index++, appName, x.getName(), grpName, x.getUrl(), XConnectionManager.getInstance().isEnableAuth() ? x.getUsername() : XConfig.X_USER, XConfig.X_TYPE, 0, m.getMinPooledSessionPerInstance(), m.getMaxClientPerInstance() * m.getMaxSessionPerClient(), MetaDbDataSource.getInstance().getConf().getIdleTimeout(), x.getGetConnTimeoutMillis(), DynamicConfig.getInstance().getXprotoMaxDnWaitConnection(), DynamicConfig.getInstance().getXprotoMaxDnConcurrent(), s.workingSession, s.idleSession, dbKey, "10", "10", storageInstId });<NEW_LINE>} else {<NEW_LINE>throw new NotSupportException("jdbc not support");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return index;<NEW_LINE>}
XConnectionManager m = XConnectionManager.getInstance();
1,443,690
public static Collection<RegressionExecution> executions() {<NEW_LINE>ArrayList<RegressionExecution> execs = new ArrayList<>();<NEW_LINE>execs.add(new ResultSetOutputFirstWhenThen());<NEW_LINE>execs.add(new ResultSet1NoneNoHavingNoJoin());<NEW_LINE>execs.add(new ResultSet2NoneNoHavingJoin());<NEW_LINE>execs<MASK><NEW_LINE>execs.add(new ResultSet4NoneHavingJoin());<NEW_LINE>execs.add(new ResultSet5DefaultNoHavingNoJoin());<NEW_LINE>execs.add(new ResultSet6DefaultNoHavingJoin());<NEW_LINE>execs.add(new ResultSet7DefaultHavingNoJoin());<NEW_LINE>execs.add(new ResultSet8DefaultHavingJoin());<NEW_LINE>execs.add(new ResultSet9AllNoHavingNoJoin());<NEW_LINE>execs.add(new ResultSet10AllNoHavingJoin());<NEW_LINE>execs.add(new ResultSet11AllHavingNoJoin());<NEW_LINE>execs.add(new ResultSet12AllHavingJoin());<NEW_LINE>execs.add(new ResultSet13LastNoHavingNoJoin());<NEW_LINE>execs.add(new ResultSet14LastNoHavingJoin());<NEW_LINE>execs.add(new ResultSet13LastNoHavingNoJoinWOrderBy());<NEW_LINE>execs.add(new ResultSet14LastNoHavingJoinWOrderBy());<NEW_LINE>execs.add(new ResultSet15LastHavingNoJoin());<NEW_LINE>execs.add(new ResultSet16LastHavingJoin());<NEW_LINE>execs.add(new ResultSet17FirstNoHavingNoJoin());<NEW_LINE>execs.add(new ResultSet17FirstNoHavingJoin());<NEW_LINE>execs.add(new ResultSet18SnapshotNoHavingNoJoin());<NEW_LINE>execs.add(new ResultSet18SnapshotNoHavingJoin());<NEW_LINE>execs.add(new ResultSetJoinSortWindow());<NEW_LINE>execs.add(new ResultSetLimitSnapshot());<NEW_LINE>execs.add(new ResultSetLimitSnapshotLimit());<NEW_LINE>execs.add(new ResultSetGroupByAll());<NEW_LINE>execs.add(new ResultSetGroupByDefault());<NEW_LINE>execs.add(new ResultSetMaxTimeWindow());<NEW_LINE>execs.add(new ResultSetNoJoinLast());<NEW_LINE>execs.add(new ResultSetNoOutputClauseView());<NEW_LINE>execs.add(new ResultSetNoOutputClauseJoin());<NEW_LINE>execs.add(new ResultSetNoJoinAll());<NEW_LINE>execs.add(new ResultSetJoinLast());<NEW_LINE>execs.add(new ResultSetJoinAll());<NEW_LINE>execs.add(new ResultSetCrontabNumberSetVariations());<NEW_LINE>execs.add(new ResultSetOutputFirstHavingJoinNoJoin());<NEW_LINE>execs.add(new ResultSetOutputFirstCrontab());<NEW_LINE>execs.add(new ResultSetOutputFirstEveryNEvents());<NEW_LINE>execs.add(new ResultSetOutputFirstMultikeyWArray());<NEW_LINE>execs.add(new ResultSetOutputAllMultikeyWArray());<NEW_LINE>execs.add(new ResultSetOutputLastMultikeyWArray());<NEW_LINE>execs.add(new ResultSetOutputSnapshotMultikeyWArray());<NEW_LINE>return execs;<NEW_LINE>}
.add(new ResultSet3NoneHavingNoJoin());
58,978
public Processor asSetPropertiesToExchangeProcessor() {<NEW_LINE>return new Processor() {<NEW_LINE><NEW_LINE>private final HeaderExpression headerFileName = new HeaderExpression(Exchange.FILE_NAME);<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void process(Exchange exchange) throws Exception {<NEW_LINE>// NOTE: use the Header FILE_NAME instead of our context property<NEW_LINE>// because that's dynamic and also the filename is not set when creating the context from CamelContext<NEW_LINE>exchange.setProperty(Exchange.FILE_NAME, headerFileName.evaluate(exchange, String.class));<NEW_LINE>// exchange.setProperty(CONTEXT_EDIMessageDatePattern, EDIMessageDatePattern);<NEW_LINE>exchange.setProperty(CONTEXT_AD_Client_Value, AD_Client_Value);<NEW_LINE>exchange.setProperty(CONTEXT_AD_Org_ID, AD_Org_ID);<NEW_LINE>exchange.setProperty(CONTEXT_ADInputDataDestination_InternalName, ADInputDataDestination_InternalName);<NEW_LINE>exchange.setProperty(CONTEXT_ADInputDataSourceID, ADInputDataSourceID);<NEW_LINE>exchange.setProperty(CONTEXT_ADUserEnteredByID, ADUserEnteredByID);<NEW_LINE>exchange.setProperty(CONTEXT_DELIVERY_RULE, DeliveryRule);<NEW_LINE><MASK><NEW_LINE>//<NEW_LINE>exchange.setProperty(CONTEXT_CurrencyISOCode, currencyISOCode);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
exchange.setProperty(CONTEXT_DELIVERY_VIA_RULE, DeliveryViaRule);
1,112,186
private void prepareDatabase() throws ClassNotFoundException, SQLException, UnknownPoiCategoryException {<NEW_LINE>Class.forName("org.sqlite.JDBC");<NEW_LINE>this.conn = DriverManager.getConnection("jdbc:sqlite:" + this.configuration.<MASK><NEW_LINE>this.conn.setAutoCommit(false);<NEW_LINE>Statement stmt = this.conn.createStatement();<NEW_LINE>// Create tables<NEW_LINE>stmt.execute(DbConstants.DROP_WAYNODES_STATEMENT);<NEW_LINE>stmt.execute(DbConstants.DROP_NODES_STATEMENT);<NEW_LINE>stmt.execute(DbConstants.DROP_METADATA_STATEMENT);<NEW_LINE>stmt.execute(DbConstants.DROP_INDEX_STATEMENT);<NEW_LINE>stmt.execute(DbConstants.DROP_CATEGORY_MAP_STATEMENT);<NEW_LINE>stmt.execute(DbConstants.DROP_DATA_STATEMENT);<NEW_LINE>stmt.execute(DbConstants.DROP_CATEGORIES_STATEMENT);<NEW_LINE>stmt.execute(DbConstants.CREATE_CATEGORIES_STATEMENT);<NEW_LINE>stmt.execute(DbConstants.CREATE_DATA_STATEMENT);<NEW_LINE>stmt.execute(DbConstants.CREATE_CATEGORY_MAP_STATEMENT);<NEW_LINE>stmt.execute(DbConstants.CREATE_INDEX_STATEMENT);<NEW_LINE>stmt.execute(DbConstants.CREATE_METADATA_STATEMENT);<NEW_LINE>stmt.execute(DbConstants.CREATE_NODES_STATEMENT);<NEW_LINE>stmt.execute(DbConstants.CREATE_WAYNODES_STATEMENT);<NEW_LINE>this.pStmtCatMap = this.conn.prepareStatement(DbConstants.INSERT_CATEGORY_MAP_STATEMENT);<NEW_LINE>this.pStmtData = this.conn.prepareStatement(DbConstants.INSERT_DATA_STATEMENT);<NEW_LINE>this.pStmtIndex = this.conn.prepareStatement(DbConstants.INSERT_INDEX_STATEMENT);<NEW_LINE>this.pStmtNodesC = this.conn.prepareStatement(DbConstants.INSERT_NODES_STATEMENT);<NEW_LINE>this.pStmtNodesR = this.conn.prepareStatement(DbConstants.FIND_NODES_STATEMENT);<NEW_LINE>this.pStmtWayNodesR = this.conn.prepareStatement(DbConstants.FIND_WAYNODES_BY_ID_STATEMENT);<NEW_LINE>// Insert categories<NEW_LINE>PreparedStatement pStmt = this.conn.prepareStatement(DbConstants.INSERT_CATEGORIES_STATEMENT);<NEW_LINE>PoiCategory root = this.categoryManager.getRootCategory();<NEW_LINE>pStmt.setLong(1, root.getID());<NEW_LINE>pStmt.setString(2, root.getTitle());<NEW_LINE>pStmt.setNull(3, 0);<NEW_LINE>pStmt.addBatch();<NEW_LINE>Stack<PoiCategory> children = new Stack<>();<NEW_LINE>children.push(root);<NEW_LINE>while (!children.isEmpty()) {<NEW_LINE>for (PoiCategory c : children.pop().getChildren()) {<NEW_LINE>pStmt.setLong(1, c.getID());<NEW_LINE>pStmt.setString(2, c.getTitle());<NEW_LINE>pStmt.setInt(3, c.getParent().getID());<NEW_LINE>pStmt.addBatch();<NEW_LINE>children.push(c);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pStmt.executeBatch();<NEW_LINE>this.conn.commit();<NEW_LINE>}
getOutputFile().getAbsolutePath());
940,225
protected void sync() {<NEW_LINE>inSync = true;<NEW_LINE>WSDLComponent secBinding = null;<NEW_LINE>WSDLComponent topSecBinding = SecurityPolicyModelHelper.getSecurityBindingTypeElement(comp);<NEW_LINE>WSDLComponent protTokenKind = SecurityTokensModelHelper.getTokenElement(topSecBinding, ProtectionToken.class);<NEW_LINE>WSDLComponent protToken = SecurityTokensModelHelper.getTokenTypeElement(protTokenKind);<NEW_LINE>boolean secConv = (protToken instanceof SecureConversationToken);<NEW_LINE>setChBox(secConvChBox, secConv);<NEW_LINE>if (secConv) {<NEW_LINE>WSDLComponent bootPolicy = SecurityTokensModelHelper.getTokenElement(protToken, BootstrapPolicy.class);<NEW_LINE>secBinding = SecurityPolicyModelHelper.getSecurityBindingTypeElement(bootPolicy);<NEW_LINE>Policy p = (Policy) secBinding.getParent();<NEW_LINE>setChBox(derivedKeysChBox, SecurityPolicyModelHelper.isRequireDerivedKeys(protToken));<NEW_LINE>setChBox(reqSigConfChBox, SecurityPolicyModelHelper.isRequireSignatureConfirmation(p));<NEW_LINE>setChBox(encryptSignatureChBox, SecurityPolicyModelHelper.isEncryptSignature(bootPolicy));<NEW_LINE>setChBox(encryptOrderChBox, SecurityPolicyModelHelper.isEncryptBeforeSigning(bootPolicy));<NEW_LINE>} else {<NEW_LINE>secBinding = SecurityPolicyModelHelper.getSecurityBindingTypeElement(comp);<NEW_LINE>setChBox(derivedKeysChBox, false);<NEW_LINE>setChBox(reqSigConfChBox, SecurityPolicyModelHelper.isRequireSignatureConfirmation(comp));<NEW_LINE>setChBox(encryptSignatureChBox, SecurityPolicyModelHelper.isEncryptSignature(comp));<NEW_LINE>setChBox(encryptOrderChBox, SecurityPolicyModelHelper.isEncryptBeforeSigning(comp));<NEW_LINE>}<NEW_LINE>WSDLComponent tokenKind = SecurityTokensModelHelper.getTokenElement(secBinding, ProtectionToken.class);<NEW_LINE>WSDLComponent token = SecurityTokensModelHelper.getTokenTypeElement(tokenKind);<NEW_LINE>setCombo(tokenTypeCombo, SecurityTokensModelHelper.getIssuedTokenType(token));<NEW_LINE>setCombo(keyTypeCombo<MASK><NEW_LINE>fillKeySize(keySizeCombo, ComboConstants.ISSUED_KEYTYPE_PUBLIC.equals(keyTypeCombo.getSelectedItem()));<NEW_LINE>setCombo(keySizeCombo, SecurityTokensModelHelper.getIssuedKeySize(token));<NEW_LINE>issuerAddressField.setText(SecurityTokensModelHelper.getIssuedIssuerAddress(token));<NEW_LINE>issuerMetadataField.setText(SecurityTokensModelHelper.getIssuedIssuerMetadataAddress(token));<NEW_LINE>setChBox(reqDerivedKeys, SecurityPolicyModelHelper.isRequireDerivedKeys(token));<NEW_LINE>setCombo(algoSuiteCombo, AlgoSuiteModelHelper.getAlgorithmSuite(secBinding));<NEW_LINE>setCombo(layoutCombo, SecurityPolicyModelHelper.getMessageLayout(secBinding));<NEW_LINE>enableDisable();<NEW_LINE>inSync = false;<NEW_LINE>}
, SecurityTokensModelHelper.getIssuedKeyType(token));
1,275,359
public static DescribeSnapshotsResponse unmarshall(DescribeSnapshotsResponse describeSnapshotsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSnapshotsResponse.setRequestId(_ctx.stringValue("DescribeSnapshotsResponse.RequestId"));<NEW_LINE>describeSnapshotsResponse.setTotalCount<MASK><NEW_LINE>describeSnapshotsResponse.setPageSize(_ctx.integerValue("DescribeSnapshotsResponse.PageSize"));<NEW_LINE>describeSnapshotsResponse.setPageNumber(_ctx.integerValue("DescribeSnapshotsResponse.PageNumber"));<NEW_LINE>List<Snapshot> snapshots = new ArrayList<Snapshot>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSnapshotsResponse.Snapshots.Length"); i++) {<NEW_LINE>Snapshot snapshot = new Snapshot();<NEW_LINE>snapshot.setCreateTime(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].CreateTime"));<NEW_LINE>snapshot.setDescription(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Description"));<NEW_LINE>snapshot.setProgress(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Progress"));<NEW_LINE>snapshot.setRemainTime(_ctx.integerValue("DescribeSnapshotsResponse.Snapshots[" + i + "].RemainTime"));<NEW_LINE>snapshot.setRetentionDays(_ctx.integerValue("DescribeSnapshotsResponse.Snapshots[" + i + "].RetentionDays"));<NEW_LINE>snapshot.setSnapshotId(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SnapshotId"));<NEW_LINE>snapshot.setSnapshotName(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SnapshotName"));<NEW_LINE>snapshot.setSourceFileSystemId(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SourceFileSystemId"));<NEW_LINE>snapshot.setSourceFileSystemSize(_ctx.longValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SourceFileSystemSize"));<NEW_LINE>snapshot.setStatus(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Status"));<NEW_LINE>snapshot.setEncryptType(_ctx.integerValue("DescribeSnapshotsResponse.Snapshots[" + i + "].EncryptType"));<NEW_LINE>snapshot.setSourceFileSystemVersion(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SourceFileSystemVersion"));<NEW_LINE>snapshots.add(snapshot);<NEW_LINE>}<NEW_LINE>describeSnapshotsResponse.setSnapshots(snapshots);<NEW_LINE>return describeSnapshotsResponse;<NEW_LINE>}
(_ctx.integerValue("DescribeSnapshotsResponse.TotalCount"));
862,384
private Point parseTag(String[] text, int lineNo, final int nLines, Point position) {<NEW_LINE>// find end of tag<NEW_LINE>final Point endTag = findChar(text, '>', position);<NEW_LINE>final boolean incompleteTag = endTag.getLineNo() >= nLines;<NEW_LINE>// get tag id (one word)<NEW_LINE>final String tagId;<NEW_LINE>if (incompleteTag) {<NEW_LINE>tagId = "";<NEW_LINE>} else {<NEW_LINE>tagId = getTagId(text, position);<NEW_LINE>}<NEW_LINE>// is this closed tag<NEW_LINE>final boolean closedTag = endTag.getLineNo() < nLines && text[endTag.getLineNo()].charAt(endTag.<MASK><NEW_LINE>// add new tag<NEW_LINE>add(new HtmlTag(tagId, position.getLineNo() + lineNo, position.getColumnNo(), closedTag, incompleteTag, text[position.getLineNo()]));<NEW_LINE>return endTag;<NEW_LINE>}
getColumnNo() - 1) == '/';
1,271,844
private void initDispatchTable() {<NEW_LINE>assert (dispatchTable == null);<NEW_LINE>// we don't do super.getDispatchTable() because we are not<NEW_LINE>// interested in any of super classes' disptcah table entries.<NEW_LINE>Map<String, String> table = new HashMap<>();<NEW_LINE>// the values being put into the map represent method names<NEW_LINE>// in PersistenceUnitDescriptor class.<NEW_LINE>table.put(PersistenceTagNames.NAME, "setName");<NEW_LINE>table.put(PersistenceTagNames.TRANSACTION_TYPE, "setTransactionType");<NEW_LINE>table.put(PersistenceTagNames.DESCRIPTION, "setDescription");<NEW_LINE>table.put(PersistenceTagNames.PROVIDER, "setProvider");<NEW_LINE>table.put(PersistenceTagNames.JTA_DATA_SOURCE, "setJtaDataSource");<NEW_LINE>table.put(PersistenceTagNames.NON_JTA_DATA_SOURCE, "setNonJtaDataSource");<NEW_LINE>table.<MASK><NEW_LINE>table.put(PersistenceTagNames.JAR_FILE, "addJarFile");<NEW_LINE>table.put(PersistenceTagNames.EXCLUDE_UNLISTED_CLASSES, "setExcludeUnlistedClasses");<NEW_LINE>table.put(PersistenceTagNames.CLASS, "addClass");<NEW_LINE>table.put(PersistenceTagNames.SHARED_CACHE_MODE, "setSharedCacheMode");<NEW_LINE>table.put(PersistenceTagNames.VALIDATION_MODE, "setValidationMode");<NEW_LINE>this.dispatchTable = table;<NEW_LINE>}
put(PersistenceTagNames.MAPPING_FILE, "addMappingFile");
1,008,412
private void resumeAllRegistrations(DatabusRequest request) throws IOException {<NEW_LINE>LOG.info("REST call to resume all registrations");<NEW_LINE>Collection<DatabusRegistration> regs = _client.getAllRegistrations();<NEW_LINE>if (null != regs) {<NEW_LINE>for (DatabusRegistration r : regs) {<NEW_LINE>if (r.getState().isRunning()) {<NEW_LINE>if ((r.getState() == DatabusRegistration.RegistrationState.PAUSED) || (r.getState() == DatabusRegistration.RegistrationState.SUSPENDED_ON_ERROR))<NEW_LINE>r.resume();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<RegistrationId, DatabusV3Registration> regMap = _client.getRegistrationIdMap();<NEW_LINE>Collection<RegInfo> topLevelRegs = getAllTopLevelV3Registrations();<NEW_LINE>if ((null != regMap) && (null != topLevelRegs)) {<NEW_LINE>for (RegInfo reg : topLevelRegs) {<NEW_LINE>DatabusV3Registration r = regMap.get(reg.getRegId());<NEW_LINE>if (r.getState().isRunning()) {<NEW_LINE>if ((r.getState() == RegistrationState.PAUSED) || (r.getState() == RegistrationState.SUSPENDED_ON_ERROR))<NEW_LINE>r.resume();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
writeJsonObjectToResponse(getAllTopLevelRegStates(), request);
1,548,076
private void findOtherStuff() {<NEW_LINE>try {<NEW_LINE>// find the domain name and/or clusters, if it is there<NEW_LINE>// If we bump into the domain end tag first -- no sweat<NEW_LINE>//<NEW_LINE>// notice how everything is MUCH more difficult to understand because<NEW_LINE>// we are going through domain.xml in one long relentless sweep and<NEW_LINE>// we can't back up!<NEW_LINE>while (skipToButNotPast("domain", PROPERTY, CLUSTERS, SYSTEM_PROPERTY, "secure-admin")) {<NEW_LINE><MASK><NEW_LINE>if (null != name)<NEW_LINE>switch(name) {<NEW_LINE>case CLUSTERS:<NEW_LINE>parseClusters();<NEW_LINE>break;<NEW_LINE>case SYSTEM_PROPERTY:<NEW_LINE>parseSystemProperty(SysPropsHandler.Type.DOMAIN);<NEW_LINE>break;<NEW_LINE>case PROPERTY:<NEW_LINE>// property found -- maybe it is the domain name?<NEW_LINE>parseDomainProperty();<NEW_LINE>break;<NEW_LINE>case "secure-admin":<NEW_LINE>parseSecureAdmin();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (domainName == null) {<NEW_LINE>Logger.getLogger(MiniXmlParser.class.getName()).log(Level.INFO, strings.get("noDomainName"));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(strings.get("noDomainEnd"));<NEW_LINE>}<NEW_LINE>}
String name = parser.getLocalName();
1,727,937
public double bearingTo(final IGeoPoint other) {<NEW_LINE>final double lat1 = Math.toRadians(this.mLatitude);<NEW_LINE>final double long1 = Math.toRadians(this.mLongitude);<NEW_LINE>final double lat2 = Math.toRadians(other.getLatitude());<NEW_LINE>final double long2 = Math.toRadians(other.getLongitude());<NEW_LINE>final double delta_long = long2 - long1;<NEW_LINE>final double a = Math.sin(delta_long) * Math.cos(lat2);<NEW_LINE>final double b = Math.cos(lat1) * Math.sin(lat2) - Math.sin(lat1) * Math.cos(lat2<MASK><NEW_LINE>final double bearing = Math.toDegrees(Math.atan2(a, b));<NEW_LINE>final double bearing_normalized = (bearing + 360) % 360;<NEW_LINE>return bearing_normalized;<NEW_LINE>}
) * Math.cos(delta_long);
405
private void loadNode1197() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ConditionType_ConditionRefresh_InputArguments, new QualifiedName(0, "InputArguments"), new LocalizedText("en", "InputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType_ConditionRefresh_InputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType_ConditionRefresh_InputArguments, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ConditionType_ConditionRefresh_InputArguments, Identifiers.HasProperty, Identifiers.ConditionType_ConditionRefresh.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>SubscriptionId</Name><DataType><Identifier>i=288</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/><Description><Locale> </Locale><Text>The identifier for the suscription to refresh.</Text> </Description> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE><MASK><NEW_LINE>}
this.nodeManager.addNode(node);
1,577,855
private void renderMemoryInfo() {<NEW_LINE>final MemoryUsage heapusage = ManagementFactory<MASK><NEW_LINE>final MemoryUsage offheapusage = ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage();<NEW_LINE>final float pctmemory = (float) heapusage.getUsed() / heapusage.getMax();<NEW_LINE>String memory = String.format(Locale.ENGLISH, "Memory Heap: %d / %d MB (%.1f%%) OffHeap: %d MB", heapusage.getUsed() >> 20, heapusage.getMax() >> 20, pctmemory * 100.0, offheapusage.getUsed() >> 20);<NEW_LINE>final int i = Mth.hsvToRgb((1.0f - (float) Math.pow(pctmemory, 1.5f)) / 3f, 1.0f, 0.5f);<NEW_LINE>memorycolour[2] = ((i) & 0xFF) / 255.0f;<NEW_LINE>memorycolour[1] = ((i >> 8) & 0xFF) / 255.0f;<NEW_LINE>memorycolour[0] = ((i >> 16) & 0xFF) / 255.0f;<NEW_LINE>renderMessage(memory, memorycolour, 1, 1.0f);<NEW_LINE>}
.getMemoryMXBean().getHeapMemoryUsage();
1,143,235
protected Street readIntersectedStreet(City c, int street24X, int street24Y, List<String> additionalTagsTable) throws IOException {<NEW_LINE>int x = 0;<NEW_LINE>int y = 0;<NEW_LINE>Street s = new Street(c);<NEW_LINE>LinkedList<String> additionalTags = null;<NEW_LINE>while (true) {<NEW_LINE>int t = codedIS.readTag();<NEW_LINE>int tag = WireFormat.getTagFieldNumber(t);<NEW_LINE>switch(tag) {<NEW_LINE>case 0:<NEW_LINE>s.setLocation(MapUtils.getLatitudeFromTile(24, y), MapUtils.getLongitudeFromTile(24, x));<NEW_LINE>return s;<NEW_LINE>case OsmandOdb.BuildingIndex.ID_FIELD_NUMBER:<NEW_LINE>s.setId(codedIS.readUInt64());<NEW_LINE>break;<NEW_LINE>case OsmandOdb.StreetIntersection.NAME_EN_FIELD_NUMBER:<NEW_LINE>s.<MASK><NEW_LINE>break;<NEW_LINE>case OsmandOdb.StreetIntersection.NAME_FIELD_NUMBER:<NEW_LINE>s.setName(codedIS.readString());<NEW_LINE>break;<NEW_LINE>case OsmandOdb.StreetIntersection.ATTRIBUTETAGIDS_FIELD_NUMBER:<NEW_LINE>int tgid = codedIS.readUInt32();<NEW_LINE>if (additionalTags == null) {<NEW_LINE>additionalTags = new LinkedList<String>();<NEW_LINE>}<NEW_LINE>if (additionalTagsTable != null && tgid < additionalTagsTable.size()) {<NEW_LINE>additionalTags.add(additionalTagsTable.get(tgid));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case OsmandOdb.StreetIntersection.ATTRIBUTEVALUES_FIELD_NUMBER:<NEW_LINE>String nm = codedIS.readString();<NEW_LINE>if (additionalTags != null && additionalTags.size() > 0) {<NEW_LINE>String tg = additionalTags.pollFirst();<NEW_LINE>if (tg.startsWith("name:")) {<NEW_LINE>s.setName(tg.substring("name:".length()), nm);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case OsmandOdb.StreetIntersection.INTERSECTEDX_FIELD_NUMBER:<NEW_LINE>x = codedIS.readSInt32() + street24X;<NEW_LINE>break;<NEW_LINE>case OsmandOdb.StreetIntersection.INTERSECTEDY_FIELD_NUMBER:<NEW_LINE>y = codedIS.readSInt32() + street24Y;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>skipUnknownField(t);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setEnName(codedIS.readString());
1,465,069
public com.amazonaws.services.dynamodbv2.model.InvalidExportTimeException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.dynamodbv2.model.InvalidExportTimeException invalidExportTimeException = new com.amazonaws.services.<MASK><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>} 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 invalidExportTimeException;<NEW_LINE>}
dynamodbv2.model.InvalidExportTimeException(null);
1,165,964
protected int runWithJob(final Namespace options, final HeliosClient client, final PrintStream out, final boolean json, final Job job, final BufferedReader stdin) throws ExecutionException, InterruptedException, IOException {<NEW_LINE>final JobId jobId = job.getId();<NEW_LINE>final boolean all = options.getBoolean(allArg.getDest());<NEW_LINE>final boolean yes = options.getBoolean(yesArg.getDest());<NEW_LINE>final List<String> hosts;<NEW_LINE>if (all) {<NEW_LINE>final JobStatus status = client.jobStatus(jobId).get();<NEW_LINE>hosts = ImmutableList.copyOf(status.getDeployments().keySet());<NEW_LINE>if (hosts.isEmpty()) {<NEW_LINE>out.printf("%s is not currently deployed on any hosts.", jobId);<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>if (!yes) {<NEW_LINE>out.printf("This will undeploy %s from %s%n", jobId, hosts);<NEW_LINE>final boolean confirmed = Utils.userConfirmed(out, stdin);<NEW_LINE>if (!confirmed) {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>hosts = options.getList(hostsArg.getDest());<NEW_LINE>if (hosts.isEmpty()) {<NEW_LINE>out.println("Please either specify a list of hosts or use the -a/--all flag.");<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!json) {<NEW_LINE>out.printf("Undeploying %s from %s%n", jobId, hosts);<NEW_LINE>}<NEW_LINE>int code = 0;<NEW_LINE>final HostResolver <MASK><NEW_LINE>for (final String candidateHost : hosts) {<NEW_LINE>final String host = resolver.resolveName(candidateHost);<NEW_LINE>if (!json) {<NEW_LINE>out.printf("%s: ", host);<NEW_LINE>}<NEW_LINE>final String token = options.getString(tokenArg.getDest());<NEW_LINE>final JobUndeployResponse response = client.undeploy(jobId, host, token).get();<NEW_LINE>if (response.getStatus() == JobUndeployResponse.Status.OK) {<NEW_LINE>if (!json) {<NEW_LINE>out.println("done");<NEW_LINE>} else {<NEW_LINE>out.print(response.toJsonString());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!json) {<NEW_LINE>out.println("failed: " + response);<NEW_LINE>} else {<NEW_LINE>out.print(response.toJsonString());<NEW_LINE>}<NEW_LINE>code = -1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return code;<NEW_LINE>}
resolver = HostResolver.create(client);
1,271,256
public int onStartCommand(Intent intent, int flags, final int startId) {<NEW_LINE>Bundle b = new Bundle();<NEW_LINE>isRootExplorer = <MASK><NEW_LINE>ArrayList<HybridFileParcelable> files = intent.getParcelableArrayListExtra(TAG_COPY_SOURCES);<NEW_LINE>String targetPath = intent.getStringExtra(TAG_COPY_TARGET);<NEW_LINE>int mode = intent.getIntExtra(TAG_COPY_OPEN_MODE, OpenMode.UNKNOWN.ordinal());<NEW_LINE>final boolean move = intent.getBooleanExtra(TAG_COPY_MOVE, false);<NEW_LINE>sharedPreferences = PreferenceManager.getDefaultSharedPreferences(c);<NEW_LINE>accentColor = ((AppConfig) getApplication()).getUtilsProvider().getColorPreference().getCurrentUserColorPreferences(this, sharedPreferences).getAccent();<NEW_LINE>mNotifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);<NEW_LINE>b.putInt(TAG_COPY_START_ID, startId);<NEW_LINE>Intent notificationIntent = new Intent(this, MainActivity.class);<NEW_LINE>notificationIntent.setAction(Intent.ACTION_MAIN);<NEW_LINE>notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>notificationIntent.putExtra(MainActivity.KEY_INTENT_PROCESS_VIEWER, true);<NEW_LINE>PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);<NEW_LINE>customSmallContentViews = new RemoteViews(getPackageName(), R.layout.notification_service_small);<NEW_LINE>customBigContentViews = new RemoteViews(getPackageName(), R.layout.notification_service_big);<NEW_LINE>Intent stopIntent = new Intent(TAG_BROADCAST_COPY_CANCEL);<NEW_LINE>PendingIntent stopPendingIntent = PendingIntent.getBroadcast(c, 1234, stopIntent, PendingIntent.FLAG_UPDATE_CURRENT);<NEW_LINE>NotificationCompat.Action action = new NotificationCompat.Action(R.drawable.ic_content_copy_white_36dp, getString(R.string.stop_ftp), stopPendingIntent);<NEW_LINE>mBuilder = new NotificationCompat.Builder(c, NotificationConstants.CHANNEL_NORMAL_ID).setContentIntent(pendingIntent).setSmallIcon(R.drawable.ic_content_copy_white_36dp).setCustomContentView(customSmallContentViews).setCustomBigContentView(customBigContentViews).setCustomHeadsUpContentView(customSmallContentViews).setStyle(new NotificationCompat.DecoratedCustomViewStyle()).addAction(action).setOngoing(true).setColor(accentColor);<NEW_LINE>// set default notification views text<NEW_LINE>NotificationConstants.setMetadata(c, mBuilder, NotificationConstants.TYPE_NORMAL);<NEW_LINE>startForeground(NotificationConstants.COPY_ID, mBuilder.build());<NEW_LINE>initNotificationViews();<NEW_LINE>b.putBoolean(TAG_COPY_MOVE, move);<NEW_LINE>b.putString(TAG_COPY_TARGET, targetPath);<NEW_LINE>b.putInt(TAG_COPY_OPEN_MODE, mode);<NEW_LINE>b.putParcelableArrayList(TAG_COPY_SOURCES, files);<NEW_LINE>super.onStartCommand(intent, flags, startId);<NEW_LINE>super.progressHalted();<NEW_LINE>// going async<NEW_LINE>new DoInBackground(isRootExplorer).execute(b);<NEW_LINE>// If we get killed, after returning from here, restart<NEW_LINE>return START_NOT_STICKY;<NEW_LINE>}
intent.getBooleanExtra(TAG_IS_ROOT_EXPLORER, false);
979,938
public static void reportDurations(Event currentRecord, boolean result, long sendTime, Map<String, String> dimensions, long msgTime, SortMetricItemSet metricItemSet) {<NEW_LINE>SortMetricItem metricItem = metricItemSet.findMetricItem(dimensions);<NEW_LINE>if (result) {<NEW_LINE>metricItem.sendSuccessCount.incrementAndGet();<NEW_LINE>metricItem.sendSuccessSize.addAndGet(currentRecord.getBody().length);<NEW_LINE>if (sendTime > 0) {<NEW_LINE>long currentTime = System.currentTimeMillis();<NEW_LINE>long sinkDuration = currentTime - sendTime;<NEW_LINE>long nodeDuration = currentTime - NumberUtils.toLong(Constants.HEADER_KEY_SOURCE_TIME, msgTime);<NEW_LINE>long wholeDuration = currentTime - msgTime;<NEW_LINE><MASK><NEW_LINE>metricItem.nodeDuration.addAndGet(nodeDuration);<NEW_LINE>metricItem.wholeDuration.addAndGet(wholeDuration);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>metricItem.sendFailCount.incrementAndGet();<NEW_LINE>metricItem.sendFailSize.addAndGet(currentRecord.getBody().length);<NEW_LINE>}<NEW_LINE>}
metricItem.sinkDuration.addAndGet(sinkDuration);
1,435,985
private boolean processMetadataFilters() {<NEW_LINE>if (_cmd.hasOption(KEYS_OPT_NAME)) {<NEW_LINE>String keysOpt = _cmd.getOptionValue(KEYS_OPT_NAME);<NEW_LINE>String[] optParts = keysOpt.split(",");<NEW_LINE>if (optParts.length > 2) {<NEW_LINE>printError("invalid key range specifier:" + keysOpt, true);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (optParts[0].length() > 0) {<NEW_LINE>_metaBuilder.minKey(optParts[0]);<NEW_LINE>}<NEW_LINE>if (2 == optParts.length && optParts[1].length() > 0) {<NEW_LINE>_metaBuilder.maxKey(optParts[1]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (_cmd.hasOption(SCNS_OPT_NAME)) {<NEW_LINE>String scnsOpt = _cmd.getOptionValue(SCNS_OPT_NAME);<NEW_LINE>String[] optParts = scnsOpt.split(",");<NEW_LINE>if (optParts.length > 2) {<NEW_LINE>printError("invalid SCN range specifier:" + scnsOpt, true);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (optParts[0].length() > 0) {<NEW_LINE>_metaBuilder.minScn(Long.parseLong(optParts[0]));<NEW_LINE>}<NEW_LINE>if (2 == optParts.length && optParts[1].length() > 0) {<NEW_LINE>_metaBuilder.maxScn(Long.parseLong(optParts[1]));<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE><MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
printError("invalid SCN range specifier:" + scnsOpt, true);
35,438
public synchronized boolean loadBitmapAsync(final Context context, Runnable after) {<NEW_LINE>if (getBitmap() != null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>waitingForLoad.add(after);<NEW_LINE>if (loadStarted)<NEW_LINE>return true;<NEW_LINE>loadStarted = true;<NEW_LINE>if (getDescriptor() != null) {<NEW_LINE>new Thread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>Log.d(<MASK><NEW_LINE>if (getDescriptor().loadBitmap(context) != null) {<NEW_LINE>Set<Runnable> waitingForLoad;<NEW_LINE>synchronized (BitmapDescriptorImpl.this) {<NEW_LINE>waitingForLoad = BitmapDescriptorImpl.this.waitingForLoad;<NEW_LINE>}<NEW_LINE>for (Runnable after : waitingForLoad) {<NEW_LINE>after.run();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Log.d("BitmapDescriptor", "Done loading " + getDescriptor());<NEW_LINE>}<NEW_LINE>}).start();<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
"BitmapDescriptor", "Start loading " + getDescriptor());
860,040
private static ElementAccessor createVisibleAccessor(ModeStructureSnapshot.ElementSnapshot snapshot) {<NEW_LINE>if (snapshot == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (snapshot instanceof ModeStructureSnapshot.EditorSnapshot) {<NEW_LINE>// Is always visible.<NEW_LINE>ModeStructureSnapshot.EditorSnapshot editorSnapshot = (ModeStructureSnapshot.EditorSnapshot) snapshot;<NEW_LINE>return new ModeStructureAccessorImpl.EditorAccessorImpl(editorSnapshot.getOriginator(), editorSnapshot, createVisibleAccessor(editorSnapshot.getEditorAreaSnapshot()), editorSnapshot.getResizeWeight());<NEW_LINE>}<NEW_LINE>if (snapshot.isVisibleInSplit()) {<NEW_LINE>if (snapshot instanceof ModeStructureSnapshot.SplitSnapshot) {<NEW_LINE>ModeStructureSnapshot.SplitSnapshot splitSnapshot = (ModeStructureSnapshot.SplitSnapshot) snapshot;<NEW_LINE>return createSplitAccessor(splitSnapshot);<NEW_LINE>} else if (snapshot instanceof ModeStructureSnapshot.ModeSnapshot) {<NEW_LINE>ModeStructureSnapshot.ModeSnapshot modeSnapshot = (ModeStructureSnapshot.ModeSnapshot) snapshot;<NEW_LINE>return new ModeStructureAccessorImpl.ModeAccessorImpl(modeSnapshot.getOriginator(), modeSnapshot);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (snapshot instanceof ModeStructureSnapshot.SplitSnapshot) {<NEW_LINE>// the split has only one visible child, so create an accessor for this child<NEW_LINE>ModeStructureSnapshot.SplitSnapshot <MASK><NEW_LINE>for (Iterator it = splitSnapshot.getChildSnapshots().iterator(); it.hasNext(); ) {<NEW_LINE>ModeStructureSnapshot.ElementSnapshot child = (ModeStructureSnapshot.ElementSnapshot) it.next();<NEW_LINE>if (child.hasVisibleDescendant()) {<NEW_LINE>return createVisibleAccessor(child);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
splitSnapshot = (ModeStructureSnapshot.SplitSnapshot) snapshot;
825,264
private Operand buildOpElementAsgnWith(OpElementAsgnNode opElementAsgnNode, Boolean truthy) {<NEW_LINE>Node receiver = opElementAsgnNode.getReceiverNode();<NEW_LINE>CallType callType = receiver instanceof SelfNode ? FUNCTIONAL : CallType.NORMAL;<NEW_LINE>Operand array = buildWithOrder(receiver, opElementAsgnNode.containsVariableAssignment());<NEW_LINE>Label endLabel = getNewLabel();<NEW_LINE>Variable elt = createTemporaryVariable();<NEW_LINE>Operand[] argList = setupCallArgs(opElementAsgnNode.getArgsNode());<NEW_LINE>Operand block = setupCallClosure(opElementAsgnNode.getBlockNode());<NEW_LINE>addInstr(CallInstr.create(scope, callType, elt, symbol(ArrayDerefInstr.AREF)<MASK><NEW_LINE>addInstr(createBranch(elt, truthy, endLabel));<NEW_LINE>Operand value = build(opElementAsgnNode.getValueNode());<NEW_LINE>argList = addArg(argList, value);<NEW_LINE>addInstr(CallInstr.create(scope, callType, elt, symbol(ArrayDerefInstr.ASET), array, argList, block));<NEW_LINE>addInstr(new CopyInstr(elt, value));<NEW_LINE>addInstr(new LabelInstr(endLabel));<NEW_LINE>return elt;<NEW_LINE>}
, array, argList, block));