idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
80,654
private static void buildByColumns(StringBuilder sqlBuilder, List<Column> columns, char separator) {<NEW_LINE>for (int i = 0; i < columns.size(); i++) {<NEW_LINE>Column before = i > 0 ? columns.get(i - 1) : null;<NEW_LINE>Column curent = columns.get(i);<NEW_LINE>if (curent instanceof Or) {<NEW_LINE>continue;<NEW_LINE>} else // sqlPart<NEW_LINE>if (curent instanceof SqlPart) {<NEW_LINE>appendSqlPartLogic(sqlBuilder, before, (SqlPart) curent, separator);<NEW_LINE>} else // group<NEW_LINE>if (curent instanceof Group) {<NEW_LINE>appendGroupLogic(sqlBuilder, before, (Group) curent, separator);<NEW_LINE>} else // in logic<NEW_LINE>if (Column.LOGIC_IN.equals(curent.getLogic()) || Column.LOGIC_NOT_IN.equals(curent.getLogic())) {<NEW_LINE>appendLinkString(sqlBuilder, before);<NEW_LINE>appendInLogic(sqlBuilder, curent, separator);<NEW_LINE>} else // between logic<NEW_LINE>if (Column.LOGIC_BETWEEN.equals(curent.getLogic()) || Column.LOGIC_NOT_BETWEEN.equals(curent.getLogic())) {<NEW_LINE>appendLinkString(sqlBuilder, before);<NEW_LINE>appendBetweenLogic(sqlBuilder, curent, separator);<NEW_LINE>} else // others<NEW_LINE>{<NEW_LINE>appendLinkString(sqlBuilder, before);<NEW_LINE><MASK><NEW_LINE>if (curent.hasPara()) {<NEW_LINE>sqlBuilder.append('?');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
appendColumnName(sqlBuilder, curent, separator);
1,352,905
public Frequency unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Frequency frequency = new Frequency();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("units", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>frequency.setUnits(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("value", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>frequency.setValue(context.getUnmarshaller(Double.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 frequency;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,208,396
private static byte[] compose(Object value, Class clazz, Class<?> mapGenericClassses) {<NEW_LINE>Class<?> valueValidationClass = CassandraValidationClassMapper.getValidationClassInstance(mapGenericClassses, true);<NEW_LINE>Object valueClassInstance;<NEW_LINE>try {<NEW_LINE>valueClassInstance = valueValidationClass.getDeclaredField<MASK><NEW_LINE>// false added after 2.1.3 upgrade (isMulticell check)<NEW_LINE>SetType setType = SetType.getInstance((AbstractType) valueClassInstance, false);<NEW_LINE>return setType.decompose((Set) value).array();<NEW_LINE>} catch (NoSuchFieldException e) {<NEW_LINE>log.error("Error while retrieving field{} value via CQL, Caused by: .", clazz.getSimpleName(), e);<NEW_LINE>throw new PersistenceException(e);<NEW_LINE>} catch (SecurityException e) {<NEW_LINE>log.error("Error while retrieving field{} value via CQL, Caused by: .", clazz.getSimpleName(), e);<NEW_LINE>throw new PersistenceException(e);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>log.error("Error while retrieving field{} value via CQL, Caused by: .", clazz.getSimpleName(), e);<NEW_LINE>throw new PersistenceException(e);<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>log.error("Error while retrieving field{} value via CQL, Caused by: .", clazz.getSimpleName(), e);<NEW_LINE>throw new PersistenceException(e);<NEW_LINE>}<NEW_LINE>}
("instance").get(null);
329,940
public void recordComment(int token) {<NEW_LINE>// compute position<NEW_LINE>int commentStart = this.startPosition;<NEW_LINE>int stopPosition = this.currentPosition;<NEW_LINE>switch(token) {<NEW_LINE>case TokenNameCOMMENT_LINE:<NEW_LINE>// both positions are negative<NEW_LINE>commentStart = -this.startPosition;<NEW_LINE>stopPosition = -this.lastCommentLinePosition;<NEW_LINE>break;<NEW_LINE>case TokenNameCOMMENT_BLOCK:<NEW_LINE>// only end position is negative<NEW_LINE>stopPosition = -this.currentPosition;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// a new comment is recorded<NEW_LINE>int length = this.commentStops.length;<NEW_LINE>if (++this.commentPtr >= length) {<NEW_LINE>int newLength = length + COMMENT_ARRAYS_SIZE * 10;<NEW_LINE>System.arraycopy(this.commentStops, 0, this.commentStops = new int[newLength], 0, length);<NEW_LINE>System.arraycopy(this.commentStarts, 0, this.commentStarts = new int[newLength], 0, length);<NEW_LINE>System.arraycopy(this.commentTagStarts, 0, this.commentTagStarts = new int<MASK><NEW_LINE>}<NEW_LINE>this.commentStops[this.commentPtr] = stopPosition;<NEW_LINE>this.commentStarts[this.commentPtr] = commentStart;<NEW_LINE>}
[newLength], 0, length);
671,807
private Object[] parseListener(Element element) {<NEW_LINE>Object[] ret = new Object[2];<NEW_LINE>BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(MessageListenerAdapter.class);<NEW_LINE>builder.addConstructorArgReference<MASK><NEW_LINE>String method = element.getAttribute("method");<NEW_LINE>if (StringUtils.hasText(method)) {<NEW_LINE>builder.addPropertyValue("defaultListenerMethod", method);<NEW_LINE>}<NEW_LINE>String serializer = element.getAttribute("serializer");<NEW_LINE>if (StringUtils.hasText(serializer)) {<NEW_LINE>builder.addPropertyReference("serializer", serializer);<NEW_LINE>}<NEW_LINE>// assemble topics<NEW_LINE>Collection<Topic> topics = new ArrayList<>();<NEW_LINE>// get topic<NEW_LINE>String xTopics = element.getAttribute("topic");<NEW_LINE>if (StringUtils.hasText(xTopics)) {<NEW_LINE>String[] array = StringUtils.delimitedListToStringArray(xTopics, " ");<NEW_LINE>for (String string : array) {<NEW_LINE>topics.add(string.contains("*") ? new PatternTopic(string) : new ChannelTopic(string));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ret[0] = builder.getBeanDefinition();<NEW_LINE>ret[1] = topics;<NEW_LINE>return ret;<NEW_LINE>}
(element.getAttribute("ref"));
1,067,081
private static void validateClientRedirectUris(String rootUrl, Set<String> redirectUris) throws ProtocolMapperConfigException {<NEW_LINE>Set<String> <MASK><NEW_LINE>for (String redirectUri : PairwiseSubMapperUtils.resolveValidRedirectUris(rootUrl, redirectUris)) {<NEW_LINE>try {<NEW_LINE>URI uri = new URI(redirectUri);<NEW_LINE>hosts.add(uri.getHost());<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>throw new ProtocolMapperConfigException("Client contained an invalid redirect URI.", PAIRWISE_MALFORMED_CLIENT_REDIRECT_URI, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hosts.isEmpty()) {<NEW_LINE>throw new ProtocolMapperConfigException("Client redirect URIs must contain a valid host component.", PAIRWISE_CLIENT_REDIRECT_URIS_MISSING_HOST);<NEW_LINE>}<NEW_LINE>if (hosts.size() > 1) {<NEW_LINE>throw new ProtocolMapperConfigException("Without a configured Sector Identifier URI, client redirect URIs must not contain multiple host components.", PAIRWISE_CLIENT_REDIRECT_URIS_MULTIPLE_HOSTS);<NEW_LINE>}<NEW_LINE>}
hosts = new HashSet<>();
1,782,372
protected EnumMap<KeyIndex, String> initContentProviderKeys() {<NEW_LINE>EnumMap<KeyIndex, String> keys = new EnumMap<KeyIndex, String>(KeyIndex.class);<NEW_LINE>keys.put(KeyIndex.CALENDARS_ID, Calendars._ID);<NEW_LINE>keys.put(KeyIndex.IS_PRIMARY, Calendars.IS_PRIMARY);<NEW_LINE>keys.put(KeyIndex.CALENDARS_NAME, Calendars.NAME);<NEW_LINE>keys.put(KeyIndex.CALENDARS_DISPLAY_NAME, Calendars.CALENDAR_DISPLAY_NAME);<NEW_LINE>keys.put(KeyIndex.CALENDARS_VISIBLE, Calendars.VISIBLE);<NEW_LINE>keys.put(KeyIndex.EVENTS_ID, Events._ID);<NEW_LINE>keys.put(KeyIndex.EVENTS_CALENDAR_ID, Events.CALENDAR_ID);<NEW_LINE>keys.put(KeyIndex.EVENTS_DESCRIPTION, Events.DESCRIPTION);<NEW_LINE>keys.put(KeyIndex.EVENTS_LOCATION, Events.EVENT_LOCATION);<NEW_LINE>keys.put(KeyIndex.EVENTS_SUMMARY, Events.TITLE);<NEW_LINE>keys.put(KeyIndex.EVENTS_START, Events.DTSTART);<NEW_LINE>keys.put(KeyIndex.EVENTS_END, Events.DTEND);<NEW_LINE>keys.put(KeyIndex.EVENTS_RRULE, Events.RRULE);<NEW_LINE>keys.put(KeyIndex.EVENTS_ALL_DAY, Events.ALL_DAY);<NEW_LINE>keys.put(KeyIndex.INSTANCES_ID, Instances._ID);<NEW_LINE>keys.put(KeyIndex.INSTANCES_EVENT_ID, Instances.EVENT_ID);<NEW_LINE>keys.put(<MASK><NEW_LINE>keys.put(KeyIndex.INSTANCES_END, Instances.END);<NEW_LINE>keys.put(KeyIndex.ATTENDEES_ID, Attendees._ID);<NEW_LINE>keys.put(KeyIndex.ATTENDEES_EVENT_ID, Attendees.EVENT_ID);<NEW_LINE>keys.put(KeyIndex.ATTENDEES_NAME, Attendees.ATTENDEE_NAME);<NEW_LINE>keys.put(KeyIndex.ATTENDEES_EMAIL, Attendees.ATTENDEE_EMAIL);<NEW_LINE>keys.put(KeyIndex.ATTENDEES_STATUS, Attendees.ATTENDEE_STATUS);<NEW_LINE>return keys;<NEW_LINE>}
KeyIndex.INSTANCES_BEGIN, Instances.BEGIN);
1,645,364
public void visitLocal(EclipseNode localNode, LocalDeclaration local) {<NEW_LINE>TypeReference type = local.type;<NEW_LINE>boolean isVal = typeMatches(val.class, localNode, type);<NEW_LINE>boolean isVar = typeMatches(<MASK><NEW_LINE>if (!(isVal || isVar))<NEW_LINE>return;<NEW_LINE>if (isVal)<NEW_LINE>handleFlagUsage(localNode, ConfigurationKeys.VAL_FLAG_USAGE, "val");<NEW_LINE>if (isVar)<NEW_LINE>handleFlagUsage(localNode, ConfigurationKeys.VAR_FLAG_USAGE, "var");<NEW_LINE>boolean variableOfForEach = false;<NEW_LINE>if (localNode.directUp().get() instanceof ForeachStatement) {<NEW_LINE>ForeachStatement fs = (ForeachStatement) localNode.directUp().get();<NEW_LINE>variableOfForEach = fs.elementVariable == local;<NEW_LINE>}<NEW_LINE>String annotation = isVal ? "val" : "var";<NEW_LINE>if (local.initialization == null && !variableOfForEach) {<NEW_LINE>localNode.addError("'" + annotation + "' on a local variable requires an initializer expression");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (local.initialization instanceof ArrayInitializer) {<NEW_LINE>localNode.addError("'" + annotation + "' is not compatible with array initializer expressions. Use the full form (new int[] { ... } instead of just { ... })");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ASTNode parentRaw = localNode.directUp().get();<NEW_LINE>if (isVal && parentRaw instanceof ForStatement) {<NEW_LINE>localNode.addError("'val' is not allowed in old-style for loops");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (parentRaw instanceof ForStatement && ((ForStatement) parentRaw).initializations != null && ((ForStatement) parentRaw).initializations.length > 1) {<NEW_LINE>localNode.addError("'var' is not allowed in old-style for loops if there is more than 1 initializer");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (local.initialization != null && local.initialization.getClass().getName().equals("org.eclipse.jdt.internal.compiler.ast.LambdaExpression")) {<NEW_LINE>localNode.addError("'" + annotation + "' is not allowed with lambda expressions.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isVar && local.initialization instanceof NullLiteral) {<NEW_LINE>localNode.addError("variable initializer is 'null'");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}
var.class, localNode, type);
1,347,521
public <T> void addValueCallback(T property, @Nullable LottieValueCallback<T> callback) {<NEW_LINE>if (property == LottieProperty.OPACITY) {<NEW_LINE>opacityAnimation.setValueCallback((LottieValueCallback<Integer>) callback);<NEW_LINE>} else if (property == LottieProperty.COLOR_FILTER) {<NEW_LINE>if (colorFilterAnimation != null) {<NEW_LINE>layer.removeAnimation(colorFilterAnimation);<NEW_LINE>}<NEW_LINE>if (callback == null) {<NEW_LINE>colorFilterAnimation = null;<NEW_LINE>} else {<NEW_LINE>colorFilterAnimation = new ValueCallbackKeyframeAnimation<>((LottieValueCallback<ColorFilter>) callback);<NEW_LINE>colorFilterAnimation.addUpdateListener(this);<NEW_LINE>layer.addAnimation(colorFilterAnimation);<NEW_LINE>}<NEW_LINE>} else if (property == LottieProperty.GRADIENT_COLOR) {<NEW_LINE>if (colorCallbackAnimation != null) {<NEW_LINE>layer.removeAnimation(colorCallbackAnimation);<NEW_LINE>}<NEW_LINE>if (callback == null) {<NEW_LINE>colorCallbackAnimation = null;<NEW_LINE>} else {<NEW_LINE>linearGradientCache.clear();<NEW_LINE>radialGradientCache.clear();<NEW_LINE>colorCallbackAnimation = new ValueCallbackKeyframeAnimation<>(callback);<NEW_LINE>colorCallbackAnimation.addUpdateListener(this);<NEW_LINE>layer.addAnimation(colorCallbackAnimation);<NEW_LINE>}<NEW_LINE>} else if (property == LottieProperty.BLUR_RADIUS) {<NEW_LINE>if (blurAnimation != null) {<NEW_LINE>blurAnimation.setValueCallback((LottieValueCallback<Float>) callback);<NEW_LINE>} else {<NEW_LINE>blurAnimation = new ValueCallbackKeyframeAnimation<>((LottieValueCallback<Float>) callback);<NEW_LINE>blurAnimation.addUpdateListener(this);<NEW_LINE>layer.addAnimation(blurAnimation);<NEW_LINE>}<NEW_LINE>} else if (property == LottieProperty.DROP_SHADOW_COLOR && dropShadowAnimation != null) {<NEW_LINE>dropShadowAnimation.setColorCallback(<MASK><NEW_LINE>} else if (property == LottieProperty.DROP_SHADOW_OPACITY && dropShadowAnimation != null) {<NEW_LINE>dropShadowAnimation.setOpacityCallback((LottieValueCallback<Float>) callback);<NEW_LINE>} else if (property == LottieProperty.DROP_SHADOW_DIRECTION && dropShadowAnimation != null) {<NEW_LINE>dropShadowAnimation.setDirectionCallback((LottieValueCallback<Float>) callback);<NEW_LINE>} else if (property == LottieProperty.DROP_SHADOW_DISTANCE && dropShadowAnimation != null) {<NEW_LINE>dropShadowAnimation.setDistanceCallback((LottieValueCallback<Float>) callback);<NEW_LINE>} else if (property == LottieProperty.DROP_SHADOW_RADIUS && dropShadowAnimation != null) {<NEW_LINE>dropShadowAnimation.setRadiusCallback((LottieValueCallback<Float>) callback);<NEW_LINE>}<NEW_LINE>}
(LottieValueCallback<Integer>) callback);
991,368
private void validateStaticIp(String sysTag) {<NEW_LINE>Map<String, String> token = TagUtils.parse(VmSystemTags.STATIC_IP.getTagFormat(), sysTag);<NEW_LINE>String l3Uuid = token.get(VmSystemTags.STATIC_IP_L3_UUID_TOKEN);<NEW_LINE>if (!dbf.isExist(l3Uuid, L3NetworkVO.class)) {<NEW_LINE>throw new ApiMessageInterceptionException(argerr<MASK><NEW_LINE>}<NEW_LINE>String ip = token.get(VmSystemTags.STATIC_IP_TOKEN);<NEW_LINE>ip = IPv6NetworkUtils.ipv6TagValueToAddress(ip);<NEW_LINE>if (!NetworkUtils.isIpv4Address(ip) && !IPv6NetworkUtils.isIpv6Address(ip)) {<NEW_LINE>throw new ApiMessageInterceptionException(argerr("%s is not a valid ip address. Please correct your system tag[%s] of static IP", ip, sysTag));<NEW_LINE>}<NEW_LINE>CheckIpAvailabilityMsg cmsg = new CheckIpAvailabilityMsg();<NEW_LINE>cmsg.setIp(ip);<NEW_LINE>cmsg.setL3NetworkUuid(l3Uuid);<NEW_LINE>bus.makeLocalServiceId(cmsg, L3NetworkConstant.SERVICE_ID);<NEW_LINE>MessageReply r = bus.call(cmsg);<NEW_LINE>if (!r.isSuccess()) {<NEW_LINE>throw new ApiMessageInterceptionException(inerr(r.getError().getDetails()));<NEW_LINE>}<NEW_LINE>CheckIpAvailabilityReply cr = r.castReply();<NEW_LINE>if (!cr.isAvailable()) {<NEW_LINE>throw new ApiMessageInterceptionException(operr("IP[%s] is not available on the L3 network[uuid:%s] because: %s", ip, l3Uuid, cr.getReason()));<NEW_LINE>}<NEW_LINE>}
("L3 network[uuid:%s] not found. Please correct your system tag[%s] of static IP", l3Uuid, sysTag));
939,590
final DeleteIntentVersionResult executeDeleteIntentVersion(DeleteIntentVersionRequest deleteIntentVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteIntentVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteIntentVersionRequest> request = null;<NEW_LINE>Response<DeleteIntentVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteIntentVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteIntentVersionRequest));<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, "Lex Model Building Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteIntentVersion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteIntentVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteIntentVersionResultJsonUnmarshaller());<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);
373,788
protected void processReport(File report) {<NEW_LINE>try {<NEW_LINE>var parser = new StaxParser((SMHierarchicCursor rootCursor) -> {<NEW_LINE>try {<NEW_LINE>rootCursor.advance();<NEW_LINE>} catch (com.ctc.wstx.exc.WstxEOFException e) {<NEW_LINE>throw new EmptyReportException("The 'Vera++' report is empty", e);<NEW_LINE>}<NEW_LINE>SMInputCursor fileCursor = rootCursor.childElementCursor("file");<NEW_LINE>while (fileCursor.getNext() != null) {<NEW_LINE>String name = fileCursor.getAttrValue("name");<NEW_LINE>SMInputCursor errorCursor = fileCursor.childElementCursor("error");<NEW_LINE>while (errorCursor.getNext() != null) {<NEW_LINE>if (!"error".equals(name)) {<NEW_LINE>String line = errorCursor.getAttrValue("line");<NEW_LINE>String message = errorCursor.getAttrValue("message");<NEW_LINE>String source = errorCursor.getAttrValue("source");<NEW_LINE>var issue = new CxxReportIssue(source, name, line, null, message);<NEW_LINE>saveUniqueViolation(issue);<NEW_LINE>} else {<NEW_LINE>LOG.debug("Error in file '{}', with message '{}'", name + "(" + errorCursor.getAttrValue("line") + ")"<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>parser.parse(report);<NEW_LINE>} catch (XMLStreamException e) {<NEW_LINE>throw new InvalidReportException("The 'Vera++' report is invalid", e);<NEW_LINE>}<NEW_LINE>}
, errorCursor.getAttrValue("message"));
1,447,714
private void indexUids(List<String> uids) throws MessagingException, IOException {<NEW_LINE>Set<String> unindexedUids = new HashSet<>();<NEW_LINE>for (String uid : uids) {<NEW_LINE>if (uidToMsgMap.get(uid) == null) {<NEW_LINE>if (K9MailLib.isDebug() && DEBUG_PROTOCOL_POP3) {<NEW_LINE>Timber.d("Need to index UID %s", uid);<NEW_LINE>}<NEW_LINE>unindexedUids.add(uid);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (unindexedUids.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>connection.executeSimpleCommand(UIDL_COMMAND);<NEW_LINE>String response;<NEW_LINE>while ((response = connection.readLine()) != null) {<NEW_LINE>if (response.equals(".")) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>String[] uidParts = response.split(" +");<NEW_LINE>// Ignore messages without a unique-id<NEW_LINE>if (uidParts.length >= 2) {<NEW_LINE>Integer msgNum = Integer<MASK><NEW_LINE>String msgUid = uidParts[1];<NEW_LINE>if (unindexedUids.contains(msgUid)) {<NEW_LINE>if (K9MailLib.isDebug() && DEBUG_PROTOCOL_POP3) {<NEW_LINE>Timber.d("Got msgNum %d for UID %s", msgNum, msgUid);<NEW_LINE>}<NEW_LINE>Pop3Message message = uidToMsgMap.get(msgUid);<NEW_LINE>if (message == null) {<NEW_LINE>message = new Pop3Message(msgUid);<NEW_LINE>}<NEW_LINE>indexMessage(msgNum, message);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.valueOf(uidParts[0]);
1,426,795
// rejectIt<NEW_LINE>@Override<NEW_LINE>public String completeIt() {<NEW_LINE>// Re-Check<NEW_LINE>if (!m_justPrepared) {<NEW_LINE>String status = prepareIt();<NEW_LINE>if (!IDocument.STATUS_InProgress.equals(status))<NEW_LINE>return status;<NEW_LINE>}<NEW_LINE>m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_COMPLETE);<NEW_LINE>if (m_processMsg != null)<NEW_LINE>return IDocument.STATUS_Invalid;<NEW_LINE>// Implicit Approval<NEW_LINE>if (!isApproved())<NEW_LINE>approveIt();<NEW_LINE>log.debug("Completed: {}", this);<NEW_LINE>//<NEW_LINE>MInOut inout = new MInOut(getCtx(), getM_InOut_ID(), get_TrxName());<NEW_LINE>MInOutLineConfirm[] lines = getLines(false);<NEW_LINE>// Check if we need to split Shipment<NEW_LINE>if (isInDispute()) {<NEW_LINE>MDocType dt = MDocType.get(getCtx(), inout.getC_DocType_ID());<NEW_LINE>if (dt.isSplitWhenDifference()) {<NEW_LINE>if (dt.getC_DocTypeDifference_ID() == 0) {<NEW_LINE>m_processMsg = "No Split Document Type defined for: " + dt.getName();<NEW_LINE>return IDocument.STATUS_Invalid;<NEW_LINE>}<NEW_LINE>splitInOut(inout, dt.getC_DocTypeDifference_ID(), lines);<NEW_LINE>m_lines = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// All lines<NEW_LINE>for (MInOutLineConfirm line : lines) {<NEW_LINE>MInOutLineConfirm confirmLine = line;<NEW_LINE>confirmLine.set_TrxName(get_TrxName());<NEW_LINE>if (!confirmLine.processLine(inout.isSOTrx(), getConfirmType())) {<NEW_LINE>m_processMsg = "ShipLine not saved - " + confirmLine;<NEW_LINE>return IDocument.STATUS_Invalid;<NEW_LINE>}<NEW_LINE>if (confirmLine.isFullyConfirmed()) {<NEW_LINE>confirmLine.setProcessed(true);<NEW_LINE>confirmLine.saveEx();<NEW_LINE>} else {<NEW_LINE>if (createDifferenceDoc(inout, confirmLine)) {<NEW_LINE>confirmLine.setProcessed(true);<NEW_LINE>confirmLine.saveEx();<NEW_LINE>} else {<NEW_LINE>log.error("Scrapped=" + confirmLine.getScrappedQty() + " - Difference=" + confirmLine.getDifferenceQty());<NEW_LINE>return IDocument.STATUS_Invalid;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// for all lines<NEW_LINE>if (m_creditMemo != null)<NEW_LINE>m_processMsg += " @C_Invoice_ID@=" + m_creditMemo.getDocumentNo();<NEW_LINE>if (m_inventory != null)<NEW_LINE>m_processMsg += " @M_Inventory_ID@=" + m_inventory.getDocumentNo();<NEW_LINE>// Try to complete Shipment<NEW_LINE>// if (inout.processIt(DocAction.ACTION_Complete))<NEW_LINE>// m_processMsg = "@M_InOut_ID@ " + inout.getDocumentNo() + ": @Completed@";<NEW_LINE>// User Validation<NEW_LINE>String valid = ModelValidationEngine.get().<MASK><NEW_LINE>if (valid != null) {<NEW_LINE>m_processMsg = valid;<NEW_LINE>return IDocument.STATUS_Invalid;<NEW_LINE>}<NEW_LINE>setProcessed(true);<NEW_LINE>setDocAction(DOCACTION_Close);<NEW_LINE>return IDocument.STATUS_Completed;<NEW_LINE>}
fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE);
629,284
public void populateItem(final Item<FilestoreModel> item) {<NEW_LINE>final FilestoreModel entry = item.getModelObject();<NEW_LINE>DateFormat dateFormater <MASK><NEW_LINE>UserModel user = app().users().getUserModel(entry.getChangedBy());<NEW_LINE>user = user == null ? UserModel.ANONYMOUS : user;<NEW_LINE>Label icon = FilestoreUI.getStatusIcon("status", entry);<NEW_LINE>item.add(icon);<NEW_LINE>item.add(new Label("on", dateFormater.format(entry.getChangedOn())));<NEW_LINE>item.add(new Label("by", user.getDisplayName()));<NEW_LINE>item.add(new Label("oid", entry.oid));<NEW_LINE>item.add(new Label("size", FileUtils.byteCountToDisplaySize(entry.getSize())));<NEW_LINE>WicketUtils.setAlternatingBackground(item, counter);<NEW_LINE>counter++;<NEW_LINE>}
= new SimpleDateFormat(Constants.ISO8601);
1,074,576
private List<NameValueCountPair> groupByCreatorUnit(Business business, Predicate predicate) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Review.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Tuple> cq = cb.createQuery(Tuple.class);<NEW_LINE>Root<Review> root = cq.from(Review.class);<NEW_LINE>Path<String> pathCreatorUnit = root.get(Review_.creatorUnit);<NEW_LINE>cq.multiselect(pathCreatorUnit, cb.count(root)).where<MASK><NEW_LINE>List<Tuple> os = em.createQuery(cq).getResultList();<NEW_LINE>List<NameValueCountPair> list = new ArrayList<>();<NEW_LINE>NameValueCountPair pair = null;<NEW_LINE>for (Tuple o : os) {<NEW_LINE>pair = new NameValueCountPair();<NEW_LINE>pair.setName(o.get(pathCreatorUnit));<NEW_LINE>pair.setValue(o.get(pathCreatorUnit));<NEW_LINE>pair.setCount(o.get(1, Long.class));<NEW_LINE>list.add(pair);<NEW_LINE>}<NEW_LINE>return list.stream().sorted(Comparator.comparing(NameValueCountPair::getCount).reversed()).collect(Collectors.toList());<NEW_LINE>}
(predicate).groupBy(pathCreatorUnit);
730,605
protected boolean doAppend(List<InstanceEvent> events) {<NEW_LINE>if (events.isEmpty()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>InstanceId id = events.get(0).getInstance();<NEW_LINE>if (!events.stream().allMatch(event -> event.getInstance().equals(id))) {<NEW_LINE>throw new IllegalArgumentException("'events' must only refer to the same instance.");<NEW_LINE>}<NEW_LINE>List<InstanceEvent> oldEvents = eventLog.computeIfAbsent(id, (key) -> new ArrayList<>(maxLogSizePerAggregate + 1));<NEW_LINE>long lastVersion = getLastVersion(oldEvents);<NEW_LINE>if (lastVersion >= events.get(0).getVersion()) {<NEW_LINE>throw createOptimisticLockException(events.get(0), lastVersion);<NEW_LINE>}<NEW_LINE>List<InstanceEvent> newEvents = new ArrayList<>(oldEvents);<NEW_LINE>newEvents.addAll(events);<NEW_LINE>if (newEvents.size() > maxLogSizePerAggregate) {<NEW_LINE>log.debug("Threshold for {} reached. Compacting events", id);<NEW_LINE>compact(newEvents);<NEW_LINE>}<NEW_LINE>if (eventLog.replace(id, oldEvents, newEvents)) {<NEW_LINE><MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>log.debug("Unsuccessful attempot append the events {} ", events);<NEW_LINE>return false;<NEW_LINE>}
log.debug("Events appended to log {}", events);
1,119,978
private void maybeDumpSourceFiles(TaskEvent e) {<NEW_LINE>JavacProcessingEnvironment jpe = JavacProcessingEnvironment.instance(JavacPlugin.instance().getContext());<NEW_LINE>Map<String, String> options = jpe.getOptions();<NEW_LINE>if (options == null) {<NEW_LINE>// no command line -A options<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String target = options.get(MANIFOLD_SOURCE_TARGET);<NEW_LINE>if (target == null || target.isEmpty()) {<NEW_LINE>// no "manifold.source.target" directory is specified (usually it isn't)<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JavaFileObject sourceFile = e.getSourceFile();<NEW_LINE>if (_dumpedSourceFiles.contains(sourceFile.toUri())) {<NEW_LINE>// already handled<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>_dumpedSourceFiles.add(sourceFile.toUri());<NEW_LINE>if (sourceFile instanceof GeneratedJavaStubFileObject && !((GeneratedJavaStubFileObject) sourceFile).isPrimary()) {<NEW_LINE>// the source file is an extended class like java.lang.String, do not write these out<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CharSequence source = ManParserFactory.getSource(sourceFile);<NEW_LINE>if (source == null) {<NEW_LINE>try {<NEW_LINE>source = sourceFile.getCharContent(true);<NEW_LINE>} catch (Exception ee) {<NEW_LINE>// for whatever reason there is no source available for this file,<NEW_LINE>// shouldn't really ever happen, regardless don't let this kill a build<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (source != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
dumpSourceFile(target, sourceFile, source);
1,834,035
public static List<RegressionExecution> executions() {<NEW_LINE>List<RegressionExecution> <MASK><NEW_LINE>execs.add(new EPLSubselectUnfilteredExpression());<NEW_LINE>execs.add(new EPLSubselectUnfilteredUnlimitedStream());<NEW_LINE>execs.add(new EPLSubselectUnfilteredLengthWindow());<NEW_LINE>execs.add(new EPLSubselectUnfilteredAsAfterSubselect());<NEW_LINE>execs.add(new EPLSubselectUnfilteredWithAsWithinSubselect());<NEW_LINE>execs.add(new EPLSubselectUnfilteredNoAs());<NEW_LINE>execs.add(new EPLSubselectUnfilteredLastEvent());<NEW_LINE>execs.add(new EPLSubselectStartStopStatement());<NEW_LINE>execs.add(new EPLSubselectSelfSubselect());<NEW_LINE>execs.add(new EPLSubselectComputedResult());<NEW_LINE>execs.add(new EPLSubselectFilterInside());<NEW_LINE>execs.add(new EPLSubselectWhereClauseWithExpression());<NEW_LINE>execs.add(new EPLSubselectCustomFunction());<NEW_LINE>execs.add(new EPLSubselectUnfilteredStreamPriorOM());<NEW_LINE>execs.add(new EPLSubselectUnfilteredStreamPriorCompile());<NEW_LINE>execs.add(new EPLSubselectTwoSubqSelect());<NEW_LINE>execs.add(new EPLSubselectWhereClauseReturningTrue());<NEW_LINE>execs.add(new EPLSubselectJoinUnfiltered());<NEW_LINE>execs.add(new EPLSubselectInvalidSubselect());<NEW_LINE>return execs;<NEW_LINE>}
execs = new ArrayList<>();
425,408
@Trivial<NEW_LINE>protected Class<?> findOrDelegateLoadClass(String className, boolean onlySearchSelf, boolean returnNull) throws ClassNotFoundException {<NEW_LINE>ClassNotFoundException findClassException = null;<NEW_LINE>// search order: 1) my class path 2) parent loader<NEW_LINE>Class<?> rc;<NEW_LINE>// first check whether we already loaded this class<NEW_LINE>rc = findLoadedClass(className);<NEW_LINE>if (rc != null) {<NEW_LINE>return rc;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// first check our classpath<NEW_LINE>rc = findClass(className, returnNull);<NEW_LINE>if (rc != null) {<NEW_LINE>return rc;<NEW_LINE>}<NEW_LINE>} catch (ClassNotFoundException cnfe) {<NEW_LINE>findClassException = cnfe;<NEW_LINE>}<NEW_LINE>// See if we can generate the class here before<NEW_LINE>// checking the parent:<NEW_LINE>Class<<MASK><NEW_LINE>if (generatedClass != null)<NEW_LINE>return generatedClass;<NEW_LINE>// no luck? try the parent next unless we are only checking ourself<NEW_LINE>if (onlySearchSelf) {<NEW_LINE>if (returnNull) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>throw findClassException;<NEW_LINE>}<NEW_LINE>if (this.parent instanceof NoClassNotFoundLoader) {<NEW_LINE>rc = ((NoClassNotFoundLoader) this.parent).loadClassNoException(className);<NEW_LINE>if (rc != null || returnNull) {<NEW_LINE>return rc;<NEW_LINE>}<NEW_LINE>throw findClassException;<NEW_LINE>}<NEW_LINE>if (returnNull) {<NEW_LINE>try {<NEW_LINE>return this.parent.loadClass(className);<NEW_LINE>} catch (ClassNotFoundException cnfe) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return this.parent.loadClass(className);<NEW_LINE>}
?> generatedClass = generateClass(className);
1,339,407
protected void estimateCase2(double[] betas) {<NEW_LINE>x.reshape(3, 1, false);<NEW_LINE>if (numControl == 4) {<NEW_LINE>L.reshape(6, 3, false);<NEW_LINE>UtilLepetitEPnP.constraintMatrix6x3(L_full, L);<NEW_LINE>} else {<NEW_LINE>L.reshape(3, 3, false);<NEW_LINE>UtilLepetitEPnP.constraintMatrix3x3(L_full, L);<NEW_LINE>}<NEW_LINE>if (!solver.setA(L))<NEW_LINE>throw new RuntimeException("Oh crap");<NEW_LINE><MASK><NEW_LINE>betas[0] = Math.sqrt(Math.abs(x.get(0)));<NEW_LINE>betas[1] = Math.sqrt(Math.abs(x.get(2)));<NEW_LINE>betas[1] *= Math.signum(x.get(0)) * Math.signum(x.get(1));<NEW_LINE>betas[2] = 0;<NEW_LINE>betas[3] = 0;<NEW_LINE>refine(betas);<NEW_LINE>}
solver.solve(y, x);
501,429
public void ready() {<NEW_LINE>if (initiating) {<NEW_LINE>initiating = false;<NEW_LINE>processingReady = false;<NEW_LINE>if (firstInit) {<NEW_LINE>firstInit = false;<NEW_LINE>if (// Show large warning when connected to >=2000 guilds<NEW_LINE>api.getGuilds().size() >= 2000) {<NEW_LINE>JDAImpl.LOG.warn(" __ __ _ ___ _ _ ___ _ _ ___ _ ");<NEW_LINE>JDAImpl.LOG.warn(" \\ \\ / //_\\ | _ \\| \\| ||_ _|| \\| | / __|| |");<NEW_LINE>JDAImpl.LOG.warn(" \\ \\/\\/ // _ \\ | /| .` | | | | .` || (_ ||_|");<NEW_LINE>JDAImpl.LOG.warn(" \\_/\\_//_/ \\_\\|_|_\\|_|\\_||___||_|\\_| \\___|(_)");<NEW_LINE>JDAImpl.LOG.warn("You're running a session with over 2000 connected");<NEW_LINE>JDAImpl.LOG.warn("guilds. You should shard the connection in order");<NEW_LINE>JDAImpl.LOG.warn("to split the load or things like resuming");<NEW_LINE>JDAImpl.LOG.warn("connection might not work as expected.");<NEW_LINE>JDAImpl.LOG.warn("For more info see https://git.io/vrFWP");<NEW_LINE>}<NEW_LINE>JDAImpl.LOG.info("Finished Loading!");<NEW_LINE>api.handleEvent(new ReadyEvent(api, api.getResponseTotal()));<NEW_LINE>} else {<NEW_LINE>updateAudioManagerReferences();<NEW_LINE>JDAImpl.LOG.info("Finished (Re)Loading!");<NEW_LINE>api.handleEvent(new ReconnectedEvent(api, api.getResponseTotal()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>JDAImpl.LOG.debug("Successfully resumed Session!");<NEW_LINE>api.handleEvent(new ResumedEvent(api<MASK><NEW_LINE>}<NEW_LINE>api.setStatus(JDA.Status.CONNECTED);<NEW_LINE>}
, api.getResponseTotal()));
1,220,359
protected void encodeInputField(FacesContext context, FileUpload fileUpload, String clientId, String tabIndex) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String inputId = clientId + "_input";<NEW_LINE>writer.startElement("input", null);<NEW_LINE>writer.writeAttribute("type", "file", null);<NEW_LINE>writer.writeAttribute("id", inputId, null);<NEW_LINE>writer.writeAttribute("name", inputId, null);<NEW_LINE>writer.writeAttribute(HTML.ARIA_HIDDEN, "true", null);<NEW_LINE>if (LangUtils.isNotBlank(tabIndex)) {<NEW_LINE>writer.writeAttribute("tabindex", tabIndex, null);<NEW_LINE>}<NEW_LINE>if (fileUpload.isMultiple()) {<NEW_LINE>writer.writeAttribute("multiple", "multiple", null);<NEW_LINE>}<NEW_LINE>if (fileUpload.isDisabled()) {<NEW_LINE>writer.writeAttribute("disabled", "disabled", "disabled");<NEW_LINE>}<NEW_LINE>if (fileUpload.getAccept() != null) {<NEW_LINE>writer.writeAttribute("accept", <MASK><NEW_LINE>}<NEW_LINE>if (fileUpload.getTitle() != null) {<NEW_LINE>writer.writeAttribute("title", fileUpload.getTitle(), null);<NEW_LINE>}<NEW_LINE>renderDynamicPassThruAttributes(context, fileUpload);<NEW_LINE>writer.endElement("input");<NEW_LINE>}
fileUpload.getAccept(), null);
1,747,255
private void search(DataSet dataSet, Object learner, int minFeatures, int maxFeatures, int folds) {<NEW_LINE>Random rand = RandomUtil.getRandom();<NEW_LINE>int nF = dataSet.getNumFeatures();<NEW_LINE>int nCat = dataSet.getNumCategoricalVars();<NEW_LINE>Set<Integer> available = new IntSet();<NEW_LINE>ListUtils.addRange(<MASK><NEW_LINE>Set<Integer> catSelected = new IntSet(dataSet.getNumCategoricalVars());<NEW_LINE>Set<Integer> numSelected = new IntSet(dataSet.getNumNumericalVars());<NEW_LINE>Set<Integer> catToRemove = new IntSet(dataSet.getNumCategoricalVars());<NEW_LINE>Set<Integer> numToRemove = new IntSet(dataSet.getNumNumericalVars());<NEW_LINE>// Start will all selected, and prune them out<NEW_LINE>ListUtils.addRange(catSelected, 0, nCat, 1);<NEW_LINE>ListUtils.addRange(numSelected, 0, nF - nCat, 1);<NEW_LINE>double[] bestScore = new double[] { Double.POSITIVE_INFINITY };<NEW_LINE>while (catSelected.size() + numSelected.size() > minFeatures) {<NEW_LINE>if (SBSRemoveFeature(available, dataSet, catToRemove, numToRemove, catSelected, numSelected, learner, folds, rand, maxFeatures, bestScore, maxDecrease) < 0)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>int pos = 0;<NEW_LINE>catIndexMap = new int[catSelected.size()];<NEW_LINE>for (int i : catSelected) catIndexMap[pos++] = i;<NEW_LINE>Arrays.sort(catIndexMap);<NEW_LINE>pos = 0;<NEW_LINE>numIndexMap = new int[numSelected.size()];<NEW_LINE>for (int i : numSelected) numIndexMap[pos++] = i;<NEW_LINE>Arrays.sort(numIndexMap);<NEW_LINE>}
available, 0, nF, 1);
773,147
private static void tryAssertionNestedDotMethod(RegressionEnvironment env, boolean grouped, boolean soda, AtomicInteger milestone) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String eplDeclare = "@public create table varaggNDM (" + (grouped ? "key string primary key, " : "") + "windowSupportBean window(*) @type('SupportBean'))";<NEW_LINE>env.compileDeploy(soda, eplDeclare, path);<NEW_LINE>String eplInto = "into table varaggNDM " + "select window(*) as windowSupportBean from SupportBean#length(2)" + (grouped ? " group by theString" : "");<NEW_LINE>env.compileDeploy(soda, eplInto, path);<NEW_LINE>String key = grouped ? "[\"E1\"]" : "";<NEW_LINE>String eplSelect = "@name('s0') select " + "varaggNDM" + key + ".windowSupportBean.last(*).intPrimitive as c0, " + "varaggNDM" + key + ".windowSupportBean.window(*).countOf() as c1, " + "varaggNDM" + key + ".windowSupportBean.window(intPrimitive).take(1) as c2" + " from SupportBean_S0";<NEW_LINE>env.compileDeploy(soda, eplSelect<MASK><NEW_LINE>Object[][] expectedAggType = new Object[][] { { "c0", Integer.class }, { "c1", Integer.class }, { "c2", Collection.class } };<NEW_LINE>env.assertStatement("s0", statement -> SupportEventTypeAssertionUtil.assertEventTypeProperties(expectedAggType, statement.getEventType(), SupportEventTypeAssertionEnum.NAME, SupportEventTypeAssertionEnum.TYPE));<NEW_LINE>String[] fields = "c0,c1,c2".split(",");<NEW_LINE>makeSendBean(env, "E1", 10, 0);<NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 10, 1, Collections.singletonList(10) });<NEW_LINE>makeSendBean(env, "E1", 20, 0);<NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 20, 2, Collections.singletonList(10) });<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>makeSendBean(env, "E1", 30, 0);<NEW_LINE>env.sendEventBean(new SupportBean_S0(0));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 30, 2, Collections.singletonList(20) });<NEW_LINE>env.undeployAll();<NEW_LINE>}
, path).addListener("s0");
838,821
private Object constructObject(UserConfigurationDictionaryObjectType type, List<String> value, EwsServiceXmlReader reader) {<NEW_LINE>EwsUtilities.ewsAssert(value != null, "UserConfigurationDictionary.ConstructObject", "value is null");<NEW_LINE>EwsUtilities.ewsAssert((value.size() == 1 || type == UserConfigurationDictionaryObjectType.StringArray), "UserConfigurationDictionary.ConstructObject", "value is array but type is not StringArray");<NEW_LINE>EwsUtilities.ewsAssert(reader != null, "UserConfigurationDictionary.ConstructObject", "reader is null");<NEW_LINE>Object dictionaryObject = null;<NEW_LINE>if (type.equals(UserConfigurationDictionaryObjectType.Boolean)) {<NEW_LINE>dictionaryObject = Boolean.parseBoolean(value.get(0));<NEW_LINE>} else if (type.equals(UserConfigurationDictionaryObjectType.Byte)) {<NEW_LINE>dictionaryObject = Byte.parseByte(value.get(0));<NEW_LINE>} else if (type.equals(UserConfigurationDictionaryObjectType.ByteArray)) {<NEW_LINE>dictionaryObject = Base64.decodeBase64(value.get(0));<NEW_LINE>} else if (type.equals(UserConfigurationDictionaryObjectType.DateTime)) {<NEW_LINE>Date dateTime = DateTimeUtils.convertDateTimeStringToDate(value.get(0));<NEW_LINE>if (dateTime != null) {<NEW_LINE>dictionaryObject = dateTime;<NEW_LINE>} else {<NEW_LINE>EwsUtilities.ewsAssert(false, "UserConfigurationDictionary.ConstructObject", "DateTime is null");<NEW_LINE>}<NEW_LINE>} else if (type.equals(UserConfigurationDictionaryObjectType.Integer32)) {<NEW_LINE>dictionaryObject = Integer.parseInt<MASK><NEW_LINE>} else if (type.equals(UserConfigurationDictionaryObjectType.Integer64)) {<NEW_LINE>dictionaryObject = Long.parseLong(value.get(0));<NEW_LINE>} else if (type.equals(UserConfigurationDictionaryObjectType.String)) {<NEW_LINE>dictionaryObject = String.valueOf(value.get(0));<NEW_LINE>} else if (type.equals(UserConfigurationDictionaryObjectType.StringArray)) {<NEW_LINE>dictionaryObject = value.toArray();<NEW_LINE>} else if (type.equals(UserConfigurationDictionaryObjectType.UnsignedInteger32)) {<NEW_LINE>dictionaryObject = Integer.parseInt(value.get(0));<NEW_LINE>} else if (type.equals(UserConfigurationDictionaryObjectType.UnsignedInteger64)) {<NEW_LINE>dictionaryObject = Long.parseLong(value.get(0));<NEW_LINE>} else {<NEW_LINE>EwsUtilities.ewsAssert(false, "UserConfigurationDictionary.ConstructObject", "Type not recognized: " + type.toString());<NEW_LINE>}<NEW_LINE>return dictionaryObject;<NEW_LINE>}
(value.get(0));
1,494,885
private void loadFromFile(File targetIgnoreFile) {<NEW_LINE>if (targetIgnoreFile.exists() && targetIgnoreFile.isFile()) {<NEW_LINE>try {<NEW_LINE>loadCodegenRules(targetIgnoreFile);<NEW_LINE>this.ignoreFile = targetIgnoreFile;<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.error(String.format(Locale.ROOT, "Could not process %s.", targetIgnoreFile.getName()), e.getMessage());<NEW_LINE>}<NEW_LINE>} else if (!".swagger-codegen-ignore".equals(targetIgnoreFile.getName())) {<NEW_LINE>final File legacyIgnoreFile = new File(targetIgnoreFile.getParentFile(), ".swagger-codegen-ignore");<NEW_LINE>if (legacyIgnoreFile.exists() && legacyIgnoreFile.isFile()) {<NEW_LINE>LOGGER.info(String.format(Locale.ROOT, "Legacy support: '%s' file renamed to '%s'.", legacyIgnoreFile.getName()<MASK><NEW_LINE>try {<NEW_LINE>Files.move(legacyIgnoreFile.toPath(), targetIgnoreFile.toPath(), REPLACE_EXISTING);<NEW_LINE>loadFromFile(targetIgnoreFile);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.error(String.format(Locale.ROOT, "Could not rename file: %s", e.getMessage()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// log info message<NEW_LINE>LOGGER.info(String.format(Locale.ROOT, "No %s file found.", targetIgnoreFile.getName()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// log info message<NEW_LINE>LOGGER.info(String.format(Locale.ROOT, "No %s file found.", targetIgnoreFile.getName()));<NEW_LINE>}<NEW_LINE>}
, targetIgnoreFile.getName()));
771,434
public com.amazonaws.services.cognitoidp.model.UnsupportedOperationException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.cognitoidp.model.UnsupportedOperationException unsupportedOperationException = new com.amazonaws.services.cognitoidp.model.UnsupportedOperationException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return unsupportedOperationException;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,343,190
public List<WumpusAction> planShot(Set<Room> possibleWumpus, Set<Room> allowed) {<NEW_LINE>Set<AgentPosition> shootingPositions = new LinkedHashSet<>();<NEW_LINE>for (Room room : possibleWumpus) {<NEW_LINE>int x = room.getX();<NEW_LINE>int y = room.getY();<NEW_LINE>for (int i = 1; i <= kb.getCaveXDimension(); i++) {<NEW_LINE>if (i < x)<NEW_LINE>shootingPositions.add(new AgentPosition(i, y<MASK><NEW_LINE>if (i > x)<NEW_LINE>shootingPositions.add(new AgentPosition(i, y, AgentPosition.Orientation.FACING_WEST));<NEW_LINE>}<NEW_LINE>for (int i = 1; i <= kb.getCaveYDimension(); i++) {<NEW_LINE>if (i < y)<NEW_LINE>shootingPositions.add(new AgentPosition(x, i, AgentPosition.Orientation.FACING_NORTH));<NEW_LINE>if (i > y)<NEW_LINE>shootingPositions.add(new AgentPosition(x, i, AgentPosition.Orientation.FACING_SOUTH));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Can't have a shooting position from any of the rooms the wumpus could reside<NEW_LINE>for (Room room : possibleWumpus) for (AgentPosition.Orientation orientation : AgentPosition.Orientation.values()) shootingPositions.remove(new AgentPosition(room.getX(), room.getY(), orientation));<NEW_LINE>List<WumpusAction> actions = new ArrayList<>(planRoute(shootingPositions, allowed));<NEW_LINE>actions.add(WumpusAction.SHOOT);<NEW_LINE>return actions;<NEW_LINE>}
, AgentPosition.Orientation.FACING_EAST));
1,462,037
private SqlViewBinding createSqlViewBinding() {<NEW_LINE>// Get HU's standard entity descriptor. We will needed all over.<NEW_LINE>final DocumentEntityDescriptor huEntityDescriptor = getHUEntityDescriptor();<NEW_LINE>//<NEW_LINE>// Static where clause<NEW_LINE>final StringBuilder sqlWhereClause = new StringBuilder();<NEW_LINE>{<NEW_LINE>// top level<NEW_LINE>sqlWhereClause.append(I_M_HU.COLUMNNAME_M_HU_Item_Parent_ID + " is null");<NEW_LINE>// Consider window tab's where clause if any<NEW_LINE>final IADWindowDAO adWindowDAO = Services.get(IADWindowDAO.class);<NEW_LINE>final AdWindowId adWindowId = huEntityDescriptor.getWindowId().toAdWindowIdOrNull();<NEW_LINE>if (adWindowId != null) {<NEW_LINE>final String firstTabWhereClause = adWindowDAO.getFirstTabWhereClause(adWindowId);<NEW_LINE>if (Check.isNotBlank(firstTabWhereClause)) {<NEW_LINE>sqlWhereClause.append("\n /* first tab */ AND (").append(firstTabWhereClause).append(")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>final String additionalSqlWhereClause = getAdditionalSqlWhereClause();<NEW_LINE>if (Check.isNotBlank(additionalSqlWhereClause)) {<NEW_LINE>sqlWhereClause.append("\n /* ").append(getClass().getSimpleName()).append(".getAdditionalSqlWhereClause */").append(" AND (").append(additionalSqlWhereClause).append(")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Start preparing the sqlViewBinding builder<NEW_LINE>final List<String> displayFieldNames = ImmutableList.of(I_M_HU.COLUMNNAME_M_HU_ID);<NEW_LINE>final SqlViewBinding.Builder sqlViewBinding = SqlViewBinding.builder().tableName(I_M_HU.Table_Name).displayFieldNames(displayFieldNames).sqlWhereClause(sqlWhereClause.toString()).rowIdsConverter(HUSqlViewRowIdsConverter.instance);<NEW_LINE>//<NEW_LINE>// View fields: from M_HU's entity descriptor<NEW_LINE>{<NEW_LINE>// NOTE: we need to add all HU's standard fields because those might be needed for some of the standard filters defined<NEW_LINE>final SqlDocumentEntityDataBindingDescriptor huEntityBindings = SqlDocumentEntityDataBindingDescriptor.<MASK><NEW_LINE>huEntityBindings.getFields().stream().map(huField -> SqlViewBindingFactory.createViewFieldBinding(huField, displayFieldNames)).forEach(sqlViewBinding::field);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// View field: BestBeforeDate<NEW_LINE>{<NEW_LINE>final String sqlBestBeforeDate = HUAttributeConstants.sqlBestBeforeDate(sqlViewBinding.getTableAlias() + "." + I_M_HU.COLUMNNAME_M_HU_ID);<NEW_LINE>sqlViewBinding.field(// .columnSql(sqlBestBeforeDate)<NEW_LINE>SqlViewRowFieldBinding.builder().fieldName(HUEditorRow.FIELDNAME_BestBeforeDate).widgetType(DocumentFieldWidgetType.LocalDate).sqlSelectValue(SqlSelectValue.builder().virtualColumnSql(sqlBestBeforeDate).columnNameAlias(HUEditorRow.FIELDNAME_BestBeforeDate).build()).fieldLoader((rs, adLanguage) -> rs.getTimestamp(HUEditorRow.FIELDNAME_BestBeforeDate)).build());<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// View filters and converters<NEW_LINE>{<NEW_LINE>sqlViewBinding.filterDescriptors(createFilterDescriptorsProvider()).filterConverter(HUBarcodeSqlDocumentFilterConverter.instance).filterConverter(HUIdsFilterHelper.SQL_DOCUMENT_FILTER_CONVERTER).filterConverters(createFilterConverters());<NEW_LINE>}<NEW_LINE>//<NEW_LINE>return sqlViewBinding.build();<NEW_LINE>}
cast(huEntityDescriptor.getDataBinding());
1,499,556
public static void main(String[] args) throws Exception {<NEW_LINE>if (args.length != 4 && args.length != 5) {<NEW_LINE>System.err.printf("Expected 4 or 5 parameters, got %d\n", args.length);<NEW_LINE>System.err.println("Usage: java AeadExample encrypt/decrypt key-file input-file output-file" + " [associated-data]");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>String mode = args[0];<NEW_LINE>File keyFile = new File(args[1]);<NEW_LINE>File inputFile = new File(args[2]);<NEW_LINE>File outputFile = new File(args[3]);<NEW_LINE>byte[] associatedData = new byte[0];<NEW_LINE>if (args.length == 5) {<NEW_LINE>associatedData = args<MASK><NEW_LINE>}<NEW_LINE>// Register all AEAD key types with the Tink runtime.<NEW_LINE>AeadConfig.register();<NEW_LINE>// Read the keyset into a KeysetHandle.<NEW_LINE>KeysetHandle handle = null;<NEW_LINE>try {<NEW_LINE>handle = CleartextKeysetHandle.read(JsonKeysetReader.withFile(keyFile));<NEW_LINE>} catch (GeneralSecurityException | IOException ex) {<NEW_LINE>System.err.println("Cannot read keyset, got error: " + ex);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>// Get the primitive.<NEW_LINE>Aead aead = null;<NEW_LINE>try {<NEW_LINE>aead = handle.getPrimitive(Aead.class);<NEW_LINE>} catch (GeneralSecurityException ex) {<NEW_LINE>System.err.println("Cannot create primitive, got error: " + ex);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>// Use the primitive to encrypt/decrypt files.<NEW_LINE>if (MODE_ENCRYPT.equals(mode)) {<NEW_LINE>byte[] plaintext = Files.readAllBytes(inputFile.toPath());<NEW_LINE>byte[] ciphertext = aead.encrypt(plaintext, associatedData);<NEW_LINE>try (FileOutputStream stream = new FileOutputStream(outputFile)) {<NEW_LINE>stream.write(ciphertext);<NEW_LINE>}<NEW_LINE>} else if (MODE_DECRYPT.equals(mode)) {<NEW_LINE>byte[] ciphertext = Files.readAllBytes(inputFile.toPath());<NEW_LINE>byte[] plaintext = aead.decrypt(ciphertext, associatedData);<NEW_LINE>try (FileOutputStream stream = new FileOutputStream(outputFile)) {<NEW_LINE>stream.write(plaintext);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>System.err.println("The first argument must be either encrypt or decrypt, got: " + mode);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>System.exit(0);<NEW_LINE>}
[4].getBytes(UTF_8);
133,264
private void reportSocketStats(long channelId, InternalWithLogId socketLogId) {<NEW_LINE>final long socketId = socketLogId.getLogId().getId();<NEW_LINE>InternalInstrumented<InternalChannelz.SocketStats> iSocket = channelz.getSocket(socketId);<NEW_LINE>if (iSocket == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String socketName = channelId + "-Socket-" + socketId;<NEW_LINE>final InternalChannelz.SocketStats socketStats = ChannelzUtils.getResult(socketName, iSocket);<NEW_LINE>if (socketStats == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MoreObjects.ToStringHelper title = MoreObjects.toStringHelper("");<NEW_LINE>title.add("local", socketStats.local);<NEW_LINE>title.add("remote", socketStats.remote);<NEW_LINE>title.add("security", socketStats.security);<NEW_LINE>logger.info("{} {}", socketName, title);<NEW_LINE>final InternalChannelz.TransportStats transportStats = socketStats.data;<NEW_LINE>if (transportStats != null) {<NEW_LINE>MoreObjects.ToStringHelper socketStrHelper = MoreObjects.toStringHelper("");<NEW_LINE>socketStrHelper.add("streamsStarted", transportStats.streamsStarted);<NEW_LINE>socketStrHelper.add("lastLocalStreamCreatedTime", toMillis(transportStats.lastLocalStreamCreatedTimeNanos));<NEW_LINE>socketStrHelper.add("lastRemoteStreamCreatedTime", toMillis(transportStats.lastRemoteStreamCreatedTimeNanos));<NEW_LINE>logger.info("{} {}", socketName, socketStrHelper);<NEW_LINE>MoreObjects.ToStringHelper socketStatStrHelper = MoreObjects.toStringHelper("");<NEW_LINE>socketStatStrHelper.<MASK><NEW_LINE>socketStatStrHelper.add("streamsFailed", transportStats.streamsFailed);<NEW_LINE>socketStatStrHelper.add("messagesSent", transportStats.messagesSent);<NEW_LINE>socketStatStrHelper.add("messagesReceived", transportStats.messagesReceived);<NEW_LINE>logger.info("{} {}", socketName, socketStatStrHelper);<NEW_LINE>MoreObjects.ToStringHelper socketStat2StrHelper = MoreObjects.toStringHelper("");<NEW_LINE>socketStat2StrHelper.add("keepAlivesSent", transportStats.keepAlivesSent);<NEW_LINE>socketStat2StrHelper.add("lastMessageSentTime", toMillis(transportStats.lastMessageSentTimeNanos));<NEW_LINE>socketStat2StrHelper.add("lastMessageReceivedTime", toMillis(transportStats.lastMessageReceivedTimeNanos));<NEW_LINE>socketStat2StrHelper.add("localFlowControlWindow", transportStats.localFlowControlWindow);<NEW_LINE>socketStat2StrHelper.add("remoteFlowControlWindow", transportStats.remoteFlowControlWindow);<NEW_LINE>logger.info("{} {}", socketName, socketStat2StrHelper);<NEW_LINE>}<NEW_LINE>// InternalChannelz.SocketOptions socketOptions = socketStats.socketOptions;<NEW_LINE>// logger.info("{} socketOptions soTimeoutMillis:{} lingerSeconds:{}", socketName, socketOptions.soTimeoutMillis, socketOptions.lingerSeconds);<NEW_LINE>// logger.info("{} socketOptions others:{}", socketName, socketOptions.others);<NEW_LINE>// InternalChannelz.TcpInfo tcpInfo = socketOptions.tcpInfo;<NEW_LINE>// if (tcpInfo != null) {<NEW_LINE>// logger.info("{} tcpInfo retransmits:{}", socketName, tcpInfo.retransmits);<NEW_LINE>// logger.info("{} tcpInfo backoff:{}", socketName, tcpInfo.backoff);<NEW_LINE>// }<NEW_LINE>}
add("streamsSucceeded", transportStats.streamsSucceeded);
216,751
private static void generateBOM(boolean isWebsphereLiberty, String version, File outputDir, Map<String, LibertyFeature> allFeatures, Constants.ArtifactType type) throws MavenRepoGeneratorException, IOException {<NEW_LINE>String groupId = isWebsphereLiberty ? Constants.WEBSPHERE_LIBERTY_FEATURES_GROUP_ID : Constants.OPEN_LIBERTY_FEATURES_GROUP_ID;<NEW_LINE>MavenCoordinates coordinates = new MavenCoordinates(groupId, Constants.BOM_ARTIFACT_ID, version);<NEW_LINE>Model model = new Model();<NEW_LINE>model.setModelVersion(Constants.MAVEN_MODEL_VERSION);<NEW_LINE>model.setGroupId(coordinates.getGroupId());<NEW_LINE>model.setArtifactId(coordinates.getArtifactId());<NEW_LINE>model.setVersion(coordinates.getVersion());<NEW_LINE>model.setPackaging(Constants.ArtifactType.POM.getType());<NEW_LINE>setLicense(model, version, false, false, isWebsphereLiberty);<NEW_LINE>List<Dependency> dependencies = new ArrayList<Dependency>();<NEW_LINE>DependencyManagement dependencyManagement = new DependencyManagement();<NEW_LINE>model.setDependencyManagement(dependencyManagement);<NEW_LINE>dependencyManagement.setDependencies(dependencies);<NEW_LINE>for (LibertyFeature feature : allFeatures.values()) {<NEW_LINE>MavenCoordinates requiredArtifact = feature.getMavenCoordinates();<NEW_LINE>if (requiredArtifact.getGroupId() == coordinates.getGroupId()) {<NEW_LINE>addDependency(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isWebsphereLiberty) {<NEW_LINE>MavenCoordinates openLibertyCoordinates = new MavenCoordinates(Constants.OPEN_LIBERTY_FEATURES_GROUP_ID, Constants.BOM_ARTIFACT_ID, version);<NEW_LINE>addDependency(dependencies, openLibertyCoordinates, Constants.ArtifactType.POM, "import");<NEW_LINE>model.setName(Constants.WEBSPHERE_LIBERTY_BOM);<NEW_LINE>model.setDescription(Constants.WEBSPHERE_LIBERTY_BOM);<NEW_LINE>} else {<NEW_LINE>model.setName(Constants.OPEN_LIBERTY_BOM);<NEW_LINE>model.setDescription(Constants.OPEN_LIBERTY_BOM);<NEW_LINE>setScmDevUrl(model);<NEW_LINE>}<NEW_LINE>File artifactDir = new File(outputDir, Utils.getRepositorySubpath(coordinates));<NEW_LINE>artifactDir.mkdirs();<NEW_LINE>File targetFile = new File(artifactDir, Utils.getFileName(coordinates, Constants.ArtifactType.POM));<NEW_LINE>if (!targetFile.exists()) {<NEW_LINE>targetFile.createNewFile();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Writer writer = new FileWriter(targetFile);<NEW_LINE>new MavenXpp3Writer().write(writer, model);<NEW_LINE>writer.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new MavenRepoGeneratorException("Could not write POM file " + targetFile, e);<NEW_LINE>}<NEW_LINE>}
dependencies, requiredArtifact, type, "provided");
1,025,006
protected void execute(Terminal terminal, OptionSet options, Environment env) throws UserException {<NEW_LINE>if (options.nonOptionArguments().isEmpty() == false) {<NEW_LINE>throw new UserException(ExitCodes.USAGE, <MASK><NEW_LINE>}<NEW_LINE>if (options.has(versionOption)) {<NEW_LINE>final String versionOutput = String.format(Locale.ROOT, "Version: %s, Build: %s/%s/%s, JVM: %s", Build.CURRENT.getQualifiedVersion(), Build.CURRENT.type().displayName(), Build.CURRENT.hash(), Build.CURRENT.date(), JvmInfo.jvmInfo().version());<NEW_LINE>terminal.println(versionOutput);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final boolean daemonize = options.has(daemonizeOption);<NEW_LINE>final Path pidFile = pidfileOption.value(options);<NEW_LINE>final boolean quiet = options.has(quietOption);<NEW_LINE>// a misconfigured java.io.tmpdir can cause hard-to-diagnose problems later, so reject it immediately<NEW_LINE>try {<NEW_LINE>env.validateTmpFile();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UserException(ExitCodes.CONFIG, e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>init(daemonize, pidFile, quiet, env);<NEW_LINE>} catch (NodeValidationException e) {<NEW_LINE>throw new UserException(ExitCodes.CONFIG, e.getMessage());<NEW_LINE>}<NEW_LINE>}
"Positional arguments not allowed, found " + options.nonOptionArguments());
1,410,435
public static DescribeTrafficControlsResponse unmarshall(DescribeTrafficControlsResponse describeTrafficControlsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeTrafficControlsResponse.setRequestId<MASK><NEW_LINE>describeTrafficControlsResponse.setTotalCount(_ctx.integerValue("DescribeTrafficControlsResponse.TotalCount"));<NEW_LINE>describeTrafficControlsResponse.setPageSize(_ctx.integerValue("DescribeTrafficControlsResponse.PageSize"));<NEW_LINE>describeTrafficControlsResponse.setPageNumber(_ctx.integerValue("DescribeTrafficControlsResponse.PageNumber"));<NEW_LINE>List<TrafficControl> trafficControls = new ArrayList<TrafficControl>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeTrafficControlsResponse.TrafficControls.Length"); i++) {<NEW_LINE>TrafficControl trafficControl = new TrafficControl();<NEW_LINE>trafficControl.setTrafficControlId(_ctx.stringValue("DescribeTrafficControlsResponse.TrafficControls[" + i + "].TrafficControlId"));<NEW_LINE>trafficControl.setTrafficControlName(_ctx.stringValue("DescribeTrafficControlsResponse.TrafficControls[" + i + "].TrafficControlName"));<NEW_LINE>trafficControl.setDescription(_ctx.stringValue("DescribeTrafficControlsResponse.TrafficControls[" + i + "].Description"));<NEW_LINE>trafficControl.setTrafficControlUnit(_ctx.stringValue("DescribeTrafficControlsResponse.TrafficControls[" + i + "].TrafficControlUnit"));<NEW_LINE>trafficControl.setApiDefault(_ctx.integerValue("DescribeTrafficControlsResponse.TrafficControls[" + i + "].ApiDefault"));<NEW_LINE>trafficControl.setUserDefault(_ctx.integerValue("DescribeTrafficControlsResponse.TrafficControls[" + i + "].UserDefault"));<NEW_LINE>trafficControl.setAppDefault(_ctx.integerValue("DescribeTrafficControlsResponse.TrafficControls[" + i + "].AppDefault"));<NEW_LINE>trafficControl.setCreatedTime(_ctx.stringValue("DescribeTrafficControlsResponse.TrafficControls[" + i + "].CreatedTime"));<NEW_LINE>trafficControl.setModifiedTime(_ctx.stringValue("DescribeTrafficControlsResponse.TrafficControls[" + i + "].ModifiedTime"));<NEW_LINE>List<SpecialPolicy> specialPolicies = new ArrayList<SpecialPolicy>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeTrafficControlsResponse.TrafficControls[" + i + "].SpecialPolicies.Length"); j++) {<NEW_LINE>SpecialPolicy specialPolicy = new SpecialPolicy();<NEW_LINE>specialPolicy.setSpecialType(_ctx.stringValue("DescribeTrafficControlsResponse.TrafficControls[" + i + "].SpecialPolicies[" + j + "].SpecialType"));<NEW_LINE>List<Special> specials = new ArrayList<Special>();<NEW_LINE>for (int k = 0; k < _ctx.lengthValue("DescribeTrafficControlsResponse.TrafficControls[" + i + "].SpecialPolicies[" + j + "].Specials.Length"); k++) {<NEW_LINE>Special special = new Special();<NEW_LINE>special.setSpecialKey(_ctx.stringValue("DescribeTrafficControlsResponse.TrafficControls[" + i + "].SpecialPolicies[" + j + "].Specials[" + k + "].SpecialKey"));<NEW_LINE>special.setTrafficValue(_ctx.integerValue("DescribeTrafficControlsResponse.TrafficControls[" + i + "].SpecialPolicies[" + j + "].Specials[" + k + "].TrafficValue"));<NEW_LINE>specials.add(special);<NEW_LINE>}<NEW_LINE>specialPolicy.setSpecials(specials);<NEW_LINE>specialPolicies.add(specialPolicy);<NEW_LINE>}<NEW_LINE>trafficControl.setSpecialPolicies(specialPolicies);<NEW_LINE>trafficControls.add(trafficControl);<NEW_LINE>}<NEW_LINE>describeTrafficControlsResponse.setTrafficControls(trafficControls);<NEW_LINE>return describeTrafficControlsResponse;<NEW_LINE>}
(_ctx.stringValue("DescribeTrafficControlsResponse.RequestId"));
1,547,071
private final void printError() {<NEW_LINE>SharedCommandLineUtilities.printPrefix();<NEW_LINE>System.err.println("Name:");<NEW_LINE>System.err.println("\tTarsosDSP resynthesizer");<NEW_LINE>SharedCommandLineUtilities.printLine();<NEW_LINE>System.err.println("Synopsis:");<NEW_LINE><MASK><NEW_LINE>SharedCommandLineUtilities.printLine();<NEW_LINE>System.err.println("Description:");<NEW_LINE>System.err.println("\tExtracts pitch and loudnes from audio and resynthesises the audio with that information.\n\t" + "The result is either played back our written in an output file. \n\t" + "There is als an option to combine source and synthezized material\n\t" + "in the left and right channels of a stereo audio file.");<NEW_LINE>String descr = "";<NEW_LINE>descr += "\n\n\tinput.wav\t\ta readable wav file.";<NEW_LINE>descr += "\n\n\t--output out.wav\t\ta writable file.";<NEW_LINE>descr += "\n\n\t--combined combined.wav\t\ta writable output file. One channel original, other synthesized.";<NEW_LINE>descr += "\n\t--detector DETECTOR\tdefaults to FFT_YIN or one of these:\n\t\t\t\t";<NEW_LINE>for (PitchEstimationAlgorithm algo : PitchEstimationAlgorithm.values()) {<NEW_LINE>descr += algo.name() + "\n\t\t\t\t";<NEW_LINE>}<NEW_LINE>System.err.println(descr);<NEW_LINE>}
System.err.println("\tjava -jar CommandLineResynthesizer.jar [--detector DETECTOR] [--output out.wav] [--combined combined.wav] input.wav");
25,974
public static void main2(String[] args) {<NEW_LINE>String dbDriver = "COM.ibm.db2.jdbc.app.DB2Driver";<NEW_LINE>String url = "jdbc:db2:sample";<NEW_LINE>String user = "batra";<NEW_LINE>String pass = "varunbatra";<NEW_LINE>String querystring = "Select * from batra.employee";<NEW_LINE>String fn;<NEW_LINE>String ln;<NEW_LINE>String bd;<NEW_LINE>String sal;<NEW_LINE>try {<NEW_LINE>ConnectionProperties cp = new ConnectionProperties(dbDriver, url, user, pass);<NEW_LINE>Query query = new Query(cp, querystring);<NEW_LINE>QueryResults qs = query.execute();<NEW_LINE>System.out.println("Number of rows = " + qs.size());<NEW_LINE>while (qs.next()) {<NEW_LINE>fn = qs.getValue("FIRSTNME");<NEW_LINE>ln = qs.getValue("LASTNAME");<NEW_LINE>bd = qs.getValue("BIRTHDATE");<NEW_LINE><MASK><NEW_LINE>System.out.println(fn + " " + ln + " birthdate " + bd + " salary " + sal);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.webcontainer.jsp.tsx.db.Query.main2", "348");<NEW_LINE>System.out.println("Exception: " + e.getMessage());<NEW_LINE>}<NEW_LINE>System.out.println("All is Fine!");<NEW_LINE>}
sal = qs.getValue("SALARY");
455,306
public MavenExecutionResult readMavenProject(File pomFile, ProjectBuildingRequest configuration) throws MavenException {<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>// $NON-NLS-1$<NEW_LINE>log.debug("Reading Maven project: {}", pomFile.getAbsoluteFile());<NEW_LINE>MavenExecutionResult result = new DefaultMavenExecutionResult();<NEW_LINE>try {<NEW_LINE>configuration.setValidationLevel(ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL);<NEW_LINE>ProjectBuildingResult projectBuildingResult = lookup(ProjectBuilder.class).build(pomFile, configuration);<NEW_LINE>result.setProject(projectBuildingResult.getProject());<NEW_LINE>result.<MASK><NEW_LINE>} catch (ProjectBuildingException ex) {<NEW_LINE>if (ex.getResults() != null && ex.getResults().size() == 1) {<NEW_LINE>ProjectBuildingResult projectBuildingResult = ex.getResults().get(0);<NEW_LINE>result.setProject(projectBuildingResult.getProject());<NEW_LINE>result.setDependencyResolutionResult(projectBuildingResult.getDependencyResolutionResult());<NEW_LINE>}<NEW_LINE>result.addException(ex);<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>result.addException(e);<NEW_LINE>} finally {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>log.debug("Read Maven project: {} in {} ms", pomFile.getAbsoluteFile(), System.currentTimeMillis() - start);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
setDependencyResolutionResult(projectBuildingResult.getDependencyResolutionResult());
1,369,678
public static PersonalPronounType disambiguatePersonalPronoun(SpanishVerbStripper.StrippedVerb strippedVerb, int pronounIdx, String clauseYield) {<NEW_LINE>List<String> pronouns = strippedVerb.getPronouns();<NEW_LINE>String pronoun = pronouns.<MASK><NEW_LINE>if (!ambiguousPersonalPronouns.contains(pronoun))<NEW_LINE>throw new IllegalArgumentException("We don't support disambiguating pronoun '" + pronoun + "'");<NEW_LINE>if (pronouns.size() == 1 && pronoun.equalsIgnoreCase("se"))<NEW_LINE>return PersonalPronounType.REFLEXIVE;<NEW_LINE>String verb = strippedVerb.getStem();<NEW_LINE>if (alwaysReflexiveVerbs.contains(verb))<NEW_LINE>return PersonalPronounType.REFLEXIVE;<NEW_LINE>else if (neverReflexiveVerbs.contains(verb))<NEW_LINE>return PersonalPronounType.OBJECT;<NEW_LINE>Pair<String, String> bruteForceKey = new Pair<>(verb, clauseYield);<NEW_LINE>if (bruteForceDecisions.containsKey(bruteForceKey))<NEW_LINE>return bruteForceDecisions.get(bruteForceKey);<NEW_LINE>// Log this instance where a clitic pronoun could not be disambiguated.<NEW_LINE>log.info("Failed to disambiguate: " + verb + "\nContaining clause:\t" + clauseYield + "\n");<NEW_LINE>return PersonalPronounType.UNKNOWN;<NEW_LINE>}
get(pronounIdx).toLowerCase();
172,862
public void widgetSelected(SelectionEvent event) {<NEW_LINE>final TableItem[] selection = buddy_table.getSelection();<NEW_LINE>UIInputReceiver prompter = ui_instance.getInputReceiver();<NEW_LINE>prompter.setLocalisedTitle(lu.getLocalisedMessageText("azbuddy.ui.menu.send"));<NEW_LINE>prompter.setLocalisedMessage(lu.getLocalisedMessageText("azbuddy.ui.menu.send_msg"));<NEW_LINE>try {<NEW_LINE>prompter.prompt(new UIInputReceiverListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void UIInputReceiverClosed(UIInputReceiver prompter) {<NEW_LINE><MASK><NEW_LINE>if (text != null) {<NEW_LINE>for (int i = 0; i < selection.length; i++) {<NEW_LINE>BuddyPluginBuddy buddy = (BuddyPluginBuddy) selection[i].getData();<NEW_LINE>buddy.getPluginNetwork().getAZ2Handler().sendAZ2Message(buddy, text);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Throwable e) {<NEW_LINE>}<NEW_LINE>}
String text = prompter.getSubmittedInput();
633,507
long parseParam(String param) {<NEW_LINE>char[<MASK><NEW_LINE>int tuIndex = 0;<NEW_LINE>for (int c = 1; c < chars.length; c++) {<NEW_LINE>if (Character.isDigit(chars[c])) {<NEW_LINE>tuIndex++;<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tuIndex == 0) {<NEW_LINE>throw new RuntimeException("Invalid Parameter: " + param);<NEW_LINE>}<NEW_LINE>int time = Integer.parseInt(param.substring(1, tuIndex + 1));<NEW_LINE>String unit = param.substring(tuIndex + 1, param.length()).trim();<NEW_LINE>if ("sec".equals(unit)) {<NEW_LINE>return TimeUnit.MILLISECONDS.convert(time, TimeUnit.SECONDS);<NEW_LINE>} else if ("min".equals(unit)) {<NEW_LINE>return TimeUnit.MILLISECONDS.convert(time, TimeUnit.MINUTES);<NEW_LINE>} else if ("hr".equals(unit)) {<NEW_LINE>return TimeUnit.MILLISECONDS.convert(time, TimeUnit.HOURS);<NEW_LINE>} else if ("day".equals(unit) || "days".equals(unit)) {<NEW_LINE>return TimeUnit.MILLISECONDS.convert(time, TimeUnit.DAYS);<NEW_LINE>} else if ("week".equals(unit) || "weeks".equals(unit)) {<NEW_LINE>// didn't have week so small cheat here<NEW_LINE>return TimeUnit.MILLISECONDS.convert(time * 7, TimeUnit.DAYS);<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("unknown time unit=" + unit);<NEW_LINE>}<NEW_LINE>}
] chars = param.toCharArray();
720,088
public CreateEventDestinationResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateEventDestinationResult createEventDestinationResult = new CreateEventDestinationResult();<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 createEventDestinationResult;<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("ConfigurationSetArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createEventDestinationResult.setConfigurationSetArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ConfigurationSetName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createEventDestinationResult.setConfigurationSetName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("EventDestination", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createEventDestinationResult.setEventDestination(EventDestinationJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return createEventDestinationResult;<NEW_LINE>}
().unmarshall(context));
5,826
public static void cleanupSchemaMeta(String schemaName, Connection metaDbConn) {<NEW_LINE>TableInfoManager tableInfoManager = new TableInfoManager();<NEW_LINE>SchemaInfoCleaner schemaInfoCleaner = new SchemaInfoCleaner();<NEW_LINE>DdlPlanAccessor ddlPlanAccessor = new DdlPlanAccessor();<NEW_LINE>try {<NEW_LINE>assert metaDbConn != null;<NEW_LINE>tableInfoManager.setConnection(metaDbConn);<NEW_LINE>schemaInfoCleaner.setConnection(metaDbConn);<NEW_LINE>ddlPlanAccessor.setConnection(metaDbConn);<NEW_LINE>// If the schema has been dropped, then we have to do some cleanup.<NEW_LINE>String tableListDataId = MetaDbDataIdBuilder.getTableListDataId(schemaName);<NEW_LINE>MetaDbConfigManager.getInstance().unregister(tableListDataId, metaDbConn);<NEW_LINE>List<TablesExtRecord> records = tableInfoManager.queryTableExts(schemaName);<NEW_LINE>for (TablesExtRecord record : records) {<NEW_LINE>String tableDataId = MetaDbDataIdBuilder.getTableDataId(schemaName, record.tableName);<NEW_LINE>MetaDbConfigManager.getInstance().unbindListener(tableDataId);<NEW_LINE>MetaDbConfigManager.getInstance().unregister(tableDataId, metaDbConn);<NEW_LINE>}<NEW_LINE>tableInfoManager.removeAll(schemaName);<NEW_LINE>schemaInfoCleaner.removeAll(schemaName);<NEW_LINE>PolarDbXSystemTableView.deleteAll(schemaName, metaDbConn);<NEW_LINE><MASK><NEW_LINE>PolarDbXSystemTableColumnStatistic.deleteAll(schemaName, metaDbConn);<NEW_LINE>PolarDbXSystemTableBaselineInfo.deleteAll(schemaName, metaDbConn);<NEW_LINE>PolarDbXSystemTablePlanInfo.deleteAll(schemaName, metaDbConn);<NEW_LINE>GsiBackfillManager.deleteAll(schemaName, metaDbConn);<NEW_LINE>CheckerManager.deleteAll(schemaName, metaDbConn);<NEW_LINE>ddlPlanAccessor.deleteAll(schemaName);<NEW_LINE>TableGroupUtils.deleteTableGroupInfoBySchema(schemaName, metaDbConn);<NEW_LINE>} catch (Exception e) {<NEW_LINE>MetaDbLogUtil.META_DB_LOG.error(e);<NEW_LINE>} finally {<NEW_LINE>tableInfoManager.setConnection(null);<NEW_LINE>schemaInfoCleaner.setConnection(null);<NEW_LINE>}<NEW_LINE>}
PolarDbXSystemTableLogicalTableStatistic.deleteAll(schemaName, metaDbConn);
573,478
private void save(ServerLongLongRow row, PSMatrixSaveContext saveContext, MatrixPartitionMeta meta, DataOutputStream out) throws IOException {<NEW_LINE>long startCol = meta.getStartCol();<NEW_LINE>if (ServerRowUtils.getVector(row) instanceof IntLongVector) {<NEW_LINE>IntLongVector vector = (IntLongVector) ServerRowUtils.getVector(row);<NEW_LINE>if (vector.isDense()) {<NEW_LINE>long[] data = vector.getStorage().getValues();<NEW_LINE>for (int i = 0; i < data.length; i++) {<NEW_LINE>out.writeLong(data[i]);<NEW_LINE>}<NEW_LINE>} else if (vector.isSorted()) {<NEW_LINE>int[] indices = vector.getStorage().getIndices();<NEW_LINE>long[] values = vector.getStorage().getValues();<NEW_LINE>for (int i = 0; i < indices.length; i++) {<NEW_LINE>out.writeLong(indices[i] + startCol);<NEW_LINE>out.writeLong(values[i]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ObjectIterator<Int2LongMap.Entry> iter = vector.getStorage().entryIterator();<NEW_LINE>Int2LongMap.Entry entry;<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>entry = iter.next();<NEW_LINE>out.writeLong(entry.getIntKey() + startCol);<NEW_LINE>out.writeLong(entry.getLongValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LongLongVector vector = (LongLongVector) ServerRowUtils.getVector(row);<NEW_LINE>if (vector.isSorted()) {<NEW_LINE>long[] indices = vector.getStorage().getIndices();<NEW_LINE>long[] values = vector<MASK><NEW_LINE>for (int i = 0; i < indices.length; i++) {<NEW_LINE>out.writeLong(indices[i] + startCol);<NEW_LINE>out.writeLong(values[i]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ObjectIterator<Long2LongMap.Entry> iter = vector.getStorage().entryIterator();<NEW_LINE>Long2LongMap.Entry entry;<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>entry = iter.next();<NEW_LINE>out.writeLong(entry.getLongKey() + startCol);<NEW_LINE>out.writeLong(entry.getLongValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getStorage().getValues();
942,757
public void bool(BoolCall<SearchLogCQ> boolLambda, ConditionOptionCall<BoolQueryBuilder> opLambda) {<NEW_LINE>SearchLogCQ mustQuery = new SearchLogCQ();<NEW_LINE>SearchLogCQ shouldQuery = new SearchLogCQ();<NEW_LINE>SearchLogCQ mustNotQuery = new SearchLogCQ();<NEW_LINE>SearchLogCQ filterQuery = new SearchLogCQ();<NEW_LINE>boolLambda.callback(<MASK><NEW_LINE>if (mustQuery.hasQueries() || shouldQuery.hasQueries() || mustNotQuery.hasQueries() || filterQuery.hasQueries()) {<NEW_LINE>BoolQueryBuilder builder = regBoolCQ(mustQuery.getQueryBuilderList(), shouldQuery.getQueryBuilderList(), mustNotQuery.getQueryBuilderList(), filterQuery.getQueryBuilderList());<NEW_LINE>if (opLambda != null) {<NEW_LINE>opLambda.callback(builder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
mustQuery, shouldQuery, mustNotQuery, filterQuery);
1,632,235
protected void onCreate(final Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>// authentication with an API key or named user is required to access basemaps and other<NEW_LINE>// location services<NEW_LINE>ArcGISRuntimeEnvironment.setApiKey(BuildConfig.API_KEY);<NEW_LINE>// get us census data as a service feature table<NEW_LINE>ServiceFeatureTable statesServiceFeatureTable = new ServiceFeatureTable(getResources().getString(R.string.us_census_feature_service));<NEW_LINE>// add the service feature table to a feature layer<NEW_LINE>final <MASK><NEW_LINE>// set the feature layer to render dynamically to allow extrusion<NEW_LINE>statesFeatureLayer.setRenderingMode(FeatureLayer.RenderingMode.DYNAMIC);<NEW_LINE>// create a scene and add it to the scene view<NEW_LINE>ArcGISScene scene = new ArcGISScene(BasemapStyle.ARCGIS_IMAGERY);<NEW_LINE>mSceneView = findViewById(R.id.sceneView);<NEW_LINE>mSceneView.setScene(scene);<NEW_LINE>// add the feature layer to the scene<NEW_LINE>scene.getOperationalLayers().add(statesFeatureLayer);<NEW_LINE>// define line and fill symbols for a simple renderer<NEW_LINE>final SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID, Color.BLACK, 1.0f);<NEW_LINE>final SimpleFillSymbol fillSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, Color.BLUE, lineSymbol);<NEW_LINE>final SimpleRenderer renderer = new SimpleRenderer(fillSymbol);<NEW_LINE>// set renderer extrusion mode to absolute height, which extrudes the feature to the specified z-value as flat top<NEW_LINE>renderer.getSceneProperties().setExtrusionMode(Renderer.SceneProperties.ExtrusionMode.ABSOLUTE_HEIGHT);<NEW_LINE>// set the simple renderer to the feature layer<NEW_LINE>statesFeatureLayer.setRenderer(renderer);<NEW_LINE>// define a look at point for the camera at geographical center of the continental US<NEW_LINE>final Point lookAtPoint = new Point(-10974490, 4814376, 0, SpatialReferences.getWebMercator());<NEW_LINE>// add a camera and set it to orbit the look at point<NEW_LINE>final Camera camera = new Camera(lookAtPoint, 20000000, 0, 55, 0);<NEW_LINE>mSceneView.setViewpointCamera(camera);<NEW_LINE>// set switch listener<NEW_LINE>Switch popSwitch = findViewById(R.id.populationSwitch);<NEW_LINE>popSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> {<NEW_LINE>// set extrusion properties to either show total population or population density based on flag<NEW_LINE>if (isChecked) {<NEW_LINE>// multiple population density by 5000 to make data legible<NEW_LINE>renderer.getSceneProperties().setExtrusionExpression("[POP07_SQMI] * 5000 + 100000");<NEW_LINE>} else {<NEW_LINE>// divide total population by 10 to make data legible<NEW_LINE>renderer.getSceneProperties().setExtrusionExpression("[POP2007] / 10");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// set initial switch state<NEW_LINE>popSwitch.setChecked(true);<NEW_LINE>}
FeatureLayer statesFeatureLayer = new FeatureLayer(statesServiceFeatureTable);
1,313,230
private Trie split(TrieKeySlice commonPath) {<NEW_LINE>int commonPathLength = commonPath.length();<NEW_LINE>TrieKeySlice newChildSharedPath = sharedPath.slice(commonPathLength + 1, sharedPath.length());<NEW_LINE>Trie newChildTrie = new Trie(this.store, newChildSharedPath, this.value, this.left, this.right, this.valueLength, this.valueHash, this.childrenSize);<NEW_LINE>NodeReference newChildReference = new NodeReference(this.store, newChildTrie, null);<NEW_LINE>// this bit will be implicit and not present in a shared path<NEW_LINE>byte pos = sharedPath.get(commonPathLength);<NEW_LINE>VarInt childrenSize = new VarInt(newChildReference.referenceSize());<NEW_LINE>NodeReference newLeft;<NEW_LINE>NodeReference newRight;<NEW_LINE>if (pos == 0) {<NEW_LINE>newLeft = newChildReference;<NEW_LINE>newRight = NodeReference.empty();<NEW_LINE>} else {<NEW_LINE>newLeft = NodeReference.empty();<NEW_LINE>newRight = newChildReference;<NEW_LINE>}<NEW_LINE>return new Trie(this.store, commonPath, null, newLeft, newRight, <MASK><NEW_LINE>}
Uint24.ZERO, null, childrenSize);
1,778,577
public void onClick(View v) {<NEW_LINE>final List<PopUpMenuItem> <MASK><NEW_LINE>for (final TracksSortByMode mode : TracksSortByMode.values()) {<NEW_LINE>items.add(new PopUpMenuItem.Builder(app).setTitleId(mode.getNameId()).setIcon(app.getUIUtilities().getThemedIcon(mode.getIconId())).setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>sortByMode = mode;<NEW_LINE>sortButton.setImageResource(mode.getIconId());<NEW_LINE>updateDescription(descriptionView);<NEW_LINE>sortFolderList();<NEW_LINE>folderSelector.setItems(getFolderChips());<NEW_LINE>folderSelector.notifyDataSetChanged();<NEW_LINE>sortFileList();<NEW_LINE>adapter.notifyDataSetChanged();<NEW_LINE>}<NEW_LINE>}).setSelected(sortByMode == mode).create());<NEW_LINE>}<NEW_LINE>new PopUpMenuHelper.Builder(v, items, nightMode).show();<NEW_LINE>}
items = new ArrayList<>();
324,183
public static float[][] readValues(java.io.InputStream in, String delimiter) throws java.io.IOException, java.lang.NumberFormatException {<NEW_LINE>String thisLine;<NEW_LINE>java.io.BufferedInputStream s = new java.io.BufferedInputStream(in);<NEW_LINE>java.io.BufferedReader myInput = new java.io.BufferedReader(new java.io.InputStreamReader(s, Charsets.UTF_8));<NEW_LINE>int index = 0;<NEW_LINE>float min = 0;<NEW_LINE>float max = 0;<NEW_LINE>float[][] theMap = <MASK><NEW_LINE>while ((thisLine = myInput.readLine()) != null) {<NEW_LINE>// scan it line by line<NEW_LINE>java.util.StringTokenizer st = new java.util.StringTokenizer(thisLine, delimiter);<NEW_LINE>float a = Float.valueOf(st.nextToken());<NEW_LINE>theMap[index / 512][index % 512] = a;<NEW_LINE>index++;<NEW_LINE>min = a < min ? a : min;<NEW_LINE>max = a > max ? a : max;<NEW_LINE>if (index / 512 > 511) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// System.out.println("min " + min);<NEW_LINE>// System.out.println("max " + max);<NEW_LINE>return (theMap);<NEW_LINE>}
new float[512][512];
1,180,698
final GetBrowserSettingsResult executeGetBrowserSettings(GetBrowserSettingsRequest getBrowserSettingsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getBrowserSettingsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetBrowserSettingsRequest> request = null;<NEW_LINE>Response<GetBrowserSettingsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetBrowserSettingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getBrowserSettingsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "WorkSpaces Web");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetBrowserSettings");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetBrowserSettingsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetBrowserSettingsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
845,260
public void baseTick() {<NEW_LINE>super.baseTick();<NEW_LINE>float radius = 5F;<NEW_LINE>float renderRadius = (float) (radius - Math.random());<NEW_LINE>for (int i = 0; i < Math.min(90, tickCount); i++) {<NEW_LINE>float a = i;<NEW_LINE>if (a % 2 == 0) {<NEW_LINE>a = 45 + a;<NEW_LINE>}<NEW_LINE>if (level.random.nextInt(tickCount < 90 ? 8 : 20) == 0) {<NEW_LINE>float rad = (float) (a * 4 * Math.PI / 180F);<NEW_LINE>double x = Math.cos(rad) * renderRadius;<NEW_LINE>double z = Math.sin(rad) * renderRadius;<NEW_LINE>WispParticleData data1 = WispParticleData.wisp(0.65F + (float) Math.random() * 0.45F, 1F, (float) Math.random() * 0.25F, (float) Math.random() * 0.25F);<NEW_LINE>level.addParticle(data1, getX() + x, getY() - 0.2, getZ() + z, (float) (Math.random() - 0.5F) * 0.15F, 0.055F + (float) Math.random() * 0.025F, (float) (Math.random() - 0.5F) * 0.15F);<NEW_LINE>float gs = (float) Math.random() * 0.15F;<NEW_LINE>float smokeRadius = (float) (renderRadius - Math.random() * renderRadius * 0.9);<NEW_LINE>x = <MASK><NEW_LINE>z = Math.sin(rad) * smokeRadius;<NEW_LINE>WispParticleData data = WispParticleData.wisp(0.65F + (float) Math.random() * 0.45F, gs, gs, gs, 1);<NEW_LINE>level.addParticle(data, getX() + x, getY() - 0.2, getZ() + z, 0, -(-0.155F - (float) Math.random() * 0.025F), 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (level.random.nextInt(20) == 0) {<NEW_LINE>level.playLocalSound(getX(), getY(), getZ(), SoundEvents.FIRE_AMBIENT, SoundSource.BLOCKS, 1F, 1F, false);<NEW_LINE>}<NEW_LINE>if (level.isClientSide) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (tickCount >= 300) {<NEW_LINE>discard();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (tickCount > 45) {<NEW_LINE>AABB boundingBox = new AABB(getX(), getY(), getZ(), getX(), getY(), getZ()).inflate(radius, radius, radius);<NEW_LINE>List<LivingEntity> entities = level.getEntitiesOfClass(LivingEntity.class, boundingBox);<NEW_LINE>if (entities.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (LivingEntity entity : entities) {<NEW_LINE>if (entity == null || MathHelper.pointDistancePlane(getX(), getY(), entity.getX(), entity.getY()) > radius) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>entity.setSecondsOnFire(4);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Math.cos(rad) * smokeRadius;
1,365,802
private Prune prune(Node node, List<Tuple> test, double[] importance, Formula formula, IntSet labels) {<NEW_LINE>if (node instanceof DecisionNode) {<NEW_LINE>DecisionNode leaf = (DecisionNode) node;<NEW_LINE>int y = leaf.output();<NEW_LINE>int error = 0;<NEW_LINE>for (Tuple t : test) {<NEW_LINE>if (y != labels.indexOf(formula.yint(t)))<NEW_LINE>error++;<NEW_LINE>}<NEW_LINE>return new Prune(node, error, leaf.count());<NEW_LINE>}<NEW_LINE>InternalNode parent = (InternalNode) node;<NEW_LINE>List<Tuple> trueBranch = new ArrayList<>();<NEW_LINE>List<Tuple> falseBranch = new ArrayList<>();<NEW_LINE>for (Tuple t : test) {<NEW_LINE>if (parent.branch(formula.x(t)))<NEW_LINE>trueBranch.add(t);<NEW_LINE>else<NEW_LINE>falseBranch.add(t);<NEW_LINE>}<NEW_LINE>Prune trueChild = prune(parent.trueChild(), <MASK><NEW_LINE>Prune falseChild = prune(parent.falseChild(), falseBranch, importance, formula, labels);<NEW_LINE>int[] count = new int[k];<NEW_LINE>for (int i = 0; i < k; i++) {<NEW_LINE>count[i] = trueChild.count[i] + falseChild.count[i];<NEW_LINE>}<NEW_LINE>int y = MathEx.whichMax(count);<NEW_LINE>int error = 0;<NEW_LINE>for (Tuple t : test) {<NEW_LINE>if (y != labels.indexOf(formula.yint(t)))<NEW_LINE>error++;<NEW_LINE>}<NEW_LINE>if (error < trueChild.error + falseChild.error) {<NEW_LINE>node = new DecisionNode(count);<NEW_LINE>importance[parent.feature()] -= parent.score();<NEW_LINE>} else {<NEW_LINE>error = trueChild.error + falseChild.error;<NEW_LINE>node = parent.replace(trueChild.node, falseChild.node);<NEW_LINE>}<NEW_LINE>return new Prune(node, error, count);<NEW_LINE>}
trueBranch, importance, formula, labels);
840,900
public static void show(Context context, Store store, int notificationIconResId) {<NEW_LINE>android.app.Notification notification;<NEW_LINE>Intent myIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(UpdateChecker.ROOT_PLAY_STORE_DEVICE + context.getPackageName()));<NEW_LINE>PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, myIntent, Intent.FILL_IN_ACTION);<NEW_LINE>String appName = null;<NEW_LINE>try {<NEW_LINE>appName = context.getPackageManager().getApplicationInfo(context.getPackageName(), 0).loadLabel(context.getPackageManager()).toString();<NEW_LINE>} catch (PackageManager.NameNotFoundException ignored) {<NEW_LINE>}<NEW_LINE>NotificationCompat.Builder builder <MASK><NEW_LINE>builder.setTicker(context.getString(R.string.newUpdateAvailable)).setContentTitle(appName).setContentText(context.getString(R.string.newUpdateAvailable)).setContentIntent(pendingIntent).build();<NEW_LINE>if (notificationIconResId == 0) {<NEW_LINE>if (store == Store.GOOGLE_PLAY) {<NEW_LINE>builder.setSmallIcon(R.drawable.ic_stat_play_store);<NEW_LINE>} else if (store == Store.AMAZON) {<NEW_LINE>builder.setSmallIcon(R.drawable.ic_stat_amazon);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>builder.setSmallIcon(notificationIconResId);<NEW_LINE>}<NEW_LINE>notification = builder.build();<NEW_LINE>notification.flags = android.app.Notification.FLAG_AUTO_CANCEL;<NEW_LINE>NotificationManager notificationManager = (NotificationManager) context.getSystemService(context.NOTIFICATION_SERVICE);<NEW_LINE>notificationManager.notify(0, notification);<NEW_LINE>}
= new NotificationCompat.Builder(context);
1,675,021
private void merge(SQLCommand command, CallableStatement statement, KeyValueStreamListener listener) throws SQLException, IOException {<NEW_LINE>Map<String, Object<MASK><NEW_LINE>if (map.isEmpty()) {<NEW_LINE>// no register given, return without doing anything<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<String> keys = new LinkedList<>();<NEW_LINE>List<Object> values = new LinkedList<>();<NEW_LINE>for (Map.Entry<String, Object> entry : map.entrySet()) {<NEW_LINE>String k = entry.getKey();<NEW_LINE>Map<String, Object> v = (Map<String, Object>) entry.getValue();<NEW_LINE>// the parameter position of the value<NEW_LINE>Integer pos = (Integer) v.get("pos");<NEW_LINE>// the field for indexing the value (if not key name)<NEW_LINE>String field = (String) v.get("field");<NEW_LINE>keys.add(field != null ? field : k);<NEW_LINE>values.add(statement.getObject(pos));<NEW_LINE>}<NEW_LINE>logger.trace("merge callable statement result: keys={} values={}", keys, values);<NEW_LINE>listener.keys(keys);<NEW_LINE>listener.values(values);<NEW_LINE>listener.end();<NEW_LINE>}
> map = command.getRegister();
1,604,267
// Copied from NbClassPath:<NEW_LINE>private static void createBootClassPath(List<String> l) {<NEW_LINE>// boot<NEW_LINE>// NOI18N<NEW_LINE>String boot = System.getProperty("sun.boot.class.path");<NEW_LINE>if (boot != null) {<NEW_LINE>StringTokenizer tok = new StringTokenizer(boot, File.pathSeparator);<NEW_LINE>while (tok.hasMoreTokens()) {<NEW_LINE>l.add(tok.nextToken());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// std extensions<NEW_LINE>// NOI18N<NEW_LINE>String extensions = System.getProperty("java.ext.dirs");<NEW_LINE>if (extensions != null) {<NEW_LINE>for (StringTokenizer st = new StringTokenizer(extensions, File.pathSeparator); st.hasMoreTokens(); ) {<NEW_LINE>File dir = new <MASK><NEW_LINE>File[] entries = dir.listFiles();<NEW_LINE>if (entries != null) {<NEW_LINE>for (File f : entries) {<NEW_LINE>String name = f.getName().toLowerCase(Locale.US);<NEW_LINE>if (name.endsWith(".zip") || name.endsWith(".jar")) {<NEW_LINE>// NOI18N<NEW_LINE>l.add(f.getAbsolutePath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
File(st.nextToken());
1,806,874
void insertWorkloadRecord(String cn, String provider, String certReqInstanceId, String sanIpStr, String hostName, Date certExpiryTime) {<NEW_LINE>if (StringUtil.isEmpty(sanIpStr)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (hostName == null) {<NEW_LINE>hostName = cn + "." + sanIpStr;<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug("hostname is not set by agent, hence forming the hostname {} with domain.service {} and sanIpStr {} ..", hostName, cn, sanIpStr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>WorkloadRecord workloadRecord;<NEW_LINE>String[] <MASK><NEW_LINE>for (String sanIp : sanIps) {<NEW_LINE>workloadRecord = new WorkloadRecord();<NEW_LINE>workloadRecord.setProvider(provider);<NEW_LINE>workloadRecord.setIp(sanIp);<NEW_LINE>workloadRecord.setInstanceId(certReqInstanceId);<NEW_LINE>workloadRecord.setService(cn);<NEW_LINE>workloadRecord.setHostname(hostName);<NEW_LINE>workloadRecord.setCreationTime(new Date());<NEW_LINE>workloadRecord.setUpdateTime(new Date());<NEW_LINE>workloadRecord.setCertExpiryTime(certExpiryTime);<NEW_LINE>if (!instanceCertManager.insertWorkloadRecord(workloadRecord)) {<NEW_LINE>LOGGER.error("unable to insert workload record={}", workloadRecord);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
sanIps = sanIpStr.split(",");
369,719
public static ResultHandle collectQualifiers(ClassOutput classOutput, ClassCreator beanCreator, BeanDeployment beanDeployment, MethodCreator constructor, AnnotationLiteralProcessor annotationLiterals, Set<AnnotationInstance> requiredQualifiers) {<NEW_LINE>ResultHandle requiredQualifiersHandle;<NEW_LINE>if (requiredQualifiers.isEmpty()) {<NEW_LINE>requiredQualifiersHandle = constructor.readStaticField(FieldDescriptors.QUALIFIERS_IP_QUALIFIERS);<NEW_LINE>} else {<NEW_LINE>requiredQualifiersHandle = constructor.newInstance(MethodDescriptor.ofConstructor(HashSet.class));<NEW_LINE>for (AnnotationInstance qualifierAnnotation : requiredQualifiers) {<NEW_LINE>BuiltinQualifier qualifier = BuiltinQualifier.of(qualifierAnnotation);<NEW_LINE>ResultHandle qualifierHandle;<NEW_LINE>if (qualifier != null) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>// Create annotation literal if needed<NEW_LINE>qualifierHandle = annotationLiterals.process(constructor, classOutput, beanDeployment.getQualifier(qualifierAnnotation.name()), qualifierAnnotation, beanCreator != null ? Types.getPackageName(beanCreator.getClassName()) : null);<NEW_LINE>}<NEW_LINE>constructor.invokeInterfaceMethod(MethodDescriptors.SET_ADD, requiredQualifiersHandle, qualifierHandle);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return requiredQualifiersHandle;<NEW_LINE>}
qualifierHandle = qualifier.getLiteralInstance(constructor);
1,241,906
static boolean certificateIsCa(X509Certificate certificate) {<NEW_LINE>boolean[] keyUsage = certificate.getKeyUsage();<NEW_LINE>int basicConstraints = certificate.getBasicConstraints();<NEW_LINE>if (keyUsage == null) {<NEW_LINE>// no KeyUsage, just check if the cA BasicConstraint is set.<NEW_LINE>return basicConstraints >= 0;<NEW_LINE>} else {<NEW_LINE>if (keyUsage[5] && basicConstraints == -1) {<NEW_LINE>// KeyUsage is present and the keyCertSign bit is set.<NEW_LINE>// According to RFC 5280 the BasicConstraint cA bit must also<NEW_LINE>// be set, but it's not!<NEW_LINE>LOGGER.debug("'{}' violates RFC 5280: KeyUsage keyCertSign " + "bit set without BasicConstraint cA bit set", certificate.getSubjectX500Principal().getName());<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>}
keyUsage[5] || basicConstraints >= 0;
960,417
private void initializeResources() {<NEW_LINE>Toolbar toolbar = findViewById(R.id.toolbar);<NEW_LINE>passphraseAuthContainer = findViewById(R.id.password_auth_container);<NEW_LINE>passphraseLayout = findViewById(R.id.passphrase_layout);<NEW_LINE>passphraseInput = findViewById(R.id.passphrase_input);<NEW_LINE>okButton = <MASK><NEW_LINE>successView = findViewById(R.id.success);<NEW_LINE>toolbar.setTitle("");<NEW_LINE>setSupportActionBar(toolbar);<NEW_LINE>SpannableString hint = new SpannableString(getString(R.string.PassphrasePromptActivity_enter_passphrase));<NEW_LINE>hint.setSpan(new RelativeSizeSpan(0.9f), 0, hint.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);<NEW_LINE>hint.setSpan(new TypefaceSpan("sans-serif-light"), 0, hint.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);<NEW_LINE>passphraseInput.setHint(hint);<NEW_LINE>passphraseInput.setOnEditorActionListener(new PassphraseActionListener());<NEW_LINE>okButton.setOnClickListener(v -> handlePassphrase());<NEW_LINE>}
findViewById(R.id.ok_button);
904,075
/*<NEW_LINE>* This method is intended for internal use only, and should only<NEW_LINE>* be called by other classes for unit testing.<NEW_LINE>*/<NEW_LINE>protected void applyOverrides(Alert alert) {<NEW_LINE>if (this.alertOverrides.isEmpty()) {<NEW_LINE>// Nothing to do<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String changedName = this.alertOverrides.getProperty(alert.getPluginId() + ".name");<NEW_LINE>if (changedName != null) {<NEW_LINE>alert.setName(applyOverride(alert.getName(), changedName));<NEW_LINE>}<NEW_LINE>String changedDesc = this.alertOverrides.getProperty(alert.getPluginId() + ".description");<NEW_LINE>if (changedDesc != null) {<NEW_LINE>alert.setDescription(applyOverride(alert.getDescription(), changedDesc));<NEW_LINE>}<NEW_LINE>String changedSolution = this.alertOverrides.getProperty(alert.getPluginId() + ".solution");<NEW_LINE>if (changedSolution != null) {<NEW_LINE>alert.setSolution(applyOverride(alert<MASK><NEW_LINE>}<NEW_LINE>String changedOther = this.alertOverrides.getProperty(alert.getPluginId() + ".otherInfo");<NEW_LINE>if (changedOther != null) {<NEW_LINE>alert.setOtherInfo(applyOverride(alert.getOtherInfo(), changedOther));<NEW_LINE>}<NEW_LINE>String changedReference = this.alertOverrides.getProperty(alert.getPluginId() + ".reference");<NEW_LINE>if (changedReference != null) {<NEW_LINE>alert.setReference(applyOverride(alert.getReference(), changedReference));<NEW_LINE>}<NEW_LINE>Map<String, String> tags = new HashMap<>(alert.getTags());<NEW_LINE>for (Map.Entry<Object, Object> e : this.alertOverrides.entrySet()) {<NEW_LINE>String propertyKey = e.getKey().toString();<NEW_LINE>if (propertyKey.startsWith(alert.getPluginId() + ".tag.")) {<NEW_LINE>String tagKey = propertyKey.substring((alert.getPluginId() + ".tag.").length());<NEW_LINE>tags.put(tagKey, applyOverride(alert.getTags().getOrDefault(tagKey, ""), e.getValue().toString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>alert.setTags(tags);<NEW_LINE>}
.getSolution(), changedSolution));
1,600,181
public static Vector apply(LongFloatVector v1, LongDummyVector v2, Binary op) {<NEW_LINE>if (v1.isSparse()) {<NEW_LINE>if (op.isKeepStorage()) {<NEW_LINE>throw new AngelException("operation is not support!");<NEW_LINE>} else {<NEW_LINE>// multi-rehash<NEW_LINE>LongFloatVectorStorage newStorage = v1.getStorage().emptySparse((int) <MASK><NEW_LINE>LongFloatVectorStorage v1Storage = v1.getStorage();<NEW_LINE>for (int i = 0; i < v1.getDim(); i++) {<NEW_LINE>if (v1Storage.hasKey(i)) {<NEW_LINE>newStorage.set(i, op.apply(v1.get(i), v2.get(i)));<NEW_LINE>} else {<NEW_LINE>newStorage.set(i, op.apply(0.0f, v2.get(i)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>v1.setStorage(newStorage);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// sorted<NEW_LINE>if (op.isKeepStorage()) {<NEW_LINE>throw new AngelException("operation is not support!");<NEW_LINE>} else {<NEW_LINE>LongFloatVectorStorage newStorage = new LongFloatSparseVectorStorage(v1.getDim());<NEW_LINE>LongFloatVectorStorage v1Storage = v1.getStorage();<NEW_LINE>for (int i = 0; i < v1.getDim(); i++) {<NEW_LINE>if (v1Storage.hasKey(i)) {<NEW_LINE>newStorage.set(i, op.apply(v1.get(i), v2.get(i)));<NEW_LINE>} else {<NEW_LINE>newStorage.set(i, op.apply(0.0f, v2.get(i)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>v1.setStorage(newStorage);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return v1;<NEW_LINE>}
(v1.getDim()));
438,455
protected <T extends Metric> void configuration(@Observes AfterDeploymentValidation adv, BeanManager manager) {<NEW_LINE>MetricRegistry registry = getReference(manager, MetricRegistry.class);<NEW_LINE>MetricName name = getReference(manager, MetricName.class);<NEW_LINE>for (Map.Entry<Bean<?>, AnnotatedMember<?>> bean : metrics.entrySet()) {<NEW_LINE>// TODO: add MetricSet metrics into the metric registry<NEW_LINE>if (// skip non @Default beans<NEW_LINE>// skip producer methods with injection point<NEW_LINE>!bean.getKey().getQualifiers().contains(DEFAULT) || hasInjectionPoints(bean.getValue()))<NEW_LINE>continue;<NEW_LINE>Metadata metadata = name.metadataOf(bean.getValue());<NEW_LINE>String[] tags = name.tagOf(bean.getValue());<NEW_LINE>registry.register(metadata, (Metric) getReference(manager, bean.getValue().getBaseType(), bean.getKey())<MASK><NEW_LINE>MetricID mid = new MetricID(metadata.getName(), Utils.tagsToTags(tags));<NEW_LINE>addMetricID(mid);<NEW_LINE>}<NEW_LINE>// Clear the collected metric producers<NEW_LINE>metrics.clear();<NEW_LINE>}
, Utils.tagsToTags(tags));
723,139
public static void show(final XmppActivity xmppActivity, final Blockable blockable) {<NEW_LINE>final AlertDialog.Builder builder = new AlertDialog.Builder(xmppActivity);<NEW_LINE>final boolean isBlocked = blockable.isBlocked();<NEW_LINE>builder.setNegativeButton(R.string.cancel, null);<NEW_LINE>DialogBlockContactBinding binding = DataBindingUtil.inflate(xmppActivity.getLayoutInflater(), R.layout.dialog_block_contact, null, false);<NEW_LINE>final boolean reporting = blockable.getAccount().getXmppConnection().getFeatures().spamReporting();<NEW_LINE>binding.reportSpam.setVisibility(!isBlocked && reporting ? View.VISIBLE : View.GONE);<NEW_LINE>builder.<MASK><NEW_LINE>final String value;<NEW_LINE>@StringRes<NEW_LINE>int res;<NEW_LINE>if (blockable.getJid().isFullJid()) {<NEW_LINE>builder.setTitle(isBlocked ? R.string.action_unblock_participant : R.string.action_block_participant);<NEW_LINE>value = blockable.getJid().toEscapedString();<NEW_LINE>res = isBlocked ? R.string.unblock_contact_text : R.string.block_contact_text;<NEW_LINE>} else if (blockable.getJid().getLocal() == null || blockable.getAccount().isBlocked(blockable.getJid().getDomain())) {<NEW_LINE>builder.setTitle(isBlocked ? R.string.action_unblock_domain : R.string.action_block_domain);<NEW_LINE>value = blockable.getJid().getDomain().toEscapedString();<NEW_LINE>res = isBlocked ? R.string.unblock_domain_text : R.string.block_domain_text;<NEW_LINE>} else {<NEW_LINE>int resBlockAction = blockable instanceof Conversation && ((Conversation) blockable).isWithStranger() ? R.string.block_stranger : R.string.action_block_contact;<NEW_LINE>builder.setTitle(isBlocked ? R.string.action_unblock_contact : resBlockAction);<NEW_LINE>value = blockable.getJid().asBareJid().toEscapedString();<NEW_LINE>res = isBlocked ? R.string.unblock_contact_text : R.string.block_contact_text;<NEW_LINE>}<NEW_LINE>binding.text.setText(JidDialog.style(xmppActivity, res, value));<NEW_LINE>builder.setPositiveButton(isBlocked ? R.string.unblock : R.string.block, (dialog, which) -> {<NEW_LINE>if (isBlocked) {<NEW_LINE>xmppActivity.xmppConnectionService.sendUnblockRequest(blockable);<NEW_LINE>} else {<NEW_LINE>boolean toastShown = false;<NEW_LINE>if (xmppActivity.xmppConnectionService.sendBlockRequest(blockable, binding.reportSpam.isChecked())) {<NEW_LINE>Toast.makeText(xmppActivity, R.string.corresponding_conversations_closed, Toast.LENGTH_SHORT).show();<NEW_LINE>toastShown = true;<NEW_LINE>}<NEW_LINE>if (xmppActivity instanceof ContactDetailsActivity) {<NEW_LINE>if (!toastShown) {<NEW_LINE>Toast.makeText(xmppActivity, R.string.contact_blocked_past_tense, Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>xmppActivity.finish();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>builder.create().show();<NEW_LINE>}
setView(binding.getRoot());
1,153,715
private void sendRecipes(GlowMerchantInventory inventory, GlowPlayer player) {<NEW_LINE>// TODO: Move this to a new 'GlowMerchant' class, to allow custom Merchant windows<NEW_LINE>checkNotNull(inventory);<NEW_LINE>checkNotNull(player);<NEW_LINE>int windowId = player.getOpenWindowId();<NEW_LINE>if (windowId == -1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ByteBuf payload = Unpooled.buffer();<NEW_LINE>payload.writeInt(windowId);<NEW_LINE>payload.writeByte(this.recipes.size());<NEW_LINE>for (MerchantRecipe recipe : this.recipes) {<NEW_LINE>if (recipe.getIngredients().isEmpty()) {<NEW_LINE>GlowBufUtils.writeSlot(payload, InventoryUtil.createEmptyStack());<NEW_LINE>} else {<NEW_LINE>GlowBufUtils.writeSlot(payload, recipe.getIngredients<MASK><NEW_LINE>}<NEW_LINE>GlowBufUtils.writeSlot(payload, recipe.getResult());<NEW_LINE>boolean secondIngredient = recipe.getIngredients().size() > 1;<NEW_LINE>payload.writeBoolean(secondIngredient);<NEW_LINE>if (secondIngredient) {<NEW_LINE>GlowBufUtils.writeSlot(payload, recipe.getIngredients().get(1));<NEW_LINE>}<NEW_LINE>// todo: no isDisabled() in MerchantRecipe?<NEW_LINE>payload.writeBoolean(false);<NEW_LINE>payload.writeInt(recipe.getUses());<NEW_LINE>payload.writeInt(recipe.getMaxUses());<NEW_LINE>}<NEW_LINE>player.getSession().send(new PluginMessage("MC|TrList", payload.array()));<NEW_LINE>}
().get(0));
375,353
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see<NEW_LINE>* com.sitewhere.device.communication.mqtt.MqttLifecycleComponent#start(com.<NEW_LINE>* sitewhere.spi.server.lifecycle.ILifecycleProgressMonitor)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException {<NEW_LINE>super.start(monitor);<NEW_LINE>this.subscriptionExecutor = Executors.newSingleThreadExecutor(new SubscribersThreadFactory());<NEW_LINE>this.processorsExecutor = Executors.newFixedThreadPool(getConfiguration().getNumThreads(), new ProcessorsThreadFactory());<NEW_LINE>getLogger().info("Receiver connecting to MQTT broker at '" + getBrokerInfo() + "'...");<NEW_LINE>connection = getConnection();<NEW_LINE>getLogger().info("Receiver connected to MQTT broker.");<NEW_LINE>getLogger().info("Suscribing using QoS: " + getConfiguration().getQos());<NEW_LINE>QoS qos = qosFromConfig(getConfiguration().getQos());<NEW_LINE>// Subscribe to chosen topic.<NEW_LINE>Topic[] topics = { new Topic(getConfiguration()<MASK><NEW_LINE>try {<NEW_LINE>Future<byte[]> future = connection.subscribe(topics);<NEW_LINE>future.await();<NEW_LINE>getLogger().info(EventSourcesMessages.SUBSCRIBED_TO_EVENTS_MQTT, getConfiguration().getTopic(), getConfiguration().getNumThreads());<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SiteWhereException("Exception while attempting to subscribe to MQTT topic: " + getConfiguration().getTopic(), e);<NEW_LINE>}<NEW_LINE>// Handle message processing in separate thread.<NEW_LINE>subscriptionExecutor.execute(new MqttSubscriptionProcessor());<NEW_LINE>}
.getTopic(), qos) };
1,581,246
private void doHandleConfirm(boolean ack, Listener listener, PendingConfirm pendingConfirm) {<NEW_LINE>this.executor.execute(() -> {<NEW_LINE>try {<NEW_LINE>if (listener.isConfirmListener()) {<NEW_LINE>if (pendingConfirm.isReturned() && !pendingConfirm.waitForReturnIfNeeded()) {<NEW_LINE>this.logger.error(<MASK><NEW_LINE>}<NEW_LINE>if (this.logger.isDebugEnabled()) {<NEW_LINE>this.logger.debug("Sending confirm " + pendingConfirm);<NEW_LINE>}<NEW_LINE>listener.handleConfirm(pendingConfirm, ack);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>this.logger.error("Exception delivering confirm", e);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (this.afterAckCallback != null) {<NEW_LINE>java.util.function.Consumer<Channel> callback = null;<NEW_LINE>synchronized (this) {<NEW_LINE>if (getPendingConfirmsCount() == 0) {<NEW_LINE>callback = this.afterAckCallback;<NEW_LINE>this.afterAckCallback = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (callback != null) {<NEW_LINE>callback.accept(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>this.logger.error("Failed to invoke afterAckCallback", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
"Return callback failed to execute in " + PendingConfirm.RETURN_CALLBACK_TIMEOUT + " seconds");
202,296
public void marshall(CreateDataRepositoryAssociationRequest createDataRepositoryAssociationRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createDataRepositoryAssociationRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createDataRepositoryAssociationRequest.getFileSystemPath(), FILESYSTEMPATH_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDataRepositoryAssociationRequest.getDataRepositoryPath(), DATAREPOSITORYPATH_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDataRepositoryAssociationRequest.getBatchImportMetaDataOnCreate(), BATCHIMPORTMETADATAONCREATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDataRepositoryAssociationRequest.getImportedFileChunkSize(), IMPORTEDFILECHUNKSIZE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDataRepositoryAssociationRequest.getS3(), S3_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDataRepositoryAssociationRequest.getClientRequestToken(), CLIENTREQUESTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(createDataRepositoryAssociationRequest.getTags(), TAGS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
createDataRepositoryAssociationRequest.getFileSystemId(), FILESYSTEMID_BINDING);
372,790
public static void test4033(String[] args) throws Exception {<NEW_LINE>try {<NEW_LINE>int x;<NEW_LINE>// SSL testing<NEW_LINE>Connection conn = null;<NEW_LINE>String driver = "virtuoso.jdbc4.Driver";<NEW_LINE>Class.forName(driver);<NEW_LINE>String url;<NEW_LINE>if (args.length == 0)<NEW_LINE>url = "jdbc:virtuoso://localhost:1111";<NEW_LINE>else<NEW_LINE>url = args[0];<NEW_LINE>System.out.println("--------------------- Test of Bug #4033 -------------------");<NEW_LINE>System.out.println("URL - " + url);<NEW_LINE>conn = DriverManager.getConnection(url, "dba", "dba");<NEW_LINE>System.<MASK><NEW_LINE>PreparedStatement stmt = null;<NEW_LINE>stmt = conn.prepareStatement("select ?");<NEW_LINE>java.util.Date date;<NEW_LINE>java.util.Calendar c = java.util.Calendar.getInstance();<NEW_LINE>c.set(2001, 5, 10, 1, 2, 3);<NEW_LINE>date = c.getTime();<NEW_LINE>Timestamp ts = new Timestamp(date.getTime());<NEW_LINE>ts.setNanos(0);<NEW_LINE>stmt.setTimestamp(1, ts);<NEW_LINE>System.out.println("insert time: " + ts);<NEW_LINE>ResultSet rs = stmt.executeQuery();<NEW_LINE>rs.next();<NEW_LINE>Timestamp ts_ret = rs.getTimestamp(1);<NEW_LINE>System.out.println("fetch date: " + ts_ret);<NEW_LINE>if (!ts_ret.equals(ts))<NEW_LINE>System.out.print("*** FAILED");<NEW_LINE>else<NEW_LINE>System.out.print("PASSED");<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>System.out.print("*** FAILED");<NEW_LINE>}<NEW_LINE>System.out.println(": Bug #4033 - compat for the dt subtypes");<NEW_LINE>}
out.println("@JBDC connection established through " + driver);
1,215,087
public NetScalerControlCenterVO registerNetscalerControlCenter(RegisterNetscalerControlCenterCmd cmd) {<NEW_LINE>if (_netscalerControlCenterDao.listAll() != null && _netscalerControlCenterDao.listAll().size() != 0) {<NEW_LINE>throw new CloudRuntimeException("One Netscaler Control Center already exist in the DataBase. At a time only one Netscaler Control Center is allowed");<NEW_LINE>}<NEW_LINE>final RegisterNetscalerControlCenterCmd cmdinfo = cmd;<NEW_LINE>String ipAddress = cmd.getIpaddress();<NEW_LINE>Map hostDetails = new HashMap<String, String>();<NEW_LINE>String hostName = "NetscalerControlCenter";<NEW_LINE>hostDetails.put("name", hostName);<NEW_LINE>hostDetails.put("guid", UUID.randomUUID().toString());<NEW_LINE>List<DataCenterVO> dcVO = _dcDao.listEnabledZones();<NEW_LINE>if (dcVO.size() == 0) {<NEW_LINE>throw new CloudRuntimeException("There is no single enabled zone. Please add a zone, enable it and then add Netscaler ControlCenter");<NEW_LINE>}<NEW_LINE>hostDetails.put("zoneId", "1");<NEW_LINE>hostDetails.put("ip", ipAddress);<NEW_LINE>hostDetails.put("username", cmd.getUsername());<NEW_LINE>hostDetails.put(<MASK><NEW_LINE>hostDetails.put("deviceName", "Netscaler ControlCenter");<NEW_LINE>ServerResource resource = new NetScalerControlCenterResource();<NEW_LINE>try {<NEW_LINE>resource.configure(hostName, hostDetails);<NEW_LINE>return Transaction.execute(new TransactionCallback<NetScalerControlCenterVO>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public NetScalerControlCenterVO doInTransaction(TransactionStatus status) {<NEW_LINE>NetScalerControlCenterVO nccVO = new NetScalerControlCenterVO(cmdinfo.getUsername(), DBEncryptionUtil.encrypt(cmdinfo.getPassword()), cmdinfo.getIpaddress(), cmdinfo.getNumretries());<NEW_LINE>_netscalerControlCenterDao.persist(nccVO);<NEW_LINE>return nccVO;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (ConfigurationException e) {<NEW_LINE>resource = null;<NEW_LINE>throw new CloudRuntimeException(e.getMessage());<NEW_LINE>}<NEW_LINE>}
"password", cmd.getPassword());
1,731,987
public void processElement(ProcessContext context, MultiOutputReceiver outputReceiver) {<NEW_LINE><MASK><NEW_LINE>String headers;<NEW_LINE>List<String> records = null;<NEW_LINE>String delimiter = String.valueOf(this.csvFormat.getDelimiter());<NEW_LINE>try {<NEW_LINE>String csvFileString = f.readFullyAsUTF8String();<NEW_LINE>StringReader reader = new StringReader(csvFileString);<NEW_LINE>CSVParser parser = CSVParser.parse(reader, this.csvFormat.withFirstRecordAsHeader());<NEW_LINE>records = parser.getRecords().stream().map(i -> String.join(delimiter, i)).collect(Collectors.toList());<NEW_LINE>headers = String.join(delimiter, parser.getHeaderNames());<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>LOG.error("Headers do not match, consistency cannot be guaranteed");<NEW_LINE>throw new RuntimeException("Could not read Csv headers: " + ioe.getMessage());<NEW_LINE>}<NEW_LINE>outputReceiver.get(this.headerTag).output(headers);<NEW_LINE>records.forEach(r -> outputReceiver.get(this.linesTag).output(r));<NEW_LINE>}
ReadableFile f = context.element();
700,890
protected void surroundLinesInBlock(EditorAdaptor editorAdaptor, TextObject selection) throws CommandExecutionException {<NEW_LINE>CursorService cursor = editorAdaptor.getCursorService();<NEW_LINE>TextContent content = editorAdaptor.getModelContent();<NEW_LINE>TextRange range = selection.getRegion(editorAdaptor, Command.NO_COUNT_GIVEN);<NEW_LINE>TextBlock textBlock = BlockWiseSelection.getTextBlock(range.getStart(), range.getEnd(), content, cursor);<NEW_LINE>for (int line = textBlock.startLine; line <= textBlock.endLine; ++line) {<NEW_LINE>final LineInformation lineInfo = content.getLineInformation(line);<NEW_LINE>Position start = cursor.getPositionByVisualOffset(line, textBlock.startVisualOffset);<NEW_LINE>if (start == null) {<NEW_LINE>// No characters at the start visual offset, fill with spaces<NEW_LINE>start = fillWithSpacesUntil(line, textBlock.startVisualOffset, cursor, content);<NEW_LINE>}<NEW_LINE>Position end = cursor.getPositionByVisualOffset(line, textBlock.endVisualOffset);<NEW_LINE>if (end == null) {<NEW_LINE>final boolean pastEOL = start.getModelOffset<MASK><NEW_LINE>// No characters at the end visual offset, fill with spaces<NEW_LINE>if (isGMode || pastEOL) {<NEW_LINE>end = fillWithSpacesUntil(line, textBlock.endVisualOffset, cursor, content);<NEW_LINE>// Insert space so the delimiter is inserted _after_ the block.<NEW_LINE>content.replace(end.getModelOffset(), 0, " ");<NEW_LINE>} else {<NEW_LINE>end = cursor.newPositionForModelOffset(lineInfo.getEndOffset() - 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>content.replace(start.getModelOffset(), 0, replacement.getLeft());<NEW_LINE>content.replace(end.addModelOffset(1 + replacement.getLeft().length()).getModelOffset(), 0, replacement.getRight());<NEW_LINE>}<NEW_LINE>cursor.setPosition(cursor.getPositionByVisualOffset(textBlock.startLine, textBlock.startVisualOffset), StickyColumnPolicy.ON_CHANGE);<NEW_LINE>}
() > lineInfo.getEndOffset();
449,532
public SearchSessionsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SearchSessionsResult searchSessionsResult = new SearchSessionsResult();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return searchSessionsResult;<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("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>searchSessionsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("sessionSummaries", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>searchSessionsResult.setSessionSummaries(new ListUnmarshaller<SessionSummary>(SessionSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return searchSessionsResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
307,470
private static // org.glowroot.common.repo.util.LazySecretKey.SymmetricEncryptionKeyMissingException<NEW_LINE>Session createMailSession(SmtpConfig smtpConfig, @Nullable String passwordOverride, LazySecretKey lazySecretKey) throws Exception {<NEW_LINE>Properties props = new Properties();<NEW_LINE>props.put("mail.smtp.host", smtpConfig.host());<NEW_LINE>ConnectionSecurity connectionSecurity = smtpConfig.connectionSecurity();<NEW_LINE>Integer port = smtpConfig.port();<NEW_LINE>if (port == null) {<NEW_LINE>port = 25;<NEW_LINE>}<NEW_LINE>props.put("mail.smtp.port", port);<NEW_LINE>if (connectionSecurity == ConnectionSecurity.SSL_TLS) {<NEW_LINE>props.put("mail.smtp.socketFactory.port", port);<NEW_LINE>props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");<NEW_LINE>} else if (connectionSecurity == ConnectionSecurity.STARTTLS) {<NEW_LINE>props.put("mail.smtp.starttls.enable", true);<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, String> entry : smtpConfig.additionalProperties().entrySet()) {<NEW_LINE>props.put(entry.getKey(<MASK><NEW_LINE>}<NEW_LINE>Authenticator authenticator = null;<NEW_LINE>final String password = getPassword(smtpConfig, passwordOverride, lazySecretKey);<NEW_LINE>if (!password.isEmpty()) {<NEW_LINE>props.put("mail.smtp.auth", "true");<NEW_LINE>final String username = smtpConfig.username();<NEW_LINE>authenticator = new Authenticator() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected PasswordAuthentication getPasswordAuthentication() {<NEW_LINE>return new PasswordAuthentication(username, password);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>return Session.getInstance(props, authenticator);<NEW_LINE>}
), entry.getValue());
1,335,494
private static boolean isUnknownHost(String hostname) {<NEW_LINE>if (hostname == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>int length = hostname.length();<NEW_LINE>if (length == 0) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (length < 6) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>char <MASK><NEW_LINE>if (('a' <= firstChar && firstChar <= 'z') || ('A' <= firstChar && firstChar <= 'Z') || (firstChar == '-')) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>char c;<NEW_LINE>c = hostname.charAt(5);<NEW_LINE>if (c == firstChar) {<NEW_LINE>// NOI18N<NEW_LINE>return hostname.substring(1, 5).equalsIgnoreCase("none");<NEW_LINE>}<NEW_LINE>if (length < 9) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>c = hostname.charAt(8);<NEW_LINE>if (c == firstChar) {<NEW_LINE>// NOI18N<NEW_LINE>return hostname.substring(1, 8).equalsIgnoreCase("unknown");<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
firstChar = hostname.charAt(0);
1,851,066
public void encodeEnd(FacesContext context, UIComponent component) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>Hotkey hotkey = (Hotkey) component;<NEW_LINE>String <MASK><NEW_LINE>writer.startElement("script", null);<NEW_LINE>writer.writeAttribute("type", "text/javascript", null);<NEW_LINE>String event = "keydown." + clientId;<NEW_LINE>writer.write("$(function(){");<NEW_LINE>if (!hotkey.isDisabled()) {<NEW_LINE>String bind = hotkey.getBindMac() != null && AgentUtils.isMac(context) ? hotkey.getBindMac() : hotkey.getBind();<NEW_LINE>writer.write("$(document).off('" + event + "').on('" + event + "',null,'" + bind + "',function(){");<NEW_LINE>if (hotkey.isAjaxified()) {<NEW_LINE>String request = preConfiguredAjaxRequestBuilder(context, hotkey).params(hotkey).build();<NEW_LINE>writer.write(request);<NEW_LINE>} else {<NEW_LINE>writer.write(hotkey.getHandler());<NEW_LINE>}<NEW_LINE>writer.write(";return false;});});");<NEW_LINE>} else {<NEW_LINE>writer.write("$(document).off('" + event + "')});");<NEW_LINE>}<NEW_LINE>writer.endElement("script");<NEW_LINE>}
clientId = hotkey.getClientId(context);
1,504,906
/*<NEW_LINE>* This is for performance - so we will not call jaspi processing for a request<NEW_LINE>* if there are no providers registered.<NEW_LINE>*<NEW_LINE>* @see com.ibm.ws.webcontainer.security.JaspiService#isAnyProviderRegistered()<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public boolean isAnyProviderRegistered(WebRequest webRequest) {<NEW_LINE>// default to true for case where a custom factory is used (i.e. not our ProviderRegistry)<NEW_LINE>// we will assume that some provider is registered so we will call jaspi to<NEW_LINE>// process the request.<NEW_LINE>boolean result = true;<NEW_LINE>AuthConfigFactory providerFactory = getAuthConfigFactory();<NEW_LINE>BridgeBuilderService bridgeBuilderService = bridgeBuilderServiceRef.getService();<NEW_LINE>if (bridgeBuilderService != null) {<NEW_LINE>// TODO: Some paths have a WebAppConfig that should be taken into accounnt when getting the appContext<NEW_LINE>JaspiRequest jaspiRequest = new JaspiRequest(webRequest, null);<NEW_LINE>String appContext = jaspiRequest.getAppContext();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (providerFactory != null && providerFactory instanceof ProviderRegistry) {<NEW_LINE>// if the user defined feature provider came or went, process that 1st<NEW_LINE>if (providerConfigModified) {<NEW_LINE>((ProviderRegistry) providerFactory).setProvider(jaspiProviderServiceRef.getService());<NEW_LINE>}<NEW_LINE>providerConfigModified = false;<NEW_LINE>result = ((ProviderRegistry) providerFactory).isAnyProviderRegistered();<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
bridgeBuilderService.buildBridgeIfNeeded(appContext, providerFactory);
1,085,538
public void run() {<NEW_LINE>List<?> selection = getSelectedObjects();<NEW_LINE>IBorderObject model = (IBorderObject) getFirstValidSelectedModelObject(selection);<NEW_LINE>if (model == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CustomColorDialog colorDialog = new CustomColorDialog(getWorkbenchPart().getSite().getShell());<NEW_LINE>// Set default RGB on first selected object<NEW_LINE>RGB defaultRGB = null;<NEW_LINE>String s = model.getBorderColor();<NEW_LINE>if (s != null) {<NEW_LINE>defaultRGB = ColorFactory.convertStringToRGB(s);<NEW_LINE>}<NEW_LINE>if (defaultRGB != null) {<NEW_LINE>colorDialog.setRGB(defaultRGB);<NEW_LINE>} else {<NEW_LINE>colorDialog.setRGB(new RGB<MASK><NEW_LINE>}<NEW_LINE>RGB newColor = colorDialog.open();<NEW_LINE>if (newColor != null) {<NEW_LINE>execute(createCommand(selection, newColor));<NEW_LINE>}<NEW_LINE>}
(0, 0, 0));
424,587
public void updateRotateAndScale(final float dx, final float dy) {<NEW_LINE>float c_x = mHelpBoxRect.centerX();<NEW_LINE>float c_y = mHelpBoxRect.centerY();<NEW_LINE>float x = mRotateDstRect.centerX();<NEW_LINE><MASK><NEW_LINE>float n_x = x + dx;<NEW_LINE>float n_y = y + dy;<NEW_LINE>float xa = x - c_x;<NEW_LINE>float ya = y - c_y;<NEW_LINE>float xb = n_x - c_x;<NEW_LINE>float yb = n_y - c_y;<NEW_LINE>float srcLen = (float) Math.sqrt(xa * xa + ya * ya);<NEW_LINE>float curLen = (float) Math.sqrt(xb * xb + yb * yb);<NEW_LINE>// Calculating a zoom ratio<NEW_LINE>float scale = curLen / srcLen;<NEW_LINE>mScale *= scale;<NEW_LINE>float newWidth = mHelpBoxRect.width() * mScale;<NEW_LINE>if (newWidth < 70) {<NEW_LINE>mScale /= scale;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>double cos = (xa * xb + ya * yb) / (srcLen * curLen);<NEW_LINE>if (cos > 1 || cos < -1)<NEW_LINE>return;<NEW_LINE>float angle = (float) Math.toDegrees(Math.acos(cos));<NEW_LINE>// Determinant calculation to determine the direction of rotation<NEW_LINE>float // Determinant calculation to determine the direction of rotation<NEW_LINE>calMatrix = xa * yb - xb * ya;<NEW_LINE>int flag = calMatrix > 0 ? 1 : -1;<NEW_LINE>angle = flag * angle;<NEW_LINE>mRotateAngle += angle;<NEW_LINE>}
float y = mRotateDstRect.centerY();
683,859
private void addToOpenWithList(SystemApplicationKey app, FileExtensionKey ext, Properties props) throws NativeException {<NEW_LINE>String name = ext.getDotName();<NEW_LINE>String extKey = ext.getKey();<NEW_LINE>String appName = app.getKey();<NEW_LINE>if (app.isAddOpenWithList()) {<NEW_LINE>if (!isEmpty(name) && !isEmpty(extKey) && !isEmpty(appName)) {<NEW_LINE>if (!registry.keyExists(clSection, clKey + name + SEP + OPEN_WITH_LIST_KEY_NAME, appName)) {<NEW_LINE>registry.createKey(clSection, clKey + name + SEP + OPEN_WITH_LIST_KEY_NAME, appName);<NEW_LINE>setExtProperty(<MASK><NEW_LINE>}<NEW_LINE>addCurrentUserOpenWithList(name, extKey, appName, props);<NEW_LINE>if (!registry.keyExists(clSection, clKey + name + SEP + OPEN_WITH_PROGIDS_KEY_NAME)) {<NEW_LINE>registry.createKey(clSection, clKey + name + SEP + OPEN_WITH_PROGIDS_KEY_NAME);<NEW_LINE>setExtProperty(props, name, EXT_HKCR_OPENWITHPROGIDS_PROPERTY, CREATED);<NEW_LINE>}<NEW_LINE>registry.setNoneValue(clSection, clKey + name + SEP + OPEN_WITH_PROGIDS_KEY_NAME, extKey);<NEW_LINE>addCurrentUserOpenWithProgids(name, extKey, appName, props);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
props, name, EXT_HKCR_OPENWITHLIST_PROPERTY, CREATED);
88,000
public void run() {<NEW_LINE>if (jurtQueue == null || jurtThread == null) {<NEW_LINE>cleanupTools.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!jurtThread.isAlive()) {<NEW_LINE>cleanupTools.warn(getName() + ": " + jurtThread.getName() + " is already dead?");<NEW_LINE>}<NEW_LINE>boolean queueIsEmpty = false;<NEW_LINE>while (!queueIsEmpty) {<NEW_LINE>try {<NEW_LINE>cleanupTools.debug(getName() + " goes to sleep for " + threadWaitMs + " ms");<NEW_LINE>Thread.sleep(threadWaitMs);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>// Do nothing<NEW_LINE>}<NEW_LINE>if (State.RUNNABLE != jurtThread.getState()) {<NEW_LINE>// Unless thread is currently executing a Job<NEW_LINE>cleanupTools.debug(getName() + " about to force Garbage Collection");<NEW_LINE>// Force garbage collection, which may put new items on queue<NEW_LINE>CleanupTools.gc();<NEW_LINE>synchronized (jurtQueue) {<NEW_LINE>queueIsEmpty = jurtQueue.isEmpty();<NEW_LINE>cleanupTools.debug(getName() + ": JURT queue is empty? " + queueIsEmpty);<NEW_LINE>}<NEW_LINE>} else<NEW_LINE>cleanupTools.debug(getName() + ": JURT thread " + jurtThread.getName() + " is executing Job");<NEW_LINE>}<NEW_LINE>cleanupTools.info(getName() + " about to kill " + jurtThread);<NEW_LINE>if (jurtThread.isAlive()) {<NEW_LINE>// noinspection deprecation<NEW_LINE>jurtThread.stop();<NEW_LINE>}<NEW_LINE>}
error(getName() + ": No queue or thread!?");
1,454,788
private void populateImpassableRoadsTypes() {<NEW_LINE>for (Map.Entry<String, Boolean> entry : routingParametersMap.entrySet()) {<NEW_LINE>final <MASK><NEW_LINE>boolean selected = entry.getValue();<NEW_LINE>GeneralRouter.RoutingParameter parameter = routingOptionsHelper.getRoutingPrefsForAppModeById(app.getRoutingHelper().getAppMode(), parameterId);<NEW_LINE>String defValue = "";<NEW_LINE>if (parameter != null) {<NEW_LINE>defValue = parameter.getName();<NEW_LINE>}<NEW_LINE>String parameterName = AndroidUtils.getRoutingStringPropertyName(app, parameterId, defValue);<NEW_LINE>final BottomSheetItemWithCompoundButton[] item = new BottomSheetItemWithCompoundButton[1];<NEW_LINE>item[0] = (BottomSheetItemWithCompoundButton) new BottomSheetItemWithCompoundButton.Builder().setCompoundButtonColor(compoundButtonColor).setChecked(selected).setTitle(parameterName).setLayoutId(R.layout.bottom_sheet_item_with_switch_no_icon).setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>item[0].setChecked(!item[0].isChecked());<NEW_LINE>routingParametersMap.put(parameterId, item[0].isChecked());<NEW_LINE>}<NEW_LINE>}).setTag(parameterId).create();<NEW_LINE>items.add(item[0]);<NEW_LINE>}<NEW_LINE>}
String parameterId = entry.getKey();
1,406,325
private void toggleUnlimited(final User user, final User target, final String item) throws Exception {<NEW_LINE>final ItemStack stack = ess.getItemDb().get(item, 1);<NEW_LINE>stack.setAmount(Math.min(stack.getType().getMaxStackSize(), 2));<NEW_LINE>final String itemname = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "");<NEW_LINE>if (ess.getSettings().permissionBasedItemSpawn() && !user.isAuthorized("essentials.unlimited.item-all") && !user.isAuthorized("essentials.unlimited.item-" + itemname) && !((stack.getType() == Material.WATER_BUCKET || stack.getType() == Material.LAVA_BUCKET) && user.isAuthorized("essentials.unlimited.item-bucket"))) {<NEW_LINE>throw new Exception<MASK><NEW_LINE>}<NEW_LINE>String message = "disableUnlimited";<NEW_LINE>boolean enableUnlimited = false;<NEW_LINE>if (!target.hasUnlimited(stack)) {<NEW_LINE>message = "enableUnlimited";<NEW_LINE>enableUnlimited = true;<NEW_LINE>if (!target.getBase().getInventory().containsAtLeast(stack, stack.getAmount())) {<NEW_LINE>target.getBase().getInventory().addItem(stack);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (user != target) {<NEW_LINE>user.sendMessage(tl(message, itemname, target.getDisplayName()));<NEW_LINE>}<NEW_LINE>target.sendMessage(tl(message, itemname, target.getDisplayName()));<NEW_LINE>target.setUnlimited(stack, enableUnlimited);<NEW_LINE>}
(tl("unlimitedItemPermission", itemname));
1,028,133
public void validateProdProcess(ProdProcess prodProcess, BillOfMaterial bom) throws AxelorException {<NEW_LINE>Map<Product, BigDecimal> bomMap = new HashMap<Product, BigDecimal>();<NEW_LINE>Set<BillOfMaterial> setBoM = MoreObjects.firstNonNull(bom.getBillOfMaterialSet(), Collections.emptySet());<NEW_LINE>for (BillOfMaterial bomIt : setBoM) {<NEW_LINE>bomMap.put(bomIt.getProduct(), bomIt.getQty());<NEW_LINE>}<NEW_LINE>List<ProdProcessLine> listPPL = MoreObjects.firstNonNull(prodProcess.getProdProcessLineList(), Collections.emptyList());<NEW_LINE>for (ProdProcessLine prodProcessLine : listPPL) {<NEW_LINE>List<ProdProduct> listPP = MoreObjects.firstNonNull(prodProcessLine.getToConsumeProdProductList(), Collections.emptyList());<NEW_LINE>for (ProdProduct prodProduct : listPP) {<NEW_LINE>if (!bomMap.containsKey(prodProduct.getProduct())) {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, I18n.get(IExceptionMessage.PROD_PROCESS_USELESS_PRODUCT), prodProduct.getProduct().getName());<NEW_LINE>}<NEW_LINE>bomMap.put(prodProduct.getProduct(), bomMap.get(prodProduct.getProduct()).subtract<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<Product> keyList = bomMap.keySet();<NEW_LINE>Map<Product, BigDecimal> copyMap = new HashMap<Product, BigDecimal>();<NEW_LINE>List<String> nameProductList = new ArrayList<String>();<NEW_LINE>for (Product product : keyList) {<NEW_LINE>if (bomMap.get(product).compareTo(BigDecimal.ZERO) > 0) {<NEW_LINE>copyMap.put(product, bomMap.get(product));<NEW_LINE>nameProductList.add(product.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!copyMap.isEmpty()) {<NEW_LINE>throw new AxelorException(TraceBackRepository.CATEGORY_CONFIGURATION_ERROR, I18n.get(IExceptionMessage.PROD_PROCESS_MISS_PRODUCT), Joiner.on(",").join(nameProductList));<NEW_LINE>}<NEW_LINE>}
(prodProduct.getQty()));
1,102,692
final CreateLogPatternResult executeCreateLogPattern(CreateLogPatternRequest createLogPatternRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createLogPatternRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateLogPatternRequest> request = null;<NEW_LINE>Response<CreateLogPatternResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateLogPatternRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Insights");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateLogPattern");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateLogPatternResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateLogPatternResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(createLogPatternRequest));
729,892
public ItemStack assemble(CraftingContainer inv) {<NEW_LINE>int[] colourArray = new int[3];<NEW_LINE>int j = 0;<NEW_LINE>int totalColourSets = 0;<NEW_LINE>ItemStack bullet = ItemStack.EMPTY;<NEW_LINE>for (int i = 0; i < inv.getContainerSize(); i++) {<NEW_LINE>ItemStack stackInSlot = inv.getItem(i);<NEW_LINE>if (!stackInSlot.isEmpty())<NEW_LINE>if (bullet.isEmpty() && isFlareBullet(stackInSlot)) {<NEW_LINE>bullet = stackInSlot;<NEW_LINE>int colour = ((IColouredItem) bullet.getItem()).getColourForIEItem(bullet, 1);<NEW_LINE>float r = (float) (colour >> 16 & 255) / 255.0F;<NEW_LINE>float g = (float) (colour >> 8 & 255) / 255.0F;<NEW_LINE>float b = (float) (colour & 255) / 255.0F;<NEW_LINE>j = (int) ((float) j + Math.max(r, Math.max(g, b)) * 255.0F);<NEW_LINE>colourArray[0] = (int) ((float) colourArray[0] + r * 255.0F);<NEW_LINE>colourArray[1] = (int) ((float) colourArray[1] + g * 255.0F);<NEW_LINE>colourArray[2] = (int) ((float) colourArray[2] + b * 255.0F);<NEW_LINE>++totalColourSets;<NEW_LINE>} else if (Utils.isDye(stackInSlot)) {<NEW_LINE>float[] afloat = Utils.getDye(stackInSlot).getTextureDiffuseColors();<NEW_LINE>int r = (int) (afloat[0] * 255.0F);<NEW_LINE>int g = (int) (afloat[1] * 255.0F);<NEW_LINE>int b = (int) (afloat[2] * 255.0F);<NEW_LINE>j += Math.max(r, Math.max(g, b));<NEW_LINE>colourArray[0] += r;<NEW_LINE>colourArray[1] += g;<NEW_LINE>colourArray[2] += b;<NEW_LINE>++totalColourSets;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!bullet.isEmpty()) {<NEW_LINE>ItemStack newBullet = ItemHandlerHelper.copyStackWithSize(bullet, 1);<NEW_LINE>int r = colourArray[0] / totalColourSets;<NEW_LINE>int g = colourArray[1] / totalColourSets;<NEW_LINE>int b = colourArray[2] / totalColourSets;<NEW_LINE>float colourMod = (<MASK><NEW_LINE>float highestColour = (float) Math.max(r, Math.max(g, b));<NEW_LINE>r = (int) ((float) r * colourMod / highestColour);<NEW_LINE>g = (int) ((float) g * colourMod / highestColour);<NEW_LINE>b = (int) ((float) b * colourMod / highestColour);<NEW_LINE>int newColour = (r << 8) + g;<NEW_LINE>newColour = (newColour << 8) + b;<NEW_LINE>ItemNBTHelper.putInt(newBullet, "flareColour", newColour);<NEW_LINE>return newBullet;<NEW_LINE>}<NEW_LINE>return ItemStack.EMPTY;<NEW_LINE>}
float) j / (float) totalColourSets;
656,985
public List<LineDoc> linearize(int indent, boolean indentFirst) {<NEW_LINE>List<LineDoc> result = top.linearize(indent, indentFirst);<NEW_LINE>if (result.isEmpty()) {<NEW_LINE>return bottom.linearize(indent + INDENT, indentFirst);<NEW_LINE>}<NEW_LINE>if (bottom.isNull()) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>LineDoc lineDoc = result.get(0);<NEW_LINE>if (result.size() == 1 && (bottom.isSingleLine() || lineDoc.getWidth() + (bottom.isEmpty() ? 0 : 1) <= MAX_INDENT)) {<NEW_LINE>result = bottom.linearize(lineDoc.getWidth() + 1, false);<NEW_LINE>lineDoc = hList(lineDoc, text(" "), result.get(0));<NEW_LINE>if (result.size() == 1) {<NEW_LINE>result = Collections.singletonList(lineDoc);<NEW_LINE>} else {<NEW_LINE>result.set(0, lineDoc);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>List<LineDoc> bottomLines = bottom.<MASK><NEW_LINE>if (result.size() == 1) {<NEW_LINE>result = new ArrayList<>(bottomLines.size() + 1);<NEW_LINE>result.add(lineDoc);<NEW_LINE>}<NEW_LINE>result.addAll(bottomLines);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
linearize(indent + INDENT, true);
135,241
public void updateAllCentralAdminConfig(AllCentralAdminConfig config, @Nullable String priorVersion) throws Exception {<NEW_LINE>validatePagerDutyConfig(config.pagerDuty());<NEW_LINE><MASK><NEW_LINE>if (priorVersion == null) {<NEW_LINE>centralConfigDao.writeWithoutOptimisticLocking(GENERAL_KEY, config.general());<NEW_LINE>centralConfigDao.writeWithoutOptimisticLocking(WEB_KEY, config.web());<NEW_LINE>centralConfigDao.writeWithoutOptimisticLocking(STORAGE_KEY, config.storage());<NEW_LINE>centralConfigDao.writeWithoutOptimisticLocking(SMTP_KEY, config.smtp());<NEW_LINE>centralConfigDao.writeWithoutOptimisticLocking(HTTP_PROXY_KEY, config.httpProxy());<NEW_LINE>centralConfigDao.writeWithoutOptimisticLocking(LDAP_KEY, config.ldap());<NEW_LINE>centralConfigDao.writeWithoutOptimisticLocking(PAGER_DUTY_KEY, config.pagerDuty());<NEW_LINE>centralConfigDao.writeWithoutOptimisticLocking(SLACK_KEY, config.slack());<NEW_LINE>writeUsersWithoutOptimisticLocking(config.users());<NEW_LINE>writeRolesWithoutOptimisticLocking(config.roles());<NEW_LINE>} else {<NEW_LINE>AllCentralAdminConfig currConfig = getAllCentralAdminConfig();<NEW_LINE>if (!priorVersion.equals(currConfig.version())) {<NEW_LINE>throw new OptimisticLockException();<NEW_LINE>}<NEW_LINE>centralConfigDao.write(GENERAL_KEY, config.general(), currConfig.general().version());<NEW_LINE>centralConfigDao.write(WEB_KEY, config.web(), currConfig.web().version());<NEW_LINE>centralConfigDao.write(STORAGE_KEY, config.storage(), currConfig.storage().version());<NEW_LINE>centralConfigDao.write(SMTP_KEY, config.smtp(), currConfig.smtp().version());<NEW_LINE>centralConfigDao.write(HTTP_PROXY_KEY, config.httpProxy(), currConfig.httpProxy().version());<NEW_LINE>centralConfigDao.write(LDAP_KEY, config.ldap(), currConfig.ldap().version());<NEW_LINE>centralConfigDao.write(PAGER_DUTY_KEY, config.pagerDuty(), currConfig.pagerDuty().version());<NEW_LINE>centralConfigDao.write(SLACK_KEY, config.slack(), currConfig.slack().version());<NEW_LINE>// there is currently no optimistic locking when updating users<NEW_LINE>writeUsersWithoutOptimisticLocking(config.users());<NEW_LINE>writeRolesWithoutOptimisticLocking(config.roles());<NEW_LINE>}<NEW_LINE>}
validateSlackConfig(config.slack());
158,624
protected ActionResult<List<Wo>> execute(EffectivePerson effectivePerson, JsonElement jsonElement) throws Exception {<NEW_LINE>ActionResult<List<Wo>> result = new ActionResult<>();<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>Work work = null;<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>work = emc.find(wi.<MASK><NEW_LINE>if (null == work) {<NEW_LINE>throw new ExceptionEntityNotExist(wi.getWork(), WorkCompleted.class);<NEW_LINE>}<NEW_LINE>WoControl control = business.getControl(effectivePerson, work, WoControl.class);<NEW_LINE>if (!control.getAllowVisit()) {<NEW_LINE>throw new ExceptionAccessDenied(effectivePerson, work);<NEW_LINE>}<NEW_LINE>List<String> people = business.organization().person().list(wi.getPersonList());<NEW_LINE>if (ListTools.isEmpty(people)) {<NEW_LINE>throw new ExceptionPersonEmpty();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Wo> wos = ThisApplication.context().applications().postQuery(x_processplatform_service_processing.class, Applications.joinQueryUri("review", "create", "work"), wi, work.getJob()).getDataAsList(Wo.class);<NEW_LINE>result.setData(wos);<NEW_LINE>return result;<NEW_LINE>}
getWork(), Work.class);
1,674,641
private static void configureTrustStore(ConfigElementList<KeyStore> keyStores, Integer port, Map<String, Object> serverProperties, SpringBootConfigFactory configFactory, Function<String, URL> urlGetter) {<NEW_LINE>KeyStore keyStore = new KeyStore();<NEW_LINE>keyStores.add(keyStore);<NEW_LINE>keyStore.setId(ID_TRUST_STORE + port);<NEW_LINE>URL trustStoreURL = urlGetter.apply((String) serverProperties.get(SSL_TRUST_STORE));<NEW_LINE>;<NEW_LINE><MASK><NEW_LINE>String trustStoreName = trustStoreURLString.substring(trustStoreURLString.lastIndexOf("/") + 1);<NEW_LINE>int dot = trustStoreName.lastIndexOf(".");<NEW_LINE>trustStoreName = trustStoreName.substring(0, dot) + "-" + port + trustStoreName.substring(dot);<NEW_LINE>File trustStoreDir = new File(configFactory.getServerDir(), SECURITY_DIR);<NEW_LINE>File trustStoreFile = new File(trustStoreDir, trustStoreName);<NEW_LINE>try (InputStream in = trustStoreURL.openStream()) {<NEW_LINE>writeFile(in, trustStoreFile);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException("Unable to copy truststore to server home/resources/security directory.", e);<NEW_LINE>}<NEW_LINE>keyStore.setLocation(trustStoreName);<NEW_LINE>String tsPass = (String) serverProperties.get(SSL_TRUST_STORE_PASSWORD);<NEW_LINE>if (tsPass != null) {<NEW_LINE>keyStore.setPassword(tsPass);<NEW_LINE>}<NEW_LINE>String tsType = (String) serverProperties.get(SSL_TRUST_STORE_TYPE);<NEW_LINE>if (tsType != null) {<NEW_LINE>keyStore.setType(tsType);<NEW_LINE>}<NEW_LINE>String provider = (String) serverProperties.get(SSL_TRUST_STORE_PROVIDER);<NEW_LINE>if (provider != null) {<NEW_LINE>keyStore.setExtraAttribute("provider", provider);<NEW_LINE>}<NEW_LINE>}
String trustStoreURLString = trustStoreURL.toString();
163,571
public static void renderWires(TilePipeHolder pipe, double x, double y, double z, BufferBuilder bb) {<NEW_LINE>int combinedLight = pipe.getWorld().getCombinedLight(pipe.getPipePos(), 0);<NEW_LINE>int <MASK><NEW_LINE>int blockLight = combinedLight & 0xFFFF;<NEW_LINE>RenderHelper.disableStandardItemLighting();<NEW_LINE>GlStateManager.pushMatrix();<NEW_LINE>GlStateManager.translate(x, y, z);<NEW_LINE>for (Map.Entry<EnumWirePart, EnumDyeColor> partColor : pipe.getWireManager().parts.entrySet()) {<NEW_LINE>EnumWirePart part = partColor.getKey();<NEW_LINE>EnumDyeColor color = partColor.getValue();<NEW_LINE>boolean isOn = pipe.wireManager.isPowered(part);<NEW_LINE>int idx = getIndex(part, color, isOn);<NEW_LINE>if (wireRenderingCache[idx] == -1) {<NEW_LINE>wireRenderingCache[idx] = compileWire(part, color, isOn);<NEW_LINE>}<NEW_LINE>OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, isOn ? 240 : blockLight, skyLight);<NEW_LINE>GlStateManager.callList(wireRenderingCache[idx]);<NEW_LINE>}<NEW_LINE>for (Map.Entry<EnumWireBetween, EnumDyeColor> betweenColor : pipe.getWireManager().betweens.entrySet()) {<NEW_LINE>EnumWireBetween between = betweenColor.getKey();<NEW_LINE>EnumDyeColor color = betweenColor.getValue();<NEW_LINE>boolean isOn = pipe.wireManager.isPowered(between.parts[0]);<NEW_LINE>int idx = getIndex(between, color, isOn);<NEW_LINE>if (wireRenderingCache[idx] == -1) {<NEW_LINE>wireRenderingCache[idx] = compileWire(between, color, isOn);<NEW_LINE>}<NEW_LINE>OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, isOn ? 240 : blockLight, skyLight);<NEW_LINE>GlStateManager.callList(wireRenderingCache[idx]);<NEW_LINE>}<NEW_LINE>GlStateManager.popMatrix();<NEW_LINE>GlStateManager.enableLighting();<NEW_LINE>GL11.glColor3f(1, 1, 1);<NEW_LINE>GlStateManager.color(1, 1, 1, 1);<NEW_LINE>}
skyLight = combinedLight >> 16 & 0xFFFF;
1,487,466
private AddressDefinition pickInterfaceAddressDef() throws UnknownHostException, SocketException {<NEW_LINE>Collection<MASK><NEW_LINE>if (interfaces.contains(new InterfaceDefinition("localhost", "127.0.0.1"))) {<NEW_LINE>return pickLoopbackAddress("localhost");<NEW_LINE>}<NEW_LINE>if (interfaces.contains(new InterfaceDefinition("127.0.0.1"))) {<NEW_LINE>return pickLoopbackAddress(null);<NEW_LINE>}<NEW_LINE>if (logger.isFineEnabled()) {<NEW_LINE>logger.fine("Prefer IPv4 stack is " + preferIPv4Stack() + ", prefer IPv6 addresses is " + preferIPv6Addresses());<NEW_LINE>}<NEW_LINE>if (!interfaces.isEmpty()) {<NEW_LINE>AddressDefinition addressDef = pickMatchingAddress(interfaces);<NEW_LINE>if (addressDef != null) {<NEW_LINE>return addressDef;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (interfacesConfig.isEnabled()) {<NEW_LINE>String msg = "Hazelcast CANNOT start on this node. No matching network interface found.\n" + "Interface matching must be either disabled or updated in the hazelcast.xml config file.";<NEW_LINE>logger.severe(msg);<NEW_LINE>throw new RuntimeException(msg);<NEW_LINE>}<NEW_LINE>if (tcpIpConfig.isEnabled()) {<NEW_LINE>logger.warning("Could not find a matching address to start with! Picking one of non-loopback addresses.");<NEW_LINE>}<NEW_LINE>return pickMatchingAddress(null);<NEW_LINE>}
<InterfaceDefinition> interfaces = getInterfaces();
391,802
private void stepDisable(Map<String, Map<String, Object>> dirtyprops) throws IOException {<NEW_LINE>LOG.fine("ModuleList: stepDisable");<NEW_LINE>Set<Module> todisable <MASK><NEW_LINE>for (Map.Entry<String, Map<String, Object>> entry : dirtyprops.entrySet()) {<NEW_LINE>String cnb = entry.getKey();<NEW_LINE>Map<String, Object> props = entry.getValue();<NEW_LINE>if (props.get("enabled") == null || !((Boolean) props.get("enabled")).booleanValue()) {<NEW_LINE>// NOI18N<NEW_LINE>DiskStatus status = statuses.get(cnb);<NEW_LINE>// #159001<NEW_LINE>assert status != null : cnb;<NEW_LINE>if (Boolean.TRUE.equals(status.diskProps.get("enabled"))) {<NEW_LINE>// NOI18N<NEW_LINE>// NOI18N<NEW_LINE>if (!status.module.isEnabled())<NEW_LINE>throw new IllegalStateException("Already disabled: " + status.module);<NEW_LINE>todisable.add(status.module);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (todisable.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Module> reallydisable = mgr.simulateDisable(todisable);<NEW_LINE>for (Module m : reallydisable) {<NEW_LINE>if (!m.isAutoload() && !m.isEager() && !todisable.contains(m)) {<NEW_LINE>todisable.add(m);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mgr.disable(todisable);<NEW_LINE>}
= new HashSet<Module>();
1,545,130
public static void apiManagementCreateSchema1(com.azure.resourcemanager.apimanagement.ApiManagementManager manager) {<NEW_LINE>manager.globalSchemas().define("schema1").withExistingService("rg1", "apimService1").withSchemaType(SchemaType.XML).withDescription("sample schema description").withValue("<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\r\n" + " xmlns:tns=\"http://tempuri.org/PurchaseOrderSchema.xsd\"\r\n" + " targetNamespace=\"http://tempuri.org/PurchaseOrderSchema.xsd\"\r\n" + " elementFormDefault=\"qualified\">\r\n" + " <xsd:element name=\"PurchaseOrder\" type=\"tns:PurchaseOrderType\"/>\r\n" + " <xsd:complexType name=\"PurchaseOrderType\">\r\n" + " <xsd:sequence>\r\n" + " <xsd:element name=\"ShipTo\" type=\"tns:USAddress\" maxOccurs=\"2\"/>\r\n" + " <xsd:element name=\"BillTo\" type=\"tns:USAddress\"/>\r\n" + " </xsd:sequence>\r\n" + " <xsd:attribute name=\"OrderDate\" type=\"xsd:date\"/>\r\n" + " </xsd:complexType>\r\n\r\n" + " <xsd:complexType name=\"USAddress\">\r\n" + " <xsd:sequence>\r\n" + " <xsd:element name=\"name\" type=\"xsd:string\"/>\r\n" + " <xsd:element name=\"street\" type=\"xsd:string\"/>\r\n" + " <xsd:element name=\"city\" type=\"xsd:string\"/>\r\n" + " <xsd:element name=\"state\" type=\"xsd:string\"/>\r\n" + " <xsd:element name=\"zip\" type=\"xsd:integer\"/>\r\n" + " </xsd:sequence>\r\n" + " <xsd:attribute name=\"country\" type=\"xsd:NMTOKEN\" fixed=\"US\"/>\r\n" + <MASK><NEW_LINE>}
" </xsd:complexType>\r\n" + "</xsd:schema>").create();
1,654,022
final GetDocumentResult executeGetDocument(GetDocumentRequest getDocumentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDocumentRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDocumentRequest> request = null;<NEW_LINE>Response<GetDocumentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetDocumentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDocumentRequest));<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, "WorkDocs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDocument");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDocumentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDocumentResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,247,258
static String responseToXml(String endpointName, ApiResponse response) throws ApiException {<NEW_LINE>try {<NEW_LINE>DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();<NEW_LINE>DocumentBuilder docBuilder = docFactory.newDocumentBuilder();<NEW_LINE><MASK><NEW_LINE>Element rootElement = doc.createElement(endpointName);<NEW_LINE>doc.appendChild(rootElement);<NEW_LINE>response.toXML(doc, rootElement);<NEW_LINE>TransformerFactory transformerFactory = TransformerFactory.newInstance();<NEW_LINE>Transformer transformer = transformerFactory.newTransformer();<NEW_LINE>DOMSource source = new DOMSource(doc);<NEW_LINE>StringWriter sw = new StringWriter();<NEW_LINE>StreamResult result = new StreamResult(sw);<NEW_LINE>transformer.transform(source, result);<NEW_LINE>return sw.toString();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Failed to convert API response to XML: " + e.getMessage(), e);<NEW_LINE>throw new ApiException(ApiException.Type.INTERNAL_ERROR, e);<NEW_LINE>}<NEW_LINE>}
Document doc = docBuilder.newDocument();
1,434,108
private void action_loadBOM() {<NEW_LINE>int M_Product_ID = getM_Product_ID();<NEW_LINE>if (M_Product_ID == 0)<NEW_LINE>return;<NEW_LINE>MProduct product = MProduct.get(getCtx(), M_Product_ID);<NEW_LINE>SimpleTreeNode parent = new SimpleTreeNode(productSummary(product, false), new ArrayList());<NEW_LINE>dataBOM.clear();<NEW_LINE>if (isImplosion()) {<NEW_LINE>try {<NEW_LINE>m_tree.setModel(null);<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>if (m_tree.getTreecols() != null)<NEW_LINE>m_tree.getTreecols().detach();<NEW_LINE>if (m_tree.getTreefoot() != null)<NEW_LINE>m_tree.getTreefoot().detach();<NEW_LINE>if (m_tree.getTreechildren() != null)<NEW_LINE>m_tree.getTreechildren().detach();<NEW_LINE>for (MPPProductBOMLine bomline : MPPProductBOMLine.getByProduct(product)) {<NEW_LINE>parent.getChildren().add(parent(bomline));<NEW_LINE>}<NEW_LINE>Treecols treeCols = new Treecols();<NEW_LINE>m_tree.appendChild(treeCols);<NEW_LINE>Treecol treeCol = new Treecol();<NEW_LINE>treeCols.appendChild(treeCol);<NEW_LINE>SimpleTreeModel model = new SimpleTreeModel(parent);<NEW_LINE>m_tree.setPageSize(-1);<NEW_LINE>m_tree.setTreeitemRenderer(model);<NEW_LINE>m_tree.setModel(model);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>m_tree.setModel(null);<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>if (m_tree.getTreecols() != null)<NEW_LINE>m_tree.getTreecols().detach();<NEW_LINE>if (m_tree.getTreefoot() != null)<NEW_LINE>m_tree.getTreefoot().detach();<NEW_LINE>if (m_tree.getTreechildren() != null)<NEW_LINE>m_tree<MASK><NEW_LINE>for (MPPProductBOM bom : MPPProductBOM.getProductBOMs(product)) {<NEW_LINE>parent.getChildren().add(parent(bom));<NEW_LINE>}<NEW_LINE>Treecols treeCols = new Treecols();<NEW_LINE>m_tree.appendChild(treeCols);<NEW_LINE>Treecol treeCol = new Treecol();<NEW_LINE>treeCols.appendChild(treeCol);<NEW_LINE>SimpleTreeModel model = new SimpleTreeModel(parent);<NEW_LINE>m_tree.setPageSize(-1);<NEW_LINE>m_tree.setTreeitemRenderer(model);<NEW_LINE>m_tree.setModel(model);<NEW_LINE>}<NEW_LINE>m_tree.addEventListener(Events.ON_SELECTION, this);<NEW_LINE>loadTableBOM();<NEW_LINE>}
.getTreechildren().detach();
720,376
protected <T> T toPrimitiveJavaType(String json, Class<T> type) {<NEW_LINE>json = jsonHelper.cleanString(json);<NEW_LINE>if (typeIsString(type)) {<NEW_LINE>return (T) json;<NEW_LINE>}<NEW_LINE>if (typeIsInteger(type)) {<NEW_LINE>return (T) Integer.valueOf(json);<NEW_LINE>}<NEW_LINE>if (typeIsBoolean(type)) {<NEW_LINE>return (T) Boolean.valueOf(json);<NEW_LINE>}<NEW_LINE>if (typeIsLong(type)) {<NEW_LINE>return (T) Long.valueOf(json);<NEW_LINE>}<NEW_LINE>if (typeIsDouble(type)) {<NEW_LINE>return (T) Double.valueOf(json);<NEW_LINE>}<NEW_LINE>if (typeIsFloat(type)) {<NEW_LINE>return (T) Float.valueOf(json);<NEW_LINE>}<NEW_LINE>if (typeIsBigInteger(type)) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>if (typeIsBigDecimal(type)) {<NEW_LINE>return (T) new BigDecimal(json);<NEW_LINE>}<NEW_LINE>throw new FacebookJsonMappingException("Don't know how to map JSON to " + type + ". Are you sure you're mapping to the right class?\nOffending JSON is '" + json + "'.");<NEW_LINE>}
(T) new BigInteger(json);
573,931
public static void main(String[] args) {<NEW_LINE>ServiceNamespace ns = ServiceNamespace.Dynamodb;<NEW_LINE>ScalableDimension tableWCUs = ScalableDimension.DynamodbTableWriteCapacityUnits;<NEW_LINE>String resourceID = "table/TestTable";<NEW_LINE>// Delete the scaling policy<NEW_LINE>DeleteScalingPolicyRequest delSPRequest = new DeleteScalingPolicyRequest().withServiceNamespace(ns).withScalableDimension(tableWCUs).withResourceId(resourceID).withPolicyName("MyScalingPolicy");<NEW_LINE>try {<NEW_LINE>aaClient.deleteScalingPolicy(delSPRequest);<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("Unable to delete scaling policy: ");<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE>}<NEW_LINE>// Verify that the scaling policy was deleted<NEW_LINE>DescribeScalingPoliciesRequest descSPRequest = new DescribeScalingPoliciesRequest().withServiceNamespace(ns).withScalableDimension(tableWCUs).withResourceId(resourceID);<NEW_LINE>try {<NEW_LINE>DescribeScalingPoliciesResult dspResult = aaClient.describeScalingPolicies(descSPRequest);<NEW_LINE>System.out.println("DescribeScalingPolicies result: ");<NEW_LINE>System.out.println(dspResult);<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>System.err.println("Unable to describe scaling policy: ");<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>// Remove the scalable target<NEW_LINE>DeregisterScalableTargetRequest delSTRequest = new DeregisterScalableTargetRequest().withServiceNamespace(ns).withScalableDimension(tableWCUs).withResourceId(resourceID);<NEW_LINE>try {<NEW_LINE>aaClient.deregisterScalableTarget(delSTRequest);<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("Unable to deregister scalable target: ");<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE>}<NEW_LINE>// Verify that the scalable target was removed<NEW_LINE>DescribeScalableTargetsRequest dscRequest = new DescribeScalableTargetsRequest().withServiceNamespace(ns).withScalableDimension(tableWCUs).withResourceIds(resourceID);<NEW_LINE>try {<NEW_LINE>DescribeScalableTargetsResult dsaResult = aaClient.describeScalableTargets(dscRequest);<NEW_LINE><MASK><NEW_LINE>System.out.println(dsaResult);<NEW_LINE>System.out.println();<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("Unable to describe scalable target: ");<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE>}<NEW_LINE>}
System.out.println("DescribeScalableTargets result: ");
419,953
private static String message(Index index, ParsedDocument doc, long tookInNanos, boolean reformat, int maxSourceCharsToLog) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(index).append(" ");<NEW_LINE>sb.append("took[").append(TimeValue.timeValueNanos(tookInNanos)).append("], ");<NEW_LINE>sb.append("took_millis[").append(TimeUnit.NANOSECONDS.toMillis(tookInNanos)).append("], ");<NEW_LINE>sb.append("id[").append(doc.id<MASK><NEW_LINE>if (doc.routing() == null) {<NEW_LINE>sb.append("routing[]");<NEW_LINE>} else {<NEW_LINE>sb.append("routing[").append(doc.routing()).append("]");<NEW_LINE>}<NEW_LINE>if (maxSourceCharsToLog == 0 || doc.source() == null || doc.source().length() == 0) {<NEW_LINE>return sb.toString();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String source = XContentHelper.convertToJson(doc.source(), reformat, doc.getXContentType());<NEW_LINE>sb.append(", source[").append(Strings.cleanTruncate(source, maxSourceCharsToLog).trim()).append("]");<NEW_LINE>} catch (IOException e) {<NEW_LINE>sb.append(", source[_failed_to_convert_[").append(e.getMessage()).append("]]");<NEW_LINE>final String message = String.format(Locale.ROOT, "failed to convert source for slow log entry [%s]", sb.toString());<NEW_LINE>throw new UncheckedIOException(message, e);<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
()).append("], ");
653,065
public void removeLeafEntry(final int entryIndex, byte[] key, byte[] value) {<NEW_LINE>final int entryPosition = getIntValue(POSITIONS_ARRAY_OFFSET + entryIndex * OIntegerSerializer.INT_SIZE);<NEW_LINE>final int entrySize;<NEW_LINE>if (isLeaf()) {<NEW_LINE>entrySize = key.length + RID_SIZE;<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Remove is applies to leaf buckets only");<NEW_LINE>}<NEW_LINE>int size = getIntValue(SIZE_OFFSET);<NEW_LINE>if (entryIndex < size - 1) {<NEW_LINE>moveData(POSITIONS_ARRAY_OFFSET + (entryIndex + 1) * OIntegerSerializer.INT_SIZE, POSITIONS_ARRAY_OFFSET + entryIndex * OIntegerSerializer.INT_SIZE, (size - entryIndex <MASK><NEW_LINE>}<NEW_LINE>size--;<NEW_LINE>setIntValue(SIZE_OFFSET, size);<NEW_LINE>final int freePointer = getIntValue(FREE_POINTER_OFFSET);<NEW_LINE>if (size > 0 && entryPosition > freePointer) {<NEW_LINE>moveData(freePointer, freePointer + entrySize, entryPosition - freePointer);<NEW_LINE>}<NEW_LINE>setIntValue(FREE_POINTER_OFFSET, freePointer + entrySize);<NEW_LINE>int currentPositionOffset = POSITIONS_ARRAY_OFFSET;<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>final int currentEntryPosition = getIntValue(currentPositionOffset);<NEW_LINE>if (currentEntryPosition < entryPosition) {<NEW_LINE>setIntValue(currentPositionOffset, currentEntryPosition + entrySize);<NEW_LINE>}<NEW_LINE>currentPositionOffset += OIntegerSerializer.INT_SIZE;<NEW_LINE>}<NEW_LINE>addPageOperation(new CellBTreeBucketSingleValueV1RemoveLeafEntryPO(entryIndex, key, value));<NEW_LINE>}
- 1) * OIntegerSerializer.INT_SIZE);