idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
41,639
public OrganizationNode unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>OrganizationNode organizationNode = new OrganizationNode();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Type", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>organizationNode.setType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Value", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>organizationNode.setValue(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 organizationNode;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
263,188
// DO NOT MODIFY THIS CODE, GENERATED AUTOMATICALLY<NEW_LINE>public static java.util.List<com.sun.jdi.ReferenceType> allClasses0(com.sun.jdi.VirtualMachine a) {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallStart("com.sun.jdi.VirtualMachine", "allClasses", "JDI CALL: com.sun.jdi.VirtualMachine({0}).allClasses()", <MASK><NEW_LINE>}<NEW_LINE>Object retValue = null;<NEW_LINE>try {<NEW_LINE>java.util.List<com.sun.jdi.ReferenceType> ret;<NEW_LINE>ret = a.allClasses();<NEW_LINE>retValue = ret;<NEW_LINE>return ret;<NEW_LINE>} catch (com.sun.jdi.InternalException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.report(ex);<NEW_LINE>return java.util.Collections.emptyList();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>if (a instanceof com.sun.jdi.Mirror) {<NEW_LINE>com.sun.jdi.VirtualMachine vm = ((com.sun.jdi.Mirror) a).virtualMachine();<NEW_LINE>try {<NEW_LINE>vm.dispose();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException vmdex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return java.util.Collections.emptyList();<NEW_LINE>} catch (Error err) {<NEW_LINE>retValue = err;<NEW_LINE>throw err;<NEW_LINE>} catch (RuntimeException rex) {<NEW_LINE>retValue = rex;<NEW_LINE>throw rex;<NEW_LINE>} finally {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallEnd("com.sun.jdi.VirtualMachine", "allClasses", retValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
new Object[] { a });
1,581,786
// suppress deprecation until https://github.com/checkstyle/checkstyle/issues/11166<NEW_LINE>@SuppressWarnings("deprecation")<NEW_LINE>@Override<NEW_LINE>public void visitToken(DetailAST ast) {<NEW_LINE>if (shouldCheck(ast)) {<NEW_LINE>final FileContents contents = getFileContents();<NEW_LINE>final int lineNo = ast.getLineNo();<NEW_LINE>final TextBlock textBlock = contents.getJavadocBefore(lineNo);<NEW_LINE>if (textBlock != null) {<NEW_LINE>final List<JavadocTag> tags = getJavadocTags(textBlock);<NEW_LINE>if (ScopeUtil.isOuterMostType(ast)) {<NEW_LINE>// don't check author/version for inner classes<NEW_LINE>checkTag(ast, tags, JavadocTagInfo.AUTHOR.getName(), authorFormat);<NEW_LINE>checkTag(ast, tags, JavadocTagInfo.VERSION.getName(), versionFormat);<NEW_LINE>}<NEW_LINE>final List<String> typeParamNames = CheckUtil.getTypeParameterNames(ast);<NEW_LINE>final List<<MASK><NEW_LINE>if (!allowMissingParamTags) {<NEW_LINE>typeParamNames.forEach(typeParamName -> {<NEW_LINE>checkTypeParamTag(ast, tags, typeParamName);<NEW_LINE>});<NEW_LINE>recordComponentNames.forEach(componentName -> {<NEW_LINE>checkComponentParamTag(ast, tags, componentName);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>checkUnusedParamTags(tags, typeParamNames, recordComponentNames);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String> recordComponentNames = getRecordComponentNames(ast);
1,732,639
private void remove(MethodCall call, MethodChannel.Result result) {<NEW_LINE>String taskId = call.argument("task_id");<NEW_LINE>boolean shouldDeleteContent = call.argument("should_delete_content");<NEW_LINE>DownloadTask task = taskDao.loadTask(taskId);<NEW_LINE>if (task != null) {<NEW_LINE>if (task.status == DownloadStatus.ENQUEUED || task.status == DownloadStatus.RUNNING) {<NEW_LINE>WorkManager.getInstance(context).cancelWorkById(UUID.fromString(taskId));<NEW_LINE>}<NEW_LINE>if (shouldDeleteContent) {<NEW_LINE>String filename = task.filename;<NEW_LINE>if (filename == null) {<NEW_LINE>filename = task.url.substring(task.url.lastIndexOf("/") + 1, task.url.length());<NEW_LINE>}<NEW_LINE>String saveFilePath = task.savedDir + File.separator + filename;<NEW_LINE>File tempFile = new File(saveFilePath);<NEW_LINE>if (tempFile.exists()) {<NEW_LINE>deleteFileInMediaStore(tempFile);<NEW_LINE>tempFile.delete();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>taskDao.deleteTask(taskId);<NEW_LINE>NotificationManagerCompat.from(context).cancel(task.primaryId);<NEW_LINE>result.success(null);<NEW_LINE>} else {<NEW_LINE>result.<MASK><NEW_LINE>}<NEW_LINE>}
error("invalid_task_id", "not found task corresponding to given task id", null);
1,433,056
public static void main(String[] args) throws InterruptedException {<NEW_LINE>// Creating Siddhi Manager<NEW_LINE>SiddhiManager siddhiManager = new SiddhiManager();<NEW_LINE>// Register the extension to Siddhi Manager<NEW_LINE>siddhiManager.setExtension("custom:plus", CustomFunctionExtension.class);<NEW_LINE>// Siddhi Application<NEW_LINE>String siddhiApp = "" + "define stream StockStream (symbol string, price long, volume long);" + "" + "@info(name = 'query1') " + "from StockStream " + "select symbol , custom:plus(price, volume) as totalCount " + "insert into Output;";<NEW_LINE>// Generating runtime<NEW_LINE>SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(siddhiApp);<NEW_LINE>// Adding callback to retrieve output events from query<NEW_LINE>siddhiAppRuntime.addCallback("query1", new QueryCallback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void receive(long timestamp, Event[] inEvents, Event[] removeEvents) {<NEW_LINE>EventPrinter.print(timestamp, inEvents, removeEvents);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Retrieving InputHandler to push events into Siddhi<NEW_LINE>InputHandler inputHandler = siddhiAppRuntime.getInputHandler("StockStream");<NEW_LINE>// Starting event processing<NEW_LINE>siddhiAppRuntime.start();<NEW_LINE>// Sending events to Siddhi<NEW_LINE>inputHandler.send(new Object[] <MASK><NEW_LINE>inputHandler.send(new Object[] { "WSO2", 600L, 200L });<NEW_LINE>inputHandler.send(new Object[] { "GOOG", 60L, 200L });<NEW_LINE>Thread.sleep(500);<NEW_LINE>// Shutting down the runtime<NEW_LINE>siddhiAppRuntime.shutdown();<NEW_LINE>// Shutting down Siddhi<NEW_LINE>siddhiManager.shutdown();<NEW_LINE>}
{ "IBM", 700L, 100L });
39,011
public SubjectAreaOMASAPIResponse<Category> updateCategory(String serverName, String userId, String guid, Category category, boolean isReplace) {<NEW_LINE>final String methodName = "updateCategory";<NEW_LINE>RESTCallToken token = restCallLogger.logRESTCall(serverName, userId, methodName);<NEW_LINE>SubjectAreaOMASAPIResponse<Category> <MASK><NEW_LINE>AuditLog auditLog = null;<NEW_LINE>// should not be called without a supplied category - the calling layer should not allow this.<NEW_LINE>try {<NEW_LINE>auditLog = instanceHandler.getAuditLog(userId, serverName, methodName);<NEW_LINE>SubjectAreaNodeClients clients = instanceHandler.getSubjectAreaNodeClients(serverName, userId, methodName);<NEW_LINE>Category updatedCategory;<NEW_LINE>if (isReplace) {<NEW_LINE>updatedCategory = clients.categories().replace(userId, guid, category);<NEW_LINE>} else {<NEW_LINE>updatedCategory = clients.categories().update(userId, guid, category);<NEW_LINE>}<NEW_LINE>response.addResult(updatedCategory);<NEW_LINE>} catch (Exception exception) {<NEW_LINE>response = getResponseForException(exception, auditLog, className, methodName);<NEW_LINE>}<NEW_LINE>restCallLogger.logRESTCallReturn(token, response.toString());<NEW_LINE>return response;<NEW_LINE>}
response = new SubjectAreaOMASAPIResponse<>();
53,038
private void createGui() {<NEW_LINE>final JPanel topPanel = new JPanel(new BorderLayout());<NEW_LINE>final JPanel innerTopPanel = new JPanel(new BorderLayout());<NEW_LINE>topPanel.add(innerTopPanel);<NEW_LINE>innerTopPanel.add(m_stdEditPanel);<NEW_LINE>innerTopPanel.add(m_debuggerPanel, BorderLayout.SOUTH);<NEW_LINE>final JPanel buttonPanel = new JPanel(new GridLayout(1, 2));<NEW_LINE>buttonPanel.setBorder(new EmptyBorder(0, 0, 5, 2));<NEW_LINE>buttonPanel.add(new JPanel());<NEW_LINE>buttonPanel.add(m_saveButton);<NEW_LINE>topPanel.add(buttonPanel, BorderLayout.SOUTH);<NEW_LINE>final JPanel innerSp = new JPanel(new BorderLayout());<NEW_LINE>m_middlePanel.setPreferredSize(new Dimension(m_middlePanel.getPreferredSize().width, 75));<NEW_LINE>innerSp.add(m_middlePanel, BorderLayout.NORTH);<NEW_LINE>innerSp.add(m_bottomPanel, BorderLayout.CENTER);<NEW_LINE>final JSplitPane outerSp = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, topPanel, innerSp);<NEW_LINE>outerSp.setOneTouchExpandable(true);<NEW_LINE>outerSp.setDividerLocation(outerSp.getMinimumDividerLocation());<NEW_LINE>outerSp.setResizeWeight(0.5);<NEW_LINE>final JPanel innerPanel = <MASK><NEW_LINE>innerPanel.add(outerSp);<NEW_LINE>add(innerPanel);<NEW_LINE>}
new JPanel(new BorderLayout());
340,806
private Map<String, String> fetchColumnType(Connection conn, String actualTableName) {<NEW_LINE>Map<String, String> specialType = new TreeMap(String.CASE_INSENSITIVE_ORDER);<NEW_LINE>Statement stmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>stmt = conn.createStatement();<NEW_LINE>rs = stmt.executeQuery("desc `" + actualTableName + "`");<NEW_LINE>while (rs.next()) {<NEW_LINE>String field = rs.getString("Field");<NEW_LINE>String type = rs.getString("Type");<NEW_LINE>if (TStringUtil.startsWithIgnoreCase(type, "enum(")) {<NEW_LINE>specialType.put(field, type);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Throwables.propagate(e);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (rs != null) {<NEW_LINE>rs.close();<NEW_LINE>}<NEW_LINE>if (stmt != null) {<NEW_LINE>stmt.close();<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return specialType;<NEW_LINE>}
logger.warn("", e);
15,743
public void visitPhpFunctionCall(@NotNull FunctionReference reference) {<NEW_LINE>final String functionName = reference.getName();<NEW_LINE>if (functionName != null && functionName.equals("date")) {<NEW_LINE>final PsiElement[] arguments = reference.getParameters();<NEW_LINE>if (arguments.length == 2) {<NEW_LINE>final PsiElement candidate = arguments[1];<NEW_LINE>if (OpenapiTypesUtil.isFunctionReference(candidate)) {<NEW_LINE>final FunctionReference inner = (FunctionReference) candidate;<NEW_LINE>final <MASK><NEW_LINE>if (innerName != null && innerName.equals("time") && inner.getParameters().length == 0) {<NEW_LINE>holder.registerProblem(inner, MessagesPresentationUtil.prefixWithEa(messageDropTime), ProblemHighlightType.LIKE_UNUSED_SYMBOL, new DropTimeFunctionCallLocalFix(holder.getProject(), arguments[0], arguments[1]));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
String innerName = inner.getName();
978,696
// isAmbiguous = should we get AmbiguousEJBReferenceException or just the first bean<NEW_LINE>private void lookupRemote(String lookup, boolean isAmbiguous) throws Exception {<NEW_LINE>try {<NEW_LINE>AmbiguousNameRemoteHome beanHome = (AmbiguousNameRemoteHome) new InitialContext().lookup(lookup);<NEW_LINE>if (isAmbiguous) {<NEW_LINE>fail("lookup of " + lookup + " should have been ambiguous");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>assertTrue("Lookup provided the wrong bean", bean.foo().equals("AmbiguousNameBean.toString()"));<NEW_LINE>} catch (NamingException nex) {<NEW_LINE>if (isAmbiguous) {<NEW_LINE>Throwable cause = nex.getCause();<NEW_LINE>if (cause instanceof AmbiguousEJBReferenceException) {<NEW_LINE>svLogger.info("lookup of " + lookup + " failed as expected : " + cause.getClass().getName() + " : " + cause.getMessage());<NEW_LINE>} else {<NEW_LINE>svLogger.info(nex.getClass().getName() + " : " + nex.getMessage());<NEW_LINE>nex.printStackTrace();<NEW_LINE>fail("lookup of " + lookup + " failed in an " + "unexpected way : " + nex.getClass().getName() + " : " + nex.getMessage());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>svLogger.info(nex.getClass().getName() + " : " + nex.getMessage());<NEW_LINE>nex.printStackTrace();<NEW_LINE>fail("lookup of " + lookup + " failed in an " + "unexpected way : " + nex.getClass().getName() + " : " + nex.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
AmbiguousRemoteName bean = beanHome.create();
127,553
public static DescribeSnapshotsResponse unmarshall(DescribeSnapshotsResponse describeSnapshotsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSnapshotsResponse.setRequestId<MASK><NEW_LINE>describeSnapshotsResponse.setNextToken(_ctx.stringValue("DescribeSnapshotsResponse.NextToken"));<NEW_LINE>describeSnapshotsResponse.setPageSize(_ctx.integerValue("DescribeSnapshotsResponse.PageSize"));<NEW_LINE>describeSnapshotsResponse.setPageNumber(_ctx.integerValue("DescribeSnapshotsResponse.PageNumber"));<NEW_LINE>describeSnapshotsResponse.setTotalCount(_ctx.integerValue("DescribeSnapshotsResponse.TotalCount"));<NEW_LINE>List<Snapshot> snapshots = new ArrayList<Snapshot>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSnapshotsResponse.Snapshots.Length"); i++) {<NEW_LINE>Snapshot snapshot = new Snapshot();<NEW_LINE>snapshot.setStatus(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Status"));<NEW_LINE>snapshot.setCreationTime(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].CreationTime"));<NEW_LINE>snapshot.setProgress(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Progress"));<NEW_LINE>snapshot.setInstantAccess(_ctx.booleanValue("DescribeSnapshotsResponse.Snapshots[" + i + "].InstantAccess"));<NEW_LINE>snapshot.setRemainTime(_ctx.integerValue("DescribeSnapshotsResponse.Snapshots[" + i + "].RemainTime"));<NEW_LINE>snapshot.setSourceDiskSize(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SourceDiskSize"));<NEW_LINE>snapshot.setRetentionDays(_ctx.integerValue("DescribeSnapshotsResponse.Snapshots[" + i + "].RetentionDays"));<NEW_LINE>snapshot.setSourceDiskType(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SourceDiskType"));<NEW_LINE>snapshot.setSourceStorageType(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SourceStorageType"));<NEW_LINE>snapshot.setUsage(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Usage"));<NEW_LINE>snapshot.setLastModifiedTime(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].LastModifiedTime"));<NEW_LINE>snapshot.setEncrypted(_ctx.booleanValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Encrypted"));<NEW_LINE>snapshot.setSnapshotType(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SnapshotType"));<NEW_LINE>snapshot.setSourceDiskId(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SourceDiskId"));<NEW_LINE>snapshot.setSnapshotName(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SnapshotName"));<NEW_LINE>snapshot.setInstantAccessRetentionDays(_ctx.integerValue("DescribeSnapshotsResponse.Snapshots[" + i + "].InstantAccessRetentionDays"));<NEW_LINE>snapshot.setDescription(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Description"));<NEW_LINE>snapshot.setSnapshotId(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SnapshotId"));<NEW_LINE>snapshot.setResourceGroupId(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].ResourceGroupId"));<NEW_LINE>snapshot.setCategory(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Category"));<NEW_LINE>snapshot.setKMSKeyId(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].KMSKeyId"));<NEW_LINE>snapshot.setSnapshotSN(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SnapshotSN"));<NEW_LINE>snapshot.setProductCode(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].ProductCode"));<NEW_LINE>snapshot.setSourceSnapshotId(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SourceSnapshotId"));<NEW_LINE>snapshot.setSourceRegionId(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].SourceRegionId"));<NEW_LINE>List<Tag> tags = new ArrayList<Tag>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Tags.Length"); j++) {<NEW_LINE>Tag tag = new Tag();<NEW_LINE>tag.setTagValue(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Tags[" + j + "].TagValue"));<NEW_LINE>tag.setTagKey(_ctx.stringValue("DescribeSnapshotsResponse.Snapshots[" + i + "].Tags[" + j + "].TagKey"));<NEW_LINE>tags.add(tag);<NEW_LINE>}<NEW_LINE>snapshot.setTags(tags);<NEW_LINE>snapshots.add(snapshot);<NEW_LINE>}<NEW_LINE>describeSnapshotsResponse.setSnapshots(snapshots);<NEW_LINE>return describeSnapshotsResponse;<NEW_LINE>}
(_ctx.stringValue("DescribeSnapshotsResponse.RequestId"));
1,656,722
public void run() {<NEW_LINE>final Properties props = loadProperties(file);<NEW_LINE>if (props == null) {<NEW_LINE>NotifyDescriptor nd = new NotifyDescriptor.Message(NbBundle.getMessage(PersistenceSupport.class, "MSG_FailedLoadFromFile"), NotifyDescriptor.ERROR_MESSAGE);<NEW_LINE>DialogDisplayer.getDefault().notifyLater(nd);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>panel.setKeyStore(props.getProperty(SecurityModel.KEYSTORE_LOCATION));<NEW_LINE>String keyStorePassword = props.getProperty(SecurityModel.KEYSTORE_PASSWORD);<NEW_LINE>panel.setKeyStorePassword(keyStorePassword == null ? null : keyStorePassword.toCharArray());<NEW_LINE>panel.setKeyStoreType(props<MASK><NEW_LINE>panel.setTrustStore(props.getProperty(SecurityModel.TRUSTSTORE_LOCATION));<NEW_LINE>String trustStorePassword = props.getProperty(SecurityModel.TRUSTSTORE_PASSWORD);<NEW_LINE>panel.setTrustStorePassword(trustStorePassword == null ? null : trustStorePassword.toCharArray());<NEW_LINE>panel.setTrustStoreType(props.getProperty(SecurityModel.TRUSTSTORE_TYPE));<NEW_LINE>panel.setEnabledProtocols(props.getProperty(SecurityModel.ENABLED_PROTOCOLS));<NEW_LINE>panel.setEnabledCipherSuites(props.getProperty(SecurityModel.ENABLED_CIPHER_SUITES));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.getProperty(SecurityModel.KEYSTORE_TYPE));
378,183
public static void assertEqualsToScale(Se3_F64 expected, Se3_F64 found, double tolAngle, double tolT) {<NEW_LINE>var R = new DMatrixRMaj(3, 3);<NEW_LINE>CommonOps_DDRM.multTransA(expected.R, found.R, R);<NEW_LINE>Rodrigues_F64 rod = ConvertRotation3D_F64.matrixToRodrigues(R, null);<NEW_LINE>assertEquals(0.0, rod.theta, tolAngle);<NEW_LINE>double normFound = found.T.norm();<NEW_LINE>double normExpected = expected.T.norm();<NEW_LINE>if (normFound == 0.0 || normExpected == 0.0) {<NEW_LINE>assertEquals(0.0, normFound, tolT);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int largestIdx = -1;<NEW_LINE>double largestMag = 0;<NEW_LINE>for (int i = 0; i < 3; i++) {<NEW_LINE>double mag = Math.abs(expected.T.getIdx(i));<NEW_LINE>if (mag > largestMag) {<NEW_LINE>largestMag = mag;<NEW_LINE>largestIdx = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (Math.signum(expected.T.getIdx(largestIdx)) != Math.signum(found.T.getIdx(largestIdx)))<NEW_LINE>normFound *= -1;<NEW_LINE>// they will have the same scale and a norm of 1<NEW_LINE>double dx = expected.T.x / normExpected <MASK><NEW_LINE>double dy = expected.T.y / normExpected - found.T.y / normFound;<NEW_LINE>double dz = expected.T.z / normExpected - found.T.z / normFound;<NEW_LINE>double r = Math.sqrt(dx * dx + dy * dy + dz * dz);<NEW_LINE>assertEquals(0.0, r, tolT, "E=" + expected.T + " F=" + found.T);<NEW_LINE>}
- found.T.x / normFound;
1,400,695
protected Sheet createSheet() {<NEW_LINE>Sheet propertySheet = super.createSheet();<NEW_LINE>Sheet.Set properties = propertySheet.get(Sheet.PROPERTIES);<NEW_LINE>if (properties == null) {<NEW_LINE>properties = Sheet.createPropertiesSet();<NEW_LINE>propertySheet.put(properties);<NEW_LINE>}<NEW_LINE>properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.srcFile.text"), NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.srcFile.text"), "", getDisplayName()));<NEW_LINE>addOriginalNameProp(properties);<NEW_LINE>String contentPath;<NEW_LINE>try {<NEW_LINE>contentPath = tag.getContent().getUniquePath();<NEW_LINE>} catch (TskCoreException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>Logger.getLogger(ContentTagNode.class.getName()).log(Level.SEVERE, "Failed to get path for content (id = " + tag.getContent().getId() + ")", ex);<NEW_LINE>contentPath = NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.unavail.text");<NEW_LINE>}<NEW_LINE>properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.srcFilePath.text"), NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.srcFilePath.text"), "", contentPath));<NEW_LINE>properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.resultType.text"), NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.resultType.text"), "", tag.getArtifact().getDisplayName()));<NEW_LINE>properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.comment.text"), NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.comment.text"), ""<MASK><NEW_LINE>properties.put(new NodeProperty<>(NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.userName.text"), NbBundle.getMessage(this.getClass(), "BlackboardArtifactTagNode.createSheet.userName.text"), "", tag.getUserName()));<NEW_LINE>return propertySheet;<NEW_LINE>}
, tag.getComment()));
1,244,956
private void sendCancelObserve() {<NEW_LINE>proactiveCancel = false;<NEW_LINE>Response response = current;<NEW_LINE>Request request = this.request;<NEW_LINE>EndpointContext destinationContext = response != null ? response.getSourceContext() : request.getDestinationContext();<NEW_LINE>Request cancel = Request.newGet();<NEW_LINE>cancel.setDestinationContext(destinationContext);<NEW_LINE>// use same Token<NEW_LINE>cancel.setToken(request.getToken());<NEW_LINE>// copy options<NEW_LINE>cancel.setOptions(request.getOptions());<NEW_LINE>// set Observe to cancel<NEW_LINE>cancel.setObserveCancel();<NEW_LINE>cancel.setMaxResourceBodySize(request.getMaxResourceBodySize());<NEW_LINE>if (request.isUnintendedPayload()) {<NEW_LINE>cancel.setUnintendedPayload();<NEW_LINE>cancel.<MASK><NEW_LINE>}<NEW_LINE>// use same message observers<NEW_LINE>for (MessageObserver observer : request.getMessageObservers()) {<NEW_LINE>if (observer.isInternal()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>request.removeMessageObserver(observer);<NEW_LINE>cancel.addMessageObserver(observer);<NEW_LINE>}<NEW_LINE>this.request = cancel;<NEW_LINE>endpoint.sendRequest(cancel);<NEW_LINE>}
setPayload(request.getPayload());
1,816,698
private void generateQueryParamBindingMethods(JDefinedClass facadeClass, ParameterSchemaArray parameters, JDefinedClass derivedBuilderClass, RecordTemplate methodSchema) {<NEW_LINE>for (ParameterSchema param : parameters) {<NEW_LINE>if ("array".equals(param.getType())) {<NEW_LINE>final JClass paramItemsClass = getJavaBindingType(param.getItems(), facadeClass).valueClass;<NEW_LINE>final JClass paramClass = getCodeModel().ref(Iterable.class).narrow(paramItemsClass);<NEW_LINE>generateQueryParamSetMethod(derivedBuilderClass, param, paramClass, paramItemsClass);<NEW_LINE>generateQueryParamAddMethod(derivedBuilderClass, param, paramItemsClass);<NEW_LINE>} else {<NEW_LINE>final DataSchema typeSchema = RestSpecCodec.textToSchema(param.getType(), _schemaResolver);<NEW_LINE>final JClass paramClass = getJavaBindingType(typeSchema, facadeClass).valueClass;<NEW_LINE>// for batchFinder parameter, we do not use the standard way to represent SearchCriteraArray as an input of the set parameter method<NEW_LINE>// since we can not guarantee that SearchCriteraArray is generated<NEW_LINE>if (!(methodSchema instanceof BatchFinderSchema && ((BatchFinderSchema) methodSchema).getBatchParam().equals(param.getName()))) {<NEW_LINE>generateQueryParamSetMethod(derivedBuilderClass, param, paramClass, paramClass);<NEW_LINE>}<NEW_LINE>// we deprecate the "items" field from ParameterSchema, which generates Iterable<Foo> in the builder<NEW_LINE>// instead, we use the standard way to represent arrays, which generates FooArray<NEW_LINE>// for backwards compatibility, add the method with Iterable<Foo> parameter<NEW_LINE>if (typeSchema instanceof ArrayDataSchema) {<NEW_LINE>final DataSchema itemsSchema = ((ArrayDataSchema) typeSchema).getItems();<NEW_LINE>final JClass paramItemsClass = getJavaBindingType(itemsSchema, facadeClass).valueClass;<NEW_LINE>final JClass iterableItemsClass = getCodeModel().ref(Iterable<MASK><NEW_LINE>generateQueryParamSetMethod(derivedBuilderClass, param, iterableItemsClass, paramItemsClass);<NEW_LINE>generateQueryParamAddMethod(derivedBuilderClass, param, paramItemsClass);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.class).narrow(paramItemsClass);
617,713
public void update(final long clusterPosition, final OClusterPositionMapBucket.PositionEntry entry, final OAtomicOperation atomicOperation) throws IOException {<NEW_LINE>final long pageIndex <MASK><NEW_LINE>final int index = (int) (clusterPosition % OClusterPositionMapBucket.MAX_ENTRIES);<NEW_LINE>final long lastPage = getLastPage(atomicOperation);<NEW_LINE>if (pageIndex > lastPage) {<NEW_LINE>throw new OClusterPositionMapException("Passed in cluster position " + clusterPosition + " is outside of range of cluster-position map", this);<NEW_LINE>}<NEW_LINE>final OCacheEntry cacheEntry = loadPageForWrite(atomicOperation, fileId, pageIndex, false, true);<NEW_LINE>try {<NEW_LINE>final OClusterPositionMapBucket bucket = new OClusterPositionMapBucket(cacheEntry);<NEW_LINE>bucket.set(index, entry);<NEW_LINE>} finally {<NEW_LINE>releasePageFromWrite(atomicOperation, cacheEntry);<NEW_LINE>}<NEW_LINE>}
= clusterPosition / OClusterPositionMapBucket.MAX_ENTRIES + 1;
1,496,228
public void testCBSyncFallback() throws Exception {<NEW_LINE>String result = null;<NEW_LINE>for (int i = 0; i < 3; i++) {<NEW_LINE>try {<NEW_LINE>result = bean.serviceE();<NEW_LINE>assertThat(result, is("serviceEFallback"));<NEW_LINE>} catch (ConnectException e) {<NEW_LINE>// We should have fallen back, assert if a ConnectException is thrown<NEW_LINE>throw new AssertionError("ConnectException not expected");<NEW_LINE>} catch (Exception ue) {<NEW_LINE>// We should have fallen back, assert if an unexpected Exception is thrown<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Confirm that the service was called 3 times.<NEW_LINE>assertThat(bean.getExecutionCounterE(), is(3));<NEW_LINE>// Circuit should now be open. Attempt to call serviceE once more.<NEW_LINE>try {<NEW_LINE>result = bean.serviceE();<NEW_LINE>} catch (ConnectException e) {<NEW_LINE>// We should have fallen back, assert if a ConnectException is thrown<NEW_LINE>throw new AssertionError("ConnectException not expected");<NEW_LINE>} catch (Exception ue) {<NEW_LINE>// We should have fallen back, assert if an unexpected Exception is thrown<NEW_LINE>throw new AssertionError("Unexpected exception " + ue);<NEW_LINE>}<NEW_LINE>// CB is open, expect to fall back<NEW_LINE>assertThat(result, is("serviceEFallback"));<NEW_LINE>// However, we don't expect the call to have reached the serviceE method because the Circuit is open<NEW_LINE>// so the counter should not have been further incremented.<NEW_LINE>assertThat(bean.getExecutionCounterE(), is(3));<NEW_LINE>}
throw new AssertionError("Unexpected exception " + ue);
878,709
public static SQLQueryAdapter generate(CockroachDBGlobalState globalState) {<NEW_LINE>int nrColumns <MASK><NEW_LINE>StringBuilder sb = new StringBuilder("CREATE ");<NEW_LINE>sb.append("VIEW ");<NEW_LINE>sb.append(globalState.getSchema().getFreeViewName());<NEW_LINE>sb.append("(");<NEW_LINE>for (int i = 0; i < nrColumns; i++) {<NEW_LINE>if (i != 0) {<NEW_LINE>sb.append(", ");<NEW_LINE>}<NEW_LINE>sb.append("c");<NEW_LINE>sb.append(i);<NEW_LINE>}<NEW_LINE>sb.append(") AS ");<NEW_LINE>sb.append(CockroachDBRandomQuerySynthesizer.generate(globalState, nrColumns).getQueryString());<NEW_LINE>ExpectedErrors errors = new ExpectedErrors();<NEW_LINE>CockroachDBErrors.addExpressionErrors(errors);<NEW_LINE>CockroachDBErrors.addTransactionErrors(errors);<NEW_LINE>errors.add("value type unknown cannot be used for table columns");<NEW_LINE>errors.add("already exists");<NEW_LINE>return new SQLQueryAdapter(sb.toString(), errors, true);<NEW_LINE>}
= Randomly.smallNumber() + 1;
1,596,236
final UpdateBotAliasResult executeUpdateBotAlias(UpdateBotAliasRequest updateBotAliasRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateBotAliasRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateBotAliasRequest> request = null;<NEW_LINE>Response<UpdateBotAliasResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateBotAliasRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateBotAliasRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateBotAlias");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateBotAliasResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateBotAliasResultJsonUnmarshaller());<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.SERVICE_ID, "Lex Models V2");
1,042,406
public DateFormat compile(CharSequence pattern, int lo, int hi, boolean generic) {<NEW_LINE>this.lexer.of(pattern, lo, hi);<NEW_LINE>IntList ops;<NEW_LINE>ObjList<String> delimiters;<NEW_LINE>if (generic) {<NEW_LINE>ops = new IntList();<NEW_LINE>delimiters = new ObjList<>();<NEW_LINE>} else {<NEW_LINE>ops = this.ops;<NEW_LINE>delimiters = this.delimiters;<NEW_LINE>ops.clear();<NEW_LINE>delimiters.clear();<NEW_LINE>}<NEW_LINE>while (this.lexer.hasNext()) {<NEW_LINE>final CharSequence cs = lexer.next();<NEW_LINE>final int op = opMap.get(cs);<NEW_LINE>switch(op) {<NEW_LINE>case -1:<NEW_LINE>makeLastOpGreedy(ops);<NEW_LINE>delimiters.add(Chars.toString(cs));<NEW_LINE>ops.add(-(delimiters.size()));<NEW_LINE>break;<NEW_LINE>case OP_AM_PM:<NEW_LINE>case OP_TIME_ZONE_SHORT:<NEW_LINE>makeLastOpGreedy(ops);<NEW_LINE>// fall thru<NEW_LINE>default:<NEW_LINE>ops.add(op);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// make last operation "greedy"<NEW_LINE>makeLastOpGreedy(ops);<NEW_LINE>return generic ? new GenericDateFormat(ops, delimiters<MASK><NEW_LINE>}
) : compile(ops, delimiters);
1,134,768
private void extractSearchIndexParameters(RequestDetails theRequestDetails, ResourceIndexedSearchParams theParams, IBaseResource theResource, ResourceTable theEntity) {<NEW_LINE>// Strings<NEW_LINE>ISearchParamExtractor.SearchParamSet<ResourceIndexedSearchParamString> strings = extractSearchParamStrings(theResource);<NEW_LINE>handleWarnings(theRequestDetails, myInterceptorBroadcaster, strings);<NEW_LINE>theParams.myStringParams.addAll(strings);<NEW_LINE>// Numbers<NEW_LINE>ISearchParamExtractor.SearchParamSet<ResourceIndexedSearchParamNumber> numbers = extractSearchParamNumber(theResource);<NEW_LINE>handleWarnings(theRequestDetails, myInterceptorBroadcaster, numbers);<NEW_LINE>theParams.myNumberParams.addAll(numbers);<NEW_LINE>// Quantities<NEW_LINE>ISearchParamExtractor.SearchParamSet<ResourceIndexedSearchParamQuantity> quantities = extractSearchParamQuantity(theResource);<NEW_LINE>handleWarnings(theRequestDetails, myInterceptorBroadcaster, quantities);<NEW_LINE>theParams.myQuantityParams.addAll(quantities);<NEW_LINE>if (myModelConfig.getNormalizedQuantitySearchLevel().equals(NormalizedQuantitySearchLevel.NORMALIZED_QUANTITY_STORAGE_SUPPORTED) || myModelConfig.getNormalizedQuantitySearchLevel().equals(NormalizedQuantitySearchLevel.NORMALIZED_QUANTITY_SEARCH_SUPPORTED)) {<NEW_LINE>ISearchParamExtractor.SearchParamSet<ResourceIndexedSearchParamQuantityNormalized> quantitiesNormalized = extractSearchParamQuantityNormalized(theResource);<NEW_LINE>handleWarnings(theRequestDetails, myInterceptorBroadcaster, quantitiesNormalized);<NEW_LINE>theParams.myQuantityNormalizedParams.addAll(quantitiesNormalized);<NEW_LINE>}<NEW_LINE>// Dates<NEW_LINE>ISearchParamExtractor.SearchParamSet<ResourceIndexedSearchParamDate> dates = extractSearchParamDates(theResource);<NEW_LINE>handleWarnings(theRequestDetails, myInterceptorBroadcaster, dates);<NEW_LINE>theParams.myDateParams.addAll(dates);<NEW_LINE>// URIs<NEW_LINE>ISearchParamExtractor.SearchParamSet<ResourceIndexedSearchParamUri> uris = extractSearchParamUri(theResource);<NEW_LINE>handleWarnings(theRequestDetails, myInterceptorBroadcaster, uris);<NEW_LINE>theParams.myUriParams.addAll(uris);<NEW_LINE>// Tokens (can result in both Token and String, as we index the display name for<NEW_LINE>// the types: Coding, CodeableConcept)<NEW_LINE>ISearchParamExtractor.SearchParamSet<BaseResourceIndexedSearchParam> tokens = extractSearchParamTokens(theResource);<NEW_LINE>for (BaseResourceIndexedSearchParam next : tokens) {<NEW_LINE>if (next instanceof ResourceIndexedSearchParamToken) {<NEW_LINE>theParams.myTokenParams.add((ResourceIndexedSearchParamToken) next);<NEW_LINE>} else if (next instanceof ResourceIndexedSearchParamCoords) {<NEW_LINE>theParams.myCoordsParams.add((ResourceIndexedSearchParamCoords) next);<NEW_LINE>} else {<NEW_LINE>theParams.myStringParams.add((ResourceIndexedSearchParamString) next);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Specials<NEW_LINE>ISearchParamExtractor.SearchParamSet<BaseResourceIndexedSearchParam> specials = extractSearchParamSpecial(theResource);<NEW_LINE>for (BaseResourceIndexedSearchParam next : specials) {<NEW_LINE>if (next instanceof ResourceIndexedSearchParamCoords) {<NEW_LINE>theParams.myCoordsParams<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.add((ResourceIndexedSearchParamCoords) next);
398,219
public void visitIfElse(final IfStatement node) {<NEW_LINE>scopes.add(new VariableScope(scopes.getLast(), node, false));<NEW_LINE>try {<NEW_LINE>// TODO: Assignment within expression may be conditional or unconditional due to short-circuit evaluation.<NEW_LINE>node.getBooleanExpression().visit(this);<NEW_LINE>Map<String, ClassNode[]> types = inferInstanceOfType(node.getBooleanExpression(), scopes.getLast());<NEW_LINE>VariableScope trueScope = new VariableScope(scopes.getLast(), node.getIfBlock(), false);<NEW_LINE>scopes.add(trueScope);<NEW_LINE>try {<NEW_LINE>for (Map.Entry<String, ClassNode[]> entry : types.entrySet()) {<NEW_LINE>if (entry.getValue().length > 0 && entry.getValue()[0] != null) {<NEW_LINE>trueScope.updateVariableSoft(entry.getKey(), entry.getValue()[0]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>node.<MASK><NEW_LINE>} finally {<NEW_LINE>scopes.removeLast();<NEW_LINE>}<NEW_LINE>// TODO: If else is empty block/statement or false path can be determined to be dead code, skip over.<NEW_LINE>VariableScope falseScope = new VariableScope(scopes.getLast(), node.getElseBlock(), false);<NEW_LINE>scopes.add(falseScope);<NEW_LINE>try {<NEW_LINE>for (Map.Entry<String, ClassNode[]> entry : types.entrySet()) {<NEW_LINE>if (entry.getValue().length > 1 && entry.getValue()[1] != null) {<NEW_LINE>falseScope.updateVariableSoft(entry.getKey(), entry.getValue()[1]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>node.getElseBlock().visit(this);<NEW_LINE>} finally {<NEW_LINE>scopes.removeLast();<NEW_LINE>}<NEW_LINE>// apply variable updates<NEW_LINE>scopes.getLast().bubbleUpdates(falseScope, trueScope);<NEW_LINE>} finally {<NEW_LINE>scopes.removeLast();<NEW_LINE>}<NEW_LINE>}
getIfBlock().visit(this);
940,990
final CreateSubnetGroupResult executeCreateSubnetGroup(CreateSubnetGroupRequest createSubnetGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createSubnetGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateSubnetGroupRequest> request = null;<NEW_LINE>Response<CreateSubnetGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateSubnetGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createSubnetGroupRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "MemoryDB");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateSubnetGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateSubnetGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateSubnetGroupResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
848,635
public void configure(Configuration configuration) {<NEW_LINE>List<String> hosts = config.getStringList(HOSTS);<NEW_LINE>Settings.Builder settings = Settings.builder();<NEW_LINE>config.entrySet().forEach(entry -> {<NEW_LINE>String key = entry.getKey();<NEW_LINE>Object value = entry.getValue().unwrapped();<NEW_LINE>if (key.startsWith(PREFIX)) {<NEW_LINE>settings.put(key.substring(PREFIX.length()), value.toString());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>TransportClient transportClient = new <MASK><NEW_LINE>for (String host : hosts) {<NEW_LINE>try {<NEW_LINE>transportClient.addTransportAddresses(new TransportAddress(InetAddress.getByName(host.split(":")[0]), Integer.parseInt(host.split(":")[1])));<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.warn("Host '{}' parse failed.", host, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BulkProcessor.Builder bulkProcessorBuilder = BulkProcessor.builder(transportClient, new BulkProcessor.Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void beforeBulk(long executionId, BulkRequest request) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void afterBulk(long executionId, BulkRequest request, BulkResponse response) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void afterBulk(long executionId, BulkRequest request, Throwable failure) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// This makes flush() blocking<NEW_LINE>// bulkProcessorBuilder.setConcurrentRequests(0);<NEW_LINE>bulkProcessor = bulkProcessorBuilder.build();<NEW_LINE>requestIndexer = new RequestIndexer() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void add(DeleteRequest... deleteRequests) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void add(IndexRequest... indexRequests) {<NEW_LINE>for (IndexRequest indexRequest : indexRequests) {<NEW_LINE>bulkProcessor.add(indexRequest);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void add(UpdateRequest... updateRequests) {<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
PreBuiltTransportClient(settings.build());
837,977
public String buildXPath(XPathModifier modifier) {<NEW_LINE>StringBuffer xpath = new StringBuffer();<NEW_LINE>for (Iterator<String> i = nsMap.keySet().iterator(); i.hasNext(); ) {<NEW_LINE>String ns = i.next();<NEW_LINE>xpath.append("declare namespace " + nsMap.get(ns) + "='" + ns + "';\n");<NEW_LINE>}<NEW_LINE>if (function != null) {<NEW_LINE>xpath.append(function).append("(");<NEW_LINE>}<NEW_LINE>if (modifier != null) {<NEW_LINE>modifier.beforeSelector(xpath);<NEW_LINE>}<NEW_LINE>String firstComponent = "";<NEW_LINE>if (pathComponents.size() > 0) {<NEW_LINE>firstComponent = pathComponents.get(pathComponents.size() - 1);<NEW_LINE>}<NEW_LINE>if (!absolute && !"".equals(firstComponent)) {<NEW_LINE>xpath.append("/");<NEW_LINE>}<NEW_LINE>for (int c = pathComponents.size() - 1; c >= 0; c--) {<NEW_LINE>xpath.append("/").append<MASK><NEW_LINE>}<NEW_LINE>if (modifier != null) {<NEW_LINE>modifier.afterSelector(xpath);<NEW_LINE>}<NEW_LINE>if (function != null) {<NEW_LINE>xpath.append(")");<NEW_LINE>}<NEW_LINE>return xpath.toString();<NEW_LINE>}
(pathComponents.get(c));
1,378,547
public static Icon cropIcon(@Nonnull Icon icon, int maxWidth, int maxHeight) {<NEW_LINE>if (icon.getIconHeight() <= maxHeight && icon.getIconWidth() <= maxWidth) {<NEW_LINE>return icon;<NEW_LINE>}<NEW_LINE>Image image = toImage(icon);<NEW_LINE>if (image == null)<NEW_LINE>return icon;<NEW_LINE>double scale = 1f;<NEW_LINE>if (image instanceof JBHiDPIScaledImage) {<NEW_LINE>scale = ((JBHiDPIScaledImage) image).getScale();<NEW_LINE>image = ((JBHiDPIScaledImage) image).getDelegate();<NEW_LINE>}<NEW_LINE>BufferedImage bi = ImageUtil.toBufferedImage(image);<NEW_LINE>final Graphics2D g = bi.createGraphics();<NEW_LINE>int imageWidth = ImageUtil.getRealWidth(image);<NEW_LINE>int imageHeight = ImageUtil.getRealHeight(image);<NEW_LINE>maxWidth = maxWidth == Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) Math.round(maxWidth * scale);<NEW_LINE>maxHeight = maxHeight == Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) Math.round(maxHeight * scale);<NEW_LINE>final int w = Math.min(imageWidth, maxWidth);<NEW_LINE>final int h = Math.min(imageHeight, maxHeight);<NEW_LINE>final BufferedImage img = UIUtil.createImage(g, <MASK><NEW_LINE>final int offX = imageWidth > maxWidth ? (imageWidth - maxWidth) / 2 : 0;<NEW_LINE>final int offY = imageHeight > maxHeight ? (imageHeight - maxHeight) / 2 : 0;<NEW_LINE>for (int col = 0; col < w; col++) {<NEW_LINE>for (int row = 0; row < h; row++) {<NEW_LINE>img.setRGB(col, row, bi.getRGB(col + offX, row + offY));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>g.dispose();<NEW_LINE>return new JBImageIcon(RetinaImage.createFrom(img, scale, null));<NEW_LINE>}
w, h, Transparency.TRANSLUCENT);
420,243
final DeleteConfigurationSetEventDestinationResult executeDeleteConfigurationSetEventDestination(DeleteConfigurationSetEventDestinationRequest deleteConfigurationSetEventDestinationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteConfigurationSetEventDestinationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteConfigurationSetEventDestinationRequest> request = null;<NEW_LINE>Response<DeleteConfigurationSetEventDestinationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteConfigurationSetEventDestinationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteConfigurationSetEventDestinationRequest));<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, "SESv2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteConfigurationSetEventDestination");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteConfigurationSetEventDestinationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteConfigurationSetEventDestinationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,581,674
private void checkSchemaVersion(final DOMWrapper schemaDom) {<NEW_LINE>String schemaVersion = schemaDom.getAttribute("metamodelVersion");<NEW_LINE>if (schemaVersion == null) {<NEW_LINE>if (hasMondrian4Elements(schemaDom)) {<NEW_LINE>schemaVersion = "4.x";<NEW_LINE>} else {<NEW_LINE>schemaVersion = "3.x";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String[] versionParts = schemaVersion.split("\\.");<NEW_LINE>final String schemaMajor = versionParts.length > <MASK><NEW_LINE>String serverSchemaVersion = Integer.toString(MondrianServer.forId(null).getSchemaVersion());<NEW_LINE>if (serverSchemaVersion.compareTo(schemaMajor) < 0) {<NEW_LINE>String errorMsg = "Schema version '" + schemaVersion + "' is later than schema version " + "'3.x' supported by this version of Mondrian";<NEW_LINE>throw Util.newError(errorMsg);<NEW_LINE>}<NEW_LINE>}
0 ? versionParts[0] : "";
1,501,848
protected PNone doIt(VirtualFrame frame, PThreadLocal object, Object keyObj, @Cached ThreadLocalNodes.GetThreadLocalDict getThreadLocalDict, @Cached LookupAttributeInMRONode.Dynamic getExisting, @Cached GetClassNode getClassNode, @Cached("create(__DELETE__)") LookupAttributeInMRONode lookupDeleteNode, @Cached CallBinaryMethodNode callDelete, @CachedLibrary(limit = "3") HashingStorageLibrary hlib, @Cached CastToJavaStringNode castKeyToStringNode) {<NEW_LINE>// Note: getting thread local dict has potential side-effects, don't move<NEW_LINE>PDict localDict = getThreadLocalDict.execute(frame, object);<NEW_LINE>String key;<NEW_LINE>try {<NEW_LINE>key = castKeyToStringNode.execute(keyObj);<NEW_LINE>} catch (CannotCastException e) {<NEW_LINE>throw raise(PythonBuiltinClassType.TypeError, ErrorMessages.ATTR_NAME_MUST_BE_STRING, keyObj);<NEW_LINE>}<NEW_LINE>Object type = getClassNode.execute(object);<NEW_LINE>Object descr = getExisting.execute(type, key);<NEW_LINE>if (descr != PNone.NO_VALUE) {<NEW_LINE>Object dataDescClass = getDescClass(descr);<NEW_LINE>Object delete = lookupDeleteNode.execute(dataDescClass);<NEW_LINE>if (PGuards.isCallable(delete)) {<NEW_LINE>callDelete.executeObject(frame, delete, descr, object);<NEW_LINE>return PNone.NONE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Object currentValue = hlib.getItem(localDict.getDictStorage(), key);<NEW_LINE>if (currentValue != null) {<NEW_LINE>HashingStorage storage = hlib.delItem(localDict.getDictStorage(), key);<NEW_LINE>localDict.setDictStorage(storage);<NEW_LINE>return PNone.NONE;<NEW_LINE>}<NEW_LINE>if (descr != PNone.NO_VALUE) {<NEW_LINE>throw raise(AttributeError, ErrorMessages.ATTR_S_READONLY, key);<NEW_LINE>} else {<NEW_LINE>throw raise(AttributeError, <MASK><NEW_LINE>}<NEW_LINE>}
ErrorMessages.OBJ_P_HAS_NO_ATTR_S, object, key);
958,305
final GetWirelessGatewayStatisticsResult executeGetWirelessGatewayStatistics(GetWirelessGatewayStatisticsRequest getWirelessGatewayStatisticsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getWirelessGatewayStatisticsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetWirelessGatewayStatisticsRequest> request = null;<NEW_LINE>Response<GetWirelessGatewayStatisticsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetWirelessGatewayStatisticsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getWirelessGatewayStatisticsRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetWirelessGatewayStatistics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetWirelessGatewayStatisticsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetWirelessGatewayStatisticsResultJsonUnmarshaller());<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.SERVICE_ID, "IoT Wireless");
1,474,100
public void read(org.apache.thrift.protocol.TProtocol prot, TopologyInfo struct) throws org.apache.thrift.TException {<NEW_LINE>TTupleProtocol iprot = (TTupleProtocol) prot;<NEW_LINE>struct.topology = new TopologySummary();<NEW_LINE>struct.topology.read(iprot);<NEW_LINE>struct.set_topology_isSet(true);<NEW_LINE>{<NEW_LINE>org.apache.thrift.protocol.TList _list188 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());<NEW_LINE>struct.components = new ArrayList<ComponentSummary>(_list188.size);<NEW_LINE>ComponentSummary _elem189;<NEW_LINE>for (int _i190 = 0; _i190 < _list188.size; ++_i190) {<NEW_LINE>_elem189 = new ComponentSummary();<NEW_LINE>_elem189.read(iprot);<NEW_LINE>struct.components.add(_elem189);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>struct.set_components_isSet(true);<NEW_LINE>{<NEW_LINE>org.apache.thrift.protocol.TList _list191 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());<NEW_LINE>struct.tasks = new ArrayList<MASK><NEW_LINE>TaskSummary _elem192;<NEW_LINE>for (int _i193 = 0; _i193 < _list191.size; ++_i193) {<NEW_LINE>_elem192 = new TaskSummary();<NEW_LINE>_elem192.read(iprot);<NEW_LINE>struct.tasks.add(_elem192);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>struct.set_tasks_isSet(true);<NEW_LINE>struct.metrics = new TopologyMetric();<NEW_LINE>struct.metrics.read(iprot);<NEW_LINE>struct.set_metrics_isSet(true);<NEW_LINE>}
<TaskSummary>(_list191.size);
407,622
private void processProgramHeader(ElfProgramHeader elfProgramHeader, int segmentNumber) throws AddressOutOfBoundsException {<NEW_LINE>// FIXME: If physical and virtual addresses do not match this may be an overlay situation.<NEW_LINE>// If sections exist they should use file offsets to correlate to overlay segment - the<NEW_LINE>// problem is that we can only handle a single memory block per overlay range - we may need to<NEW_LINE>// not load segment in this case and defer to section!! Such situations may also<NEW_LINE>// occur for mapped memory regions as seen with some Harvard Architecture processors. The<NEW_LINE>// process-specific extension should control the outcome.<NEW_LINE>Address address = getSegmentLoadAddress(elfProgramHeader);<NEW_LINE>AddressSpace space = address.getAddressSpace();<NEW_LINE>long addr = elfProgramHeader.getVirtualAddress();<NEW_LINE>long loadSizeBytes = elfProgramHeader.getAdjustedLoadSize();<NEW_LINE>long fullSizeBytes = elfProgramHeader.getAdjustedMemorySize();<NEW_LINE>boolean maintainExecuteBit = elf.getSectionHeaderCount() == 0;<NEW_LINE>if (fullSizeBytes <= 0) {<NEW_LINE>log("Skipping zero-length segment [" + segmentNumber + "," + elfProgramHeader.getDescription() + "] at address " + address.toString(true));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!space.isValidRange(address.getOffset(), fullSizeBytes)) {<NEW_LINE>log("Skipping unloadable segment [" + segmentNumber + "] at address " + address.toString(true) + " (size=" + fullSizeBytes + ")");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Only allow segment fragmentation if section headers are defined<NEW_LINE>boolean isFragmentationOK = (elf.getSectionHeaderCount() != 0);<NEW_LINE>String comment = getSectionComment(addr, fullSizeBytes, space.getAddressableUnitSize(), elfProgramHeader.getDescription(), address.isLoadedMemoryAddress());<NEW_LINE>if (!maintainExecuteBit && elfProgramHeader.isExecute()) {<NEW_LINE>comment += " (disabled execute bit)";<NEW_LINE>}<NEW_LINE>String blockName = String.format("%s%d", SEGMENT_NAME_PREFIX, segmentNumber);<NEW_LINE>if (loadSizeBytes != 0) {<NEW_LINE>addInitializedMemorySection(elfProgramHeader, elfProgramHeader.getOffset(), loadSizeBytes, address, blockName, elfProgramHeader.isRead(), elfProgramHeader.isWrite(), maintainExecuteBit ? elfProgramHeader.isExecute() : false, comment, isFragmentationOK, elfProgramHeader.getType() == ElfProgramHeaderConstants.PT_LOAD);<NEW_LINE>}<NEW_LINE>// NOTE: Uninitialized portions of segments will be added via expandProgramHeaderBlocks<NEW_LINE>// when no sections are present. When sections are present, we assume sections will<NEW_LINE>// be created which correspond to these areas.<NEW_LINE>} catch (AddressOverflowException e) {<NEW_LINE>log("Failed to load segment [" + segmentNumber <MASK><NEW_LINE>}<NEW_LINE>}
+ "]: " + getMessage(e));
1,339,061
private static Map<String, Integer> makeUnitsMap() {<NEW_LINE>// NOTE: consciously choosing not to support WEEK at this time,<NEW_LINE>// because of complexity in rounding down to the nearest week<NEW_LINE>// arround a month/year boundry.<NEW_LINE>// (Not to mention: it's not clear what people would *expect*)<NEW_LINE>//<NEW_LINE>// If we consider adding some time of "week" support, then<NEW_LINE>// we probably need to change "Locale loc" to default to something<NEW_LINE>// from a param via SolrRequestInfo as well.<NEW_LINE>Map<String, Integer> units = new HashMap<String, Integer>(13);<NEW_LINE>units.put("YEAR", Calendar.YEAR);<NEW_LINE>units.put("YEARS", Calendar.YEAR);<NEW_LINE>units.<MASK><NEW_LINE>units.put("MONTHS", Calendar.MONTH);<NEW_LINE>units.put("DAY", Calendar.DATE);<NEW_LINE>units.put("DAYS", Calendar.DATE);<NEW_LINE>units.put("DATE", Calendar.DATE);<NEW_LINE>units.put("HOUR", Calendar.HOUR_OF_DAY);<NEW_LINE>units.put("HOURS", Calendar.HOUR_OF_DAY);<NEW_LINE>units.put("MINUTE", Calendar.MINUTE);<NEW_LINE>units.put("MINUTES", Calendar.MINUTE);<NEW_LINE>units.put("SECOND", Calendar.SECOND);<NEW_LINE>units.put("SECONDS", Calendar.SECOND);<NEW_LINE>units.put("MILLI", Calendar.MILLISECOND);<NEW_LINE>units.put("MILLIS", Calendar.MILLISECOND);<NEW_LINE>units.put("MILLISECOND", Calendar.MILLISECOND);<NEW_LINE>units.put("MILLISECONDS", Calendar.MILLISECOND);<NEW_LINE>return units;<NEW_LINE>}
put("MONTH", Calendar.MONTH);
1,447,270
public Dialog onCreateDialog(Bundle savedInstanceState) {<NEW_LINE>Bundle argument = getArguments();<NEW_LINE>String errorMessage = argument.getString(ERROR_MESSAGE);<NEW_LINE>final OsmPoint point = (OsmPoint) argument.getSerializable(POINT);<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());<NEW_LINE>builder.setTitle(getResources().getString(R.string.failed_to_upload)).setMessage(MessageFormat.format(getResources().getString(R.string.error_message_pattern), errorMessage)).setPositiveButton(R.string.shared_string_ok, null);<NEW_LINE>builder.setNeutralButton(getResources().getString(R.string.delete_change), new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>public void onClick(@Nullable DialogInterface dialog, int id) {<NEW_LINE>OsmEditingPlugin plugin = OsmandPlugin.getActivePlugin(OsmEditingPlugin.class);<NEW_LINE>assert point != null;<NEW_LINE>assert plugin != null;<NEW_LINE>if (point.getGroup() == OsmPoint.Group.BUG) {<NEW_LINE>plugin.getDBBug()<MASK><NEW_LINE>} else if (point.getGroup() == OsmPoint.Group.POI) {<NEW_LINE>plugin.getDBPOI().deletePOI((OpenstreetmapPoint) point);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return builder.create();<NEW_LINE>}
.deleteAllBugModifications((OsmNotesPoint) point);
939,546
public static GetSubscriptionItemDetailResponse unmarshall(GetSubscriptionItemDetailResponse getSubscriptionItemDetailResponse, UnmarshallerContext _ctx) {<NEW_LINE>getSubscriptionItemDetailResponse.setRequestId(_ctx.stringValue("GetSubscriptionItemDetailResponse.RequestId"));<NEW_LINE>getSubscriptionItemDetailResponse.setSuccess(_ctx.booleanValue("GetSubscriptionItemDetailResponse.Success"));<NEW_LINE>getSubscriptionItemDetailResponse.setCode(_ctx.stringValue("GetSubscriptionItemDetailResponse.Code"));<NEW_LINE>getSubscriptionItemDetailResponse.setMessage(_ctx.stringValue("GetSubscriptionItemDetailResponse.Message"));<NEW_LINE>SubscriptionItemDetail subscriptionItemDetail = new SubscriptionItemDetail();<NEW_LINE>subscriptionItemDetail.setDescription(_ctx.stringValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Description"));<NEW_LINE>subscriptionItemDetail.setSmsStatus(_ctx.integerValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.SmsStatus"));<NEW_LINE>subscriptionItemDetail.setChannel(_ctx.stringValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Channel"));<NEW_LINE>subscriptionItemDetail.setEmailStatus(_ctx.integerValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.EmailStatus"));<NEW_LINE>subscriptionItemDetail.setItemId(_ctx.integerValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.ItemId"));<NEW_LINE>subscriptionItemDetail.setPmsgStatus(_ctx.integerValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.PmsgStatus"));<NEW_LINE>subscriptionItemDetail.setWebhookStatus(_ctx.integerValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.WebhookStatus"));<NEW_LINE>subscriptionItemDetail.setItemName(_ctx.stringValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.ItemName"));<NEW_LINE>subscriptionItemDetail.setTtsStatus(_ctx.integerValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.TtsStatus"));<NEW_LINE>subscriptionItemDetail.setRegionId(_ctx.stringValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.RegionId"));<NEW_LINE>List<Contact> contacts = new ArrayList<Contact>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts.Length"); i++) {<NEW_LINE>Contact contact = new Contact();<NEW_LINE>contact.setLastMobileVerificationTimeStamp(_ctx.longValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].LastMobileVerificationTimeStamp"));<NEW_LINE>contact.setEmail(_ctx.stringValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].Email"));<NEW_LINE>contact.setPosition(_ctx.stringValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].Position"));<NEW_LINE>contact.setLastEmailVerificationTimeStamp(_ctx.longValue<MASK><NEW_LINE>contact.setContactId(_ctx.longValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].ContactId"));<NEW_LINE>contact.setAccountUID(_ctx.longValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].AccountUID"));<NEW_LINE>contact.setMobile(_ctx.stringValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].Mobile"));<NEW_LINE>contact.setName(_ctx.stringValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].Name"));<NEW_LINE>contact.setIsAccount(_ctx.booleanValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].IsAccount"));<NEW_LINE>contact.setIsVerifiedEmail(_ctx.booleanValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].IsVerifiedEmail"));<NEW_LINE>contact.setIsObsolete(_ctx.booleanValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].IsObsolete"));<NEW_LINE>contact.setIsVerifiedMobile(_ctx.booleanValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].IsVerifiedMobile"));<NEW_LINE>contacts.add(contact);<NEW_LINE>}<NEW_LINE>subscriptionItemDetail.setContacts(contacts);<NEW_LINE>List<Webhook> webhooks = new ArrayList<Webhook>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Webhooks.Length"); i++) {<NEW_LINE>Webhook webhook = new Webhook();<NEW_LINE>webhook.setWebhookId(_ctx.longValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Webhooks[" + i + "].WebhookId"));<NEW_LINE>webhook.setServerUrl(_ctx.stringValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Webhooks[" + i + "].ServerUrl"));<NEW_LINE>webhook.setName(_ctx.stringValue("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Webhooks[" + i + "].Name"));<NEW_LINE>webhooks.add(webhook);<NEW_LINE>}<NEW_LINE>subscriptionItemDetail.setWebhooks(webhooks);<NEW_LINE>getSubscriptionItemDetailResponse.setSubscriptionItemDetail(subscriptionItemDetail);<NEW_LINE>return getSubscriptionItemDetailResponse;<NEW_LINE>}
("GetSubscriptionItemDetailResponse.SubscriptionItemDetail.Contacts[" + i + "].LastEmailVerificationTimeStamp"));
251,067
public Map<String, String> updateSensorProperties(OwBaseBridgeHandler bridgeHandler) throws OwException {<NEW_LINE>Map<String, String> properties = new <MASK><NEW_LINE>OwPageBuffer pages = bridgeHandler.readPages(sensorId);<NEW_LINE>OwSensorType sensorType = OwSensorType.UNKNOWN;<NEW_LINE>try {<NEW_LINE>sensorType = OwSensorType.valueOf(new String(pages.getPage(0), 0, 7, StandardCharsets.US_ASCII));<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>}<NEW_LINE>if (!SUPPORTED_SENSOR_TYPES.contains(sensorType)) {<NEW_LINE>throw new OwException("sensorType not supported for EDSSensorThing");<NEW_LINE>}<NEW_LINE>int fwRevisionLow = pages.getByte(3, 3);<NEW_LINE>int fwRevisionHigh = pages.getByte(3, 4);<NEW_LINE>String fwRevision = String.format("%d.%d", fwRevisionHigh, fwRevisionLow);<NEW_LINE>properties.put(PROPERTY_MODELID, sensorType.name());<NEW_LINE>properties.put(PROPERTY_VENDOR, "Embedded Data Systems");<NEW_LINE>properties.put(PROPERTY_HW_REVISION, String.valueOf(fwRevision));<NEW_LINE>return properties;<NEW_LINE>}
HashMap<String, String>();
1,451,496
public void addDbmsDataSourceHandler(ConnectionPoolComponent connectionPoolComponent) {<NEW_LINE>final Function<Dbms, PoolableConnection> extractor = connectionPoolComponent::getConnection;<NEW_LINE>final Consumer<PoolableConnection> starter = wrapSqlException(c -> c.setAutoCommit(false), "setup connection");<NEW_LINE>final BiFunction<PoolableConnection, Isolation, Isolation> isolationConfigurator = (PoolableConnection c, Isolation newLevel) -> {<NEW_LINE>final int previousLevel;<NEW_LINE>try {<NEW_LINE>previousLevel = c.getTransactionIsolation();<NEW_LINE>c.<MASK><NEW_LINE>} catch (SQLException sqle) {<NEW_LINE>throw new TransactionException("Unable to get/set isolation level for a connection " + c, sqle);<NEW_LINE>}<NEW_LINE>return Isolation.fromSqlIsolationLevel(previousLevel);<NEW_LINE>};<NEW_LINE>final Consumer<PoolableConnection> committer = wrapSqlException(PoolableConnection::commit, "commit connection");<NEW_LINE>final Consumer<PoolableConnection> rollbacker = wrapSqlException(PoolableConnection::rollback, "rollback connection");<NEW_LINE>final Consumer<PoolableConnection> closer = wrapSqlException(c -> {<NEW_LINE>c.setAutoCommit(true);<NEW_LINE>c.close();<NEW_LINE>}, "close connection");<NEW_LINE>putDataSourceHandler(Dbms.class, DataSourceHandler.of(extractor, isolationConfigurator, starter, committer, rollbacker, closer));<NEW_LINE>}
setTransactionIsolation(newLevel.getSqlIsolationLevel());
784,224
protected static ArrayList<SubtitleItem> findSubtitlesByName(DLNAResource resource, String languageCodes, FileNamePrettifier prettifier) {<NEW_LINE>if (resource == null) {<NEW_LINE>return new ArrayList<>();<NEW_LINE>}<NEW_LINE>String fileName = null;<NEW_LINE>if (resource instanceof RealFile) {<NEW_LINE>File file = ((RealFile) resource).getFile();<NEW_LINE>if (file != null) {<NEW_LINE>fileName = file.getName();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (fileName == null) {<NEW_LINE>fileName = resource.getSystemName();<NEW_LINE>}<NEW_LINE>Array queryArray = new Array();<NEW_LINE>if (isNotBlank(fileName)) {<NEW_LINE>Struct queryStruct = new Struct();<NEW_LINE>queryStruct.put(new MemberString("tag", fileName));<NEW_LINE>if (isNotBlank(languageCodes)) {<NEW_LINE>queryStruct.put(new MemberString("sublanguageid", languageCodes));<NEW_LINE>}<NEW_LINE>if (prettifier != null && prettifier.getSeason() > 0 && prettifier.getEpisode() > 0) {<NEW_LINE>queryStruct.put(new MemberInt("season", prettifier.getSeason()));<NEW_LINE>queryStruct.put(new MemberInt("episode", prettifier.getEpisode()));<NEW_LINE>}<NEW_LINE>queryArray.add(new ValueStruct(queryStruct));<NEW_LINE>}<NEW_LINE>if (prettifier != null && isNotBlank(prettifier.getName())) {<NEW_LINE>Struct queryStruct = new Struct();<NEW_LINE>queryStruct.put(new MemberString("query", prettifier.getName()));<NEW_LINE>if (isNotBlank(languageCodes)) {<NEW_LINE>queryStruct.put(new MemberString("sublanguageid", languageCodes));<NEW_LINE>}<NEW_LINE>if (prettifier.getSeason() > 0 && prettifier.getEpisode() > 0) {<NEW_LINE>queryStruct.put(new MemberInt("season"<MASK><NEW_LINE>queryStruct.put(new MemberInt("episode", prettifier.getEpisode()));<NEW_LINE>}<NEW_LINE>queryArray.add(new ValueStruct(queryStruct));<NEW_LINE>}<NEW_LINE>return searchSubtitles(queryArray, resource, prettifier, "filename", fileName, -1);<NEW_LINE>}
, prettifier.getSeason()));
545,195
private void loadNode157() {<NEW_LINE>ServerCapabilitiesTypeNode node = new ServerCapabilitiesTypeNode(this.context, Identifiers.Server_ServerCapabilities, new QualifiedName(0, "ServerCapabilities"), new LocalizedText("en", "ServerCapabilities"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), UByte.valueOf(0));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerCapabilities, Identifiers.HasProperty, Identifiers.Server_ServerCapabilities_ServerProfileArray.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerCapabilities, Identifiers.HasProperty, Identifiers.Server_ServerCapabilities_LocaleIdArray.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerCapabilities, Identifiers.HasProperty, Identifiers.Server_ServerCapabilities_MinSupportedSampleRate.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerCapabilities, Identifiers.HasProperty, Identifiers.Server_ServerCapabilities_MaxBrowseContinuationPoints<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerCapabilities, Identifiers.HasProperty, Identifiers.Server_ServerCapabilities_MaxQueryContinuationPoints.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerCapabilities, Identifiers.HasProperty, Identifiers.Server_ServerCapabilities_MaxHistoryContinuationPoints.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerCapabilities, Identifiers.HasProperty, Identifiers.Server_ServerCapabilities_SoftwareCertificates.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerCapabilities, Identifiers.HasProperty, Identifiers.Server_ServerCapabilities_MaxArrayLength.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerCapabilities, Identifiers.HasProperty, Identifiers.Server_ServerCapabilities_MaxStringLength.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerCapabilities, Identifiers.HasProperty, Identifiers.Server_ServerCapabilities_MaxByteStringLength.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerCapabilities, Identifiers.HasComponent, Identifiers.Server_ServerCapabilities_OperationLimits.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerCapabilities, Identifiers.HasComponent, Identifiers.Server_ServerCapabilities_ModellingRules.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerCapabilities, Identifiers.HasComponent, Identifiers.Server_ServerCapabilities_AggregateFunctions.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerCapabilities, Identifiers.HasTypeDefinition, Identifiers.ServerCapabilitiesType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.Server_ServerCapabilities, Identifiers.HasComponent, Identifiers.Server.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
1,469,386
public static Object fromPropertyDescriptor(ExecutionContext context, Object d) {<NEW_LINE>// 8.10.4<NEW_LINE>if (d == Types.UNDEFINED) {<NEW_LINE>return Types.UNDEFINED;<NEW_LINE>}<NEW_LINE>final PropertyDescriptor desc = (PropertyDescriptor) d;<NEW_LINE>JSObject obj = new DynObject(context.getGlobalContext());<NEW_LINE>if (desc.isDataDescriptor()) {<NEW_LINE>obj.defineOwnProperty(context, "value", PropertyDescriptor.newDataPropertyDescriptor(desc.getValue(), true, true, true), false);<NEW_LINE>obj.defineOwnProperty(context, "writable", PropertyDescriptor.newDataPropertyDescriptor(desc.getWritable(), true, true, true), false);<NEW_LINE>} else {<NEW_LINE>obj.defineOwnProperty(context, "get", PropertyDescriptor.newDataPropertyDescriptor(desc.getGetter(), true, true, true), false);<NEW_LINE>obj.defineOwnProperty(context, "set", PropertyDescriptor.newDataPropertyDescriptor(desc.getSetter(), true, true, true), false);<NEW_LINE>}<NEW_LINE>obj.defineOwnProperty(context, "enumerable", PropertyDescriptor.newDataPropertyDescriptor(desc.getEnumerable(), true, true, true), false);<NEW_LINE>obj.defineOwnProperty(context, "configurable", PropertyDescriptor.newDataPropertyDescriptor(desc.getConfigurable(), true<MASK><NEW_LINE>return obj;<NEW_LINE>}
, true, true), false);
1,184,013
// ==== Dialog ====<NEW_LINE>public void showDialog(Node node) {<NEW_LINE>FXUtils.checkFxUserThread();<NEW_LINE>if (dialog == null) {<NEW_LINE>if (decorator.getDrawerWrapper() == null) {<NEW_LINE>// Sometimes showDialog will be invoked before decorator was initialized.<NEW_LINE>// Keep trying again.<NEW_LINE>Platform.runLater(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>dialog = new JFXDialog();<NEW_LINE>dialogPane = new StackContainerPane();<NEW_LINE>dialog.setContent(dialogPane);<NEW_LINE>decorator.capableDraggingWindow(dialog);<NEW_LINE>decorator.forbidDraggingWindow(dialogPane);<NEW_LINE>dialog.setDialogContainer(decorator.getDrawerWrapper());<NEW_LINE>dialog.setOverlayClose(false);<NEW_LINE>dialog.show();<NEW_LINE>navigator.setDisable(true);<NEW_LINE>}<NEW_LINE>dialogPane.push(node);<NEW_LINE>EventHandler<DialogCloseEvent> handler = event -> closeDialog(node);<NEW_LINE>node.getProperties().put(PROPERTY_DIALOG_CLOSE_HANDLER, handler);<NEW_LINE>node.addEventHandler(DialogCloseEvent.CLOSE, handler);<NEW_LINE>if (node instanceof DialogAware) {<NEW_LINE>DialogAware dialogAware = (DialogAware) node;<NEW_LINE>if (dialog.isVisible()) {<NEW_LINE>dialogAware.onDialogShown();<NEW_LINE>} else {<NEW_LINE>dialog.visibleProperty().addListener(new ChangeListener<Boolean>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {<NEW_LINE>if (newValue) {<NEW_LINE>dialogAware.onDialogShown();<NEW_LINE>observable.removeListener(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
() -> showDialog(node));
1,265,685
public boolean onSingleTapConfirmed(MotionEvent e) {<NEW_LINE>// create a point where the user tapped<NEW_LINE>android.graphics.Point point = new android.graphics.Point(Math.round(e.getX()), Math.round(e.getY()));<NEW_LINE>Point mapPoint = mMapView.screenToLocation(point);<NEW_LINE>if (addFacilityButton.isSelected()) {<NEW_LINE>// create facility from point and display to map view<NEW_LINE>addServicePoint(mapPoint, facilitySymbol, serviceAreaFacilities, facilityOverlay);<NEW_LINE>} else if (addBarrierButton.isSelected()) {<NEW_LINE>// create barrier and display to map view<NEW_LINE>mBarrierBuilder.addPoint(new Point(mapPoint.getX(), mapPoint.getY(), mMapView.getSpatialReference()));<NEW_LINE>barrierOverlay.getGraphics().add(barrierOverlay.getGraphics().size(), new Graphic(mBarrierBuilder<MASK><NEW_LINE>}<NEW_LINE>return super.onSingleTapConfirmed(e);<NEW_LINE>}
.toGeometry(), barrierLine));
526,438
public Result doWork() {<NEW_LINE>final var repo = NotesRepository.getInstance(getApplicationContext());<NEW_LINE>for (final var account : repo.getAccounts()) {<NEW_LINE>try {<NEW_LINE>final var ssoAccount = AccountImporter.getSingleSignOnAccount(getApplicationContext(), account.getAccountName());<NEW_LINE>Log.i(TAG, "Refreshing capabilities for " + ssoAccount.name);<NEW_LINE>final var capabilities = CapabilitiesClient.getCapabilities(getApplicationContext(), ssoAccount, account.getCapabilitiesETag(), ApiProvider.getInstance());<NEW_LINE>repo.updateCapabilitiesETag(account.getId(), capabilities.getETag());<NEW_LINE>repo.updateBrand(account.getId(), capabilities.getColor(), capabilities.getTextColor());<NEW_LINE>repo.updateApiVersion(account.getId(<MASK><NEW_LINE>Log.i(TAG, capabilities.toString());<NEW_LINE>repo.updateDisplayName(account.getId(), CapabilitiesClient.getDisplayName(getApplicationContext(), ssoAccount, ApiProvider.getInstance()));<NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (e instanceof NextcloudHttpRequestFailedException) {<NEW_LINE>if (((NextcloudHttpRequestFailedException) e).getStatusCode() == HttpURLConnection.HTTP_NOT_MODIFIED) {<NEW_LINE>Log.i(TAG, "Capabilities not modified.");<NEW_LINE>return Result.success();<NEW_LINE>} else if (((NextcloudHttpRequestFailedException) e).getStatusCode() == HttpURLConnection.HTTP_UNAVAILABLE) {<NEW_LINE>Log.i(TAG, "Server is in maintenance mode.");<NEW_LINE>return Result.success();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>e.printStackTrace();<NEW_LINE>return Result.failure();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Result.success();<NEW_LINE>}
), capabilities.getApiVersion());
233,397
public String startMinion(String minionStarterClassName, PinotConfiguration minionConf) throws Exception {<NEW_LINE>LOGGER.info("Trying to start Pinot Minion...");<NEW_LINE>if (!minionConf.containsKey(CommonConstants.Helix.CONFIG_OF_CLUSTER_NAME)) {<NEW_LINE>minionConf.setProperty(CommonConstants.Helix.CONFIG_OF_CLUSTER_NAME, _clusterName);<NEW_LINE>}<NEW_LINE>if (!minionConf.containsKey(CommonConstants.Helix.CONFIG_OF_ZOOKEEPR_SERVER)) {<NEW_LINE>minionConf.setProperty(CommonConstants.Helix.CONFIG_OF_ZOOKEEPR_SERVER, _zkAddress);<NEW_LINE>}<NEW_LINE>ServiceStartable minionStarter = getServiceStartable(minionStarterClassName);<NEW_LINE>minionStarter.init(minionConf);<NEW_LINE>minionStarter.start();<NEW_LINE>String instanceId = minionStarter.getInstanceId();<NEW_LINE>_runningInstanceMap.put(instanceId, minionStarter);<NEW_LINE><MASK><NEW_LINE>return instanceId;<NEW_LINE>}
LOGGER.info("Pinot Minion instance [{}] is Started...", instanceId);
1,601,711
private void initialize(AgentWorkContext agentWorkContext) {<NEW_LINE>JobIdentifier jobIdentifier = assignment.getJobIdentifier();<NEW_LINE>this.timeProvider = new TimeProvider();<NEW_LINE>agentWorkContext.getAgentRuntimeInfo().busy(new AgentBuildingInfo(jobIdentifier.buildLocatorForDisplay(), jobIdentifier.buildLocator()));<NEW_LINE>this.workingDirectory = assignment.getWorkingDirectory();<NEW_LINE>this.materialRevisions = assignment.materialRevisions();<NEW_LINE>this.goPublisher = new DefaultGoPublisher(agentWorkContext.getArtifactsManipulator(), jobIdentifier, agentWorkContext.getRepositoryRemote(), agentWorkContext.getAgentRuntimeInfo(), consoleLogCharset);<NEW_LINE>this.artifactsPublisher = new ArtifactsPublisher(goPublisher, agentWorkContext.getArtifactExtension(), assignment.getArtifactStores(), <MASK><NEW_LINE>this.builders = new Builders(assignment.getBuilders(), goPublisher, agentWorkContext.getTaskExtension(), agentWorkContext.getArtifactExtension(), agentWorkContext.getPluginRequestProcessorRegistry());<NEW_LINE>}
agentWorkContext.getPluginRequestProcessorRegistry(), workingDirectory);
179,274
public static JsonWebKey fromRsa(KeyPair keyPair) {<NEW_LINE>RSAPrivateCrtKey privateKey = <MASK><NEW_LINE>JsonWebKey key = null;<NEW_LINE>if (privateKey != null) {<NEW_LINE>key = new JsonWebKey().setKeyType(KeyType.RSA).setN(toByteArray(privateKey.getModulus())).setE(toByteArray(privateKey.getPublicExponent())).setD(toByteArray(privateKey.getPrivateExponent())).setP(toByteArray(privateKey.getPrimeP())).setQ(toByteArray(privateKey.getPrimeQ())).setDp(toByteArray(privateKey.getPrimeExponentP())).setDq(toByteArray(privateKey.getPrimeExponentQ())).setQi(toByteArray(privateKey.getCrtCoefficient()));<NEW_LINE>} else {<NEW_LINE>RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic();<NEW_LINE>key = new JsonWebKey().setKeyType(KeyType.RSA).setN(toByteArray(publicKey.getModulus())).setE(toByteArray(publicKey.getPublicExponent())).setD(null).setP(null).setQ(null).setDp(null).setDq(null).setQi(null);<NEW_LINE>}<NEW_LINE>return key;<NEW_LINE>}
(RSAPrivateCrtKey) keyPair.getPrivate();
664,996
Mono<Response<BlockBlobItem>> uploadFromUrlWithResponse(BlobUploadFromUrlOptions options, Context context) {<NEW_LINE>StorageImplUtils.assertNotNull("options", options);<NEW_LINE>BlobRequestConditions destinationRequestConditions = options.getDestinationRequestConditions() == null ? new BlobRequestConditions() : options.getDestinationRequestConditions();<NEW_LINE>BlobRequestConditions sourceRequestConditions = options.getSourceRequestConditions() == null ? new BlobRequestConditions() : options.getSourceRequestConditions();<NEW_LINE>context = context == null ? Context.NONE : context;<NEW_LINE>String sourceAuth = options.getSourceAuthorization() == null ? null : options.getSourceAuthorization().toString();<NEW_LINE>try {<NEW_LINE>new URL(options.getSourceUrl());<NEW_LINE>} catch (MalformedURLException ex) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException("'sourceUrl' is not a valid url.", ex));<NEW_LINE>}<NEW_LINE>// TODO (kasobol-msft) add metadata back (https://github.com/Azure/azure-sdk-for-net/issues/15969)<NEW_LINE>return this.azureBlobStorage.getBlockBlobs().putBlobFromUrlWithResponseAsync(containerName, blobName, 0, options.getSourceUrl(), null, null, null, destinationRequestConditions.getLeaseId(), options.getTier(), destinationRequestConditions.getIfModifiedSince(), destinationRequestConditions.getIfUnmodifiedSince(), destinationRequestConditions.getIfMatch(), destinationRequestConditions.getIfNoneMatch(), destinationRequestConditions.getTagsConditions(), sourceRequestConditions.getIfModifiedSince(), sourceRequestConditions.getIfUnmodifiedSince(), sourceRequestConditions.getIfMatch(), sourceRequestConditions.getIfNoneMatch(), sourceRequestConditions.getTagsConditions(), null, options.getContentMd5(), tagsToString(options.getTags()), options.isCopySourceBlobProperties(), sourceAuth, options.getCopySourceTags(), options.getHeaders(), getCustomerProvidedKey(), encryptionScope, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)).map(rb -> {<NEW_LINE>BlockBlobsPutBlobFromUrlHeaders hd = rb.getDeserializedHeaders();<NEW_LINE>BlockBlobItem item = new BlockBlobItem(hd.getETag(), hd.getLastModified(), hd.getContentMD5(), hd.isXMsRequestServerEncrypted(), hd.getXMsEncryptionKeySha256(), hd.getXMsEncryptionScope(<MASK><NEW_LINE>return new SimpleResponse<>(rb, item);<NEW_LINE>});<NEW_LINE>}
), hd.getXMsVersionId());
754,062
private void addStep(String path, long value) {<NEW_LINE>if (ongoingGpuProfiling && renderer != null) {<NEW_LINE>renderer.stopProfiling();<NEW_LINE>ongoingGpuProfiling = false;<NEW_LINE>}<NEW_LINE>if (prevPath != null) {<NEW_LINE>StatLine prevLine = data.get(prevPath);<NEW_LINE>if (prevLine != null) {<NEW_LINE>prevLine.setValueCpu(value - prevLine.getValueCpu());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>StatLine line = pool.get(path);<NEW_LINE>if (line == null) {<NEW_LINE>line = new StatLine(currentFrame);<NEW_LINE>pool.put(path, line);<NEW_LINE>}<NEW_LINE>data.put(path, line);<NEW_LINE>line.setNewFrameValueCpu(value);<NEW_LINE>if (renderer != null) {<NEW_LINE>int id = getUnusedTaskId();<NEW_LINE><MASK><NEW_LINE>renderer.startProfiling(id);<NEW_LINE>}<NEW_LINE>ongoingGpuProfiling = true;<NEW_LINE>prevPath = path;<NEW_LINE>}
line.taskIds.add(id);
1,159,961
protected Record rebalance(int id1, Record r1, int id2, Record r2) {<NEW_LINE>RecordBufferPageMgr mgr = bpt.getRecordsMgr().getRecordBufferPageMgr();<NEW_LINE>RecordBufferPage page1 = mgr.getWrite(id1);<NEW_LINE>RecordBufferPage <MASK><NEW_LINE>// Wrong calculation.<NEW_LINE>for (int i = page2.getCount(); i < page1.getMaxSize() / 2; i++) {<NEW_LINE>// shiftOneup(node1, node2) ;<NEW_LINE>Record r = page1.getRecordBuffer().getHigh();<NEW_LINE>page1.getRecordBuffer().removeTop();<NEW_LINE>page2.getRecordBuffer().add(0, r);<NEW_LINE>}<NEW_LINE>mgr.put(page1);<NEW_LINE>mgr.put(page2);<NEW_LINE>Record splitPoint = page1.getRecordBuffer().getHigh();<NEW_LINE>splitPoint = bpt.getRecordFactory().createKeyOnly(splitPoint);<NEW_LINE>// Record splitPoint = node1.maxRecord() ;<NEW_LINE>return splitPoint;<NEW_LINE>}
page2 = mgr.getWrite(id2);
1,106,798
public Boolean removeTranslationPageFromCache(final String uri, String localeCode, boolean isSecure) {<NEW_LINE>String cacheKey = buildBaseKey(uri, localeCode, isSecure);<NEW_LINE>List<String> cacheKeys = new ArrayList<>();<NEW_LINE>cacheKeys.add(cacheKey);<NEW_LINE>if (queryExtensionManager != null) {<NEW_LINE>ExtensionResultHolder<List<String>> response = new ExtensionResultHolder<List<String>>();<NEW_LINE>queryExtensionManager.getProxy().getCacheKeyListForTemplateSite(cacheKey, response);<NEW_LINE>cacheKeys = response.getResult();<NEW_LINE>}<NEW_LINE>for (String cKey : cacheKeys) {<NEW_LINE>// cacheKeys from the templateSites (extensionManager) are returned with a "templateSiteId:" prefix. Parsing those out to get just the child site keys<NEW_LINE>if (cKey.contains(":")) {<NEW_LINE>cKey = cKey.substring(cKey.indexOf(":") + 1);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
getPageCache().remove(cKey);
1,177,917
/*<NEW_LINE>* This method is called from invalidateAll for local invalidations.<NEW_LINE>*/<NEW_LINE>public void invalidate(String sessionId) {<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {<NEW_LINE>StringBuffer sb = new StringBuffer("for app ").append(_sap.getAppName()).append(" id ").append(sessionId);<NEW_LINE>LoggingUtil.SESSION_LOGGER_CORE.entering(methodClassName, methodNames[INVALIDATE], sb.toString());<NEW_LINE>}<NEW_LINE>ISession iSess = _coreHttpSessionManager.getISession(sessionId);<NEW_LINE>if (iSess != null) {<NEW_LINE>IStore iStore = _coreHttpSessionManager.getIStore();<NEW_LINE>try {<NEW_LINE>iStore.setThreadContext();<NEW_LINE>synchronized (iSess) {<NEW_LINE>// START PM47941<NEW_LINE>if (iSess.isValid()) {<NEW_LINE>iSess.invalidate();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// END PM47941<NEW_LINE>} finally {<NEW_LINE>iStore.unsetThreadContext();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {<NEW_LINE>LoggingUtil.SESSION_LOGGER_CORE.exiting<MASK><NEW_LINE>}<NEW_LINE>}
(methodClassName, methodNames[INVALIDATE]);
1,558
public BaseMethodBinding<?> determineResourceMethod(RequestDetails requestDetails, String requestPath) {<NEW_LINE>RequestTypeEnum requestType = requestDetails.getRequestType();<NEW_LINE>ResourceBinding resourceBinding = null;<NEW_LINE>BaseMethodBinding<?> resourceMethod = null;<NEW_LINE>String resourceName = requestDetails.getResourceName();<NEW_LINE>if (myServerConformanceMethod.incomingServerRequestMatchesMethod(requestDetails) != MethodMatchEnum.NONE) {<NEW_LINE>resourceMethod = myServerConformanceMethod;<NEW_LINE>} else if (resourceName == null) {<NEW_LINE>resourceBinding = myServerBinding;<NEW_LINE>} else {<NEW_LINE>resourceBinding = myResourceNameToBinding.get(resourceName);<NEW_LINE>if (resourceBinding == null) {<NEW_LINE>throwUnknownResourceTypeException(resourceName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (resourceMethod == null) {<NEW_LINE>if (resourceBinding != null) {<NEW_LINE>resourceMethod = resourceBinding.getMethod(requestDetails);<NEW_LINE>}<NEW_LINE>if (resourceMethod == null) {<NEW_LINE>resourceMethod = myGlobalBinding.getMethod(requestDetails);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (resourceMethod == null) {<NEW_LINE>if (isBlank(requestPath)) {<NEW_LINE>throw new InvalidRequestException(Msg.code(287) + myFhirContext.getLocalizer().getMessage(RestfulServer.class, "rootRequest"));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return resourceMethod;<NEW_LINE>}
throwUnknownFhirOperationException(requestDetails, requestPath, requestType);
1,349,270
public static FileObject resolveFileObjectForClass(FileObject referenceFileObject, final String className) throws IOException {<NEW_LINE>final FileObject[] result = new FileObject[1];<NEW_LINE>JavaSource <MASK><NEW_LINE>if (javaSource == null) {<NEW_LINE>// Should not happen, at least some debug logging, see i.e. issue #202495.<NEW_LINE>Logger.getLogger(_RetoucheUtil.class.getName()).log(Level.SEVERE, "JavaSource not created for FileObject: path={0}, valid={1}, mime-type={2}", new Object[] { referenceFileObject.getPath(), referenceFileObject.isValid(), referenceFileObject.getMIMEType() });<NEW_LINE>}<NEW_LINE>javaSource.runUserActionTask(new Task<CompilationController>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(CompilationController controller) throws IOException {<NEW_LINE>controller.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED);<NEW_LINE>TypeElement typeElement = controller.getElements().getTypeElement(className);<NEW_LINE>if (typeElement != null) {<NEW_LINE>result[0] = org.netbeans.api.java.source.SourceUtils.getFile(ElementHandle.create(typeElement), controller.getClasspathInfo());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, true);<NEW_LINE>return result[0];<NEW_LINE>}
javaSource = JavaSource.forFileObject(referenceFileObject);
1,278,582
public final /*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see SimplifiedSerialization.writeObject(java.io.DataInputStream)<NEW_LINE>*/<NEW_LINE>void writeObject(java.io.DataOutputStream dataOutputStream) throws ObjectManagerException {<NEW_LINE>if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())<NEW_LINE>trace.entry(this, cclass, "writeObject", "dataOutputStream=" + dataOutputStream);<NEW_LINE>try {<NEW_LINE>dataOutputStream.writeByte(SimpleSerialVersion);<NEW_LINE>super.writeObject(dataOutputStream);<NEW_LINE>dataOutputStream.writeInt(activeSubListCount);<NEW_LINE>for (int i = 0; i < subListTokens.length; i++) {<NEW_LINE>subListTokens[i].writeObject(dataOutputStream);<NEW_LINE>}<NEW_LINE>// for subLists.<NEW_LINE>} catch (java.io.IOException exception) {<NEW_LINE>// No FFDC Code Needed.<NEW_LINE>ObjectManager.ffdc.processException(this, <MASK><NEW_LINE>if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())<NEW_LINE>trace.exit(this, cclass, "writeObject", "via PermanentIOException");<NEW_LINE>throw new PermanentIOException(this, exception);<NEW_LINE>}<NEW_LINE>// catch (java.io.IOException exception).<NEW_LINE>if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())<NEW_LINE>trace.exit(this, cclass, "writeObject");<NEW_LINE>}
cclass, "writeObject", exception, "1:1229:1.26");
121,607
public void ldc(TypeBinding typeBinding) {<NEW_LINE>this.countLabels = 0;<NEW_LINE>int index = this.constantPool.literalIndexForType(typeBinding);<NEW_LINE>this.stackDepth++;<NEW_LINE>pushTypeBinding(typeBinding);<NEW_LINE>if (this.stackDepth > this.stackMax)<NEW_LINE>this.stackMax = this.stackDepth;<NEW_LINE>if (index > 255) {<NEW_LINE>// Generate a ldc_w<NEW_LINE>if (this.classFileOffset + 2 >= this.bCodeStream.length) {<NEW_LINE>resizeByteArray();<NEW_LINE>}<NEW_LINE>this.position++;<NEW_LINE>this.bCodeStream[this.classFileOffset++] = Opcodes.OPC_ldc_w;<NEW_LINE>writeUnsignedShort(index);<NEW_LINE>} else {<NEW_LINE>// Generate a ldc<NEW_LINE>if (this.classFileOffset + 1 >= this.bCodeStream.length) {<NEW_LINE>resizeByteArray();<NEW_LINE>}<NEW_LINE>this.position += 2;<NEW_LINE>this.bCodeStream[this.classFileOffset++] = Opcodes.OPC_ldc;<NEW_LINE>this.bCodeStream[this.<MASK><NEW_LINE>}<NEW_LINE>}
classFileOffset++] = (byte) index;
129,562
protected void addBookmark(int level, String title, int x, int y) {<NEW_LINE>Bookmark parent = bookmarkStack.peek();<NEW_LINE>// searching for parent<NEW_LINE>while (parent.level >= level) {<NEW_LINE>bookmarkStack.pop();<NEW_LINE>parent = bookmarkStack.peek();<NEW_LINE>}<NEW_LINE>if (!getCurrentItemConfiguration().isCollapseMissingBookmarkLevels()) {<NEW_LINE>// creating empty bookmarks in order to preserve the bookmark level<NEW_LINE>for (int i = parent.level + 1; i < level; ++i) {<NEW_LINE>Bookmark emptyBookmark <MASK><NEW_LINE>bookmarkStack.push(emptyBookmark);<NEW_LINE>parent = emptyBookmark;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int height = OrientationEnum.PORTRAIT.equals(pageFormat.getOrientation()) ? pageFormat.getPageHeight() - y : y;<NEW_LINE>Bookmark bookmark = new Bookmark(parent, x, height, title);<NEW_LINE>bookmarkStack.push(bookmark);<NEW_LINE>}
= new Bookmark(parent, EMPTY_BOOKMARK_TITLE);
1,840,177
protected void renderBg(PoseStack transform, float f, int mx, int my) {<NEW_LINE>RenderSystem.enableBlend();<NEW_LINE>ClientUtils.bindTexture(TEXTURE);<NEW_LINE>this.blit(transform, leftPos, topPos, <MASK><NEW_LINE>RenderSystem.disableBlend();<NEW_LINE>GuiHelper.handleGuiTank(transform, tile.tank, leftPos + 8, topPos + 8, 16, 47, 176, 30, 20, 51, mx, my, TEXTURE, null);<NEW_LINE>int stored = (int) (46 * (tile.fertilizerAmount / (float) IEServerConfig.MACHINES.cloche_fertilizer.get()));<NEW_LINE>fillGradient(transform, leftPos + 30, topPos + 22 + (46 - stored), leftPos + 37, topPos + 68, 0xff95ed00, 0xff8a5a00);<NEW_LINE>stored = (int) (46 * (tile.getEnergyStored(null) / (float) tile.getMaxEnergyStored(null)));<NEW_LINE>fillGradient(transform, leftPos + 158, topPos + 22 + (46 - stored), leftPos + 165, topPos + 68, 0xffb51500, 0xff600b00);<NEW_LINE>}
0, 0, imageWidth, imageHeight);
1,766,433
private void reloadField(Object component, IssueField field) {<NEW_LINE>String newValue;<NEW_LINE>if (component instanceof JList) {<NEW_LINE>newValue = mergeValues(issue.getFieldValues(field));<NEW_LINE>} else {<NEW_LINE>newValue = issue.getFieldValue(field);<NEW_LINE>}<NEW_LINE>boolean fieldDirty = unsavedFields.contains(field.getKey());<NEW_LINE>if (!fieldDirty) {<NEW_LINE>if (component instanceof JComboBox) {<NEW_LINE>JComboBox combo = (JComboBox) component;<NEW_LINE>selectInCombo(combo, newValue, true);<NEW_LINE>} else if (component instanceof JTextComponent) {<NEW_LINE>((JTextComponent<MASK><NEW_LINE>} else if (component instanceof JList) {<NEW_LINE>JList list = (JList) component;<NEW_LINE>list.clearSelection();<NEW_LINE>ListModel model = list.getModel();<NEW_LINE>for (String value : issue.getFieldValues(field)) {<NEW_LINE>for (int i = 0; i < model.getSize(); i++) {<NEW_LINE>if (value.equals(model.getElementAt(i))) {<NEW_LINE>list.addSelectionInterval(i, i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (component instanceof JCheckBox) {<NEW_LINE>((JCheckBox) component).setSelected("1".equals(newValue));<NEW_LINE>} else if (component instanceof IDEServices.DatePickerComponent) {<NEW_LINE>IDEServices.DatePickerComponent picker = (IDEServices.DatePickerComponent) component;<NEW_LINE>try {<NEW_LINE>picker.setDate(BugzillaIssue.DUE_DATE_FORMAT.parse(newValue));<NEW_LINE>} catch (ParseException ex) {<NEW_LINE>picker.setDate(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
) component).setText(newValue);
1,218,753
public void execute(CommandLine commandLine, Options options, RPCHook rpcHook) throws SubCommandException {<NEW_LINE>DefaultMQAdminExt defaultMQAdminExt = new DefaultMQAdminExt(rpcHook);<NEW_LINE>defaultMQAdminExt.setInstanceName(Long.toString(System.currentTimeMillis()));<NEW_LINE>try {<NEW_LINE>String clusterName = commandLine.getOptionValue('c').trim();<NEW_LINE>String filePath = !commandLine.hasOption('f') ? "/tmp/rocketmq/export" : commandLine.getOptionValue('f').trim();<NEW_LINE>defaultMQAdminExt.start();<NEW_LINE>Map<String, Object> result = new HashMap<>();<NEW_LINE>// name servers<NEW_LINE>List<String> nameServerAddressList = defaultMQAdminExt.getNameServerAddressList();<NEW_LINE>// broker<NEW_LINE>int masterBrokerSize = 0;<NEW_LINE>int slaveBrokerSize = 0;<NEW_LINE>Map<String, Properties> brokerConfigs = new HashMap<>();<NEW_LINE>Map<String, List<String>> masterAndSlaveMap = CommandUtil.fetchMasterAndSlaveDistinguish(defaultMQAdminExt, clusterName);<NEW_LINE>for (Entry<String, List<String>> masterAndSlaveEntry : masterAndSlaveMap.entrySet()) {<NEW_LINE>Properties masterProperties = defaultMQAdminExt.getBrokerConfig(masterAndSlaveEntry.getKey());<NEW_LINE>masterBrokerSize++;<NEW_LINE>slaveBrokerSize += masterAndSlaveEntry.getValue().size();<NEW_LINE>brokerConfigs.put(masterProperties.getProperty("brokerName"), needBrokerProprties(masterProperties));<NEW_LINE>}<NEW_LINE>Map<String, Integer> clusterScaleMap = new HashMap<>();<NEW_LINE>clusterScaleMap.put("namesrvSize", nameServerAddressList.size());<NEW_LINE>clusterScaleMap.put("masterBrokerSize", masterBrokerSize);<NEW_LINE><MASK><NEW_LINE>result.put("brokerConfigs", brokerConfigs);<NEW_LINE>result.put("clusterScale", clusterScaleMap);<NEW_LINE>String path = filePath + "/configs.json";<NEW_LINE>MixAll.string2FileNotSafe(JSON.toJSONString(result, true), path);<NEW_LINE>System.out.printf("export %s success", path);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SubCommandException(this.getClass().getSimpleName() + " command failed", e);<NEW_LINE>} finally {<NEW_LINE>defaultMQAdminExt.shutdown();<NEW_LINE>}<NEW_LINE>}
clusterScaleMap.put("slaveBrokerSize", slaveBrokerSize);
261,026
public String serialize(int numberOfSpacesToIndent, HttpResponse httpResponse) {<NEW_LINE>StringBuffer output = new StringBuffer();<NEW_LINE>if (httpResponse != null) {<NEW_LINE>appendNewLineAndIndent(numberOfSpacesToIndent * INDENT_SIZE, output).append("response()");<NEW_LINE>if (httpResponse.getStatusCode() != null) {<NEW_LINE>appendNewLineAndIndent((numberOfSpacesToIndent + 1) * INDENT_SIZE, output).append(".withStatusCode(").append(httpResponse.getStatusCode()).append(")");<NEW_LINE>}<NEW_LINE>if (httpResponse.getReasonPhrase() != null) {<NEW_LINE>appendNewLineAndIndent((numberOfSpacesToIndent + 1) * INDENT_SIZE, output).append(".withReasonPhrase(\"").append(StringEscapeUtils.escapeJava(httpResponse.getReasonPhrase())).append("\")");<NEW_LINE>}<NEW_LINE>outputHeaders(numberOfSpacesToIndent + 1, output, httpResponse.getHeaderList());<NEW_LINE>outputCookies(numberOfSpacesToIndent + 1, output, httpResponse.getCookieList());<NEW_LINE>if (isNotBlank(httpResponse.getBodyAsString())) {<NEW_LINE>if (httpResponse.getBody() instanceof BinaryBody) {<NEW_LINE>appendNewLineAndIndent((numberOfSpacesToIndent + 1) * INDENT_SIZE, output);<NEW_LINE>BinaryBody body = (BinaryBody) httpResponse.getBody();<NEW_LINE>output.append(".withBody(new Base64Converter().base64StringToBytes(\"").append(base64Converter.bytesToBase64String(body.getRawBytes(<MASK><NEW_LINE>} else {<NEW_LINE>appendNewLineAndIndent((numberOfSpacesToIndent + 1) * INDENT_SIZE, output).append(".withBody(\"").append(StringEscapeUtils.escapeJava(httpResponse.getBodyAsString())).append("\")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (httpResponse.getDelay() != null) {<NEW_LINE>appendNewLineAndIndent((numberOfSpacesToIndent + 1) * INDENT_SIZE, output).append(".withDelay(").append(new DelayToJavaSerializer().serialize(0, httpResponse.getDelay())).append(")");<NEW_LINE>}<NEW_LINE>if (httpResponse.getConnectionOptions() != null) {<NEW_LINE>appendNewLineAndIndent((numberOfSpacesToIndent + 1) * INDENT_SIZE, output).append(".withConnectionOptions(");<NEW_LINE>output.append(new ConnectionOptionsToJavaSerializer().serialize(numberOfSpacesToIndent + 2, httpResponse.getConnectionOptions()));<NEW_LINE>appendNewLineAndIndent((numberOfSpacesToIndent + 1) * INDENT_SIZE, output).append(")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return output.toString();<NEW_LINE>}
))).append("\"))");
1,766,178
public final <X> P8<A, X, C, D, E, F, G, H> map2(final fj.F<B, X> f) {<NEW_LINE>return new P8<A, X, C, D, E, F, G, H>() {<NEW_LINE><NEW_LINE>public A _1() {<NEW_LINE>return P8.this._1();<NEW_LINE>}<NEW_LINE><NEW_LINE>public X _2() {<NEW_LINE>return f.f(P8.this._2());<NEW_LINE>}<NEW_LINE><NEW_LINE>public C _3() {<NEW_LINE>return P8.this._3();<NEW_LINE>}<NEW_LINE><NEW_LINE>public D _4() {<NEW_LINE>return P8.this._4();<NEW_LINE>}<NEW_LINE><NEW_LINE>public E _5() {<NEW_LINE>return P8.this._5();<NEW_LINE>}<NEW_LINE><NEW_LINE>public F _6() {<NEW_LINE>return P8.this._6();<NEW_LINE>}<NEW_LINE><NEW_LINE>public G _7() {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>public H _8() {<NEW_LINE>return P8.this._8();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
return P8.this._7();
1,437,800
protected double computeWeightedOrientation(int c_x, int c_y) {<NEW_LINE>computeAngles();<NEW_LINE>double windowRadius = windowSize / 2.0;<NEW_LINE>int w = rect.x1 - rect.x0;<NEW_LINE>double bestScore = -1;<NEW_LINE>double bestAngle = 0;<NEW_LINE>double stepAngle = Math.PI * 2.0 / numAngles;<NEW_LINE>int N = w * (rect.y1 - rect.y0);<NEW_LINE>for (double angle = -Math.PI; angle < Math.PI; angle += stepAngle) {<NEW_LINE>double dx = 0;<NEW_LINE>double dy = 0;<NEW_LINE>for (int i = 0; i < N; i++) {<NEW_LINE>double diff = UtilAngle.dist(angle, angles[i]);<NEW_LINE>if (diff <= windowRadius) {<NEW_LINE>int localX = i % w;<NEW_LINE>int localY = i / w;<NEW_LINE>double ww = weights.get(localX, localY);<NEW_LINE>int x = rect.x0 + i % w;<NEW_LINE>int y = rect.y0 + i / w;<NEW_LINE>dx += ww * derivX.get(x, y);<NEW_LINE>dy += ww * <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>double n = dx * dx + dy * dy;<NEW_LINE>if (n > bestScore) {<NEW_LINE>bestAngle = Math.atan2(dy, dx);<NEW_LINE>bestScore = n;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return bestAngle;<NEW_LINE>}
derivY.get(x, y);
86,519
private <T extends Annotation> void inspect(Object handler, Method method, Class<T> annotationType, Class<? extends RepositoryEvent> eventType) {<NEW_LINE>T annotation = AnnotationUtils.findAnnotation(method, annotationType);<NEW_LINE>if (annotation == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (method.getParameterCount() == 0) {<NEW_LINE>throw new IllegalStateException(String.format(PARAMETER_MISSING, method));<NEW_LINE>}<NEW_LINE>ResolvableType parameter = ResolvableType.forMethodParameter(method, 0, handler.getClass());<NEW_LINE>EventHandlerMethod handlerMethod = EventHandlerMethod.of(parameter.resolve(), handler, method);<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Annotated handler method found: {}", handlerMethod);<NEW_LINE>}<NEW_LINE>List<EventHandlerMethod> <MASK><NEW_LINE>if (events == null) {<NEW_LINE>events = new ArrayList<EventHandlerMethod>();<NEW_LINE>}<NEW_LINE>if (events.isEmpty()) {<NEW_LINE>handlerMethods.add(eventType, handlerMethod);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>events.add(handlerMethod);<NEW_LINE>Collections.sort(events);<NEW_LINE>handlerMethods.put(eventType, events);<NEW_LINE>}
events = handlerMethods.get(eventType);
870,884
private JSONObject findProperty(final JSONObject parent, final String name) {<NEW_LINE>JSONArray properties = getJSONArrayProperty(parent, PROPERTIES);<NEW_LINE>if (properties != null) {<NEW_LINE>for (Object propertyTmp : properties) {<NEW_LINE>JSONObject property = (JSONObject) propertyTmp;<NEW_LINE>String <MASK><NEW_LINE>if (propertyName != null && propertyName.equals(name)) {<NEW_LINE>return property;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>properties = getJSONArrayProperty(parent, METHODS);<NEW_LINE>if (properties != null) {<NEW_LINE>for (Object propertyTmp : properties) {<NEW_LINE>JSONObject property = (JSONObject) propertyTmp;<NEW_LINE>String propertyName = getJSONStringProperty(property, NAME);<NEW_LINE>if (propertyName != null && propertyName.equals(name)) {<NEW_LINE>return property;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>properties = getJSONArrayProperty(parent, CLASSES);<NEW_LINE>if (properties != null) {<NEW_LINE>String className = getJSONStringProperty(parent, NAME) + '.' + name;<NEW_LINE>for (Object propertyTmp : properties) {<NEW_LINE>JSONObject property = (JSONObject) propertyTmp;<NEW_LINE>String propertyName = getJSONStringProperty(property, NAME);<NEW_LINE>if (propertyName != null && (propertyName.equals(className) || propertyName.equals(name))) {<NEW_LINE>return property;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
propertyName = getJSONStringProperty(property, NAME);
583,906
public void run() {<NEW_LINE>try {<NEW_LINE>if (mPokemonGo != null && NianticManager.this.currentBatchCall == myCurrentBatch) {<NEW_LINE>Thread.sleep(133);<NEW_LINE>mPokemonGo.setLocation(latitude, longitude, alt);<NEW_LINE>Thread.sleep(133);<NEW_LINE>Collection<FortDataOuterClass.FortData> gyms = mPokemonGo.getMap().getMapObjects().getGyms();<NEW_LINE>if (NianticManager.this.currentBatchCall == myCurrentBatch)<NEW_LINE>EventBus.getDefault().post(new GymsEvent(gyms, latitude, longitude));<NEW_LINE>}<NEW_LINE>} catch (LoginFailedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>Log.e(TAG, <MASK><NEW_LINE>EventBus.getDefault().post(new LoginEventResult(false, null, null));<NEW_LINE>} catch (RemoteServerException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>Log.e(TAG, "Failed to fetch map information via getGyms(). Remote server unreachable. Raised: " + e.getMessage());<NEW_LINE>EventBus.getDefault().post(new ServerUnreachableEvent(e));<NEW_LINE>} catch (InterruptedException | RuntimeException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>Log.e(TAG, "Failed to fetch map information via getGyms(). PoGoAPI crashed. Raised: " + e.getMessage());<NEW_LINE>EventBus.getDefault().post(new InternalExceptionEvent(e));<NEW_LINE>}<NEW_LINE>}
"Failed to fetch map information via getGyms(). Login credentials wrong or user banned. Raised: " + e.getMessage());
626,487
public void invoke(@Nonnull Project project, Editor editor, PsiFile file, DataContext dataContext) {<NEW_LINE>int offset = editor.getCaretModel().getOffset();<NEW_LINE>editor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE);<NEW_LINE>PsiElement element = file.findElementAt(offset);<NEW_LINE>while (true) {<NEW_LINE>if (element == null) {<NEW_LINE>String message = RefactoringBundle.getCannotRefactorMessage(RefactoringBundle.message("the.caret.should.be.positioned.at.the.class.method.or.field.to.be.refactored"));<NEW_LINE>CommonRefactoringUtil.showErrorHint(project, editor, message, REFACTORING_NAME, null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (tryToMoveElement(element, project, dataContext, null, editor)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>if (range != null) {<NEW_LINE>int relative = offset - range.getStartOffset();<NEW_LINE>final PsiReference reference = element.findReferenceAt(relative);<NEW_LINE>if (reference != null) {<NEW_LINE>final PsiElement refElement = reference.resolve();<NEW_LINE>if (refElement != null && tryToMoveElement(refElement, project, dataContext, reference, editor))<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>element = element.getParent();<NEW_LINE>}<NEW_LINE>}
TextRange range = element.getTextRange();
172,544
public ArrangementSettings deserialize(@Nonnull Element element) {<NEW_LINE>final Set<StdArrangementRuleAliasToken> tokensDefinition = deserializeTokensDefinition(element, myDefaultSettings);<NEW_LINE>final List<ArrangementGroupingRule> groupingRules = deserializeGropings(element, myDefaultSettings);<NEW_LINE>final Element rulesElement = element.getChild(RULES_ELEMENT_NAME);<NEW_LINE>final List<ArrangementSectionRule> sectionRules = ContainerUtil.newArrayList();<NEW_LINE>if (rulesElement == null) {<NEW_LINE>sectionRules.addAll(myDefaultSettings.getSections());<NEW_LINE>} else {<NEW_LINE>sectionRules.addAll(deserializeSectionRules(rulesElement, tokensDefinition));<NEW_LINE>if (sectionRules.isEmpty()) {<NEW_LINE>// for backward compatibility<NEW_LINE>final List<StdArrangementMatchRule> rules = deserializeRules(rulesElement, tokensDefinition);<NEW_LINE>return StdArrangementSettings.createByMatchRules(groupingRules, rules);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tokensDefinition == null) {<NEW_LINE>return new StdArrangementSettings(groupingRules, sectionRules);<NEW_LINE>}<NEW_LINE>return new <MASK><NEW_LINE>}
StdArrangementExtendableSettings(groupingRules, sectionRules, tokensDefinition);
1,753,749
public static byte[] ecdsaDer2Ieee(byte[] der, int ieeeLength) throws GeneralSecurityException {<NEW_LINE>if (!isValidDerEncoding(der)) {<NEW_LINE>throw new GeneralSecurityException("Invalid DER encoding");<NEW_LINE>}<NEW_LINE>byte[] ieee = new byte[ieeeLength];<NEW_LINE>int length = der[1] & 0xff;<NEW_LINE>int offset = 1 + /* 0x30 */<NEW_LINE>1;<NEW_LINE>if (length >= 128) {<NEW_LINE>// Long form length<NEW_LINE>offset++;<NEW_LINE>}<NEW_LINE>// 0x02<NEW_LINE>offset++;<NEW_LINE>int rLength = der[offset++];<NEW_LINE>int extraZero = 0;<NEW_LINE>if (der[offset] == 0) {<NEW_LINE>extraZero = 1;<NEW_LINE>}<NEW_LINE>System.arraycopy(der, offset + extraZero, ieee, ieeeLength / 2 - <MASK><NEW_LINE>offset += rLength + /* r byte array */<NEW_LINE>1;<NEW_LINE>int sLength = der[offset++];<NEW_LINE>extraZero = 0;<NEW_LINE>if (der[offset] == 0) {<NEW_LINE>extraZero = 1;<NEW_LINE>}<NEW_LINE>System.arraycopy(der, offset + extraZero, ieee, ieeeLength - sLength + extraZero, sLength - extraZero);<NEW_LINE>return ieee;<NEW_LINE>}
rLength + extraZero, rLength - extraZero);
121,352
private void buildDialog(boolean wasException) {<NEW_LINE>try {<NEW_LINE>final AlertDialog.Builder b = new AlertDialog.Builder(MultiredditOverview.this).setCancelable(false).setOnDismissListener(dialog -> finish());<NEW_LINE>if (wasException) {<NEW_LINE>b.setTitle(R.string.err_title).setMessage(R.string.err_loading_content).setPositiveButton(R.string.btn_ok, (dialog, which) -> finish());<NEW_LINE>} else if (profile.isEmpty()) {<NEW_LINE>b.setTitle(R.string.multireddit_err_title).setMessage(R.string.multireddit_err_msg).setPositiveButton(R.string.btn_yes, (dialog, which) -> {<NEW_LINE>Intent i = new Intent(MultiredditOverview.this, CreateMulti.class);<NEW_LINE>startActivity(i);<NEW_LINE>}).setNegativeButton(R.string.btn_no, (dialog<MASK><NEW_LINE>} else {<NEW_LINE>b.setTitle(R.string.public_multireddit_err_title).setMessage(R.string.public_multireddit_err_msg).setNegativeButton(R.string.btn_go_back, (dialog, which) -> finish());<NEW_LINE>}<NEW_LINE>b.show();<NEW_LINE>} catch (Exception e) {<NEW_LINE>}<NEW_LINE>}
, which) -> finish());
1,341,235
private void collectPlatformProperties(ApplicationModelBuilder appBuilder, List<Dependency> managedDeps) throws AppModelResolverException {<NEW_LINE>final PlatformImportsImpl platformReleases = new PlatformImportsImpl();<NEW_LINE>for (Dependency d : managedDeps) {<NEW_LINE>final Artifact artifact = d.getArtifact();<NEW_LINE>final String extension = artifact.getExtension();<NEW_LINE>final String artifactId = artifact.getArtifactId();<NEW_LINE>if ("json".equals(extension) && artifactId.endsWith(BootstrapConstants.PLATFORM_DESCRIPTOR_ARTIFACT_ID_SUFFIX)) {<NEW_LINE>platformReleases.addPlatformDescriptor(artifact.getGroupId(), artifactId, artifact.getClassifier(), <MASK><NEW_LINE>} else if ("properties".equals(artifact.getExtension()) && artifactId.endsWith(BootstrapConstants.PLATFORM_PROPERTIES_ARTIFACT_ID_SUFFIX)) {<NEW_LINE>platformReleases.addPlatformProperties(artifact.getGroupId(), artifactId, artifact.getClassifier(), extension, artifact.getVersion(), mvn.resolve(artifact).getArtifact().getFile().toPath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>appBuilder.setPlatformImports(platformReleases);<NEW_LINE>}
extension, artifact.getVersion());
1,128,935
private Flux<AsyncPollResponse<T, U>> pollingLoop(PollingContext<T> pollingContext) {<NEW_LINE>return // Create a Polling Context per subscription<NEW_LINE>Flux.// Create a Polling Context per subscription<NEW_LINE>using(// Do polling<NEW_LINE>() -> pollingContext, // set|read to|from context as needed, reactor guarantee thread-safety of cxt object.<NEW_LINE>cxt -> Mono.defer(() -> pollOperation.apply(cxt)).delaySubscription(getDelay(cxt.getLatestResponse())).switchIfEmpty(Mono.error(() -> new IllegalStateException("PollOperation returned Mono.empty()."))).repeat().takeUntil(currentPollResponse -> currentPollResponse.getStatus().isComplete()).concatMap(currentPollResponse -> {<NEW_LINE>cxt.setLatestResponse(currentPollResponse);<NEW_LINE>return Mono.just(new AsyncPollResponse<>(cxt, this<MASK><NEW_LINE>}), cxt -> {<NEW_LINE>});<NEW_LINE>}
.cancelOperation, this.fetchResultOperation));
381,412
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see com.digitalpebble.stormcrawler.persistence.Scheduler#schedule(com.<NEW_LINE>* digitalpebble. stormcrawler.persistence .Status,<NEW_LINE>* com.digitalpebble.stormcrawler.Metadata)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public Optional<Date> schedule(Status status, Metadata metadata) {<NEW_LINE>int minutesIncrement = 0;<NEW_LINE>Optional<Integer> customInterval = Optional.empty();<NEW_LINE>// try with a value set in the metadata<NEW_LINE>String customInMetadata = metadata.getFirstValue(DELAY_METADATA);<NEW_LINE>if (customInMetadata != null) {<NEW_LINE>customInterval = Optional.of(Integer.parseInt(customInMetadata));<NEW_LINE>}<NEW_LINE>// try with the rules from the configuration<NEW_LINE>if (!customInterval.isPresent()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (customInterval.isPresent()) {<NEW_LINE>minutesIncrement = customInterval.get();<NEW_LINE>} else {<NEW_LINE>switch(status) {<NEW_LINE>case FETCHED:<NEW_LINE>minutesIncrement = defaultfetchInterval;<NEW_LINE>break;<NEW_LINE>case FETCH_ERROR:<NEW_LINE>minutesIncrement = fetchErrorFetchInterval;<NEW_LINE>break;<NEW_LINE>case ERROR:<NEW_LINE>minutesIncrement = errorFetchInterval;<NEW_LINE>break;<NEW_LINE>case REDIRECTION:<NEW_LINE>minutesIncrement = defaultfetchInterval;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// a value of -1 means never fetch<NEW_LINE>// we return null<NEW_LINE>if (minutesIncrement == -1) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>Calendar cal = Calendar.getInstance();<NEW_LINE>cal.add(Calendar.MINUTE, minutesIncrement);<NEW_LINE>return Optional.of(cal.getTime());<NEW_LINE>}
customInterval = checkCustomInterval(metadata, status);
1,344,741
public static void square(long[] x, long[] z) {<NEW_LINE>long[] t = new long[4];<NEW_LINE>Interleave.expand64To128(x<MASK><NEW_LINE>Interleave.expand64To128(x[1], t, 2);<NEW_LINE>long z0 = t[0], z1 = t[1], z2 = t[2], z3 = t[3];<NEW_LINE>z1 ^= z3 ^ (z3 << 1) ^ (z3 << 2) ^ (z3 << 7);<NEW_LINE>z2 ^= (z3 >>> 63) ^ (z3 >>> 62) ^ (z3 >>> 57);<NEW_LINE>z0 ^= z2 ^ (z2 << 1) ^ (z2 << 2) ^ (z2 << 7);<NEW_LINE>z1 ^= (z2 >>> 63) ^ (z2 >>> 62) ^ (z2 >>> 57);<NEW_LINE>z[0] = z0;<NEW_LINE>z[1] = z1;<NEW_LINE>}
[0], t, 0);
56,678
public void testRxFlowableInvoker_get3WithGenericType(Map<String, String> param, StringBuilder ret) {<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE>final String threadName = "jaxrs21Thread";<NEW_LINE>ThreadFactory jaxrs21ThreadFactory = Executors.defaultThreadFactory();<NEW_LINE>Thread jaxrs21Thread = jaxrs21ThreadFactory.newThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>String runThreadName = Thread.currentThread().getName();<NEW_LINE>if (!(runThreadName.equals(threadName))) {<NEW_LINE>throw new RuntimeException("testRxFlowable_get3WithGenericType: incorrect thread name");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>jaxrs21Thread.setName(threadName);<NEW_LINE>ExecutorService executorService = Executors.newSingleThreadExecutor(jaxrs21ThreadFactory);<NEW_LINE>ClientBuilder cb = ClientBuilder.<MASK><NEW_LINE>Client c = cb.build();<NEW_LINE>c.register(RxFlowableInvokerProvider.class);<NEW_LINE>WebTarget t = c.target("http://" + serverIP + ":" + serverPort + "/jaxrs21bookstore/JAXRS21bookstore2/rxget3");<NEW_LINE>Builder builder = t.request();<NEW_LINE>builder.accept("application/xml");<NEW_LINE>GenericType<List<JAXRS21Book>> genericResponseType = new GenericType<List<JAXRS21Book>>() {<NEW_LINE>};<NEW_LINE>Flowable<List<JAXRS21Book>> flowable = builder.rx(RxFlowableInvoker.class).get(genericResponseType);<NEW_LINE>final Holder<List<JAXRS21Book>> holder = new Holder<List<JAXRS21Book>>();<NEW_LINE>final CountDownLatch countDownLatch = new CountDownLatch(1);<NEW_LINE>flowable.subscribe(v -> {<NEW_LINE>// OnNext<NEW_LINE>holder.value = v;<NEW_LINE>countDownLatch.countDown();<NEW_LINE>}, throwable -> {<NEW_LINE>// OnError<NEW_LINE>throw new RuntimeException("testRxFlowable_get3WithGenericType: onError " + throwable.getStackTrace());<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>if (!(countDownLatch.await(complexTimeout, TimeUnit.SECONDS))) {<NEW_LINE>throw new RuntimeException("testRxFlowable_get3WithGenericType: Response took too long. Waited " + complexTimeout);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>List<JAXRS21Book> response = holder.value;<NEW_LINE>ret.append(response != null);<NEW_LINE>c.close();<NEW_LINE>}
newBuilder().executorService(executorService);
1,273,358
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "theString".split(",");<NEW_LINE>String epl = "create window ABCWin#length_batch(3) as SupportBean;\n" + "insert into ABCWin select * from SupportBean;\n" + "on SupportBean_A delete from ABCWin where theString = id;\n" + "@Name('s0') select irstream * from ABCWin;\n";<NEW_LINE>env.compileDeployAddListenerMileZero(epl, "s0");<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, null);<NEW_LINE>sendSupportBean(env, "E1");<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.milestone(1);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "E1" } });<NEW_LINE>// delete<NEW_LINE>sendSupportBean_A(env, "E1");<NEW_LINE>// batch is quiet-delete<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.milestone(2);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, <MASK><NEW_LINE>sendSupportBean(env, "E2");<NEW_LINE>sendSupportBean(env, "E3");<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.milestone(3);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "E2" }, { "E3" } });<NEW_LINE>// delete<NEW_LINE>sendSupportBean_A(env, "E3");<NEW_LINE>// batch is quiet-delete<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.milestone(4);<NEW_LINE>sendSupportBean(env, "E4");<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>sendSupportBean(env, "E5");<NEW_LINE>env.assertPropsPerRowIRPair("s0", fields, new Object[][] { { "E2" }, { "E4" }, { "E5" } }, null);<NEW_LINE>env.milestone(5);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[0][]);<NEW_LINE>sendSupportBean(env, "E6");<NEW_LINE>sendSupportBean(env, "E7");<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.milestone(6);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "E6" }, { "E7" } });<NEW_LINE>sendSupportBean(env, "E8");<NEW_LINE>env.assertPropsPerRowIRPair("s0", fields, new Object[][] { { "E6" }, { "E7" }, { "E8" } }, new Object[][] { { "E2" }, { "E4" }, { "E5" } });<NEW_LINE>env.undeployAll();<NEW_LINE>}
new Object[0][]);
1,608,611
public boolean tryLock(final byte[] ctx, final long timeout, final TimeUnit unit) {<NEW_LINE>final long timeoutNs = unit.toNanos(timeout);<NEW_LINE>final long startNs = System.nanoTime();<NEW_LINE>int attempts = 1;<NEW_LINE>try {<NEW_LINE>for (; ; ) {<NEW_LINE>final Owner owner = internalTryLock(ctx);<NEW_LINE>if (owner.isSuccess()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (System.nanoTime() - startNs >= timeoutNs) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (attempts < 8) {<NEW_LINE>attempts++;<NEW_LINE>}<NEW_LINE>final long remaining = Math.max(0, owner.getRemainingMillis());<NEW_LINE>// TODO optimize with notify?<NEW_LINE>// avoid liveLock<NEW_LINE>Thread.sleep(Math.min<MASK><NEW_LINE>}<NEW_LINE>} catch (final Throwable t) {<NEW_LINE>ThrowUtil.throwException(t);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
(remaining, 2 << attempts));
17,912
public void analyze(Analyzer analyzer) throws AnalysisException, UserException {<NEW_LINE>super.analyze(analyzer);<NEW_LINE>// check auth<NEW_LINE>if (!Env.getCurrentEnv().getAuth().checkGlobalPriv(ConnectContext.get(), PrivPredicate.ADMIN)) {<NEW_LINE>ErrorReport.<MASK><NEW_LINE>}<NEW_LINE>tblRef.getName().analyze(analyzer);<NEW_LINE>Util.prohibitExternalCatalog(tblRef.getName().getCtl(), this.getClass().getSimpleName());<NEW_LINE>PartitionNames partitionNames = tblRef.getPartitionNames();<NEW_LINE>if (partitionNames != null) {<NEW_LINE>if (partitionNames.isTemp()) {<NEW_LINE>throw new AnalysisException("Do not support showing replica status of temporary partitions");<NEW_LINE>}<NEW_LINE>partitions.addAll(partitionNames.getPartitionNames());<NEW_LINE>}<NEW_LINE>if (!analyzeWhere()) {<NEW_LINE>throw new AnalysisException("Where clause should looks like: status =/!= 'OK/DEAD/VERSION_ERROR/SCHEMA_ERROR/MISSING'");<NEW_LINE>}<NEW_LINE>}
reportAnalysisException(ErrorCode.ERR_SPECIFIC_ACCESS_DENIED_ERROR, "ADMIN");
629,465
private void removeWildcardsWithoutNullColumns(QueryStatement queryStatement) throws StatementAnalyzeException {<NEW_LINE>List<Expression> expressions = queryStatement.getFilterNullComponent().getWithoutNullColumns();<NEW_LINE>// because timeSeries path may be with "*", so need to remove it for getting some actual<NEW_LINE>// timeSeries paths<NEW_LINE>// actualExpressions store the actual timeSeries paths<NEW_LINE>List<Expression> <MASK><NEW_LINE>List<Expression> resultExpressions = new ArrayList<>();<NEW_LINE>// because expression.removeWildcards will ignore the TimeSeries path that exists in the meta<NEW_LINE>// so we need to recognise the alias, just simply add to the resultExpressions<NEW_LINE>for (Expression expression : expressions) {<NEW_LINE>if (queryStatement.getSelectComponent().getAliasSet().contains(expression.getExpressionString())) {<NEW_LINE>resultExpressions.add(expression);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>expression.removeWildcards(this, actualExpressions);<NEW_LINE>}<NEW_LINE>// group by level, use groupedPathMap<NEW_LINE>if (queryStatement.isGroupByLevel()) {<NEW_LINE>GroupByLevelController groupByLevelController = ((AggregationQueryStatement) queryStatement).getGroupByLevelComponent().getGroupByLevelController();<NEW_LINE>for (Expression expression : actualExpressions) {<NEW_LINE>String groupedPath = groupByLevelController.getGroupedPath(expression.getExpressionString());<NEW_LINE>if (groupedPath != null) {<NEW_LINE>try {<NEW_LINE>resultExpressions.add(new TimeSeriesOperand(new PartialPath(groupedPath)));<NEW_LINE>} catch (IllegalPathException e) {<NEW_LINE>throw new StatementAnalyzeException(e.getMessage());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>resultExpressions.add(expression);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>resultExpressions.addAll(actualExpressions);<NEW_LINE>}<NEW_LINE>queryStatement.getFilterNullComponent().setWithoutNullColumns(resultExpressions);<NEW_LINE>}
actualExpressions = new ArrayList<>();
1,694,393
private static Collection<StateExpr> pruneRoot(StateExpr root, Multimap<StateExpr, StateExpr> postStates, Multimap<StateExpr, StateExpr> preStates, BiConsumer<StateExpr, StateExpr> removeEdge, Set<StateExpr> statesToKeep) {<NEW_LINE>assert !statesToKeep.contains(root);<NEW_LINE>assert !preStates.containsKey(root);<NEW_LINE>Collection<StateExpr> <MASK><NEW_LINE>for (StateExpr successor : successors) {<NEW_LINE>removeEdge.accept(root, successor);<NEW_LINE>preStates.remove(successor, root);<NEW_LINE>}<NEW_LINE>// We deleted an edge from each successor. If this was the only edge attached to it, that state<NEW_LINE>// is no longer in the table and is now invalid.<NEW_LINE>return successors.stream().filter(s -> postStates.containsKey(s) || preStates.containsKey(s)).collect(Collectors.toList());<NEW_LINE>}
successors = postStates.removeAll(root);
140,108
protected Chunk newMediaChunk(RepresentationHolder representationHolder, DataSource dataSource, int trackType, Format trackFormat, int trackSelectionReason, Object trackSelectionData, long firstSegmentNum, int maxSegmentCount, long seekTimeUs) {<NEW_LINE>Representation representation = representationHolder.representation;<NEW_LINE>long startTimeUs = representationHolder.getSegmentStartTimeUs(firstSegmentNum);<NEW_LINE>RangedUri segmentUri = representationHolder.getSegmentUrl(firstSegmentNum);<NEW_LINE>String baseUrl = representation.baseUrl;<NEW_LINE>if (representationHolder.extractorWrapper == null) {<NEW_LINE>long endTimeUs = representationHolder.getSegmentEndTimeUs(firstSegmentNum);<NEW_LINE>DataSpec dataSpec = new DataSpec(segmentUri.resolveUri(baseUrl), segmentUri.start, segmentUri.length, representation.getCacheKey());<NEW_LINE>return new SingleSampleMediaChunk(dataSource, dataSpec, trackFormat, trackSelectionReason, trackSelectionData, startTimeUs, endTimeUs, firstSegmentNum, trackType, trackFormat);<NEW_LINE>} else {<NEW_LINE>int segmentCount = 1;<NEW_LINE>for (int i = 1; i < maxSegmentCount; i++) {<NEW_LINE>RangedUri nextSegmentUri = representationHolder.getSegmentUrl(firstSegmentNum + i);<NEW_LINE>RangedUri mergedSegmentUri = segmentUri.attemptMerge(nextSegmentUri, baseUrl);<NEW_LINE>if (mergedSegmentUri == null) {<NEW_LINE>// Unable to merge segment fetches because the URIs do not merge.<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>segmentUri = mergedSegmentUri;<NEW_LINE>segmentCount++;<NEW_LINE>}<NEW_LINE>long endTimeUs = representationHolder.getSegmentEndTimeUs(firstSegmentNum + segmentCount - 1);<NEW_LINE>long periodDurationUs = representationHolder.periodDurationUs;<NEW_LINE>long clippedEndTimeUs = periodDurationUs != C.TIME_UNSET && periodDurationUs <= endTimeUs ? periodDurationUs : C.TIME_UNSET;<NEW_LINE>DataSpec dataSpec = new DataSpec(segmentUri.resolveUri(baseUrl), segmentUri.start, segmentUri.<MASK><NEW_LINE>long sampleOffsetUs = -representation.presentationTimeOffsetUs;<NEW_LINE>return new ContainerMediaChunk(dataSource, dataSpec, trackFormat, trackSelectionReason, trackSelectionData, startTimeUs, endTimeUs, seekTimeUs, clippedEndTimeUs, firstSegmentNum, segmentCount, sampleOffsetUs, representationHolder.extractorWrapper);<NEW_LINE>}<NEW_LINE>}
length, representation.getCacheKey());
927,641
public void onViewCreated(@NonNull final View view, final Bundle savedInstanceState) {<NEW_LINE>super.onViewCreated(view, savedInstanceState);<NEW_LINE>final Context context = view.getContext();<NEW_LINE>final AppSettings as = new AppSettings(context);<NEW_LINE>final ContextUtils cu = new ContextUtils(context);<NEW_LINE>cu.setAppLanguage(as.getLanguage());<NEW_LINE>final String sharedText = (getArguments() != null ? getArguments().getString(EXTRA_SHARED_TEXT, "") : "").trim();<NEW_LINE>if (_savedInstanceState == null) {<NEW_LINE>FragmentTransaction t = getChildFragmentManager().beginTransaction();<NEW_LINE>_shareIntoImportOptionsFragment = ShareIntoImportOptionsFragment.newInstance(sharedText);<NEW_LINE>_shareIntoImportOptionsFragment.setWorkingDir(workingDir);<NEW_LINE>t.replace(R.id.document__share_into__fragment__placeholder_fragment, _shareIntoImportOptionsFragment, <MASK><NEW_LINE>} else {<NEW_LINE>_shareIntoImportOptionsFragment = (ShareIntoImportOptionsFragment) getChildFragmentManager().findFragmentByTag(ShareIntoImportOptionsFragment.TAG);<NEW_LINE>}<NEW_LINE>_hlEditor.setText(sharedText);<NEW_LINE>_hlEditor.setTextSize(TypedValue.COMPLEX_UNIT_SP, as.getFontSize());<NEW_LINE>_hlEditor.setTypeface(Typeface.create(as.getFontFamily(), Typeface.NORMAL));<NEW_LINE>if (sharedText.isEmpty()) {<NEW_LINE>_hlEditor.requestFocus();<NEW_LINE>}<NEW_LINE>}
ShareIntoImportOptionsFragment.TAG).commit();
734,877
private static void createValidationCodePath(MethodCreator bytecodeCreator, ResultHandle configObject, String configPrefix) {<NEW_LINE>ResultHandle validationResult = bytecodeCreator.invokeInterfaceMethod(MethodDescriptor.ofMethod(VALIDATOR_CLASS, "validate", Set.class, Object.class, Class[].class), bytecodeCreator.getMethodParam(1), configObject, bytecodeCreator.newArray(Class.class, 0));<NEW_LINE>ResultHandle constraintSetIsEmpty = bytecodeCreator.invokeInterfaceMethod(MethodDescriptor.ofMethod(Set.class, "isEmpty"<MASK><NEW_LINE>BranchResult constraintSetIsEmptyBranch = bytecodeCreator.ifNonZero(constraintSetIsEmpty);<NEW_LINE>constraintSetIsEmptyBranch.trueBranch().returnValue(configObject);<NEW_LINE>BytecodeCreator constraintSetIsEmptyFalse = constraintSetIsEmptyBranch.falseBranch();<NEW_LINE>ResultHandle exception = constraintSetIsEmptyFalse.newInstance(MethodDescriptor.ofConstructor(CONSTRAINT_VIOLATION_EXCEPTION_CLASS, Set.class.getName()), validationResult);<NEW_LINE>constraintSetIsEmptyFalse.throwException(exception);<NEW_LINE>}
, boolean.class), validationResult);
608,718
public List<Long> jobOperatorGetJobInstanceIds(String jobName, String appTag, int start, int count) {<NEW_LINE>List<Long> data = new ArrayList<>();<NEW_LINE>try (Connection conn = getConnection();<NEW_LINE>PreparedStatement statement = conn.prepareStatement(queryStrings.get(JOBOPERATOR_GET_JOB_INSTANCE_IDS))) {<NEW_LINE>statement.setObject(1, jobName);<NEW_LINE>statement.setObject(2, appTag);<NEW_LINE>try (ResultSet rs = statement.executeQuery()) {<NEW_LINE>while (rs.next()) {<NEW_LINE>long <MASK><NEW_LINE>data.add(id);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new PersistenceException(e);<NEW_LINE>}<NEW_LINE>if (!data.isEmpty()) {<NEW_LINE>try {<NEW_LINE>return data.subList(start, start + count);<NEW_LINE>} catch (IndexOutOfBoundsException oobEx) {<NEW_LINE>return data.subList(start, data.size());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return data;<NEW_LINE>}<NEW_LINE>}
id = rs.getLong("jobinstanceid");
455,400
public // , ISequentialInStream<NEW_LINE>int // , ISequentialInStream<NEW_LINE>Code(// ISequentialOutStream<NEW_LINE>java.io.InputStream inStream, java.io.OutputStream outStream, long outSize, ICompressProgressInfo progress) throws java.io.IOException {<NEW_LINE>byte[] _buffer = new byte[kBufferSize];<NEW_LINE>long TotalSize = 0;<NEW_LINE>for (; ; ) {<NEW_LINE>int realProcessedSize;<NEW_LINE>int size = kBufferSize;<NEW_LINE>if (// NULL<NEW_LINE>outSize != -1)<NEW_LINE>if (size > (outSize - TotalSize))<NEW_LINE>size = (int) (outSize - TotalSize);<NEW_LINE>realProcessedSize = inStream.read(_buffer, 0, size);<NEW_LINE>if (// EOF<NEW_LINE>realProcessedSize == -1)<NEW_LINE>break;<NEW_LINE>outStream.write(_buffer, 0, realProcessedSize);<NEW_LINE>TotalSize += realProcessedSize;<NEW_LINE>if (progress != null) {<NEW_LINE>int res = <MASK><NEW_LINE>if (res != HRESULT.S_OK)<NEW_LINE>return res;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return HRESULT.S_OK;<NEW_LINE>}
progress.SetRatioInfo(TotalSize, TotalSize);
1,139,248
private GeneralPath makeDocumentPath(Diagram diagram) {<NEW_LINE>if (points.size() != 4)<NEW_LINE>return null;<NEW_LINE>Rectangle bounds = makeIntoPath().getBounds();<NEW_LINE>ShapePoint point1 = new ShapePoint((float) bounds.getMinX(), (float) bounds.getMinY());<NEW_LINE>ShapePoint point2 = new ShapePoint((float) bounds.getMaxX(), (<MASK><NEW_LINE>ShapePoint point3 = new ShapePoint((float) bounds.getMaxX(), (float) bounds.getMaxY());<NEW_LINE>ShapePoint point4 = new ShapePoint((float) bounds.getMinX(), (float) bounds.getMaxY());<NEW_LINE>ShapePoint pointMid = new ShapePoint((float) bounds.getCenterX(), (float) bounds.getMaxY());<NEW_LINE>GeneralPath path = new GeneralPath();<NEW_LINE>path.moveTo(point1.x, point1.y);<NEW_LINE>path.lineTo(point2.x, point2.y);<NEW_LINE>path.lineTo(point3.x, point3.y);<NEW_LINE>// int controlDX = diagram.getCellWidth();<NEW_LINE>// int controlDY = diagram.getCellHeight() / 2;<NEW_LINE>int controlDX = bounds.width / 6;<NEW_LINE>int controlDY = bounds.height / 8;<NEW_LINE>path.quadTo(pointMid.x + controlDX, pointMid.y - controlDY, pointMid.x, pointMid.y);<NEW_LINE>path.quadTo(pointMid.x - controlDX, pointMid.y + controlDY, point4.x, point4.y);<NEW_LINE>path.closePath();<NEW_LINE>return path;<NEW_LINE>}
float) bounds.getMinY());
712,065
public void selectPackagePrefixByProject() {<NEW_LINE>TreeSet<String> projects = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);<NEW_LINE>Multiset<String> count = new Multiset<>();<NEW_LINE>int total = 0;<NEW_LINE>for (BugInstance b : getBugCollection().getCollection()) {<NEW_LINE>if (shouldDisplayIssueIgnoringPackagePrefixes(b)) {<NEW_LINE>TreeSet<String> projectsForThisBug = projectPackagePrefixes.getProjects(b.getPrimaryClass().getClassName());<NEW_LINE>projects.addAll(projectsForThisBug);<NEW_LINE>count.addAll(projectsForThisBug);<NEW_LINE>total++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (projects.size() == 0) {<NEW_LINE>JOptionPane.showMessageDialog(this, "No issues in current view");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ArrayList<ProjectSelector> selectors = new ArrayList<>(<MASK><NEW_LINE>ProjectSelector everything = new ProjectSelector("all projects", "", total);<NEW_LINE>selectors.add(everything);<NEW_LINE>for (String projectName : projects) {<NEW_LINE>ProjectPackagePrefixes.PrefixFilter filter = projectPackagePrefixes.getFilter(projectName);<NEW_LINE>selectors.add(new ProjectSelector(projectName, filter.toString(), count.getCount(projectName)));<NEW_LINE>}<NEW_LINE>ProjectSelector choice = (ProjectSelector) JOptionPane.showInputDialog(null, "Choose a project to set appropriate package prefix(es)", "Select package prefixes by package", JOptionPane.QUESTION_MESSAGE, null, selectors.toArray(), everything);<NEW_LINE>if (choice == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mainFrameTree.setFieldForPackagesToDisplayText(choice.filter);<NEW_LINE>viewFilter.setPackagesToDisplay(choice.filter);<NEW_LINE>resetViewCache();<NEW_LINE>}
projects.size() + 1);
1,769,677
public static void main(String[] args) {<NEW_LINE>if (args.length < 3) {<NEW_LINE>System.out.println("paramters not specified.");<NEW_LINE>System.out.println("H2Control <h2 command> <h2 host> <h2 port> <h2 home> <redirect output>");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>H2Control h2Control = null;<NEW_LINE>if (args.length == 3) {<NEW_LINE>h2Control = new H2Control(args[0], args[1], args[2]);<NEW_LINE>} else if (args.length == 4) {<NEW_LINE>h2Control = new H2Control(args[0], args[1], args[2], args[3]);<NEW_LINE>} else if (args.length == 5) {<NEW_LINE>h2Control = new H2Control(args[0], args[1], args[2], args[<MASK><NEW_LINE>} else if (args.length > 5) {<NEW_LINE>h2Control = new H2Control(args[0], args[1], args[2], args[3], args[4], args[5]);<NEW_LINE>}<NEW_LINE>if (h2Control != null) {<NEW_LINE>h2Control.invokeServer();<NEW_LINE>}<NEW_LINE>}
3], args[4]);
1,248,437
public static Resource findRootByType(Model model, Resource atype) {<NEW_LINE>String s = String.join("\n", "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>", "PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>", "SELECT DISTINCT ?root { { ?root rdf:type ?ATYPE } UNION { ?root rdf:type ?t . ?t rdfs:subClassOf ?ATYPE } }");<NEW_LINE>Query q = QueryFactory.create(s);<NEW_LINE>QuerySolutionMap qsm = new QuerySolutionMap();<NEW_LINE><MASK><NEW_LINE>try (QueryExecution qExec = QueryExecution.model(model).query(q).initialBinding(qsm).build()) {<NEW_LINE>return (Resource) QueryExecUtils.getAtMostOne(qExec, "root");<NEW_LINE>}<NEW_LINE>}
qsm.add("ATYPE", atype);
1,361,499
private ListenableFuture<Optional<BuildResult>> checkManifestBasedCaches() {<NEW_LINE>Optional<DependencyFileRuleKeyFactory.RuleKeyAndInputs> manifestKeyAndInputs = manifestBasedKeySupplier.get();<NEW_LINE>if (!manifestKeyAndInputs.isPresent()) {<NEW_LINE>return Futures.<MASK><NEW_LINE>}<NEW_LINE>getBuildInfoRecorder().addBuildMetadata(BuildInfo.MetadataKey.MANIFEST_KEY, manifestKeyAndInputs.get().getRuleKey().toString());<NEW_LINE>try (Scope ignored = LeafEvents.scope(eventBus, "checking_cache_depfile_based")) {<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>return Futures.transform(manifestRuleKeyManager.performManifestBasedCacheFetch(manifestKeyAndInputs.get()), (@Nonnull ManifestFetchResult result) -> {<NEW_LINE>buildRuleScopeManager.setManifestFetchResult(result);<NEW_LINE>manifestRuleKeyCacheCheckTimestampsMillis = new Pair<>(start, System.currentTimeMillis());<NEW_LINE>if (!result.getRuleCacheResult().isPresent()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>if (!result.getRuleCacheResult().get().getType().isSuccess()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>return Optional.of(success(BuildRuleSuccessType.FETCHED_FROM_CACHE_MANIFEST_BASED, result.getRuleCacheResult().get()));<NEW_LINE>}, MoreExecutors.directExecutor());<NEW_LINE>}<NEW_LINE>}
immediateFuture(Optional.empty());
1,462,964
public void excuteSetCommand(List<Map<String, String>> attributesToAdd, List<Map<String, String>> attributesToDelete) throws TransactionFailure {<NEW_LINE>try {<NEW_LINE>// Add all required metrics<NEW_LINE>for (Map<String, String> attribute : attributesToAdd) {<NEW_LINE>Map<String, String> parameters = new HashMap<>();<NEW_LINE>parameters.put("add-metric", String.format("metricName=%s description=%s", attribute.get("metricName"), attribute.get("description")));<NEW_LINE><MASK><NEW_LINE>RestActionReporter reporter = ResourceUtil.runCommand("set-healthcheck-service-configuration", parameters, getSubject());<NEW_LINE>if (reporter.isFailure()) {<NEW_LINE>throw new TransactionFailure(reporter.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Delete all unrequired metrics<NEW_LINE>for (Map<String, String> attribute : attributesToDelete) {<NEW_LINE>Map<String, String> parameters = new HashMap<>();<NEW_LINE>parameters.put("delete-metric", String.format("metricName=%s", attribute.get("metricName")));<NEW_LINE>parameters.put("service", "mp-metrics");<NEW_LINE>RestActionReporter reporter = ResourceUtil.runCommand("set-healthcheck-service-configuration", parameters, getSubject());<NEW_LINE>if (reporter.isFailure()) {<NEW_LINE>throw new TransactionFailure(reporter.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>TranslatedConfigView.doSubstitution.set(true);<NEW_LINE>}<NEW_LINE>}
parameters.put("service", "mp-metrics");
1,263,561
public /* synchronized */<NEW_LINE>Pair<String, String> putIfAbsent(String accountName, String remotePath, V value) {<NEW_LINE>String targetKey = buildKey(accountName, remotePath);<NEW_LINE>Node<V> valuedNode = new Node(targetKey, value);<NEW_LINE>Node<V> previousValue = <MASK><NEW_LINE>if (previousValue != null) {<NEW_LINE>// remotePath already known; not replaced<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>// value really added<NEW_LINE>String currentPath = remotePath, parentPath = null, parentKey = null;<NEW_LINE>Node<V> currentNode = valuedNode, parentNode = null;<NEW_LINE>boolean linked = false;<NEW_LINE>while (!OCFile.ROOT_PATH.equals(currentPath) && !linked) {<NEW_LINE>parentPath = new File(currentPath).getParent();<NEW_LINE>if (!parentPath.endsWith(File.separator)) {<NEW_LINE>parentPath += File.separator;<NEW_LINE>}<NEW_LINE>parentKey = buildKey(accountName, parentPath);<NEW_LINE>parentNode = mMap.get(parentKey);<NEW_LINE>if (parentNode == null) {<NEW_LINE>parentNode = new Node(parentKey, null);<NEW_LINE>parentNode.addChild(currentNode);<NEW_LINE>mMap.put(parentKey, parentNode);<NEW_LINE>} else {<NEW_LINE>parentNode.addChild(currentNode);<NEW_LINE>linked = true;<NEW_LINE>}<NEW_LINE>currentPath = parentPath;<NEW_LINE>currentNode = parentNode;<NEW_LINE>}<NEW_LINE>String linkedTo = OCFile.ROOT_PATH;<NEW_LINE>if (linked) {<NEW_LINE>linkedTo = parentNode.getKey().substring(accountName.length());<NEW_LINE>}<NEW_LINE>return new Pair<String, String>(targetKey, linkedTo);<NEW_LINE>}<NEW_LINE>}
mMap.putIfAbsent(targetKey, valuedNode);
237,865
public void converterFor(RelationalColumn column, ConverterRegistration<SchemaBuilder> registration) {<NEW_LINE>String sqlType = column.typeName().toUpperCase();<NEW_LINE>SchemaBuilder schemaBuilder = null;<NEW_LINE>Converter converter = null;<NEW_LINE>if ("DATE".equals(sqlType)) {<NEW_LINE>schemaBuilder = SchemaBuilder.string().<MASK><NEW_LINE>converter = this::convertDate;<NEW_LINE>}<NEW_LINE>if ("TIME".equals(sqlType)) {<NEW_LINE>schemaBuilder = SchemaBuilder.string().optional().name("org.apache.inlong.agent.time.string");<NEW_LINE>converter = this::convertTime;<NEW_LINE>}<NEW_LINE>if ("DATETIME".equals(sqlType)) {<NEW_LINE>schemaBuilder = SchemaBuilder.string().optional().name("org.apache.inlong.agent.datetime.string");<NEW_LINE>converter = this::convertDateTime;<NEW_LINE>}<NEW_LINE>if ("TIMESTAMP".equals(sqlType)) {<NEW_LINE>schemaBuilder = SchemaBuilder.string().optional().name("org.apache.inlong.agent.timestamp.string");<NEW_LINE>converter = this::convertTimestamp;<NEW_LINE>}<NEW_LINE>if (schemaBuilder != null) {<NEW_LINE>registration.register(schemaBuilder, converter);<NEW_LINE>LOGGER.info("register converter for sqlType {} to schema {}", sqlType, schemaBuilder.name());<NEW_LINE>}<NEW_LINE>}
optional().name("org.apache.inlong.agent.date.string");
955,010
private void markupReferenceListEntry(ResourceMap map, Address mapAddress, ResourceType type, Address resourceDataAddress) throws DuplicateNameException, IOException, Exception {<NEW_LINE>ProgramModule module = createModule("ResourceListEntry");<NEW_LINE>int id = 0;<NEW_LINE>Address entryAddress = mapAddress.add(map.getResourceTypeListOffset() + type.getOffsetToReferenceList());<NEW_LINE>List<ReferenceListEntry> reference = type.getReferenceList();<NEW_LINE>for (ReferenceListEntry entry : reference) {<NEW_LINE>if (monitor.isCancelled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DataType entryDT = entry.toDataType();<NEW_LINE>createData(entryAddress, entryDT);<NEW_LINE>createFragment(module, type.getTypeAsString() + hack(), entryAddress, entryDT.getLength());<NEW_LINE>String name = "" + (id++);<NEW_LINE>if (entry.getName() != null) {<NEW_LINE>name += " - " + entry.getName();<NEW_LINE>}<NEW_LINE>setPlateComment(entryAddress, name);<NEW_LINE>entryAddress = entryAddress.<MASK><NEW_LINE>Address dataAddress = resourceDataAddress.add(entry.getDataOffset());<NEW_LINE>setPlateComment(dataAddress, type.getTypeAsString() + " - " + entry.getName());<NEW_LINE>}<NEW_LINE>}
add(entryDT.getLength());
1,511,903
public void init(FilterConfig filterConfig) throws ServletException {<NEW_LINE>final MetricRegistry metricsRegistry = getMetricsFactory(filterConfig);<NEW_LINE>String metricName = filterConfig.getInitParameter(METRIC_PREFIX);<NEW_LINE>if (metricName == null || metricName.isEmpty()) {<NEW_LINE>metricName = getClass().getName();<NEW_LINE>}<NEW_LINE>this.metersByStatusCode = new ConcurrentHashMap<>(meterNamesByStatusCode.size());<NEW_LINE>for (Entry<Integer, String> entry : meterNamesByStatusCode.entrySet()) {<NEW_LINE>metersByStatusCode.put(entry.getKey(), metricsRegistry.meter(name(metricName, entry.getValue())));<NEW_LINE>}<NEW_LINE>this.otherMeter = metricsRegistry.meter(name(metricName, otherMetricName));<NEW_LINE>this.timeoutsMeter = metricsRegistry.meter(name(metricName, "timeouts"));<NEW_LINE>this.errorsMeter = metricsRegistry.meter<MASK><NEW_LINE>this.activeRequests = metricsRegistry.counter(name(metricName, "activeRequests"));<NEW_LINE>this.requestTimer = metricsRegistry.timer(name(metricName, "requests"));<NEW_LINE>}
(name(metricName, "errors"));
579,588
public RelDataType deriveType(SqlValidator validator, SqlValidatorScope scope, SqlCall call) {<NEW_LINE>final RelDataTypeFactory typeFactory = validator.getTypeFactory();<NEW_LINE>List<RelDataTypeFieldImpl> <MASK><NEW_LINE>int index = 0;<NEW_LINE>columns.add(new RelDataTypeFieldImpl("SCHEDULE_ID", index++, typeFactory.createSqlType(SqlTypeName.INTEGER)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("TIME_ZONE", index++, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("FIRE_TIME", index++, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("START_TIME", index++, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("FINISH_TIME", index++, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("STATE", index++, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("REMARK", index++, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>columns.add(new RelDataTypeFieldImpl("RESULT_MSG", index++, typeFactory.createSqlType(SqlTypeName.VARCHAR)));<NEW_LINE>return typeFactory.createStructType(columns);<NEW_LINE>}
columns = new LinkedList<>();
1,154,304
public void run() {<NEW_LINE>logger.info("Aggregating account stats for local report");<NEW_LINE>try {<NEW_LINE>// Each time we collect account stats from blob stores, we will recalculate the delete tombstone related stats<NEW_LINE>// as well. So before starting collecting account stats, let's reset the delete tombstone stats.<NEW_LINE>resetDeleteTombstoneStats();<NEW_LINE>long totalFetchAndAggregateStartTimeMs = time.milliseconds();<NEW_LINE>List<PartitionId> unreachablePartitions = new ArrayList<>();<NEW_LINE>Map<Long, Map<Short, Map<Short, ContainerStorageStats>>> hostStorageStatsMap = new HashMap<>();<NEW_LINE>// 1. First, collect account stats from each replicas and aggregate the result to aggregatedSnapshot.<NEW_LINE>Set<PartitionId> partitionIds = new HashSet<>(partitionToReplicaMap.keySet());<NEW_LINE>Iterator<PartitionId> iterator = partitionIds.iterator();<NEW_LINE>while (!cancelled && iterator.hasNext()) {<NEW_LINE>PartitionId partitionId = iterator.next();<NEW_LINE>logger.debug("Aggregating account stats for local report started for store {}", partitionId);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// 2. Second, filter out the unreachable partitions that are not in the map.<NEW_LINE>List<String> unreachableStores = examineUnreachablePartitions(unreachablePartitions);<NEW_LINE>// 3. Update the delete tombstone related stats.<NEW_LINE>updateAggregatedDeleteTombstoneStats();<NEW_LINE>metrics.initDeleteStatsGaugesIfNeeded();<NEW_LINE>if (!cancelled) {<NEW_LINE>metrics.totalFetchAndAggregateTimeMs.update(time.milliseconds() - totalFetchAndAggregateStartTimeMs);<NEW_LINE>// 4. Construct a StatsWrapper.<NEW_LINE>StatsHeader statsHeader = new StatsHeader(StatsHeader.StatsDescription.STORED_DATA_SIZE, time.milliseconds(), partitionIds.size(), partitionIds.size() - unreachableStores.size(), unreachableStores);<NEW_LINE>HostAccountStorageStatsWrapper statsWrapper = new HostAccountStorageStatsWrapper(statsHeader, new HostAccountStorageStats(hostStorageStatsMap));<NEW_LINE>// 5. Persist this statsWrapper to mysql database if connection exists.<NEW_LINE>accountStatsStore.storeHostAccountStorageStats(statsWrapper);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>metrics.statsAggregationFailureCount.inc();<NEW_LINE>logger.error("Exception while aggregating account stats for local report. Stats output file path - {}", statsOutputFile.getAbsolutePath(), e);<NEW_LINE>}<NEW_LINE>}
collectAndAggregateAccountStorageStats(hostStorageStatsMap, partitionId, unreachablePartitions);
403,158
public Request<GetIdentityProviderByIdentifierRequest> marshall(GetIdentityProviderByIdentifierRequest getIdentityProviderByIdentifierRequest) {<NEW_LINE>if (getIdentityProviderByIdentifierRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(GetIdentityProviderByIdentifierRequest)");<NEW_LINE>}<NEW_LINE>Request<GetIdentityProviderByIdentifierRequest> request = new DefaultRequest<GetIdentityProviderByIdentifierRequest>(getIdentityProviderByIdentifierRequest, "AmazonCognitoIdentityProvider");<NEW_LINE>String target = "AWSCognitoIdentityProviderService.GetIdentityProviderByIdentifier";<NEW_LINE><MASK><NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (getIdentityProviderByIdentifierRequest.getUserPoolId() != null) {<NEW_LINE>String userPoolId = getIdentityProviderByIdentifierRequest.getUserPoolId();<NEW_LINE>jsonWriter.name("UserPoolId");<NEW_LINE>jsonWriter.value(userPoolId);<NEW_LINE>}<NEW_LINE>if (getIdentityProviderByIdentifierRequest.getIdpIdentifier() != null) {<NEW_LINE>String idpIdentifier = getIdentityProviderByIdentifierRequest.getIdpIdentifier();<NEW_LINE>jsonWriter.name("IdpIdentifier");<NEW_LINE>jsonWriter.value(idpIdentifier);<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.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.addHeader("X-Amz-Target", target);
1,656,050
public List<ResourceHistoryTable> fetchEntities(RequestPartitionId thePartitionId, Integer theOffset, int theFromIndex, int theToIndex) {<NEW_LINE>CriteriaBuilder cb = myEntityManager.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<ResourceHistoryTable> criteriaQuery = cb.createQuery(ResourceHistoryTable.class);<NEW_LINE>Root<ResourceHistoryTable> from = criteriaQuery.from(ResourceHistoryTable.class);<NEW_LINE>addPredicatesToQuery(cb, thePartitionId, criteriaQuery, from);<NEW_LINE>from.<MASK><NEW_LINE>criteriaQuery.orderBy(cb.desc(from.get("myUpdated")));<NEW_LINE>TypedQuery<ResourceHistoryTable> query = myEntityManager.createQuery(criteriaQuery);<NEW_LINE>int startIndex = theFromIndex;<NEW_LINE>if (theOffset != null) {<NEW_LINE>startIndex += theOffset;<NEW_LINE>}<NEW_LINE>query.setFirstResult(startIndex);<NEW_LINE>query.setMaxResults(theToIndex - theFromIndex);<NEW_LINE>List<ResourceHistoryTable> tables = query.getResultList();<NEW_LINE>if (tables.size() > 0) {<NEW_LINE>ImmutableListMultimap<Long, ResourceHistoryTable> resourceIdToHistoryEntries = Multimaps.index(tables, ResourceHistoryTable::getResourceId);<NEW_LINE>Map<Long, Optional<String>> pidToForcedId = myIdHelperService.translatePidsToForcedIds(resourceIdToHistoryEntries.keySet());<NEW_LINE>ourLog.trace("Translated IDs: {}", pidToForcedId);<NEW_LINE>for (Long nextResourceId : resourceIdToHistoryEntries.keySet()) {<NEW_LINE>List<ResourceHistoryTable> historyTables = resourceIdToHistoryEntries.get(nextResourceId);<NEW_LINE>String resourceId;<NEW_LINE>Optional<String> forcedId = pidToForcedId.get(nextResourceId);<NEW_LINE>if (forcedId.isPresent()) {<NEW_LINE>resourceId = forcedId.get();<NEW_LINE>} else {<NEW_LINE>resourceId = nextResourceId.toString();<NEW_LINE>}<NEW_LINE>for (ResourceHistoryTable nextHistoryTable : historyTables) {<NEW_LINE>nextHistoryTable.setTransientForcedId(resourceId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return tables;<NEW_LINE>}
fetch("myProvenance", JoinType.LEFT);
683,502
private static void patchGeneratedMessageLite() {<NEW_LINE>try {<NEW_LINE>ClassPool classPool = getClassPool();<NEW_LINE>CtClass generatedMessageLite = classPool.get(protobufPackage + "GeneratedMessageLite");<NEW_LINE>removeFinal(generatedMessageLite.getDeclaredMethod("getParserForType"));<NEW_LINE>removeFinal(generatedMessageLite.getDeclaredMethod("isInitialized"));<NEW_LINE>// The method was removed, but it is used in com.mapr.fs.proto.Dbserver.<NEW_LINE>// Adding it back.<NEW_LINE>generatedMessageLite.addMethod(CtNewMethod.make("protected void makeExtensionsImmutable() { }", generatedMessageLite));<NEW_LINE>// A constructor with this signature was removed. Adding it back.<NEW_LINE>String className = protobufPackage + "GeneratedMessageLite.Builder";<NEW_LINE>generatedMessageLite.addConstructor(CtNewConstructor.make("protected GeneratedMessageLite(" + className + " builder) { }", generatedMessageLite));<NEW_LINE>// This single method was added instead of several abstract methods.<NEW_LINE>// MapR-DB client doesn't use it, but it was added in overridden equals() method.<NEW_LINE>// Adding default implementation.<NEW_LINE>CtMethod dynamicMethod = generatedMessageLite.getDeclaredMethod("dynamicMethod", new CtClass[] { classPool.get(protobufPackage + "GeneratedMessageLite$MethodToInvoke"), classPool.get("java.lang.Object"), classPool.get("java.lang.Object") });<NEW_LINE>className = protobufPackage + "GeneratedMessageLite.MethodToInvoke";<NEW_LINE>String dynamicMethodBody = MessageFormat.format("if ($1.equals({0}.GET_DEFAULT_INSTANCE)) '{'" + " return this;" + "'}' else if ($1.equals({0}.BUILD_MESSAGE_INFO)) '{' " + " {1}StructuralMessageInfo.Builder builder = {1}StructuralMessageInfo.newBuilder();" + " builder.withSyntax({1}ProtoSyntax.PROTO2);" + " builder.withDefaultInstance(this);" + " return builder.build();" + "'}' else '{'" + " return null;" + "'}'", className, protobufPackage);<NEW_LINE>addImplementation(dynamicMethod, dynamicMethodBody);<NEW_LINE>generatedMessageLite.toClass();<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
logger.warn("Unable to patch Protobuf.", e);