idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,428,835 | static void vp8_optimize_mbuv(Macroblock x) {<NEW_LINE>int b;<NEW_LINE>EntropyContextPlanes t_above, t_left;<NEW_LINE>FullAccessIntArrPointer ta;<NEW_LINE>FullAccessIntArrPointer tl;<NEW_LINE>if (x.e_mbd.above_context.get() == null || x.e_mbd.left_context == null)<NEW_LINE>return;<NEW_LINE>t_above = new EntropyContextPlanes(x.e_mbd.above_context.get());<NEW_LINE>t_left = new EntropyContextPlanes(x.e_mbd.left_context);<NEW_LINE>ta = t_above.panes;<NEW_LINE>tl = t_left.panes;<NEW_LINE>for (b = 16; b < 24; ++b) {<NEW_LINE>ta.setPos(BlockD.vp8_block2above[b]);<NEW_LINE>tl.setPos(BlockD.vp8_block2left[b]);<NEW_LINE>optimize_b(x, b, <MASK><NEW_LINE>}<NEW_LINE>} | PlaneType.UV, ta, tl); |
795,362 | private static void connectScouterCollector() {<NEW_LINE>Logger log = <MASK><NEW_LINE>List<ServerConfig> serverConfigList = ConfigureManager.getConfigure().getServerConfigs();<NEW_LINE>ServerManager srvMgr = ServerManager.getInstance();<NEW_LINE>for (ServerConfig serverConfig : serverConfigList) {<NEW_LINE>scouterx.webapp.framework.client.server.Server server = new scouterx.webapp.framework.client.server.Server(serverConfig.getIp(), serverConfig.getPort());<NEW_LINE>if (srvMgr.getServer(server.getId()) == null) {<NEW_LINE>srvMgr.addServer(server);<NEW_LINE>} else {<NEW_LINE>server = srvMgr.getServer(server.getId());<NEW_LINE>}<NEW_LINE>server.setUserId(serverConfig.getId());<NEW_LINE>server.setPassword(serverConfig.getPassword());<NEW_LINE>LoginRequest result = LoginMgr.login(server);<NEW_LINE>if (result.success) {<NEW_LINE>log.info("Successfully log in to {}:{}", server.getIp(), server.getPort());<NEW_LINE>// preloading<NEW_LINE>AgentModelThread.getInstance();<NEW_LINE>} else {<NEW_LINE>server.setUserId(serverConfig.getId());<NEW_LINE>server.setPassword(serverConfig.getPassword());<NEW_LINE>log.error("Fail to log in to {}:{}", server.getIp(), server.getPort());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ServerSessionObserver.load();<NEW_LINE>} | LoggerFactory.getLogger(WebAppMain.class); |
1,733,680 | public DeletePlaceIndexResult deletePlaceIndex(DeletePlaceIndexRequest deletePlaceIndexRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deletePlaceIndexRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeletePlaceIndexRequest> request = null;<NEW_LINE>Response<DeletePlaceIndexResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new <MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<DeletePlaceIndexResult, JsonUnmarshallerContext> unmarshaller = new DeletePlaceIndexResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<DeletePlaceIndexResult> responseHandler = new JsonResponseHandler<DeletePlaceIndexResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | DeletePlaceIndexRequestMarshaller().marshall(deletePlaceIndexRequest); |
265,810 | public void authenticate(AuthenticationFlowContext context) {<NEW_LINE>String username = retrieveUsername(context);<NEW_LINE>if (username == null) {<NEW_LINE>context.getEvent().error(Errors.USER_NOT_FOUND);<NEW_LINE>Response challengeResponse = errorResponse(Response.Status.UNAUTHORIZED.getStatusCode(), "invalid_request", "Missing parameter: username");<NEW_LINE>context.failure(AuthenticationFlowError.INVALID_USER, challengeResponse);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>context.getEvent().detail(Details.USERNAME, username);<NEW_LINE>context.getAuthenticationSession().setAuthNote(AbstractUsernameFormAuthenticator.ATTEMPTED_USERNAME, username);<NEW_LINE>UserModel user = null;<NEW_LINE>try {<NEW_LINE>user = KeycloakModelUtils.findUserByNameOrEmail(context.getSession(), context.getRealm(), username);<NEW_LINE>} catch (ModelDuplicateException mde) {<NEW_LINE><MASK><NEW_LINE>Response challengeResponse = errorResponse(Response.Status.UNAUTHORIZED.getStatusCode(), "invalid_request", "Invalid user credentials");<NEW_LINE>context.failure(AuthenticationFlowError.INVALID_USER, challengeResponse);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (user == null) {<NEW_LINE>context.getEvent().error(Errors.USER_NOT_FOUND);<NEW_LINE>Response challengeResponse = errorResponse(Response.Status.UNAUTHORIZED.getStatusCode(), "invalid_grant", "Invalid user credentials");<NEW_LINE>context.failure(AuthenticationFlowError.INVALID_USER, challengeResponse);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String bruteForceError = getDisabledByBruteForceEventError(context, user);<NEW_LINE>if (bruteForceError != null) {<NEW_LINE>context.getEvent().user(user);<NEW_LINE>context.getEvent().error(bruteForceError);<NEW_LINE>Response challengeResponse = errorResponse(Response.Status.UNAUTHORIZED.getStatusCode(), "invalid_grant", "Invalid user credentials");<NEW_LINE>context.forceChallenge(challengeResponse);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!user.isEnabled()) {<NEW_LINE>context.getEvent().user(user);<NEW_LINE>context.getEvent().error(Errors.USER_DISABLED);<NEW_LINE>Response challengeResponse = errorResponse(Response.Status.BAD_REQUEST.getStatusCode(), "invalid_grant", "Account disabled");<NEW_LINE>context.forceChallenge(challengeResponse);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>context.setUser(user);<NEW_LINE>context.success();<NEW_LINE>} | ServicesLogger.LOGGER.modelDuplicateException(mde); |
1,013,199 | public void batchCopy(ApiScenarioBatchRequest request) {<NEW_LINE>ServiceUtils.getSelectAllIds(request, request.getCondition(), (query) -> extApiScenarioMapper.selectIdsByQuery(query));<NEW_LINE>List<String> ids = request.getIds();<NEW_LINE>if (CollectionUtils.isEmpty(ids))<NEW_LINE>return;<NEW_LINE>List<ApiScenarioDTO> apiScenarioList = extApiScenarioMapper.selectIds(ids);<NEW_LINE>SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH);<NEW_LINE>ApiScenarioMapper mapper = sqlSession.getMapper(ApiScenarioMapper.class);<NEW_LINE>Long nextOrder = ServiceUtils.getNextOrder(request.getProjectId(), extApiScenarioMapper::getLastOrder);<NEW_LINE>int nextNum = getNextNum(request.getProjectId());<NEW_LINE>try {<NEW_LINE>for (int i = 0; i < apiScenarioList.size(); i++) {<NEW_LINE>ApiScenarioWithBLOBs api = apiScenarioList.get(i);<NEW_LINE>api.setId(UUID.randomUUID().toString());<NEW_LINE>api.setName(ServiceUtils.getCopyName(api.getName()));<NEW_LINE>api.<MASK><NEW_LINE>api.setModulePath(request.getModulePath());<NEW_LINE>api.setOrder(nextOrder += ServiceUtils.ORDER_STEP);<NEW_LINE>api.setCreateTime(System.currentTimeMillis());<NEW_LINE>api.setUpdateTime(System.currentTimeMillis());<NEW_LINE>api.setRefId(api.getId());<NEW_LINE>api.setNum(nextNum++);<NEW_LINE>api.setCustomNum(String.valueOf(api.getNum()));<NEW_LINE>mapper.insert(api);<NEW_LINE>if (i % 50 == 0)<NEW_LINE>sqlSession.flushStatements();<NEW_LINE>}<NEW_LINE>sqlSession.flushStatements();<NEW_LINE>} finally {<NEW_LINE>SqlSessionUtils.closeSqlSession(sqlSession, sqlSessionFactory);<NEW_LINE>}<NEW_LINE>} | setApiScenarioModuleId(request.getApiScenarioModuleId()); |
679,004 | public Request<TagResourceRequest> marshall(TagResourceRequest tagResourceRequest) {<NEW_LINE>if (tagResourceRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(TagResourceRequest)");<NEW_LINE>}<NEW_LINE>Request<TagResourceRequest> request = new DefaultRequest<TagResourceRequest>(tagResourceRequest, "AWSIot");<NEW_LINE><MASK><NEW_LINE>String uriResourcePath = "/tags";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (tagResourceRequest.getResourceArn() != null) {<NEW_LINE>String resourceArn = tagResourceRequest.getResourceArn();<NEW_LINE>jsonWriter.name("resourceArn");<NEW_LINE>jsonWriter.value(resourceArn);<NEW_LINE>}<NEW_LINE>if (tagResourceRequest.getTags() != null) {<NEW_LINE>java.util.List<Tag> tags = tagResourceRequest.getTags();<NEW_LINE>jsonWriter.name("tags");<NEW_LINE>jsonWriter.beginArray();<NEW_LINE>for (Tag tagsItem : tags) {<NEW_LINE>if (tagsItem != null) {<NEW_LINE>TagJsonMarshaller.getInstance().marshall(tagsItem, jsonWriter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jsonWriter.endArray();<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.0");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | request.setHttpMethod(HttpMethodName.POST); |
1,557,425 | static AnnotationBinding createAnnotation(IBinaryAnnotation annotationInfo, LookupEnvironment env, char[][][] missingTypeNames) {<NEW_LINE>// temporary debug for Bug 532176 - [10] NPE during reconcile<NEW_LINE>if (annotationInfo instanceof AnnotationInfo) {<NEW_LINE>RuntimeException ex = ((AnnotationInfo) annotationInfo).exceptionDuringDecode;<NEW_LINE>if (ex != null)<NEW_LINE>// $NON-NLS-1$<NEW_LINE>new IllegalStateException("Accessing annotation with decode error", ex).printStackTrace();<NEW_LINE>}<NEW_LINE>// --<NEW_LINE>IBinaryElementValuePair[] binaryPairs = annotationInfo.getElementValuePairs();<NEW_LINE>int length = binaryPairs == null ? 0 : binaryPairs.length;<NEW_LINE>ElementValuePair[] pairs = length == 0 ? Binding.NO_ELEMENT_VALUE_PAIRS : new ElementValuePair[length];<NEW_LINE>for (int i = 0; i < length; i++) pairs[i] = new ElementValuePair(binaryPairs[i].getName(), convertMemberValue(binaryPairs[i].getValue(), env, missingTypeNames, false), null);<NEW_LINE>char[] typeName = annotationInfo.getTypeName();<NEW_LINE>LookupEnvironment env2 = annotationInfo.isExternalAnnotation<MASK><NEW_LINE>ReferenceBinding annotationType = env2.getTypeFromConstantPoolName(typeName, 1, typeName.length - 1, false, missingTypeNames);<NEW_LINE>return env2.createUnresolvedAnnotation(annotationType, pairs);<NEW_LINE>} | () ? env.root : env; |
1,739,024 | public void executeQuery(KeyNamePair docTypeKNPair, IMiniTable miniTable) {<NEW_LINE>log.info("");<NEW_LINE>int AD_Client_ID = Env.<MASK><NEW_LINE>String sql = "";<NEW_LINE>if (docTypeKNPair.getKey() == MRMA.Table_ID) {<NEW_LINE>sql = getRMASql();<NEW_LINE>} else {<NEW_LINE>sql = getOrderSQL();<NEW_LINE>}<NEW_LINE>log.fine(sql);<NEW_LINE>// reset table<NEW_LINE>int row = 0;<NEW_LINE>miniTable.setRowCount(row);<NEW_LINE>// Execute<NEW_LINE>try {<NEW_LINE>PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null);<NEW_LINE>pstmt.setInt(1, AD_Client_ID);<NEW_LINE>ResultSet rs = pstmt.executeQuery();<NEW_LINE>//<NEW_LINE>while (rs.next()) {<NEW_LINE>// extend table<NEW_LINE>miniTable.setRowCount(row + 1);<NEW_LINE>// set values<NEW_LINE>// C_Order_ID<NEW_LINE>miniTable.setValueAt(new IDColumn(rs.getInt(1)), row, 0);<NEW_LINE>// Org<NEW_LINE>miniTable.setValueAt(rs.getString(2), row, 1);<NEW_LINE>// DocType<NEW_LINE>miniTable.setValueAt(rs.getString(3), row, 2);<NEW_LINE>// Doc No<NEW_LINE>miniTable.setValueAt(rs.getString(4), row, 3);<NEW_LINE>// BPartner<NEW_LINE>miniTable.setValueAt(rs.getString(5), row, 4);<NEW_LINE>// DateOrdered<NEW_LINE>miniTable.setValueAt(rs.getTimestamp(6), row, 5);<NEW_LINE>// TotalLines<NEW_LINE>miniTable.setValueAt(rs.getBigDecimal(7), row, 6);<NEW_LINE>// prepare next<NEW_LINE>row++;<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>pstmt.close();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.SEVERE, sql.toString(), e);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>miniTable.autoSize();<NEW_LINE>// statusBar.setStatusDB(String.valueOf(miniTable.getRowCount()));<NEW_LINE>} | getAD_Client_ID(Env.getCtx()); |
357,915 | public static void main(String[] args) {<NEW_LINE>int[] input = { 1, 3, 5, 7, 9, 11 };<NEW_LINE>SegmentTree st = new SegmentTree();<NEW_LINE>Operation sumOp = new SumOperation();<NEW_LINE>Operation minOp = new MinOperation();<NEW_LINE>int[] result = st.createTree(input, sumOp);<NEW_LINE>for (int i = 0; i < result.length; i++) {<NEW_LINE>System.out.print(result[i] + " ");<NEW_LINE>}<NEW_LINE>int[] input1 = { 3, 4, 2<MASK><NEW_LINE>int[] result1 = st.createTree(input1, minOp);<NEW_LINE>for (int i = 0; i < result1.length; i++) {<NEW_LINE>System.out.print(result1[i] + " ");<NEW_LINE>}<NEW_LINE>st.updateValueForSumOperation(input, result, 0, 0);<NEW_LINE>System.out.println();<NEW_LINE>for (int i = 0; i < result.length; i++) {<NEW_LINE>System.out.print(result[i] + " ");<NEW_LINE>}<NEW_LINE>} | , 1, 6, -1 }; |
1,167,490 | private String infixtopostfix(String expression) {<NEW_LINE>String result = "";<NEW_LINE>Stack<Character> stack = new Stack<>();<NEW_LINE>int i = 0;<NEW_LINE>for (i = 0; i < expression.length(); i++) {<NEW_LINE>char c = expression.charAt(i);<NEW_LINE>if (priority(c) > 0) {<NEW_LINE>// if the topmost operator in the stack has a priority greater than or equal to c<NEW_LINE>// pop it and add to result string<NEW_LINE>// else push it into the stack<NEW_LINE>while (stack.isEmpty() == false && (priority(stack.peek()) >= priority(c))) {<NEW_LINE>result <MASK><NEW_LINE>}<NEW_LINE>stack.push(c);<NEW_LINE>} else if (c == ')') {<NEW_LINE>// if character is ending bracket ')'<NEW_LINE>// pop from stack, until '(' is found<NEW_LINE>while (stack.peek() != '(') {<NEW_LINE>result = result + stack.peek();<NEW_LINE>stack.pop();<NEW_LINE>}<NEW_LINE>char x = stack.pop();<NEW_LINE>} else if (c == '(') {<NEW_LINE>stack.push(c);<NEW_LINE>} else {<NEW_LINE>result = result + c;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>while (!stack.isEmpty()) result = result + stack.pop();<NEW_LINE>return result;<NEW_LINE>} | = result + stack.pop(); |
73,255 | public static DescribeStratetyDetailResponse unmarshall(DescribeStratetyDetailResponse describeStratetyDetailResponse, UnmarshallerContext context) {<NEW_LINE>describeStratetyDetailResponse.setRequestId(context.stringValue("DescribeStratetyDetailResponse.RequestId"));<NEW_LINE>Strategy strategy = new Strategy();<NEW_LINE>strategy.setCycleDays(context.integerValue("DescribeStratetyDetailResponse.Strategy.CycleDays"));<NEW_LINE>strategy.setName(context.stringValue("DescribeStratetyDetailResponse.Strategy.Name"));<NEW_LINE>strategy.setId(context.integerValue("DescribeStratetyDetailResponse.Strategy.Id"));<NEW_LINE>strategy.setCycleStartTime(context.integerValue("DescribeStratetyDetailResponse.Strategy.CycleStartTime"));<NEW_LINE>strategy.setType(context.integerValue("DescribeStratetyDetailResponse.Strategy.Type"));<NEW_LINE>List<RiskTypeWhiteListQueryResult> riskTypeWhiteListQueryResultList = new ArrayList<RiskTypeWhiteListQueryResult>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeStratetyDetailResponse.Strategy.RiskTypeWhiteListQueryResultList.Length"); i++) {<NEW_LINE>RiskTypeWhiteListQueryResult riskTypeWhiteListQueryResult = new RiskTypeWhiteListQueryResult();<NEW_LINE>riskTypeWhiteListQueryResult.setTypeName(context.stringValue("DescribeStratetyDetailResponse.Strategy.RiskTypeWhiteListQueryResultList[" + i + "].TypeName"));<NEW_LINE>riskTypeWhiteListQueryResult.setAlias(context.stringValue("DescribeStratetyDetailResponse.Strategy.RiskTypeWhiteListQueryResultList[" + i + "].Alias"));<NEW_LINE>riskTypeWhiteListQueryResult.setOn(context.booleanValue("DescribeStratetyDetailResponse.Strategy.RiskTypeWhiteListQueryResultList[" + i + "].On"));<NEW_LINE>List<SubType> subTypes <MASK><NEW_LINE>for (int j = 0; j < context.lengthValue("DescribeStratetyDetailResponse.Strategy.RiskTypeWhiteListQueryResultList[" + i + "].SubTypes.Length"); j++) {<NEW_LINE>SubType subType = new SubType();<NEW_LINE>subType.setTypeName(context.stringValue("DescribeStratetyDetailResponse.Strategy.RiskTypeWhiteListQueryResultList[" + i + "].SubTypes[" + j + "].TypeName"));<NEW_LINE>subType.setAlias(context.stringValue("DescribeStratetyDetailResponse.Strategy.RiskTypeWhiteListQueryResultList[" + i + "].SubTypes[" + j + "].Alias"));<NEW_LINE>subType.setOn(context.booleanValue("DescribeStratetyDetailResponse.Strategy.RiskTypeWhiteListQueryResultList[" + i + "].SubTypes[" + j + "].On"));<NEW_LINE>subTypes.add(subType);<NEW_LINE>}<NEW_LINE>riskTypeWhiteListQueryResult.setSubTypes(subTypes);<NEW_LINE>riskTypeWhiteListQueryResultList.add(riskTypeWhiteListQueryResult);<NEW_LINE>}<NEW_LINE>strategy.setRiskTypeWhiteListQueryResultList(riskTypeWhiteListQueryResultList);<NEW_LINE>describeStratetyDetailResponse.setStrategy(strategy);<NEW_LINE>return describeStratetyDetailResponse;<NEW_LINE>} | = new ArrayList<SubType>(); |
1,102,200 | private Match findInImage(ScreenImage base, Object target) throws IOException {<NEW_LINE>Finder finder = null;<NEW_LINE>Match match = null;<NEW_LINE>boolean findingText = false;<NEW_LINE>Image img = null;<NEW_LINE>if (target instanceof String) {<NEW_LINE>if (((String) target).startsWith("\t") && ((String) target).endsWith("\t")) {<NEW_LINE>findingText = true;<NEW_LINE>} else {<NEW_LINE>img = Image.create((String) target);<NEW_LINE>if (img.isValid()) {<NEW_LINE>finder = doCheckLastSeenAndCreateFinder(base, img, 0.0, null);<NEW_LINE>if (!finder.hasNext()) {<NEW_LINE>runFinder(finder, img);<NEW_LINE>}<NEW_LINE>} else if (img.isText()) {<NEW_LINE>findingText = true;<NEW_LINE>} else {<NEW_LINE>throw new IOException("Region: findInImage: Image not loadable: " + target.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (findingText) {<NEW_LINE>log(logLevel, "findInImage: Switching to TextSearch");<NEW_LINE>finder = new Finder(getScreen().capture(x, y, w, h), this);<NEW_LINE>finder.findText((String) target);<NEW_LINE>}<NEW_LINE>} else if (target instanceof Pattern) {<NEW_LINE>if (((Pattern) target).isValid()) {<NEW_LINE>img = ((Pattern) target).getImage();<NEW_LINE>finder = doCheckLastSeenAndCreateFinder(base, img<MASK><NEW_LINE>if (!finder.hasNext()) {<NEW_LINE>runFinder(finder, target);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IOException("Region: findInImage: Image not loadable: " + target.toString());<NEW_LINE>}<NEW_LINE>} else if (target instanceof Image) {<NEW_LINE>if (((Image) target).isValid()) {<NEW_LINE>img = ((Image) target);<NEW_LINE>finder = doCheckLastSeenAndCreateFinder(base, img, 0.0, null);<NEW_LINE>if (!finder.hasNext()) {<NEW_LINE>runFinder(finder, img);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new IOException("Region: findInImage: Image not loadable: " + target.toString());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log(-1, "findInImage: invalid parameter: %s", target);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (finder.hasNext()) {<NEW_LINE>match = finder.next();<NEW_LINE>// match.setImage(img);<NEW_LINE>img.setLastSeen(match.getRect(), match.getScore());<NEW_LINE>}<NEW_LINE>return match;<NEW_LINE>} | , 0.0, (Pattern) target); |
820,609 | private static void applyCommonOptions(HttpServerOptions httpServerOptions, HttpBuildTimeConfig buildTimeConfig, HttpConfiguration httpConfiguration, List<String> websocketSubProtocols) {<NEW_LINE>httpServerOptions.setHost(httpConfiguration.host);<NEW_LINE>setIdleTimeout(httpConfiguration, httpServerOptions);<NEW_LINE>httpServerOptions.setMaxHeaderSize(httpConfiguration.limits.maxHeaderSize.asBigInteger().intValueExact());<NEW_LINE>httpServerOptions.setMaxChunkSize(httpConfiguration.limits.maxChunkSize.<MASK><NEW_LINE>httpServerOptions.setMaxFormAttributeSize(httpConfiguration.limits.maxFormAttributeSize.asBigInteger().intValueExact());<NEW_LINE>httpServerOptions.setWebSocketSubProtocols(websocketSubProtocols);<NEW_LINE>httpServerOptions.setReusePort(httpConfiguration.soReusePort);<NEW_LINE>httpServerOptions.setTcpQuickAck(httpConfiguration.tcpQuickAck);<NEW_LINE>httpServerOptions.setTcpCork(httpConfiguration.tcpCork);<NEW_LINE>httpServerOptions.setAcceptBacklog(httpConfiguration.acceptBacklog);<NEW_LINE>httpServerOptions.setTcpFastOpen(httpConfiguration.tcpFastOpen);<NEW_LINE>httpServerOptions.setCompressionSupported(buildTimeConfig.enableCompression);<NEW_LINE>if (buildTimeConfig.compressionLevel.isPresent()) {<NEW_LINE>httpServerOptions.setCompressionLevel(buildTimeConfig.compressionLevel.getAsInt());<NEW_LINE>}<NEW_LINE>httpServerOptions.setDecompressionSupported(buildTimeConfig.enableDecompression);<NEW_LINE>httpServerOptions.setMaxInitialLineLength(httpConfiguration.limits.maxInitialLineLength);<NEW_LINE>} | asBigInteger().intValueExact()); |
710,636 | public ListResiliencyPoliciesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListResiliencyPoliciesResult listResiliencyPoliciesResult = new ListResiliencyPoliciesResult();<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 listResiliencyPoliciesResult;<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>listResiliencyPoliciesResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("resiliencyPolicies", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listResiliencyPoliciesResult.setResiliencyPolicies(new ListUnmarshaller<ResiliencyPolicy>(ResiliencyPolicyJsonUnmarshaller.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 listResiliencyPoliciesResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,248,858 | private void parseChildren(ParserState<?> theState, String theName, JsonLikeValue theJsonVal, JsonLikeValue theAlternateVal, String theAlternateName, boolean theInArray) {<NEW_LINE>if (theName.equals("id")) {<NEW_LINE>if (!theJsonVal.isString()) {<NEW_LINE>getErrorHandler().incorrectJsonType(null, "id", ValueType.SCALAR, ScalarType.STRING, theJsonVal.getJsonType(), theJsonVal.getDataType());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (theJsonVal.isArray()) {<NEW_LINE>JsonLikeArray nextArray = theJsonVal.getAsArray();<NEW_LINE>JsonLikeValue alternateVal = theAlternateVal;<NEW_LINE>if (alternateVal != null && alternateVal.isArray() == false) {<NEW_LINE>getErrorHandler().incorrectJsonType(null, theAlternateName, ValueType.ARRAY, null, <MASK><NEW_LINE>alternateVal = null;<NEW_LINE>}<NEW_LINE>// could be null<NEW_LINE>JsonLikeArray nextAlternateArray = JsonLikeValue.asArray(alternateVal);<NEW_LINE>for (int i = 0; i < nextArray.size(); i++) {<NEW_LINE>JsonLikeValue nextObject = nextArray.get(i);<NEW_LINE>JsonLikeValue nextAlternate = null;<NEW_LINE>if (nextAlternateArray != null && nextAlternateArray.size() >= (i + 1)) {<NEW_LINE>nextAlternate = nextAlternateArray.get(i);<NEW_LINE>}<NEW_LINE>parseChildren(theState, theName, nextObject, nextAlternate, theAlternateName, true);<NEW_LINE>}<NEW_LINE>} else if (theJsonVal.isObject()) {<NEW_LINE>if (!theInArray && theState.elementIsRepeating(theName)) {<NEW_LINE>getErrorHandler().incorrectJsonType(null, theName, ValueType.ARRAY, null, ValueType.OBJECT, null);<NEW_LINE>}<NEW_LINE>theState.enteringNewElement(null, theName);<NEW_LINE>parseAlternates(theAlternateVal, theState, theAlternateName, theAlternateName);<NEW_LINE>JsonLikeObject nextObject = theJsonVal.getAsObject();<NEW_LINE>boolean preResource = false;<NEW_LINE>if (theState.isPreResource()) {<NEW_LINE>JsonLikeValue resType = nextObject.get("resourceType");<NEW_LINE>if (resType == null || !resType.isString()) {<NEW_LINE>throw new DataFormatException(Msg.code(1843) + "Missing required element 'resourceType' from JSON resource object, unable to parse");<NEW_LINE>}<NEW_LINE>theState.enteringNewElement(null, resType.getAsString());<NEW_LINE>preResource = true;<NEW_LINE>}<NEW_LINE>parseChildren(nextObject, theState);<NEW_LINE>if (preResource) {<NEW_LINE>theState.endingElement();<NEW_LINE>}<NEW_LINE>theState.endingElement();<NEW_LINE>} else if (theJsonVal.isNull()) {<NEW_LINE>theState.enteringNewElement(null, theName);<NEW_LINE>parseAlternates(theAlternateVal, theState, theAlternateName, theAlternateName);<NEW_LINE>theState.endingElement();<NEW_LINE>} else {<NEW_LINE>// must be a SCALAR<NEW_LINE>theState.enteringNewElement(null, theName);<NEW_LINE>String asString = theJsonVal.getAsString();<NEW_LINE>theState.attributeValue("value", asString);<NEW_LINE>parseAlternates(theAlternateVal, theState, theAlternateName, theAlternateName);<NEW_LINE>theState.endingElement();<NEW_LINE>}<NEW_LINE>} | alternateVal.getJsonType(), null); |
1,852,619 | public UserProject newProjectFromExternalTemplate(String projectName, String zipData) {<NEW_LINE>System.out.println(">>>>> ProjectService newProjectFromExternalTemplate name = " + projectName);<NEW_LINE>UserProject userProject = null;<NEW_LINE>// Convert base64 string to byte[]<NEW_LINE>// NOTE: GWT's Base64Utils uses a non-standard algorithm.<NEW_LINE>// @see: https://code.google.com/p/google-web-toolkit/issues/detail?id=3880<NEW_LINE>byte[] binData = null;<NEW_LINE>binData = Base64Util.decodeLines(zipData);<NEW_LINE>// Import the project<NEW_LINE>ByteArrayInputStream bais = null;<NEW_LINE>FileImporter fileImporter = new FileImporterImpl();<NEW_LINE>try {<NEW_LINE>bais = new ByteArrayInputStream(binData);<NEW_LINE>userProject = fileImporter.importProject(userInfoProvider.getUserId(), projectName, bais);<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>// Create a new empty project if no Zip<NEW_LINE>LOG.log(Level.SEVERE, "File Not Found importing from template project (external)", e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.log(<MASK><NEW_LINE>} catch (FileImporterException e) {<NEW_LINE>LOG.log(Level.SEVERE, "FileImporterException Error importing from template project (external)", e);<NEW_LINE>}<NEW_LINE>return userProject;<NEW_LINE>} | Level.SEVERE, "I/O Error importing from template project (external)", e); |
873,699 | public Object eval(Reader reader, ScriptContext ctx) throws ScriptException {<NEW_LINE>ctx.setAttribute(<MASK><NEW_LINE>initFreeMarkerConfiguration(ctx);<NEW_LINE>String fileName = getFilename(ctx);<NEW_LINE>boolean outputAsString = isStringOutputMode(ctx);<NEW_LINE>Writer out;<NEW_LINE>if (outputAsString) {<NEW_LINE>out = new StringWriter();<NEW_LINE>} else {<NEW_LINE>out = ctx.getWriter();<NEW_LINE>}<NEW_LINE>Template template = null;<NEW_LINE>try {<NEW_LINE>if (fo != null) {<NEW_LINE>template = templates.remove(fo);<NEW_LINE>}<NEW_LINE>if (template == null) {<NEW_LINE>template = new MyTemplate(fo, fileName, reader, conf);<NEW_LINE>Object exceptionHandler = ctx.getAttribute(FREEMARKER_EXCEPTION_HANDLER);<NEW_LINE>if (exceptionHandler instanceof TemplateExceptionHandler) {<NEW_LINE>template.setTemplateExceptionHandler((TemplateExceptionHandler) exceptionHandler);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>((MyTemplate) template).conf = conf;<NEW_LINE>}<NEW_LINE>template.process(null, out);<NEW_LINE>out.flush();<NEW_LINE>if (fo != null) {<NEW_LINE>templates.put(fo, template);<NEW_LINE>}<NEW_LINE>} catch (Exception exp) {<NEW_LINE>throw new ScriptException(exp);<NEW_LINE>}<NEW_LINE>return outputAsString ? out.toString() : null;<NEW_LINE>} | "context", ctx, ScriptContext.ENGINE_SCOPE); |
1,115,432 | public static void buildApiDoc(ApiConfig config, JavaProjectBuilder javaProjectBuilder) {<NEW_LINE>DocBuilderTemplate builderTemplate = new DocBuilderTemplate();<NEW_LINE>builderTemplate.checkAndInit(config, false);<NEW_LINE>config.setAdoc(false);<NEW_LINE>config.setParamsDataToTree(false);<NEW_LINE>ProjectDocConfigBuilder configBuilder = new ProjectDocConfigBuilder(config, javaProjectBuilder);<NEW_LINE>IDocBuildTemplate docBuildTemplate = BuildTemplateFactory.getDocBuildTemplate(config.getFramework());<NEW_LINE>List<ApiDoc> apiDocList = docBuildTemplate.getApiData(configBuilder);<NEW_LINE>if (config.isAllInOne()) {<NEW_LINE>String version = config.isCoverOld() ? "" : "-V" + DateTimeUtil.long2Str(System.currentTimeMillis(), DATE_FORMAT);<NEW_LINE>String docName = builderTemplate.allInOneDocName(config, <MASK><NEW_LINE>apiDocList = docBuildTemplate.handleApiGroup(apiDocList, config);<NEW_LINE>builderTemplate.buildAllInOne(apiDocList, config, javaProjectBuilder, ALL_IN_ONE_MD_TPL, docName);<NEW_LINE>} else {<NEW_LINE>builderTemplate.buildApiDoc(apiDocList, config, API_DOC_MD_TPL, API_EXTENSION);<NEW_LINE>builderTemplate.buildErrorCodeDoc(config, ERROR_CODE_LIST_MD_TPL, ERROR_CODE_LIST_MD);<NEW_LINE>builderTemplate.buildDirectoryDataDoc(config, javaProjectBuilder, DICT_LIST_MD_TPL, DICT_LIST_MD);<NEW_LINE>}<NEW_LINE>} | "AllInOne" + version + ".md", ".md"); |
1,343,011 | public static void main(String[] args) {<NEW_LINE>var vm = new VirtualMachine(new Wizard(45, 7, 11, 0, 0), new Wizard(36, 18, 8, 0, 0));<NEW_LINE>vm.execute(InstructionConverterUtil.convertToByteCode(LITERAL_0));<NEW_LINE>vm.execute<MASK><NEW_LINE>vm.execute(InstructionConverterUtil.convertToByteCode(String.format(HEALTH_PATTERN, "GET")));<NEW_LINE>vm.execute(InstructionConverterUtil.convertToByteCode(LITERAL_0));<NEW_LINE>vm.execute(InstructionConverterUtil.convertToByteCode(GET_AGILITY));<NEW_LINE>vm.execute(InstructionConverterUtil.convertToByteCode(LITERAL_0));<NEW_LINE>vm.execute(InstructionConverterUtil.convertToByteCode(GET_WISDOM));<NEW_LINE>vm.execute(InstructionConverterUtil.convertToByteCode(ADD));<NEW_LINE>vm.execute(InstructionConverterUtil.convertToByteCode(LITERAL_2));<NEW_LINE>vm.execute(InstructionConverterUtil.convertToByteCode(DIVIDE));<NEW_LINE>vm.execute(InstructionConverterUtil.convertToByteCode(ADD));<NEW_LINE>vm.execute(InstructionConverterUtil.convertToByteCode(String.format(HEALTH_PATTERN, "SET")));<NEW_LINE>} | (InstructionConverterUtil.convertToByteCode(LITERAL_0)); |
18,581 | final CreateApplicationResult executeCreateApplication(CreateApplicationRequest createApplicationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createApplicationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateApplicationRequest> request = null;<NEW_LINE>Response<CreateApplicationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateApplicationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createApplicationRequest));<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, "Migration Hub Refactor Spaces");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateApplication");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateApplicationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new CreateApplicationResultJsonUnmarshaller()); |
1,412,899 | public static CreateOrderV2Response unmarshall(CreateOrderV2Response createOrderV2Response, UnmarshallerContext _ctx) {<NEW_LINE>createOrderV2Response.setRequestId<MASK><NEW_LINE>createOrderV2Response.setCode(_ctx.stringValue("CreateOrderV2Response.Code"));<NEW_LINE>createOrderV2Response.setMessage(_ctx.stringValue("CreateOrderV2Response.Message"));<NEW_LINE>createOrderV2Response.setSubCode(_ctx.stringValue("CreateOrderV2Response.SubCode"));<NEW_LINE>createOrderV2Response.setSubMessage(_ctx.stringValue("CreateOrderV2Response.SubMessage"));<NEW_LINE>createOrderV2Response.setLogsId(_ctx.stringValue("CreateOrderV2Response.LogsId"));<NEW_LINE>createOrderV2Response.setSuccess(_ctx.booleanValue("CreateOrderV2Response.Success"));<NEW_LINE>createOrderV2Response.setTotalCount(_ctx.longValue("CreateOrderV2Response.TotalCount"));<NEW_LINE>Model model = new Model();<NEW_LINE>model.setRedirectUrl(_ctx.stringValue("CreateOrderV2Response.Model.RedirectUrl"));<NEW_LINE>List<String> orderIds = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CreateOrderV2Response.Model.OrderIds.Length"); i++) {<NEW_LINE>orderIds.add(_ctx.stringValue("CreateOrderV2Response.Model.OrderIds[" + i + "]"));<NEW_LINE>}<NEW_LINE>model.setOrderIds(orderIds);<NEW_LINE>List<String> payTradeIds = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CreateOrderV2Response.Model.PayTradeIds.Length"); i++) {<NEW_LINE>payTradeIds.add(_ctx.stringValue("CreateOrderV2Response.Model.PayTradeIds[" + i + "]"));<NEW_LINE>}<NEW_LINE>model.setPayTradeIds(payTradeIds);<NEW_LINE>List<LmOrderListItem> lmOrderList = new ArrayList<LmOrderListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CreateOrderV2Response.Model.LmOrderList.Length"); i++) {<NEW_LINE>LmOrderListItem lmOrderListItem = new LmOrderListItem();<NEW_LINE>lmOrderListItem.setLmOrderId(_ctx.stringValue("CreateOrderV2Response.Model.LmOrderList[" + i + "].LmOrderId"));<NEW_LINE>lmOrderList.add(lmOrderListItem);<NEW_LINE>}<NEW_LINE>model.setLmOrderList(lmOrderList);<NEW_LINE>createOrderV2Response.setModel(model);<NEW_LINE>return createOrderV2Response;<NEW_LINE>} | (_ctx.stringValue("CreateOrderV2Response.RequestId")); |
980,147 | private void resolveTags(AuxParserResult result) {<NEW_LINE>List<BibEntry> entriesToInsert = new ArrayList<>();<NEW_LINE>for (String key : result.getUniqueKeys()) {<NEW_LINE>if (!result.getGeneratedBibDatabase().getEntryByCitationKey(key).isPresent()) {<NEW_LINE>Optional<BibEntry> entry = masterDatabase.getEntryByCitationKey(key);<NEW_LINE>if (entry.isPresent()) {<NEW_LINE>entriesToInsert.add(entry.get());<NEW_LINE>} else {<NEW_LINE>result.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>insertEntries(entriesToInsert, result);<NEW_LINE>resolveCrossReferences(entriesToInsert, result);<NEW_LINE>// Copy database definitions<NEW_LINE>if (result.getGeneratedBibDatabase().hasEntries()) {<NEW_LINE>result.getGeneratedBibDatabase().copyPreamble(masterDatabase);<NEW_LINE>result.insertStrings(masterDatabase.getUsedStrings(result.getGeneratedBibDatabase().getEntries()));<NEW_LINE>}<NEW_LINE>} | getUnresolvedKeys().add(key); |
1,191,996 | public com.amazonaws.services.secretsmanager.model.PublicPolicyException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.secretsmanager.model.PublicPolicyException publicPolicyException = new com.amazonaws.services.secretsmanager.model.PublicPolicyException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return 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 publicPolicyException;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
758,435 | final DeleteBackupResult executeDeleteBackup(DeleteBackupRequest deleteBackupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteBackupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteBackupRequest> request = null;<NEW_LINE>Response<DeleteBackupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteBackupRequestProtocolMarshaller(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, "OpsWorksCM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteBackup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteBackupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteBackupResultJsonUnmarshaller());<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(deleteBackupRequest)); |
1,225,804 | public Request<RemoveRoleFromInstanceProfileRequest> marshall(RemoveRoleFromInstanceProfileRequest removeRoleFromInstanceProfileRequest) {<NEW_LINE>if (removeRoleFromInstanceProfileRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<RemoveRoleFromInstanceProfileRequest> request = new DefaultRequest<RemoveRoleFromInstanceProfileRequest>(removeRoleFromInstanceProfileRequest, "AmazonIdentityManagement");<NEW_LINE>request.addParameter("Action", "RemoveRoleFromInstanceProfile");<NEW_LINE><MASK><NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (removeRoleFromInstanceProfileRequest.getInstanceProfileName() != null) {<NEW_LINE>request.addParameter("InstanceProfileName", StringUtils.fromString(removeRoleFromInstanceProfileRequest.getInstanceProfileName()));<NEW_LINE>}<NEW_LINE>if (removeRoleFromInstanceProfileRequest.getRoleName() != null) {<NEW_LINE>request.addParameter("RoleName", StringUtils.fromString(removeRoleFromInstanceProfileRequest.getRoleName()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | request.addParameter("Version", "2010-05-08"); |
970,223 | private void rebuildAllSyncData() {<NEW_LINE>// Delete all tasks not assigned to self<NEW_LINE>taskService.deleteWhere(Criterion.or(Task.USER_ID.neq(0), Task.DELETION_DATE.gt(0)));<NEW_LINE>// Delete user table<NEW_LINE>userDao.deleteWhere(Criterion.all);<NEW_LINE>// Delete comments this user didn't make<NEW_LINE>userActivityDao.deleteWhere(Criterion.or(UserActivity.USER_UUID.neq(0), UserActivity.DELETED_AT.gt(0)));<NEW_LINE>// Delete attachments table<NEW_LINE><MASK><NEW_LINE>// Delete deleted tags<NEW_LINE>tagDataDao.deleteWhere(TagData.DELETION_DATE.gt(0));<NEW_LINE>// Delete deleted metadata<NEW_LINE>metadataDao.deleteWhere(Metadata.DELETION_DATE.gt(0));<NEW_LINE>// Clear all outstanding tables<NEW_LINE>taskOutstandingDao.deleteWhere(Criterion.all);<NEW_LINE>tagOutstandingDao.deleteWhere(Criterion.all);<NEW_LINE>userActivityOutstandingDao.deleteWhere(Criterion.all);<NEW_LINE>taskListMetadataOutstandingDao.deleteWhere(Criterion.all);<NEW_LINE>taskAttachmentOutstandingDao.deleteWhere(Criterion.all);<NEW_LINE>// Make all tags private<NEW_LINE>tagMetadataDao.deleteWhere(Criterion.all);<NEW_LINE>// Generate new uuids for all tasks/tags/user activity/task list metadata and update links<NEW_LINE>generateNewUuids();<NEW_LINE>ActFmSyncThread.clearTablePushedAtValues();<NEW_LINE>constructOutstandingTables();<NEW_LINE>} | taskAttachmentDao.deleteWhere(Criterion.all); |
673,526 | public boolean process() {<NEW_LINE>int numViews = depths.numRows;<NEW_LINE>int numFeatures = depths.numCols;<NEW_LINE>P.reshape(3 * numViews, 4);<NEW_LINE>X.reshape(4, numFeatures);<NEW_LINE>A.reshape(numViews * 3, numFeatures);<NEW_LINE>B.reshape(numViews * 3, numFeatures);<NEW_LINE>// Scale depths so that they are close to unity<NEW_LINE>normalizeDepths(depths);<NEW_LINE>// Compute the initial A matirx<NEW_LINE>assignValuesToA(A);<NEW_LINE>for (int iter = 0; iter < maxIterations; iter++) {<NEW_LINE>if (!svd.decompose(A))<NEW_LINE>return false;<NEW_LINE>svd.getU(U, false);<NEW_LINE><MASK><NEW_LINE>double[] sv = svd.getSingularValues();<NEW_LINE>SingularOps_DDRM.descendingOrder(U, false, sv, A.numCols, Vt, true);<NEW_LINE>// This is equivalent to forcing the rank to be 4<NEW_LINE>CommonOps_DDRM.extract(U, 0, 0, P);<NEW_LINE>CommonOps_DDRM.multCols(P, sv);<NEW_LINE>CommonOps_DDRM.extract(Vt, 0, 0, X);<NEW_LINE>// Compute the new value of A<NEW_LINE>CommonOps_DDRM.mult(P, X, B);<NEW_LINE>// See how much change there is<NEW_LINE>double delta = SpecializedOps_DDRM.diffNormF(A, B) / (A.numCols * A.numRows);<NEW_LINE>// swap arrays for the next iteration<NEW_LINE>DMatrixRMaj tmp = A;<NEW_LINE>A = B;<NEW_LINE>B = tmp;<NEW_LINE>// exit if converged<NEW_LINE>if (delta <= minimumChangeTol)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | svd.getV(Vt, true); |
97,536 | public DescribeBrokerEngineTypesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeBrokerEngineTypesResult describeBrokerEngineTypesResult = new DescribeBrokerEngineTypesResult();<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 describeBrokerEngineTypesResult;<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("brokerEngineTypes", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeBrokerEngineTypesResult.setBrokerEngineTypes(new ListUnmarshaller<BrokerEngineType>(BrokerEngineTypeJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("maxResults", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeBrokerEngineTypesResult.setMaxResults(context.getUnmarshaller(Integer.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeBrokerEngineTypesResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeBrokerEngineTypesResult;<NEW_LINE>} | class).unmarshall(context)); |
245,457 | void buildFilePart(final KeyDataPair pairWithFile, final MultipartEntityBuilder builder) {<NEW_LINE><MASK><NEW_LINE>if (mimeType == null) {<NEW_LINE>mimeType = MimeType.APPLICATION_OCTET_STREAM;<NEW_LINE>}<NEW_LINE>final ContentType contentType = ContentType.create(mimeType);<NEW_LINE>final File file = pairWithFile.getFile();<NEW_LINE>if (pairWithFile.getData() != null) {<NEW_LINE>final String filename;<NEW_LINE>if (file == null) {<NEW_LINE>filename = pairWithFile.getValue();<NEW_LINE>} else if (pairWithFile.getFileName() == null) {<NEW_LINE>filename = file.getName();<NEW_LINE>} else {<NEW_LINE>filename = pairWithFile.getFileName();<NEW_LINE>}<NEW_LINE>builder.addBinaryBody(pairWithFile.getName(), new ByteArrayInputStream(pairWithFile.getData()), contentType, filename);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (file == null) {<NEW_LINE>// Overridden in order not to have a chunked response.<NEW_LINE>builder.// Overridden in order not to have a chunked response.<NEW_LINE>addPart(// Overridden in order not to have a chunked response.<NEW_LINE>pairWithFile.getName(), new InputStreamBody(new ByteArrayInputStream(new byte[0]), contentType, pairWithFile.getValue()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public long getContentLength() {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final String filename;<NEW_LINE>if (pairWithFile.getFile() == null) {<NEW_LINE>filename = pairWithFile.getValue();<NEW_LINE>} else if (pairWithFile.getFileName() == null) {<NEW_LINE>filename = pairWithFile.getFile().getName();<NEW_LINE>} else {<NEW_LINE>filename = pairWithFile.getFileName();<NEW_LINE>}<NEW_LINE>builder.addBinaryBody(pairWithFile.getName(), pairWithFile.getFile(), contentType, filename);<NEW_LINE>} | String mimeType = pairWithFile.getMimeType(); |
1,033,603 | public static SignalServiceAddress toSignalServiceAddress(@NonNull Context context, @NonNull Recipient recipient) throws IOException {<NEW_LINE>recipient = recipient.resolve();<NEW_LINE>if (!recipient.getServiceId().isPresent() && !recipient.getE164().isPresent()) {<NEW_LINE>throw new AssertionError(recipient.getId() + " - No UUID or phone number!");<NEW_LINE>}<NEW_LINE>if (!recipient.getServiceId().isPresent()) {<NEW_LINE>Log.i(TAG, recipient.getId() + " is missing a UUID...");<NEW_LINE>RegisteredState state = ContactDiscovery.refresh(context, recipient, false);<NEW_LINE>recipient = Recipient.resolved(recipient.getId());<NEW_LINE>Log.i(TAG, "Successfully performed a UUID fetch for " + recipient.<MASK><NEW_LINE>}<NEW_LINE>if (recipient.hasServiceId()) {<NEW_LINE>return new SignalServiceAddress(recipient.requireServiceId(), Optional.ofNullable(recipient.resolve().getE164().orElse(null)));<NEW_LINE>} else {<NEW_LINE>throw new NotFoundException(recipient.getId() + " is not registered!");<NEW_LINE>}<NEW_LINE>} | getId() + ". Registered: " + state); |
219,289 | public Transaction refund(boolean partial, MerchantStore store, Transaction transaction, Order order, BigDecimal amount, IntegrationConfiguration configuration, IntegrationModule module) throws IntegrationException {<NEW_LINE>String apiKey = configuration.getIntegrationKeys().get("secretKey");<NEW_LINE>if (StringUtils.isBlank(apiKey)) {<NEW_LINE>IntegrationException te = new IntegrationException("Can't process Stripe, missing payment.metaData");<NEW_LINE>te.setExceptionType(IntegrationException.TRANSACTION_EXCEPTION);<NEW_LINE>te.setMessageCode("message.payment.error");<NEW_LINE>te.setErrorCode(IntegrationException.TRANSACTION_EXCEPTION);<NEW_LINE>throw te;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String trnID = transaction.getTransactionDetails().get("TRNORDERNUMBER");<NEW_LINE>String amnt = productPriceUtils.getAdminFormatedAmount(store, amount);<NEW_LINE>Stripe.apiKey = apiKey;<NEW_LINE>// stripe does not support floating point<NEW_LINE>// so amnt * 100 or remove floating point<NEW_LINE>// 553.47 = 55347<NEW_LINE>String strAmount = String.valueOf(amnt);<NEW_LINE>strAmount = <MASK><NEW_LINE>Charge ch = Charge.retrieve(trnID);<NEW_LINE>Map<String, Object> params = new HashMap<>();<NEW_LINE>params.put("charge", ch.getId());<NEW_LINE>params.put("amount", strAmount);<NEW_LINE>Refund re = Refund.create(params);<NEW_LINE>transaction = new Transaction();<NEW_LINE>transaction.setAmount(order.getTotal());<NEW_LINE>transaction.setOrder(order);<NEW_LINE>transaction.setTransactionDate(new Date());<NEW_LINE>transaction.setTransactionType(TransactionType.CAPTURE);<NEW_LINE>transaction.setPaymentType(PaymentType.CREDITCARD);<NEW_LINE>transaction.getTransactionDetails().put("TRANSACTIONID", transaction.getTransactionDetails().get("TRANSACTIONID"));<NEW_LINE>transaction.getTransactionDetails().put("TRNAPPROVED", re.getReason());<NEW_LINE>transaction.getTransactionDetails().put("TRNORDERNUMBER", re.getId());<NEW_LINE>transaction.getTransactionDetails().put("MESSAGETEXT", null);<NEW_LINE>return transaction;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw buildException(e);<NEW_LINE>}<NEW_LINE>} | strAmount.replace(".", ""); |
160,598 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>insidePanel = new javax.swing.JPanel();<NEW_LINE>xLabel = new javax.swing.JLabel();<NEW_LINE>xField = new javax.swing.JTextField();<NEW_LINE>yLabel = new javax.swing.JLabel();<NEW_LINE>yField = new javax.swing.JTextField();<NEW_LINE>setLayout(new java.awt.BorderLayout());<NEW_LINE>insidePanel.setLayout(new java.awt.GridBagLayout());<NEW_LINE>xLabel.setLabelFor(xField);<NEW_LINE>// NOI18N<NEW_LINE>java.util.ResourceBundle bundle = java.<MASK><NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(xLabel, bundle.getString("CTL_X"));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;<NEW_LINE>insidePanel.add(xLabel, gridBagConstraints);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(4, 8, 4, 0);<NEW_LINE>insidePanel.add(xField, gridBagConstraints);<NEW_LINE>yLabel.setLabelFor(yField);<NEW_LINE>// NOI18N<NEW_LINE>org.openide.awt.Mnemonics.setLocalizedText(yLabel, bundle.getString("CTL_Y"));<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;<NEW_LINE>insidePanel.add(yLabel, gridBagConstraints);<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(4, 8, 4, 0);<NEW_LINE>insidePanel.add(yField, gridBagConstraints);<NEW_LINE>add(insidePanel, java.awt.BorderLayout.CENTER);<NEW_LINE>} | util.ResourceBundle.getBundle("org/netbeans/beaninfo/editors/Bundle"); |
907,376 | boolean tryYearCmpFunc(Item.ItemResult type) {<NEW_LINE>if (type == Item.ItemResult.ROW_RESULT)<NEW_LINE>return false;<NEW_LINE>boolean aisyear = a.fieldType() == FieldTypes.MYSQL_TYPE_YEAR;<NEW_LINE>boolean bisyear = b<MASK><NEW_LINE>if (!aisyear && !bisyear)<NEW_LINE>return false;<NEW_LINE>if (aisyear && bisyear) {<NEW_LINE>getValueAFunc = new GetYearValue();<NEW_LINE>getValueBFunc = new GetYearValue();<NEW_LINE>} else if (aisyear && b.isTemporalWithDate()) {<NEW_LINE>getValueAFunc = new GetYearValue();<NEW_LINE>getValueBFunc = new GetDatetimeValue();<NEW_LINE>} else if (bisyear && a.isTemporalWithDate()) {<NEW_LINE>getValueBFunc = new GetYearValue();<NEW_LINE>getValueAFunc = new GetDatetimeValue();<NEW_LINE>} else<NEW_LINE>return false;<NEW_LINE>isNullsEq = isOwnerEqualFunc();<NEW_LINE>func = new CompareDatetime();<NEW_LINE>setcmpcontextfordatetime();<NEW_LINE>return true;<NEW_LINE>} | .fieldType() == FieldTypes.MYSQL_TYPE_YEAR; |
420,289 | void populate(byte[] msg, byte[] headers, byte[] body) throws DBusException {<NEW_LINE>big = (msg[0] == Endian.BIG);<NEW_LINE>type = msg[1];<NEW_LINE>flags = msg[2];<NEW_LINE>protover = msg[3];<NEW_LINE>wiredata[0] = msg;<NEW_LINE>wiredata[1] = headers;<NEW_LINE>wiredata[2] = body;<NEW_LINE>this.body = body;<NEW_LINE>bufferuse = 3;<NEW_LINE>bodylen = ((Number) extract(Message.ArgumentType.UINT32_STRING, msg, 4)[0]).longValue();<NEW_LINE>serial = ((Number) extract(Message.ArgumentType.UINT32_STRING, msg, 8)[0]).longValue();<NEW_LINE>bytecounter = msg.length <MASK><NEW_LINE>if (Debug.debug)<NEW_LINE>Debug.print(Debug.VERBOSE, headers);<NEW_LINE>Object[] hs = extract("a(yv)", headers, 0);<NEW_LINE>if (Debug.debug)<NEW_LINE>Debug.print(Debug.VERBOSE, Arrays.deepToString(hs));<NEW_LINE>for (Object o : (Vector<Object>) hs[0]) {<NEW_LINE>this.headers.put((Byte) ((Object[]) o)[0], ((Variant<Object>) ((Object[]) o)[1]).getValue());<NEW_LINE>}<NEW_LINE>} | + headers.length + body.length; |
1,845,431 | private static Object evalContext(String path, Object ctx) {<NEW_LINE>final String[] parts;<NEW_LINE>if (path == null || path.isEmpty())<NEW_LINE>parts = EMPTY_ARRAY;<NEW_LINE>else<NEW_LINE>parts = path.split("\\.");<NEW_LINE>for (String part : parts) {<NEW_LINE>if (ctx == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (ctx instanceof Map) {<NEW_LINE>ctx = ((Map) ctx).get(part);<NEW_LINE>} else if (ctx instanceof List) {<NEW_LINE>try {<NEW_LINE>int <MASK><NEW_LINE>ctx = ((List) ctx).get(index);<NEW_LINE>} catch (NumberFormatException nfe) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else if (ctx.getClass().isArray()) {<NEW_LINE>try {<NEW_LINE>int index = Integer.parseInt(part);<NEW_LINE>ctx = Array.get(ctx, index);<NEW_LINE>} catch (NumberFormatException nfe) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ctx;<NEW_LINE>} | index = Integer.parseInt(part); |
1,587,069 | public void notifyUserInCharge(@NonNull final ApiAuditConfig apiAuditConfig, @NonNull final ApiRequestAudit apiRequestAudit, final boolean isError) {<NEW_LINE>final Optional<UserGroupId> userGroupToNotify = apiAuditConfig.getUserGroupToNotify(isError);<NEW_LINE>if (!userGroupToNotify.isPresent()) {<NEW_LINE>Loggables.addLog("Notification skipped due to ApiAuditConfig! UserGroupInChargeId = {}, " + "ApiAuditConfigId = {}, NotifyUserInChargeTrigger = {}", apiAuditConfig.getUserGroupInChargeId(), apiAuditConfig.getApiAuditConfigId(), apiAuditConfig.getNotifyUserInCharge());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final AdMessageKey messageKey = isError ? MSG_API_INVOCATION_FAILED : MSG_SUCCESSFUL_API_INVOCATION;<NEW_LINE>final UserNotificationRequest.TargetRecordAction targetRecordAction = UserNotificationRequest.TargetRecordAction.of(I_API_Request_Audit.Table_Name, apiRequestAudit.getIdNotNull().getRepoId());<NEW_LINE>userGroupRepository.getByUserGroupId(userGroupToNotify.get()).streamAssignmentsFor(userGroupToNotify.get(), Instant.now()).map(UserGroupUserAssignment::getUserId).map(userId -> UserNotificationRequest.builder().recipientUserId(userId).contentADMessage(messageKey).contentADMessageParam(apiRequestAudit.getPath()).targetAction(targetRecordAction).build()<MASK><NEW_LINE>} | ).forEach(notificationBL::send); |
905,777 | private List<Frame> splitMessageToFrames(Message msg) {<NEW_LINE>byte code = getCode(msg.getCommand());<NEW_LINE>List<Frame> ret = new ArrayList<>();<NEW_LINE>byte[] bytes = msg.getEncoded();<NEW_LINE>int curPos = 0;<NEW_LINE>while (curPos < bytes.length) {<NEW_LINE>int newPos = min(curPos + maxFramePayloadSize, bytes.length);<NEW_LINE>byte[] frameBytes = curPos == 0 && newPos == bytes.length ? bytes : Arrays.<MASK><NEW_LINE>ret.add(new Frame(code, frameBytes));<NEW_LINE>curPos = newPos;<NEW_LINE>}<NEW_LINE>if (ret.size() > 1) {<NEW_LINE>// frame has been split<NEW_LINE>int contextId = contextIdCounter.getAndIncrement();<NEW_LINE>ret.get(0).totalFrameSize = bytes.length;<NEW_LINE>loggerWire.debug("Message (size {}) split to {} frames. Context-id: {}", bytes.length, ret.size(), contextId);<NEW_LINE>for (Frame frame : ret) {<NEW_LINE>frame.contextId = contextId;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | copyOfRange(bytes, curPos, newPos); |
963,129 | private RequestBodySpec sendRequest(WebClient webClient, String logId, Request request, HttpHeaders headers) {<NEW_LINE>//<NEW_LINE>RequestBodySpec //<NEW_LINE>requestBodySpec = webClient.method(HttpMethod.valueOf(request.getMethod().toUpperCase())).uri(builder -> {<NEW_LINE>builder = builder.path(request.getEndpoint());<NEW_LINE>if (!ObjectUtils.isEmpty(request.getParameters())) {<NEW_LINE>for (Entry<String, String> entry : request.getParameters().entrySet()) {<NEW_LINE>builder = builder.queryParam(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}).//<NEW_LINE>attribute(//<NEW_LINE>ClientRequest.LOG_ID_ATTRIBUTE, logId).headers(theHeaders -> {<NEW_LINE>// add all the headers explicitly set<NEW_LINE>theHeaders.addAll(headers);<NEW_LINE>// and now those that might be set on the request.<NEW_LINE>if (request.getOptions() != null) {<NEW_LINE>if (!ObjectUtils.isEmpty(request.getOptions().getHeaders())) {<NEW_LINE>request.getOptions().getHeaders().forEach(it -> theHeaders.add(it.getName(), it.getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (request.getEntity() != null) {<NEW_LINE>Lazy<String> body = bodyExtractor(request);<NEW_LINE>ClientLogger.logRequest(logId, request.getMethod().toUpperCase(), request.getEndpoint(), request.<MASK><NEW_LINE>requestBodySpec.contentType(MediaType.valueOf(request.getEntity().getContentType().getValue())).body(Mono.fromSupplier(body), String.class);<NEW_LINE>} else {<NEW_LINE>ClientLogger.logRequest(logId, request.getMethod().toUpperCase(), request.getEndpoint(), request.getParameters());<NEW_LINE>}<NEW_LINE>return requestBodySpec;<NEW_LINE>} | getParameters(), body::get); |
1,485,491 | public OceanBaseConstant castAs(CastType type) {<NEW_LINE>if (isNull()) {<NEW_LINE>return OceanBaseConstant.createNullConstant();<NEW_LINE>}<NEW_LINE>if (type == CastType.SIGNED || type == CastType.UNSIGNED) {<NEW_LINE>String value = this.value;<NEW_LINE>while (value.startsWith(" ") || value.startsWith("\t") || value.startsWith("\n")) {<NEW_LINE>if (value.startsWith("\n")) {<NEW_LINE>throw new IgnoreMeException();<NEW_LINE>}<NEW_LINE>value = value.substring(1);<NEW_LINE>}<NEW_LINE>for (int i = value.length(); i >= 1; i--) {<NEW_LINE>try {<NEW_LINE>String substring = value.substring(0, i);<NEW_LINE>long <MASK><NEW_LINE>return OceanBaseConstant.createIntConstant(val, type == CastType.SIGNED);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return OceanBaseConstant.createIntConstant(0, type == CastType.SIGNED);<NEW_LINE>} else {<NEW_LINE>throw new AssertionError();<NEW_LINE>}<NEW_LINE>} | val = Long.parseLong(substring); |
1,280,507 | public void restoreInstanceState(@NonNull Bundle state) {<NEW_LINE>int checkedItem = state.getInt(STATE_CHECKED_ITEM, 0);<NEW_LINE>if (checkedItem != 0) {<NEW_LINE>updateSuspended = true;<NEW_LINE>for (int i = 0, size = items.size(); i < size; i++) {<NEW_LINE>NavigationMenuItem item = items.get(i);<NEW_LINE>if (item instanceof NavigationMenuTextItem) {<NEW_LINE>MenuItemImpl menuItem = ((NavigationMenuTextItem) item).getMenuItem();<NEW_LINE>if (menuItem != null && menuItem.getItemId() == checkedItem) {<NEW_LINE>setCheckedItem(menuItem);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>updateSuspended = false;<NEW_LINE>prepareMenuItems();<NEW_LINE>}<NEW_LINE>// Restore the states of the action views.<NEW_LINE>SparseArray<ParcelableSparseArray> actionViewStates = state.getSparseParcelableArray(STATE_ACTION_VIEWS);<NEW_LINE>if (actionViewStates != null) {<NEW_LINE>for (int i = 0, size = items.size(); i < size; i++) {<NEW_LINE>NavigationMenuItem navigationMenuItem = items.get(i);<NEW_LINE>if (!(navigationMenuItem instanceof NavigationMenuTextItem)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>MenuItemImpl item = ((NavigationMenuTextItem) navigationMenuItem).getMenuItem();<NEW_LINE>if (item == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (actionView == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ParcelableSparseArray container = actionViewStates.get(item.getItemId());<NEW_LINE>if (container == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>actionView.restoreHierarchyState(container);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | View actionView = item.getActionView(); |
1,843,792 | private void refreshView(final Lookup context, boolean immediate) {<NEW_LINE>Runnable r = new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>Project mainProject = OpenProjectList<MASK><NEW_LINE>final Project[] projects = selection(mainProject, context);<NEW_LINE>final String presenterName = getPresenterName(name, mainProject, projects);<NEW_LINE>final boolean enabled;<NEW_LINE>if (command == null) {<NEW_LINE>enabled = projects.length == 1 && performer.enable(projects[0]);<NEW_LINE>} else if (projects.length == 0) {<NEW_LINE>enabled = false;<NEW_LINE>} else {<NEW_LINE>boolean e = true;<NEW_LINE>for (Project p : projects) {<NEW_LINE>if (!ActionsUtil.commandSupported(p, command, Lookup.EMPTY)) {<NEW_LINE>e = false;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>enabled = e;<NEW_LINE>}<NEW_LINE>Mutex.EVENT.writeAccess(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>putValue("selectedProjects", projects);<NEW_LINE>putValue("menuText", presenterName);<NEW_LINE>putValue(SHORT_DESCRIPTION, Actions.cutAmpersand(presenterName));<NEW_LINE>setEnabled(enabled);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (immediate) {<NEW_LINE>r.run();<NEW_LINE>} else {<NEW_LINE>RP.post(r);<NEW_LINE>}<NEW_LINE>} | .getDefault().getMainProject(); |
348,000 | public static CreateContactFlowResponse unmarshall(CreateContactFlowResponse createContactFlowResponse, UnmarshallerContext context) {<NEW_LINE>createContactFlowResponse.setRequestId(context.stringValue("CreateContactFlowResponse.RequestId"));<NEW_LINE>createContactFlowResponse.setSuccess(context.booleanValue("CreateContactFlowResponse.Success"));<NEW_LINE>createContactFlowResponse.setCode(context.stringValue("CreateContactFlowResponse.Code"));<NEW_LINE>createContactFlowResponse.setMessage(context.stringValue("CreateContactFlowResponse.Message"));<NEW_LINE>createContactFlowResponse.setHttpStatusCode(context.integerValue("CreateContactFlowResponse.HttpStatusCode"));<NEW_LINE>ContactFlow contactFlow = new ContactFlow();<NEW_LINE>contactFlow.setContactFlowId(context.stringValue("CreateContactFlowResponse.ContactFlow.ContactFlowId"));<NEW_LINE>contactFlow.setInstanceId(context.stringValue("CreateContactFlowResponse.ContactFlow.InstanceId"));<NEW_LINE>contactFlow.setContactFlowName(context.stringValue("CreateContactFlowResponse.ContactFlow.ContactFlowName"));<NEW_LINE>contactFlow.setContactFlowDescription(context.stringValue("CreateContactFlowResponse.ContactFlow.ContactFlowDescription"));<NEW_LINE>contactFlow.setType<MASK><NEW_LINE>contactFlow.setAppliedVersion(context.stringValue("CreateContactFlowResponse.ContactFlow.AppliedVersion"));<NEW_LINE>List<ContactFlowVersion> versions = new ArrayList<ContactFlowVersion>();<NEW_LINE>for (int i = 0; i < context.lengthValue("CreateContactFlowResponse.ContactFlow.Versions.Length"); i++) {<NEW_LINE>ContactFlowVersion contactFlowVersion = new ContactFlowVersion();<NEW_LINE>contactFlowVersion.setContactFlowVersionId(context.stringValue("CreateContactFlowResponse.ContactFlow.Versions[" + i + "].ContactFlowVersionId"));<NEW_LINE>contactFlowVersion.setVersion(context.stringValue("CreateContactFlowResponse.ContactFlow.Versions[" + i + "].Version"));<NEW_LINE>contactFlowVersion.setContactFlowVersionDescription(context.stringValue("CreateContactFlowResponse.ContactFlow.Versions[" + i + "].ContactFlowVersionDescription"));<NEW_LINE>contactFlowVersion.setCanvas(context.stringValue("CreateContactFlowResponse.ContactFlow.Versions[" + i + "].Canvas"));<NEW_LINE>contactFlowVersion.setContent(context.stringValue("CreateContactFlowResponse.ContactFlow.Versions[" + i + "].Content"));<NEW_LINE>contactFlowVersion.setLastModified(context.stringValue("CreateContactFlowResponse.ContactFlow.Versions[" + i + "].LastModified"));<NEW_LINE>contactFlowVersion.setLastModifiedBy(context.stringValue("CreateContactFlowResponse.ContactFlow.Versions[" + i + "].LastModifiedBy"));<NEW_LINE>contactFlowVersion.setLockedBy(context.stringValue("CreateContactFlowResponse.ContactFlow.Versions[" + i + "].LockedBy"));<NEW_LINE>contactFlowVersion.setStatus(context.stringValue("CreateContactFlowResponse.ContactFlow.Versions[" + i + "].Status"));<NEW_LINE>versions.add(contactFlowVersion);<NEW_LINE>}<NEW_LINE>contactFlow.setVersions(versions);<NEW_LINE>List<PhoneNumber> phoneNumbers = new ArrayList<PhoneNumber>();<NEW_LINE>for (int i = 0; i < context.lengthValue("CreateContactFlowResponse.ContactFlow.PhoneNumbers.Length"); i++) {<NEW_LINE>PhoneNumber phoneNumber = new PhoneNumber();<NEW_LINE>phoneNumber.setPhoneNumberId(context.stringValue("CreateContactFlowResponse.ContactFlow.PhoneNumbers[" + i + "].PhoneNumberId"));<NEW_LINE>phoneNumber.setInstanceId(context.stringValue("CreateContactFlowResponse.ContactFlow.PhoneNumbers[" + i + "].InstanceId"));<NEW_LINE>phoneNumber.setNumber(context.stringValue("CreateContactFlowResponse.ContactFlow.PhoneNumbers[" + i + "].Number"));<NEW_LINE>phoneNumber.setPhoneNumberDescription(context.stringValue("CreateContactFlowResponse.ContactFlow.PhoneNumbers[" + i + "].PhoneNumberDescription"));<NEW_LINE>phoneNumber.setTestOnly(context.booleanValue("CreateContactFlowResponse.ContactFlow.PhoneNumbers[" + i + "].TestOnly"));<NEW_LINE>phoneNumber.setRemainingTime(context.integerValue("CreateContactFlowResponse.ContactFlow.PhoneNumbers[" + i + "].RemainingTime"));<NEW_LINE>phoneNumber.setAllowOutbound(context.booleanValue("CreateContactFlowResponse.ContactFlow.PhoneNumbers[" + i + "].AllowOutbound"));<NEW_LINE>phoneNumber.setUsage(context.stringValue("CreateContactFlowResponse.ContactFlow.PhoneNumbers[" + i + "].Usage"));<NEW_LINE>phoneNumber.setTrunks(context.integerValue("CreateContactFlowResponse.ContactFlow.PhoneNumbers[" + i + "].Trunks"));<NEW_LINE>phoneNumbers.add(phoneNumber);<NEW_LINE>}<NEW_LINE>contactFlow.setPhoneNumbers(phoneNumbers);<NEW_LINE>createContactFlowResponse.setContactFlow(contactFlow);<NEW_LINE>return createContactFlowResponse;<NEW_LINE>} | (context.stringValue("CreateContactFlowResponse.ContactFlow.Type")); |
654,931 | private boolean createCircularReveal() {<NEW_LINE>if (mColorBg == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int w = mColorBg.getWidth();<NEW_LINE>int h = mColorBg.getHeight();<NEW_LINE>if (ViewCompat.isAttachedToWindow(mColorBg) && w != 0 && h != 0) {<NEW_LINE>Resources resources = getContext2().getResources();<NEW_LINE>int keylineMargin = resources.<MASK><NEW_LINE>int thumbWidth = resources.getDimensionPixelSize(R.dimen.gallery_detail_thumb_width);<NEW_LINE>int thumbHeight = resources.getDimensionPixelSize(R.dimen.gallery_detail_thumb_height);<NEW_LINE>int x = thumbWidth / 2 + keylineMargin;<NEW_LINE>int y = thumbHeight / 2 + keylineMargin;<NEW_LINE>int radiusX = Math.max(Math.abs(x), Math.abs(w - x));<NEW_LINE>int radiusY = Math.max(Math.abs(y), Math.abs(h - y));<NEW_LINE>float radius = (float) Math.hypot(radiusX, radiusY);<NEW_LINE>ViewAnimationUtils.createCircularReveal(mColorBg, x, y, 0, radius).setDuration(300).start();<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | getDimensionPixelSize(R.dimen.keyline_margin); |
640,165 | ActionResult<List<Wo>> execute(EffectivePerson effectivePerson) throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>ActionResult<List<Wo>> result = new ActionResult<>();<NEW_LINE>Business business = new Business(emc);<NEW_LINE>List<String> ids = business.imConversationFactory().listConversationWithPerson(effectivePerson.getDistinguishedName());<NEW_LINE>List<Wo> wos = Wo.copier.copy(emc.list(IMConversation.class, ids));<NEW_LINE>for (Wo wo : wos) {<NEW_LINE>IMConversationExt ext = business.imConversationFactory().getConversationExt(effectivePerson.getDistinguishedName(), wo.getId());<NEW_LINE>if (ext != null) {<NEW_LINE>wo.<MASK><NEW_LINE>wo.setUnreadNumber(business.imConversationFactory().unreadNumber(ext));<NEW_LINE>} else {<NEW_LINE>IMConversationExt conversationExt = new IMConversationExt();<NEW_LINE>conversationExt.setConversationId(wo.getId());<NEW_LINE>conversationExt.setPerson(effectivePerson.getDistinguishedName());<NEW_LINE>emc.beginTransaction(IMConversationExt.class);<NEW_LINE>emc.persist(conversationExt, CheckPersistType.all);<NEW_LINE>emc.commit();<NEW_LINE>wo.setIsTop(false);<NEW_LINE>wo.setUnreadNumber(business.imConversationFactory().unreadNumber(conversationExt));<NEW_LINE>}<NEW_LINE>wo.setLastMessage(WoMsg.copier.copy(business.imConversationFactory().lastMessage(wo.getId())));<NEW_LINE>}<NEW_LINE>result.setData(wos);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | setIsTop(ext.getIsTop()); |
873,714 | private void deleteVolume(final CascadeAction action, final Completion completion) {<NEW_LINE>final List<<MASK><NEW_LINE>if (volumes == null || volumes.isEmpty()) {<NEW_LINE>completion.success();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<VolumeDeletionMsg> msgs = new ArrayList<VolumeDeletionMsg>();<NEW_LINE>for (VolumeDeletionStruct vol : volumes) {<NEW_LINE>VolumeDeletionMsg msg = new VolumeDeletionMsg();<NEW_LINE>msg.setDetachBeforeDeleting(vol.isDetachBeforeDeleting());<NEW_LINE>msg.setForceDelete(action.isActionCode(CascadeConstant.DELETION_FORCE_DELETE_CODE));<NEW_LINE>msg.setVolumeUuid(vol.getInventory().getUuid());<NEW_LINE>msg.setDeletionPolicy(vol.getDeletionPolicy());<NEW_LINE>bus.makeTargetServiceIdByResourceUuid(msg, VolumeConstant.SERVICE_ID, vol.getInventory().getUuid());<NEW_LINE>msgs.add(msg);<NEW_LINE>}<NEW_LINE>bus.send(msgs, 10, new CloudBusListCallBack(completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(List<MessageReply> replies) {<NEW_LINE>if (!action.isActionCode(CascadeConstant.DELETION_FORCE_DELETE_CODE)) {<NEW_LINE>for (MessageReply r : replies) {<NEW_LINE>if (!r.isSuccess()) {<NEW_LINE>completion.fail(r.getError());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>completion.success();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | VolumeDeletionStruct> volumes = volumesFromAction(action); |
1,583,580 | // Note that some TREC 2018 topics don't properly close the </url> tags.<NEW_LINE>@Override<NEW_LINE>public SortedMap<Integer, Map<String, String>> read(BufferedReader bRdr) throws IOException {<NEW_LINE>SortedMap<Integer, Map<String, String>> map = new TreeMap<>();<NEW_LINE>Map<String, String> fields = new HashMap<>();<NEW_LINE>String number = "";<NEW_LINE>Matcher m;<NEW_LINE>String line;<NEW_LINE>while ((line = bRdr.readLine()) != null) {<NEW_LINE>line = line.trim();<NEW_LINE>if (line.startsWith("<num>") && line.endsWith("</num>")) {<NEW_LINE>m = NUM_PATTERN.matcher(line);<NEW_LINE>if (!m.find()) {<NEW_LINE>throw new IOException("Error parsing " + line);<NEW_LINE>}<NEW_LINE>number = m.group(1);<NEW_LINE>}<NEW_LINE>if (line.startsWith("<docid>") && line.endsWith("</docid>")) {<NEW_LINE>m = DOCID_PATTERN.matcher(line);<NEW_LINE>if (!m.find()) {<NEW_LINE>throw new IOException("Error parsing " + line);<NEW_LINE>}<NEW_LINE>fields.put("title", m.group(1));<NEW_LINE>}<NEW_LINE>if (line.startsWith("<url>") && (line.endsWith("</url>") || line.endsWith("<url>"))) {<NEW_LINE>// Note that some TREC 2018 topics don't properly close the </url> tags.<NEW_LINE>m = URL_PATTERN.matcher(line);<NEW_LINE>if (!m.find()) {<NEW_LINE>throw new IOException("Error parsing " + line);<NEW_LINE>}<NEW_LINE>fields.put("url"<MASK><NEW_LINE>}<NEW_LINE>if (line.startsWith("</top>")) {<NEW_LINE>map.put(Integer.valueOf(number), fields);<NEW_LINE>fields = new HashMap<>();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>} | , m.group(1)); |
1,733,907 | public void dump() {<NEW_LINE>String hdr <MASK><NEW_LINE>System.out.println(hdr);<NEW_LINE>if (m_data == null) {<NEW_LINE>System.out.println("----- no data -----");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// raw data<NEW_LINE>for (int i = 0; i < m_data.length; i++) {<NEW_LINE>char data = (char) m_data[i];<NEW_LINE>System.out.print(data);<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>System.out.println(hdr);<NEW_LINE>// Count nulls at end<NEW_LINE>int ii = m_data.length - 1;<NEW_LINE>int nullCount = 0;<NEW_LINE>while (m_data[ii--] == 0) nullCount++;<NEW_LINE>System.out.println("----- Length=" + m_data.length + ", EndNulls=" + nullCount + ", RealLength=" + (m_data.length - nullCount));<NEW_LINE>} | = "----- " + getName() + " -----"; |
1,704,732 | public void unarchive(final List<Path> selected) {<NEW_LINE>final List<Path> expanded <MASK><NEW_LINE>for (final Path s : selected) {<NEW_LINE>final Archive archive = Archive.forName(s.getName());<NEW_LINE>if (null == archive) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>new OverwriteController(parent).overwrite(archive.getExpanded(Collections.singletonList(s)), new DefaultMainAction() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>parent.background(new RegistryBackgroundAction<Boolean>(parent, parent.getSession()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Boolean run(final Session<?> session) throws BackgroundException {<NEW_LINE>final Compress feature = session.getFeature(Compress.class);<NEW_LINE>feature.unarchive(archive, s, parent, parent);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void cleanup() {<NEW_LINE>super.cleanup();<NEW_LINE>expanded.addAll(archive.getExpanded(Collections.singletonList(s)));<NEW_LINE>// Update Selection<NEW_LINE>parent.reload(parent.workdir(), selected, expanded);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getActivity() {<NEW_LINE>return archive.getDecompressCommand(s);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | = new ArrayList<Path>(); |
1,776,236 | private void process(JaxbXmlPart part) throws Docx4JException {<NEW_LINE>log.info("/n Processing " + part.getPartName().getName());<NEW_LINE>org.docx4j.openpackaging.packages.OpcPackage pkg = part.getPackage();<NEW_LINE>// Binding is a concept which applies more broadly<NEW_LINE>// than just Word documents.<NEW_LINE>org.w3c.dom.Document doc = XmlUtils.marshaltoW3CDomDocument(part.getJaxbElement());<NEW_LINE>JAXBContext jc = Context.jc;<NEW_LINE>try {<NEW_LINE>// Use constructor which takes Unmarshaller, rather than JAXBContext,<NEW_LINE>// so we can set JaxbValidationEventHandler<NEW_LINE>Unmarshaller u = jc.createUnmarshaller();<NEW_LINE>JaxbValidationEventHandler eventHandler = new org.docx4j.jaxb.JaxbValidationEventHandler();<NEW_LINE>// eventHandler.setContinue(true);<NEW_LINE>u.setEventHandler(eventHandler);<NEW_LINE>Map<String, Object> transformParameters = new HashMap<String, Object>();<NEW_LINE>transformParameters.put("OpenDoPEIntegrity", this);<NEW_LINE>try {<NEW_LINE>javax.xml.bind.util.JAXBResult result = new javax.xml.bind.util.JAXBResult(u);<NEW_LINE>org.docx4j.XmlUtils.transform(doc, xslt, transformParameters, result);<NEW_LINE>part.setJaxbElement(result);<NEW_LINE>// this will fail if there is unexpected content,<NEW_LINE>// since JaxbValidationEventHandler fails by default<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error(e.getMessage(), e);<NEW_LINE>log.error("Input in question:" + XmlUtils.w3CDomNodeToString(doc));<NEW_LINE>log.error("Now trying DOMResult..");<NEW_LINE>DOMResult result = new DOMResult();<NEW_LINE>org.docx4j.XmlUtils.transform(doc, xslt, transformParameters, result);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>org.w3c.dom.Document docResult = ((org.w3c.dom.Document) result.getNode());<NEW_LINE>// log.debug("After ODI: " + XmlUtils.w3CDomNodeToString(docResult));<NEW_LINE>Object o = XmlUtils.unmarshal(((org.w3c.dom.Document) result.getNode()));<NEW_LINE>part.setJaxbElement(o);<NEW_LINE>} else {<NEW_LINE>// part.unmarshal( ((org.w3c.dom.Document)result.getNode()).getDocumentElement() );<NEW_LINE>Object o = XmlUtils.unmarshal(((org.w3c.dom.Document) result.getNode()));<NEW_LINE>part.setJaxbElement(o);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | throw new Docx4JException("Problems ensuring integrity", e); |
588,253 | public BucketPolicy unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>BucketPolicy bucketPolicy = new BucketPolicy();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("allowsPublicReadAccess", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>bucketPolicy.setAllowsPublicReadAccess(context.getUnmarshaller(Boolean.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("allowsPublicWriteAccess", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>bucketPolicy.setAllowsPublicWriteAccess(context.getUnmarshaller(Boolean.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 bucketPolicy;<NEW_LINE>} | class).unmarshall(context)); |
258,615 | protected EncounterResult encounter() throws RequestFailedException {<NEW_LINE>EncounterMessage message = EncounterMessage.newBuilder().setEncounterId(pokemon.encounterId).setSpawnPointId(pokemon.spawnPointId).setPlayerLatitude(api.latitude).setPlayerLongitude(api.longitude).build();<NEW_LINE>ServerRequest request = new ServerRequest(RequestType.ENCOUNTER, message);<NEW_LINE>ByteString responseData = api.<MASK><NEW_LINE>try {<NEW_LINE>EncounterResponse response = EncounterResponse.parseFrom(responseData);<NEW_LINE>encounterResult = EncounterResult.from(response.getStatus());<NEW_LINE>activeItem = response.getActiveItem();<NEW_LINE>captureProbabilities = response.getCaptureProbability();<NEW_LINE>encounteredPokemon = response.getWildPokemon().getPokemonData();<NEW_LINE>} catch (InvalidProtocolBufferException e) {<NEW_LINE>throw new RequestFailedException(e);<NEW_LINE>}<NEW_LINE>return encounterResult;<NEW_LINE>} | requestHandler.sendServerRequests(request, true); |
432,933 | protected void delegateMethod(final RESTRequest request, final RESTResponse response) throws RESTException {<NEW_LINE>final String method = request.getMethod();<NEW_LINE>if (HTTP_METHOD_GET.equals(method)) {<NEW_LINE>setJSONResponse(response, doGET(request, response), HTTP_OK);<NEW_LINE>} else if (HTTP_METHOD_POST.equals(method)) {<NEW_LINE>checkMediaTypeIsJson(request);<NEW_LINE>POSTResponse pr = doPOST(request, response);<NEW_LINE>response.setResponseHeader("Location", pr.createdURL);<NEW_LINE>setJSONResponse(<MASK><NEW_LINE>} else if (HTTP_METHOD_PUT.equals(method)) {<NEW_LINE>checkMediaTypeIsJson(request);<NEW_LINE>setJSONResponse(response, doPUT(request, response), HTTP_OK);<NEW_LINE>} else if (HTTP_METHOD_DELETE.equals(method)) {<NEW_LINE>setJSONResponse(response, doDELETE(request, response), HTTP_OK);<NEW_LINE>} else {<NEW_LINE>throw new MethodNotSupportedException();<NEW_LINE>}<NEW_LINE>} | response, pr.jsonPayload, HTTP_CREATED); |
1,351,291 | public static String[] splitCommaUnlessInParen(String line) {<NEW_LINE>int nestingLevelParen = 0;<NEW_LINE>int lastComma = -1;<NEW_LINE>List<String> parts = new ArrayList<String>();<NEW_LINE>for (int i = 0; i < line.length(); i++) {<NEW_LINE>char c = line.charAt(i);<NEW_LINE>if (c == '(') {<NEW_LINE>nestingLevelParen++;<NEW_LINE>}<NEW_LINE>if (c == ')') {<NEW_LINE>if (nestingLevelParen == 0) {<NEW_LINE>throw new RuntimeException("Close parenthesis ')' found but none open");<NEW_LINE>}<NEW_LINE>nestingLevelParen--;<NEW_LINE>}<NEW_LINE>if (c == ',' && nestingLevelParen == 0) {<NEW_LINE>String part = line.substring(lastComma + 1, i);<NEW_LINE>if (part.trim().length() > 0) {<NEW_LINE>parts.add(part);<NEW_LINE>}<NEW_LINE>lastComma = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String lastPart = <MASK><NEW_LINE>if (lastPart.trim().length() > 0) {<NEW_LINE>parts.add(lastPart);<NEW_LINE>}<NEW_LINE>return parts.toArray(new String[parts.size()]);<NEW_LINE>} | line.substring(lastComma + 1); |
608,149 | public static void doMove(final Module[] modules, final ModuleGroup group, @Nullable final DataContext dataContext) {<NEW_LINE>Project project = modules[0].getProject();<NEW_LINE>for (final Module module : modules) {<NEW_LINE>ModifiableModuleModel model = dataContext != null ? dataContext.<MASK><NEW_LINE>if (model != null) {<NEW_LINE>model.setModuleGroupPath(module, group == null ? null : group.getGroupPath());<NEW_LINE>} else {<NEW_LINE>ModuleManagerImpl.getInstanceImpl(project).setModuleGroupPath(module, group == null ? null : group.getGroupPath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>AbstractProjectViewPane pane = ProjectView.getInstance(project).getCurrentProjectViewPane();<NEW_LINE>if (pane != null) {<NEW_LINE>pane.updateFromRoot(true);<NEW_LINE>}<NEW_LINE>boolean processedInsideSettings = false;<NEW_LINE>if (dataContext != null) {<NEW_LINE>Settings settings = dataContext.getData(Settings.KEY);<NEW_LINE>if (settings != null) {<NEW_LINE>ModuleStructureConfigurable configurable = settings.findConfigurable(ModuleStructureConfigurable.class);<NEW_LINE>if (configurable != null) {<NEW_LINE>processedInsideSettings = ModuleStructureConfigurable.processModulesMoved(configurable, modules, group);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!processedInsideSettings && pane != null) {<NEW_LINE>if (group != null) {<NEW_LINE>pane.selectModuleGroup(group, true);<NEW_LINE>} else {<NEW_LINE>pane.selectModule(modules[0], true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getData(LangDataKeys.MODIFIABLE_MODULE_MODEL) : null; |
1,351,146 | final DescribeSpotInstanceRequestsResult executeDescribeSpotInstanceRequests(DescribeSpotInstanceRequestsRequest describeSpotInstanceRequestsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeSpotInstanceRequestsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeSpotInstanceRequestsRequest> request = null;<NEW_LINE>Response<DescribeSpotInstanceRequestsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeSpotInstanceRequestsRequestMarshaller().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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeSpotInstanceRequests");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeSpotInstanceRequestsResult> responseHandler = new StaxResponseHandler<DescribeSpotInstanceRequestsResult>(new DescribeSpotInstanceRequestsResultStaxUnmarshaller());<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(describeSpotInstanceRequestsRequest)); |
341,820 | private void writeEventToRelayDispatcher(ConnectionState curState, DbusEvent event, String message) throws InterruptedException, InvalidEventException {<NEW_LINE>boolean success = false;<NEW_LINE>// Create a infinite backoff timer that waits for maximum of 1 sec<NEW_LINE>// for writing the control message to evb<NEW_LINE>BackoffTimerStaticConfig timerConfig = new BackoffTimerStaticConfig(1, 1000, 1, 1, -1);<NEW_LINE>BackoffTimer timer = new BackoffTimer("EVB More Space Timer", timerConfig);<NEW_LINE>timer.reset();<NEW_LINE>byte[] eventBytes = new byte[event.size()];<NEW_LINE>_log.info("Event size: " + eventBytes.length);<NEW_LINE>_log.info(<MASK><NEW_LINE>event.getRawBytes().get(eventBytes);<NEW_LINE>UnifiedClientStats unifiedClientStats = _sourcesConn.getUnifiedClientStats();<NEW_LINE>while ((!success) && (timer.getRemainingRetriesNum() > 0)) {<NEW_LINE>ByteArrayInputStream cpIs = new ByteArrayInputStream(eventBytes);<NEW_LINE>ReadableByteChannel cpRbc = Channels.newChannel(cpIs);<NEW_LINE>sendHeartbeat(unifiedClientStats);<NEW_LINE>int ecnt = curState.getDataEventsBuffer().readEvents(cpRbc);<NEW_LINE>if (ecnt <= 0) {<NEW_LINE>_log.error("Not enough spece in the event buffer to add a control message :" + message);<NEW_LINE>boolean interrupted = !timer.backoffAndSleep();<NEW_LINE>if (interrupted)<NEW_LINE>throw new InterruptedException("Got interrupted while waiting to write control Message to EVB : " + message);<NEW_LINE>} else {<NEW_LINE>_log.info("Sent a control message :" + message);<NEW_LINE>success = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "Event:" + event.toString()); |
1,766,114 | private static void applyLValueCondense(AssignmentSimple a1, AssignmentSimple a2, Op03SimpleStatement stm1, Op03SimpleStatement stm2) {<NEW_LINE>Expression r1 = a1.getRValue();<NEW_LINE>Expression r2 = a2.getRValue();<NEW_LINE>LValue l1 = a1.getCreatedLValue();<NEW_LINE>LValue l2 = a2.getCreatedLValue();<NEW_LINE>if (!r2.equals(new LValueExpression(l1)))<NEW_LINE>return;<NEW_LINE>Expression newRhs = null;<NEW_LINE>if (r1 instanceof ArithmeticOperation && ((ArithmeticOperation) r1).isMutationOf(l1)) {<NEW_LINE>ArithmeticOperation ar1 = (ArithmeticOperation) r1;<NEW_LINE>AbstractMutatingAssignmentExpression me = ar1.getMutationOf(l1);<NEW_LINE>newRhs = me;<NEW_LINE>}<NEW_LINE>if (newRhs == null)<NEW_LINE>newRhs = new AssignmentExpression(BytecodeLoc.TODO, l1, r1);<NEW_LINE>if (newRhs.getInferredJavaType().getJavaTypeInstance() != l2.getInferredJavaType().getJavaTypeInstance()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>stm2.replaceStatement(new AssignmentSimple(BytecodeLoc<MASK><NEW_LINE>stm1.nopOut();<NEW_LINE>} | .TODO, l2, newRhs)); |
1,551,793 | public boolean process(DMatrixRMaj P) {<NEW_LINE>if (!svd.decompose(P))<NEW_LINE>return false;<NEW_LINE>svd.getU(Ut, true);<NEW_LINE>svd.getV(V, false);<NEW_LINE>double[] sv = svd.getSingularValues();<NEW_LINE>SingularOps_DDRM.descendingOrder(Ut, true, sv, 3, V, false);<NEW_LINE>// compute W+, which is transposed and non-negative inverted<NEW_LINE>for (int i = 0; i < 3; i++) {<NEW_LINE>Wt.unsafe_set(i, i<MASK><NEW_LINE>}<NEW_LINE>// get the pseudo inverse<NEW_LINE>// A+ = V*(W+)*U'<NEW_LINE>CommonOps_DDRM.mult(V, Wt, tmp);<NEW_LINE>CommonOps_DDRM.mult(tmp, Ut, PA);<NEW_LINE>// Vector U, which is P*U = 0<NEW_LINE>SpecializedOps_DDRM.subvector(V, 0, 3, V.numRows, false, 0, ns);<NEW_LINE>return true;<NEW_LINE>} | , 1.0 / sv[i]); |
337,201 | public synchronized void nextPanel() {<NEW_LINE>if (current() == selectUriStep) {<NEW_LINE>Map<String, GitBranch> remoteBranches = selectUriStep.getRemoteBranches();<NEW_LINE>Map<String, String> remoteTags = selectUriStep.getRemoteTags();<NEW_LINE>if (remoteBranches != null) {<NEW_LINE>pushBranchesStep.fillRemoteBranches(selectUriStep.getSelectedRemote(), remoteBranches, remoteTags == null ? Collections.<String, String>emptyMap() : remoteTags);<NEW_LINE>}<NEW_LINE>pushBranchesStep.setAsLastPanel(!selectUriStep.isConfiguredRemoteSelected() && selectUriStep.getRemoteName() == null);<NEW_LINE>selectUriStep.storeURI();<NEW_LINE>} else if (current() == pushBranchesStep) {<NEW_LINE>Collection<PushMapping> mappings = pushBranchesStep.getSelectedMappings();<NEW_LINE>Map<String, String> remoteBranches = new LinkedHashMap<String, String>(mappings.size());<NEW_LINE>for (PushMapping mapping : mappings) {<NEW_LINE>if (!mapping.isDeletion() && mapping instanceof PushMapping.PushBranchMapping) {<NEW_LINE>PushBranchMapping <MASK><NEW_LINE>remoteBranches.put(pushMapping.getRemoteRepositoryBranchName(), pushMapping.getLocalRepositoryBranchHeadId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>updateBranchReferencesStep.setRemote(selectUriStep.getSelectedRemote());<NEW_LINE>updateBranchReferencesStep.fillRemoteBranches(remoteBranches);<NEW_LINE>}<NEW_LINE>super.nextPanel();<NEW_LINE>} | pushMapping = (PushMapping.PushBranchMapping) mapping; |
745,011 | public CreateJobTemplateResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateJobTemplateResult createJobTemplateResult = new CreateJobTemplateResult();<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 createJobTemplateResult;<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("jobTemplate", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createJobTemplateResult.setJobTemplate(JobTemplateJsonUnmarshaller.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 createJobTemplateResult;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
671,472 | public static DeleteSipAgentGroupResponse unmarshall(DeleteSipAgentGroupResponse deleteSipAgentGroupResponse, UnmarshallerContext context) {<NEW_LINE>deleteSipAgentGroupResponse.setRequestId(context.stringValue("DeleteSipAgentGroupResponse.RequestId"));<NEW_LINE>deleteSipAgentGroupResponse.setSuccess<MASK><NEW_LINE>deleteSipAgentGroupResponse.setCode(context.stringValue("DeleteSipAgentGroupResponse.Code"));<NEW_LINE>deleteSipAgentGroupResponse.setMessage(context.stringValue("DeleteSipAgentGroupResponse.Message"));<NEW_LINE>deleteSipAgentGroupResponse.setHttpStatusCode(context.integerValue("DeleteSipAgentGroupResponse.HttpStatusCode"));<NEW_LINE>deleteSipAgentGroupResponse.setProvider(context.stringValue("DeleteSipAgentGroupResponse.Provider"));<NEW_LINE>List<SipAgent> sipAgents = new ArrayList<SipAgent>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DeleteSipAgentGroupResponse.SipAgents.Length"); i++) {<NEW_LINE>SipAgent sipAgent = new SipAgent();<NEW_LINE>sipAgent.setId(context.longValue("DeleteSipAgentGroupResponse.SipAgents[" + i + "].Id"));<NEW_LINE>sipAgent.setName(context.stringValue("DeleteSipAgentGroupResponse.SipAgents[" + i + "].Name"));<NEW_LINE>sipAgent.setIp(context.stringValue("DeleteSipAgentGroupResponse.SipAgents[" + i + "].Ip"));<NEW_LINE>sipAgent.setPort(context.stringValue("DeleteSipAgentGroupResponse.SipAgents[" + i + "].Port"));<NEW_LINE>sipAgent.setSendInterface(context.integerValue("DeleteSipAgentGroupResponse.SipAgents[" + i + "].SendInterface"));<NEW_LINE>sipAgent.setStatus(context.booleanValue("DeleteSipAgentGroupResponse.SipAgents[" + i + "].Status"));<NEW_LINE>sipAgents.add(sipAgent);<NEW_LINE>}<NEW_LINE>deleteSipAgentGroupResponse.setSipAgents(sipAgents);<NEW_LINE>return deleteSipAgentGroupResponse;<NEW_LINE>} | (context.booleanValue("DeleteSipAgentGroupResponse.Success")); |
1,608,491 | public AuthenticationDetails login(Credentials credentials) throws LoginException {<NEW_LINE>checkNotNullArgument(credentials, "credentials should not be null");<NEW_LINE>SecurityContext previousSecurityContext = AppContext.getSecurityContext();<NEW_LINE>AppContext.setSecurityContext(new SecurityContext(serverSession));<NEW_LINE>AuthenticationDetails authenticationDetails = null;<NEW_LINE>try {<NEW_LINE>try (Transaction tx = persistence.createTransaction()) {<NEW_LINE>publishBeforeLoginEvent(credentials);<NEW_LINE>authenticationDetails = authenticateInternal(credentials);<NEW_LINE>tx.commit();<NEW_LINE>userSessionManager.clearPermissionsOnUser(authenticationDetails.getSession());<NEW_LINE>setTimeZone(credentials, authenticationDetails);<NEW_LINE>setSessionAttributes(credentials, authenticationDetails);<NEW_LINE>storeSession(credentials, authenticationDetails);<NEW_LINE>log.info(<MASK><NEW_LINE>publishUserLoggedInEvent(credentials, authenticationDetails);<NEW_LINE>return authenticationDetails;<NEW_LINE>} finally {<NEW_LINE>publishAfterLoginEvent(credentials, authenticationDetails);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>AppContext.setSecurityContext(previousSecurityContext);<NEW_LINE>}<NEW_LINE>} | "Logged in: {}", authenticationDetails.getSession()); |
1,787,190 | public RolePermissionsForm updateRolePermissions(final RolePermissionsForm rolePermissionsForm) {<NEW_LINE>log.debug("updateRolePermissions() - rolePermissionsForm: {}", rolePermissionsForm);<NEW_LINE>final Set<Permission> newPermissions = rolePermissionsForm.getRolePermissions().stream().filter(RolePermissionDto::isSelected).map(rolePermissionDto -> permissionService.find(rolePermissionDto.getPermission().getId())).collect(Collectors.toSet());<NEW_LINE>final Role role = roleService.find(rolePermissionsForm.getRole().getId());<NEW_LINE>role.changePermissions(newPermissions);<NEW_LINE>final Role <MASK><NEW_LINE>final RoleDto updatedRoleDto = roleToRoleDtoConverter.convert(updatedRole);<NEW_LINE>final List<Permission> allPermissions = permissionService.findAll();<NEW_LINE>final List<PermissionDto> allPermissionsDto = permissionToPermissionDtoConverter.convertToList(allPermissions);<NEW_LINE>return new RolePermissionsForm(updatedRoleDto, allPermissionsDto);<NEW_LINE>} | updatedRole = roleService.update(role); |
1,745,676 | public int decodeNumeric(PackedBits8 data, int bitLocation, int lengthBits) {<NEW_LINE>int length = data.read(bitLocation, lengthBits, true);<NEW_LINE>bitLocation += lengthBits;<NEW_LINE>while (length >= 3) {<NEW_LINE>if (data.size < bitLocation + 10) {<NEW_LINE>if (verbose != null)<NEW_LINE>verbose.printf("overflow: numeric data.size=%d\n", data.size);<NEW_LINE>failureCause = QrCode.Failure.MESSAGE_OVERFLOW;<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>int chunk = data.read(bitLocation, 10, true);<NEW_LINE>bitLocation += 10;<NEW_LINE>int valA = chunk / 100;<NEW_LINE>int valB = (chunk - valA * 100) / 10;<NEW_LINE>int valC = chunk - valA * 100 - valB * 10;<NEW_LINE>workString.append((char) (valA + '0'));<NEW_LINE>workString.append((char) (valB + '0'));<NEW_LINE>workString.append((char) (valC + '0'));<NEW_LINE>length -= 3;<NEW_LINE>}<NEW_LINE>if (length == 2) {<NEW_LINE>if (data.size < bitLocation + 7) {<NEW_LINE>failureCause = QrCode.Failure.MESSAGE_OVERFLOW;<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>int chunk = data.read(bitLocation, 7, true);<NEW_LINE>bitLocation += 7;<NEW_LINE>int valA = chunk / 10;<NEW_LINE>int valB = chunk - valA * 10;<NEW_LINE>workString.append((char) (valA + '0'));<NEW_LINE>workString.append((<MASK><NEW_LINE>} else if (length == 1) {<NEW_LINE>if (data.size < bitLocation + 4) {<NEW_LINE>failureCause = QrCode.Failure.MESSAGE_OVERFLOW;<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>int valA = data.read(bitLocation, 4, true);<NEW_LINE>bitLocation += 4;<NEW_LINE>workString.append((char) (valA + '0'));<NEW_LINE>}<NEW_LINE>return bitLocation;<NEW_LINE>} | char) (valB + '0')); |
735,434 | public void attemptAuthentication(final PwmRequest pwmRequest) throws PwmUnrecoverableException {<NEW_LINE>if (!pwmRequest.getDomainConfig().readSettingAsBoolean(PwmSetting.BASIC_AUTH_ENABLED)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (pwmRequest.isAuthenticated()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Optional<BasicAuthInfo> basicAuthInfo = BasicAuthInfo.parseAuthHeader(pwmRequest.getPwmDomain(), pwmRequest);<NEW_LINE>if (basicAuthInfo.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final PwmSession pwmSession = pwmRequest.getPwmSession();<NEW_LINE>final PwmDomain pwmDomain = pwmRequest.getPwmDomain();<NEW_LINE>// user isn't already authenticated and has an auth header, so try to auth them.<NEW_LINE>LOGGER.debug(pwmRequest, () -> "attempting to authenticate user using basic auth header (username=" + basicAuthInfo.get().getUsername() + ")");<NEW_LINE>final SessionAuthenticator sessionAuthenticator = new SessionAuthenticator(pwmDomain, pwmRequest, PwmAuthenticationSource.BASIC_AUTH);<NEW_LINE>final UserSearchEngine userSearchEngine = pwmDomain.getUserSearchEngine();<NEW_LINE>final UserIdentity userIdentity = userSearchEngine.resolveUsername(basicAuthInfo.get().getUsername(), null, null, pwmRequest.getLabel());<NEW_LINE>sessionAuthenticator.authenticateUser(userIdentity, basicAuthInfo.<MASK><NEW_LINE>pwmSession.getLoginInfoBean().setBasicAuth(basicAuthInfo.get());<NEW_LINE>} catch (final PwmException e) {<NEW_LINE>if (e.getError() == PwmError.ERROR_DIRECTORY_UNAVAILABLE) {<NEW_LINE>StatisticsClient.incrementStat(pwmRequest, Statistic.LDAP_UNAVAILABLE_COUNT);<NEW_LINE>}<NEW_LINE>throw new PwmUnrecoverableException(e.getError());<NEW_LINE>}<NEW_LINE>} | get().getPassword()); |
1,268,308 | void create(Set<String> tableDirs, Manager manager) throws IOException {<NEW_LINE>UniqueNameAllocator namer = manager.getContext().getUniqueNameAllocator();<NEW_LINE>for (ImportedTableInfo.DirectoryMapping dm : tableInfo.directories) {<NEW_LINE>Path exportDir = new Path(dm.exportDir);<NEW_LINE>log.info("Looking for matching filesystem for {} from options {}", exportDir, tableDirs);<NEW_LINE>Path base = manager.getVolumeManager().matchingFileSystem(exportDir, tableDirs);<NEW_LINE>if (base == null) {<NEW_LINE>throw new IOException(dm.exportDir + " is not in the same file system as any volume configured for Accumulo");<NEW_LINE>}<NEW_LINE>log.info("Chose base table directory of {}", base);<NEW_LINE>Path directory = new Path(base, tableInfo.tableId.canonical());<NEW_LINE>Path newBulkDir = new Path(directory, Constants.BULK_PREFIX + namer.getNextName());<NEW_LINE>dm.importDir = newBulkDir.toString();<NEW_LINE>log.<MASK><NEW_LINE>}<NEW_LINE>} | info("Using import dir: {}", dm.importDir); |
214,946 | private Collection<ClientMethodInvocation> collectPendingRpcCalls(Collection<ClientConnector> rpcPendingQueue) {<NEW_LINE>List<ClientMethodInvocation> pendingInvocations = new ArrayList<>();<NEW_LINE>for (ClientConnector connector : rpcPendingQueue) {<NEW_LINE>List<ClientMethodInvocation> paintablePendingRpc = connector.retrievePendingRpcCalls();<NEW_LINE>if (null != paintablePendingRpc && !paintablePendingRpc.isEmpty()) {<NEW_LINE>List<ClientMethodInvocation> oldPendingRpc = pendingInvocations;<NEW_LINE>int totalCalls = pendingInvocations.size() + paintablePendingRpc.size();<NEW_LINE>pendingInvocations = new ArrayList<>(totalCalls);<NEW_LINE>// merge two ordered comparable lists<NEW_LINE>for (int destIndex = 0, oldIndex = 0, paintableIndex = 0; destIndex < totalCalls; destIndex++) {<NEW_LINE>if (paintableIndex >= paintablePendingRpc.size() || (oldIndex < oldPendingRpc.size() && oldPendingRpc.get(oldIndex).compareTo(paintablePendingRpc.get(paintableIndex)) <= 0)) {<NEW_LINE>pendingInvocations.add(oldPendingRpc.get(oldIndex++));<NEW_LINE>} else {<NEW_LINE>pendingInvocations.add(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return pendingInvocations;<NEW_LINE>} | paintablePendingRpc.get(paintableIndex++)); |
889,038 | private void traceConfig() {<NEW_LINE>writer.println(new StringBuilder(180).append(impl.getClass().getName()).append(' ').append(traceID).append(" = new ").append(impl.getClass().getName()).append("();").toString());<NEW_LINE>try {<NEW_LINE>PropertyDescriptor[] props = Introspector.getBeanInfo(impl.getClass()).getPropertyDescriptors();<NEW_LINE>Method readMeth, writeMeth;<NEW_LINE>for (int i = 0; i < props.length; i++) {<NEW_LINE>if ((readMeth = props[i].getReadMethod()) != null && (writeMeth = props[i].getWriteMethod()) != null) {<NEW_LINE>StringBuilder buffer = new StringBuilder(60);<NEW_LINE>buffer.append(traceID).append('.').append(writeMeth.getName()).append('(');<NEW_LINE>if (!"password".equals(props[i].getName())) {<NEW_LINE>try {<NEW_LINE>buffer.append(toString(readMeth.invoke(impl, (Object[]) null)));<NEW_LINE>} catch (Throwable th) {<NEW_LINE>}<NEW_LINE>// No FFDC code needed. Cannot read property.<NEW_LINE>}<NEW_LINE>buffer.append(");");<NEW_LINE>writer.println(new String(buffer));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IntrospectionException introspectX) {<NEW_LINE>// No FFDC code needed, just include the error in the trace.<NEW_LINE><MASK><NEW_LINE>introspectX.printStackTrace(writer);<NEW_LINE>}<NEW_LINE>} | writer.println("Unable to read the configuration for " + traceID); |
172,395 | public static PathValue populate(VirtualPathValue value, DbAccess dbAccess, NodeCursor nodeCursor, RelationshipScanCursor relCursor, PropertyCursor propertyCursor) {<NEW_LINE>if (value instanceof PathValue) {<NEW_LINE>return (PathValue) value;<NEW_LINE>} else {<NEW_LINE>var nodeIds = value.nodeIds();<NEW_LINE>var relIds = value.relationshipIds();<NEW_LINE>var nodes = new NodeValue[nodeIds.length];<NEW_LINE>var rels = new RelationshipValue[relIds.length];<NEW_LINE>long payloadSize = 0;<NEW_LINE>// we know that rels.length + 1 = nodes.length<NEW_LINE>int i = 0;<NEW_LINE>for (; i < rels.length; i++) {<NEW_LINE>NodeValue nodeValue = nodeValue(nodeIds[i], dbAccess, nodeCursor, propertyCursor);<NEW_LINE>RelationshipValue relationshipValue = relationshipValue(relIds[i], <MASK><NEW_LINE>payloadSize += nodeValue.estimatedHeapUsage() + relationshipValue.estimatedHeapUsage();<NEW_LINE>nodes[i] = nodeValue;<NEW_LINE>rels[i] = relationshipValue;<NEW_LINE>}<NEW_LINE>NodeValue nodeValue = nodeValue(nodeIds[i], dbAccess, nodeCursor, propertyCursor);<NEW_LINE>payloadSize += nodeValue.estimatedHeapUsage();<NEW_LINE>nodes[i] = nodeValue;<NEW_LINE>return VirtualValues.path(nodes, rels, payloadSize);<NEW_LINE>}<NEW_LINE>} | dbAccess, nodeCursor, relCursor, propertyCursor); |
1,399,665 | final void mergeClustersInB() {<NEW_LINE>// Update the labels with merge info for the next iteration<NEW_LINE>for (int i = 0; i < labelsB.size; i++) {<NEW_LINE>int label = labelsB.data[i];<NEW_LINE>if (// See if this cluster got merged<NEW_LINE>label == -1 || merge.data[label] == -1)<NEW_LINE>continue;<NEW_LINE>labelsB.data[i] = traverseToEnd(label);<NEW_LINE>}<NEW_LINE>// Update the counts for each cluster<NEW_LINE>for (int label = 0; label < countsB.size; label++) {<NEW_LINE>if (// See if this cluster got merged<NEW_LINE>merge.data[label] == -1)<NEW_LINE>continue;<NEW_LINE>int target = traverseToEnd(label);<NEW_LINE>// Add the point count from the merged nodes<NEW_LINE>countsB.data[target] += countsB.data[label];<NEW_LINE>// zero it out so that when the next line is processed we know this has been merged<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | countsB.data[label] = 0; |
1,257,186 | private Operation buildEntityOperation(HandlerMethod handlerMethod, DataRestRepository dataRestRepository, OpenAPI openAPI, RequestMethod requestMethod, String operationPath, MethodAttributes methodAttributes, ResourceMetadata resourceMetadata) {<NEW_LINE>Class<?> domainType = null;<NEW_LINE>if (!ControllerType.GENERAL.equals(dataRestRepository.getControllerType()))<NEW_LINE>domainType = dataRestRepository.getDomainType();<NEW_LINE>Operation operation = initOperation(handlerMethod, domainType, requestMethod);<NEW_LINE>dataRestRequestService.buildParameters(openAPI, handlerMethod, requestMethod, <MASK><NEW_LINE>dataRestResponseService.buildEntityResponse(operation, handlerMethod, openAPI, requestMethod, operationPath, methodAttributes, dataRestRepository, resourceMetadata);<NEW_LINE>tagsBuilder.buildEntityTags(operation, handlerMethod, dataRestRepository);<NEW_LINE>if (domainType != null)<NEW_LINE>addOperationDescription(operation, requestMethod, domainType.getSimpleName().toLowerCase(), dataRestRepository);<NEW_LINE>return operation;<NEW_LINE>} | methodAttributes, operation, resourceMetadata, dataRestRepository); |
1,641,635 | private void text(double x, double y, double w, double h, String str, TextAlign align, TextBaseline valign, boolean clip, double rotation) {<NEW_LINE>if (state.fillColor == null) {<NEW_LINE>state.fillColor = convertColor(state.fillColorValue);<NEW_LINE>}<NEW_LINE>if (state.fillColor != null) {<NEW_LINE>x = (state.dx + x) * state.scale;<NEW_LINE>y = (state.<MASK><NEW_LINE>w *= state.scale;<NEW_LINE>h *= state.scale;<NEW_LINE>// Font-metrics needed below this line<NEW_LINE>Graphics2D g2 = createTextGraphics(x, y, w, h, rotation, clip, align, valign);<NEW_LINE>FontMetrics fm = g2.getFontMetrics();<NEW_LINE>String[] lines = str.split("\n");<NEW_LINE>int[] stringWidths = new int[lines.length];<NEW_LINE>int textWidth = 0;<NEW_LINE>for (int i = 0; i < lines.length; i++) {<NEW_LINE>stringWidths[i] = fm.stringWidth(lines[i]);<NEW_LINE>textWidth = Math.max(textWidth, stringWidths[i]);<NEW_LINE>}<NEW_LINE>int textHeight = Math.round(lines.length * (fm.getFont().getSize() * mxConstants.LINE_HEIGHT));<NEW_LINE>if (clip && textHeight > h && h > 0) {<NEW_LINE>textHeight = (int) h;<NEW_LINE>}<NEW_LINE>Point2D margin = getMargin(align, valign);<NEW_LINE>x += margin.getX() * textWidth;<NEW_LINE>y += margin.getY() * textHeight;<NEW_LINE>g2.setColor(state.fillColor);<NEW_LINE>y += fm.getHeight() - fm.getDescent() - (margin.getY() + 0.5);<NEW_LINE>for (int i = 0; i < lines.length; i++) {<NEW_LINE>double dx = 0;<NEW_LINE>if (align != null) {<NEW_LINE>if (align == TextAlign.center) {<NEW_LINE>dx = (textWidth - stringWidths[i]) / 2;<NEW_LINE>} else if (align == TextAlign.right) {<NEW_LINE>dx = textWidth - stringWidths[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!lines[i].isEmpty()) {<NEW_LINE>g2.drawString(lines[i], (int) Math.round(x + dx), (int) Math.round(y));<NEW_LINE>}<NEW_LINE>y += Math.round(fm.getFont().getSize() * mxConstants.LINE_HEIGHT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | dy + y) * state.scale; |
333,363 | private void paintDropShadowText(Graphics g, int w, int h) {<NEW_LINE>if (textImage == null) {<NEW_LINE>textImage = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);<NEW_LINE>dropShadowImage = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);<NEW_LINE>}<NEW_LINE>// Step 1: render the text.<NEW_LINE>Graphics2D textImageG = textImage.createGraphics();<NEW_LINE>textImageG.setComposite(AlphaComposite.Clear);<NEW_LINE>textImageG.fillRect(0, 0, w, h);<NEW_LINE>textImageG.setComposite(AlphaComposite.SrcOver);<NEW_LINE>textImageG.setColor(TEXT_BLUR_COLOR);<NEW_LINE>paintText(textImageG, w, h);<NEW_LINE>textImageG.dispose();<NEW_LINE>// Step 2: copy the image containing the text to dropShadowImage using<NEW_LINE>// the blur effect, which generates a nice drop shadow.<NEW_LINE>Graphics2D blurryImageG = dropShadowImage.createGraphics();<NEW_LINE>blurryImageG.setComposite(AlphaComposite.Clear);<NEW_LINE>blurryImageG.fillRect(0, 0, w, h);<NEW_LINE><MASK><NEW_LINE>if (blur == null) {<NEW_LINE>// Configure structures needed for rendering drop shadow.<NEW_LINE>int kw = KERNEL_SIZE, kh = KERNEL_SIZE;<NEW_LINE>float blurFactor = BLUR_FACTOR;<NEW_LINE>float[] kernelData = new float[kw * kh];<NEW_LINE>for (int i = 0; i < kernelData.length; i++) {<NEW_LINE>kernelData[i] = blurFactor;<NEW_LINE>}<NEW_LINE>blur = new ConvolveOp(new Kernel(kw, kh, kernelData));<NEW_LINE>}<NEW_LINE>blurryImageG.drawImage(textImage, blur, SHIFT_X, SHIFT_Y);<NEW_LINE>if (emphasize) {<NEW_LINE>blurryImageG.setColor(Color.YELLOW);<NEW_LINE>} else {<NEW_LINE>blurryImageG.setColor(TEXT_COLOR);<NEW_LINE>}<NEW_LINE>blurryImageG.setFont(getFont());<NEW_LINE>// Step 3: render the text again on top.<NEW_LINE>paintText(blurryImageG, w, h);<NEW_LINE>blurryImageG.dispose();<NEW_LINE>// And finally copy it.<NEW_LINE>g.drawImage(dropShadowImage, 0, 0, null);<NEW_LINE>} | blurryImageG.setComposite(AlphaComposite.SrcOver); |
1,244,827 | final CreateTokenResult executeCreateToken(CreateTokenRequest createTokenRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createTokenRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<CreateTokenRequest> request = null;<NEW_LINE>Response<CreateTokenResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateTokenRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createTokenRequest));<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, "AmplifyBackend");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateToken");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateTokenResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateTokenResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
1,482,953 | public Map<Short, String> fetchAllSchemaVersionsBySourceName(String databusSourceName) throws NoSuchSchemaException, DatabusException {<NEW_LINE>boolean isDebugEnabled = LOG.isDebugEnabled();<NEW_LINE>Map<Short, String> resultMap = new HashMap<Short, String>();<NEW_LINE>SortedMap<VersionedSchemaId, VersionedSchema> schemaMap = _curSchemaSet.getAllVersionsByName(databusSourceName);<NEW_LINE>if (null != schemaMap) {<NEW_LINE>for (Entry<VersionedSchemaId, VersionedSchema> e : schemaMap.entrySet()) {<NEW_LINE>resultMap.put(e.getKey().getVersion(), e.getValue().<MASK><NEW_LINE>if (isDebugEnabled) {<NEW_LINE>LOG.debug("fetchAllSchemaVersionsBySourceName: Source (" + databusSourceName + "). For Version (" + e.getKey().getVersion() + ") adding schema (" + e.getValue().getSchema().toString() + ") to result set.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOG.warn("unknown source: " + databusSourceName);<NEW_LINE>}<NEW_LINE>return resultMap;<NEW_LINE>} | getSchema().toString()); |
893,698 | public static String dateTimeConvert(String timeValueStr, String inputFormatStr, String outputFormatStr, String outputGranularityStr) {<NEW_LINE>long timeValueMs = new DateTimeFormatSpec(inputFormatStr).fromFormatToMillis(timeValueStr);<NEW_LINE>DateTimeFormatSpec outputFormat = new DateTimeFormatSpec(outputFormatStr);<NEW_LINE>DateTimeGranularitySpec granularitySpec = new DateTimeGranularitySpec(outputGranularityStr);<NEW_LINE>if (outputFormat.getTimeFormat() == DateTimeFieldSpec.TimeFormat.SIMPLE_DATE_FORMAT) {<NEW_LINE>DateTimeFormatter outputFormatter = outputFormat.getDateTimeFormatter();<NEW_LINE>DateTime dateTime = new DateTime(<MASK><NEW_LINE>int size = granularitySpec.getSize();<NEW_LINE>switch(granularitySpec.getTimeUnit()) {<NEW_LINE>case MILLISECONDS:<NEW_LINE>dateTime = dateTime.withMillisOfSecond((dateTime.getMillisOfSecond() / size) * size);<NEW_LINE>break;<NEW_LINE>case SECONDS:<NEW_LINE>dateTime = dateTime.withSecondOfMinute((dateTime.getSecondOfMinute() / size) * size).secondOfMinute().roundFloorCopy();<NEW_LINE>break;<NEW_LINE>case MINUTES:<NEW_LINE>dateTime = dateTime.withMinuteOfHour((dateTime.getMinuteOfHour() / size) * size).minuteOfHour().roundFloorCopy();<NEW_LINE>break;<NEW_LINE>case HOURS:<NEW_LINE>dateTime = dateTime.withHourOfDay((dateTime.getHourOfDay() / size) * size).hourOfDay().roundFloorCopy();<NEW_LINE>break;<NEW_LINE>case DAYS:<NEW_LINE>dateTime = dateTime.withDayOfMonth(((dateTime.getDayOfMonth() - 1) / size) * size + 1).dayOfMonth().roundFloorCopy();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return outputFormatter.print(dateTime);<NEW_LINE>} else {<NEW_LINE>long granularityMs = granularitySpec.granularityToMillis();<NEW_LINE>long roundedTimeValueMs = timeValueMs / granularityMs * granularityMs;<NEW_LINE>return new DateTimeFormatSpec(outputFormatStr).fromMillisToFormat(roundedTimeValueMs);<NEW_LINE>}<NEW_LINE>} | timeValueMs, outputFormatter.getZone()); |
1,131,994 | public ListResolversResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListResolversResult listResolversResult = new ListResolversResult();<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 listResolversResult;<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("resolvers", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listResolversResult.setResolvers(new ListUnmarshaller<Resolver>(ResolverJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listResolversResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listResolversResult;<NEW_LINE>} | )).unmarshall(context)); |
374,596 | public String display() {<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>DecimalFormat f = new java.text.DecimalFormat("' '000");<NEW_LINE>sb.append(AdapterUtil.EOLN).append(this);<NEW_LINE>sb.append(AdapterUtil.EOLN).append("Number of entries: ").append(numEntries);<NEW_LINE>sb.append(AdapterUtil.EOLN).append("Maximum entries: ").append(maxEntries);<NEW_LINE>sb.append(AdapterUtil.EOLN).append("Number of buckets: ").append(numBuckets);<NEW_LINE>sb.append(AdapterUtil.EOLN).append("Maximum bucket size: ").append(maxBucketSize);<NEW_LINE>sb.append(AdapterUtil.EOLN).append("Number of discards: ").append(numDiscards);<NEW_LINE>sb.append(AdapterUtil.EOLN);<NEW_LINE>sb.append(AdapterUtil.EOLN).append("BUCKET SIZE PREV NEXT");<NEW_LINE>sb.append(AdapterUtil.EOLN);<NEW_LINE>for (int i = 0; i < numBuckets; i++) {<NEW_LINE>sb.append(f.format(i));<NEW_LINE>sb.append(f.format(bucketSizes[i]));<NEW_LINE>sb.append(f.<MASK><NEW_LINE>sb.append(f.format(next[i]));<NEW_LINE>sb.append(AdapterUtil.EOLN);<NEW_LINE>for (int j = 0; j < bucketSizes[i]; j++) sb.append(" ").append(Integer.toHexString(values[i][j].hashCode())).append(' ').append(keys[i][j]).append(AdapterUtil.EOLN);<NEW_LINE>}<NEW_LINE>sb.append(f.format(BEFORE_LRU)).append(" LRU ").append(f.format(next[BEFORE_LRU])).append(AdapterUtil.EOLN);<NEW_LINE>sb.append(f.format(AFTER_MRU)).append(" MRU").append(f.format(previous[AFTER_MRU])).append(AdapterUtil.EOLN);<NEW_LINE>return new String(sb);<NEW_LINE>} | format(previous[i])); |
1,151,514 | public PlanNode visitQuery(QueryStatement queryStatement, MPPQueryContext context) {<NEW_LINE>PlanBuilder planBuilder = planSelectComponent(queryStatement);<NEW_LINE>if (queryStatement.getWhereCondition() != null) {<NEW_LINE>planBuilder = planQueryFilter(planBuilder, queryStatement.getWhereCondition().getQueryFilter());<NEW_LINE>}<NEW_LINE>if (queryStatement.isGroupByLevel()) {<NEW_LINE>planBuilder = planGroupByLevel(planBuilder, ((AggregationQueryStatement) queryStatement).getGroupByLevelComponent());<NEW_LINE>}<NEW_LINE>if (queryStatement instanceof FillQueryStatement) {<NEW_LINE>planBuilder = planFill(planBuilder, ((FillQueryStatement<MASK><NEW_LINE>}<NEW_LINE>planBuilder = planFilterNull(planBuilder, queryStatement.getFilterNullComponent());<NEW_LINE>planBuilder = planSort(planBuilder, queryStatement.getResultOrder());<NEW_LINE>planBuilder = planLimit(planBuilder, queryStatement.getRowLimit());<NEW_LINE>planBuilder = planOffset(planBuilder, queryStatement.getRowOffset());<NEW_LINE>return planBuilder.getRoot();<NEW_LINE>} | ) queryStatement).getFillComponent()); |
1,525,038 | public static void fitCannyEdges(GrayF32 input) {<NEW_LINE>BufferedImage displayImage = new BufferedImage(input.width, input.height, BufferedImage.TYPE_INT_RGB);<NEW_LINE>// Finds edges inside the image<NEW_LINE>CannyEdge<GrayF32, GrayF32> canny = FactoryEdgeDetectors.canny(2, true, true, GrayF32.class, GrayF32.class);<NEW_LINE>canny.process(input, 0.1f, 0.3f, null);<NEW_LINE>List<EdgeContour> contours = canny.getContours();<NEW_LINE>Graphics2D g2 = displayImage.createGraphics();<NEW_LINE>g2.setStroke(new BasicStroke(2));<NEW_LINE>// used to select colors for each line<NEW_LINE><MASK><NEW_LINE>for (EdgeContour e : contours) {<NEW_LINE>g2.setColor(new Color(rand.nextInt()));<NEW_LINE>for (EdgeSegment s : e.segments) {<NEW_LINE>// fit line segments to the point sequence. Note that loop is false<NEW_LINE>List<PointIndex_I32> vertexes = ShapeFittingOps.fitPolygon(s.points, false, minSide, cornerPenalty);<NEW_LINE>VisualizeShapes.drawPolygon(vertexes, false, g2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>gui.addImage(displayImage, "Canny Trace");<NEW_LINE>} | Random rand = new Random(234); |
156,410 | private void handle_null_service_context(ServerRequestInfo serverRequestInfo, ORB orb) {<NEW_LINE>if (logger.isLoggable(Level.FINE)) {<NEW_LINE>logger.log(Level.FINE, "No SAS context element found in service context list for operation: " + serverRequestInfo.operation());<NEW_LINE>}<NEW_LINE>ServiceContext serviceContext = null;<NEW_LINE>int secStatus = secContextUtil.setSecurityContext(null, serverRequestInfo.object_id(), serverRequestInfo.operation(), getServerSocket());<NEW_LINE>if (secStatus == STATUS_FAILED) {<NEW_LINE>SASContextBody sasctxbody = createContextError(INVALID_MECHANISM_MAJOR, INVALID_MECHANISM_MINOR);<NEW_LINE>serviceContext = createSvcContext(sasctxbody, orb);<NEW_LINE>serverRequestInfo.add_reply_service_context(serviceContext, NO_REPLACE);<NEW_LINE>if (logger.isLoggable(Level.FINE)) {<NEW_LINE>logger.<MASK><NEW_LINE>}<NEW_LINE>throw new NO_PERMISSION();<NEW_LINE>}<NEW_LINE>} | log(Level.FINE, "SecServerRequestInterceptor.receive_request: NO_PERMISSION"); |
624,826 | final CreateReplicationInstanceResult executeCreateReplicationInstance(CreateReplicationInstanceRequest createReplicationInstanceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createReplicationInstanceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateReplicationInstanceRequest> request = null;<NEW_LINE>Response<CreateReplicationInstanceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateReplicationInstanceRequestProtocolMarshaller(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, "Database Migration Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateReplicationInstance");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateReplicationInstanceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateReplicationInstanceResultJsonUnmarshaller());<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(createReplicationInstanceRequest)); |
1,528,112 | public static void main(String[] args) {<NEW_LINE>Exercise24_NonOverlappingIntervalSearch nonOverlappingIntervalSearch = new Exercise24_NonOverlappingIntervalSearch();<NEW_LINE>Interval interval1 = nonOverlappingIntervalSearch.new Interval(1, 1643, 2033);<NEW_LINE>Interval interval2 = nonOverlappingIntervalSearch.new Interval(2, 5532, 7643);<NEW_LINE>Interval interval3 = nonOverlappingIntervalSearch.new Interval(3, 8999, 10332);<NEW_LINE>Interval interval4 = nonOverlappingIntervalSearch.new Interval(4, 5666653, 5669321);<NEW_LINE>List<Interval> intervals = new ArrayList<>();<NEW_LINE>intervals.add(interval1);<NEW_LINE>intervals.add(interval2);<NEW_LINE>intervals.add(interval3);<NEW_LINE>intervals.add(interval4);<NEW_LINE>NonOverlappingIntervalFinder nonOverlappingIntervalFinder = nonOverlappingIntervalSearch.new NonOverlappingIntervalFinder(intervals);<NEW_LINE>StdOut.println("Find 9122: " + nonOverlappingIntervalFinder<MASK><NEW_LINE>StdOut.println("Find 8122: " + nonOverlappingIntervalFinder.findInterval(8122) + " Expected: -1");<NEW_LINE>StdOut.println("Find -100: " + nonOverlappingIntervalFinder.findInterval(-100) + " Expected: -1");<NEW_LINE>StdOut.println("Find 5531: " + nonOverlappingIntervalFinder.findInterval(5531) + " Expected: -1");<NEW_LINE>StdOut.println("Find 5532: " + nonOverlappingIntervalFinder.findInterval(5532) + " Expected: 2");<NEW_LINE>StdOut.println("Find 5669321: " + nonOverlappingIntervalFinder.findInterval(5669321) + " Expected: 4");<NEW_LINE>StdOut.println("Find 5669322: " + nonOverlappingIntervalFinder.findInterval(5669322) + " Expected: -1");<NEW_LINE>} | .findInterval(9122) + " Expected: 3"); |
835,082 | protected void handleTextFont(PFont which, float size) {<NEW_LINE>textFont = which;<NEW_LINE>String fontName = which.getName();<NEW_LINE>String fontPsName = which.getPostScriptName();<NEW_LINE>textFontInfo = fontCache.get(fontName, size);<NEW_LINE>if (textFontInfo == null) {<NEW_LINE>Font font = null;<NEW_LINE>if (which.isStream()) {<NEW_LINE>// Load from ttf or otf file<NEW_LINE>String filename = fontCache.nameToFilename.get(fontName);<NEW_LINE>font = Font.loadFont(parent.createInput(filename), size);<NEW_LINE>}<NEW_LINE>if (font == null) {<NEW_LINE>// Look up font name<NEW_LINE>font = new Font(fontName, size);<NEW_LINE>if (!fontName.equalsIgnoreCase(font.getName())) {<NEW_LINE>// Look up font postscript name<NEW_LINE>font = new Font(fontPsName, size);<NEW_LINE>if (!fontPsName.equalsIgnoreCase(font.getName())) {<NEW_LINE>// Done with it<NEW_LINE>font = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (font == null && which.getNative() != null) {<NEW_LINE>// Ain't got nothing, but AWT has something, so glyph images are not<NEW_LINE>// going to be used for this font; go with the default font then<NEW_LINE>font = new Font(size);<NEW_LINE>}<NEW_LINE>textFontInfo = fontCache.createFontInfo(font);<NEW_LINE>fontCache.<MASK><NEW_LINE>}<NEW_LINE>context.setFont(textFontInfo.font);<NEW_LINE>} | put(fontName, size, textFontInfo); |
1,587,085 | private void checkReviewApprovers(GitHubApi api, String project, PullRequest prData, ImmutableListMultimap.Builder<String, String> labelsBuilder) throws ValidationException, RepoException {<NEW_LINE>if (reviewState == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ImmutableList<Review> reviews = api.getReviews(<MASK><NEW_LINE>ApproverState approverState = reviewState.shouldMigrate(reviews, reviewApprovers, prData.getHead().getSha());<NEW_LINE>if (!forceImport() && !approverState.shouldMigrate()) {<NEW_LINE>String rejected = "";<NEW_LINE>if (!approverState.rejectedReviews().isEmpty()) {<NEW_LINE>rejected = String.format("\nThe following reviews were ignored because they don't meet " + "the association requirement of %s:\n%s", Joiner.on(", ").join(reviewApprovers), approverState.rejectedReviews().entries().stream().map(e -> String.format("User %s - Association: %s", e.getKey(), e.getValue())).collect(joining("\n")));<NEW_LINE>}<NEW_LINE>throw new EmptyChangeException(String.format("Cannot migrate http://github.com/%s/pull/%d because it is missing the required" + " approvals (origin is configured as %s).%s", project, prData.getNumber(), reviewState, rejected));<NEW_LINE>}<NEW_LINE>Set<String> approvers = new HashSet<>();<NEW_LINE>Set<String> others = new HashSet<>();<NEW_LINE>for (Review review : reviews) {<NEW_LINE>if (reviewApprovers.contains(review.getAuthorAssociation())) {<NEW_LINE>approvers.add(review.getUser().getLogin());<NEW_LINE>} else {<NEW_LINE>others.add(review.getUser().getLogin());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>labelsBuilder.putAll(GITHUB_PR_REVIEWER_APPROVER, approvers);<NEW_LINE>labelsBuilder.putAll(GITHUB_PR_REVIEWER_OTHER, others);<NEW_LINE>} | project, prData.getNumber()); |
1,156,189 | private boolean refillBufferIfNeeded() throws IOException {<NEW_LINE>if (buffer.readableBytes() == 0) {<NEW_LINE>if (cursor >= objectLen) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>long startRange = cursor;<NEW_LINE>long endRange = Math.min(cursor + bufferSize - 1, objectLen - 1);<NEW_LINE>try {<NEW_LINE>Blob blob = blobStore.getBlob(bucket, key, new GetOptions().range(startRange, endRange));<NEW_LINE>versionCheck.check(key, blob);<NEW_LINE>try (InputStream stream = blob.getPayload().openStream()) {<NEW_LINE>buffer.clear();<NEW_LINE>bufferOffsetStart = startRange;<NEW_LINE>bufferOffsetEnd = endRange;<NEW_LINE><MASK><NEW_LINE>int bytesToCopy = (int) bytesRead;<NEW_LINE>while (bytesToCopy > 0) {<NEW_LINE>bytesToCopy -= buffer.writeBytes(stream, bytesToCopy);<NEW_LINE>}<NEW_LINE>cursor += buffer.readableBytes();<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>throw new IOException("Error reading from BlobStore", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | long bytesRead = endRange - startRange + 1; |
1,806,161 | private void logCommandUsageNoHeader(BaseCommand theCommand) {<NEW_LINE>// This is passed in from the launch script<NEW_LINE>String columnsString = System.getProperty("columns");<NEW_LINE>int columns;<NEW_LINE>try {<NEW_LINE>columns = Integer.parseInt(columnsString);<NEW_LINE>columns = Math.max(columns, 40);<NEW_LINE>columns = Math.min(columns, 180);<NEW_LINE>} catch (Exception e) {<NEW_LINE>columns = 80;<NEW_LINE>}<NEW_LINE>// Usage<NEW_LINE>printMessageToStdout("Usage:");<NEW_LINE>printMessageToStdout(" " + provideCommandName() + " " + theCommand.getCommandName() + " [options]");<NEW_LINE>printMessageToStdout("");<NEW_LINE>// Description<NEW_LINE>String wrapped = WordUtils.wrap(theCommand.getCommandDescription(), columns);<NEW_LINE>printMessageToStdout(wrapped);<NEW_LINE>printMessageToStdout("");<NEW_LINE>// Usage Notes<NEW_LINE>List<String> usageNotes = theCommand.provideUsageNotes();<NEW_LINE>for (String next : usageNotes) {<NEW_LINE>wrapped = <MASK><NEW_LINE>printMessageToStdout(wrapped);<NEW_LINE>printMessageToStdout("");<NEW_LINE>}<NEW_LINE>// Options<NEW_LINE>printMessageToStdout("Options:");<NEW_LINE>HelpFormatter fmt = new HelpFormatter();<NEW_LINE>PrintWriter pw = new PrintWriter(System.out);<NEW_LINE>fmt.printOptions(pw, columns, getOptions(theCommand), 2, 2);<NEW_LINE>pw.flush();<NEW_LINE>// That's it!<NEW_LINE>printMessageToStdout("");<NEW_LINE>} | WordUtils.wrap(next, columns); |
1,141,224 | public void onPlayerLevelUp(McMMOPlayerLevelUpEvent event) {<NEW_LINE><MASK><NEW_LINE>PrimarySkillType skill = event.getSkill();<NEW_LINE>McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);<NEW_LINE>// TODO: Handle proper validation at the event level<NEW_LINE>if (mcMMOPlayer == null || !mcMMOPlayer.getProfile().isLoaded())<NEW_LINE>return;<NEW_LINE>if (player.isOnline()) {<NEW_LINE>// Players can gain multiple levels especially during xprate events<NEW_LINE>for (int i = 0; i < event.getLevelsGained(); i++) {<NEW_LINE>int previousLevelGained = event.getSkillLevel() - i;<NEW_LINE>// Send player skill unlock notifications<NEW_LINE>UserManager.getPlayer(player).processUnlockNotifications(plugin, event.getSkill(), previousLevelGained);<NEW_LINE>}<NEW_LINE>// Reset the delay timer<NEW_LINE>RankUtils.resetUnlockDelayTimer();<NEW_LINE>if (mcMMO.p.getGeneralConfig().getScoreboardsEnabled())<NEW_LINE>ScoreboardManager.handleLevelUp(player, skill);<NEW_LINE>}<NEW_LINE>} | Player player = event.getPlayer(); |
115,601 | public <T extends Ruleset> List<T> findAll(Class<T> rulesetType, RulesetQuery query) {<NEW_LINE>return persistenceService.doReturningTransaction(em -> {<NEW_LINE><MASK><NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>List<ParameterBinder> binders = new ArrayList<>();<NEW_LINE>appendSelectString(sb, rulesetType, query);<NEW_LINE>appendFromString(sb, rulesetType, query);<NEW_LINE>appendWhereString(sb, rulesetType, query, binders);<NEW_LINE>appendOrder(sb, query);<NEW_LINE>appendLimit(sb, query);<NEW_LINE>String sqlQuery = sb.toString();<NEW_LINE>return em.unwrap(Session.class).doReturningWork(new AbstractReturningWork<List<T>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public List<T> execute(Connection connection) throws SQLException {<NEW_LINE>LOG.finer("Executing: " + sqlQuery);<NEW_LINE>try (PreparedStatement st = connection.prepareStatement(sqlQuery)) {<NEW_LINE>binders.forEach(parameterBinder -> parameterBinder.accept(st));<NEW_LINE>try (ResultSet rs = st.executeQuery()) {<NEW_LINE>List<T> result = new ArrayList<>();<NEW_LINE>while (rs.next()) {<NEW_LINE>result.add(mapResultTuple(rulesetType, query, rs));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>} | LOG.finer("Building: " + query); |
1,740,049 | private Set<ClassInfoType> processJarFormatInputStreamURL(URL jarURL) throws ClassScannerException {<NEW_LINE>final HashSet<ClassInfoType> citSet = new HashSet<ClassInfoType>();<NEW_LINE>try (JarInputStream jis = new JarInputStream(jarURL.openStream(), false)) {<NEW_LINE>JarEntry jarEntry = null;<NEW_LINE>while ((jarEntry = jis.getNextJarEntry()) != null) {<NEW_LINE>String name = jarEntry.getName();<NEW_LINE>if (name != null && name.endsWith(".class")) {<NEW_LINE>name = name.substring(0, name.length() - 6<MASK><NEW_LINE>citSet.add(scanByteCodeFromInputStream(name, jis));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>FFDCFilter.processException(t, EntityMappingsScanner.class.getName() + ".processJarFormatInputStreamURL", "311");<NEW_LINE>throw new ClassScannerException(t);<NEW_LINE>}<NEW_LINE>return citSet;<NEW_LINE>} | ).replace("/", "."); |
13,320 | public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>env.compileDeploy("@public create " + typeType + " schema EventOne(sbarr SupportBean_S0[])", path);<NEW_LINE>env.compileDeploy("@name('s0') @public insert into EventOne select " + "(select * from SupportBean_S0#keepall " + (filter ? "where 1=1" : "") + ") as sbarr " + "from SupportBean", path).addListener("s0");<NEW_LINE>env.compileDeploy("@name('s1') select * from EventOne#keepall", path);<NEW_LINE>SupportBean_S0 s0One = new SupportBean_S0(1, "x1");<NEW_LINE>env.sendEventBean(s0One);<NEW_LINE>env.sendEventBean(new SupportBean("E1", 1));<NEW_LINE>env.assertEventNew("s0", event <MASK><NEW_LINE>env.milestone(0);<NEW_LINE>SupportBean_S0 s0Two = new SupportBean_S0(2, "x2", "y2");<NEW_LINE>env.sendEventBean(s0Two);<NEW_LINE>env.sendEventBean(new SupportBean("E2", 2));<NEW_LINE>env.assertEventNew("s0", event -> assertS0(event, s0One, s0Two));<NEW_LINE>env.assertPropsPerRowIterator("s1", "sbarr[0].id,sbarr[1].id".split(","), new Object[][] { { 1, null }, { 1, 2 } });<NEW_LINE>env.undeployAll();<NEW_LINE>} | -> assertS0(event, s0One)); |
1,471,003 | private String addLineToPreviousSpace(Fonts.TextMeasurer m, String paragraph, Fonts.Style style, int guess, Size size, boolean first) {<NEW_LINE>do {<NEW_LINE>int next = guess - 1;<NEW_LINE>while (next > 0 && !whitespace().matches(paragraph.charAt(next))) {<NEW_LINE>next--;<NEW_LINE>}<NEW_LINE>if (next == 0) {<NEW_LINE>// We have a single word longer than our max width. Blow our limit.<NEW_LINE>addLine(paragraph.substring(0, guess<MASK><NEW_LINE>return paragraph.substring(guess).trim();<NEW_LINE>}<NEW_LINE>guess = next;<NEW_LINE>size = m.measure(style, paragraph.substring(0, next));<NEW_LINE>if (size.w <= MAX_WIDTH) {<NEW_LINE>addLine(paragraph.substring(0, guess), style, size, first);<NEW_LINE>return paragraph.substring(guess).trim();<NEW_LINE>}<NEW_LINE>} while (true);<NEW_LINE>} | ), style, size, first); |
1,404,164 | final TestWirelessDeviceResult executeTestWirelessDevice(TestWirelessDeviceRequest testWirelessDeviceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(testWirelessDeviceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TestWirelessDeviceRequest> request = null;<NEW_LINE>Response<TestWirelessDeviceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TestWirelessDeviceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(testWirelessDeviceRequest));<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, "IoT Wireless");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TestWirelessDeviceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TestWirelessDeviceResultJsonUnmarshaller());<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>} | addHandlerContext(HandlerContextKey.OPERATION_NAME, "TestWirelessDevice"); |
1,246,332 | final CreateConnectAttachmentResult executeCreateConnectAttachment(CreateConnectAttachmentRequest createConnectAttachmentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createConnectAttachmentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateConnectAttachmentRequest> request = null;<NEW_LINE>Response<CreateConnectAttachmentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateConnectAttachmentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createConnectAttachmentRequest));<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, "NetworkManager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateConnectAttachment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateConnectAttachmentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateConnectAttachmentResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
184,656 | public Integer save(ConsumptionInfo info, String operator) {<NEW_LINE>log.debug("begin to save consumption info={}", info);<NEW_LINE>Preconditions.checkNotNull(info, "consumption info cannot be null");<NEW_LINE>Preconditions.checkNotNull(<MASK><NEW_LINE>if (isConsumerGroupExists(info.getConsumerGroup(), info.getId())) {<NEW_LINE>throw new BusinessException(String.format("consumer group %s already exist", info.getConsumerGroup()));<NEW_LINE>}<NEW_LINE>if (info.getId() != null) {<NEW_LINE>ConsumptionEntity consumptionEntity = consumptionMapper.selectByPrimaryKey(info.getId());<NEW_LINE>Preconditions.checkNotNull(consumptionEntity, "consumption not exist with id: " + info.getId());<NEW_LINE>ConsumptionStatus consumptionStatus = ConsumptionStatus.fromStatus(consumptionEntity.getStatus());<NEW_LINE>Preconditions.checkTrue(ConsumptionStatus.ALLOW_SAVE_UPDATE_STATUS.contains(consumptionStatus), "consumption not allow update when status is " + consumptionStatus.name());<NEW_LINE>}<NEW_LINE>setTopicInfo(info);<NEW_LINE>ConsumptionEntity entity = this.saveConsumption(info, operator);<NEW_LINE>String mqType = entity.getMqType();<NEW_LINE>if (MQType.PULSAR.equals(mqType) || MQType.TDMQ_PULSAR.equals(mqType)) {<NEW_LINE>savePulsarInfo(info.getMqExtInfo(), entity);<NEW_LINE>}<NEW_LINE>log.info("success to save consumption info by user={}", operator);<NEW_LINE>return entity.getId();<NEW_LINE>} | info.getTopic(), "consumption topic cannot be empty"); |
1,548,265 | public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {<NEW_LINE>Register result = asRegister(resultValue);<NEW_LINE>Label done = new Label();<NEW_LINE>Register arrayA = asRegister(arrayAValue);<NEW_LINE>Register arrayB = asRegister(arrayBValue);<NEW_LINE>// add byte offset to array pointers<NEW_LINE>masm.leaq(arrayA, new AMD64Address(arrayA, asRegister(offsetAValue), Scale.Times1));<NEW_LINE>masm.leaq(arrayB, new AMD64Address(arrayB, asRegister(offsetBValue), Scale.Times1));<NEW_LINE>// load region length in to registers "length" and "result"<NEW_LINE>Register length = asRegister(lengthValue);<NEW_LINE>masm.movl(result, length);<NEW_LINE>emitArrayCompare(crb, masm, result, arrayA, arrayB, length<MASK><NEW_LINE>// return<NEW_LINE>masm.bind(done);<NEW_LINE>} | , asRegister(offsetAValue), done); |
635,298 | public static ListNodeGroupTransferPacketsResponse unmarshall(ListNodeGroupTransferPacketsResponse listNodeGroupTransferPacketsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listNodeGroupTransferPacketsResponse.setRequestId(_ctx.stringValue("ListNodeGroupTransferPacketsResponse.RequestId"));<NEW_LINE>listNodeGroupTransferPacketsResponse.setSuccess(_ctx.booleanValue("ListNodeGroupTransferPacketsResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotalCount(_ctx.longValue("ListNodeGroupTransferPacketsResponse.Data.TotalCount"));<NEW_LINE>List<Packet> list = new ArrayList<Packet>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListNodeGroupTransferPacketsResponse.Data.List.Length"); i++) {<NEW_LINE>Packet packet = new Packet();<NEW_LINE>packet.setGwEui(_ctx.stringValue("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].GwEui"));<NEW_LINE>packet.setDevEui(_ctx.stringValue("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].DevEui"));<NEW_LINE>packet.setDevAddr(_ctx.stringValue("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].DevAddr"));<NEW_LINE>packet.setFreq(_ctx.floatValue("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].Freq"));<NEW_LINE>packet.setDatr(_ctx.stringValue("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].Datr"));<NEW_LINE>packet.setClassMode(_ctx.stringValue("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].ClassMode"));<NEW_LINE>packet.setRssi(_ctx.integerValue("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].Rssi"));<NEW_LINE>packet.setLsnr(_ctx.floatValue("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].Lsnr"));<NEW_LINE>packet.setFPort(_ctx.integerValue("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].FPort"));<NEW_LINE>packet.setGwOwnerAliyunId(_ctx.stringValue<MASK><NEW_LINE>packet.setFreqBandPlanGroupId(_ctx.longValue("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].FreqBandPlanGroupId"));<NEW_LINE>packet.setLogMillis(_ctx.longValue("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].LogMillis"));<NEW_LINE>packet.setHasMacCommand(_ctx.booleanValue("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].HasMacCommand"));<NEW_LINE>packet.setHasData(_ctx.booleanValue("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].HasData"));<NEW_LINE>packet.setBase64EncodedMacPayload(_ctx.stringValue("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].Base64EncodedMacPayload"));<NEW_LINE>packet.setMacPayloadSize(_ctx.longValue("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].MacPayloadSize"));<NEW_LINE>packet.setProcessEvent(_ctx.stringValue("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].ProcessEvent"));<NEW_LINE>packet.setMessageType(_ctx.stringValue("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].MessageType"));<NEW_LINE>packet.setMacCommandCIDs(_ctx.stringValue("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].MacCommandCIDs"));<NEW_LINE>packet.setFcntUp(_ctx.longValue("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].FcntUp"));<NEW_LINE>packet.setFcntDown(_ctx.longValue("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].FcntDown"));<NEW_LINE>list.add(packet);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>listNodeGroupTransferPacketsResponse.setData(data);<NEW_LINE>return listNodeGroupTransferPacketsResponse;<NEW_LINE>} | ("ListNodeGroupTransferPacketsResponse.Data.List[" + i + "].GwOwnerAliyunId")); |
1,488,134 | /* (non-Javadoc)<NEW_LINE>* @see org.mitre.openid.connect.service.MITREidDataServiceExtension#fixExtensionObjectReferences()<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void fixExtensionObjectReferences(MITREidDataServiceMaps maps) {<NEW_LINE>for (Long permissionId : permissionToResourceRefs.keySet()) {<NEW_LINE>Long oldResourceId = permissionToResourceRefs.get(permissionId);<NEW_LINE>Long <MASK><NEW_LINE>Permission p = permissionRepository.getById(permissionId);<NEW_LINE>ResourceSet rs = resourceSetRepository.getById(newResourceId);<NEW_LINE>p.setResourceSet(rs);<NEW_LINE>permissionRepository.saveRawPermission(p);<NEW_LINE>logger.debug("Mapping rsid " + oldResourceId + " to " + newResourceId + " for permission " + permissionId);<NEW_LINE>}<NEW_LINE>for (Long tokenId : tokenToPermissionRefs.keySet()) {<NEW_LINE>Long newTokenId = maps.getAccessTokenOldToNewIdMap().get(tokenId);<NEW_LINE>OAuth2AccessTokenEntity token = tokenRepository.getAccessTokenById(newTokenId);<NEW_LINE>Set<Permission> permissions = new HashSet<>();<NEW_LINE>for (Long permissionId : tokenToPermissionRefs.get(tokenId)) {<NEW_LINE>Permission p = permissionRepository.getById(permissionId);<NEW_LINE>permissions.add(p);<NEW_LINE>}<NEW_LINE>token.setPermissions(permissions);<NEW_LINE>tokenRepository.saveAccessToken(token);<NEW_LINE>}<NEW_LINE>permissionToResourceRefs.clear();<NEW_LINE>resourceSetOldToNewIdMap.clear();<NEW_LINE>tokenToPermissionRefs.clear();<NEW_LINE>} | newResourceId = resourceSetOldToNewIdMap.get(oldResourceId); |
1,076,997 | public static void registerType(final ModelBuilder modelBuilder) {<NEW_LINE>final ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(ResourceRole.class, BPMN_ELEMENT_RESOURCE_ROLE).namespaceUri(BPMN20_NS).extendsType(BaseElement.class).instanceProvider(new ModelTypeInstanceProvider<ResourceRole>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ResourceRole newInstance(final ModelTypeInstanceContext instanceContext) {<NEW_LINE>return new ResourceRoleImpl(instanceContext);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>nameAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_NAME).build();<NEW_LINE>final SequenceBuilder sequenceBuilder = typeBuilder.sequence();<NEW_LINE>resourceRefChild = sequenceBuilder.element(ResourceRef.class).qNameElementReference(Resource.class).build();<NEW_LINE>resourceParameterBindingCollection = sequenceBuilder.elementCollection(<MASK><NEW_LINE>resourceAssignmentExpressionChild = sequenceBuilder.element(ResourceAssignmentExpression.class).build();<NEW_LINE>typeBuilder.build();<NEW_LINE>} | ResourceParameterBinding.class).build(); |
1,075,735 | private void recycle(List<Node> nodes) {<NEW_LINE>List<Node> nodesToRecycle = new ArrayList<>();<NEW_LINE>for (Node candidate : nodes) {<NEW_LINE>if (broken(candidate)) {<NEW_LINE>List<String> unparkedChildren = !candidate.type().isHost() ? List.of() : nodeRepository.nodes().list().childrenOf(candidate).not().state(Node.State.parked).mapToList(Node::hostname);<NEW_LINE>if (unparkedChildren.isEmpty()) {<NEW_LINE>nodeRepository.nodes().park(candidate.hostname(), false, Agent.FailedExpirer, "Parked by FailedExpirer due to hardware issue or high fail count");<NEW_LINE>} else {<NEW_LINE>log.info(String.format("Expired failed node %s with hardware issue was not parked because of " + "unparked children: %s", candidate.hostname(), String.<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>nodesToRecycle.add(candidate);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>nodeRepository.nodes().deallocate(nodesToRecycle, Agent.FailedExpirer, "Expired by FailedExpirer");<NEW_LINE>} | join(", ", unparkedChildren))); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.