idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
528,414
void updateStatusBar() {<NEW_LINE>int countFilteredBugs = BugSet.countFilteredBugs();<NEW_LINE>String msg = "";<NEW_LINE>if (countFilteredBugs == 1) {<NEW_LINE>msg = " 1 " + L10N.getLocalString("statusbar.bug_hidden", "bug hidden (see view menu)");<NEW_LINE>} else if (countFilteredBugs > 1) {<NEW_LINE>msg = " " + countFilteredBugs + " " + L10N.getLocalString("statusbar.bugs_hidden", "bugs hidden (see view menu)");<NEW_LINE>}<NEW_LINE>if (errorMsg != null && errorMsg.length() > 0) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// should not be the URL<NEW_LINE>mainFrameTree.setWaitStatusLabelText(msg);<NEW_LINE>if (msg.length() == 0) {<NEW_LINE>msg = "https://github.com/spotbugs";<NEW_LINE>}<NEW_LINE>statusBarLabel.setText(msg);<NEW_LINE>}
msg = join(msg, errorMsg);
1,825,950
public CodeGenNode unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CodeGenNode codeGenNode = new CodeGenNode();<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("Id", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>codeGenNode.setId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NodeType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>codeGenNode.setNodeType(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Args", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>codeGenNode.setArgs(new ListUnmarshaller<CodeGenNodeArg>(CodeGenNodeArgJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("LineNumber", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>codeGenNode.setLineNumber(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 codeGenNode;<NEW_LINE>}
class).unmarshall(context));
1,221,510
// Configure stage4<NEW_LINE>protected JobConf configStage4() throws Exception {<NEW_LINE>final JobConf conf = new JobConf(getConf(), ConCmpt.class);<NEW_LINE>conf.set("number_nodes", "" + number_nodes);<NEW_LINE>conf.set("cur_iter", "" + cur_iter);<NEW_LINE>conf.set("make_symmetric", "" + make_symmetric);<NEW_LINE>conf.setJobName("ConCmpt_Stage4");<NEW_LINE>conf.setMapperClass(MapStage4.class);<NEW_LINE>conf.setReducerClass(RedStage4.class);<NEW_LINE>conf.setCombinerClass(RedStage4.class);<NEW_LINE>FileInputFormat.setInputPaths(conf, curbm_path);<NEW_LINE><MASK><NEW_LINE>conf.setNumReduceTasks(nreducers);<NEW_LINE>conf.setOutputKeyClass(IntWritable.class);<NEW_LINE>conf.setOutputValueClass(IntWritable.class);<NEW_LINE>return conf;<NEW_LINE>}
FileOutputFormat.setOutputPath(conf, summaryout_path);
1,589,386
public void traverse(ASTVisitor visitor, ClassScope scope) {<NEW_LINE>if (visitor.visit(this, scope)) {<NEW_LINE>if (this.annotations != null) {<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < annotationsLevels; i++) {<NEW_LINE>int annotationsLength = this.annotations[i] == null ? 0 : this.annotations[i].length;<NEW_LINE>for (int j = 0; j < annotationsLength; j++) this.annotations[i][j].traverse(visitor, scope);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Annotation[][] annotationsOnDimensions = getAnnotationsOnDimensions(true);<NEW_LINE>if (annotationsOnDimensions != null) {<NEW_LINE>for (int i = 0, max = annotationsOnDimensions.length; i < max; i++) {<NEW_LINE>Annotation[] annotations2 = annotationsOnDimensions[i];<NEW_LINE>for (int j = 0, max2 = annotations2 == null ? 0 : annotations2.length; j < max2; j++) {<NEW_LINE>Annotation annotation = annotations2[j];<NEW_LINE>annotation.traverse(visitor, scope);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0, max = this.typeArguments.length; i < max; i++) {<NEW_LINE>if (this.typeArguments[i] != null) {<NEW_LINE>for (int j = 0, max2 = this.typeArguments[i].length; j < max2; j++) {<NEW_LINE>this.typeArguments[i][j].traverse(visitor, scope);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>visitor.endVisit(this, scope);<NEW_LINE>}
int annotationsLevels = this.annotations.length;
65,586
//<NEW_LINE>private static void SetMatrix(double d, double d1, double[][] ad, int i) {<NEW_LINE>double[][] ad1 = new double[3][3];<NEW_LINE>double[][] ad2 = new double[3][3];<NEW_LINE>ad1[0][0] = 1.0D;<NEW_LINE>ad1[0][1] = 0.0D;<NEW_LINE>ad1[0][2] = 0.0D;<NEW_LINE>ad1[1][0] = 0.0D;<NEW_LINE>ad1[1][1] = Math.cos(d);<NEW_LINE>ad1[1][2] = Math.sin(d);<NEW_LINE>ad1[2][0] = 0.0D;<NEW_LINE>ad1[2][1] = -ad1[1][2];<NEW_LINE>ad1[2][2] = ad1[1][1];<NEW_LINE>ad2[0][0] = Math.cos(d1);<NEW_LINE>ad2[0][1] = 0.0D;<NEW_LINE>ad2[0][2] = -Math.sin(d1);<NEW_LINE>ad2[1][0] = 0.0D;<NEW_LINE>ad2[1][1] = 1.0D;<NEW_LINE>ad2[1][2] = 0.0D;<NEW_LINE>ad2[2][0] = <MASK><NEW_LINE>ad2[2][1] = 0.0D;<NEW_LINE>ad2[2][2] = ad2[0][0];<NEW_LINE>if (i == 1) {<NEW_LINE>matrix_matrix_mult(ad1, ad2, ad);<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>matrix_matrix_mult(ad2, ad1, ad);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}
-ad2[0][2];
724,046
public final CharsetNameBaseContext charsetNameBase() throws RecognitionException {<NEW_LINE>CharsetNameBaseContext _localctx = new CharsetNameBaseContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 624, RULE_charsetNameBase);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(6464);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (!(((((_la - 639)) & ~0x3f) == 0 && ((1L << (_la - 639)) & ((1L << (ARMSCII8 - 639)) | (1L << (ASCII - 639)) | (1L << (BIG5 - 639)) | (1L << (CP1250 - 639)) | (1L << (CP1251 - 639)) | (1L << (CP1256 - 639)) | (1L << (CP1257 - 639)) | (1L << (CP850 - 639)) | (1L << (CP852 - 639)) | (1L << (CP866 - 639)) | (1L << (CP932 - 639)) | (1L << (DEC8 - 639)) | (1L << (EUCJPMS - 639)) | (1L << (EUCKR - 639)) | (1L << (GB2312 - 639)) | (1L << (GBK - 639)) | (1L << (GEOSTD8 - 639)) | (1L << (GREEK - 639)) | (1L << (HEBREW - 639)) | (1L << (HP8 - 639)) | (1L << (KEYBCS2 - 639)) | (1L << (KOI8R - 639)) | (1L << (KOI8U - 639)) | (1L << (LATIN1 - 639)) | (1L << (LATIN2 - 639)) | (1L << (LATIN5 - 639)) | (1L << (LATIN7 - 639)) | (1L << (MACCE - 639)) | (1L << (MACROMAN - 639)) | (1L << (SJIS - 639)) | (1L << (SWE7 - 639)) | (1L << (TIS620 - 639)) | (1L << (UCS2 - 639)) | (1L << (UJIS - 639)) | (1L << (UTF16 - 639)) | (1L << (UTF16LE - 639)) | (1L << (UTF32 - 639)) | (1L << (UTF8 - 639)) | (1L << (UTF8MB3 - 639)) | (1L << (UTF8MB4 - 639)))) != 0))) {<NEW_LINE>_errHandler.recoverInline(this);<NEW_LINE>} else {<NEW_LINE>if (_input.LA(1) == Token.EOF)<NEW_LINE>matchedEOF = true;<NEW_LINE>_errHandler.reportMatch(this);<NEW_LINE>consume();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
_errHandler.recover(this, re);
1,219,141
public static Key create(Snippet snip) {<NEW_LINE>switch(snip.kind()) {<NEW_LINE>case IMPORT:<NEW_LINE>ImportSnippet imp = ((ImportSnippet) snip);<NEW_LINE>return new Key("I_" + imp.fullname() + (imp.isStatic() ? "*" : ""));<NEW_LINE>case TYPE_DECL:<NEW_LINE>TypeDeclSnippet tdecl = ((TypeDeclSnippet) snip);<NEW_LINE>return new Key("T_" + tdecl.name());<NEW_LINE>case METHOD:<NEW_LINE>MethodSnippet method = ((MethodSnippet) snip);<NEW_LINE>return new Key("M_" + method.name() + <MASK><NEW_LINE>case VAR:<NEW_LINE>VarSnippet var = (VarSnippet) snip;<NEW_LINE>return new Key("V_" + var.name() + ":" + var.typeName());<NEW_LINE>case EXPRESSION:<NEW_LINE>ExpressionSnippet expr = (ExpressionSnippet) snip;<NEW_LINE>return new Key("E_" + (expr.name()) + ":" + (expr.typeName()));<NEW_LINE>case STATEMENT:<NEW_LINE>case ERRONEOUS:<NEW_LINE>return new Key("C_" + snip.source());<NEW_LINE>default:<NEW_LINE>throw new AssertionError(snip.kind().name());<NEW_LINE>}<NEW_LINE>}
":" + method.signature());
210,200
public Optional<ZonedDateTime> nextExecution(final ZonedDateTime date) {<NEW_LINE>Preconditions.checkNotNull(date);<NEW_LINE>try {<NEW_LINE>ZonedDateTime nextMatch = nextClosestMatch(date);<NEW_LINE>if (nextMatch.equals(date)) {<NEW_LINE>nextMatch = nextClosestMatch(date.plusSeconds(1));<NEW_LINE>if (nextMatch.getOffset().compareTo(date.getOffset()) > 0) {<NEW_LINE>// daylight saving time overlap case: issue #446<NEW_LINE>Optional<ZonedDateTime> nextNextExecution = Optional.empty();<NEW_LINE>try {<NEW_LINE>nextNextExecution = Optional.of(nextClosestMatch(<MASK><NEW_LINE>} catch (final NoSuchValueException canBeIgnored) {<NEW_LINE>}<NEW_LINE>if (nextNextExecution.isPresent()) {<NEW_LINE>final boolean lessFrequentThan1Hour = (Duration.between(nextMatch, nextNextExecution.get()).toHours() > 1);<NEW_LINE>if (lessFrequentThan1Hour) {<NEW_LINE>// Avoid duplicate execution during DST overlap<NEW_LINE>nextMatch = nextClosestMatch(date.plusSeconds(1).plusHours(1));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Optional.of(nextMatch);<NEW_LINE>} catch (final NoSuchValueException e) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>}
nextMatch.plusSeconds(1)));
266,135
protected void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException {<NEW_LINE>if (params != null) {<NEW_LINE>throw new InvalidAlgorithmParameterException("HMAC does not use parameters");<NEW_LINE>}<NEW_LINE>if (!(key instanceof SecretKey)) {<NEW_LINE>throw new InvalidKeyException("Secret key expected");<NEW_LINE>}<NEW_LINE>byte[<MASK><NEW_LINE>if (secret == null) {<NEW_LINE>throw new InvalidKeyException("Missing key data");<NEW_LINE>}<NEW_LINE>// if key is longer than the block length, reset it using<NEW_LINE>// the message digest object.<NEW_LINE>if (secret.length > blockLen) {<NEW_LINE>byte[] tmp = md.digest(secret);<NEW_LINE>// now erase the secret<NEW_LINE>Arrays.fill(secret, (byte) 0);<NEW_LINE>secret = tmp;<NEW_LINE>}<NEW_LINE>// XOR k with ipad and opad, respectively<NEW_LINE>for (int i = 0; i < blockLen; i++) {<NEW_LINE>int si = (i < secret.length) ? secret[i] : 0;<NEW_LINE>k_ipad[i] = (byte) (si ^ 0x36);<NEW_LINE>k_opad[i] = (byte) (si ^ 0x5c);<NEW_LINE>}<NEW_LINE>// now erase the secret<NEW_LINE>Arrays.fill(secret, (byte) 0);<NEW_LINE>secret = null;<NEW_LINE>engineReset();<NEW_LINE>}
] secret = key.getEncoded();
1,199,467
public void onError(java.lang.Exception e) {<NEW_LINE>byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;<NEW_LINE>org.apache.thrift.TSerializable msg;<NEW_LINE>getUserAuthorizations_result result = new getUserAuthorizations_result();<NEW_LINE>if (e instanceof ThriftSecurityException) {<NEW_LINE><MASK><NEW_LINE>result.setSecIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof org.apache.thrift.transport.TTransportException) {<NEW_LINE>_LOGGER.error("TTransportException inside handler", e);<NEW_LINE>fb.close();<NEW_LINE>return;<NEW_LINE>} else if (e instanceof org.apache.thrift.TApplicationException) {<NEW_LINE>_LOGGER.error("TApplicationException inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = (org.apache.thrift.TApplicationException) e;<NEW_LINE>} else {<NEW_LINE>_LOGGER.error("Exception inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fcall.sendResponse(fb, msg, msgType, seqid);<NEW_LINE>} catch (java.lang.Exception ex) {<NEW_LINE>_LOGGER.error("Exception writing to internal frame buffer", ex);<NEW_LINE>fb.close();<NEW_LINE>}<NEW_LINE>}
result.sec = (ThriftSecurityException) e;
24,423
public static HashMap<String, Object> convertV2TIMConversationToMap(V2TIMConversation info) {<NEW_LINE>HashMap<String, Object> rinfo = new HashMap<String, Object>();<NEW_LINE>rinfo.put("conversationID", info.getConversationID());<NEW_LINE>rinfo.put("draftText", info.getDraftText());<NEW_LINE>rinfo.put(<MASK><NEW_LINE>rinfo.put("faceUrl", info.getFaceUrl());<NEW_LINE>rinfo.put("groupID", info.getGroupID());<NEW_LINE>rinfo.put("groupType", info.getGroupType());<NEW_LINE>rinfo.put("lastMessage", CommonUtil.convertV2TIMMessageToMap(info.getLastMessage()));<NEW_LINE>rinfo.put("showName", info.getShowName());<NEW_LINE>rinfo.put("type", info.getType());<NEW_LINE>rinfo.put("unreadCount", info.getUnreadCount());<NEW_LINE>rinfo.put("userID", info.getUserID());<NEW_LINE>rinfo.put("isPinned", info.isPinned());<NEW_LINE>rinfo.put("recvOpt", info.getRecvOpt());<NEW_LINE>rinfo.put("orderkey", info.getOrderKey());<NEW_LINE>List<V2TIMGroupAtInfo> atList = info.getGroupAtInfoList();<NEW_LINE>List<Map<String, Object>> groupAtInfoList = new LinkedList<Map<String, Object>>();<NEW_LINE>for (int i = 0; i < atList.size(); i++) {<NEW_LINE>V2TIMGroupAtInfo item = atList.get(i);<NEW_LINE>Map<String, Object> itemMap = new HashMap<String, Object>();<NEW_LINE>itemMap.put("atType", item.getAtType());<NEW_LINE>itemMap.put("seq", String.valueOf(item.getSeq()));<NEW_LINE>groupAtInfoList.add(itemMap);<NEW_LINE>}<NEW_LINE>rinfo.put("groupAtInfoList", groupAtInfoList);<NEW_LINE>return rinfo;<NEW_LINE>}
"draftTimestamp", info.getDraftTimestamp());
863,764
public org.python.Object __ge__(org.python.Object other) {<NEW_LINE>if (other instanceof org.python.types.Int) {<NEW_LINE>long other_val = ((org.python.types.Int) other).value;<NEW_LINE>return org.python.types.Bool.getBool(this.value >= ((double) other_val));<NEW_LINE>} else if (other instanceof org.python.types.Float) {<NEW_LINE>double other_val = ((org.python.types.Float) other).value;<NEW_LINE>return org.python.types.Bool.getBool(this.value >= other_val);<NEW_LINE>} else if (other instanceof org.python.types.Bool) {<NEW_LINE>if (((org.python.types.Bool) other).value) {<NEW_LINE>return org.python.types.Bool.<MASK><NEW_LINE>} else {<NEW_LINE>return org.python.types.Bool.getBool(this.value >= 0.0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return org.python.types.NotImplementedType.NOT_IMPLEMENTED;<NEW_LINE>}
getBool(this.value >= 1.0);
271,624
public boolean handleChild(DDParser parser, String localName) throws DDParser.ParseException {<NEW_LINE>if (xmi && "bindingResourceRef".equals(localName)) {<NEW_LINE>this.bindingResourceRef = new com.ibm.ws.javaee.ddmodel.CrossComponentReferenceType("bindingResourceRef", parser.getCrossComponentType());<NEW_LINE>parser.parse(bindingResourceRef);<NEW_LINE>com.ibm.ws.javaee.dd.common.ResourceRef referent = this.bindingResourceRef.resolveReferent(parser, com.ibm.ws.javaee.dd.common.ResourceRef.class);<NEW_LINE>if (referent != null) {<NEW_LINE>this.name = parser.parseString(referent.getName());<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (!xmi && "authentication-alias".equals(localName)) {<NEW_LINE>com.ibm.ws.javaee.ddmodel.commonbnd.AuthenticationAliasType authentication_alias = new com.ibm.ws.javaee<MASK><NEW_LINE>parser.parse(authentication_alias);<NEW_LINE>this.authentication_alias = authentication_alias;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (!xmi && "custom-login-configuration".equals(localName)) {<NEW_LINE>com.ibm.ws.javaee.ddmodel.commonbnd.CustomLoginConfigurationType custom_login_configuration = new com.ibm.ws.javaee.ddmodel.commonbnd.CustomLoginConfigurationType();<NEW_LINE>parser.parse(custom_login_configuration);<NEW_LINE>this.custom_login_configuration = custom_login_configuration;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (xmi && "properties".equals(localName)) {<NEW_LINE>if (this.custom_login_configuration == null) {<NEW_LINE>this.custom_login_configuration = new com.ibm.ws.javaee.ddmodel.commonbnd.CustomLoginConfigurationType(true);<NEW_LINE>}<NEW_LINE>com.ibm.ws.javaee.ddmodel.commonbnd.PropertyType property = new com.ibm.ws.javaee.ddmodel.commonbnd.PropertyType(xmi);<NEW_LINE>parser.parse(property);<NEW_LINE>this.custom_login_configuration.addProperty(property);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if ((xmi ? "defaultAuth" : "default-auth").equals(localName)) {<NEW_LINE>DefaultAuthType default_auth = new DefaultAuthType(xmi);<NEW_LINE>parser.parse(default_auth);<NEW_LINE>this.default_auth = default_auth;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
.ddmodel.commonbnd.AuthenticationAliasType();
1,493,578
public static SocketAddress resolveAddress(Request request, RequestContext requestContext) throws UnknownHostException, UnknownSchemeException {<NEW_LINE>final URI uri = request.getURI();<NEW_LINE>final String scheme = uri.getScheme();<NEW_LINE>if (!HTTP_SCHEME.equalsIgnoreCase(scheme) && !HTTPS_SCHEME.equalsIgnoreCase(scheme)) {<NEW_LINE>throw new UnknownSchemeException("Unknown scheme: " + scheme + " (only http/https is supported)");<NEW_LINE>}<NEW_LINE>final String host = uri.getHost();<NEW_LINE>int port = uri.getPort();<NEW_LINE>if (port == -1) {<NEW_LINE>port = HTTP_SCHEME.equalsIgnoreCase(scheme) ? HTTP_DEFAULT_PORT : HTTPS_DEFAULT_PORT;<NEW_LINE>}<NEW_LINE>// TODO investigate DNS resolution and timing<NEW_LINE>final InetAddress inetAddress = InetAddress.getByName(host);<NEW_LINE>final SocketAddress address = new InetSocketAddress(inetAddress, port);<NEW_LINE>requestContext.putLocalAttr(R2Constants.REMOTE_SERVER_ADDR, inetAddress.getHostAddress());<NEW_LINE>requestContext.<MASK><NEW_LINE>return address;<NEW_LINE>}
putLocalAttr(R2Constants.REMOTE_SERVER_PORT, port);
639,224
private static void println(@Level int level, @Nullable String tag, @Nullable String msg, @Nullable Throwable tr) {<NEW_LINE>if (INSTANCE.writer == null)<NEW_LINE>return;<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(DATE_FORMAT.format(new Date(System.currentTimeMillis()))).append(" ");<NEW_LINE>switch(level) {<NEW_LINE>case ASSERT:<NEW_LINE>sb.append("A/");<NEW_LINE>break;<NEW_LINE>case DEBUG:<NEW_LINE>sb.append("D/");<NEW_LINE>break;<NEW_LINE>case ERROR:<NEW_LINE>sb.append("E/");<NEW_LINE>break;<NEW_LINE>case INFO:<NEW_LINE>sb.append("I/");<NEW_LINE>break;<NEW_LINE>case VERBOSE:<NEW_LINE>sb.append("V/");<NEW_LINE>break;<NEW_LINE>case WARN:<NEW_LINE>sb.append("W/");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>sb.append(<MASK><NEW_LINE>if (msg != null)<NEW_LINE>sb.append(": ").append(msg);<NEW_LINE>INSTANCE.executor.submit(() -> {<NEW_LINE>synchronized (INSTANCE) {<NEW_LINE>INSTANCE.writer.println(sb);<NEW_LINE>if (tr != null) {<NEW_LINE>tr.printStackTrace(INSTANCE.writer);<NEW_LINE>}<NEW_LINE>INSTANCE.writer.flush();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
tag == null ? "App Manager" : tag);
1,096,379
/*<NEW_LINE>* same hash function with c++ std::tr1::hash<NEW_LINE>* static std::size_t hash(const char* first, std::size_t length)<NEW_LINE>{ std::size_t result = static_cast<std::size_t>(14695981039346656037ULL);<NEW_LINE>for (; length > 0; --length)<NEW_LINE>{<NEW_LINE>size_t value = (std::size_t)*first++;<NEW_LINE>result ^= value;<NEW_LINE>result *= 1099511628211ULL;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>*/<NEW_LINE>private BigInteger paiHash(String source) {<NEW_LINE>if (null == source || source.length() == 0) {<NEW_LINE>return BigInteger.ZERO;<NEW_LINE>}<NEW_LINE>byte[] sourceArray = source.getBytes(StandardCharsets.UTF_8);<NEW_LINE>BigInteger result = new BigInteger("14695981039346656037");<NEW_LINE>BigInteger m = new BigInteger("1099511628211");<NEW_LINE>BigInteger unsignedLongLong = new BigInteger("ffffffffffffffff", 16);<NEW_LINE>for (int i = 0; i < sourceArray.length; i++) {<NEW_LINE>result = result.xor(BigInteger.valueOf(sourceArray[i]));<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return result.and(unsignedLongLong);<NEW_LINE>}
result = result.multiply(m);
94,345
public Set<DataObject> instantiate(TemplateWizard wizard) throws IOException {<NEW_LINE>FileObject targetFolder = Templates.getTargetFolder(wizard);<NEW_LINE>String targetName = Templates.getTargetName(wizard);<NEW_LINE>DataFolder <MASK><NEW_LINE>FileObject template = Templates.getTemplate(wizard);<NEW_LINE>DataObject dTemplate = DataObject.find(template);<NEW_LINE>Map<String, Object> templateProperties = new HashMap<String, Object>();<NEW_LINE>String tagName = (String) wizard.getProperty(FacesComponentPanel.PROP_TAG_NAME);<NEW_LINE>String tagNamespace = (String) wizard.getProperty(FacesComponentPanel.PROP_TAG_NAMESPACE);<NEW_LINE>Boolean createSampleCode = (Boolean) wizard.getProperty(FacesComponentPanel.PROP_SAMPLE_CODE);<NEW_LINE>if (!tagName.isEmpty() && !tagName.equals(tagNameForClassName(targetName))) {<NEW_LINE>// NOI18N<NEW_LINE>templateProperties.put("tagName", tagName);<NEW_LINE>}<NEW_LINE>if (!tagNamespace.isEmpty() && !tagNamespace.equals(DEFAULT_COMPONENT_NS)) {<NEW_LINE>// NOI18N<NEW_LINE>templateProperties.put("tagNamespace", tagNamespace);<NEW_LINE>}<NEW_LINE>if (createSampleCode) {<NEW_LINE>// NOI18N<NEW_LINE>templateProperties.put("sampleCode", Boolean.TRUE);<NEW_LINE>}<NEW_LINE>DataObject result = dTemplate.createFromTemplate(dataFolder, targetName, templateProperties);<NEW_LINE>return Collections.singleton(result);<NEW_LINE>}
dataFolder = DataFolder.findFolder(targetFolder);
1,014,561
private boolean explore(Maze maze, int row, int col, List<Coordinate> path) {<NEW_LINE>if (!maze.isValidLocation(row, col) || maze.isWall(row, col) || maze.isExplored(row, col)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>path.add(<MASK><NEW_LINE>maze.setVisited(row, col, true);<NEW_LINE>if (maze.isExit(row, col)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>for (int[] direction : DIRECTIONS) {<NEW_LINE>Coordinate coordinate = getNextCoordinate(row, col, direction[0], direction[1]);<NEW_LINE>if (explore(maze, coordinate.getX(), coordinate.getY(), path)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>path.remove(path.size() - 1);<NEW_LINE>return false;<NEW_LINE>}
new Coordinate(row, col));
1,217,958
private boolean subTypeOfType(ReferenceBinding subType, ReferenceBinding typeBinding) {<NEW_LINE>if (typeBinding == null || subType == null)<NEW_LINE>return false;<NEW_LINE>if (TypeBinding.equalsEquals(subType, typeBinding))<NEW_LINE>return true;<NEW_LINE>ReferenceBinding superclass = subType.superclass();<NEW_LINE>if (superclass != null)<NEW_LINE>superclass = <MASK><NEW_LINE>// if (superclass != null && superclass.id == TypeIds.T_JavaLangObject && subType.isHierarchyInconsistent()) return false;<NEW_LINE>if (subTypeOfType(superclass, typeBinding))<NEW_LINE>return true;<NEW_LINE>ReferenceBinding[] superInterfaces = subType.superInterfaces();<NEW_LINE>if (superInterfaces != null) {<NEW_LINE>for (int i = 0, length = superInterfaces.length; i < length; i++) {<NEW_LINE>ReferenceBinding superInterface = (ReferenceBinding) superInterfaces[i].erasure();<NEW_LINE>if (subTypeOfType(superInterface, typeBinding))<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
(ReferenceBinding) superclass.erasure();
1,534,764
public Product createProduct(@NonNull final CreateProductRequest request) {<NEW_LINE>final I_M_Product product = newInstance(I_M_Product.class);<NEW_LINE>if (request.getProductValue() != null) {<NEW_LINE>product.setValue(request.getProductValue());<NEW_LINE>}<NEW_LINE>product.setName(request.getProductName());<NEW_LINE>product.setM_Product_Category_ID(request.getProductCategoryId().getRepoId());<NEW_LINE>product.setProductType(request.getProductType());<NEW_LINE>product.setC_UOM_ID(request.getUomId().getRepoId());<NEW_LINE>product.setIsPurchased(request.isPurchased());<NEW_LINE>product.setUPC(request.getEan());<NEW_LINE>product.setGTIN(request.getGtin());<NEW_LINE>product.setDescription(request.getDescription());<NEW_LINE>product.setAD_Org_ID(request.<MASK><NEW_LINE>final boolean isDiscontinued = Boolean.TRUE.equals(request.getDiscontinued());<NEW_LINE>if (isDiscontinued) {<NEW_LINE>final ZoneId zoneId = orgDAO.getTimeZone(request.getOrgId());<NEW_LINE>product.setDiscontinuedFrom(product.getDiscontinuedFrom() != null ? TimeUtil.asTimestamp(request.getDiscontinuedFrom(), zoneId) : TimeUtil.asTimestamp(Instant.now()));<NEW_LINE>} else {<NEW_LINE>product.setDiscontinuedFrom(null);<NEW_LINE>}<NEW_LINE>product.setDiscontinued(isDiscontinued);<NEW_LINE>if (request.getActive() != null) {<NEW_LINE>product.setIsActive(request.getActive());<NEW_LINE>}<NEW_LINE>if (request.getStocked() != null) {<NEW_LINE>product.setIsStocked(request.getStocked());<NEW_LINE>}<NEW_LINE>saveRecord(product);<NEW_LINE>return ofProductRecord(product);<NEW_LINE>}
getOrgId().getRepoId());
117,569
public static void onReceiveReplyToNotification(TermuxApiReceiver termuxApiReceiver, Context context, Intent intent) {<NEW_LINE><MASK><NEW_LINE>CharSequence reply = getMessageText(intent);<NEW_LINE>String action = intent.getStringExtra("action");<NEW_LINE>if (action != null && reply != null)<NEW_LINE>action = action.replace("$REPLY", shellEscape(reply));<NEW_LINE>try {<NEW_LINE>createAction(context, action).send();<NEW_LINE>} catch (PendingIntent.CanceledException e) {<NEW_LINE>Logger.logError(LOG_TAG, "CanceledException when performing action: " + action);<NEW_LINE>}<NEW_LINE>String notificationId = intent.getStringExtra("id");<NEW_LINE>boolean ongoing = intent.getBooleanExtra("ongoing", false);<NEW_LINE>Notification repliedNotification;<NEW_LINE>NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);<NEW_LINE>if (ongoing) {<NEW_LINE>// Re-issue the new notification to clear the spinner<NEW_LINE>repliedNotification = buildNotification(context, intent).first.build();<NEW_LINE>notificationManager.notify(notificationId, 0, repliedNotification);<NEW_LINE>} else {<NEW_LINE>// Cancel the notification<NEW_LINE>notificationManager.cancel(notificationId, 0);<NEW_LINE>}<NEW_LINE>}
Logger.logDebug(LOG_TAG, "onReceiveReplyToNotification");
1,845,731
public GrpcTelemetry build() {<NEW_LINE>SpanNameExtractor<<MASK><NEW_LINE>SpanNameExtractor<? super GrpcRequest> clientSpanNameExtractor = originalSpanNameExtractor;<NEW_LINE>if (clientSpanNameExtractorTransformer != null) {<NEW_LINE>clientSpanNameExtractor = clientSpanNameExtractorTransformer.apply(originalSpanNameExtractor);<NEW_LINE>}<NEW_LINE>SpanNameExtractor<? super GrpcRequest> serverSpanNameExtractor = originalSpanNameExtractor;<NEW_LINE>if (serverSpanNameExtractorTransformer != null) {<NEW_LINE>serverSpanNameExtractor = serverSpanNameExtractorTransformer.apply(originalSpanNameExtractor);<NEW_LINE>}<NEW_LINE>InstrumenterBuilder<GrpcRequest, Status> clientInstrumenterBuilder = Instrumenter.builder(openTelemetry, INSTRUMENTATION_NAME, clientSpanNameExtractor);<NEW_LINE>InstrumenterBuilder<GrpcRequest, Status> serverInstrumenterBuilder = Instrumenter.builder(openTelemetry, INSTRUMENTATION_NAME, serverSpanNameExtractor);<NEW_LINE>Stream.of(clientInstrumenterBuilder, serverInstrumenterBuilder).forEach(instrumenter -> instrumenter.setSpanStatusExtractor(new GrpcSpanStatusExtractor()).addAttributesExtractor(new GrpcAttributesExtractor()).addAttributesExtractors(additionalExtractors));<NEW_LINE>GrpcNetClientAttributesGetter netClientAttributesGetter = new GrpcNetClientAttributesGetter();<NEW_LINE>GrpcRpcAttributesGetter rpcAttributesGetter = GrpcRpcAttributesGetter.INSTANCE;<NEW_LINE>clientInstrumenterBuilder.addAttributesExtractor(RpcClientAttributesExtractor.create(rpcAttributesGetter)).addAttributesExtractor(NetClientAttributesExtractor.create(netClientAttributesGetter));<NEW_LINE>serverInstrumenterBuilder.addAttributesExtractor(RpcServerAttributesExtractor.create(rpcAttributesGetter)).addAttributesExtractor(NetServerAttributesExtractor.create(new GrpcNetServerAttributesGetter()));<NEW_LINE>if (peerService != null) {<NEW_LINE>clientInstrumenterBuilder.addAttributesExtractor(AttributesExtractor.constant(SemanticAttributes.PEER_SERVICE, peerService));<NEW_LINE>} else {<NEW_LINE>clientInstrumenterBuilder.addAttributesExtractor(PeerServiceAttributesExtractor.create(netClientAttributesGetter));<NEW_LINE>}<NEW_LINE>return new // gRPC client interceptors require two phases, one to set up request and one to execute.<NEW_LINE>GrpcTelemetry(// gRPC client interceptors require two phases, one to set up request and one to execute.<NEW_LINE>serverInstrumenterBuilder.newServerInstrumenter(GrpcRequestGetter.INSTANCE), // So we go ahead and inject manually in this instrumentation.<NEW_LINE>clientInstrumenterBuilder.newInstrumenter(SpanKindExtractor.alwaysClient()), openTelemetry.getPropagators(), captureExperimentalSpanAttributes);<NEW_LINE>}
GrpcRequest> originalSpanNameExtractor = new GrpcSpanNameExtractor();
131,991
public ParseFieldOperation mergeWithPrevious(ParseFieldOperation previous) {<NEW_LINE>if (previous == null) {<NEW_LINE>return this;<NEW_LINE>} else if (previous instanceof ParseDeleteOperation) {<NEW_LINE>return new ParseSetOperation(objects);<NEW_LINE>} else if (previous instanceof ParseSetOperation) {<NEW_LINE>Object value = ((ParseSetOperation) previous).getValue();<NEW_LINE>if (value instanceof JSONArray) {<NEW_LINE>ArrayList<Object> result = ParseFieldOperations.jsonArrayAsArrayList((JSONArray) value);<NEW_LINE>result.addAll(objects);<NEW_LINE>return new <MASK><NEW_LINE>} else if (value instanceof List) {<NEW_LINE>ArrayList<Object> result = new ArrayList<>((List<?>) value);<NEW_LINE>result.addAll(objects);<NEW_LINE>return new ParseSetOperation(result);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("You can only add an item to a List or JSONArray.");<NEW_LINE>}<NEW_LINE>} else if (previous instanceof ParseAddOperation) {<NEW_LINE>ArrayList<Object> result = new ArrayList<>(((ParseAddOperation) previous).objects);<NEW_LINE>result.addAll(objects);<NEW_LINE>return new ParseAddOperation(result);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Operation is invalid after previous operation.");<NEW_LINE>}<NEW_LINE>}
ParseSetOperation(new JSONArray(result));
1,641,407
public boolean onCreateOptionsMenu(final Menu menu) {<NEW_LINE>try (ContextLogger ignore = new ContextLogger(Log.LogLevel.DEBUG, "MainActivity.onCreateOptionsMenu")) {<NEW_LINE>getMenuInflater().inflate(R.menu.main_activity_options, menu);<NEW_LINE>MenuCompat.setGroupDividerEnabled(menu, true);<NEW_LINE>final SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);<NEW_LINE>searchItem = menu.findItem(R.id.menu_gosearch);<NEW_LINE>searchView = (SearchView) searchItem.getActionView();<NEW_LINE>searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));<NEW_LINE>searchView.setSuggestionsAdapter(new GeocacheSuggestionsAdapter(this));<NEW_LINE>// initialize menu items<NEW_LINE>menu.findItem(R.id.menu_wizard).setVisible(!InstallWizardActivity.isConfigurationOk(this));<NEW_LINE>menu.findItem(R.id.menu_update_routingdata).setEnabled(Settings.useInternalRouting());<NEW_LINE>final boolean isPremiumActive = Settings.isGCConnectorActive<MASK><NEW_LINE>menu.findItem(R.id.menu_pocket_queries).setVisible(isPremiumActive);<NEW_LINE>menu.findItem(R.id.menu_bookmarklists).setVisible(isPremiumActive);<NEW_LINE>SearchUtils.hideKeyboardOnSearchClick(searchView, searchItem);<NEW_LINE>SearchUtils.hideActionIconsWhenSearchIsActive(this, menu, searchItem);<NEW_LINE>SearchUtils.handleDropDownVisibility(this, searchView, searchItem);<NEW_LINE>}<NEW_LINE>if (Log.isEnabled(Log.LogLevel.DEBUG)) {<NEW_LINE>binding.getRoot().post(() -> Log.d("Post after MainActivity.onCreateOptionsMenu"));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
() && Settings.isGCPremiumMember();
1,038,264
private int readC(String sql, int end, int tokenStart, int i, ArrayList<Token> tokens) {<NEW_LINE>int endIndex = findIdentifierEnd(sql, end, i);<NEW_LINE>int length = endIndex - tokenStart;<NEW_LINE>int type;<NEW_LINE>if (eq("CASE", sql, tokenStart, length)) {<NEW_LINE>type = CASE;<NEW_LINE>} else if (eq("CAST", sql, tokenStart, length)) {<NEW_LINE>type = CAST;<NEW_LINE>} else if (eq("CHECK", sql, tokenStart, length)) {<NEW_LINE>type = CHECK;<NEW_LINE>} else if (eq("CONSTRAINT", sql, tokenStart, length)) {<NEW_LINE>type = CONSTRAINT;<NEW_LINE>} else if (eq("CROSS", sql, tokenStart, length)) {<NEW_LINE>type = CROSS;<NEW_LINE>} else if (length >= 12 && eq("CURRENT_", sql, tokenStart, 8)) {<NEW_LINE>type = getTokenTypeCurrent(sql, tokenStart, length);<NEW_LINE>} else {<NEW_LINE>type = IDENTIFIER;<NEW_LINE>}<NEW_LINE>return readIdentifierOrKeyword(sql, <MASK><NEW_LINE>}
tokenStart, tokens, endIndex, type);
1,300,601
public static DescribeRoomKickoutUserListResponse unmarshall(DescribeRoomKickoutUserListResponse describeRoomKickoutUserListResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeRoomKickoutUserListResponse.setRequestId(_ctx.stringValue("DescribeRoomKickoutUserListResponse.RequestId"));<NEW_LINE>describeRoomKickoutUserListResponse.setTotalPage(_ctx.integerValue("DescribeRoomKickoutUserListResponse.TotalPage"));<NEW_LINE>describeRoomKickoutUserListResponse.setTotalNum(_ctx.integerValue("DescribeRoomKickoutUserListResponse.TotalNum"));<NEW_LINE>List<User> userList <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeRoomKickoutUserListResponse.UserList.Length"); i++) {<NEW_LINE>User user = new User();<NEW_LINE>user.setOpStartTime(_ctx.stringValue("DescribeRoomKickoutUserListResponse.UserList[" + i + "].OpStartTime"));<NEW_LINE>user.setOpEndTime(_ctx.stringValue("DescribeRoomKickoutUserListResponse.UserList[" + i + "].OpEndTime"));<NEW_LINE>user.setAppUid(_ctx.stringValue("DescribeRoomKickoutUserListResponse.UserList[" + i + "].AppUid"));<NEW_LINE>userList.add(user);<NEW_LINE>}<NEW_LINE>describeRoomKickoutUserListResponse.setUserList(userList);<NEW_LINE>return describeRoomKickoutUserListResponse;<NEW_LINE>}
= new ArrayList<User>();
978,582
public static void topicYamlGenerator(Map<String, Object> parent, Config config) {<NEW_LINE>if (config.getTopicConfigs().isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, Object> child = new LinkedHashMap<>();<NEW_LINE>for (TopicConfig subConfigAsObject : config.getTopicConfigs().values()) {<NEW_LINE>Map<String, Object> subConfigAsMap = new LinkedHashMap<>();<NEW_LINE>addNonNullToMap(subConfigAsMap, "statistics-enabled", subConfigAsObject.isStatisticsEnabled());<NEW_LINE>addNonNullToMap(subConfigAsMap, <MASK><NEW_LINE>addNonNullToMap(subConfigAsMap, "message-listeners", getListenerConfigsAsList(subConfigAsObject.getMessageListenerConfigs()));<NEW_LINE>addNonNullToMap(subConfigAsMap, "multi-threading-enabled", subConfigAsObject.isMultiThreadingEnabled());<NEW_LINE>child.put(subConfigAsObject.getName(), subConfigAsMap);<NEW_LINE>}<NEW_LINE>parent.put("topic", child);<NEW_LINE>}
"global-ordering-enabled", subConfigAsObject.isGlobalOrderingEnabled());
92,853
public static void main(String[] args) throws Exception {<NEW_LINE>ClientConfig daxConfig = new ClientConfig().withCredentialsProvider(new ProfileCredentialsProvider()).withEndpoints("mydaxcluster.2cmrwl.clustercfg.dax.use1.cache.amazonaws.com:8111");<NEW_LINE>AmazonDynamoDBAsync client = new ClusterDaxAsyncClient(daxConfig);<NEW_LINE>HashMap<String, AttributeValue> key = new HashMap<String, AttributeValue>();<NEW_LINE>key.put("Artist", new AttributeValue<MASK><NEW_LINE>key.put("SongTitle", new AttributeValue().withS("Scared of My Shadow"));<NEW_LINE>GetItemRequest request = new GetItemRequest().withTableName("Music").withKey(key);<NEW_LINE>// Java Futures<NEW_LINE>Future<GetItemResult> call = client.getItemAsync(request);<NEW_LINE>while (!call.isDone()) {<NEW_LINE>// Do other processing while you're waiting for the response<NEW_LINE>System.out.println("Doing something else for a few seconds...");<NEW_LINE>Thread.sleep(3000);<NEW_LINE>}<NEW_LINE>// The results should be ready by now<NEW_LINE>try {<NEW_LINE>call.get();<NEW_LINE>} catch (ExecutionException ee) {<NEW_LINE>// Futures always wrap errors as an ExecutionException.<NEW_LINE>// The *real* exception is stored as the cause of the<NEW_LINE>// ExecutionException<NEW_LINE>Throwable exception = ee.getCause();<NEW_LINE>System.out.println("Error getting item: " + exception.getMessage());<NEW_LINE>}<NEW_LINE>// Async callbacks<NEW_LINE>call = client.getItemAsync(request, new AsyncHandler<GetItemRequest, GetItemResult>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(GetItemRequest request, GetItemResult getItemResult) {<NEW_LINE>System.out.println("Result: " + getItemResult);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Exception e) {<NEW_LINE>System.out.println("Unable to read item");<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE>// Callers can also test if exception is an instance of<NEW_LINE>// AmazonServiceException or AmazonClientException and cast<NEW_LINE>// it to get additional information<NEW_LINE>}<NEW_LINE>});<NEW_LINE>call.get();<NEW_LINE>}
().withS("No One You Know"));
499,255
static <R extends Response> R extractResponseAndNotifyResponseHandler(ResponseHandler responseHandler, NonBlockingRouterMetrics routerMetrics, ResponseInfo responseInfo, Deserializer<R> deserializer, Function<R, ServerErrorCode> errorExtractor) {<NEW_LINE>R response = null;<NEW_LINE>if (responseInfo.isQuotaRejected()) {<NEW_LINE>return response;<NEW_LINE>}<NEW_LINE>ReplicaId replicaId = responseInfo.getRequestInfo().getReplicaId();<NEW_LINE>NetworkClientErrorCode networkClientErrorCode = responseInfo.getError();<NEW_LINE>if (networkClientErrorCode == null) {<NEW_LINE>try {<NEW_LINE>if (responseInfo.getResponse() != null) {<NEW_LINE>// If this responseInfo already has the deserialized java object, we can reference it directly. This is<NEW_LINE>// applicable when we are receiving responses from Azure APIs in frontend. The responses from Azure are<NEW_LINE>// handled in {@code AmbryRequest} class methods using a thread pool running with in the frontend. These<NEW_LINE>// responses are then sent using local queues in {@code LocalRequestResponseChannel}.<NEW_LINE>response = (R) mapToReceivedResponse((Response) responseInfo.getResponse());<NEW_LINE>} else {<NEW_LINE>DataInputStream dis = new NettyByteBufDataInputStream(responseInfo.content());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>responseHandler.onEvent(replicaId, errorExtractor.apply(response));<NEW_LINE>} catch (Exception e) {<NEW_LINE>// Ignore. There is no value in notifying the response handler.<NEW_LINE>logger.error("Response deserialization received unexpected error", e);<NEW_LINE>routerMetrics.responseDeserializationErrorCount.inc();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>responseHandler.onEvent(replicaId, networkClientErrorCode);<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>}
response = deserializer.readFrom(dis);
1,650,030
public void parse(String str) {<NEW_LINE>if (debug) {<NEW_LINE>log.debug("parse " + str);<NEW_LINE>}<NEW_LINE>String[] ss = Strings.splitIgnoreBlank(str, ";");<NEW_LINE>for (String s : ss) {<NEW_LINE>Pair<String> p = Pair.create(Strings.trim(s));<NEW_LINE>if (p.getValueString() == null && ignoreNull) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (keyWords.contains(p.getName().toLowerCase()))<NEW_LINE>continue;<NEW_LINE>if ("Max-Age".equalsIgnoreCase(p.getName())) {<NEW_LINE>long age = Long.parseLong(p.getValue());<NEW_LINE>if (age == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String val = Strings.sNull(p.getValueString());<NEW_LINE>if (debug) {<NEW_LINE>log.debugf("add cookie [%s=%s]", <MASK><NEW_LINE>}<NEW_LINE>map.put(p.getName(), val);<NEW_LINE>}<NEW_LINE>}
p.getName(), val);
1,834,660
public RelDataType validateImpl(RelDataType targetRowType) {<NEW_LINE>resolvedNamespace = Preconditions.checkNotNull(resolveImpl(id));<NEW_LINE>if (resolvedNamespace instanceof TableNamespace) {<NEW_LINE>SqlValidatorTable table = resolvedNamespace.getTable();<NEW_LINE>if (validator.shouldExpandIdentifiers()) {<NEW_LINE>// TODO: expand qualifiers for column references also<NEW_LINE>List<String> qualifiedNames = table.getQualifiedName();<NEW_LINE>if (qualifiedNames != null) {<NEW_LINE>// Assign positions to the components of the fully-qualified<NEW_LINE>// identifier, as best we can. We assume that qualification<NEW_LINE>// adds names to the front, e.g. FOO.BAR becomes BAZ.FOO.BAR.<NEW_LINE>List<SqlParserPos> poses = new ArrayList<>(Collections.nCopies(qualifiedNames.size(), id.getParserPosition()));<NEW_LINE>int offset = qualifiedNames.size() - id.names.size();<NEW_LINE>// Test offset in case catalog supports fewer qualifiers than catalog<NEW_LINE>// reader.<NEW_LINE>if (offset >= 0) {<NEW_LINE>for (int i = 0; i < id.names.size(); i++) {<NEW_LINE>poses.set(i + offset, id.getComponentParserPosition(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>id.setNames(qualifiedNames, poses);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (extendList != null) {<NEW_LINE>if (!(resolvedNamespace instanceof TableNamespace)) {<NEW_LINE>throw new RuntimeException("cannot convert");<NEW_LINE>}<NEW_LINE>resolvedNamespace = ((TableNamespace) resolvedNamespace).extend(extendList);<NEW_LINE>rowType = resolvedNamespace.getRowType();<NEW_LINE>}<NEW_LINE>// Build a list of monotonic expressions.<NEW_LINE>final ImmutableList.Builder<Pair<SqlNode, SqlMonotonicity>> builder = ImmutableList.builder();<NEW_LINE>List<RelDataTypeField> fields = rowType.getFieldList();<NEW_LINE>for (RelDataTypeField field : fields) {<NEW_LINE>final String fieldName = field.getName();<NEW_LINE>final SqlMonotonicity monotonicity = resolvedNamespace.getMonotonicity(fieldName);<NEW_LINE>if (monotonicity != SqlMonotonicity.NOT_MONOTONIC) {<NEW_LINE>builder.add(Pair.of((SqlNode) new SqlIdentifier(fieldName, SqlParserPos.ZERO), monotonicity));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>monotonicExprs = builder.build();<NEW_LINE>// Validation successful.<NEW_LINE>return rowType;<NEW_LINE>}
RelDataType rowType = resolvedNamespace.getRowType();
1,074,551
public RuleResult execute(final Map<String, String> ruleParam, Map<String, String> resourceAttributes) {<NEW_LINE>logger.debug("========SecurityGroupNotUsedRule started=========");<NEW_LINE>String groupId = null;<NEW_LINE>Annotation annotation = null;<NEW_LINE>String severity = ruleParam.get(PacmanRuleConstants.SEVERITY);<NEW_LINE>String category = ruleParam.get(PacmanRuleConstants.CATEGORY);<NEW_LINE>String tagsSplitter = ruleParam.get(PacmanSdkConstants.SPLITTER_CHAR);<NEW_LINE>String groupName = resourceAttributes.get(PacmanRuleConstants.GROUP_NAME);<NEW_LINE>String serviceWithSgUrls = null;<NEW_LINE>String esUrl = ruleParam.get(PacmanRuleConstants.ES_URL_PARAM);<NEW_LINE>// this is the logback Mapped Diagnostic Contex<NEW_LINE>MDC.put("executionId", ruleParam.get("executionId"));<NEW_LINE>// this is the logback Mapped Diagnostic Contex<NEW_LINE>MDC.put("ruleId", ruleParam.get(PacmanSdkConstants.RULE_ID));<NEW_LINE>String pacmanHost = PacmanUtils.getPacmanHost(PacmanRuleConstants.ES_URI);<NEW_LINE>if (!StringUtils.isNullOrEmpty(pacmanHost)) {<NEW_LINE>serviceWithSgUrls = ruleParam.get(PacmanRuleConstants.ES_SERVICES_WITH_SG_URL);<NEW_LINE>esUrl = pacmanHost;<NEW_LINE>}<NEW_LINE>List<LinkedHashMap<String, Object>> issueList = new ArrayList<>();<NEW_LINE>LinkedHashMap<String, Object> issue = new LinkedHashMap<>();<NEW_LINE>if (!PacmanUtils.doesAllHaveValue(severity, category, serviceWithSgUrls, tagsSplitter, esUrl)) {<NEW_LINE>logger.info(PacmanRuleConstants.MISSING_CONFIGURATION);<NEW_LINE>throw new InvalidInputException(PacmanRuleConstants.MISSING_CONFIGURATION);<NEW_LINE>}<NEW_LINE>List<String> serviceWithSgUrlsList = PacmanUtils.splitStringToAList(serviceWithSgUrls, tagsSplitter);<NEW_LINE>if (!resourceAttributes.isEmpty()) {<NEW_LINE>groupId = StringUtils.trim(resourceAttributes.get(PacmanRuleConstants.GROUP_ID));<NEW_LINE>String resource;<NEW_LINE>try {<NEW_LINE>resource = PacmanUtils.getQueryFromElasticSearch(groupId, serviceWithSgUrlsList, esUrl, ruleParam);<NEW_LINE>if (StringUtils.isNullOrEmpty(resource)) {<NEW_LINE>annotation = Annotation.buildAnnotation(ruleParam, Annotation.Type.ISSUE);<NEW_LINE>annotation.<MASK><NEW_LINE>annotation.put(PacmanRuleConstants.SEVERITY, severity);<NEW_LINE>annotation.put(PacmanRuleConstants.SUBTYPE, Annotation.Type.RECOMMENDATION.toString());<NEW_LINE>annotation.put(PacmanRuleConstants.CATEGORY, category);<NEW_LINE>annotation.put(PacmanRuleConstants.GROUP_NAME, groupName);<NEW_LINE>issue.put(PacmanRuleConstants.VIOLATION_REASON, "Security group not associated to any of EC2/ApplicationElb/ClassicElb/RDSDB/RDSCluster/RedShift/Lambda/Elasticsearch");<NEW_LINE>issueList.add(issue);<NEW_LINE>annotation.put("issueDetails", issueList.toString());<NEW_LINE>logger.debug("========SecurityGroupNotUsedRule ended with an annotation : {}=========", annotation);<NEW_LINE>return new RuleResult(PacmanSdkConstants.STATUS_FAILURE, PacmanRuleConstants.FAILURE_MESSAGE, annotation);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("unable to determine", e);<NEW_LINE>throw new RuleExecutionFailedExeption("unable to determine" + e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.debug("========SecurityGroupNotUsedRule ended=========");<NEW_LINE>return new RuleResult(PacmanSdkConstants.STATUS_SUCCESS, PacmanRuleConstants.SUCCESS_MESSAGE);<NEW_LINE>}
put(PacmanSdkConstants.DESCRIPTION, "Unused security group found!!");
614,349
public ImmutableSortedMap<K, V> insert(K key, V value) {<NEW_LINE>int pos = findKey(key);<NEW_LINE>if (pos != -1) {<NEW_LINE>if (this.keys[pos] == key && this.values[pos] == value) {<NEW_LINE>return this;<NEW_LINE>} else {<NEW_LINE>// The key and/or value might have changed, even though the comparison might still yield 0<NEW_LINE>K[] newKeys = replaceInArray(<MASK><NEW_LINE>V[] newValues = replaceInArray(this.values, pos, value);<NEW_LINE>return new ArraySortedMap<K, V>(this.comparator, newKeys, newValues);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (this.keys.length > Builder.ARRAY_TO_RB_TREE_SIZE_THRESHOLD) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<K, V> map = new HashMap<K, V>(this.keys.length + 1);<NEW_LINE>for (int i = 0; i < this.keys.length; i++) {<NEW_LINE>map.put(this.keys[i], this.values[i]);<NEW_LINE>}<NEW_LINE>map.put(key, value);<NEW_LINE>return RBTreeSortedMap.fromMap(map, this.comparator);<NEW_LINE>} else {<NEW_LINE>int newPos = findKeyOrInsertPosition(key);<NEW_LINE>K[] keys = addToArray(this.keys, newPos, key);<NEW_LINE>V[] values = addToArray(this.values, newPos, value);<NEW_LINE>return new ArraySortedMap<K, V>(this.comparator, keys, values);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
this.keys, pos, key);
1,579,352
public QuickConnectSummary unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>QuickConnectSummary quickConnectSummary = new QuickConnectSummary();<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("Id", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>quickConnectSummary.setId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Arn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>quickConnectSummary.setArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>quickConnectSummary.setName(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("QuickConnectType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>quickConnectSummary.setQuickConnectType(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 quickConnectSummary;<NEW_LINE>}
class).unmarshall(context));
1,620,857
public void callbackOnContext(TraverserContext context, DataSchemaTraverse.Order order) {<NEW_LINE>if (context.getEnclosingField() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (DataSchemaTraverse.Order.PRE_ORDER.equals(order)) {<NEW_LINE>final DataSchema currentSchema = context.getCurrentSchema().getDereferencedDataSchema();<NEW_LINE>final PathSpec path = new PathSpec(context.getSchemaPathSpec());<NEW_LINE>// First, check for collection in primary properties<NEW_LINE>final Map<String, Object> primaryProperties = context.getEnclosingField().getProperties();<NEW_LINE>final Object timeseriesFieldAnnotationObj = primaryProperties.get(TimeseriesFieldAnnotation.ANNOTATION_NAME);<NEW_LINE>final Object timeseriesFieldCollectionAnnotationObj = <MASK><NEW_LINE>if (currentSchema.getType() == DataSchema.Type.RECORD && timeseriesFieldCollectionAnnotationObj != null) {<NEW_LINE>validateCollectionAnnotation(currentSchema, timeseriesFieldCollectionAnnotationObj, context.getTraversePath().toString());<NEW_LINE>addTimeseriesFieldCollectionSpec(currentSchema, path, timeseriesFieldCollectionAnnotationObj);<NEW_LINE>} else if (timeseriesFieldAnnotationObj != null && !path.getPathComponents().get(path.getPathComponents().size() - 1).equals("*")) {<NEW_LINE>// For arrays make sure to add just the array form<NEW_LINE>addTimeseriesFieldSpec(currentSchema, path, timeseriesFieldAnnotationObj);<NEW_LINE>} else {<NEW_LINE>addTimeseriesFieldCollectionKey(path);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
primaryProperties.get(TimeseriesFieldCollectionAnnotation.ANNOTATION_NAME);
667,337
public Artifact buildIjar(StarlarkActionFactory actions, Artifact inputJar, @Nullable Label targetLabel, JavaToolchainProvider javaToolchain) throws EvalException {<NEW_LINE>String ijarBasename = FileSystemUtils.removeExtension(inputJar.getFilename()) + "-ijar.jar";<NEW_LINE>Artifact interfaceJar = actions.declareFile(ijarBasename, inputJar);<NEW_LINE>FilesToRunProvider ijarTarget = javaToolchain.getIjar();<NEW_LINE>CustomCommandLine.Builder commandLine = CustomCommandLine.builder().addExecPath(inputJar).addExecPath(interfaceJar);<NEW_LINE>if (targetLabel != null) {<NEW_LINE>commandLine.addLabel("--target_label", targetLabel);<NEW_LINE>}<NEW_LINE>SpawnAction.Builder actionBuilder = new SpawnAction.Builder().addInput(inputJar).addOutput(interfaceJar).setExecutable(ijarTarget).setProgressMessage("Extracting interface for jar %s", inputJar.getFilename()).addCommandLine(commandLine.build()).useDefaultShellEnvironment().setMnemonic("JavaIjar");<NEW_LINE>actions.registerAction(actionBuilder.build<MASK><NEW_LINE>return interfaceJar;<NEW_LINE>}
(actions.getActionConstructionContext()));
1,129,509
public static List<Point2D_F64> gridChess(int numRows, int numCols, double squareWidth) {<NEW_LINE>List<Point2D_F64> all = new ArrayList<>();<NEW_LINE>// convert it into the number of calibration points<NEW_LINE>numCols = numCols - 1;<NEW_LINE>numRows = numRows - 1;<NEW_LINE>// center the grid around the origin. length of a size divided by two<NEW_LINE>double startX = -((numCols - 1) * squareWidth) / 2.0;<NEW_LINE>double startY = -((numRows - 1) * squareWidth) / 2.0;<NEW_LINE>for (int i = numRows - 1; i >= 0; i--) {<NEW_LINE>double y = startY + i * squareWidth;<NEW_LINE>for (int j = 0; j < numCols; j++) {<NEW_LINE>double x = startX + j * squareWidth;<NEW_LINE>all.add(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return all;<NEW_LINE>}
new Point2D_F64(x, y));
1,031,869
public void onWornTick(ItemStack stack, LivingEntity entity) {<NEW_LINE>if (!entity.level.isClientSide && !entity.isShiftKeyDown()) {<NEW_LINE>boolean lastOnGround = entity.isOnGround();<NEW_LINE>entity.setOnGround(true);<NEW_LINE>FrostWalkerEnchantment.onEntityMoved(entity, entity.level, <MASK><NEW_LINE>entity.setOnGround(lastOnGround);<NEW_LINE>int x = Mth.floor(entity.getX());<NEW_LINE>int y = Mth.floor(entity.getY());<NEW_LINE>int z = Mth.floor(entity.getZ());<NEW_LINE>BlockState blockstate = Blocks.SNOW.defaultBlockState();<NEW_LINE>for (int l = 0; l < 4; ++l) {<NEW_LINE>x = Mth.floor(entity.getX() + (double) ((float) (l % 2 * 2 - 1) * 0.25F));<NEW_LINE>z = Mth.floor(entity.getZ() + (double) ((float) (l / 2 % 2 * 2 - 1) * 0.25F));<NEW_LINE>BlockPos blockpos = new BlockPos(x, y, z);<NEW_LINE>if (entity.level.isEmptyBlock(blockpos) && ((AccessorBiome) (Object) (entity.level.getBiome(blockpos))).callGetTemperature(blockpos) < 0.9F && blockstate.canSurvive(entity.level, blockpos)) {<NEW_LINE>entity.level.setBlockAndUpdate(blockpos, blockstate);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (entity.level.isClientSide && !entity.isShiftKeyDown()) {<NEW_LINE>if (entity.level.random.nextFloat() >= 0.25F) {<NEW_LINE>entity.level.addParticle(new BlockParticleOption(ParticleTypes.FALLING_DUST, Blocks.SNOW_BLOCK.defaultBlockState()), entity.getX() + entity.level.random.nextFloat() * 0.6 - 0.3, entity.getY() + 1.1, entity.getZ() + entity.level.random.nextFloat() * 0.6 - 0.3, 0, -0.15, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
entity.blockPosition(), 8);
573,843
public void initialize() {<NEW_LINE>super.initialize();<NEW_LINE>// -- const vec3 cXaxis = vec3(1.0, 0.0, 0.0);<NEW_LINE>mcXAxis = (RVec3) addConst("cXAxis", castVec3(1.f, 0, 0));<NEW_LINE>// -- const vec3 cYaxis = vec3(0.0, 1.0, 0.0);<NEW_LINE>mcYAxis = (RVec3) addConst("cYAxis", castVec3(0, 1.f, 0));<NEW_LINE>// -- const vec3 cZaxis = vec3(0.0, 0.0, 1.0);<NEW_LINE>mcZAxis = (RVec3) addConst("cZAxis", castVec3(0, 0, 1.f));<NEW_LINE>// -- the amplitude of the 'wave' effect<NEW_LINE>// const float cStrength = 0.5;<NEW_LINE>mcStrength = (<MASK><NEW_LINE>}
RFloat) addConst("cStrength", .5f);
830,315
/* (non-Javadoc)<NEW_LINE>* @see com.webank.weid.rpc.CredentialPojoService#verify(<NEW_LINE>* com.webank.weid.protocol.base.CredentialPojo,<NEW_LINE>* com.webank.weid.protocol.base.WeIdPublicKey<NEW_LINE>* )<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public ResponseData<Boolean> verify(WeIdPublicKey issuerPublicKey, CredentialPojo credential) {<NEW_LINE>String publicKey = issuerPublicKey.getPublicKey();<NEW_LINE>if (StringUtils.isEmpty(publicKey)) {<NEW_LINE>return new ResponseData<Boolean>(false, ErrorCode.CREDENTIAL_PUBLIC_KEY_NOT_EXISTS);<NEW_LINE>}<NEW_LINE>if (CredentialPojoUtils.isLiteCredential(credential)) {<NEW_LINE>return verifyLiteCredential(credential, issuerPublicKey.getPublicKey(), null);<NEW_LINE>}<NEW_LINE>ErrorCode errorCode = verifyContent(credential, publicKey, false, null);<NEW_LINE>if (errorCode.getCode() != ErrorCode.SUCCESS.getCode()) {<NEW_LINE>return new ResponseData<MASK><NEW_LINE>}<NEW_LINE>return new ResponseData<Boolean>(true, ErrorCode.SUCCESS);<NEW_LINE>}
<Boolean>(false, errorCode);
1,284,671
private void processMethods(DexHeader header, TaskMonitor monitor, MessageLog log) throws Exception {<NEW_LINE>monitor.setMessage("DEX: processing methods");<NEW_LINE>monitor.setMaximum(header.getMethodIdsSize());<NEW_LINE>monitor.setProgress(0);<NEW_LINE>Address address = baseAddress.add(header.getMethodIdsOffset());<NEW_LINE>int methodIndex = 0;<NEW_LINE>for (MethodIDItem item : header.getMethods()) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>monitor.incrementProgress(1);<NEW_LINE>DataType dataType = item.toDataType();<NEW_LINE>api.createData(address, dataType);<NEW_LINE>fragmentManager.methodsAddressSet.add(address, address.add(dataType.getLength() - 1));<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>builder.append("Method Index: 0x" + Integer.toHexString(methodIndex) + "\n");<NEW_LINE>builder.append("Class: " + DexUtil.convertTypeIndexToString(header, item.getClassIndex()) + "\n");<NEW_LINE>builder.append("Prototype: " + DexUtil.convertPrototypeIndexToString(header, item.getProtoIndex()) + "\n");<NEW_LINE>builder.append("Name: " + DexUtil.convertToString(header, item.getNameIndex()) + "\n");<NEW_LINE>api.setPlateComment(address, builder.toString());<NEW_LINE>Address methodIndexAddress = DexUtil.toLookupAddress(program, methodIndex);<NEW_LINE>if (program.getMemory().getInt(methodIndexAddress) == -1) {<NEW_LINE>// Add placeholder symbol for external functions<NEW_LINE>String methodName = DexUtil.convertToString(header, item.getNameIndex());<NEW_LINE>String className = DexUtil.convertTypeIndexToString(header, item.getClassIndex());<NEW_LINE>Namespace classNameSpace = <MASK><NEW_LINE>if (classNameSpace != null) {<NEW_LINE>Address externalAddress = DexUtil.toLookupAddress(program, methodIndex);<NEW_LINE>Symbol methodSymbol = createMethodSymbol(externalAddress, methodName, classNameSpace, log);<NEW_LINE>if (methodSymbol != null) {<NEW_LINE>String externalName = methodSymbol.getName(true);<NEW_LINE>program.getReferenceManager().addExternalReference(methodIndexAddress, "EXTERNAL.dex-" + methodIndex, externalName, null, SourceType.ANALYSIS, 0, RefType.DATA);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>api.createData(methodIndexAddress, new PointerDataType());<NEW_LINE>++methodIndex;<NEW_LINE>address = address.add(dataType.getLength());<NEW_LINE>}<NEW_LINE>}
DexUtil.createNameSpaceFromMangledClassName(program, className);
1,806,711
public PropertiesDiff build() {<NEW_LINE>DiffBuilder<?> leftBuilder = new DiffBuilder<>(leftMap, rightMap, ToStringStyle.DEFAULT_STYLE);<NEW_LINE>DiffBuilder<?> rightBuilder = new DiffBuilder<>(leftMap, rightMap, ToStringStyle.DEFAULT_STYLE);<NEW_LINE>List<String> <MASK><NEW_LINE>for (Entry<String, String> entry : leftMap.entrySet()) {<NEW_LINE>if (!rightMap.containsKey(entry.getKey())) {<NEW_LINE>removed.put(entry.getKey(), entry.getValue());<NEW_LINE>leftMapRemove.add(entry.getKey());<NEW_LINE>} else {<NEW_LINE>leftBuilder.append(entry.getKey(), entry.getValue(), rightMap.get(entry.getKey()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String keyToRemove : leftMapRemove) {<NEW_LINE>leftMap.remove(keyToRemove);<NEW_LINE>}<NEW_LINE>for (Entry<String, String> entry : rightMap.entrySet()) {<NEW_LINE>rightBuilder.append(entry.getKey(), entry.getValue(), leftMap.get(entry.getKey()));<NEW_LINE>}<NEW_LINE>DiffResult<?> leftResult = leftBuilder.build();<NEW_LINE>for (Diff<?> diff : leftResult) {<NEW_LINE>leftMap.remove(diff.getFieldName());<NEW_LINE>if (diff.getRight() == null) {<NEW_LINE>deleted.put(diff.getFieldName(), diff.getLeft().toString());<NEW_LINE>} else if (!StringUtils.hasText(diff.getRight().toString())) {<NEW_LINE>deleted.put(diff.getFieldName(), diff.getLeft().toString());<NEW_LINE>} else {<NEW_LINE>changed.put(diff.getFieldName(), new PropertyChange(diff.getLeft().toString(), diff.getRight().toString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>common.putAll(leftMap);<NEW_LINE>DiffResult<?> rightResult = rightBuilder.build();<NEW_LINE>for (Diff<?> diff : rightResult) {<NEW_LINE>if (diff.getRight() == null) {<NEW_LINE>added.put(diff.getFieldName(), diff.getLeft().toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new PropertiesDiff(removed, added, common, changed, deleted);<NEW_LINE>}
leftMapRemove = new ArrayList<>();
1,854,795
private void updateUI() {<NEW_LINE>FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser();<NEW_LINE>if (currentUser == null) {<NEW_LINE>// Not signed in<NEW_LINE>mBinding.anonSignIn.setEnabled(true);<NEW_LINE>mBinding.beginFlow.setEnabled(false);<NEW_LINE>mBinding.resolveMerge.setEnabled(false);<NEW_LINE>mBinding.signOut.setEnabled(false);<NEW_LINE>} else if (mPendingCredential == null && currentUser.isAnonymous()) {<NEW_LINE>// Anonymous user, waiting for linking<NEW_LINE>mBinding.anonSignIn.setEnabled(false);<NEW_LINE>mBinding.beginFlow.setEnabled(true);<NEW_LINE>mBinding.resolveMerge.setEnabled(false);<NEW_LINE><MASK><NEW_LINE>} else if (mPendingCredential == null && !currentUser.isAnonymous()) {<NEW_LINE>// Fully signed in<NEW_LINE>mBinding.anonSignIn.setEnabled(false);<NEW_LINE>mBinding.beginFlow.setEnabled(false);<NEW_LINE>mBinding.resolveMerge.setEnabled(false);<NEW_LINE>mBinding.signOut.setEnabled(true);<NEW_LINE>} else if (mPendingCredential != null) {<NEW_LINE>// Signed in anonymous, awaiting merge conflict<NEW_LINE>mBinding.anonSignIn.setEnabled(false);<NEW_LINE>mBinding.beginFlow.setEnabled(false);<NEW_LINE>mBinding.resolveMerge.setEnabled(true);<NEW_LINE>mBinding.signOut.setEnabled(true);<NEW_LINE>}<NEW_LINE>}
mBinding.signOut.setEnabled(true);
1,631,757
public void write(List<IoTDBInsertRequest> requestList) throws IOException {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>for (IoTDBInsertRequest request : requestList) {<NEW_LINE>log.debug("Writing data to IoTDB: {}", request);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<String> devicePathList = new ArrayList<>();<NEW_LINE>List<Long> timeList = new ArrayList<>();<NEW_LINE>List<List<String>> timeseriesListList = new ArrayList<>();<NEW_LINE>List<List<TSDataType>> typesList = new ArrayList<>();<NEW_LINE>List<List<Object>> valuesList = new ArrayList<>();<NEW_LINE>requestList.forEach(request -> {<NEW_LINE>StringBuilder devicePath = new StringBuilder();<NEW_LINE>devicePath.append(storageGroup).append(IoTDBClient.DOT).append(request.getModelName());<NEW_LINE>// make an index value as a layer name of the storage path<NEW_LINE>if (!request.getIndexes().isEmpty()) {<NEW_LINE>request.getIndexValues().forEach(value -> devicePath.append(IoTDBClient.DOT).append(IoTDBUtils.indexValue2LayerName(value)));<NEW_LINE>}<NEW_LINE>devicePathList.add(devicePath.toString());<NEW_LINE>timeList.<MASK><NEW_LINE>timeseriesListList.add(request.getMeasurements());<NEW_LINE>typesList.add(request.getMeasurementTypes());<NEW_LINE>valuesList.add(request.getMeasurementValues());<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>sessionPool.insertRecords(devicePathList, timeList, timeseriesListList, typesList, valuesList);<NEW_LINE>healthChecker.health();<NEW_LINE>} catch (IoTDBConnectionException | StatementExecutionException e) {<NEW_LINE>healthChecker.unHealth(e);<NEW_LINE>throw new IOException(e);<NEW_LINE>}<NEW_LINE>}
add(request.getTime());
1,519,335
public Pkcs10Csr build() {<NEW_LINE>try {<NEW_LINE>PKCS10CertificationRequestBuilder requestBuilder = new JcaPKCS10CertificationRequestBuilder(new X500Name(subject.getName()), keyPair.getPublic());<NEW_LINE>ExtensionsGenerator extGen = new ExtensionsGenerator();<NEW_LINE>if (basicConstraintsExtension != null) {<NEW_LINE>extGen.addExtension(Extension.basicConstraints, basicConstraintsExtension.isCritical, new BasicConstraints(basicConstraintsExtension.isCertAuthorityCertificate));<NEW_LINE>}<NEW_LINE>if (!subjectAlternativeNames.isEmpty()) {<NEW_LINE>GeneralNames generalNames = new GeneralNames(subjectAlternativeNames.stream().map(SubjectAlternativeName::toGeneralName).toArray(GeneralName[]::new));<NEW_LINE>extGen.addExtension(Extension.subjectAlternativeName, false, generalNames);<NEW_LINE>}<NEW_LINE>requestBuilder.addAttribute(PKCSObjectIdentifiers.pkcs_9_at_extensionRequest, extGen.generate());<NEW_LINE>ContentSigner contentSigner = new JcaContentSignerBuilder(signatureAlgorithm.getAlgorithmName()).setProvider(BouncyCastleProviderHolder.getInstance()).build(keyPair.getPrivate());<NEW_LINE>return new Pkcs10Csr<MASK><NEW_LINE>} catch (OperatorCreationException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UncheckedIOException(e);<NEW_LINE>}<NEW_LINE>}
(requestBuilder.build(contentSigner));
397,923
protected void notifyComplete(MqttToken token) throws MqttException {<NEW_LINE>final String methodName = "notifyComplete";<NEW_LINE>MqttWireMessage message = token.internalTok.getWireMessage();<NEW_LINE>if (message != null && message instanceof MqttAck) {<NEW_LINE>// @TRACE 629=received key={0} token={1} message={2}<NEW_LINE>log.fine(CLASS_NAME, methodName, "629", new Object[] { Integer.valueOf(message.getMessageId()), token, message });<NEW_LINE>MqttAck ack = (MqttAck) message;<NEW_LINE>if (ack instanceof MqttPubAck) {<NEW_LINE>// QoS 1 - user notified now remove from persistence...<NEW_LINE>persistence.remove(getSendPersistenceKey(message));<NEW_LINE>persistence.remove(getSendBufferedPersistenceKey(message));<NEW_LINE>outboundQoS1.remove(Integer.valueOf(ack.getMessageId()));<NEW_LINE>decrementInFlight();<NEW_LINE>releaseMessageId(message.getMessageId());<NEW_LINE>tokenStore.removeToken(message);<NEW_LINE>// @TRACE 650=removed Qos 1 publish. key={0}<NEW_LINE>log.fine(CLASS_NAME, methodName, "650", new Object[] { Integer.valueOf(ack.getMessageId()) });<NEW_LINE>} else if (ack instanceof MqttPubComp) {<NEW_LINE>// QoS 2 - user notified now remove from persistence...<NEW_LINE>persistence.remove(getSendPersistenceKey(message));<NEW_LINE>persistence.remove(getSendConfirmPersistenceKey(message));<NEW_LINE>persistence.remove(getSendBufferedPersistenceKey(message));<NEW_LINE>outboundQoS2.remove(Integer.valueOf(ack.getMessageId()));<NEW_LINE>inFlightPubRels--;<NEW_LINE>decrementInFlight();<NEW_LINE>releaseMessageId(message.getMessageId());<NEW_LINE>tokenStore.removeToken(message);<NEW_LINE>// @TRACE 645=removed QoS 2 publish/pubrel. key={0}, -1 inFlightPubRels={1}<NEW_LINE>log.fine(CLASS_NAME, methodName, "645", new Object[] { Integer.valueOf(ack.getMessageId()), <MASK><NEW_LINE>}<NEW_LINE>checkQuiesceLock();<NEW_LINE>}<NEW_LINE>}
Integer.valueOf(inFlightPubRels) });
1,398,255
private void parseHeader() {<NEW_LINE>headerScratchBits.setPosition(0);<NEW_LINE>SyncFrameInfo frameInfo = Ac4Util.parseAc4SyncframeInfo(headerScratchBits);<NEW_LINE>if (format == null || frameInfo.channelCount != format.channelCount || frameInfo.sampleRate != format.sampleRate || !MimeTypes.AUDIO_AC4.equals(format.sampleMimeType)) {<NEW_LINE>format = new Format.Builder().setId(formatId).setSampleMimeType(MimeTypes.AUDIO_AC4).setChannelCount(frameInfo.channelCount).setSampleRate(frameInfo.sampleRate).setLanguage(language).build();<NEW_LINE>output.format(format);<NEW_LINE>}<NEW_LINE>sampleSize = frameInfo.frameSize;<NEW_LINE>// In this class a sample is an AC-4 sync frame, but Format#sampleRate specifies the number of<NEW_LINE>// PCM audio samples per second.<NEW_LINE>sampleDurationUs = C.MICROS_PER_SECOND <MASK><NEW_LINE>}
* frameInfo.sampleCount / format.sampleRate;
772,826
// builds directives from a type and its extensions<NEW_LINE>@NotNull<NEW_LINE>GraphQLDirective buildDirective(BuildContext buildCtx, Directive directive, Set<GraphQLDirective> directiveDefinitions, DirectiveLocation directiveLocation, GraphqlTypeComparatorRegistry comparatorRegistry) {<NEW_LINE>GraphQLDirective.Builder builder = GraphQLDirective.newDirective().name(directive.getName()).description(buildDescription(directive, null)).comparatorRegistry(comparatorRegistry).validLocations(directiveLocation);<NEW_LINE>Optional<GraphQLDirective> directiveDefOpt = FpKit.findOne(directiveDefinitions, dd -> dd.getName().equals(directive.getName()));<NEW_LINE>GraphQLDirective graphQLDirective = directiveDefOpt.orElseGet(() -> {<NEW_LINE>Function<Type, Optional<GraphQLInputType>> inputTypeFactory = <MASK><NEW_LINE>Optional<DirectiveDefinition> directiveDefinition = buildCtx.getTypeRegistry().getDirectiveDefinition(directive.getName());<NEW_LINE>return directiveDefinition.map(definition -> buildDirectiveFromDefinition(buildCtx, definition, inputTypeFactory)).orElse(null);<NEW_LINE>});<NEW_LINE>if (graphQLDirective != null) {<NEW_LINE>builder.repeatable(graphQLDirective.isRepeatable());<NEW_LINE>List<GraphQLArgument> arguments = mapNotNull(directive.getArguments(), arg -> buildDirectiveArgument(buildCtx, arg, graphQLDirective).orElse(null));<NEW_LINE>arguments = transferMissingArguments(arguments, graphQLDirective);<NEW_LINE>arguments.forEach(builder::argument);<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
inputType -> buildInputType(buildCtx, inputType);
1,741,818
public ProjectArchive load(Path projectDirectory, WorkflowResourceMatcher matcher, Config overrideParams) throws IOException {<NEW_LINE>// toAbsolutePath is necessary because Paths.get("singleName").getParent() returns null instead of Paths.get("")<NEW_LINE>Path projectPath = projectDirectory.normalize().toAbsolutePath();<NEW_LINE>// find workflow names<NEW_LINE>ModelValidator validator = ModelValidator.builder();<NEW_LINE>ImmutableList.Builder<RuntimeException> errors = ImmutableList.builder();<NEW_LINE>ImmutableList.Builder<WorkflowDefinition<MASK><NEW_LINE>listFiles(projectPath, (resourceName, path) -> {<NEW_LINE>if (matcher.matches(resourceName, path)) {<NEW_LINE>try {<NEW_LINE>WorkflowFile workflowFile = loadWorkflowFile(resourceName, path, overrideParams);<NEW_LINE>defs.add(workflowFile.toWorkflowDefinition());<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>validator.error("workflow " + path, null, ex.getMessage());<NEW_LINE>errors.add(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>validator.validate("project", projectDirectory);<NEW_LINE>} catch (ModelValidationException ex) {<NEW_LINE>for (Throwable error : errors.build()) {<NEW_LINE>ex.addSuppressed(error);<NEW_LINE>}<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>ArchiveMetadata metadata = ArchiveMetadata.of(WorkflowDefinitionList.of(defs.build()), overrideParams);<NEW_LINE>return new ProjectArchive(projectPath, metadata);<NEW_LINE>}
> defs = ImmutableList.builder();
1,259,276
static ParallelInstruction forParallelInstruction(ParallelInstruction input, boolean replaceWithByteArrayCoder) throws Exception {<NEW_LINE>try {<NEW_LINE>ParallelInstruction instruction = clone(input, ParallelInstruction.class);<NEW_LINE>if (instruction.getRead() != null) {<NEW_LINE>Source cloudSource = instruction<MASK><NEW_LINE>cloudSource.setCodec(forCodec(cloudSource.getCodec(), replaceWithByteArrayCoder));<NEW_LINE>} else if (instruction.getWrite() != null) {<NEW_LINE>com.google.api.services.dataflow.model.Sink cloudSink = instruction.getWrite().getSink();<NEW_LINE>cloudSink.setCodec(forCodec(cloudSink.getCodec(), replaceWithByteArrayCoder));<NEW_LINE>} else if (instruction.getParDo() != null) {<NEW_LINE>instruction.setParDo(forParDoInstruction(instruction.getParDo(), replaceWithByteArrayCoder));<NEW_LINE>} else if (instruction.getPartialGroupByKey() != null) {<NEW_LINE>PartialGroupByKeyInstruction pgbk = instruction.getPartialGroupByKey();<NEW_LINE>pgbk.setInputElementCodec(forCodec(pgbk.getInputElementCodec(), replaceWithByteArrayCoder));<NEW_LINE>} else if (instruction.getFlatten() != null) {<NEW_LINE>// FlattenInstructions have no codecs to wrap.<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("Unknown parallel instruction: " + input);<NEW_LINE>}<NEW_LINE>return instruction;<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(String.format("Failed to replace unknown coder with " + "LengthPrefixCoder for : {%s}", input), e);<NEW_LINE>}<NEW_LINE>}
.getRead().getSource();
533,011
private void checkRequests() {<NEW_LINE>// to be honest I don't see why this can't be 5 seconds, but I'm trying 1 second<NEW_LINE>// now as the existing 0.1 second is crazy given we're checking for events that<NEW_LINE>// occur<NEW_LINE>// at 60+ second intervals<NEW_LINE>if (mainloop_loop_count % MAINLOOP_ONE_SECOND_INTERVAL != 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>hash_handler.update();<NEW_LINE>final long now = SystemTime.getCurrentTime();<NEW_LINE>// for every connection<NEW_LINE>final List<PEPeerTransport> peer_transports = peer_transports_cow;<NEW_LINE>for (int i = peer_transports.size() - 1; i >= 0; i--) {<NEW_LINE>final PEPeerTransport pc = peer_transports.get(i);<NEW_LINE>if (pc.getPeerState() == PEPeer.TRANSFERING) {<NEW_LINE>final List expired = pc.getExpiredRequests();<NEW_LINE>if (expired != null && expired.size() > 0) {<NEW_LINE>// now we know there's a request that's > 60 seconds old<NEW_LINE>final boolean isSeed = pc.isSeed();<NEW_LINE>checkSnubbing(pc);<NEW_LINE>// Only cancel first request if more than 2 mins have passed<NEW_LINE>DiskManagerReadRequest request = (DiskManagerReadRequest) expired.get(0);<NEW_LINE>long timeSinceData = pc.getTimeSinceLastDataMessageReceived();<NEW_LINE>long dataTimeout = isSeed ? REQ_TIMEOUT_DATA_AGE_SEED_MILLIS : REQ_TIMEOUT_DATA_AGE_LEECH_MILLIS;<NEW_LINE>long requestTimeout = REQ_TIMEOUT_OLDEST_REQ_AGE_MILLIS;<NEW_LINE>if (pc.getNetwork() != AENetworkClassifier.AT_PUBLIC) {<NEW_LINE>dataTimeout *= 2;<NEW_LINE>requestTimeout *= 2;<NEW_LINE>}<NEW_LINE>boolean noData = timeSinceData < 0 || timeSinceData > dataTimeout;<NEW_LINE>long timeSinceOldestRequest = <MASK><NEW_LINE>// for every expired request<NEW_LINE>for (int j = (timeSinceOldestRequest > requestTimeout && noData) ? 0 : 1; j < expired.size(); j++) {<NEW_LINE>// get the request object<NEW_LINE>request = (DiskManagerReadRequest) expired.get(j);<NEW_LINE>// Only cancel first request if more than 2 mins have passed<NEW_LINE>// cancel the request object<NEW_LINE>pc.sendCancel(request);<NEW_LINE>// get the piece number<NEW_LINE>final int pieceNumber = request.getPieceNumber();<NEW_LINE>PEPiece pe_piece = pePieces[pieceNumber];<NEW_LINE>// unmark the request on the block<NEW_LINE>if (pe_piece != null)<NEW_LINE>pe_piece.clearRequested(request.getOffset() / DiskManager.BLOCK_SIZE);<NEW_LINE>// remove piece if empty so peers can choose something else, except in end game<NEW_LINE>if (!piecePicker.isInEndGameMode())<NEW_LINE>checkEmptyPiece(pieceNumber);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
now - request.getTimeCreated(now);
99,553
public void updateFileMenuButtons(int view) {<NEW_LINE>if (isReadOnly) {<NEW_LINE>// This may be too simple<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (view == 0) {<NEW_LINE>// We are in the Projects view<NEW_LINE>fileDropDown.setItemEnabled(MESSAGES.deleteProjectButton(), false);<NEW_LINE>fileDropDown.setItemEnabled(MESSAGES.deleteFromTrashButton(), false);<NEW_LINE>fileDropDown.setItemEnabled(MESSAGES.trashProjectMenuItem(), ProjectListBox.getProjectListBox().getProjectList().getMyProjectsCount() == 0);<NEW_LINE>fileDropDown.setItemEnabled(MESSAGES.exportAllProjectsMenuItem(), ProjectListBox.getProjectListBox().getProjectList().getMyProjectsCount() > 0);<NEW_LINE>fileDropDown.setItemEnabledById(WIDGET_NAME_EXPORTPROJECT, false);<NEW_LINE>fileDropDown.setItemEnabled(MESSAGES.saveMenuItem(), false);<NEW_LINE>fileDropDown.setItemEnabled(MESSAGES.saveAsMenuItem(), false);<NEW_LINE>fileDropDown.setItemEnabled(MESSAGES.checkpointMenuItem(), false);<NEW_LINE>buildDropDown.setItemEnabled(MESSAGES.showExportAndroidApk(), false);<NEW_LINE>buildDropDown.setItemEnabled(MESSAGES.showExportAndroidAab(), false);<NEW_LINE>if (Ode.getInstance().hasSecondBuildserver()) {<NEW_LINE>buildDropDown.setItemEnabled(MESSAGES.showExportAndroidApk2(), false);<NEW_LINE>buildDropDown.setItemEnabled(MESSAGES.showExportAndroidAab2(), false);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// We have to be in the Designer/Blocks view<NEW_LINE>fileDropDown.setItemEnabled(MESSAGES.deleteProjectButton(), true);<NEW_LINE>fileDropDown.setItemEnabled(MESSAGES.trashProjectMenuItem(), true);<NEW_LINE>fileDropDown.setItemEnabled(MESSAGES.exportAllProjectsMenuItem(), ProjectListBox.getProjectListBox().getProjectList().getMyProjectsCount() > 0);<NEW_LINE>fileDropDown.setItemEnabledById(WIDGET_NAME_EXPORTPROJECT, true);<NEW_LINE>fileDropDown.setItemEnabled(MESSAGES.saveMenuItem(), true);<NEW_LINE>fileDropDown.setItemEnabled(MESSAGES.saveAsMenuItem(), true);<NEW_LINE>fileDropDown.setItemEnabled(MESSAGES.checkpointMenuItem(), true);<NEW_LINE>buildDropDown.setItemEnabled(MESSAGES.showExportAndroidApk(), true);<NEW_LINE>buildDropDown.setItemEnabled(MESSAGES.showExportAndroidAab(), true);<NEW_LINE>if (Ode.getInstance().hasSecondBuildserver()) {<NEW_LINE>buildDropDown.setItemEnabled(<MASK><NEW_LINE>buildDropDown.setItemEnabled(MESSAGES.showExportAndroidAab2(), true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>updateKeystoreFileMenuButtons(true);<NEW_LINE>}
MESSAGES.showExportAndroidApk2(), true);
1,021,397
public void run() {<NEW_LINE><MASK><NEW_LINE>Package msg = new Package();<NEW_LINE>try {<NEW_LINE>if (pkg.getHeader().getCmd() == Command.SERVER_GOODBYE_RESPONSE) {<NEW_LINE>logger.info("client|address={}| has reject ", session.getContext().channel().remoteAddress());<NEW_LINE>} else {<NEW_LINE>msg.setHeader(new Header(CLIENT_GOODBYE_RESPONSE, OPStatus.SUCCESS.getCode(), OPStatus.SUCCESS.getDesc(), pkg.getHeader().getSeq()));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("GoodbyeTask failed|user={}|errMsg={}", session.getClient(), e);<NEW_LINE>msg.setHeader(new Header(CLIENT_GOODBYE_RESPONSE, OPStatus.FAIL.getCode(), e.getStackTrace().toString(), pkg.getHeader().getSeq()));<NEW_LINE>} finally {<NEW_LINE>this.eventMeshTCPServer.getScheduler().submit(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>Utils.writeAndFlush(msg, startTime, taskExecuteTime, session.getContext(), session);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// session.write2Client(msg);<NEW_LINE>}<NEW_LINE>EventMeshTcp2Client.closeSessionIfTimeout(this.eventMeshTCPServer, session, eventMeshTCPServer.getClientSessionGroupMapping());<NEW_LINE>}
long taskExecuteTime = System.currentTimeMillis();
1,572,045
public void marshall(ListCompilationJobsRequest listCompilationJobsRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (listCompilationJobsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(listCompilationJobsRequest.getNextToken(), NEXTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(listCompilationJobsRequest.getMaxResults(), MAXRESULTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(listCompilationJobsRequest.getCreationTimeAfter(), CREATIONTIMEAFTER_BINDING);<NEW_LINE>protocolMarshaller.marshall(listCompilationJobsRequest.getCreationTimeBefore(), CREATIONTIMEBEFORE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(listCompilationJobsRequest.getLastModifiedTimeBefore(), LASTMODIFIEDTIMEBEFORE_BINDING);<NEW_LINE>protocolMarshaller.marshall(listCompilationJobsRequest.getNameContains(), NAMECONTAINS_BINDING);<NEW_LINE>protocolMarshaller.marshall(listCompilationJobsRequest.getStatusEquals(), STATUSEQUALS_BINDING);<NEW_LINE>protocolMarshaller.marshall(listCompilationJobsRequest.getSortBy(), SORTBY_BINDING);<NEW_LINE>protocolMarshaller.marshall(listCompilationJobsRequest.getSortOrder(), SORTORDER_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
listCompilationJobsRequest.getLastModifiedTimeAfter(), LASTMODIFIEDTIMEAFTER_BINDING);
1,267,788
private static ByteBuffer compressString(String input) throws IOException {<NEW_LINE>// Compress the UTF-8 encoded String into a byte[]<NEW_LINE>ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>GZIPOutputStream os = new GZIPOutputStream(baos);<NEW_LINE>os.write(input.getBytes("UTF-8"));<NEW_LINE>os.finish();<NEW_LINE>byte[] compressedBytes = baos.toByteArray();<NEW_LINE>// The following code writes the compressed bytes to a ByteBuffer.<NEW_LINE>// A simpler way to do this is by simply calling<NEW_LINE>// ByteBuffer.wrap(compressedBytes);<NEW_LINE>// However, the longer form below shows the importance of resetting the<NEW_LINE>// position of the buffer<NEW_LINE>// back to the beginning of the buffer if you are writing bytes directly<NEW_LINE>// to it, since the SDK<NEW_LINE>// will consider only the bytes after the current position when sending<NEW_LINE>// data to DynamoDB.<NEW_LINE>// Using the "wrap" method automatically resets the position to zero.<NEW_LINE>ByteBuffer buffer = <MASK><NEW_LINE>buffer.put(compressedBytes, 0, compressedBytes.length);<NEW_LINE>// Important: reset the position of the ByteBuffer<NEW_LINE>buffer.position(0);<NEW_LINE>// to the beginning<NEW_LINE>return buffer;<NEW_LINE>}
ByteBuffer.allocate(compressedBytes.length);
1,365,619
public void indexFromDocuments(final Consumer<Boolean> success, final Consumer<Throwable> error) {<NEW_LINE>final FessConfig fessConfig = ComponentUtil.getFessConfig();<NEW_LINE>final long interval = fessConfig.getSuggestUpdateRequestIntervalAsInteger().longValue();<NEW_LINE>final int docPerReq = fessConfig.getSuggestUpdateDocPerRequestAsInteger();<NEW_LINE>final SystemHelper systemHelper = ComponentUtil.getSystemHelper();<NEW_LINE>suggester.indexer().indexFromDocument(() -> {<NEW_LINE>final ESSourceReader reader = new // TODO remove type<NEW_LINE>ESSourceReader(// TODO remove type<NEW_LINE>ComponentUtil.getSearchEngineClient(), // TODO remove type<NEW_LINE>suggester.settings(), // TODO remove type<NEW_LINE>fessConfig.getIndexDocumentSearchIndex(), "_doc");<NEW_LINE>reader.<MASK><NEW_LINE>reader.setLimitDocNumPercentage(fessConfig.getSuggestUpdateContentsLimitNumPercentage());<NEW_LINE>reader.setLimitNumber(fessConfig.getSuggestUpdateContentsLimitNumAsInteger());<NEW_LINE>reader.setLimitOfDocumentSize(fessConfig.getSuggestUpdateContentsLimitDocSizeAsInteger());<NEW_LINE>final List<FunctionScoreQueryBuilder.FilterFunctionBuilder> flist = new ArrayList<>();<NEW_LINE>flist.add(new FunctionScoreQueryBuilder.FilterFunctionBuilder(ScoreFunctionBuilders.randomFunction().seed(System.currentTimeMillis()).setField(fessConfig.getIndexFieldDocId())));<NEW_LINE>reader.setQuery(QueryBuilders.functionScoreQuery(QueryBuilders.matchAllQuery(), flist.toArray(new FunctionScoreQueryBuilder.FilterFunctionBuilder[flist.size()])).boostMode(CombineFunction.MULTIPLY));<NEW_LINE>reader.addSort(SortBuilders.fieldSort(fessConfig.getIndexFieldClickCount()));<NEW_LINE>reader.addSort(SortBuilders.scoreSort());<NEW_LINE>return reader;<NEW_LINE>}, docPerReq, () -> {<NEW_LINE>systemHelper.calibrateCpuLoad();<NEW_LINE>ThreadUtil.sleep(interval);<NEW_LINE>}).then(response -> {<NEW_LINE>refresh();<NEW_LINE>success.accept(true);<NEW_LINE>}).error(t -> error.accept(t));<NEW_LINE>}
setScrollSize(fessConfig.getSuggestSourceReaderScrollSizeAsInteger());
956,040
public static QuerySubscribeRelationResponse unmarshall(QuerySubscribeRelationResponse querySubscribeRelationResponse, UnmarshallerContext _ctx) {<NEW_LINE>querySubscribeRelationResponse.setRequestId(_ctx.stringValue("QuerySubscribeRelationResponse.RequestId"));<NEW_LINE>querySubscribeRelationResponse.setSuccess(_ctx.booleanValue("QuerySubscribeRelationResponse.Success"));<NEW_LINE>querySubscribeRelationResponse.setCode(_ctx.stringValue("QuerySubscribeRelationResponse.Code"));<NEW_LINE>querySubscribeRelationResponse.setErrorMessage(_ctx.stringValue("QuerySubscribeRelationResponse.ErrorMessage"));<NEW_LINE>querySubscribeRelationResponse.setProductKey(_ctx.stringValue("QuerySubscribeRelationResponse.ProductKey"));<NEW_LINE>querySubscribeRelationResponse.setType(_ctx.stringValue("QuerySubscribeRelationResponse.Type"));<NEW_LINE>querySubscribeRelationResponse.setDeviceDataFlag(_ctx.booleanValue("QuerySubscribeRelationResponse.DeviceDataFlag"));<NEW_LINE>querySubscribeRelationResponse.setDeviceLifeCycleFlag(_ctx.booleanValue("QuerySubscribeRelationResponse.DeviceLifeCycleFlag"));<NEW_LINE>querySubscribeRelationResponse.setDeviceStatusChangeFlag(_ctx.booleanValue("QuerySubscribeRelationResponse.DeviceStatusChangeFlag"));<NEW_LINE>querySubscribeRelationResponse.setDeviceTopoLifeCycleFlag(_ctx.booleanValue("QuerySubscribeRelationResponse.DeviceTopoLifeCycleFlag"));<NEW_LINE>querySubscribeRelationResponse.setFoundDeviceListFlag(_ctx.booleanValue("QuerySubscribeRelationResponse.FoundDeviceListFlag"));<NEW_LINE>querySubscribeRelationResponse.setOtaEventFlag(_ctx.booleanValue("QuerySubscribeRelationResponse.OtaEventFlag"));<NEW_LINE>querySubscribeRelationResponse.setThingHistoryFlag(_ctx.booleanValue("QuerySubscribeRelationResponse.ThingHistoryFlag"));<NEW_LINE>querySubscribeRelationResponse.setMnsConfiguration(_ctx.stringValue("QuerySubscribeRelationResponse.MnsConfiguration"));<NEW_LINE>querySubscribeRelationResponse.setDeviceTagFlag(_ctx.booleanValue("QuerySubscribeRelationResponse.DeviceTagFlag"));<NEW_LINE>querySubscribeRelationResponse.setOtaVersionFlag(_ctx.booleanValue("QuerySubscribeRelationResponse.OtaVersionFlag"));<NEW_LINE>querySubscribeRelationResponse.setOtaJobFlag<MASK><NEW_LINE>List<String> consumerGroupIds = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QuerySubscribeRelationResponse.ConsumerGroupIds.Length"); i++) {<NEW_LINE>consumerGroupIds.add(_ctx.stringValue("QuerySubscribeRelationResponse.ConsumerGroupIds[" + i + "]"));<NEW_LINE>}<NEW_LINE>querySubscribeRelationResponse.setConsumerGroupIds(consumerGroupIds);<NEW_LINE>return querySubscribeRelationResponse;<NEW_LINE>}
(_ctx.booleanValue("QuerySubscribeRelationResponse.OtaJobFlag"));
1,438,331
public AnalyticsModelingOMASAPIResponse createArtifact(String serverName, String userId, String serverCapability, String serverCapabilityGUID, AnalyticsAsset artifact) {<NEW_LINE>String methodName = "createArtifact";<NEW_LINE>AnalyticsModelingOMASAPIResponse ret;<NEW_LINE>RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);<NEW_LINE>try {<NEW_LINE>validateUrlParameters(serverName, userId, null, null, null, null, methodName);<NEW_LINE>AssetsResponse response = new AssetsResponse();<NEW_LINE>AnalyticsArtifactHandler handler = getHandler().getAnalyticsArtifactHandler(serverName, userId, methodName);<NEW_LINE>ResponseContainerAssets assets = handler.createAssets(userId, serverCapability, serverCapabilityGUID, artifact);<NEW_LINE>response.setAssetList(assets);<NEW_LINE>response.setMeta(handler.getMessages());<NEW_LINE>ret = response;<NEW_LINE>} catch (Exception e) {<NEW_LINE>ret = handleErrorResponse(e, methodName);<NEW_LINE>}<NEW_LINE>restCallLogger.logRESTCallReturn(<MASK><NEW_LINE>return ret;<NEW_LINE>}
token, ret.toString());
1,783,747
public void onSingleClick(View v) {<NEW_LINE>currentlyEditingId = "";<NEW_LINE>backedText = "";<NEW_LINE>doShowMenu(baseView);<NEW_LINE>if (SettingValues.fastscroll) {<NEW_LINE>mPage.fastScroll.setVisibility(View.VISIBLE);<NEW_LINE>if (mPage.fab != null)<NEW_LINE>mPage.<MASK><NEW_LINE>mPage.overrideFab = false;<NEW_LINE>}<NEW_LINE>dataSet.refreshLayout.setRefreshing(true);<NEW_LINE>if (currentlyEditing != null) {<NEW_LINE>String text = currentlyEditing.getText().toString();<NEW_LINE>new ReplyTaskComment(n, baseNode, holder, changedProfile).execute(text);<NEW_LINE>currentlyEditing = null;<NEW_LINE>editingPosition = -1;<NEW_LINE>}<NEW_LINE>// Hide soft keyboard<NEW_LINE>View view = ((Activity) mContext).findViewById(android.R.id.content);<NEW_LINE>if (view != null) {<NEW_LINE>KeyboardUtil.hideKeyboard(mContext, view.getWindowToken(), 0);<NEW_LINE>}<NEW_LINE>}
fab.setVisibility(View.VISIBLE);
338,447
public static <T extends PreTrainedTokenizer> T fromPretrained(Class<T> cls, Kwargs kwargs) {<NEW_LINE>String pretrained_model_name_or_path = kwargs.removeWithType("pretrained_model_name_or_path");<NEW_LINE>File tokenizerConfigFileFile = Paths.get(pretrained_model_name_or_path, TOKENIZER_CONFIG_FILE).toFile();<NEW_LINE>String content = TokenizerUtils.readFileToString(tokenizerConfigFileFile);<NEW_LINE>Kwargs initKwargs = JsonConverter.<MASK><NEW_LINE>initKwargs.putAll(kwargs);<NEW_LINE>// TODO: cls.max_model_input_sizes<NEW_LINE>initKwargs.put("vocab_file", Paths.get(pretrained_model_name_or_path, "vocab.txt").toAbsolutePath().toString(), "special_tokens_map_file", Paths.get(pretrained_model_name_or_path, "special_tokens_map.json").toAbsolutePath().toString(), "name_or_path", pretrained_model_name_or_path);<NEW_LINE>T tokenizer;<NEW_LINE>try {<NEW_LINE>Constructor<T> constructor = cls.getConstructor(Kwargs.class);<NEW_LINE>tokenizer = constructor.newInstance(initKwargs);<NEW_LINE>} catch (InvocationTargetException | NoSuchMethodException | InstantiationException | IllegalAccessException e) {<NEW_LINE>throw new RuntimeException(String.format("Cannot initialize class %s", cls.getCanonicalName()));<NEW_LINE>}<NEW_LINE>File specialTokensMapFile = Paths.get(pretrained_model_name_or_path, SPECIAL_TOKENS_MAP_FILE).toFile();<NEW_LINE>if (specialTokensMapFile.exists()) {<NEW_LINE>content = TokenizerUtils.readFileToString(specialTokensMapFile);<NEW_LINE>Map<String, String> specialTokensMap = JsonConverter.fromJson(content, new TypeToken<Map<String, String>>() {<NEW_LINE>}.getType());<NEW_LINE>specialTokensMap.forEach((k, v) -> {<NEW_LINE>tokenizer.specialTokenValues.put(SPECIAL_TOKENS.valueOf(k.toUpperCase()), v);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>// TODO: added_tokens_file is not None<NEW_LINE>// TODO: sanitize_special_tokens<NEW_LINE>return tokenizer;<NEW_LINE>}
fromJson(content, Kwargs.class);
140,483
void onFocusOutMinAmountTextField(boolean oldValue, boolean newValue) {<NEW_LINE>if (oldValue && !newValue) {<NEW_LINE>InputValidator.ValidationResult result = isBtcInputValid(minAmount.get());<NEW_LINE>minAmountValidationResult.set(result);<NEW_LINE>if (result.isValid) {<NEW_LINE>Coin minAmountAsCoin = dataModel.getMinAmount().get();<NEW_LINE>syncMinAmountWithAmount = minAmountAsCoin != null && minAmountAsCoin.equals(dataModel.getBtcAmount().get());<NEW_LINE>setMinAmountToModel();<NEW_LINE>dataModel.calculateMinVolume();<NEW_LINE>if (dataModel.getMinVolume().get() != null) {<NEW_LINE>InputValidator.ValidationResult minVolumeResult = isVolumeInputValid(VolumeUtil.formatVolume(dataModel.getMinVolume().get()));<NEW_LINE>volumeValidationResult.set(minVolumeResult);<NEW_LINE>updateButtonDisableState();<NEW_LINE>}<NEW_LINE>this.minAmount.set(btcFormatter.formatCoin(minAmountAsCoin));<NEW_LINE>if (!dataModel.isMinAmountLessOrEqualAmount()) {<NEW_LINE>this.amount.set(this.minAmount.get());<NEW_LINE>} else {<NEW_LINE>minAmountValidationResult.set(result);<NEW_LINE>if (this.amount.get() != null)<NEW_LINE>amountValidationResult.set(isBtcInputValid(this<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>syncMinAmountWithAmount = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.amount.get()));
548,010
private Collection<IFile> filterFiles(Collection<IFile> files, IProgressMonitor monitor) {<NEW_LINE>SubMonitor sub = SubMonitor.convert(monitor, 100);<NEW_LINE>// First filter out files that don't exist, are derived, or are team-private<NEW_LINE>files = CollectionsUtil.filter(files, new IFilter<IFile>() {<NEW_LINE><NEW_LINE>public boolean include(IFile item) {<NEW_LINE>return !ResourceUtil.shouldIgnore(item);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>sub.worked(10);<NEW_LINE>// Next map IFiles to IFileStores for filter participants' sake<NEW_LINE>Set<IFileStore> fileStores = new HashSet<IFileStore>(CollectionsUtil.map(files, new IMap<IFile, IFileStore>() {<NEW_LINE><NEW_LINE>public IFileStore map(IFile item) {<NEW_LINE>IPath path = item.getLocation();<NEW_LINE>return (path == null) ? null : EFS.getLocalFileSystem().getStore(path);<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>sub.worked(15);<NEW_LINE>if (!CollectionsUtil.isEmpty(fileStores)) {<NEW_LINE>// Now let filters run<NEW_LINE>IndexManager manager = getIndexManager();<NEW_LINE>if (manager != null) {<NEW_LINE>for (IIndexFilterParticipant filterParticipant : manager.getFilterParticipants()) {<NEW_LINE>fileStores = filterParticipant.applyFilter(fileStores);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sub.worked(60);<NEW_LINE>// Now we need to map back to IFiles again. UGH!<NEW_LINE>return CollectionsUtil.map(fileStores, new IMap<IFileStore, IFile>() {<NEW_LINE><NEW_LINE>public IFile map(IFileStore fileStore) {<NEW_LINE>IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();<NEW_LINE>IFile[] iFiles = workspaceRoot.<MASK><NEW_LINE>if (ArrayUtil.isEmpty(iFiles)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return iFiles[0];<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return files;<NEW_LINE>}
findFilesForLocationURI(fileStore.toURI());
922,134
final ListNodegroupsResult executeListNodegroups(ListNodegroupsRequest listNodegroupsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listNodegroupsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListNodegroupsRequest> request = null;<NEW_LINE>Response<ListNodegroupsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListNodegroupsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listNodegroupsRequest));<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, "EKS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListNodegroups");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListNodegroupsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new ListNodegroupsResultJsonUnmarshaller());
1,495,833
public void processStream(InputStream input) throws IOException {<NEW_LINE>// Pass null for revision to get all history for the file.<NEW_LINE>PerforceHistoryParser parser = new PerforceHistoryParser(repo);<NEW_LINE>List<HistoryEntry> revisions = parser.getRevisions(file, null).getHistoryEntries();<NEW_LINE>HashMap<String, String> <MASK><NEW_LINE>for (HistoryEntry entry : revisions) {<NEW_LINE>revAuthor.put(entry.getRevision(), entry.getAuthor());<NEW_LINE>}<NEW_LINE>String line;<NEW_LINE>int lineno = 0;<NEW_LINE>try (BufferedReader reader = new BufferedReader(new InputStreamReader(input))) {<NEW_LINE>while ((line = reader.readLine()) != null) {<NEW_LINE>++lineno;<NEW_LINE>if (line.equals("(... files differ ...)")) {<NEW_LINE>// Perforce knows as a binary file?<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Matcher matcher = ANNOTATION_PATTERN.matcher(line);<NEW_LINE>if (matcher.find()) {<NEW_LINE>String revision = matcher.group(1);<NEW_LINE>String author = revAuthor.get(revision);<NEW_LINE>annotation.addLine(revision, author, true);<NEW_LINE>} else {<NEW_LINE>LOGGER.log(Level.SEVERE, "Error: did not find annotation in line {0}: [{1}]", new Object[] { lineno, line });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.log(Level.SEVERE, "Error: Could not read annotations for " + annotation.getFilename(), e);<NEW_LINE>}<NEW_LINE>}
revAuthor = new HashMap<>();
775,619
public static String formatDurationFrom(final Context context, final long startTime, final long endTime, final int timeStringRes, final int unitsToDisplay) {<NEW_LINE>final String space = " ";<NEW_LINE>final String comma = ",";<NEW_LINE>final String separator = comma + space;<NEW_LINE>final DateTime dateTime = new DateTime(endTime);<NEW_LINE>final DateTime localDateTime = dateTime.withZone(DateTimeZone.getDefault());<NEW_LINE>final Period period = new Duration(startTime, endTime).toPeriodTo(localDateTime);<NEW_LINE>final PeriodFormatter periodFormatter = new PeriodFormatterBuilder().appendYears().appendSuffix(space).appendSuffix(context.getString(R.string.time_year), context.getString(R.string.time_years)).appendSeparator(separator).appendMonths().appendSuffix(space).appendSuffix(context.getString(R.string.time_month), context.getString(R.string.time_months)).appendSeparator(separator).appendDays().appendSuffix(space).appendSuffix(context.getString(R.string.time_day), context.getString(R.string.time_days)).appendSeparator(separator).appendHours().appendSuffix(space).appendSuffix(context.getString(R.string.time_hour), context.getString(R.string.time_hours)).appendSeparator(separator).appendMinutes().appendSuffix(space).appendSuffix(context.getString(R.string.time_min), context.getString(R.string.time_mins)).appendSeparator(separator).appendSeconds().appendSuffix(space).appendSuffix(context.getString(R.string.time_sec), context.getString(R.string.time_secs)).appendSeparator(separator).appendMillis().appendSuffix(space).appendSuffix(context.getString(R.string.time_ms)).toFormatter();<NEW_LINE>StringBuilder duration = new StringBuilder(periodFormatter.print(period.normalizedStandard(PeriodType.yearMonthDayTime())));<NEW_LINE>final List<String> parts = Arrays.asList(duration.toString<MASK><NEW_LINE>if (parts.size() >= unitsToDisplay) {<NEW_LINE>duration = new StringBuilder(parts.get(0));<NEW_LINE>for (int i = 1; i < unitsToDisplay; i++) {<NEW_LINE>duration.append(comma).append(parts.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return String.format(context.getString(timeStringRes), duration.toString());<NEW_LINE>}
().split(comma));
1,393,056
public Condition unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Condition condition = new Condition();<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("AttributeValueList", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>condition.setAttributeValueList(new ListUnmarshaller<AttributeValue>(AttributeValueJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ComparisonOperator", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>condition.setComparisonOperator(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return condition;<NEW_LINE>}
class).unmarshall(context));
1,475,813
public void introspect(PrintWriter out) throws Exception {<NEW_LINE>List<InterruptibleThreadObjectStatus> itos = getStatusArray();<NEW_LINE>if (itos.isEmpty() == false) {<NEW_LINE>for (InterruptibleThreadObjectStatus cur : itos) {<NEW_LINE>if (cur != null) {<NEW_LINE>long curThreadId = cur.getThreadId();<NEW_LINE>String requestId = cur.getRequestId();<NEW_LINE>String dispatchTime = cur.getDispatchTimeString();<NEW_LINE>Boolean interrupted = cur.getInterrupted();<NEW_LINE>Boolean givenUp = cur.getGivenUp();<NEW_LINE>out.println(" ");<NEW_LINE>out.println("Information for thread " + curThreadId);<NEW_LINE>out.println(" Request id " + requestId);<NEW_LINE>out.println(" Dispatch time " + dispatchTime);<NEW_LINE>out.println(" Interrupted " + interrupted);<NEW_LINE>out.println(" Given up " + givenUp);<NEW_LINE>out.println(" ODIs ");<NEW_LINE>List<InterruptibleThreadObjectOdiStatus> odis = cur.getOdiStatus();<NEW_LINE>for (InterruptibleThreadObjectOdiStatus curOdi : odis) {<NEW_LINE>String curName = curOdi.getName();<NEW_LINE><MASK><NEW_LINE>String objectDetails = curOdi.getDetails();<NEW_LINE>Boolean queried = curOdi.getQueried();<NEW_LINE>out.println(" " + curName + " position: " + curPos + " queried: " + queried + " details: " + objectDetails);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int curPos = curOdi.getPosition();
1,748,997
private static Pair<PhpClass, Set<String>> invoke(@NotNull Project project, @NotNull YAMLKeyValue serviceKeyValue) {<NEW_LINE>String aClass = YamlHelper.getYamlKeyValueAsString(serviceKeyValue, "class");<NEW_LINE>if (aClass == null || StringUtils.isBlank(aClass)) {<NEW_LINE>PsiElement key = serviceKeyValue.getKey();<NEW_LINE>if (key != null) {<NEW_LINE>String text = key.getText();<NEW_LINE>if (StringUtils.isNotBlank(text) && YamlHelper.isClassServiceId(text)) {<NEW_LINE>aClass = text;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (aClass == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>PhpClass resolvedClassDefinition = ServiceUtil.getResolvedClassDefinition(project, aClass, new ContainerCollectionResolver.LazyServiceCollector(project));<NEW_LINE>if (resolvedClassDefinition == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Set<String> phpClassServiceTags = ServiceUtil.getPhpClassServiceTags(resolvedClassDefinition);<NEW_LINE>Set<String> strings = YamlHelper.collectServiceTags(serviceKeyValue);<NEW_LINE>if (strings.size() > 0) {<NEW_LINE>for (String s : strings) {<NEW_LINE>if (phpClassServiceTags.contains(s)) {<NEW_LINE>phpClassServiceTags.remove(s);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>}
Pair.create(resolvedClassDefinition, phpClassServiceTags);
628,984
protected void onActivityResult(int requestCode, int resultCode, Intent resultData) {<NEW_LINE>Logger.logVerbose(LOG_TAG, "onActivityResult: requestCode: " + requestCode + ", resultCode: " + resultCode + ", data: " + IntentUtils.getIntentString(resultData));<NEW_LINE>super.onActivityResult(requestCode, resultCode, resultData);<NEW_LINE>if (resultCode == RESULT_OK) {<NEW_LINE>Uri data = resultData.getData();<NEW_LINE>try {<NEW_LINE>try (InputStream in = getContentResolver().openInputStream(data)) {<NEW_LINE>try (OutputStream out = new FileOutputStream(outputFile)) {<NEW_LINE>byte[] buffer = new byte[8192];<NEW_LINE>while (true) {<NEW_LINE>int read = in.read(buffer);<NEW_LINE>if (read <= 0) {<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>out.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>Logger.logStackTraceWithMessage(LOG_TAG, "Error copying " + data + " to " + outputFile, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>finish();<NEW_LINE>}
write(buffer, 0, read);
690,059
private Pair<@NotNull Expression, Concrete.@NotNull Expression> visitLetClause(@NotNull HaveClause coreLetClause, @NotNull Concrete.LetClause exprLetClause) {<NEW_LINE>var accepted = exprLetClause.getTerm().accept(this, coreLetClause.getExpression());<NEW_LINE>if (accepted != null)<NEW_LINE>return accepted;<NEW_LINE>Concrete.Expression resultType = exprLetClause.getResultType();<NEW_LINE>if (resultType == null)<NEW_LINE>return nullWithError(new SubExprError(SubExprError.Kind.ConcreteHasNoTypeBinding, coreLetClause.getTypeExpr()));<NEW_LINE>Expression coreResultType = coreLetClause.getTypeExpr();<NEW_LINE>if (coreResultType instanceof PiExpression) {<NEW_LINE>return visitPiImpl(exprLetClause.getParameters()<MASK><NEW_LINE>} else<NEW_LINE>return resultType.accept(this, coreResultType);<NEW_LINE>}
, resultType, (PiExpression) coreResultType);
705,959
public void run() {<NEW_LINE>final Set<File> result = new HashSet<File>();<NEW_LINE>// Search in the source groups of the projects.<NEW_LINE>for (SourceGroup group : ProjectUtils.getSources(project).getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA)) {<NEW_LINE>for (FileObject fo : NbCollections.iterable(group.getRootFolder().getChildren(true))) {<NEW_LINE>if (Thread.currentThread().isInterrupted()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!SpringConstants.CONFIG_MIME_TYPE.equals(fo.getMIMEType())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>File <MASK><NEW_LINE>if (file == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>result.add(file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Search any providers of Spring config files registered in the project lookup.<NEW_LINE>for (SpringConfigFileProvider provider : project.getLookup().lookupAll(SpringConfigFileProvider.class)) {<NEW_LINE>if (Thread.currentThread().isInterrupted()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>result.addAll(provider.getConfigFiles());<NEW_LINE>}<NEW_LINE>final List<File> sorted = new ArrayList<File>(result.size());<NEW_LINE>sorted.addAll(result);<NEW_LINE>Collections.sort(sorted);<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>updateAvailableFiles(sorted);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
file = FileUtil.toFile(fo);
12,850
private static Geometry smooth(final Geometry geom, final double fit, final GeometryFactory factory, GeometrySmoother smoother) {<NEW_LINE>switch(geom.getGeometryType().toUpperCase()) {<NEW_LINE>case "POINT":<NEW_LINE>case "MULTIPOINT":<NEW_LINE>// For points, just return the input geometry<NEW_LINE>return geom;<NEW_LINE>case "LINESTRING":<NEW_LINE>// This handles open and closed lines (LinearRings)<NEW_LINE>return smoothLineString(factory, smoother, geom, fit);<NEW_LINE>case "MULTILINESTRING":<NEW_LINE>return smoothMultiLineString(factory, smoother, geom, fit);<NEW_LINE>case "POLYGON":<NEW_LINE>return smoother.smooth((Polygon) geom, fit);<NEW_LINE>case "MULTIPOLYGON":<NEW_LINE>return smoothMultiPolygon(factory, smoother, geom, fit);<NEW_LINE>case "GEOMETRYCOLLECTION":<NEW_LINE>return smoothGeometryCollection(<MASK><NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("No smoothing method available for " + geom.getGeometryType());<NEW_LINE>}<NEW_LINE>}
factory, smoother, geom, fit);
1,252,844
private static HandshakeData createDefaultSsl() {<NEW_LINE>try {<NEW_LINE>final KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");<NEW_LINE>keyPairGenerator.initialize(2048);<NEW_LINE>final KeyPair keyPair = keyPairGenerator.generateKeyPair();<NEW_LINE>// Generate self signed certificate<NEW_LINE>final X509Certificate[] chain = new X509Certificate[1];<NEW_LINE>// Select provider<NEW_LINE>Security.addProvider(new BouncyCastleProvider());<NEW_LINE>// Generate cert details<NEW_LINE>final long now = System.currentTimeMillis();<NEW_LINE>final Date startDate = new Date(System.currentTimeMillis());<NEW_LINE>final X500Name dnName = new X500Name("C=US; ST=CO; L=Denver; " + "O=Apache Traffic Control; OU=Apache Foundation; OU=Hosted by Traffic Control; " + "OU=CDNDefault; CN=" + DEFAULT_SSL_KEY);<NEW_LINE>final BigInteger certSerialNumber = new BigInteger(Long.toString(now));<NEW_LINE>final Calendar calendar = Calendar.getInstance();<NEW_LINE>calendar.setTime(startDate);<NEW_LINE>calendar.add(Calendar.YEAR, 3);<NEW_LINE>final Date endDate = calendar.getTime();<NEW_LINE>// Build certificate<NEW_LINE>final ContentSigner contentSigner = new JcaContentSignerBuilder("SHA1WithRSA").build(keyPair.getPrivate());<NEW_LINE>final JcaX509v3CertificateBuilder certBuilder = new JcaX509v3CertificateBuilder(dnName, certSerialNumber, startDate, endDate, dnName, keyPair.getPublic());<NEW_LINE>// Attach extensions<NEW_LINE>certBuilder.addExtension(Extension.basicConstraints, true, new BasicConstraints(true));<NEW_LINE>certBuilder.addExtension(Extension.keyUsage, true, new KeyUsage(KeyUsage.digitalSignature | KeyUsage.keyEncipherment | KeyUsage.keyCertSign));<NEW_LINE>certBuilder.addExtension(Extension.extendedKeyUsage, true, new ExtendedKeyUsage(new KeyPurposeId[] { KeyPurposeId.id_kp_clientAuth, KeyPurposeId.id_kp_serverAuth }));<NEW_LINE>// Generate final certificate<NEW_LINE>final X509CertificateHolder certHolder = certBuilder.build(contentSigner);<NEW_LINE><MASK><NEW_LINE>converter.setProvider(new BouncyCastleProvider());<NEW_LINE>chain[0] = converter.getCertificate(certHolder);<NEW_LINE>return new HandshakeData(DEFAULT_SSL_KEY, DEFAULT_SSL_KEY, chain, keyPair.getPrivate());<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Could not generate the default certificate: " + e.getMessage(), e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
final JcaX509CertificateConverter converter = new JcaX509CertificateConverter();
1,364,781
public void testRxObservableInvoker_post3WithGenericType(Map<String, String> param, StringBuilder ret) {<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE>final String threadName = "jaxrs21Thread";<NEW_LINE>ThreadFactory jaxrs21ThreadFactory = Executors.defaultThreadFactory();<NEW_LINE>Thread jaxrs21Thread = jaxrs21ThreadFactory.newThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>String runThreadName = Thread.currentThread().getName();<NEW_LINE>if (!(runThreadName.equals(threadName))) {<NEW_LINE>throw new RuntimeException("testRxObservableInvoker_post3WithGenericType: incorrect thread name");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>jaxrs21Thread.setName(threadName);<NEW_LINE>ExecutorService executorService = Executors.newSingleThreadExecutor(jaxrs21ThreadFactory);<NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder().executorService(executorService);<NEW_LINE>Client c = cb.build();<NEW_LINE>c.register(RxObservableInvokerProvider.class);<NEW_LINE>WebTarget t = c.target("http://" + serverIP + ":" + serverPort + "/jaxrs21bookstore/JAXRS21bookstore2/rxpost3");<NEW_LINE>Builder builder = t.request();<NEW_LINE>builder.accept("application/xml");<NEW_LINE>GenericType<List<JAXRS21Book>> genericResponseType = new GenericType<List<JAXRS21Book>>() {<NEW_LINE>};<NEW_LINE>JAXRS21Book book <MASK><NEW_LINE>rx.Observable<List<JAXRS21Book>> observable = builder.rx(RxObservableInvoker.class).post(Entity.xml(book), genericResponseType);<NEW_LINE>final Holder<List<JAXRS21Book>> holder = new Holder<List<JAXRS21Book>>();<NEW_LINE>final CountDownLatch countDownLatch = new CountDownLatch(1);<NEW_LINE>observable.subscribe(v -> {<NEW_LINE>// OnNext<NEW_LINE>holder.value = v;<NEW_LINE>countDownLatch.countDown();<NEW_LINE>}, throwable -> {<NEW_LINE>// OnError<NEW_LINE>throw new RuntimeException("testRxObservableInvoker_post3WithGenericType: onError " + throwable.getStackTrace());<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>if (!(countDownLatch.await(basicTimeout, TimeUnit.SECONDS))) {<NEW_LINE>throw new RuntimeException("testRxObservableInvoker_post3WithGenericType: Response took too long. Waited " + basicTimeout);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>List<JAXRS21Book> response = holder.value;<NEW_LINE>ret.append(response.get(response.size() - 1).getName());<NEW_LINE>c.close();<NEW_LINE>}
= new JAXRS21Book("Test book3", 102);
420,805
public static void handleLogsFilter(LogsFilterCapsule logsFilterCapsule) {<NEW_LINE>Iterator<Entry<String, LogFilterAndResult>> it;<NEW_LINE>if (logsFilterCapsule.isSolidified()) {<NEW_LINE>it = getEventFilter2ResultSolidity().entrySet().iterator();<NEW_LINE>} else {<NEW_LINE>it = getEventFilter2ResultFull().entrySet().iterator();<NEW_LINE>}<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Entry<String, LogFilterAndResult<MASK><NEW_LINE>if (entry.getValue().isExpire()) {<NEW_LINE>it.remove();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>LogFilterAndResult logFilterAndResult = entry.getValue();<NEW_LINE>long fromBlock = logFilterAndResult.getLogFilterWrapper().getFromBlock();<NEW_LINE>long toBlock = logFilterAndResult.getLogFilterWrapper().getToBlock();<NEW_LINE>if (!(fromBlock <= logsFilterCapsule.getBlockNumber() && logsFilterCapsule.getBlockNumber() <= toBlock)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (logsFilterCapsule.getBloom() != null && !logFilterAndResult.getLogFilterWrapper().getLogFilter().matchBloom(logsFilterCapsule.getBloom())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>LogFilter logFilter = logFilterAndResult.getLogFilterWrapper().getLogFilter();<NEW_LINE>List<LogFilterElement> elements = LogMatch.matchBlock(logFilter, logsFilterCapsule.getBlockNumber(), logsFilterCapsule.getBlockHash(), logsFilterCapsule.getTxInfoList(), logsFilterCapsule.isRemoved());<NEW_LINE>if (CollectionUtils.isNotEmpty(elements)) {<NEW_LINE>logFilterAndResult.getResult().addAll(elements);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
> entry = it.next();
1,204,414
public Map<String, LineChart> buildGraphByDomain(Date start, Date end, String domain) {<NEW_LINE>BusinessReportConfig config = m_configManager.queryConfigByDomain(domain);<NEW_LINE>HashMap<String, LineChart> result = new LinkedHashMap<String, LineChart>();<NEW_LINE>if (config != null) {<NEW_LINE>Map<String, double[]> datas = prepareBusinessItemDatas(start, end, domain, config);<NEW_LINE>Map<String, double[]> baseLines = prepareBusinessItemBaseLines(start, end, datas.keySet());<NEW_LINE>Map<String, CustomConfig> customConfigs = config.getCustomConfigs();<NEW_LINE>Map<String, double[]> customBaseLines = prepareCustomBaseLines(start, end, domain, customConfigs);<NEW_LINE>Map<String, double[]> customDatas = prepareCustomDatas(start, end, domain, customConfigs, datas);<NEW_LINE>Map<String, BusinessReportConfig> configs = new HashMap<String, BusinessReportConfig>();<NEW_LINE>configs.put(domain, config);<NEW_LINE>result.putAll(buildCharts(datas, baseLines<MASK><NEW_LINE>result.putAll(buildCharts(customDatas, customBaseLines, start, end, configs));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
, start, end, configs));
425,060
static OpcUaServerConfigBuilder copy(OpcUaServerConfig config) {<NEW_LINE>OpcUaServerConfigBuilder builder = new OpcUaServerConfigBuilder();<NEW_LINE>// UaStackServerConfig values<NEW_LINE>builder.setEndpoints(config.getEndpoints());<NEW_LINE>builder.setApplicationName(config.getApplicationName());<NEW_LINE>builder.<MASK><NEW_LINE>builder.setProductUri(config.getProductUri());<NEW_LINE>builder.setEncodingLimits(config.getEncodingLimits());<NEW_LINE>builder.setMinimumSecureChannelLifetime(config.getMinimumSecureChannelLifetime());<NEW_LINE>builder.setMaximumSecureChannelLifetime(config.getMaximumSecureChannelLifetime());<NEW_LINE>builder.setCertificateManager(config.getCertificateManager());<NEW_LINE>builder.setTrustListManager(config.getTrustListManager());<NEW_LINE>builder.setCertificateValidator(config.getCertificateValidator());<NEW_LINE>builder.setHttpsKeyPair(config.getHttpsKeyPair().orElse(null));<NEW_LINE>builder.setHttpsCertificateChain(config.getHttpsCertificateChain().orElse(null));<NEW_LINE>builder.setExecutor(config.getExecutor());<NEW_LINE>// OpcUaServerConfig values<NEW_LINE>builder.setIdentityValidator(config.getIdentityValidator());<NEW_LINE>builder.setBuildInfo(config.getBuildInfo());<NEW_LINE>builder.setLimits(config.getLimits());<NEW_LINE>builder.setScheduledExecutorService(config.getScheduledExecutorService());<NEW_LINE>return builder;<NEW_LINE>}
setApplicationUri(config.getApplicationUri());
1,482,658
public ApiResponse<String> downloadDownloadWithTokenWithHttpInfo(String downloadid) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'downloadid' is set<NEW_LINE>if (downloadid == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'downloadid' when calling downloadDownloadWithToken");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/download/{downloadid}".replaceAll("\\{" + "downloadid" + "\\}", apiClient.escapeString(downloadid.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "text/json" };<NEW_LINE>final String <MASK><NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "oauth2" };<NEW_LINE>GenericType<String> localVarReturnType = new GenericType<String>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
200,491
public OResultSet syncPull(OCommandContext ctx, int nRecords) throws OTimeoutException {<NEW_LINE>getPrev().ifPresent(x -> x.syncPull(ctx, nRecords));<NEW_LINE>return new OResultSet() {<NEW_LINE><NEW_LINE>private int internalNext = 0;<NEW_LINE><NEW_LINE>private void fetchNext() {<NEW_LINE>if (nextResult != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>ORecordId nextRid = iterator.next();<NEW_LINE>if (nextRid == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>OIdentifiable nextDoc = (OIdentifiable) ctx.getDatabase().load(nextRid);<NEW_LINE>if (nextDoc == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>nextResult = new OResultInternal();<NEW_LINE>((OResultInternal<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasNext() {<NEW_LINE>if (internalNext >= nRecords) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (nextResult == null) {<NEW_LINE>fetchNext();<NEW_LINE>}<NEW_LINE>return nextResult != null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public OResult next() {<NEW_LINE>if (!hasNext()) {<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>internalNext++;<NEW_LINE>OResult result = nextResult;<NEW_LINE>nextResult = null;<NEW_LINE>ctx.setVariable("$current", result.toElement());<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void close() {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Optional<OExecutionPlan> getExecutionPlan() {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Map<String, Long> getQueryStats() {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
) nextResult).setElement(nextDoc);
1,767,978
public void authenticate() throws ServerException, UserException {<NEW_LINE>try {<NEW_LINE>AuthInterface authInterface = channel.get(AuthInterface.class);<NEW_LINE>if (authenticationInfo instanceof UsernamePasswordAuthenticationInfo) {<NEW_LINE>UsernamePasswordAuthenticationInfo usernamePasswordAuthenticationInfo = (UsernamePasswordAuthenticationInfo) authenticationInfo;<NEW_LINE>setToken(authInterface.login(usernamePasswordAuthenticationInfo.getUsername(), usernamePasswordAuthenticationInfo.getPassword()));<NEW_LINE>} else if (authenticationInfo instanceof AutologinAuthenticationInfo) {<NEW_LINE>AutologinAuthenticationInfo autologinAuthenticationInfo = (AutologinAuthenticationInfo) authenticationInfo;<NEW_LINE>setToken(autologinAuthenticationInfo.getAutologinCode());<NEW_LINE>} else if (authenticationInfo instanceof TokenAuthentication) {<NEW_LINE>TokenAuthentication tokenAuthentication = (TokenAuthentication) authenticationInfo;<NEW_LINE>setToken(tokenAuthentication.getToken());<NEW_LINE>} else if (authenticationInfo instanceof UserTokenAuthentication) {<NEW_LINE>UserTokenAuthentication tokenAuthentication = (UserTokenAuthentication) authenticationInfo;<NEW_LINE>setToken(authInterface.loginUserToken<MASK><NEW_LINE>} else if (authenticationInfo instanceof SystemAuthentication) {<NEW_LINE>}<NEW_LINE>} catch (PublicInterfaceNotFoundException e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>}<NEW_LINE>}
(tokenAuthentication.getToken()));
96,696
protected void createMaxResultsLayout() {<NEW_LINE>maxResultsLayout = uiComponents.create(HBoxLayout.class);<NEW_LINE>maxResultsLayout.setStyleName("c-maxresults");<NEW_LINE>maxResultsLayout.setSpacing(true);<NEW_LINE>Label<String> maxResultsLabel = <MASK><NEW_LINE>maxResultsLabel.setStyleName("c-maxresults-label");<NEW_LINE>maxResultsLabel.setValue(messages.getMainMessage("filter.maxResults.label1"));<NEW_LINE>maxResultsLabel.setAlignment(Alignment.MIDDLE_RIGHT);<NEW_LINE>maxResultsLayout.add(maxResultsLabel);<NEW_LINE>maxResultsTextField = uiComponents.create(TextField.TYPE_INTEGER);<NEW_LINE>maxResultsTextField.setStyleName("c-maxresults-input");<NEW_LINE>maxResultsTextField.setMaxLength(4);<NEW_LINE>maxResultsTextField.setWidth(theme.get("cuba.gui.Filter.maxResults.width"));<NEW_LINE>maxResultsTextField.addValueChangeListener(this::onMaxResultsChange);<NEW_LINE>maxResultsLookupField = maxResultsFieldHelper.createMaxResultsLookupField();<NEW_LINE>maxResultsLookupField.setStyleName("c-maxresults-select");<NEW_LINE>maxResultsLookupField.addValueChangeListener(this::onMaxResultsChange);<NEW_LINE>maxResultsField = textMaxResults ? maxResultsTextField : maxResultsLookupField;<NEW_LINE>maxResultsLayout.add(maxResultsField);<NEW_LINE>}
uiComponents.create(Label.NAME);
54,553
public static void openProperties(File[] roots, String ctxDisplayName) {<NEW_LINE>if (!Subversion.getInstance().checkClientAvailable()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final PropertiesPanel panel = new PropertiesPanel();<NEW_LINE>final PropertiesTable propTable;<NEW_LINE>propTable = new PropertiesTable(panel.labelForTable, PropertiesTable.PROPERTIES_COLUMNS, new String<MASK><NEW_LINE>panel.setPropertiesTable(propTable);<NEW_LINE>JComponent component = propTable.getComponent();<NEW_LINE>panel.propsPanel.setLayout(new BorderLayout());<NEW_LINE>panel.propsPanel.add(component, BorderLayout.CENTER);<NEW_LINE>SvnProperties svnProperties = new SvnProperties(panel, propTable, roots);<NEW_LINE>JButton btnClose = new JButton();<NEW_LINE>// NOI18N<NEW_LINE>Mnemonics.setLocalizedText(btnClose, getString("CTL_Properties_Action_Close"));<NEW_LINE>// NOI18N<NEW_LINE>btnClose.getAccessibleContext().setAccessibleDescription(getString("CTL_Properties_Action_Close"));<NEW_LINE>// NOI18N<NEW_LINE>btnClose.getAccessibleContext().setAccessibleName(getString("CTL_Properties_Action_Close"));<NEW_LINE>// NOI18N<NEW_LINE>DialogDescriptor dd = new DialogDescriptor(panel, org.openide.util.NbBundle.getMessage(SvnPropertiesAction.class, "CTL_PropertiesDialog_Title", ctxDisplayName));<NEW_LINE>dd.setModal(true);<NEW_LINE>dd.setOptions(new Object[] { btnClose });<NEW_LINE>dd.setHelpCtx(new HelpCtx(SvnPropertiesAction.class));<NEW_LINE>// NOI18N<NEW_LINE>panel.putClientProperty("contentTitle", ctxDisplayName);<NEW_LINE>// NOI18N<NEW_LINE>panel.putClientProperty("DialogDescriptor", dd);<NEW_LINE>Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);<NEW_LINE>// NOI18N<NEW_LINE>dialog.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(SvnPropertiesAction.class, "CTL_PropertiesAction"));<NEW_LINE>dialog.pack();<NEW_LINE>dialog.setVisible(true);<NEW_LINE>}
[] { PropertiesTableModel.COLUMN_NAME_VALUE });
912,319
public Map<String, ContainerRegistryConfiguration> convert(String dockerconfigjson) {<NEW_LINE>if (StringUtils.hasText(dockerconfigjson)) {<NEW_LINE>try {<NEW_LINE>Map authsMap = (Map) new ObjectMapper().readValue(dockerconfigjson, Map<MASK><NEW_LINE>Map<String, ContainerRegistryConfiguration> registryConfigurationMap = new HashMap<>();<NEW_LINE>for (Object registryUrl : authsMap.keySet()) {<NEW_LINE>ContainerRegistryConfiguration rc = new ContainerRegistryConfiguration();<NEW_LINE>rc.setRegistryHost(replaceDefaultDockerRegistryServerUrl(registryUrl.toString()));<NEW_LINE>Map registryMap = (Map) authsMap.get(registryUrl.toString());<NEW_LINE>rc.setUser((String) registryMap.get("username"));<NEW_LINE>rc.setSecret((String) registryMap.get("password"));<NEW_LINE>Optional<String> tokenAccessUrl = getDockerTokenServiceUri(rc.getRegistryHost(), true, this.httpProxyPerHost.getOrDefault(rc.getRegistryHost(), false));<NEW_LINE>if (tokenAccessUrl.isPresent()) {<NEW_LINE>rc.setAuthorizationType(ContainerRegistryConfiguration.AuthorizationType.dockeroauth2);<NEW_LINE>rc.getExtra().put(DockerOAuth2RegistryAuthorizer.DOCKER_REGISTRY_AUTH_URI_KEY, tokenAccessUrl.get());<NEW_LINE>} else {<NEW_LINE>if (StringUtils.isEmpty(rc.getUser()) && StringUtils.isEmpty(rc.getSecret())) {<NEW_LINE>rc.setAuthorizationType(ContainerRegistryConfiguration.AuthorizationType.anonymous);<NEW_LINE>} else {<NEW_LINE>rc.setAuthorizationType(ContainerRegistryConfiguration.AuthorizationType.basicauth);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.info("Registry Configuration: " + rc.toString());<NEW_LINE>registryConfigurationMap.put(rc.getRegistryHost(), rc);<NEW_LINE>}<NEW_LINE>return registryConfigurationMap;<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Failed to parse the Secrets in dockerconfigjson");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Collections.emptyMap();<NEW_LINE>}
.class).get("auths");
613,150
public ImmutableList<CppCompileAction> generateActionsForInputArtifacts(ImmutableSet<TreeFileArtifact> inputTreeFileArtifacts, ActionLookupKey artifactOwner) throws ActionExecutionException {<NEW_LINE>ImmutableList.Builder<CppCompileAction> expandedActions = new ImmutableList.Builder<>();<NEW_LINE>ImmutableList.Builder<TreeFileArtifact> sourcesBuilder = ImmutableList.builder();<NEW_LINE>NestedSetBuilder<Artifact> privateHeadersBuilder = NestedSetBuilder.stableOrder();<NEW_LINE>for (TreeFileArtifact inputTreeFileArtifact : inputTreeFileArtifacts) {<NEW_LINE>boolean isHeader = CppFileTypes.CPP_HEADER.matches(inputTreeFileArtifact.getExecPath());<NEW_LINE>boolean isTextualInclude = CppFileTypes.CPP_TEXTUAL_INCLUDE.matches(inputTreeFileArtifact.getExecPath());<NEW_LINE>boolean isSource = SourceCategory.CC_AND_OBJC.getSourceTypes().matches(inputTreeFileArtifact.getExecPathString()) && !isHeader;<NEW_LINE>if (isHeader) {<NEW_LINE>privateHeadersBuilder.add(inputTreeFileArtifact);<NEW_LINE>}<NEW_LINE>if (isSource || (isHeader && shouldCompileHeaders() && !isTextualInclude)) {<NEW_LINE>sourcesBuilder.add(inputTreeFileArtifact);<NEW_LINE>} else if (!isHeader) {<NEW_LINE>String message = String.format("Artifact '%s' expanded from the directory artifact '%s' is neither header " + "nor source file.", inputTreeFileArtifact.getExecPathString(), sourceTreeArtifact.getExecPathString());<NEW_LINE>throw new ActionExecutionException(message, this, /*catastrophe=*/<NEW_LINE>false, makeDetailedExitCode(message));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ImmutableList<TreeFileArtifact> sources = sourcesBuilder.build();<NEW_LINE>NestedSet<Artifact> privateHeaders = privateHeadersBuilder.build();<NEW_LINE>for (TreeFileArtifact inputTreeFileArtifact : sources) {<NEW_LINE>String outputName = outputTreeFileArtifactName(inputTreeFileArtifact);<NEW_LINE>TreeFileArtifact outputTreeFileArtifact = TreeFileArtifact.createTemplateExpansionOutput(outputTreeArtifact, outputName, artifactOwner);<NEW_LINE>TreeFileArtifact dotdFileArtifact = null;<NEW_LINE>if (dotdTreeArtifact != null && cppCompileActionBuilder.useDotdFile(inputTreeFileArtifact)) {<NEW_LINE>dotdFileArtifact = TreeFileArtifact.createTemplateExpansionOutput(<MASK><NEW_LINE>}<NEW_LINE>expandedActions.add(createAction(inputTreeFileArtifact, outputTreeFileArtifact, dotdFileArtifact, privateHeaders));<NEW_LINE>}<NEW_LINE>return expandedActions.build();<NEW_LINE>}
dotdTreeArtifact, outputName + ".d", artifactOwner);
919,439
final UpdateDomainMetadataResult executeUpdateDomainMetadata(UpdateDomainMetadataRequest updateDomainMetadataRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateDomainMetadataRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateDomainMetadataRequest> request = null;<NEW_LINE>Response<UpdateDomainMetadataResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateDomainMetadataRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDomainMetadataRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WorkLink");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateDomainMetadata");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateDomainMetadataResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDomainMetadataResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
228,811
void addRegOrMem(Instruction instruction, int operand, int regLo, int regHi, int vsibIndexRegLo, int vsibIndexRegHi, boolean allowMemOp, boolean allowRegOp) {<NEW_LINE>int opKind = instruction.getOpKind(operand);<NEW_LINE>encoderFlags |= EncoderFlags.MOD_RM;<NEW_LINE>if (opKind == OpKind.REGISTER) {<NEW_LINE>if (!allowRegOp) {<NEW_LINE>setErrorMessage(String.format("Operand %d: register operand != allowed", operand));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int reg = instruction.getOpRegister(operand);<NEW_LINE>if (!verify(operand, reg, regLo, regHi))<NEW_LINE>return;<NEW_LINE>int regNum = reg - regLo;<NEW_LINE>if (regLo == Register.AL) {<NEW_LINE>if (reg >= Register.R8L)<NEW_LINE>regNum -= 4;<NEW_LINE>else if (reg >= Register.SPL) {<NEW_LINE>regNum -= 4;<NEW_LINE>encoderFlags |= EncoderFlags.REX;<NEW_LINE>} else if (reg >= Register.AH)<NEW_LINE>encoderFlags |= EncoderFlags.HIGH_LEGACY_8_BIT_REGS;<NEW_LINE>}<NEW_LINE>modRM |= (byte) (regNum & 7);<NEW_LINE>modRM |= 0xC0;<NEW_LINE>encoderFlags |= (regNum >>> 3) & 3;<NEW_LINE>assert Integer.compareUnsigned(<MASK><NEW_LINE>} else if (opKind == OpKind.MEMORY) {<NEW_LINE>if (!allowMemOp) {<NEW_LINE>setErrorMessage(String.format("Operand %d: memory operand != allowed", operand));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (MemorySize.isBroadcast(instruction.getMemorySize()))<NEW_LINE>encoderFlags |= EncoderFlags.BROADCAST;<NEW_LINE>int codeSize = instruction.getCodeSize();<NEW_LINE>if (codeSize == CodeSize.UNKNOWN) {<NEW_LINE>if (bitness == 64)<NEW_LINE>codeSize = CodeSize.CODE64;<NEW_LINE>else if (bitness == 32)<NEW_LINE>codeSize = CodeSize.CODE32;<NEW_LINE>else {<NEW_LINE>assert bitness == 16 : bitness;<NEW_LINE>codeSize = CodeSize.CODE16;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>int addrSize = com.github.icedland.iced.x86.InternalInstructionUtils.getAddressSizeInBytes(instruction.getMemoryBase(), instruction.getMemoryIndex(), instruction.getMemoryDisplSize(), codeSize) * 8;<NEW_LINE>if (addrSize != bitness)<NEW_LINE>encoderFlags |= EncoderFlags.P67;<NEW_LINE>if ((encoderFlags & EncoderFlags.REG_IS_MEMORY) != 0) {<NEW_LINE>int regSize = getRegisterOpSize(instruction);<NEW_LINE>if (regSize != addrSize) {<NEW_LINE>setErrorMessage(String.format("Operand %d: Register operand size must equal memory addressing mode (16/32/64)", operand));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (addrSize == 16) {<NEW_LINE>if (vsibIndexRegLo != Register.NONE) {<NEW_LINE>setErrorMessage(String.format("Operand %d: VSIB operands can't use 16-bit addressing. It must be 32-bit or 64-bit addressing", operand));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>addMemOp16(instruction, operand);<NEW_LINE>} else<NEW_LINE>addMemOp(instruction, operand, addrSize, vsibIndexRegLo, vsibIndexRegHi);<NEW_LINE>} else<NEW_LINE>setErrorMessage(String.format("Operand %d: Expected a register or memory operand, but opKind is %d", operand, opKind));<NEW_LINE>}
regNum, 31) <= 0 : regNum;
1,704,088
void onBindView(GeoActivity activity, Location location, MainThemeManager themeManager, int position) {<NEW_LINE>StringBuilder talkBackBuilder = new StringBuilder(activity.getString(R.string.tag_aqi));<NEW_LINE>super.onBindView(activity, location, themeManager, talkBackBuilder, position);<NEW_LINE>assert location.getWeather() != null;<NEW_LINE>Daily daily = location.getWeather().getDailyForecast().get(position);<NEW_LINE>Integer index = daily.getAirQuality().getAqiIndex();<NEW_LINE>talkBackBuilder.append(", ").append(index).append(", ").append(daily.getAirQuality().getAqiText());<NEW_LINE>mPolylineAndHistogramView.setData(null, null, null, null, null, null, (float) (index == null ? 0 : index), String.format("%d", index == null ? 0 : index), (float) mHighestIndex, 0f);<NEW_LINE>mPolylineAndHistogramView.setLineColors(daily.getAirQuality().getAqiColor(activity), daily.getAirQuality().getAqiColor(activity), mThemeManager.getSeparatorColor(activity));<NEW_LINE>int[] themeColors = mThemeManager.getWeatherThemeColors();<NEW_LINE>mPolylineAndHistogramView.setShadowColors(themeColors[1], themeColors[2], mThemeManager.isLightTheme());<NEW_LINE>mPolylineAndHistogramView.setTextColors(mThemeManager.getTextContentColor(activity)<MASK><NEW_LINE>mPolylineAndHistogramView.setHistogramAlpha(mThemeManager.isLightTheme() ? 1f : 0.5f);<NEW_LINE>dailyItem.setContentDescription(talkBackBuilder.toString());<NEW_LINE>}
, mThemeManager.getTextSubtitleColor(activity));
1,834,876
public void execute(final CommandLine commandLine, final Options options, final RPCHook rpcHook) throws SubCommandException {<NEW_LINE>DefaultMQAdminExt defaultMQAdminExt = new DefaultMQAdminExt(rpcHook);<NEW_LINE>defaultMQAdminExt.setInstanceName(Long.toString(System.currentTimeMillis()));<NEW_LINE>try {<NEW_LINE>if (commandLine.hasOption('b')) {<NEW_LINE>String brokerAddr = commandLine.<MASK><NEW_LINE>defaultMQAdminExt.start();<NEW_LINE>getAndPrint(defaultMQAdminExt, String.format("============%s============\n", brokerAddr), brokerAddr);<NEW_LINE>} else if (commandLine.hasOption('c')) {<NEW_LINE>String clusterName = commandLine.getOptionValue('c').trim();<NEW_LINE>defaultMQAdminExt.start();<NEW_LINE>Map<String, List<String>> masterAndSlaveMap = CommandUtil.fetchMasterAndSlaveDistinguish(defaultMQAdminExt, clusterName);<NEW_LINE>for (Entry<String, List<String>> masterAndSlaveEntry : masterAndSlaveMap.entrySet()) {<NEW_LINE>getAndPrint(defaultMQAdminExt, String.format("============Master: %s============\n", masterAndSlaveEntry.getKey()), masterAndSlaveEntry.getKey());<NEW_LINE>for (String slaveAddr : masterAndSlaveEntry.getValue()) {<NEW_LINE>getAndPrint(defaultMQAdminExt, String.format("============My Master: %s=====Slave: %s============\n", masterAndSlaveEntry.getKey(), slaveAddr), slaveAddr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SubCommandException(this.getClass().getSimpleName() + " command failed", e);<NEW_LINE>} finally {<NEW_LINE>defaultMQAdminExt.shutdown();<NEW_LINE>}<NEW_LINE>}
getOptionValue('b').trim();
1,764,700
public void deleteById(String id) {<NEW_LINE>String resourceGroupName = <MASK><NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String factoryName = Utils.getValueFromIdByName(id, "factories");<NEW_LINE>if (factoryName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'factories'.", id)));<NEW_LINE>}<NEW_LINE>String integrationRuntimeName = Utils.getValueFromIdByName(id, "integrationRuntimes");<NEW_LINE>if (integrationRuntimeName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'integrationRuntimes'.", id)));<NEW_LINE>}<NEW_LINE>this.deleteWithResponse(resourceGroupName, factoryName, integrationRuntimeName, Context.NONE);<NEW_LINE>}
Utils.getValueFromIdByName(id, "resourceGroups");
496,595
private void emitPerBaseCoverageIfRequested() {<NEW_LINE>if (this.perBaseOutput == null)<NEW_LINE>return;<NEW_LINE>final PrintWriter out = new PrintWriter(IOUtil.openFileForBufferedWriting(this.perBaseOutput));<NEW_LINE>out.println("chrom\tpos\ttarget\tcoverage");<NEW_LINE>for (final Map.Entry<Interval, Coverage> entry : this.highQualityCoverageByTarget.entrySet()) {<NEW_LINE>final Interval interval = entry.getKey();<NEW_LINE>final String chrom = interval.getContig();<NEW_LINE>final int firstBase = interval.getStart();<NEW_LINE>final int[] cov = entry.getValue().getDepths();<NEW_LINE>for (int i = 0; i < cov.length; ++i) {<NEW_LINE>out.print(chrom);<NEW_LINE>out.print('\t');<NEW_LINE>out.print(firstBase + i);<NEW_LINE>out.print('\t');<NEW_LINE>out.<MASK><NEW_LINE>out.print('\t');<NEW_LINE>out.print(cov[i]);<NEW_LINE>out.println();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.close();<NEW_LINE>}
print(interval.getName());
417,180
static void baseCalc(FastDistanceSparseData left, FastDistanceSparseData right, double[] res, double fillValue, Functional.SerializableFunction<Double, Double> function) {<NEW_LINE>Arrays.fill(res, fillValue);<NEW_LINE>int[][] leftIndices = left.getIndices();<NEW_LINE>int[][] rightIndices = right.getIndices();<NEW_LINE>double[][] leftValues = left.getValues();<NEW_LINE>double[][] rightValues = right.getValues();<NEW_LINE>Preconditions.checkArgument(leftIndices.length == rightIndices.length, "VectorSize not equal!");<NEW_LINE>for (int i = 0; i < leftIndices.length; i++) {<NEW_LINE>int<MASK><NEW_LINE>int[] rightIndicesList = rightIndices[i];<NEW_LINE>double[] leftValuesList = leftValues[i];<NEW_LINE>double[] rightValuesList = rightValues[i];<NEW_LINE>if (null != leftIndicesList) {<NEW_LINE>for (int j = 0; j < leftIndicesList.length; j++) {<NEW_LINE>double leftValue = leftValuesList[j];<NEW_LINE>int startIndex = leftIndicesList[j] * right.vectorNum;<NEW_LINE>if (null != rightIndicesList) {<NEW_LINE>for (int k = 0; k < rightIndicesList.length; k++) {<NEW_LINE>res[startIndex + rightIndicesList[k]] += function.apply(rightValuesList[k] * leftValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
[] leftIndicesList = leftIndices[i];
1,780,121
public static void reportErrorAsHTML(PrintWriter out, ServletErrorReport error, String url) {<NEW_LINE>out.println("<HTML>\n<HEAD><TITLE>" + nls.getString("Error.Report", "Error Report") + "</TITLE></HEAD>\n<BODY>");<NEW_LINE>if (error == null) {<NEW_LINE>out.println(nls.getString("No.Error.to.Report", "No Error to Report"));<NEW_LINE>} else {<NEW_LINE>out.println("<H1>Error " + error.getErrorCode() + "</H1>");<NEW_LINE>out.println(// 96236<NEW_LINE>"<H3>" + nls.getString("error.occured.processing.request", "An error has occurred while processing request: ") + encodeChars(url) + "</H3>");<NEW_LINE>out.println(// begin 110817<NEW_LINE>"<H3><B>" + nls.getString("Message", "Message:") + // ServletErrorReport by default encodes the chars for getMessage().<NEW_LINE>// "</B> " + encodeChars(error.getMessage()) + // 96236<NEW_LINE>"</B> " + // end 110817<NEW_LINE>error.getMessage() + "</H3><BR>");<NEW_LINE>out.println(// 96236<NEW_LINE>"<B>" + nls.getString("Target.Servlet", "Target Servlet:") + " </B>" + encodeChars(error<MASK><NEW_LINE>out.println("<B>" + nls.getString("StackTrace", "StackTrace:") + " </B>");<NEW_LINE>printFullStackTrace(out, error);<NEW_LINE>}<NEW_LINE>out.println("\n</BODY>\n</HTML>");<NEW_LINE>out.flush();<NEW_LINE>}
.getTargetServletName()) + "<BR>");
775,897
public boolean reActivateIt() {<NEW_LINE>log.info(toString());<NEW_LINE>// Before reActivate<NEW_LINE>m_processMsg = ModelValidationEngine.get().<MASK><NEW_LINE>if (m_processMsg != null)<NEW_LINE>return false;<NEW_LINE>MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());<NEW_LINE>String DocSubTypeSO = dt.getDocSubTypeSO();<NEW_LINE>// Replace Prepay with POS to revert all doc<NEW_LINE>if (MDocType.DOCSUBTYPESO_PrepayOrder.equals(DocSubTypeSO)) {<NEW_LINE>MDocType newDT = null;<NEW_LINE>MDocType[] dts = MDocType.getOfClient(getCtx());<NEW_LINE>for (int i = 0; i < dts.length; i++) {<NEW_LINE>MDocType type = dts[i];<NEW_LINE>if (MDocType.DOCSUBTYPESO_PrepayOrder.equals(type.getDocSubTypeSO())) {<NEW_LINE>if (type.isDefault() || newDT == null)<NEW_LINE>newDT = type;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (newDT == null)<NEW_LINE>return false;<NEW_LINE>else<NEW_LINE>setC_DocType_ID(newDT.getC_DocType_ID());<NEW_LINE>}<NEW_LINE>// PO - just re-open<NEW_LINE>if (!isSOTrx())<NEW_LINE>log.info("Existing documents not modified - " + dt);<NEW_LINE>else // Reverse Direct Documents<NEW_LINE>if (// (W)illCall(I)nvoice<NEW_LINE>// (W)illCall(P)ickup<NEW_LINE>MDocType.DOCSUBTYPESO_OnCreditOrder.equals(DocSubTypeSO) || // (W)alkIn(R)eceipt<NEW_LINE>MDocType.DOCSUBTYPESO_WarehouseOrder.equals(DocSubTypeSO) || MDocType.DOCSUBTYPESO_POSOrder.equals(DocSubTypeSO)) {<NEW_LINE>if (!createReversals(false))<NEW_LINE>return false;<NEW_LINE>} else {<NEW_LINE>log.info("Existing documents not modified - SubType=" + DocSubTypeSO);<NEW_LINE>}
fireDocValidate(this, ModelValidator.TIMING_BEFORE_REACTIVATE);
129,814
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {<NEW_LINE>String ip = request.getHeader("X-Forwarded-For");<NEW_LINE>if (ip == null) {<NEW_LINE>ip = request.getHeader("X-Real-IP");<NEW_LINE>}<NEW_LINE>if (ip != null) {<NEW_LINE>ip = ip.split(",")[0];<NEW_LINE>} else {<NEW_LINE>ip = request.getRemoteAddr();<NEW_LINE>}<NEW_LINE>if (configProvider.getBaseConfig().getMain().getLogging().isMapIpToHost()) {<NEW_LINE>try {<NEW_LINE>InetAddress inetAddress = InetAddress.getByName(ip);<NEW_LINE>ip = inetAddress.getHostName();<NEW_LINE>} catch (UnknownHostException e) {<NEW_LINE>logger.debug("Unable to determine host from IP address {}", ip);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (configProvider.getBaseConfig().getMain().getLogging().isLogIpAddresses()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (configProvider.getBaseConfig().getMain().getLogging().isLogUsername() && !Strings.isNullOrEmpty(request.getRemoteUser())) {<NEW_LINE>MDC.put("USERNAME", request.getRemoteUser());<NEW_LINE>}<NEW_LINE>SessionStorage.IP.set(ip);<NEW_LINE>SessionStorage.username.set(request.getRemoteUser());<NEW_LINE>SessionStorage.userAgent.set(userAgentMapper.getUserAgent(request.getHeader("User-Agent")));<NEW_LINE>SessionStorage.requestUrl.set(request.getRequestURI());<NEW_LINE>return true;<NEW_LINE>}
MDC.put("IPADDRESS", ip);
80,107
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>requireButton = new JButton();<NEW_LINE>requireDevButton = new JButton();<NEW_LINE>keepOpenCheckBox = new JCheckBox();<NEW_LINE>innerPanel = new JPanel();<NEW_LINE>// NOI18N<NEW_LINE>Mnemonics.setLocalizedText(requireButton, NbBundle.getMessage(AddDependencyPanel.class, "AddDependencyPanel.requireButton.text"));<NEW_LINE>requireButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent evt) {<NEW_LINE>requireButtonActionPerformed(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// NOI18N<NEW_LINE>Mnemonics.setLocalizedText(requireDevButton, NbBundle.getMessage(AddDependencyPanel.class, "AddDependencyPanel.requireDevButton.text"));<NEW_LINE>requireDevButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent evt) {<NEW_LINE>requireDevButtonActionPerformed(evt);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// NOI18N<NEW_LINE>Mnemonics.setLocalizedText(keepOpenCheckBox, NbBundle.getMessage(AddDependencyPanel.class, "AddDependencyPanel.keepOpenCheckBox.text"));<NEW_LINE>innerPanel.setLayout(new BorderLayout());<NEW_LINE><MASK><NEW_LINE>this.setLayout(layout);<NEW_LINE>layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(innerPanel, GroupLayout.DEFAULT_SIZE, 550, Short.MAX_VALUE).addContainerGap()));<NEW_LINE>layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(innerPanel, GroupLayout.DEFAULT_SIZE, 321, Short.MAX_VALUE).addContainerGap()));<NEW_LINE>}
GroupLayout layout = new GroupLayout(this);
86,114
private String executeWithNashorn(SampleResult previousResult, Sampler currentSampler, JMeterContext jmctx, JMeterVariables vars, String script, String varName) throws InvalidVariableException {<NEW_LINE>String resultStr = null;<NEW_LINE>try {<NEW_LINE>ScriptContext newContext = new SimpleScriptContext();<NEW_LINE>ScriptEngine engine = getInstance().getEngineByName(JavaScript.NASHORN_ENGINE_NAME);<NEW_LINE>Bindings bindings = engine.createBindings();<NEW_LINE>// Set up some objects for the script to play with<NEW_LINE>// $NON-NLS-1$<NEW_LINE>bindings.put("log", log);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>bindings.put("ctx", jmctx);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>bindings.put("vars", vars);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>bindings.put("props", JMeterUtils.getJMeterProperties());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>bindings.put("threadName", Thread.currentThread().getName());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>bindings.put("sampler", currentSampler);<NEW_LINE>// $NON-NLS-1$<NEW_LINE><MASK><NEW_LINE>newContext.setBindings(bindings, ScriptContext.ENGINE_SCOPE);<NEW_LINE>Object result = engine.eval(script, newContext);<NEW_LINE>resultStr = result.toString();<NEW_LINE>if (varName != null && vars != null) {<NEW_LINE>// vars can be null if run from TestPlan<NEW_LINE>vars.put(varName, resultStr);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Error processing Javascript: [{}]", script, e);<NEW_LINE>throw new InvalidVariableException("Error processing Javascript: [" + script + "]", e);<NEW_LINE>}<NEW_LINE>return resultStr;<NEW_LINE>}
bindings.put("sampleResult", previousResult);
1,139,110
protected void executeImpl() throws MojoExecutionException, MojoFailureException {<NEW_LINE>File commonDir = getCN1ProjectDir();<NEW_LINE>if (commonDir == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>File rootMavenProjectDir = commonDir.getParentFile();<NEW_LINE>File javaSEDir = new File(rootMavenProjectDir, "javase");<NEW_LINE>if (!javaSEDir.exists()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>InvocationRequest request = new DefaultInvocationRequest();<NEW_LINE>// request.setPomFile( new File( "/path/to/pom.xml" ) );<NEW_LINE>request.setGoals(Arrays.asList("verify"));<NEW_LINE>request.setProfiles(Arrays.asList("debug-simulator"));<NEW_LINE>Properties props = new Properties();<NEW_LINE><MASK><NEW_LINE>props.setProperty("jpda.address", System.getProperty("jpda.address"));<NEW_LINE>request.setProperties(props);<NEW_LINE>request.setBaseDirectory(rootMavenProjectDir);<NEW_LINE>Invoker invoker = new DefaultInvoker();<NEW_LINE>try {<NEW_LINE>invoker.execute(request);<NEW_LINE>} catch (MavenInvocationException ex) {<NEW_LINE>throw new MojoExecutionException(ex.getMessage(), ex);<NEW_LINE>}<NEW_LINE>}
props.setProperty("codename1.platform", "javase");
1,849,125
private JMethod createReboundValueSelectorMethod(SourceInfo info, String prefix, String parameterType, JReferenceType returntype, List<String> results, List<JExpression> resultExpressions, Multimap<String, Integer> resultsToPermutations) {<NEW_LINE>// Pick the most-used result type to emit less code<NEW_LINE>String mostUsed = mostUsedValue(resultsToPermutations);<NEW_LINE>assert mostUsed != null;<NEW_LINE>JMethod toReturn;<NEW_LINE>info = info.makeChild(SourceOrigin.UNKNOWN);<NEW_LINE>// c_g_g_d_c_i_DOMImpl<NEW_LINE>toReturn = new JMethod(info, prefix + parameterType.replace("_", "_1").replace('.', '_'), holderType, returntype, false, true, true, AccessModifier.PUBLIC);<NEW_LINE>toReturn.setBody(new JMethodBody(info));<NEW_LINE>holderType.addMethod(toReturn);<NEW_LINE>toReturn.freezeParamTypes();<NEW_LINE>info.addCorrelation(info.getCorrelator().by(toReturn));<NEW_LINE>softPermutationMethods.put(parameterType, toReturn);<NEW_LINE>// Used in the return statement at the end<NEW_LINE>JExpression mostUsedExpression = null;<NEW_LINE>JBlock switchBody = new JBlock(info);<NEW_LINE>for (int i = 0, j = results.size(); i < j; i++) {<NEW_LINE>String resultType = results.get(i);<NEW_LINE>JExpression expression = resultExpressions.get(i);<NEW_LINE>Collection<Integer> permutations = resultsToPermutations.get(resultType);<NEW_LINE>if (permutations.isEmpty()) {<NEW_LINE>// This rebind result is unused in this permutation<NEW_LINE>continue;<NEW_LINE>} else if (resultType.equals(mostUsed)) {<NEW_LINE>// Save off the fallback expression and go onto the next type<NEW_LINE>mostUsedExpression = expression;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (int permutationId : permutations) {<NEW_LINE>// case 33:<NEW_LINE>switchBody.addStmt(new JCaseStatement(info, program.getLiteralInt(permutationId)));<NEW_LINE>}<NEW_LINE>// return new FooImpl();<NEW_LINE>switchBody.addStmt(expression.makeReturnStatement());<NEW_LINE>}<NEW_LINE>assert switchBody.getStatements().size() > 0 : "No case statement emitted " + "for supposedly soft-rebind " + parameterType;<NEW_LINE>// switch (CollapsedPropertyHolder.getPermutationId()) { ... }<NEW_LINE>JSwitchStatement sw = new JSwitchStatement(info, new JMethodCall(info, null, permutationIdMethod), switchBody);<NEW_LINE>// return new FallbackImpl(); at the very end.<NEW_LINE>assert mostUsedExpression != null : "No most-used expression";<NEW_LINE>JReturnStatement fallbackReturn = mostUsedExpression.makeReturnStatement();<NEW_LINE>JMethodBody body = (JMethodBody) toReturn.getBody();<NEW_LINE>body.getBlock().addStmt(sw);<NEW_LINE>body.<MASK><NEW_LINE>return toReturn;<NEW_LINE>}
getBlock().addStmt(fallbackReturn);
96,576
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = new String[] { "c0", "c1" };<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>// create window<NEW_LINE>String stmtTextCreate = "@public @buseventtype create schema MyEvent(cid string);\n";<NEW_LINE>stmtTextCreate += namedWindow ? "@public create window MyInfra.win:keepall() as MyEvent" : "@public create table MyInfra(cid string primary key)";<NEW_LINE>env.compileDeploy(stmtTextCreate, path);<NEW_LINE>// create insert into<NEW_LINE>String stmtTextInsert = "insert into MyInfra select * from MyEvent";<NEW_LINE>env.compileDeploy(stmtTextInsert, path);<NEW_LINE>// create join<NEW_LINE>String stmtTextJoin = "@name('s0') select ce.cid as c0, sb.intPrimitive as c1 from MyInfra as ce, SupportBean#keepall() as sb" + " where sb.theString = ce.cid";<NEW_LINE>env.compileDeploy(stmtTextJoin, path).addListener("s0");<NEW_LINE>sendMyEvent(env, "C1");<NEW_LINE>sendMyEvent(env, "C2");<NEW_LINE>sendMyEvent(env, "C3");<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportBean("C2", 1));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "C2", 1 });<NEW_LINE>env.sendEventBean(<MASK><NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "C1", 4 });<NEW_LINE>env.undeployAll();<NEW_LINE>}
new SupportBean("C1", 4));
932,193
final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));<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, "License Manager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);