idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,794,046
public void meetWith(LockSet other) {<NEW_LINE>for (int i = 0; i + 1 < array.length; i += 2) {<NEW_LINE>int valueNumber = array[i];<NEW_LINE>if (valueNumber < 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>int <MASK><NEW_LINE>int his = other.getLockCount(valueNumber);<NEW_LINE>array[i + 1] = mergeValues(mine, his);<NEW_LINE>}<NEW_LINE>for (int i = 0; i + 1 < other.array.length; i += 2) {<NEW_LINE>int valueNumber = other.array[i];<NEW_LINE>if (valueNumber < 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>int mine = getLockCount(valueNumber);<NEW_LINE>int his = other.array[i + 1];<NEW_LINE>setLockCount(valueNumber, mergeValues(mine, his));<NEW_LINE>}<NEW_LINE>setDefaultLockCount(0);<NEW_LINE>}
mine = array[i + 1];
1,501,262
void searchInScope() {<NEW_LINE>String searchText = textFind.getText();<NEW_LINE>if (searchText.length() >= 0) {<NEW_LINE>String convertedText = convertTextString(searchText);<NEW_LINE>boolean isWholeWord = getConfiguration().getWholeWord();<NEW_LINE>boolean isRegEx = getConfiguration().getRegularExpression() || ObjectUtil.areNotEqual(searchText, convertedText);<NEW_LINE>boolean isCaseSensitive = getConfiguration().getCaseSensitive();<NEW_LINE>if (isWholeWord && !isRegEx && isWord(convertedText)) {<NEW_LINE>isRegEx = true;<NEW_LINE>convertedText = REGEX_WORD_BOUNDARY + convertedText + REGEX_WORD_BOUNDARY;<NEW_LINE>}<NEW_LINE>IStatusLineManager statusLineManager = (IStatusLineManager) textEditor.getAdapter(IStatusLineManager.class);<NEW_LINE>switch(findScope) {<NEW_LINE>case OPEN_FILES:<NEW_LINE>FindHelper.findInOpenDocuments(convertedText, isCaseSensitive, isWholeWord, isRegEx, statusLineManager);<NEW_LINE>break;<NEW_LINE>case ENCLOSING_PROJECT:<NEW_LINE>FindHelper.findInEnclosingProject(convertedText, isCaseSensitive, isWholeWord, isRegEx, statusLineManager);<NEW_LINE>break;<NEW_LINE>case WORKSPACE:<NEW_LINE>FindHelper.findInWorkspace(convertedText, <MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
isCaseSensitive, isWholeWord, isRegEx, statusLineManager);
85,817
private Object extractColumns(final Map<String, Object> map, final boolean includeHiddenAndDeleted, final boolean publicOnly) {<NEW_LINE>final <MASK><NEW_LINE>final NodeFactory nodeFactory = new NodeFactory(securityContext);<NEW_LINE>if (map.size() == 1) {<NEW_LINE>final Entry<String, Object> entry = map.entrySet().iterator().next();<NEW_LINE>final String key = entry.getKey();<NEW_LINE>final Object value = entry.getValue();<NEW_LINE>try {<NEW_LINE>return handleObject(nodeFactory, relFactory, key, value, includeHiddenAndDeleted, publicOnly, 0);<NEW_LINE>} catch (FrameworkException fex) {<NEW_LINE>logger.error(ExceptionUtils.getStackTrace(fex));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return Iterables.map(entry -> {<NEW_LINE>final String key = entry.getKey();<NEW_LINE>final Object val = entry.getValue();<NEW_LINE>try {<NEW_LINE>return handleObject(nodeFactory, relFactory, key, val, includeHiddenAndDeleted, publicOnly, 0);<NEW_LINE>} catch (FrameworkException fex) {<NEW_LINE>logger.error(ExceptionUtils.getStackTrace(fex));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}, map.entrySet());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
RelationshipFactory relFactory = new RelationshipFactory(securityContext);
519,285
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {<NEW_LINE>if (response.isCommitted() || baseRequest.isHandled())<NEW_LINE>return;<NEW_LINE>baseRequest.setHandled(true);<NEW_LINE>final <MASK><NEW_LINE>if (!HttpMethod.GET.is(method)) {<NEW_LINE>response.sendError(HttpServletResponse.SC_NOT_FOUND);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>response.setStatus(HttpServletResponse.SC_OK);<NEW_LINE>response.setContentType(MimeTypes.Type.TEXT_HTML_UTF_8.toString());<NEW_LINE>final StringBuilder maintenanceHTML = new StringBuilder();<NEW_LINE>maintenanceHTML.append("<!DOCTYPE html>\n");<NEW_LINE>maintenanceHTML.append("<html lang=\"en\">\n<head>\n");<NEW_LINE>maintenanceHTML.append("<title>Maintenance Mode Active</title>\n");<NEW_LINE>maintenanceHTML.append("<meta charset=\"utf-8\">\n");<NEW_LINE>maintenanceHTML.append("</head>\n<body>\n");<NEW_LINE>maintenanceHTML.append("<h2>Maintenance Mode Active</h2>\n");<NEW_LINE>maintenanceHTML.append(Settings.MaintenanceMessage.getValue());<NEW_LINE>maintenanceHTML.append("\n</body>\n</html>\n");<NEW_LINE>response.setContentLength(maintenanceHTML.length());<NEW_LINE>try (OutputStream out = response.getOutputStream()) {<NEW_LINE>out.write(maintenanceHTML.toString().getBytes());<NEW_LINE>}<NEW_LINE>}
String method = request.getMethod();
996,033
final GetInventorySchemaResult executeGetInventorySchema(GetInventorySchemaRequest getInventorySchemaRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getInventorySchemaRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetInventorySchemaRequest> request = null;<NEW_LINE>Response<GetInventorySchemaResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetInventorySchemaRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getInventorySchemaRequest));<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, "SSM");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetInventorySchemaResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetInventorySchemaResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetInventorySchema");
665,527
private Properties defaultProperties() {<NEW_LINE>Properties felixProps = new Properties();<NEW_LINE>final String felixDirectory = getFelixBaseDirFromConfig();<NEW_LINE>Logger.info(this, () -> "Felix base dir: " + felixDirectory);<NEW_LINE>final String felixAutoDeployDirectory = Config.getStringProperty(AUTO_DEPLOY_DIR_PROPERTY, felixDirectory + File.separator + "bundle");<NEW_LINE>final String felixUploadDirectory = Config.getStringProperty(FELIX_UPLOAD_DIR, felixDirectory + File.separator + "upload");<NEW_LINE>final String felixLoadDirectory = Config.getStringProperty(FELIX_FILEINSTALL_DIR, felixDirectory + File.separator + "load");<NEW_LINE>final String felixUndeployDirectory = Config.getStringProperty(FELIX_UNDEPLOYED_DIR, felixDirectory + File.separator + "undeployed");<NEW_LINE>final String felixCacheDirectory = Config.getStringProperty(FELIX_FRAMEWORK_STORAGE, felixDirectory + File.separator + "felix-cache");<NEW_LINE>felixProps.put(FELIX_BASE_DIR, felixDirectory);<NEW_LINE>felixProps.put(AUTO_DEPLOY_DIR_PROPERTY, felixAutoDeployDirectory);<NEW_LINE>felixProps.put(FELIX_FRAMEWORK_STORAGE, felixCacheDirectory);<NEW_LINE>felixProps.put(FELIX_UPLOAD_DIR, felixUploadDirectory);<NEW_LINE>felixProps.put(FELIX_FILEINSTALL_DIR, felixLoadDirectory);<NEW_LINE>felixProps.put(FELIX_UNDEPLOYED_DIR, felixUndeployDirectory);<NEW_LINE>felixProps.put("felix.auto.deploy.action", "install,start");<NEW_LINE><MASK><NEW_LINE>felixProps.put("felix.fileinstall.log.level", "3");<NEW_LINE>felixProps.put("org.osgi.framework.startlevel.beginning", "2");<NEW_LINE>felixProps.put("org.osgi.framework.storage.clean", "onFirstInit");<NEW_LINE>felixProps.put("felix.log.level", "3");<NEW_LINE>felixProps.put("felix.fileinstall.disableNio2", "true");<NEW_LINE>felixProps.put("gosh.args", "--noi");<NEW_LINE>// Create host activator;<NEW_LINE>HostActivator hostActivator = HostActivator.instance();<NEW_LINE>felixProps.put(FelixConstants.SYSTEMBUNDLE_ACTIVATORS_PROP, ImmutableList.of(hostActivator));<NEW_LINE>return felixProps;<NEW_LINE>}
felixProps.put("felix.fileinstall.start.level", "1");
918,894
public ResponseEntity<Object> login(@RequestBody Map<String, String> requestBody) {<NEW_LINE>if (requestBody == null || !requestBody.containsKey(APP_ID) || !requestBody.containsKey("password")) {<NEW_LINE>return ResponseEntity.badRequest().build();<NEW_LINE>}<NEW_LINE>String appId = requestBody.get("appId");<NEW_LINE>String password = requestBody.get("password");<NEW_LINE>SurenessAccount account = accountProvider.loadAccount(appId);<NEW_LINE>if (account == null || account.isDisabledAccount() || account.isExcessiveAttempts()) {<NEW_LINE>return ResponseEntity.status(HttpStatus.FORBIDDEN).build();<NEW_LINE>}<NEW_LINE>if (account.getPassword() != null) {<NEW_LINE>if (account.getSalt() != null) {<NEW_LINE>password = Md5Util.md5(password + account.getSalt());<NEW_LINE>}<NEW_LINE>if (!account.getPassword().equals(password)) {<NEW_LINE>return ResponseEntity.status(HttpStatus.FORBIDDEN).build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Get the roles the user has - rbac<NEW_LINE>List<String<MASK><NEW_LINE>long refreshPeriodTime = 36000L;<NEW_LINE>// issue jwt<NEW_LINE>String jwt = JsonWebTokenUtil.issueJwt(UUID.randomUUID().toString(), appId, "token-server", refreshPeriodTime >> 1, roles, null, Boolean.FALSE);<NEW_LINE>Map<String, String> body = Collections.singletonMap("token", jwt);<NEW_LINE>return ResponseEntity.ok().body(body);<NEW_LINE>}
> roles = account.getOwnRoles();
1,036,185
public static Collection<ErrorDescription> apply(HintContext hc) {<NEW_LINE>if (hc.isCanceled() || (hc.getPath().getLeaf().getKind() != Tree.Kind.IDENTIFIER || hc.getPath().getParentPath().getLeaf().getKind() != Tree.Kind.ANNOTATION)) {<NEW_LINE>// NOI18N<NEW_LINE>// we pass only if it is an annotation<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>final JPAProblemContext ctx = ModelUtils.getOrCreateCachedContext(hc);<NEW_LINE>if (ctx == null || hc.isCanceled()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>TypeElement subject = ctx.getJavaClass();<NEW_LINE>if (((JPAProblemContext) ctx).getAccessType() != AccessType.PROPERTY) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<ErrorDescription> <MASK><NEW_LINE>for (ExecutableElement method : ElementFilter.methodsIn(subject.getEnclosedElements())) {<NEW_LINE>if (!isAccessor(method)) {<NEW_LINE>for (String annotName : ModelUtils.extractAnnotationNames(method)) {<NEW_LINE>if (JPAAnnotations.MEMBER_LEVEL.contains(annotName)) {<NEW_LINE>Tree elementTree = ctx.getCompilationInfo().getTrees().getTree(method);<NEW_LINE>Utilities.TextSpan underlineSpan = Utilities.getUnderlineSpan(ctx.getCompilationInfo(), elementTree);<NEW_LINE>ErrorDescription error = ErrorDescriptionFactory.forSpan(hc, underlineSpan.getStartOffset(), underlineSpan.getEndOffset(), NbBundle.getMessage(LegalCombinationOfAnnotations.class, "MSG_JPAAnnotsOnlyOnAccesor", ModelUtils.shortAnnotationName(annotName)));<NEW_LINE>problemsFound.add(error);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return problemsFound;<NEW_LINE>}
problemsFound = new ArrayList<>();
157,882
final DeleteDatastoreResult executeDeleteDatastore(DeleteDatastoreRequest deleteDatastoreRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteDatastoreRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteDatastoreRequest> request = null;<NEW_LINE>Response<DeleteDatastoreResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteDatastoreRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDatastoreRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoTAnalytics");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDatastore");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteDatastoreResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDatastoreResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
533,262
final ListAssociatedAssetsResult executeListAssociatedAssets(ListAssociatedAssetsRequest listAssociatedAssetsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listAssociatedAssetsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListAssociatedAssetsRequest> request = null;<NEW_LINE>Response<ListAssociatedAssetsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListAssociatedAssetsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAssociatedAssetsRequest));<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, "IoTSiteWise");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAssociatedAssets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "api.";<NEW_LINE>String resolvedHostPrefix = String.format("api.");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListAssociatedAssetsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListAssociatedAssetsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
endClientExecution(awsRequestMetrics, request, response);
1,739,832
public Object execute(CommandLine commandLine) throws Exception {<NEW_LINE>List<SearchMatch> matches = executeSearch(commandLine);<NEW_LINE>String projectName = commandLine.getValue(Options.NAME_OPTION);<NEW_LINE>IProject project = projectName != null ? ProjectUtils.getProject(projectName) : null;<NEW_LINE>String[] sortKeys = getSortKeys(project);<NEW_LINE>// Store the results keyed by the sort key<NEW_LINE>Map<String, List<Position>> positionMap = new HashMap<String, List<Position>>();<NEW_LINE>for (SearchMatch match : matches) {<NEW_LINE>IJavaElement element = (IJavaElement) match.getElement();<NEW_LINE>if (element != null) {<NEW_LINE>int elementType = element.getElementType();<NEW_LINE>if (elementType != IJavaElement.PACKAGE_FRAGMENT && elementType != IJavaElement.PACKAGE_FRAGMENT_ROOT) {<NEW_LINE>Position result = createPosition(project, match);<NEW_LINE>if (result != null) {<NEW_LINE>String sortKey = getSortKey(result, sortKeys);<NEW_LINE>List<Position> <MASK><NEW_LINE>if (positions == null) {<NEW_LINE>positions = new ArrayList<Position>();<NEW_LINE>positionMap.put(sortKey, positions);<NEW_LINE>}<NEW_LINE>positions.add(result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Assemble the final results in the sorted order<NEW_LINE>List<Position> results = null;<NEW_LINE>for (String sortKey : sortKeys) {<NEW_LINE>List<Position> positions = positionMap.get(sortKey);<NEW_LINE>if (positions == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (results == null) {<NEW_LINE>results = positions;<NEW_LINE>} else {<NEW_LINE>results.addAll(positions);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return results == null ? Collections.emptyList() : results;<NEW_LINE>}
positions = positionMap.get(sortKey);
100,180
public boolean compile(List<File> sourceFiles, List<String> classpathEntries, File outputDir, Map<String, String> environment, ILogListener logListener) throws IOException {<NEW_LINE>List<String> commands = new ArrayList<>();<NEW_LINE>commands.add(compilerPath.toString());<NEW_LINE>String outputDirPath = outputDir<MASK><NEW_LINE>List<String> compileOptions = Arrays.asList(new String[] { "-print", "-g:vars", "-d", outputDirPath });<NEW_LINE>commands.addAll(compileOptions);<NEW_LINE>addScalaCoreLibs(classpathEntries);<NEW_LINE>if (classpathEntries.size() > 0) {<NEW_LINE>commands.add("-classpath");<NEW_LINE>commands.add(makeClassPath(classpathEntries));<NEW_LINE>}<NEW_LINE>for (File sourceFile : sourceFiles) {<NEW_LINE>commands.add(sourceFile.getAbsolutePath());<NEW_LINE>}<NEW_LINE>boolean success = runCommands(commands, environment, logListener);<NEW_LINE>if (success) {<NEW_LINE>String realSource = getOutputStream();<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>}
.getAbsolutePath().toString();
468,778
private static boolean parse(String value) {<NEW_LINE>String[] lines = value.trim().split("\n");<NEW_LINE>String whitePlayer = "Player 1";<NEW_LINE>String blackPlayer = "Player 2";<NEW_LINE>double komi = 1.5;<NEW_LINE>int handicap = 0;<NEW_LINE>for (String line : lines) {<NEW_LINE>if (line.startsWith("\\[GAMEINFOMAIN=")) {<NEW_LINE>// See if komi is included<NEW_LINE>int i = line.indexOf("GONGJE:");<NEW_LINE>if (i != -1) {<NEW_LINE>int sk = i + "GONGJE:".length();<NEW_LINE>int ek = line.indexOf(',', sk);<NEW_LINE>komi = Integer.parseInt(line.substring(sk, ek)) / 10.0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Players names<NEW_LINE>if (line.startsWith("\\[GAMEBLACKNAME=")) {<NEW_LINE>blackPlayer = line.substring(16, <MASK><NEW_LINE>}<NEW_LINE>if (line.startsWith("\\[GAMEWHITENAME=")) {<NEW_LINE>whitePlayer = line.substring(16, line.length() - 3);<NEW_LINE>}<NEW_LINE>// Handicap info<NEW_LINE>if (line.startsWith("INI")) {<NEW_LINE>String[] fields = line.split(" ");<NEW_LINE>handicap = Integer.parseInt(fields[3]);<NEW_LINE>if (handicap >= 2) {<NEW_LINE>placeHandicap(handicap);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Actual moves<NEW_LINE>if (line.startsWith("STO")) {<NEW_LINE>String[] fields = line.split(" ");<NEW_LINE>int x = Integer.parseInt(fields[4]);<NEW_LINE>int y = Integer.parseInt(fields[5]);<NEW_LINE>Stone s = fields[3].equals("1") ? Stone.BLACK : Stone.WHITE;<NEW_LINE>Lizzie.board.place(x, y, s);<NEW_LINE>}<NEW_LINE>// Pass<NEW_LINE>if (line.startsWith("SKI")) {<NEW_LINE>Lizzie.board.pass();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Lizzie.board.setKomi(komi);<NEW_LINE>Lizzie.frame.setPlayers(whitePlayer, blackPlayer);<NEW_LINE>// Rewind to game start<NEW_LINE>while (Lizzie.board.previousMove()) ;<NEW_LINE>return false;<NEW_LINE>}
line.length() - 3);
699,577
protected void forceColors() {<NEW_LINE>UIUtils.runInUIThread(new Runnable() {<NEW_LINE><NEW_LINE>String greenBGString;<NEW_LINE><NEW_LINE>String redBGString;<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>RGB greenBG = GitColors.greenBG().getRGB();<NEW_LINE>greenBGString = StringConverter.asString(greenBG);<NEW_LINE>RGB redBG = GitColors.redBG().getRGB();<NEW_LINE>redBGString = StringConverter.asString(redBG);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>JFaceResources.getColorRegistry().put("CONFLICTING_COLOR", redBG);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>JFaceResources.getColorRegistry().put("RESOLVED_COLOR", greenBG);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>setQuickDiffColors(InstanceScope.INSTANCE.getNode("com.aptana.editor.common"));<NEW_LINE>if (ThemePlugin.applyToAllEditors()) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>setQuickDiffColors(InstanceScope.INSTANCE.getNode("org.eclipse.ui.editors"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>protected void setQuickDiffColors(IEclipsePreferences prefs) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>prefs.put("changeIndicationColor", greenBGString);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>prefs.put("additionIndicationColor", greenBGString);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>prefs.put("deletionIndicationColor", redBGString);<NEW_LINE>// APSTUD-4152<NEW_LINE>// See ThemeManager#setCurrentTheme() for outgoing/incoming diff/compare colors<NEW_LINE>// $NON-NLS-1$<NEW_LINE><MASK><NEW_LINE>// $NON-NLS-1$<NEW_LINE>prefs.put("RESOLVED_COLOR", greenBGString);<NEW_LINE>try {<NEW_LINE>prefs.flush();<NEW_LINE>} catch (BackingStoreException e) {<NEW_LINE>IdeLog.logError(getDefault(), e, IDebugScopes.DEBUG);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
prefs.put("CONFLICTING_COLOR", redBGString);
1,137,688
public void performContextAction(final Node[] nodes) {<NEW_LINE>ProgressSupport support = new ContextAction.ProgressSupport(this, nodes) {<NEW_LINE><NEW_LINE>public void perform() {<NEW_LINE>SvnModuleConfig config = SvnModuleConfig.getDefault();<NEW_LINE>int status = getActionStatus(nodes);<NEW_LINE>List<File> files = new ArrayList<File>();<NEW_LINE>for (Node node : nodes) {<NEW_LINE>File aFile = node.getLookup().lookup(File.class);<NEW_LINE>FileObject fo = node.getLookup().lookup(FileObject.class);<NEW_LINE>if (aFile != null) {<NEW_LINE>files.add(aFile);<NEW_LINE>} else if (fo != null) {<NEW_LINE>File f = FileUtil.toFile(fo);<NEW_LINE>if (f != null) {<NEW_LINE>files.add(f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<String> paths = new ArrayList<String<MASK><NEW_LINE>for (File file : files) {<NEW_LINE>paths.add(file.getAbsolutePath());<NEW_LINE>}<NEW_LINE>if (isCanceled())<NEW_LINE>return;<NEW_LINE>if (status == EXCLUDING) {<NEW_LINE>config.addExclusionPaths(paths);<NEW_LINE>} else if (status == INCLUDING) {<NEW_LINE>config.removeExclusionPaths(paths);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>support.start(createRequestProcessor(nodes));<NEW_LINE>}
>(files.size());
448,025
private // AWT task and post it for later execution.<NEW_LINE>void reindentLater(final BaseDocument doc, int start, int end) throws BadLocationException {<NEW_LINE>final Position from = doc.createPosition(Utilities.getRowStart(doc, start));<NEW_LINE>final Position to = doc.createPosition(Utilities<MASK><NEW_LINE>Runnable rn = new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>final Indent indent = Indent.get(doc);<NEW_LINE>indent.lock();<NEW_LINE>try {<NEW_LINE>doc.runAtomic(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>try {<NEW_LINE>indent.reindent(from.getOffset(), to.getOffset());<NEW_LINE>} catch (BadLocationException ex) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} finally {<NEW_LINE>indent.unlock();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>if (inTest) {<NEW_LINE>rn.run();<NEW_LINE>} else {<NEW_LINE>SwingUtilities.invokeLater(rn);<NEW_LINE>}<NEW_LINE>}
.getRowEnd(doc, end));
355,801
public void processUserInfo(TLRPC.User user, TLRPC.UserFull info, boolean fromCache, boolean force, int classGuid, ArrayList<Integer> pinnedMessages, HashMap<Integer, MessageObject> pinnedMessagesMap, int totalPinnedCount, boolean pinnedEndReached) {<NEW_LINE>AndroidUtilities.runOnUIThread(() -> {<NEW_LINE>if (fromCache) {<NEW_LINE>loadFullUser(user, classGuid, force);<NEW_LINE>}<NEW_LINE>if (info != null) {<NEW_LINE>if (fullUsers.get(user.id) == null) {<NEW_LINE>fullUsers.put(user.id, info);<NEW_LINE>int index = blockePeers.indexOfKey(user.id);<NEW_LINE>if (info.blocked) {<NEW_LINE>if (index < 0) {<NEW_LINE>blockePeers.<MASK><NEW_LINE>getNotificationCenter().postNotificationName(NotificationCenter.blockedUsersDidLoad);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (index >= 0) {<NEW_LINE>blockePeers.removeAt(index);<NEW_LINE>getNotificationCenter().postNotificationName(NotificationCenter.blockedUsersDidLoad);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>getNotificationCenter().postNotificationName(NotificationCenter.userInfoDidLoad, user.id, info);<NEW_LINE>}<NEW_LINE>if (pinnedMessages != null) {<NEW_LINE>getNotificationCenter().postNotificationName(NotificationCenter.pinnedInfoDidLoad, user.id, pinnedMessages, pinnedMessagesMap, totalPinnedCount, pinnedEndReached);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
put(user.id, 1);
1,725,440
public RunningDevServicesDatasource startDatabase(Optional<String> username, Optional<String> password, Optional<String> datasourceName, Optional<String> imageName, Map<String, String> containerProperties, Map<String, String> additionalJdbcUrlProperties, OptionalInt fixedExposedPort, LaunchMode launchMode, Optional<Duration> startupTimeout) {<NEW_LINE>QuarkusPostgreSQLContainer container = new QuarkusPostgreSQLContainer(imageName, fixedExposedPort, !devServicesSharedNetworkBuildItem.isEmpty());<NEW_LINE><MASK><NEW_LINE>container.withPassword(password.orElse("quarkus")).withUsername(username.orElse("quarkus")).withDatabaseName(datasourceName.orElse("default")).withReuse(true);<NEW_LINE>additionalJdbcUrlProperties.forEach(container::withUrlParam);<NEW_LINE>container.start();<NEW_LINE>LOG.info("Dev Services for PostgreSQL started.");<NEW_LINE>return new RunningDevServicesDatasource(container.getContainerId(), container.getEffectiveJdbcUrl(), container.getUsername(), container.getPassword(), new ContainerShutdownCloseable(container, "PostgreSQL"));<NEW_LINE>}
startupTimeout.ifPresent(container::withStartupTimeout);
426,264
public void display(final SheetStub stub, final boolean early) {<NEW_LINE>// Since we are on Swing EDT, use asynchronous processing<NEW_LINE>OmrExecutors.getCachedLowExecutor().submit(() -> {<NEW_LINE>try {<NEW_LINE>LogUtil.start(stub);<NEW_LINE>// Check whether we should run early steps on the sheet<NEW_LINE>checkStubStatus(stub, early);<NEW_LINE>SwingUtilities.invokeAndWait(() -> {<NEW_LINE>// Race condition: let's check we are working on the selected stub<NEW_LINE>SheetStub selected = getSelectedStub();<NEW_LINE>if (stub == selected) {<NEW_LINE>// Tell the selected assembly that it now has the focus<NEW_LINE>// (to display stub related boards and error pane)<NEW_LINE>stub<MASK><NEW_LINE>// Stub status<NEW_LINE>BookActions.getInstance().updateProperties(stub.getSheet());<NEW_LINE>// GUI: Perform sheets upgrade?<NEW_LINE>final Book book = stub.getBook();<NEW_LINE>if (!book.promptedForUpgrade() && !book.getStubsToUpgrade().isEmpty()) {<NEW_LINE>promptForUpgrades(stub, book.getStubsToUpgrade());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.debug("Too late for {}", stub);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return null;<NEW_LINE>} finally {<NEW_LINE>LogUtil.stopStub();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.getAssembly().assemblySelected();
865,980
private WeightOrDocIdSet rewrite(LeafReaderContext context) throws IOException {<NEW_LINE>final Terms terms = context.reader().terms(query.field);<NEW_LINE>if (terms == null) {<NEW_LINE>// field does not exist<NEW_LINE>return new WeightOrDocIdSet((DocIdSet) null);<NEW_LINE>}<NEW_LINE>final TermsEnum termsEnum = query.getTermsEnum(terms);<NEW_LINE>assert termsEnum != null;<NEW_LINE>PostingsEnum docs = null;<NEW_LINE>final List<TermAndState> collectedTerms = new ArrayList<>();<NEW_LINE>if (collectTerms(context, termsEnum, collectedTerms)) {<NEW_LINE>// build a boolean query<NEW_LINE>BooleanQuery.Builder bq = new BooleanQuery.Builder();<NEW_LINE>for (TermAndState t : collectedTerms) {<NEW_LINE>final TermStates termStates = new TermStates(searcher.getTopReaderContext());<NEW_LINE>termStates.register(t.state, context.ord, t.docFreq, t.totalTermFreq);<NEW_LINE>bq.add(new TermQuery(new Term(query.field, t.term), termStates), Occur.SHOULD);<NEW_LINE>}<NEW_LINE>Query q = new ConstantScoreQuery(bq.build());<NEW_LINE>final Weight weight = searcher.rewrite(q).createWeight(searcher, scoreMode, score());<NEW_LINE>return new WeightOrDocIdSet(weight);<NEW_LINE>}<NEW_LINE>// Too many terms: go back to the terms we already collected and start building the bit set<NEW_LINE>DocIdSetBuilder builder = new DocIdSetBuilder(context.reader().maxDoc(), terms);<NEW_LINE>if (collectedTerms.isEmpty() == false) {<NEW_LINE>TermsEnum termsEnum2 = terms.iterator();<NEW_LINE>for (TermAndState t : collectedTerms) {<NEW_LINE>termsEnum2.seekExact(t.term, t.state);<NEW_LINE>docs = termsEnum2.postings(docs, PostingsEnum.NONE);<NEW_LINE>builder.add(docs);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Then keep filling the bit set with remaining terms<NEW_LINE>do {<NEW_LINE>docs = termsEnum.postings(docs, PostingsEnum.NONE);<NEW_LINE>builder.add(docs);<NEW_LINE>} while (termsEnum.next() != null);<NEW_LINE>return new <MASK><NEW_LINE>}
WeightOrDocIdSet(builder.build());
1,481,855
public void incrementTransition(Transducer.TransitionIterator ti, double count) {<NEW_LINE>int index = ti.getIndex();<NEW_LINE>CRF.State source = (CRF.State) ti.getSourceState();<NEW_LINE>int nwi = source.weightsIndices[index].length;<NEW_LINE>@Var<NEW_LINE>int weightsIndex;<NEW_LINE>for (int wi = 0; wi < nwi; wi++) {<NEW_LINE>weightsIndex = source<MASK><NEW_LINE>// For frozen weights, don't even gather their sufficient statistics; this is how we ensure that the gradient for these will be zero<NEW_LINE>if (weightsFrozen[weightsIndex])<NEW_LINE>continue;<NEW_LINE>// TODO Should we also obey FeatureSelection here? No need; it is enforced by the creation of the weights.<NEW_LINE>weights[weightsIndex].plusEqualsSparse((FeatureVector) ti.getInput(), count);<NEW_LINE>defaultWeights[weightsIndex] += count;<NEW_LINE>}<NEW_LINE>}
.weightsIndices[index][wi];
1,306,519
public void replaceDexArchiveBuilderTransform(BaseVariantOutput vod) {<NEW_LINE>List<TransformTask> list = TransformManager.findTransformTaskByTransformType(variantContext, DexArchiveBuilderTransform.class);<NEW_LINE>DefaultDexOptions dexOptions = variantContext.getAppExtension().getDexOptions();<NEW_LINE>boolean minified = variantContext.getScope().getCodeShrinker() != null;<NEW_LINE>ProjectOptions projectOptions = variantContext.getScope().getGlobalScope().getProjectOptions();<NEW_LINE>FileCache userLevelCache = getUserDexCache(minified, dexOptions.getPreDexLibraries());<NEW_LINE>for (TransformTask transformTask : list) {<NEW_LINE>AtlasDexArchiveBuilderTransform atlasDexArchiveBuilderTransform = new AtlasDexArchiveBuilderTransform(variantContext, vod, dexOptions, variantContext.getScope().getGlobalScope().getAndroidBuilder().getErrorReporter(), userLevelCache, variantContext.getScope().getMinSdkVersion().getFeatureLevel(), variantContext.getScope().getDexer(), projectOptions.get(BooleanOption.ENABLE_GRADLE_WORKERS), projectOptions.get(IntegerOption.DEXING_READ_BUFFER_SIZE), projectOptions.get(IntegerOption.DEXING_WRITE_BUFFER_SIZE), variantContext.getScope().getVariantConfiguration().getBuildType().isDebuggable());<NEW_LINE>atlasDexArchiveBuilderTransform.setTransformTask(transformTask);<NEW_LINE>ReflectUtils.updateField(transformTask, "transform", atlasDexArchiveBuilderTransform);<NEW_LINE>if (variantContext.getScope().getInstantRunBuildContext().isInInstantRunMode() && variantContext.getVariantConfiguration().getMinSdkVersion().getApiLevel() < 21) {<NEW_LINE>transformTask.doLast(task -> {<NEW_LINE>task.<MASK><NEW_LINE>generateMainDexList(variantContext.getScope());<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getLogger().info("generate maindexList......");
1,461,013
public void clearTempDirectory() {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>File[] files = dir.listFiles();<NEW_LINE>if (files == null)<NEW_LINE>throw new IllegalStateException("Not a directory: " + tempDir);<NEW_LINE>Date currentDate = timeSource.currentTimestamp();<NEW_LINE>for (File file : files) {<NEW_LINE>Date fileDate = new Date(file.lastModified());<NEW_LINE>Calendar calendar = new GregorianCalendar();<NEW_LINE>calendar.setTime(fileDate);<NEW_LINE>calendar.add(Calendar.DAY_OF_YEAR, 2);<NEW_LINE>if (currentDate.compareTo(calendar.getTime()) > 0) {<NEW_LINE>deleteFileLink(file.getAbsolutePath());<NEW_LINE>if (!file.delete()) {<NEW_LINE>log.warn(String.format("Could not remove temp file %s", file.getName()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>log.error(ex.getMessage(), ex);<NEW_LINE>}<NEW_LINE>}
File dir = new File(tempDir);
1,275,127
private static String loadLibraryFromClasspath(Platform platform) {<NEW_LINE>Path tmp = null;<NEW_LINE>try {<NEW_LINE>String libName = System.mapLibraryName(LIB_NAME);<NEW_LINE>Path cacheFolder = Utils.getEngineCacheDir("mxnet");<NEW_LINE>String version = platform.getVersion();<NEW_LINE>String flavor = platform.getFlavor();<NEW_LINE>if ("cpu".equals(flavor)) {<NEW_LINE>flavor = "mkl";<NEW_LINE>} else if (!flavor.endsWith("mkl")) {<NEW_LINE>// NOPMD<NEW_LINE>flavor += "mkl";<NEW_LINE>}<NEW_LINE>String classifier = platform.getClassifier();<NEW_LINE>Path dir = cacheFolder.resolve(version + '-' + flavor + '-' + classifier);<NEW_LINE>logger.debug("Using cache dir: {}", dir);<NEW_LINE>Path path = dir.resolve(libName);<NEW_LINE>if (Files.exists(path)) {<NEW_LINE>return path<MASK><NEW_LINE>}<NEW_LINE>Files.createDirectories(cacheFolder);<NEW_LINE>tmp = Files.createTempDirectory(cacheFolder, "tmp");<NEW_LINE>for (String file : platform.getLibraries()) {<NEW_LINE>String libPath = "native/lib/" + file;<NEW_LINE>logger.info("Extracting {} to cache ...", libPath);<NEW_LINE>try (InputStream is = ClassLoaderUtils.getResourceAsStream(libPath)) {<NEW_LINE>Files.copy(is, tmp.resolve(file), StandardCopyOption.REPLACE_EXISTING);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Utils.moveQuietly(tmp, dir);<NEW_LINE>return path.toAbsolutePath().toString();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new IllegalStateException("Failed to extract MXNet native library", e);<NEW_LINE>} finally {<NEW_LINE>if (tmp != null) {<NEW_LINE>Utils.deleteQuietly(tmp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.toAbsolutePath().toString();
1,189,800
private static void addAFM(String fontName, String afmName) throws IOException {<NEW_LINE>STANDARD_14_NAMES.add(fontName);<NEW_LINE>STANDARD_14_MAPPING.put(fontName, afmName);<NEW_LINE>if (STANDARD14_AFM_MAP.containsKey(afmName)) {<NEW_LINE>STANDARD14_AFM_MAP.put(fontName, STANDARD14_AFM_MAP.get(afmName));<NEW_LINE>}<NEW_LINE>String resourceName = "com/tom_roush/pdfbox/resources/afm/" + afmName + ".afm";<NEW_LINE>InputStream afmStream;<NEW_LINE>if (PDFBoxResourceLoader.isReady()) {<NEW_LINE>afmStream = PDFBoxResourceLoader.getStream(resourceName);<NEW_LINE>} else {<NEW_LINE>afmStream = PDType1Font.class.getResourceAsStream("/" + resourceName);<NEW_LINE>}<NEW_LINE>if (afmStream == null) {<NEW_LINE>throw new IOException(resourceName + " not found");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>AFMParser parser = new AFMParser(afmStream);<NEW_LINE>FontMetrics <MASK><NEW_LINE>STANDARD14_AFM_MAP.put(fontName, metric);<NEW_LINE>} finally {<NEW_LINE>afmStream.close();<NEW_LINE>}<NEW_LINE>}
metric = parser.parse(true);
1,731,613
public void leaderboardGetName(final Response.Listener<InlineResponse200> responseListener, final Response.ErrorListener errorListener) {<NEW_LINE>Object postBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String path = "/leaderboard/name".replaceAll("\\{format\\}", "json");<NEW_LINE>// query params<NEW_LINE>List<Pair> queryParams = new ArrayList<Pair>();<NEW_LINE>// header params<NEW_LINE>Map<String, String> headerParams = new HashMap<String, String>();<NEW_LINE>// form params<NEW_LINE>Map<String, String> formParams = new HashMap<String, String>();<NEW_LINE>String[] contentTypes = { "application/json", "application/x-www-form-urlencoded" };<NEW_LINE>String contentType = contentTypes.length > <MASK><NEW_LINE>if (contentType.startsWith("multipart/form-data")) {<NEW_LINE>// file uploading<NEW_LINE>MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();<NEW_LINE>HttpEntity httpEntity = localVarBuilder.build();<NEW_LINE>postBody = httpEntity;<NEW_LINE>} else {<NEW_LINE>// normal form params<NEW_LINE>}<NEW_LINE>String[] authNames = new String[] { "apiExpires", "apiKey", "apiSignature" };<NEW_LINE>try {<NEW_LINE>apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, new Response.Listener<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(String localVarResponse) {<NEW_LINE>try {<NEW_LINE>responseListener.onResponse((InlineResponse200) ApiInvoker.deserialize(localVarResponse, "", InlineResponse200.class));<NEW_LINE>} catch (ApiException exception) {<NEW_LINE>errorListener.onErrorResponse(new VolleyError(exception));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, new Response.ErrorListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onErrorResponse(VolleyError error) {<NEW_LINE>errorListener.onErrorResponse(error);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (ApiException ex) {<NEW_LINE>errorListener.onErrorResponse(new VolleyError(ex));<NEW_LINE>}<NEW_LINE>}
0 ? contentTypes[0] : "application/json";
544,858
public InstanceStateChangeReason unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>InstanceStateChangeReason instanceStateChangeReason = new InstanceStateChangeReason();<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("Code", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>instanceStateChangeReason.setCode(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Message", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>instanceStateChangeReason.setMessage(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 instanceStateChangeReason;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
537,144
public Resource<Bitmap> transform(Resource<Bitmap> resource, int outWidth, int outHeight) {<NEW_LINE><MASK><NEW_LINE>int width = source.getWidth();<NEW_LINE>int height = source.getHeight();<NEW_LINE>int scaledWidth = width / mSampling;<NEW_LINE>int scaledHeight = height / mSampling;<NEW_LINE>Bitmap bitmap = mBitmapPool.get(scaledWidth, scaledHeight, Bitmap.Config.ARGB_8888);<NEW_LINE>if (bitmap == null) {<NEW_LINE>bitmap = Bitmap.createBitmap(scaledWidth, scaledHeight, Bitmap.Config.ARGB_8888);<NEW_LINE>}<NEW_LINE>Canvas canvas = new Canvas(bitmap);<NEW_LINE>canvas.scale(1 / (float) mSampling, 1 / (float) mSampling);<NEW_LINE>Paint paint = new Paint();<NEW_LINE>paint.setFlags(Paint.FILTER_BITMAP_FLAG);<NEW_LINE>canvas.drawBitmap(source, 0, 0, paint);<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {<NEW_LINE>try {<NEW_LINE>bitmap = RSBlur.getInstance(mContext).blur(bitmap, mRadius);<NEW_LINE>} catch (RSRuntimeException e) {<NEW_LINE>bitmap = FastBlur.blur(bitmap, mRadius, true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>bitmap = FastBlur.blur(bitmap, mRadius, true);<NEW_LINE>}<NEW_LINE>return BitmapResource.obtain(bitmap, mBitmapPool);<NEW_LINE>}
Bitmap source = resource.get();
1,223,434
protected void initialize() throws IOException {<NEW_LINE>if (generateJPA) {<NEW_LINE>// NOI18N<NEW_LINE>newClassTree = genUtils.addAnnotation(newClassTree, genUtils.createAnnotation("javax.persistence.Entity"));<NEW_LINE>if (dbMappings.getTableName() != null && !entityClassName.equalsIgnoreCase(dbMappings.getTableName())) {<NEW_LINE>// NOI18N<NEW_LINE>List<ExpressionTree> tableAnnArgs = Collections.singletonList(genUtils.createAnnotationArgument("name", dbMappings.getTableName()));<NEW_LINE>// NOI18N<NEW_LINE>newClassTree = genUtils.addAnnotation(newClassTree, genUtils.createAnnotation("javax.persistence.Table", tableAnnArgs));<NEW_LINE>}<NEW_LINE>} else if (dbMappings.getTableName() != null && !entityClassName.equalsIgnoreCase(dbMappings.getTableName())) {<NEW_LINE>// NOI18N<NEW_LINE>List<ExpressionTree> tableAnnArgs = Collections.singletonList(genUtils.createAnnotationArgument(null<MASK><NEW_LINE>// NOI18N<NEW_LINE>newClassTree = genUtils.addAnnotation(newClassTree, genUtils.createAnnotation("io.micronaut.data.annotation.MappedEntity", tableAnnArgs));<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>newClassTree = genUtils.addAnnotation(newClassTree, genUtils.createAnnotation("io.micronaut.data.annotation.MappedEntity"));<NEW_LINE>}<NEW_LINE>}
, dbMappings.getTableName()));
396,286
public void run() {<NEW_LINE>try {<NEW_LINE>Map resp = (Map) handler.invoke(buildRequestMap(req));<NEW_LINE>if (resp == null) {<NEW_LINE>// handler return null<NEW_LINE>cb.run(HttpEncode(404, new HeaderMap()<MASK><NEW_LINE>eventLogger.log(eventNames.serverStatus404);<NEW_LINE>} else {<NEW_LINE>Object body = resp.get(BODY);<NEW_LINE>if (!(body instanceof AsyncChannel)) {<NEW_LINE>// hijacked<NEW_LINE>HeaderMap headers = HeaderMap.camelCase((Map) resp.get(HEADERS));<NEW_LINE>if (req.version == HTTP_1_0 && req.isKeepAlive) {<NEW_LINE>headers.put("Connection", "Keep-Alive");<NEW_LINE>}<NEW_LINE>final int status = getStatus(resp);<NEW_LINE>cb.run(HttpEncode(status, headers, body, this.serverHeader));<NEW_LINE>eventLogger.log(eventNames.serverStatusPrefix + status);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>cb.run(HttpEncode(500, new HeaderMap(), e.getMessage(), this.serverHeader));<NEW_LINE>errorLogger.log(req.method + " " + req.uri, e);<NEW_LINE>eventLogger.log(eventNames.serverStatus500);<NEW_LINE>}<NEW_LINE>}
, null, this.serverHeader));
892,500
public void doSetup() {<NEW_LINE>sz = (int) Math.cbrt(size / 8) / 2;<NEW_LINE>n = sz - 2;<NEW_LINE>a0 = new float[sz * sz * sz];<NEW_LINE>a1 = new float[sz * sz * sz];<NEW_LINE>ainit = new float[sz * sz * sz];<NEW_LINE>Arrays.fill(a1, 0);<NEW_LINE>final <MASK><NEW_LINE>for (int i = 1; i < n + 1; i++) {<NEW_LINE>for (int j = 1; j < n + 1; j++) {<NEW_LINE>for (int k = 1; k < n + 1; k++) {<NEW_LINE>ainit[(i * sz * sz) + (j * sz) + k] = rand.nextFloat();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>copy(sz, ainit, a0);<NEW_LINE>//<NEW_LINE>ts = //<NEW_LINE>new TaskSchedule("benchmark").//<NEW_LINE>streamIn(//<NEW_LINE>a0, //<NEW_LINE>a1).//<NEW_LINE>task(//<NEW_LINE>"stencil", //<NEW_LINE>Stencil::stencil3d, //<NEW_LINE>n, //<NEW_LINE>sz, //<NEW_LINE>a0, //<NEW_LINE>a1, //<NEW_LINE>FAC).//<NEW_LINE>task(//<NEW_LINE>"copy", //<NEW_LINE>Stencil::copy, //<NEW_LINE>sz, //<NEW_LINE>a1, a0).streamOut(a0);<NEW_LINE>ts.getTask("stencil");<NEW_LINE>ts.warmup();<NEW_LINE>}
Random rand = new Random(7);
430,925
public void handle(Promise<RowSet<Row>> promise) {<NEW_LINE>try {<NEW_LINE>PreparedStatement preparedStatement = connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);<NEW_LINE>for (Tuple tuple : batch) {<NEW_LINE>setParams(tuple, preparedStatement);<NEW_LINE>preparedStatement.addBatch();<NEW_LINE>}<NEW_LINE>VertxRowSetImpl vertxRowSet = new VertxRowSetImpl();<NEW_LINE>vertxRowSet.setAffectRow(Arrays.stream(preparedStatement.executeBatch()).sum());<NEW_LINE>long lastInsertId = 0;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>while (generatedKeys.next()) {<NEW_LINE>BigDecimal aLong = generatedKeys.getBigDecimal(1);<NEW_LINE>lastInsertId = aLong.longValue();<NEW_LINE>}<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE>LOGGER.error("", throwable);<NEW_LINE>}<NEW_LINE>vertxRowSet.setLastInsertId(lastInsertId);<NEW_LINE>promise.tryComplete(vertxRowSet);<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE>promise.tryFail(throwable);<NEW_LINE>}<NEW_LINE>}
ResultSet generatedKeys = preparedStatement.getGeneratedKeys();
189,690
private static long stringToMillis(String dateTime) {<NEW_LINE>Calendar cal = Calendar.getInstance();<NEW_LINE>cal.set(Calendar.MILLISECOND, 0);<NEW_LINE>java.util.StringTokenizer st = new java.util.StringTokenizer(dateTime, "- :");<NEW_LINE>cal.set(Calendar.YEAR, Integer.parseInt(st.nextToken()));<NEW_LINE>cal.set(Calendar.MONTH, Integer.parseInt(st.nextToken()) - 1);<NEW_LINE>cal.set(Calendar.DAY_OF_MONTH, Integer.parseInt(st.nextToken()));<NEW_LINE>if (st.hasMoreTokens()) {<NEW_LINE>cal.set(Calendar.HOUR_OF_DAY, Integer.parseInt(st.nextToken()));<NEW_LINE>cal.set(Calendar.MINUTE, Integer.parseInt(st.nextToken()));<NEW_LINE>cal.set(Calendar.SECOND, Integer.parseInt<MASK><NEW_LINE>if (st.hasMoreTokens()) {<NEW_LINE>cal.setTimeZone(TimeZone.getTimeZone(st.nextToken()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>cal.set(Calendar.HOUR_OF_DAY, 0);<NEW_LINE>cal.set(Calendar.MINUTE, 0);<NEW_LINE>cal.set(Calendar.SECOND, 0);<NEW_LINE>}<NEW_LINE>return cal.getTimeInMillis();<NEW_LINE>}
(st.nextToken()));
1,015,314
public static void loadRoutingFiles(@NonNull final OsmandApplication app, @Nullable final LoadRoutingFilesCallback callback) {<NEW_LINE>new AsyncTask<Void, Void, Map<String, RoutingConfiguration.Builder>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Map<String, RoutingConfiguration.Builder> doInBackground(Void... voids) {<NEW_LINE>Map<String, String> defaultAttributes = getDefaultAttributes();<NEW_LINE>Map<String, RoutingConfiguration.Builder> customConfigs = new HashMap<>();<NEW_LINE>File routingFolder = app.getAppPath(IndexConstants.ROUTING_PROFILES_DIR);<NEW_LINE>if (routingFolder.isDirectory()) {<NEW_LINE>File[] fl = routingFolder.listFiles();<NEW_LINE>if (fl != null && fl.length > 0) {<NEW_LINE>for (File f : fl) {<NEW_LINE>if (f.isFile() && f.getName().endsWith(IndexConstants.ROUTING_FILE_EXT) && f.canRead()) {<NEW_LINE>try {<NEW_LINE>String fileName = f.getName();<NEW_LINE>RoutingConfiguration.Builder builder = new RoutingConfiguration.Builder(defaultAttributes);<NEW_LINE>RoutingConfiguration.parseFromInputStream(new FileInputStream(f), fileName, builder);<NEW_LINE><MASK><NEW_LINE>} catch (XmlPullParserException | IOException e) {<NEW_LINE>Algorithms.removeAllFiles(f);<NEW_LINE>LOG.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return customConfigs;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onPostExecute(Map<String, RoutingConfiguration.Builder> customConfigs) {<NEW_LINE>if (!customConfigs.isEmpty()) {<NEW_LINE>app.getCustomRoutingConfigs().putAll(customConfigs);<NEW_LINE>}<NEW_LINE>app.avoidSpecificRoads.initRouteObjects(false);<NEW_LINE>if (callback != null) {<NEW_LINE>callback.onRoutingFilesLoaded();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>private Map<String, String> getDefaultAttributes() {<NEW_LINE>Map<String, String> defaultAttributes = new HashMap<>();<NEW_LINE>RoutingConfiguration.Builder builder = RoutingConfiguration.getDefault();<NEW_LINE>for (Map.Entry<String, String> entry : builder.getAttributes().entrySet()) {<NEW_LINE>String key = entry.getKey();<NEW_LINE>if (!"routerName".equals(key)) {<NEW_LINE>defaultAttributes.put(key, entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return defaultAttributes;<NEW_LINE>}<NEW_LINE>}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);<NEW_LINE>}
customConfigs.put(fileName, builder);
1,066,874
public ArmatureDebugger addArmatureFrom(Armature armature, Spatial forSpatial) {<NEW_LINE>ArmatureDebugger ad = armatures.get(armature);<NEW_LINE>if (ad != null) {<NEW_LINE>return ad;<NEW_LINE>}<NEW_LINE>JointInfoVisitor visitor = new JointInfoVisitor(armature);<NEW_LINE>forSpatial.depthFirstTraversal(visitor);<NEW_LINE>ad = new ArmatureDebugger(forSpatial.getName() + "_Armature", armature, visitor.deformingJoints);<NEW_LINE>ad.setLocalTransform(forSpatial.getWorldTransform());<NEW_LINE>if (forSpatial instanceof Node) {<NEW_LINE>List<Geometry> geoms = new ArrayList<>();<NEW_LINE>findGeoms((Node) forSpatial, geoms);<NEW_LINE>if (geoms.size() == 1) {<NEW_LINE>ad.setLocalTransform(geoms.get(0).getWorldTransform());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>armatures.put(armature, ad);<NEW_LINE>debugNode.attachChild(ad);<NEW_LINE>if (isInitialized()) {<NEW_LINE>ad.initialize(app.getAssetManager(<MASK><NEW_LINE>}<NEW_LINE>return ad;<NEW_LINE>}
), app.getCamera());
1,390,752
public Promise<OneResult<?>, OneReject<Throwable>, Void> race(Iterable<?> iterable) {<NEW_LINE>if (iterable == null) {<NEW_LINE>throw new IllegalArgumentException("Iterable is null");<NEW_LINE>}<NEW_LINE>Iterator<?> iterator = iterable.iterator();<NEW_LINE>if (!iterator.hasNext()) {<NEW_LINE>throw new IllegalArgumentException("Iterable is empty");<NEW_LINE>}<NEW_LINE>List<Object> items <MASK><NEW_LINE>List<DeferredFutureTask<?, ?>> allTasks = new ArrayList<DeferredFutureTask<?, ?>>();<NEW_LINE>// First pass, check each element to make sure it can be converted to a promise<NEW_LINE>// This is done in 2 passes because we don't want to submit tasks but also throw an Exception because some<NEW_LINE>// object was not able to convert. The method should succeed all or nothing.<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Object object = iterator.next();<NEW_LINE>if (!canPromise(object)) {<NEW_LINE>throw new IllegalArgumentException("An item of type " + object.getClass().getName() + " cannot be converted to a DeferredFutureTask");<NEW_LINE>}<NEW_LINE>// additional check: we can't use Promise to create a DeferredFutureTask<NEW_LINE>if (object instanceof Promise) {<NEW_LINE>throw new IllegalArgumentException("An item of type " + object.getClass().getName() + " cannot be converted to a DeferredFutureTask");<NEW_LINE>}<NEW_LINE>items.add(object);<NEW_LINE>}<NEW_LINE>// Second pass, now we know every object can be converted to a DeferredFutureTask, convert them<NEW_LINE>for (Object item : items) {<NEW_LINE>allTasks.add(toDeferredFutureTask(item));<NEW_LINE>}<NEW_LINE>return submitForSingle(allTasks.toArray(new DeferredFutureTask[allTasks.size()]));<NEW_LINE>}
= new LinkedList<Object>();
942,963
private CompiledQuery sqlShowColumns(SqlExecutionContext executionContext) throws SqlException {<NEW_LINE>CharSequence tok;<NEW_LINE>tok = SqlUtil.fetchNext(lexer);<NEW_LINE>if (null == tok || !isFromKeyword(tok)) {<NEW_LINE>throw SqlException.position(lexer.getPosition()).put("expected 'from'");<NEW_LINE>}<NEW_LINE>tok = SqlUtil.fetchNext(lexer);<NEW_LINE>if (null == tok) {<NEW_LINE>throw SqlException.position(lexer.getPosition()).put("expected a table name");<NEW_LINE>}<NEW_LINE>final CharSequence tableName = GenericLexer.assertNoDotsAndSlashes(GenericLexer.unquote(tok), lexer.lastTokenPosition());<NEW_LINE>int status = engine.getStatus(executionContext.getCairoSecurityContext(), path, tableName, 0, tableName.length());<NEW_LINE>if (status != TableUtils.TABLE_EXISTS) {<NEW_LINE>throw SqlException.position(lexer.lastTokenPosition()).put('\'').put<MASK><NEW_LINE>}<NEW_LINE>return compiledQuery.of(new ShowColumnsRecordCursorFactory(tableName));<NEW_LINE>}
(tableName).put("' is not a valid table");
870,295
public void testClientLtpaHander_ClientNoTokenWithSSLDefault(Map<String, String> param, StringBuilder ret) {<NEW_LINE>String serverIP = param.get("hostname");<NEW_LINE>String serverPort = param.get("secport");<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("testClientLtpaHander_ClientNoTokenWithSSLDefault: incorrect thread name");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>jaxrs21Thread.setName(threadName);<NEW_LINE>ExecutorService executorService = Executors.newSingleThreadExecutor(jaxrs21ThreadFactory);<NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder().executorService(executorService);<NEW_LINE>Client c = cb.build();<NEW_LINE>c.property("com.ibm.ws.jaxrs.client.ltpa.handler", "true");<NEW_LINE>WebTarget t = c.target("https://" + serverIP + ":" + serverPort + "/" + moduleName + "/Test/BasicResource").path("echo").path(param.get("param"));<NEW_LINE>Builder builder = t.request();<NEW_LINE>CompletionStageRxInvoker completionStageRxInvoker = builder.rx();<NEW_LINE>CompletionStage<String> completionStage = completionStageRxInvoker.get(String.class);<NEW_LINE>CompletableFuture<String<MASK><NEW_LINE>try {<NEW_LINE>String response = completableFuture.get();<NEW_LINE>ret.append(response);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>c.close();<NEW_LINE>}
> completableFuture = completionStage.toCompletableFuture();
909,771
void refresh() throws SQLException {<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>PreparedStatement stmt = getPositionsStmt();<NEW_LINE>stmt.setString(1, _source);<NEW_LINE>rs = stmt.executeQuery();<NEW_LINE>if (rs.next()) {<NEW_LINE>_producelogid = rs.getInt(1);<NEW_LINE>_logrid = rs.getInt(2);<NEW_LINE>_applylogid = rs.getInt(3);<NEW_LINE><MASK><NEW_LINE>_logmaxrid = rs.getInt(5);<NEW_LINE>long currentLogMaxScn = rs.getLong(6);<NEW_LINE>if (currentLogMaxScn > 0) {<NEW_LINE>if (_lastlogmaxscn > currentLogMaxScn) {<NEW_LINE>throw new RuntimeException("_lastlogmaxscn=" + _lastlogmaxscn + " currentLogMaxScn=" + currentLogMaxScn + " applylogid=" + _applylogid + " producerlogid=" + _producelogid + " tabrid=" + _tabrid + " logrid=" + _logrid + " logmaxrid=" + _logmaxrid);<NEW_LINE>}<NEW_LINE>_lastlogmaxscn = currentLogMaxScn;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>LOG.error("Error occured during refresh of sourcePositions", e);<NEW_LINE>if (null != rs) {<NEW_LINE>rs.close();<NEW_LINE>rs = null;<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}
_tabrid = rs.getInt(4);
1,655,813
protected EmittedArtifact emitSelectionScript(TreeLogger logger, LinkerContext context, ArtifactSet artifacts) throws UnableToCompleteException {<NEW_LINE>// Find the single Script result<NEW_LINE>Set<Script> results = artifacts.find(Script.class);<NEW_LINE>if (results.size() != 1) {<NEW_LINE>logger.log(TreeLogger.ERROR, "The module must have exactly one distinct" + " permutation when using the " + getDescription() + " Linker; found " + results.size(), null);<NEW_LINE>throw new UnableToCompleteException();<NEW_LINE>}<NEW_LINE>Script result = results.iterator().next();<NEW_LINE>DefaultTextOutput out = new DefaultTextOutput(true);<NEW_LINE>// Emit the selection script.<NEW_LINE>String bootstrap = generateSelectionScript(logger, context, artifacts);<NEW_LINE>bootstrap = context.optimizeJavaScript(logger, bootstrap);<NEW_LINE>out.print(bootstrap);<NEW_LINE>out.newlineOpt();<NEW_LINE>// Emit the module's JS a closure.<NEW_LINE>out.print("(function () {");<NEW_LINE>out.newlineOpt();<NEW_LINE>out.print("var $gwt_version = \"" + About.getGwtVersionNum() + "\";");<NEW_LINE>out.newlineOpt();<NEW_LINE>out.print("var $wnd = window;");<NEW_LINE>out.newlineOpt();<NEW_LINE>out.print("var $doc = $wnd.document;");<NEW_LINE>out.newlineOpt();<NEW_LINE>out.print("var $moduleName, $moduleBase;");<NEW_LINE>out.newlineOpt();<NEW_LINE>out.print("var $stats = $wnd.__gwtStatsEvent ? function(a) {$wnd.__gwtStatsEvent(a)} : null;");<NEW_LINE>out.newlineOpt();<NEW_LINE>out.print("var $strongName = '" + result.getStrongName() + "';");<NEW_LINE>out.newlineOpt();<NEW_LINE>out.<MASK><NEW_LINE>// Generate the call to tell the bootstrap code that we're ready to go.<NEW_LINE>out.newlineOpt();<NEW_LINE>out.print("if (" + context.getModuleFunctionName() + ") " + context.getModuleFunctionName() + ".onScriptLoad(gwtOnLoad);");<NEW_LINE>out.newlineOpt();<NEW_LINE>out.print("})();");<NEW_LINE>out.newlineOpt();<NEW_LINE>return emitString(logger, out.toString(), context.getModuleName() + ".nocache.js");<NEW_LINE>}
print(result.getJavaScript());
1,146,624
private static void showTree(StringBuilder builder, MetaPackage mp, boolean onlyCompiled) {<NEW_LINE>List<MetaPackage> childPackages = mp.getChildPackages();<NEW_LINE>for (MetaPackage childPackage : childPackages) {<NEW_LINE>showTree(builder, childPackage, onlyCompiled);<NEW_LINE>}<NEW_LINE>List<MetaClass> packageClasses = mp.getPackageClasses();<NEW_LINE>for (MetaClass metaClass : packageClasses) {<NEW_LINE>for (IMetaMember member : metaClass.getMetaMembers()) {<NEW_LINE>boolean isCompiled = member.isCompiled();<NEW_LINE>if (!onlyCompiled || isCompiled) {<NEW_LINE>builder.append(mp.getName()).append(HEADLESS_SEPARATOR);<NEW_LINE>builder.append(metaClass.getName()).append(HEADLESS_SEPARATOR);<NEW_LINE>builder.append(member.toStringUnqualifiedMethodName(true, true)).append(HEADLESS_SEPARATOR);<NEW_LINE>builder.append(isCompiled ? "Y" : "N").append(HEADLESS_SEPARATOR);<NEW_LINE>builder.append(getCompiledAttributeOrNA(member, ATTR_COMPILER, S_HYPEN)).append(HEADLESS_SEPARATOR);<NEW_LINE>builder.append(getQueuedAttributeOrNA(member, ATTR_STAMP, S_HYPEN)).append(HEADLESS_SEPARATOR);<NEW_LINE>builder.append(getCompiledAttributeOrNA(member, ATTR_STAMP, S_HYPEN)).append(HEADLESS_SEPARATOR);<NEW_LINE>builder.append(getLastCompilationTime(member)).append(HEADLESS_SEPARATOR);<NEW_LINE>builder.append(getCompiledAttributeOrNA(member, ATTR_BYTES, S_HYPEN)).append(HEADLESS_SEPARATOR);<NEW_LINE>builder.append(getCompiledAttributeOrNA(member, ATTR_NMSIZE, <MASK><NEW_LINE>builder.append(getCompiledAttributeOrNA(member, ATTR_DECOMPILES, "0"));<NEW_LINE>builder.append(S_NEWLINE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
S_HYPEN)).append(HEADLESS_SEPARATOR);
66,627
private List<RebalanceTask> executeTasks(final int batchId, RebalanceBatchPlanProgressBar progressBar, final ExecutorService service, List<RebalanceTaskInfo> rebalanceTaskPlanList, Map<Integer, Semaphore> donorPermits) {<NEW_LINE>List<RebalanceTask> taskList = Lists.newArrayList();<NEW_LINE>int taskId = 0;<NEW_LINE>RebalanceScheduler scheduler <MASK><NEW_LINE>List<StealerBasedRebalanceTask> sbTaskList = Lists.newArrayList();<NEW_LINE>for (RebalanceTaskInfo taskInfo : rebalanceTaskPlanList) {<NEW_LINE>StealerBasedRebalanceTask rebalanceTask = new StealerBasedRebalanceTask(batchId, taskId, taskInfo, donorPermits.get(taskInfo.getDonorId()), adminClient, progressBar, scheduler);<NEW_LINE>taskList.add(rebalanceTask);<NEW_LINE>sbTaskList.add(rebalanceTask);<NEW_LINE>// service.execute(rebalanceTask);<NEW_LINE>taskId++;<NEW_LINE>}<NEW_LINE>scheduler.run(sbTaskList);<NEW_LINE>return taskList;<NEW_LINE>}
= new RebalanceScheduler(service, maxParallelRebalancing);
378,015
// TODO EmitResult should not contain compilation diagnostics.<NEW_LINE>public EmitResult emit(OutputType outputType, Path filePath) {<NEW_LINE>Path generatedArtifact = null;<NEW_LINE>if (diagnosticResult.hasErrors()) {<NEW_LINE>return new EmitResult(false, diagnosticResult, generatedArtifact);<NEW_LINE>}<NEW_LINE>switch(outputType) {<NEW_LINE>case EXEC:<NEW_LINE>generatedArtifact = emitExecutable(filePath);<NEW_LINE>break;<NEW_LINE>case BALA:<NEW_LINE>generatedArtifact = emitBala(filePath);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>List<Diagnostic> pluginDiagnostics = packageCompilation.notifyCompilationCompletion(filePath);<NEW_LINE>if (!pluginDiagnostics.isEmpty()) {<NEW_LINE>ArrayList<Diagnostic> diagnostics = new ArrayList<>(diagnosticResult.allDiagnostics);<NEW_LINE>diagnostics.addAll(pluginDiagnostics);<NEW_LINE>diagnosticResult = new DefaultDiagnosticResult(diagnostics);<NEW_LINE>}<NEW_LINE>// TODO handle the EmitResult properly<NEW_LINE>return new EmitResult(true, diagnosticResult, generatedArtifact);<NEW_LINE>}
throw new RuntimeException("Unexpected output type: " + outputType);
737,155
private void buildTablePartitionInfoAndTopology() {<NEW_LINE>CreateTablePreparedData indexTablePreparedData = gsiPreparedData.getIndexTablePreparedData();<NEW_LINE>SqlDdl sqlDdl = (SqlDdl) relDdl.sqlNode;<NEW_LINE>if (sqlDdl.getKind() == SqlKind.CREATE_TABLE || sqlDdl.getKind() == SqlKind.ALTER_TABLE) {<NEW_LINE>refreshShardingInfo(gsiPreparedData.getIndexDefinition(), indexTablePreparedData);<NEW_LINE>} else if (sqlDdl.getKind() == SqlKind.CREATE_INDEX) {<NEW_LINE>refreshShardingInfo(gsiPreparedData.getSqlCreateIndex(), indexTablePreparedData);<NEW_LINE>} else {<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_DDL_JOB_UNSUPPORTED, "DDL Kind '" + sqlDdl.getKind() + "' for GSI creation");<NEW_LINE>}<NEW_LINE>indexTableBuilder = new CreatePartitionTableBuilder(relDdl, indexTablePreparedData, executionContext, PartitionTableType.GSI_TABLE);<NEW_LINE>PartitionInfo indexPartInfo = indexTableBuilder.getPartitionInfo();<NEW_LINE><MASK><NEW_LINE>if (indexPartInfo.equals(primaryPartitionInfo) && primaryPartitionInfo.getTableGroupId() == TableGroupRecord.INVALID_TABLE_GROUP_ID && indexPartInfo.getTableGroupId() == TableGroupRecord.INVALID_TABLE_GROUP_ID) {<NEW_LINE>physicalLocationAlignWithPrimaryTable(primaryPartitionInfo, indexPartInfo);<NEW_LINE>gsiPreparedData.setIndexAlignWithPrimaryTableGroup(true);<NEW_LINE>}<NEW_LINE>indexTableBuilder.buildTableRuleAndTopology();<NEW_LINE>this.gsiPreparedData.setIndexPartitionInfo(indexTableBuilder.getPartitionInfo());<NEW_LINE>this.partitionInfo = indexTableBuilder.getPartitionInfo();<NEW_LINE>this.tableTopology = indexTableBuilder.getTableTopology();<NEW_LINE>}
PartitionInfo primaryPartitionInfo = gsiPreparedData.getPrimaryPartitionInfo();
783,624
private void createComponent() {<NEW_LINE>myComp = new MyComponent(myContent, this, myShadowBorderProvider != null ? null : myShowPointer ? myPosition.createBorder(this) : getPointlessBorder());<NEW_LINE>if (myActionProvider == null) {<NEW_LINE>final Consumer<MouseEvent> listener = event -> {<NEW_LINE>// noinspection SSBasedInspection<NEW_LINE>SwingUtilities.invokeLater(() -> hide());<NEW_LINE>};<NEW_LINE>myActionProvider = new ActionProvider() {<NEW_LINE><NEW_LINE>private ActionButton myCloseButton;<NEW_LINE><NEW_LINE>@Nonnull<NEW_LINE>@Override<NEW_LINE>public List<ActionButton> createActions() {<NEW_LINE>myCloseButton = new CloseButton(listener);<NEW_LINE>return Collections.singletonList(myCloseButton);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void layout(@Nonnull Rectangle lpBounds) {<NEW_LINE>if (!myCloseButton.isVisible()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>consulo.ui.image.Image icon = getCloseButton();<NEW_LINE>int iconWidth = icon.getWidth();<NEW_LINE>int iconHeight = icon.getHeight();<NEW_LINE>Insets borderInsets = getShadowBorderInsets();<NEW_LINE>myCloseButton.setBounds(lpBounds.x + lpBounds.width - iconWidth - borderInsets.right - JBUIScale.scale(8), lpBounds.y + borderInsets.top + JBUIScale.scale<MASK><NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>myComp.clear();<NEW_LINE>myComp.myAlpha = isAnimationEnabled() ? 0f : -1;<NEW_LINE>myComp.setBorder(new EmptyBorder(getShadowBorderInsets()));<NEW_LINE>myLayeredPane.add(myComp);<NEW_LINE>// the second balloon must be over the first one<NEW_LINE>myLayeredPane.setLayer(myComp, getLayer(), 0);<NEW_LINE>myPosition.updateBounds(this);<NEW_LINE>PopupLocationTracker.register(this);<NEW_LINE>if (myBlockClicks) {<NEW_LINE>myComp.addMouseListener(new MouseAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseClicked(MouseEvent e) {<NEW_LINE>e.consume();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mousePressed(MouseEvent e) {<NEW_LINE>e.consume();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseReleased(MouseEvent e) {<NEW_LINE>e.consume();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
(6), iconWidth, iconHeight);
773,784
default public WebDriver restartDriver(boolean isSameDevice) {<NEW_LINE>WebDriver drv = getDriver(DEFAULT);<NEW_LINE>Device device = nullDevice;<NEW_LINE>DesiredCapabilities caps = new DesiredCapabilities();<NEW_LINE>boolean keepProxy = false;<NEW_LINE>if (isSameDevice) {<NEW_LINE>keepProxy = true;<NEW_LINE>device = getDevice(drv);<NEW_LINE>POOL_LOGGER.debug("Added udid: " + <MASK><NEW_LINE>caps.setCapability("udid", device.getUdid());<NEW_LINE>}<NEW_LINE>POOL_LOGGER.debug("before restartDriver: " + driversPool);<NEW_LINE>for (CarinaDriver carinaDriver : driversPool) {<NEW_LINE>if (carinaDriver.getDriver().equals(drv)) {<NEW_LINE>quitDriver(carinaDriver, keepProxy);<NEW_LINE>// [VD] don't remove break or refactor moving removal out of "for" cycle<NEW_LINE>driversPool.remove(carinaDriver);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>POOL_LOGGER.debug("after restartDriver: " + driversPool);<NEW_LINE>return createDriver(DEFAULT, caps, null);<NEW_LINE>}
device.getUdid() + " to capabilities for restartDriver on the same device.");
1,224,762
public AutogenPythonEnvironmentBlob generate(SourceOfRandomness r, GenerationStatus status) {<NEW_LINE>// if (r.nextBoolean())<NEW_LINE>// return null;<NEW_LINE>AutogenPythonEnvironmentBlob obj = new AutogenPythonEnvironmentBlob();<NEW_LINE>if (r.nextBoolean()) {<NEW_LINE>int size = r.nextInt(0, 10);<NEW_LINE>List<AutogenPythonRequirementEnvironmentBlob> ret = new ArrayList(size);<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>ret.add(gen().type(AutogenPythonRequirementEnvironmentBlob.class).generate(r, status));<NEW_LINE>}<NEW_LINE>obj.setConstraints(Utils.removeEmpty(ret));<NEW_LINE>}<NEW_LINE>if (r.nextBoolean()) {<NEW_LINE>int size = <MASK><NEW_LINE>List<AutogenPythonRequirementEnvironmentBlob> ret = new ArrayList(size);<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>ret.add(gen().type(AutogenPythonRequirementEnvironmentBlob.class).generate(r, status));<NEW_LINE>}<NEW_LINE>obj.setRequirements(Utils.removeEmpty(ret));<NEW_LINE>}<NEW_LINE>if (r.nextBoolean()) {<NEW_LINE>obj.setVersion(Utils.removeEmpty(gen().type(AutogenVersionEnvironmentBlob.class).generate(r, status)));<NEW_LINE>}<NEW_LINE>return obj;<NEW_LINE>}
r.nextInt(0, 10);
410,125
public List<Path> call() throws IOException {<NEW_LINE>// Obtain the size of each file<NEW_LINE>final int numFiles = uriToTargetMap.size();<NEW_LINE>if (numFiles < 1) {<NEW_LINE>// avoid reporting progress like "Retrieving file size 1 of 0"<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>final Map<URI, Long> fileSizes = getSizes();<NEW_LINE>final long totalBytes = sum(fileSizes.values());<NEW_LINE>List<Path> downloadedFiles = new ArrayList<>();<NEW_LINE>int index = 0;<NEW_LINE>long completedFilesBytes = 0;<NEW_LINE>for (Map.Entry<URI, Path> entry : uriToTargetMap.entrySet()) {<NEW_LINE>final int downloadedFileCount = index + 1;<NEW_LINE>final long previousFilesBytes = completedFilesBytes;<NEW_LINE>SingleFileTransferProgressListener singleDownloadListener = (fileDownloadedBytes, fileTotalBytes) -> progressListener.onDownloadProgress(previousFilesBytes + fileDownloadedBytes, totalBytes, downloadedFileCount, numFiles);<NEW_LINE>// Converting URI to URL in order to pass it SingleFileDownloader's constructor<NEW_LINE>URL url = entry<MASK><NEW_LINE>SingleFileDownloader fileDownloader = new SingleFileDownloader(url, entry.getValue(), singleDownloadListener);<NEW_LINE>downloadedFiles.add(fileDownloader.call());<NEW_LINE>completedFilesBytes += fileSizes.get(entry.getKey());<NEW_LINE>index++;<NEW_LINE>}<NEW_LINE>return downloadedFiles;<NEW_LINE>}
.getKey().toURL();
368,562
public void addServiceService(final String objectName, final String serviceAddress, final ServiceQueue serviceQueue) {<NEW_LINE>servicesToStop.add(serviceQueue);<NEW_LINE>servicesToFlush.add(serviceQueue);<NEW_LINE>QueueDispatch dispatch = new QueueDispatch(serviceQueue);<NEW_LINE>if (serviceAddress != null && !serviceAddress.isEmpty()) {<NEW_LINE>serviceMapping.put(serviceAddress, dispatch);<NEW_LINE>}<NEW_LINE>if (objectName != null) {<NEW_LINE>serviceMapping.put(objectName, dispatch);<NEW_LINE>}<NEW_LINE>serviceMapping.put(serviceQueue.name(<MASK><NEW_LINE>serviceMapping.put(serviceQueue.name(), dispatch);<NEW_LINE>serviceMapping.put(serviceQueue.address(), dispatch);<NEW_LINE>serviceMapping.put(serviceQueue.address().toLowerCase(), dispatch);<NEW_LINE>sendQueues.add(dispatch.requests);<NEW_LINE>final Collection<String> addresses = serviceQueue.addresses(this.rootAddress);<NEW_LINE>if (debug) {<NEW_LINE>logger.debug(ServiceBundleImpl.class.getName() + " addresses: " + addresses);<NEW_LINE>}<NEW_LINE>for (String addr : addresses) {<NEW_LINE>serviceMapping.put(addr, dispatch);<NEW_LINE>}<NEW_LINE>}
).toLowerCase(), dispatch);
923,500
private void loadNode540() {<NEW_LINE>SessionSecurityDiagnosticsTypeNode node = new SessionSecurityDiagnosticsTypeNode(this.context, Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics, new QualifiedName(0, "SessionSecurityDiagnostics"), new LocalizedText("en", "SessionSecurityDiagnostics"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.SessionSecurityDiagnosticsDataType, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics, Identifiers.HasComponent, Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics_SessionId.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics, Identifiers.HasComponent, Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics_ClientUserIdOfSession.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics, Identifiers.HasComponent, Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics_ClientUserIdHistory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics, Identifiers.HasComponent, Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics_AuthenticationMechanism.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics, Identifiers.HasComponent, Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics_Encoding.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics, Identifiers.HasComponent, Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics_TransportProtocol.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics, Identifiers.HasComponent, Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics_SecurityMode.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics, Identifiers.HasComponent, Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics_SecurityPolicyUri.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics, Identifiers.HasComponent, Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics_ClientCertificate<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics, Identifiers.HasTypeDefinition, Identifiers.SessionSecurityDiagnosticsType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.SessionDiagnosticsObjectType_SessionSecurityDiagnostics, Identifiers.HasComponent, Identifiers.SessionDiagnosticsObjectType.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
1,216,417
private boolean equalContent(IParseRootNode inputParseResult, String output) {<NEW_LINE>if (output == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>output = output.trim();<NEW_LINE>IParser parser = checkoutParser();<NEW_LINE>IParseState parseState = new ParseState(output);<NEW_LINE>IParseRootNode outputParseResult = null;<NEW_LINE>try {<NEW_LINE>ParseResult result = parser.parse(parseState);<NEW_LINE>outputParseResult = result.getRootNode();<NEW_LINE>if (outputParseResult == null) {<NEW_LINE>List<IParseError> errors = result.getErrors();<NEW_LINE>for (IParseError parseError : errors) {<NEW_LINE>IdeLog.logError(JSFormatterPlugin.getDefault(), parseError.toString(), IDebugScopes.DEBUG);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>IdeLog.logError(JSFormatterPlugin.getDefault(), e, IDebugScopes.DEBUG);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>checkinParser(parser);<NEW_LINE>// Flatten the AST's and do a string compare<NEW_LINE>// The toString() of the JSParseRootNode calls the JSFormatWalker,<NEW_LINE>// which should generate the same string for the input and the output.<NEW_LINE>String flattenOutputAST = outputParseResult.toString();<NEW_LINE>String flattenInputAST = inputParseResult.toString();<NEW_LINE>boolean <MASK><NEW_LINE>if (!equals) {<NEW_LINE>FormatterUtils.logDiff(flattenInputAST, flattenOutputAST);<NEW_LINE>}<NEW_LINE>return equals;<NEW_LINE>}
equals = flattenOutputAST.equals(flattenInputAST);
32,702
public static <E> int levenshteinDistance(E[] s1, E[] s2) {<NEW_LINE>int[] costs = new int[s2.length + 1];<NEW_LINE>for (int i = 0; i <= s1.length; i++) {<NEW_LINE>int lastValue = i;<NEW_LINE>for (int j = 0; j <= s2.length; j++) {<NEW_LINE>if (i == 0)<NEW_LINE>costs[j] = j;<NEW_LINE>else {<NEW_LINE>if (j > 0) {<NEW_LINE>int newValue = costs[j - 1];<NEW_LINE>if (!s1[i - 1].equals(s2[j - 1]))<NEW_LINE>newValue = Math.min(Math.min(newValue, lastValue), costs[j]) + 1;<NEW_LINE>costs[j - 1] = lastValue;<NEW_LINE>lastValue = newValue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (i > 0)<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return costs[s2.length];<NEW_LINE>}
costs[s2.length] = lastValue;
1,201,310
private void submitChange(String changeId) throws RepoException, ValidationException {<NEW_LINE>try (ProfilerTask ignore = generalOptions.profiler().start("submit_gerrit_change")) {<NEW_LINE>ChangeInfo changeInfo = findChange(changeId);<NEW_LINE>if (changeInfo == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GerritApi gerritApi = gerritOptions.newGerritApi(repoUrl);<NEW_LINE>// If the change isn't yet submittable, try voting Code-Review+2 to approve the change.<NEW_LINE>// The change will generally not be submittable until it receives Code-Review+2, but<NEW_LINE>// individual Gerrit projects can change their Prolog submittability rules to change this<NEW_LINE>// behavior, and even to get rid of the Code-Review label entirely.<NEW_LINE>if (!changeInfo.isSubmittable()) {<NEW_LINE>gerritApi.setReview(changeInfo.getChangeId(), changeInfo.getCurrentRevision(), new SetReviewInput("", ImmutableMap.<MASK><NEW_LINE>}<NEW_LINE>ChangeInfo resultInfo = gerritApi.submitChange(changeInfo.getChangeId(), new SubmitInput(null));<NEW_LINE>console.infoFmt("Submitted change : %s/changes/%s", repoUrl, resultInfo.getChangeId());<NEW_LINE>} catch (RepoException e) {<NEW_LINE>if (e.getMessage().contains("2 is restricted")) {<NEW_LINE>throw new ValidationException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}
of("Code-Review", 2)));
773,603
protected void parse() {<NEW_LINE>showTabNames = getBoolean(SHOW_TEXT_ICONS, true);<NEW_LINE>processImages = getInt(PROCESS_IMAGES, 0);<NEW_LINE>// No default<NEW_LINE>configLocale = getString(LOCALE, null);<NEW_LINE>locale = getString(LOCALE, DEFAULT_LOCALE);<NEW_LINE>useSystemsLocaleForFormat = getBoolean(USE_SYSTEMS_LOCALE_FOR_FORMAT_KEY, true);<NEW_LINE>displayOption = getInt(DISPLAY_OPTION, 1);<NEW_LINE>responsePanelPosition = getString(RESPONSE_PANEL_POS_KEY, WorkbenchPanel.ResponsePanelPosition.TABS_SIDE_BY_SIDE.name());<NEW_LINE>brkPanelViewOption = getInt(BRK_PANEL_VIEW_OPTION, 0);<NEW_LINE>showMainToolbar = getInt(SHOW_MAIN_TOOLBAR_OPTION, 1);<NEW_LINE>advancedViewEnabled = getInt(ADVANCEDUI_OPTION, 0);<NEW_LINE>wmUiHandlingEnabled = getInt(WMUIHANDLING_OPTION, 0);<NEW_LINE>askOnExitEnabled = getInt(ASKONEXIT_OPTION, 1);<NEW_LINE>warnOnTabDoubleClick = getBoolean(WARN_ON_TAB_DOUBLE_CLICK_OPTION, true);<NEW_LINE>mode = getString(MODE_OPTION, Mode.standard.name());<NEW_LINE>outputTabTimeStampingEnabled = getBoolean(OUTPUT_TAB_TIMESTAMPING_OPTION, false);<NEW_LINE>outputTabTimeStampFormat = getString(OUTPUT_TAB_TIMESTAMP_FORMAT, DEFAULT_TIME_STAMP_FORMAT);<NEW_LINE>showLocalConnectRequests = getBoolean(SHOW_LOCAL_CONNECT_REQUESTS, false);<NEW_LINE>showSplashScreen = getBoolean(SPLASHSCREEN_OPTION, true);<NEW_LINE>for (FontUtils.FontType fontType : FontUtils.FontType.values()) {<NEW_LINE>fontNames.put(fontType, getString(getFontNameConfKey(fontType), ""));<NEW_LINE>fontSizes.put(fontType, getInt(getFontSizeConfKey(fontType), -1));<NEW_LINE>}<NEW_LINE>scaleImages = getBoolean(SCALE_IMAGES, true);<NEW_LINE>showDevWarning = getBoolean(SHOW_DEV_WARNING, true);<NEW_LINE>lookAndFeelInfo = new LookAndFeelInfo(getString(LOOK_AND_FEEL, DEFAULT_LOOK_AND_FEEL.getName()), getString(LOOK_AND_FEEL_CLASS, DEFAULT_LOOK_AND_FEEL.getClassName()));<NEW_LINE>allowAppIntegrationInContainers = getBoolean(ALLOW_APP_INTEGRATION_IN_CONTAINERS, false);<NEW_LINE>this.<MASK><NEW_LINE>this.confirmRemoveScannerExcludeRegex = getBoolean(CONFIRM_REMOVE_SCANNER_EXCLUDE_REGEX_KEY, false);<NEW_LINE>this.confirmRemoveSpiderExcludeRegex = getBoolean(CONFIRM_REMOVE_SPIDER_EXCLUDE_REGEX_KEY, false);<NEW_LINE>}
confirmRemoveProxyExcludeRegex = getBoolean(CONFIRM_REMOVE_PROXY_EXCLUDE_REGEX_KEY, false);
834,722
Problem returnType(Problem p, String returnType, ExecutableElement method, TypeElement enclosingTypeElement) {<NEW_LINE>TypeMirror parseType;<NEW_LINE>if (returnType != null && returnType.length() < 1) {<NEW_LINE>// NOI18N<NEW_LINE>p = createProblem(p, true, NbBundle.getMessage(ChangeParametersPlugin<MASK><NEW_LINE>} else if (returnType != null) {<NEW_LINE>TypeElement typeElement = javac.getElements().getTypeElement(returnType);<NEW_LINE>parseType = typeElement == null ? null : typeElement.asType();<NEW_LINE>if (parseType == null) {<NEW_LINE>boolean isGenericType = false;<NEW_LINE>List<? extends TypeParameterElement> typeParameters = method.getTypeParameters();<NEW_LINE>for (TypeParameterElement typeParameterElement : typeParameters) {<NEW_LINE>TypeParameterTree tpTree = (TypeParameterTree) javac.getTrees().getTree(typeParameterElement);<NEW_LINE>if (returnType.equals(tpTree.getName().toString())) {<NEW_LINE>isGenericType = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!isGenericType) {<NEW_LINE>parseType = javac.getTreeUtilities().parseType(returnType, enclosingTypeElement);<NEW_LINE>if (parseType == null || parseType.getKind() == TypeKind.ERROR) {<NEW_LINE>// NOI18N<NEW_LINE>p = createProblem(p, false, NbBundle.getMessage(ChangeParametersPlugin.class, "WRN_canNotResolveReturn", returnType));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return p;<NEW_LINE>}
.class, "ERR_NoReturn", returnType));
549,442
private void loadData(MongoClient db) {<NEW_LINE>db.dropCollection("albums", drop -> {<NEW_LINE>if (drop.failed()) {<NEW_LINE>throw new RuntimeException(drop.cause());<NEW_LINE>}<NEW_LINE>List<JsonObject> <MASK><NEW_LINE>albums.add(new JsonObject().put("artist", "The Wurzels").put("genre", "Scrumpy and Western").put("title", "I Am A Cider Drinker").put("price", 0.99));<NEW_LINE>albums.add(new JsonObject().put("artist", "Vanilla Ice").put("genre", "Hip Hop").put("title", "Ice Ice Baby").put("price", 0.01));<NEW_LINE>albums.add(new JsonObject().put("artist", "Ena Baga").put("genre", "Easy Listening").put("title", "The Happy Hammond").put("price", 0.50));<NEW_LINE>albums.add(new JsonObject().put("artist", "The Tweets").put("genre", "Bird related songs").put("title", "The Birdy Song").put("price", 1.20));<NEW_LINE>for (JsonObject album : albums) {<NEW_LINE>db.insert("albums", album, res -> {<NEW_LINE>System.out.println("inserted " + album.encode());<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
albums = new LinkedList<>();
1,802,988
void buildMergeHandlerWithSubQueries(List<DMLResponseHandler> subQueryEndHandlers, Set<String> queryRouteNodes) {<NEW_LINE>for (DMLResponseHandler endHandler : subQueryEndHandlers) {<NEW_LINE>// clearExplain status<NEW_LINE>SubQueryHandler subQueryHandler = (SubQueryHandler) (endHandler.getNextHandler());<NEW_LINE>if (!isExplain) {<NEW_LINE>subQueryHandler.clearForExplain();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>GlobalVisitor visitor = new GlobalVisitor(node, true, false);<NEW_LINE>visitor.visit();<NEW_LINE>String sql = visitor.getSql().toString();<NEW_LINE>Map<String, String<MASK><NEW_LINE>for (Map.Entry<String, String> tableToSimple : mapTableToSimple.entrySet()) {<NEW_LINE>sql = sql.replace(tableToSimple.getKey(), tableToSimple.getValue());<NEW_LINE>}<NEW_LINE>RouteResultset realRrs = new RouteResultset(sql, ServerParse.SELECT);<NEW_LINE>realRrs.setStatement(sql);<NEW_LINE>realRrs.setComplexSQL(true);<NEW_LINE>buildOneMergeHandler(queryRouteNodes, realRrs);<NEW_LINE>}
> mapTableToSimple = visitor.getMapTableToSimple();
1,229,498
private static ToolTipImage icon2ToolTipImage(Icon icon, URL url) {<NEW_LINE>Parameters.notNull("icon", icon);<NEW_LINE>if (icon instanceof ToolTipImage) {<NEW_LINE>return (ToolTipImage) icon;<NEW_LINE>}<NEW_LINE>ToolTipImage image = new ToolTipImage(icon, "", url, BufferedImage.TYPE_INT_ARGB);<NEW_LINE>Graphics g = image.getGraphics();<NEW_LINE>try {<NEW_LINE>icon.paintIcon(dummyIconComponentLabel, g, 0, 0);<NEW_LINE>} catch (ClassCastException ex) {<NEW_LINE>// java.desktop/javax.swing.plaf.metal.OceanTheme$IFIcon.paintIcon assumes a different component,<NEW_LINE>// so let's try second most used one type, it satisfies AbstractButton, JCheckbox. Not all cases are<NEW_LINE>// covered, however.<NEW_LINE>icon.paintIcon(<MASK><NEW_LINE>}<NEW_LINE>g.dispose();<NEW_LINE>return image;<NEW_LINE>}
dummyIconComponentButton, g, 0, 0);
884,711
final GetUsageForecastResult executeGetUsageForecast(GetUsageForecastRequest getUsageForecastRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getUsageForecastRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetUsageForecastRequest> request = null;<NEW_LINE>Response<GetUsageForecastResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetUsageForecastRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getUsageForecastRequest));<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, "Cost Explorer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetUsageForecast");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetUsageForecastResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetUsageForecastResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
410,636
public static void main(String[] args) {<NEW_LINE>String fileName = UtilIO.pathExample("background/highway_bridge_jitter.mp4");<NEW_LINE>ImageType type = ImageType.pl(3, GrayU8.class);<NEW_LINE>// ImageType type = ImageType.single(GrayU8.class);<NEW_LINE>// ImageType type = ImageType.pl(3, GrayF32.class);<NEW_LINE>// ImageType type = ImageType.single(GrayF32.class);<NEW_LINE>var sequence = new <MASK><NEW_LINE>BufferedImage out;<NEW_LINE>if (sequence.hasNext()) {<NEW_LINE>ImageBase frame = sequence.next();<NEW_LINE>out = new BufferedImage(frame.width, frame.height, BufferedImage.TYPE_INT_RGB);<NEW_LINE>ConvertBufferedImage.convertTo(frame, out, false);<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("No first frame?!?!");<NEW_LINE>}<NEW_LINE>var gui = new ImagePanel(out);<NEW_LINE>ShowImages.showWindow(gui, "Video!", true);<NEW_LINE>long totalNano = 0;<NEW_LINE>while (sequence.hasNext()) {<NEW_LINE>long before = System.nanoTime();<NEW_LINE>ImageBase frame = sequence.next();<NEW_LINE>totalNano += System.nanoTime() - before;<NEW_LINE>ConvertBufferedImage.convertTo(frame, out, false);<NEW_LINE>gui.repaint();<NEW_LINE>// slow it down to make it easier to see what's going on<NEW_LINE>BoofMiscOps.sleep(20);<NEW_LINE>}<NEW_LINE>System.out.printf("JCodec FPS %.1f\n", sequence.getFrameNumber() / (totalNano / 1.0e9));<NEW_LINE>}
JCodecSimplified<>(fileName, type);
495,606
public static void main(String[] args) {<NEW_LINE>final String ilp = "vbw water_speed_longitudinal=0.07,water_speed_transveral=,water_speed_status=\"A\",ground_speed_longitudinal=0,ground_speed_transveral=0,ground_speed_status=\"A\",water_speed_stern_transversal=,water_speed_stern_transversal_status=\"V\",ground_speed_stern_transversal=0,ground_speed_stern_transversal_status=\"V\" 1627046637414969856\n";<NEW_LINE>final int len = ilp.length();<NEW_LINE>long mem = Unsafe.<MASK><NEW_LINE>try {<NEW_LINE>Chars.asciiStrCpy(ilp, len, mem);<NEW_LINE>long fd = Net.socketTcp(true);<NEW_LINE>if (fd != -1) {<NEW_LINE>if (Net.connect(fd, Net.sockaddr("127.0.0.1", 9009)) == 0) {<NEW_LINE>try {<NEW_LINE>int sent = Net.send(fd, mem, len);<NEW_LINE>System.out.println("Sent " + sent + " out of " + len);<NEW_LINE>} finally {<NEW_LINE>Net.close(fd);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>System.out.println("could not connect");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>System.out.println("Could not open socket [errno=" + Os.errno() + "]");<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>Unsafe.free(mem, len, MemoryTag.NATIVE_DEFAULT);<NEW_LINE>}<NEW_LINE>}
malloc(len, MemoryTag.NATIVE_DEFAULT);
1,187,606
public void write(ByteBuffer buf) {<NEW_LINE>freeze();<NEW_LINE>ResChunk_header.write(buf, (short) RES_STRING_POOL_TYPE, () -> {<NEW_LINE>// header<NEW_LINE>int startPos = buf.position();<NEW_LINE>int stringCount = strings.size();<NEW_LINE>// begin string pool...<NEW_LINE>// stringCount<NEW_LINE>buf.putInt(stringCount);<NEW_LINE>// styleCount<NEW_LINE>buf.putInt(0);<NEW_LINE>// flags<NEW_LINE>buf.putInt(UTF8_FLAG);<NEW_LINE>IntWriter stringStart = new IntWriter(buf);<NEW_LINE>// stylesStart<NEW_LINE>buf.putInt(0);<NEW_LINE>stringStart.write(<MASK><NEW_LINE>}, () -> {<NEW_LINE>// contents<NEW_LINE>int stringOffset = /*buf.position() + */<NEW_LINE>8 + 4 * stringsAsBytes.size();<NEW_LINE>for (int i = 0; i < stringsAsBytes.size(); i++) {<NEW_LINE>String string = strings.get(i);<NEW_LINE>byte[] bytes = stringsAsBytes.get(i);<NEW_LINE>buf.putInt(stringOffset);<NEW_LINE>stringOffset += lenLen(string.length()) + lenLen(bytes.length) + bytes.length + 1;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < stringsAsBytes.size(); i++) {<NEW_LINE>// number of chars<NEW_LINE>writeLen(buf, strings.get(i).length());<NEW_LINE>// number of bytes<NEW_LINE>writeLen(buf, stringsAsBytes.get(i).length);<NEW_LINE>// bytes<NEW_LINE>buf.put(stringsAsBytes.get(i));<NEW_LINE>// null terminator<NEW_LINE>buf.put((byte) '\0');<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
buf.position() - startPos);
941,036
@ReactiveTransactional<NEW_LINE>public Uni<Response> login(@RestForm String userName, @BeanParam WebAuthnLoginResponse webAuthnResponse, RoutingContext ctx) {<NEW_LINE>// Input validation<NEW_LINE>if (userName == null || userName.isEmpty() || !webAuthnResponse.isSet() || !webAuthnResponse.isValid()) {<NEW_LINE>return Uni.createFrom().item(Response.status(Status.BAD_REQUEST).build());<NEW_LINE>}<NEW_LINE>Uni<User> userUni = User.findByUserName(userName);<NEW_LINE>return userUni.flatMap(user -> {<NEW_LINE>if (user == null) {<NEW_LINE>// Invalid user<NEW_LINE>return Uni.createFrom().item(Response.status(Status.BAD_REQUEST).build());<NEW_LINE>}<NEW_LINE>Uni<Authenticator> authenticator = this.webAuthnSecurity.login(webAuthnResponse, ctx);<NEW_LINE>return // bump the auth counter<NEW_LINE>authenticator.invoke(auth -> user.webAuthnCredential.counter = auth.getCounter()).map(auth -> {<NEW_LINE>// make a login cookie<NEW_LINE>this.webAuthnSecurity.rememberUser(auth.getUserName(), ctx);<NEW_LINE>return Response<MASK><NEW_LINE>}).// handle login failure<NEW_LINE>onFailure().recoverWithItem(x -> {<NEW_LINE>// make a proper error response<NEW_LINE>return Response.status(Status.BAD_REQUEST).build();<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
.ok().build();
927,877
public void run() throws IOException {<NEW_LINE>verifyInput();<NEW_LINE>if (tokenStrings != null) {<NEW_LINE>numTokens = tokenStrings.size();<NEW_LINE>}<NEW_LINE>Deque<String> domainNames;<NEW_LINE>if (domainNamesFile == null) {<NEW_LINE>domainNames = null;<NEW_LINE>} else {<NEW_LINE>domainNames = newArrayDeque(Splitter.on('\n').omitEmptyStrings().trimResults().split(Files.asCharSource(new File(domainNamesFile), <MASK><NEW_LINE>numTokens = domainNames.size();<NEW_LINE>}<NEW_LINE>int tokensSaved = 0;<NEW_LINE>do {<NEW_LINE>ImmutableSet<AllocationToken> tokens = getNextTokenBatch(tokensSaved).map(t -> {<NEW_LINE>AllocationToken.Builder token = new AllocationToken.Builder().setToken(t).setTokenType(tokenType == null ? SINGLE_USE : tokenType).setAllowedRegistrarIds(ImmutableSet.copyOf(nullToEmpty(allowedClientIds))).setAllowedTlds(ImmutableSet.copyOf(nullToEmpty(allowedTlds)));<NEW_LINE>Optional.ofNullable(discountFraction).ifPresent(token::setDiscountFraction);<NEW_LINE>Optional.ofNullable(discountPremiums).ifPresent(token::setDiscountPremiums);<NEW_LINE>Optional.ofNullable(discountYears).ifPresent(token::setDiscountYears);<NEW_LINE>Optional.ofNullable(tokenStatusTransitions).ifPresent(token::setTokenStatusTransitions);<NEW_LINE>Optional.ofNullable(domainNames).ifPresent(d -> token.setDomainName(d.removeFirst()));<NEW_LINE>return token.build();<NEW_LINE>}).collect(toImmutableSet());<NEW_LINE>// Wrap in a retrier to deal with transient 404 errors (thrown as RemoteApiExceptions).<NEW_LINE>tokensSaved += retrier.callWithRetry(() -> saveTokens(tokens), RemoteApiException.class);<NEW_LINE>} while (tokensSaved < numTokens);<NEW_LINE>}
UTF_8).read()));
175,584
public static void main(String[] args) {<NEW_LINE>// the original array<NEW_LINE>int[] A = new int[] { 18, 17, 13, 19, 15, 11, 20 };<NEW_LINE>SegmentTree st = new SegmentTree(A);<NEW_LINE>System.out.printf(" idx 0, 1, 2, 3, 4, 5, 6\n");<NEW_LINE>System.out.printf(" A is {18,17,13,19,15, 11,20}\n");<NEW_LINE>// answer = index 2<NEW_LINE>System.out.printf("RMQ(1, 3) = %d\n", st.rmq(1, 3));<NEW_LINE>// answer = index 5<NEW_LINE>System.out.printf("RMQ(4, 6) = %d\n", st.rmq(4, 6));<NEW_LINE>// answer = index 4<NEW_LINE>System.out.printf("RMQ(3, 4) = %d\n", st.rmq(3, 4));<NEW_LINE>// answer = index 0<NEW_LINE>System.out.printf("RMQ(0, 0) = %d\n", st.rmq(0, 0));<NEW_LINE>// answer = index 1<NEW_LINE>System.out.printf("RMQ(0, 1) = %d\n", st.rmq(0, 1));<NEW_LINE>// answer = index 5<NEW_LINE>System.out.printf("RMQ(0, 6) = %d\n", st.rmq(0, 6));<NEW_LINE>System.out.printf(" idx 0, 1, 2, 3, 4, 5, 6\n");<NEW_LINE>System.out.printf("Now, modify A into {18,17,13,19,15,100,20}\n");<NEW_LINE>// update A[5] from 11 to 100<NEW_LINE><MASK><NEW_LINE>System.out.printf("These values do not change\n");<NEW_LINE>// 2<NEW_LINE>System.out.printf("RMQ(1, 3) = %d\n", st.rmq(1, 3));<NEW_LINE>// 4<NEW_LINE>System.out.printf("RMQ(3, 4) = %d\n", st.rmq(3, 4));<NEW_LINE>// 0<NEW_LINE>System.out.printf("RMQ(0, 0) = %d\n", st.rmq(0, 0));<NEW_LINE>// 1<NEW_LINE>System.out.printf("RMQ(0, 1) = %d\n", st.rmq(0, 1));<NEW_LINE>System.out.printf("These values change\n");<NEW_LINE>// 5->2<NEW_LINE>System.out.printf("RMQ(0, 6) = %d\n", st.rmq(0, 6));<NEW_LINE>// 5->4<NEW_LINE>System.out.printf("RMQ(4, 6) = %d\n", st.rmq(4, 6));<NEW_LINE>// 5->4<NEW_LINE>System.out.printf("RMQ(4, 5) = %d\n", st.rmq(4, 5));<NEW_LINE>}
st.update_point(5, 100);
680,586
public DdlCommandResult executeCreateStream(final CreateStreamCommand createStream) {<NEW_LINE>final <MASK><NEW_LINE>final DataSource dataSource = metaStore.getSource(sourceName);<NEW_LINE>if (dataSource != null && !createStream.isOrReplace()) {<NEW_LINE>final String sourceType = dataSource.getDataSourceType().getKsqlType();<NEW_LINE>return new DdlCommandResult(true, String.format("Cannot add stream %s: A %s with the same name " + "already exists.", sourceName, sourceType.toLowerCase()));<NEW_LINE>}<NEW_LINE>final KsqlStream<?> ksqlStream = new KsqlStream<>(sql, createStream.getSourceName(), createStream.getSchema(), createStream.getTimestampColumn(), withQuery, getKsqlTopic(createStream), createStream.getIsSource());<NEW_LINE>metaStore.putSource(ksqlStream, createStream.isOrReplace());<NEW_LINE>metaStore.addSourceReferences(ksqlStream.getName(), withQuerySources);<NEW_LINE>return new DdlCommandResult(true, "Stream created");<NEW_LINE>}
SourceName sourceName = createStream.getSourceName();
307,551
public void activate(final BundleContext bundleContext, final Map<String, Object> configuration) {<NEW_LINE>logger.debug("FritzBox TR064 Binding activated!");<NEW_LINE>// to override the default refresh interval one has to add a<NEW_LINE>// parameter to openhab.cfg like <bindingName>:refresh=<intervalInMs><NEW_LINE>String refreshIntervalString = Objects.toString(configuration.get("refresh"), null);<NEW_LINE>if (StringUtils.isNotBlank(refreshIntervalString)) {<NEW_LINE>refreshInterval = Long.parseLong(refreshIntervalString);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// Check if fritzbox parameters were provided in config, otherwise does not make sense going on...<NEW_LINE>String fboxurl = Objects.toString(configuration.get("url"), null);<NEW_LINE>String fboxuser = Objects.toString(configuration.get("user"), null);<NEW_LINE>String fboxpw = Objects.toString(configuration.get("pass"), null);<NEW_LINE>String fboxphonebookid = Objects.toString(configuration.get("phonebookid"), null);<NEW_LINE>if (fboxurl == null) {<NEW_LINE>logger.warn("Fritzbox URL was not provided in config. Shutting down binding.");<NEW_LINE>// how to shutdown??<NEW_LINE>setProperlyConfigured(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (fboxuser == null) {<NEW_LINE>logger.warn("Fritzbox User was not provided in config. Using default username.");<NEW_LINE>}<NEW_LINE>if (fboxpw == null) {<NEW_LINE>logger.warn("Fritzbox Password was not provided in config. Shutting down binding.");<NEW_LINE>// how to shutdown??<NEW_LINE>setProperlyConfigured(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (fboxphonebookid == null) {<NEW_LINE>logger.debug("No Phonebookid provided. Use default: 0");<NEW_LINE>fboxphonebookid = "0";<NEW_LINE>}<NEW_LINE>this._pw = fboxpw;<NEW_LINE>this._user = fboxuser;<NEW_LINE>this._url = fboxurl;<NEW_LINE>try {<NEW_LINE>this._pbid = Integer.valueOf(fboxphonebookid);<NEW_LINE>} catch (NumberFormatException ex) {<NEW_LINE>// set fallback to 0<NEW_LINE>this._pbid = 0;<NEW_LINE>}<NEW_LINE>if (_fboxComm == null) {<NEW_LINE>_fboxComm = new Tr064Comm(_url, _user, _pw);<NEW_LINE>}<NEW_LINE>setProperlyConfigured(true);<NEW_LINE>}
logger.debug("Custom refresh interval set to {}", refreshInterval);
1,816,194
private Mono<Response<Void>> disableWithResponseAsync(String resourceGroupName, String workspaceName, String intelligencePackName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (workspaceName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (intelligencePackName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter intelligencePackName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.disable(this.client.getEndpoint(), resourceGroupName, workspaceName, intelligencePackName, this.client.getApiVersion(), this.client.getSubscriptionId(), context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
1,533,798
public Pair<Gradient, INDArray> backpropGradient(INDArray epsilon, LayerWorkspaceMgr workspaceMgr) {<NEW_LINE>assertInputSet(true);<NEW_LINE>INDArray z = preOutput(true, workspaceMgr);<NEW_LINE>// Shape: [mb, vector, seqLength]<NEW_LINE>INDArray delta = layerConf().getActivationFn().backprop(z, epsilon).getFirst();<NEW_LINE>boolean ncw = layerConf().getOutputFormat() == RNNFormat.NCW;<NEW_LINE>if (maskArray != null) {<NEW_LINE>if (ncw) {<NEW_LINE>delta = Broadcast.mul(delta.castTo(z.dataType()), maskArray.castTo(z.dataType()), delta.castTo(z.dataType()), 0, 2);<NEW_LINE>} else {<NEW_LINE>delta = Broadcast.mul(delta.castTo(z.dataType()), maskArray.castTo(z.dataType()), delta.castTo(z.dataType()), 0, 1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int inputLength = layerConf().getInputLength();<NEW_LINE>long numSamples = input.size(0);<NEW_LINE>val nOut = layerConf().getNOut();<NEW_LINE>if (delta.ordering() != 'c' || delta.isView() || !hasDefaultStridesForShape(delta)) {<NEW_LINE>delta = delta.dup('c');<NEW_LINE>}<NEW_LINE>if (ncw) {<NEW_LINE>// From [minibatch, nOut, length] to [minibatch, length, nOut]<NEW_LINE>delta = delta.permute(0, 2, 1);<NEW_LINE>}<NEW_LINE>delta = delta.reshape('c', inputLength * numSamples, nOut);<NEW_LINE>INDArray weightGradients = gradientViews.get(DefaultParamInitializer.WEIGHT_KEY);<NEW_LINE>weightGradients.assign(0);<NEW_LINE>if (!hasDefaultStridesForShape(input))<NEW_LINE>input = workspaceMgr.dup(<MASK><NEW_LINE>INDArray indices = Nd4j.createFromArray(indexes);<NEW_LINE>Nd4j.scatterUpdate(org.nd4j.linalg.api.ops.impl.scatter.ScatterUpdate.UpdateOp.ADD, weightGradients, indices, delta, WEIGHT_DIM);<NEW_LINE>Gradient ret = new DefaultGradient();<NEW_LINE>ret.gradientForVariable().put(DefaultParamInitializer.WEIGHT_KEY, weightGradients);<NEW_LINE>if (hasBias()) {<NEW_LINE>INDArray biasGradientsView = gradientViews.get(DefaultParamInitializer.BIAS_KEY);<NEW_LINE>// biasGradientView is initialized/zeroed first in sum op<NEW_LINE>delta.sum(biasGradientsView, 0);<NEW_LINE>ret.gradientForVariable().put(DefaultParamInitializer.BIAS_KEY, biasGradientsView);<NEW_LINE>}<NEW_LINE>return new Pair<>(ret, null);<NEW_LINE>}
ArrayType.ACTIVATIONS, input, 'f');
483,991
private void relockDomain() {<NEW_LINE>RegistryLock oldLock = null;<NEW_LINE>DomainBase domain;<NEW_LINE>try {<NEW_LINE>oldLock = RegistryLockDao.getByRevisionId(oldUnlockRevisionId).orElseThrow(() -> new IllegalArgumentException(String.<MASK><NEW_LINE>domain = tm().loadByKey(VKey.create(DomainBase.class, oldLock.getRepoId())).cloneProjectedAtTime(tm().getTransactionTime());<NEW_LINE>} catch (Throwable t) {<NEW_LINE>handleTransientFailure(Optional.ofNullable(oldLock), t);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (domain.getStatusValues().containsAll(REGISTRY_LOCK_STATUSES) || oldLock.getRelock() != null) {<NEW_LINE>// The domain was manually locked, so we shouldn't worry about re-locking<NEW_LINE>String message = String.format("Domain %s is already manually re-locked, skipping automated re-lock.", domain.getDomainName());<NEW_LINE>logger.atInfo().log(message);<NEW_LINE>response.setPayload(message);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>verifyDomainAndLockState(oldLock, domain);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>// If the domain was, for example, transferred, then notify the old registrar and don't retry.<NEW_LINE>handleNonRetryableFailure(oldLock, t);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>applyRelock(oldLock);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>handleTransientFailure(Optional.of(oldLock), t);<NEW_LINE>}<NEW_LINE>}
format("Unknown revision ID %d", oldUnlockRevisionId)));
973,691
protected void onFragmentCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {<NEW_LINE>if (getArguments() == null) {<NEW_LINE>throw new NullPointerException("Bundle is null, therefore, PullRequestFilesFragment can't be proceeded.");<NEW_LINE>}<NEW_LINE>setupChanges();<NEW_LINE>stateLayout.setEmptyText(R.string.no_commits);<NEW_LINE>stateLayout.setOnReloadListener(this);<NEW_LINE>refresh.setOnRefreshListener(this);<NEW_LINE>recycler.setEmptyView(stateLayout, refresh);<NEW_LINE>adapter = new CommitFilesAdapter(getPresenter().<MASK><NEW_LINE>adapter.setListener(getPresenter());<NEW_LINE>getLoadMore().initialize(getPresenter().getCurrentPage(), getPresenter().getPreviousTotal());<NEW_LINE>recycler.setAdapter(adapter);<NEW_LINE>recycler.addOnScrollListener(getLoadMore());<NEW_LINE>if (savedInstanceState == null) {<NEW_LINE>getPresenter().onFragmentCreated(getArguments());<NEW_LINE>} else if (getPresenter().getFiles().isEmpty() && !getPresenter().isApiCalled()) {<NEW_LINE>onRefresh();<NEW_LINE>}<NEW_LINE>fastScroller.attachRecyclerView(recycler);<NEW_LINE>}
getFiles(), this, this);
112,755
public CreateProposalResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateProposalResult createProposalResult = new CreateProposalResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return createProposalResult;<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("ProposalId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createProposalResult.setProposalId(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 createProposalResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,571,433
protected void editSetting(final SettingModel settingModel) {<NEW_LINE>final JTextField textField = new JTextField(settingModel.currentValue);<NEW_LINE>JPanel editPanel = new JPanel(new GridLayout(0, 1));<NEW_LINE>editPanel.add(new JLabel("New Value"));<NEW_LINE>editPanel.add(textField);<NEW_LINE>JPanel settingPanel = new JPanel(new BorderLayout());<NEW_LINE>settingPanel.add(new SettingPanel<MASK><NEW_LINE>settingPanel.add(editPanel, BorderLayout.SOUTH);<NEW_LINE>settingPanel.setPreferredSize(new Dimension(800, 200));<NEW_LINE>String[] options;<NEW_LINE>if (settingModel.currentValue.equals(settingModel.defaultValue)) {<NEW_LINE>options = new String[] { Translation.get("gb.cancel"), Translation.get("gb.save") };<NEW_LINE>} else {<NEW_LINE>options = new String[] { Translation.get("gb.cancel"), Translation.get("gb.setDefault"), Translation.get("gb.save") };<NEW_LINE>}<NEW_LINE>String defaultOption = options[0];<NEW_LINE>int selection = JOptionPane.showOptionDialog(SettingsPanel.this, settingPanel, settingModel.name, JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, new ImageIcon(getClass().getResource("/settings_16x16.png")), options, defaultOption);<NEW_LINE>if (selection <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (options[selection].equals(Translation.get("gb.setDefault"))) {<NEW_LINE>textField.setText(settingModel.defaultValue);<NEW_LINE>}<NEW_LINE>final Map<String, String> newSettings = new HashMap<String, String>();<NEW_LINE>newSettings.put(settingModel.name, textField.getText().trim());<NEW_LINE>GitblitWorker worker = new GitblitWorker(SettingsPanel.this, RpcRequest.EDIT_SETTINGS) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected Boolean doRequest() throws IOException {<NEW_LINE>boolean success = gitblit.updateSettings(newSettings);<NEW_LINE>if (success) {<NEW_LINE>gitblit.refreshSettings();<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onSuccess() {<NEW_LINE>updateTable(false);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>worker.execute();<NEW_LINE>}
(settingModel), BorderLayout.CENTER);
931,807
private Map<String, URLClassLoader> createClassLoaderMap(File dir, String[] files) throws IOException {<NEW_LINE>Map<String, URLClassLoader> m = new TreeMap<>();<NEW_LINE>for (int i = 0; i < files.length; i++) {<NEW_LINE>File moduleJar = new File<MASK><NEW_LINE>Manifest manifest;<NEW_LINE>try (JarFile jar = new JarFile(moduleJar)) {<NEW_LINE>manifest = jar.getManifest();<NEW_LINE>}<NEW_LINE>if (manifest == null) {<NEW_LINE>log(moduleJar + " has no manifest", Project.MSG_WARN);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String codename = JarWithModuleAttributes.extractCodeName(manifest.getMainAttributes());<NEW_LINE>if (codename == null) {<NEW_LINE>log(moduleJar + " is not a module", Project.MSG_WARN);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>m.put(codename.replaceFirst("/[0-9]+$", ""), new URLClassLoader(new URL[] { moduleJar.toURI().toURL() }, ClassLoader.getSystemClassLoader().getParent(), new NbDocsStreamHandler.Factory()));<NEW_LINE>}<NEW_LINE>return m;<NEW_LINE>}
(dir, files[i]);
1,581,817
public Void visitLiteral(LiteralTree node, Void p) {<NEW_LINE>int startPos = (int) info.getTrees().getSourcePositions().getStartPosition(info.getCompilationUnit(), node);<NEW_LINE>tl.moveToOffset(startPos);<NEW_LINE><MASK><NEW_LINE>if (t != null && t.id() == JavaTokenId.MULTILINE_STRING_LITERAL && t.partType() == PartType.COMPLETE) {<NEW_LINE>String tokenText = t.text().toString();<NEW_LINE>String[] lines = tokenText.split("\n");<NEW_LINE>int indent = Arrays.stream(lines, 1, lines.length).filter(l -> !l.trim().isEmpty()).mapToInt(this::leadingIndent).min().orElse(0);<NEW_LINE>int pos = startPos + lines[0].length() + 1;<NEW_LINE>for (int i = 1; i < lines.length; i++) {<NEW_LINE>String line = lines[i];<NEW_LINE>if (i == lines.length - 1) {<NEW_LINE>line = line.substring(0, line.length() - 3);<NEW_LINE>}<NEW_LINE>String strippendLine = line.replaceAll("[\t ]+$", "");<NEW_LINE>int indentedStart = pos + indent;<NEW_LINE>int indentedEnd = pos + strippendLine.length();<NEW_LINE>if (indentedEnd > indentedStart)<NEW_LINE>extraColoring.add(Pair.of(new int[] { indentedStart, indentedEnd }, UNINDENTED_TEXT_BLOCK));<NEW_LINE>pos += line.length() + 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>addParameterInlineHint(node);<NEW_LINE>return super.visitLiteral(node, p);<NEW_LINE>}
Token t = tl.currentToken();
1,318,843
public void marshall(ReplicaSettingsUpdate replicaSettingsUpdate, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (replicaSettingsUpdate == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(replicaSettingsUpdate.getReplicaProvisionedReadCapacityUnits(), REPLICAPROVISIONEDREADCAPACITYUNITS_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicaSettingsUpdate.getReplicaProvisionedReadCapacityAutoScalingSettingsUpdate(), REPLICAPROVISIONEDREADCAPACITYAUTOSCALINGSETTINGSUPDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicaSettingsUpdate.getReplicaGlobalSecondaryIndexSettingsUpdate(), REPLICAGLOBALSECONDARYINDEXSETTINGSUPDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicaSettingsUpdate.getReplicaTableClass(), REPLICATABLECLASS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
replicaSettingsUpdate.getRegionName(), REGIONNAME_BINDING);
1,295,255
public DescribeEntitiesDetectionJobResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeEntitiesDetectionJobResult describeEntitiesDetectionJobResult = new DescribeEntitiesDetectionJobResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeEntitiesDetectionJobResult;<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("EntitiesDetectionJobProperties", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeEntitiesDetectionJobResult.setEntitiesDetectionJobProperties(EntitiesDetectionJobPropertiesJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeEntitiesDetectionJobResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,692,090
private FormalTypePatternContext formalTypePattern(int _p) throws RecognitionException {<NEW_LINE>ParserRuleContext _parentctx = _ctx;<NEW_LINE>int _parentState = getState();<NEW_LINE>FormalTypePatternContext _localctx = new FormalTypePatternContext(_ctx, _parentState);<NEW_LINE>FormalTypePatternContext _prevctx = _localctx;<NEW_LINE>int _startState = 14;<NEW_LINE>enterRecursionRule(_localctx, 14, RULE_formalTypePattern, _p);<NEW_LINE>try {<NEW_LINE>int _alt;<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(122);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(_input.LA(1)) {<NEW_LINE>case DOT:<NEW_LINE>case WILDCARD:<NEW_LINE>case DOTDOT:<NEW_LINE>case Identifier:<NEW_LINE>{<NEW_LINE>setState(119);<NEW_LINE>classNameOrInterface();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case BANG:<NEW_LINE>{<NEW_LINE>setState(120);<NEW_LINE>match(BANG);<NEW_LINE>setState(121);<NEW_LINE>formalTypePattern(3);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new NoViableAltException(this);<NEW_LINE>}<NEW_LINE>_ctx.stop = _input.LT(-1);<NEW_LINE>setState(132);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_alt = getInterpreter().adaptivePredict(_input, 17, _ctx);<NEW_LINE>while (_alt != 2 && _alt != org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER) {<NEW_LINE>if (_alt == 1) {<NEW_LINE>if (_parseListeners != null)<NEW_LINE>triggerExitRuleEvent();<NEW_LINE>_prevctx = _localctx;<NEW_LINE>{<NEW_LINE>setState(130);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(getInterpreter().adaptivePredict(_input, 16, _ctx)) {<NEW_LINE>case 1:<NEW_LINE>{<NEW_LINE>_localctx = new FormalTypePatternContext(_parentctx, _parentState);<NEW_LINE>pushNewRecursionContext(_localctx, _startState, RULE_formalTypePattern);<NEW_LINE>setState(124);<NEW_LINE>if (!(precpred(_ctx, 2)))<NEW_LINE>throw new FailedPredicateException(this, "precpred(_ctx, 2)");<NEW_LINE>setState(125);<NEW_LINE>match(AND);<NEW_LINE>setState(126);<NEW_LINE>formalTypePattern(3);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>{<NEW_LINE>_localctx = new FormalTypePatternContext(_parentctx, _parentState);<NEW_LINE>pushNewRecursionContext(_localctx, _startState, RULE_formalTypePattern);<NEW_LINE>setState(127);<NEW_LINE>if (!(precpred(_ctx, 1)))<NEW_LINE>throw new FailedPredicateException(this, "precpred(_ctx, 1)");<NEW_LINE>setState(128);<NEW_LINE>match(OR);<NEW_LINE>setState(129);<NEW_LINE>formalTypePattern(2);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(134);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_alt = getInterpreter().adaptivePredict(_input, 17, _ctx);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE><MASK><NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>unrollRecursionContexts(_parentctx);<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
_errHandler.reportError(this, re);
1,525,394
public static TransactionInput fromByteReader(ByteReader reader) throws TransactionInputParsingException {<NEW_LINE>try {<NEW_LINE>Sha256Hash outPointHash = reader.getSha256Hash().reverse();<NEW_LINE><MASK><NEW_LINE>int scriptSize = (int) reader.getCompactInt();<NEW_LINE>byte[] script = reader.getBytes(scriptSize);<NEW_LINE>int sequence = reader.getIntLE();<NEW_LINE>OutPoint outPoint = new OutPoint(outPointHash, outPointIndex);<NEW_LINE>ScriptInput inscript;<NEW_LINE>if (outPointHash.equals(Sha256Hash.ZERO_HASH)) {<NEW_LINE>// Coinbase scripts are special as they can contain anything that<NEW_LINE>// does not parse<NEW_LINE>inscript = new ScriptInputCoinbase(script);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>inscript = ScriptInput.fromScriptBytes(script);<NEW_LINE>} catch (ScriptParsingException e) {<NEW_LINE>throw new TransactionInputParsingException(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new TransactionInput(outPoint, inscript, sequence, 0);<NEW_LINE>} catch (InsufficientBytesException e) {<NEW_LINE>throw new TransactionInputParsingException("Unable to parse transaction input: " + e.getMessage());<NEW_LINE>}<NEW_LINE>}
int outPointIndex = reader.getIntLE();
338,299
public void run(RegressionEnvironment env) {<NEW_LINE>AtomicInteger milestone = new AtomicInteger();<NEW_LINE>String epl = "@name('s0') select symbol from " + "SupportMarketDataBean#length(10) as one, " + "SupportBeanString#length(100) as two " + "where one.symbol = two.theString " + "order by price";<NEW_LINE>SymbolPricesVolumes spv = new SymbolPricesVolumes();<NEW_LINE>SupportUpdateListener listener = new SupportUpdateListener();<NEW_LINE>createAndSend(env, epl, milestone);<NEW_LINE>sendJoinEvents(env, milestone);<NEW_LINE>spv.symbols.add("KGB");<NEW_LINE>assertValues(env, spv.symbols, "symbol");<NEW_LINE>clearValues(spv);<NEW_LINE>sendEvent(env, "DOG", 10);<NEW_LINE>spv.symbols.add("DOG");<NEW_LINE>assertValues(env, spv.symbols, "symbol");<NEW_LINE>clearValuesDropStmt(env, spv);<NEW_LINE>// Set start time<NEW_LINE>sendTimeEvent(env, 0);<NEW_LINE>epl = "@name('s0') select symbol from " <MASK><NEW_LINE>createAndSend(env, epl, milestone);<NEW_LINE>sendJoinEvents(env, milestone);<NEW_LINE>orderValuesByPriceJoin(spv);<NEW_LINE>sendTimeEvent(env, 1000);<NEW_LINE>assertValues(env, spv.symbols, "symbol");<NEW_LINE>assertOnlyProperties(env, Arrays.asList(new String[] { "symbol" }));<NEW_LINE>clearValuesDropStmt(env, spv);<NEW_LINE>}
+ "SupportMarketDataBean#time_batch(1) as one, " + "SupportBeanString#length(100) as two " + "where one.symbol = two.theString " + "order by price, symbol";
1,537,336
// This solution is generic for both BST and regular binary trees<NEW_LINE>public TreeNode convertBST(TreeNode root) {<NEW_LINE>if (root == null) {<NEW_LINE>return root;<NEW_LINE>}<NEW_LINE>List<Integer> list = new ArrayList<>();<NEW_LINE>putNodeToList(list, root);<NEW_LINE>Collections.sort(list);<NEW_LINE>int[] sums = new int[list.size()];<NEW_LINE>sums[list.<MASK><NEW_LINE>for (int i = list.size() - 2; i >= 0; i--) {<NEW_LINE>sums[i] = sums[i + 1] + list.get(i + 1);<NEW_LINE>}<NEW_LINE>TreeMap<Integer, Integer> treeMap = new TreeMap<>();<NEW_LINE>for (int i = 0; i < list.size(); i++) {<NEW_LINE>treeMap.put(list.get(i), sums[i]);<NEW_LINE>}<NEW_LINE>TreeNode result = new TreeNode(treeMap.get(list.get(0)));<NEW_LINE>return generateResultRoot(root, treeMap, result);<NEW_LINE>}
size() - 1] = 0;
725,177
private void fillNicPrerequisites(OVFNetworkTO nic, Node parentNode) {<NEW_LINE>String addressOnParentStr = ovfParser.getChildNodeValue(parentNode, "AddressOnParent");<NEW_LINE>String automaticAllocationStr = ovfParser.getChildNodeValue(parentNode, "AutomaticAllocation");<NEW_LINE>String description = ovfParser.getChildNodeValue(parentNode, "Description");<NEW_LINE>String elementName = ovfParser.getChildNodeValue(parentNode, "ElementName");<NEW_LINE>String instanceIdStr = ovfParser.getChildNodeValue(parentNode, "InstanceID");<NEW_LINE>String resourceSubType = ovfParser.getChildNodeValue(parentNode, "ResourceSubType");<NEW_LINE>String resourceType = <MASK><NEW_LINE>try {<NEW_LINE>int addressOnParent = Integer.parseInt(addressOnParentStr);<NEW_LINE>nic.setAddressOnParent(addressOnParent);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>s_logger.warn("Encountered element of type \"AddressOnParent\", that could not be parse to an integer number: " + addressOnParentStr);<NEW_LINE>}<NEW_LINE>boolean automaticAllocation = StringUtils.isNotBlank(automaticAllocationStr) && Boolean.parseBoolean(automaticAllocationStr);<NEW_LINE>nic.setAutomaticAllocation(automaticAllocation);<NEW_LINE>nic.setNicDescription(description);<NEW_LINE>nic.setElementName(elementName);<NEW_LINE>try {<NEW_LINE>int instanceId = Integer.parseInt(instanceIdStr);<NEW_LINE>nic.setInstanceID(instanceId);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>s_logger.warn("Encountered element of type \"InstanceID\", that could not be parse to an integer number: " + instanceIdStr);<NEW_LINE>}<NEW_LINE>nic.setResourceSubType(resourceSubType);<NEW_LINE>nic.setResourceType(resourceType);<NEW_LINE>}
ovfParser.getChildNodeValue(parentNode, "ResourceType");
595,767
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see com.navercorp.pinpoint.bootstrap.interceptor.AroundInterceptor#after(java.lang.Object, java.lang.Object[],<NEW_LINE>* java.lang.Object, java.lang.Throwable)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void after(final Object target, final Object[] args, final Object result, final Throwable throwable) {<NEW_LINE>if (isDebug) {<NEW_LINE>logger.afterInterceptor(target, args, result, throwable);<NEW_LINE>}<NEW_LINE>final Trace trace = traceContext.currentTraceObject();<NEW_LINE>if (trace == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!trace.canSampled()) {<NEW_LINE>traceContext.removeTraceObject();<NEW_LINE>trace.close();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final SpanEventRecorder recorder = trace.currentSpanEventRecorder();<NEW_LINE>recorder.recordApi(methodDescriptor);<NEW_LINE>recorder.recordException(throwable);<NEW_LINE>} catch (final Throwable th) {<NEW_LINE>if (logger.isWarnEnabled()) {<NEW_LINE>logger.warn("AFTER. Caused:{}", <MASK><NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>trace.traceBlockEnd();<NEW_LINE>trace.close();<NEW_LINE>traceContext.removeTraceObject();<NEW_LINE>}<NEW_LINE>}
th.getMessage(), th);
733,748
// -----------------------------------------------------------------------<NEW_LINE>@Override<NEW_LINE>public void validate(ReadablePartial partial, int[] values) {<NEW_LINE>// check values in standard range, catching really stupid cases like -1<NEW_LINE>// this means that the second check will not hit trouble<NEW_LINE>int size = partial.size();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>int value = values[i];<NEW_LINE>DateTimeField <MASK><NEW_LINE>if (value < field.getMinimumValue()) {<NEW_LINE>throw new IllegalFieldValueException(field.getType(), Integer.valueOf(value), Integer.valueOf(field.getMinimumValue()), null);<NEW_LINE>}<NEW_LINE>if (value > field.getMaximumValue()) {<NEW_LINE>throw new IllegalFieldValueException(field.getType(), Integer.valueOf(value), null, Integer.valueOf(field.getMaximumValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// check values in specific range, catching really odd cases like 30th Feb<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>int value = values[i];<NEW_LINE>DateTimeField field = partial.getField(i);<NEW_LINE>if (value < field.getMinimumValue(partial, values)) {<NEW_LINE>throw new IllegalFieldValueException(field.getType(), Integer.valueOf(value), Integer.valueOf(field.getMinimumValue(partial, values)), null);<NEW_LINE>}<NEW_LINE>if (value > field.getMaximumValue(partial, values)) {<NEW_LINE>throw new IllegalFieldValueException(field.getType(), Integer.valueOf(value), null, Integer.valueOf(field.getMaximumValue(partial, values)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
field = partial.getField(i);
1,041,835
public void writeValue(int ex) {<NEW_LINE>double x = xyGraph.primaryXAxis.getPositionValue(ex, false);<NEW_LINE>int index = (int) x;<NEW_LINE>if (index < 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Sample sample = (Sample) trace.getDataProvider().getSample(index);<NEW_LINE>if (sample != null) {<NEW_LINE>double y = sample.getYValue();<NEW_LINE>int height = xyGraph.<MASK><NEW_LINE>int startX = xyGraph.primaryXAxis.getValuePosition((int) x, false);<NEW_LINE>GC gc = new GC(canvas);<NEW_LINE>Font font = new Font(null, "Verdana", 10, SWT.BOLD);<NEW_LINE>gc.setFont(font);<NEW_LINE>String value = FormatUtil.print(y, "#,###");<NEW_LINE>Point textSize = gc.textExtent(value);<NEW_LINE>gc.drawText(value, startX + (xAxisUnitWidth - textSize.x) / 2, height - 20, true);<NEW_LINE>int ground = xyGraph.primaryYAxis.getValuePosition(0, false);<NEW_LINE>gc.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));<NEW_LINE>gc.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_MAGENTA));<NEW_LINE>gc.drawRectangle(startX + (xAxisUnitWidth - lineWidth) / 2, height, lineWidth, ground - height);<NEW_LINE>gc.fillRectangle(startX + (xAxisUnitWidth - lineWidth) / 2, height, lineWidth, ground - height);<NEW_LINE>gc.dispose();<NEW_LINE>}<NEW_LINE>}
primaryYAxis.getValuePosition(y, false);
1,168,260
private Mono<PagedResponse<DdosProtectionPlanInner>> listSinglePageAsync() {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String apiVersion = "2018-11-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)).<PagedResponse<DdosProtectionPlanInner>>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));
1,594,250
final DescribeRemediationConfigurationsResult executeDescribeRemediationConfigurations(DescribeRemediationConfigurationsRequest describeRemediationConfigurationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeRemediationConfigurationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeRemediationConfigurationsRequest> request = null;<NEW_LINE>Response<DescribeRemediationConfigurationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeRemediationConfigurationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeRemediationConfigurationsRequest));<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, "Config Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeRemediationConfigurations");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeRemediationConfigurationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeRemediationConfigurationsResultJsonUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig);
931,855
public DataType toDataType() throws DuplicateNameException, IOException {<NEW_LINE>Structure structure = new StructureDataType(VdexHeader_10.class.getSimpleName() + "_" + number_of_dex_files_, 0);<NEW_LINE>structure.add(STRING, 4, "magic_", null);<NEW_LINE>structure.add(STRING, 4, "verifier_deps_version_", null);<NEW_LINE>structure.add(STRING, 4, "dex_section_version_", null);<NEW_LINE>structure.<MASK><NEW_LINE>structure.add(DWORD, "verifier_deps_size_", null);<NEW_LINE>structure.add(DWORD, "bootclasspath_checksums_size_", null);<NEW_LINE>structure.add(DWORD, "class_loader_context_size_", null);<NEW_LINE>for (int i = 0; i < dex_checksums_.length; ++i) {<NEW_LINE>structure.add(DWORD, "dex_checksum_" + i, null);<NEW_LINE>}<NEW_LINE>if (sectionHeader != null) {<NEW_LINE>structure.add(sectionHeader.toDataType(), "dex_section_header_", null);<NEW_LINE>}<NEW_LINE>if (stringTable != null && stringTable.getStringCount() > 0) {<NEW_LINE>structure.add(stringTable.toDataType(), "strings", null);<NEW_LINE>}<NEW_LINE>structure.setCategoryPath(new CategoryPath("/vdex"));<NEW_LINE>return structure;<NEW_LINE>}
add(DWORD, "number_of_dex_files_", null);
650,467
public void findDatafeedIdsForJobIds(Collection<String> jobIds, ActionListener<Set<String>> listener) {<NEW_LINE>SearchSourceBuilder sourceBuilder = new SearchSourceBuilder().query(buildDatafeedJobIdsQuery(jobIds));<NEW_LINE>sourceBuilder.fetchSource(false);<NEW_LINE>sourceBuilder.<MASK><NEW_LINE>sourceBuilder.docValueField(DatafeedConfig.ID.getPreferredName(), null);<NEW_LINE>SearchRequest searchRequest = client.prepareSearch(MlConfigIndex.indexName()).setIndicesOptions(IndicesOptions.lenientExpandOpen()).setSource(sourceBuilder).request();<NEW_LINE>executeAsyncWithOrigin(client.threadPool().getThreadContext(), ML_ORIGIN, searchRequest, ActionListener.<SearchResponse>wrap(response -> {<NEW_LINE>Set<String> datafeedIds = new HashSet<>();<NEW_LINE>// There cannot be more than one datafeed per job<NEW_LINE>assert response.getHits().getTotalHits().value <= jobIds.size();<NEW_LINE>SearchHit[] hits = response.getHits().getHits();<NEW_LINE>for (SearchHit hit : hits) {<NEW_LINE>datafeedIds.add(hit.field(DatafeedConfig.ID.getPreferredName()).getValue());<NEW_LINE>}<NEW_LINE>listener.onResponse(datafeedIds);<NEW_LINE>}, listener::onFailure), client::search);<NEW_LINE>}
size(jobIds.size());
1,620,504
private DataPack doRefresh(@Nonnull Collection<VirtualFile> roots) {<NEW_LINE>StopWatch <MASK><NEW_LINE>PermanentGraph<Integer> permanentGraph = myCurrentDataPack.isFull() ? myCurrentDataPack.getPermanentGraph() : null;<NEW_LINE>Map<VirtualFile, CompressedRefs> currentRefs = myCurrentDataPack.getRefsModel().getAllRefsByRoot();<NEW_LINE>try {<NEW_LINE>if (permanentGraph != null) {<NEW_LINE>int commitCount = myRecentCommitCount;<NEW_LINE>for (int attempt = 0; attempt <= 1; attempt++) {<NEW_LINE>loadLogAndRefs(roots, currentRefs, commitCount);<NEW_LINE>List<? extends GraphCommit<Integer>> compoundLog = multiRepoJoin(myLoadedInfo.getCommits());<NEW_LINE>Map<VirtualFile, CompressedRefs> allNewRefs = getAllNewRefs(myLoadedInfo, currentRefs);<NEW_LINE>List<GraphCommit<Integer>> joinedFullLog = join(compoundLog, permanentGraph.getAllCommits(), currentRefs, allNewRefs);<NEW_LINE>if (joinedFullLog == null) {<NEW_LINE>commitCount *= 5;<NEW_LINE>} else {<NEW_LINE>return DataPack.build(joinedFullLog, allNewRefs, myProviders, myHashMap, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// couldn't join => need to reload everything; if 5000 commits is still not enough, it's worth reporting:<NEW_LINE>LOG.info("Couldn't join " + commitCount / 5 + " recent commits to the log (" + permanentGraph.getAllCommits().size() + " commits)");<NEW_LINE>}<NEW_LINE>return loadFullLog();<NEW_LINE>} catch (Exception e) {<NEW_LINE>myExceptionHandler.consume(e);<NEW_LINE>return DataPack.EMPTY;<NEW_LINE>} finally {<NEW_LINE>sw.report();<NEW_LINE>}<NEW_LINE>}
sw = StopWatch.start("refresh");
1,528,567
protected void handleSuccess(Response response, Request<List<ThreadChannel>> request) {<NEW_LINE>DataObject obj = response.getObject();<NEW_LINE>DataArray selfThreadMembers = obj.getArray("members");<NEW_LINE>DataArray threads = obj.getArray("threads");<NEW_LINE>List<ThreadChannel> list = new ArrayList<>(threads.length());<NEW_LINE><MASK><NEW_LINE>TLongObjectMap<DataObject> selfThreadMemberMap = new TLongObjectHashMap<>();<NEW_LINE>for (int i = 0; i < selfThreadMembers.length(); i++) {<NEW_LINE>DataObject selfThreadMember = selfThreadMembers.getObject(i);<NEW_LINE>// Store the thread member based on the "id" which is the _thread's_ id, not the member's id (which would be our id)<NEW_LINE>selfThreadMemberMap.put(selfThreadMember.getLong("id"), selfThreadMember);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < threads.length(); i++) {<NEW_LINE>try {<NEW_LINE>DataObject threadObj = threads.getObject(i);<NEW_LINE>DataObject selfThreadMemberObj = selfThreadMemberMap.get(threadObj.getLong("id", 0));<NEW_LINE>if (selfThreadMemberObj != null) {<NEW_LINE>// Combine the thread and self thread-member into a single object to model what we get from<NEW_LINE>// thread payloads (like from Gateway, etc)<NEW_LINE>threadObj.put("member", selfThreadMemberObj);<NEW_LINE>}<NEW_LINE>ThreadChannel thread = builder.createThreadChannel(threadObj, getGuild().getIdLong());<NEW_LINE>list.add(thread);<NEW_LINE>if (this.useCache)<NEW_LINE>this.cached.add(thread);<NEW_LINE>this.last = thread;<NEW_LINE>this.lastKey = last.getIdLong();<NEW_LINE>} catch (ParsingException | NullPointerException e) {<NEW_LINE>LOG.warn("Encountered exception in ThreadChannelPagination", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>request.onSuccess(list);<NEW_LINE>}
EntityBuilder builder = api.getEntityBuilder();
261,537
public GetContentModerationResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetContentModerationResult getContentModerationResult = new GetContentModerationResult();<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE><MASK><NEW_LINE>if (name.equals("JobStatus")) {<NEW_LINE>getContentModerationResult.setJobStatus(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("StatusMessage")) {<NEW_LINE>getContentModerationResult.setStatusMessage(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("VideoMetadata")) {<NEW_LINE>getContentModerationResult.setVideoMetadata(VideoMetadataJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("ModerationLabels")) {<NEW_LINE>getContentModerationResult.setModerationLabels(new ListUnmarshaller<ContentModerationDetection>(ContentModerationDetectionJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>} else if (name.equals("NextToken")) {<NEW_LINE>getContentModerationResult.setNextToken(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("ModerationModelVersion")) {<NEW_LINE>getContentModerationResult.setModerationModelVersion(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return getContentModerationResult;<NEW_LINE>}
String name = reader.nextName();
1,656,876
public static void open(URL url, BasicFrame parent) {<NEW_LINE>String displayName = null;<NEW_LINE>// First figure out the file name from the URL<NEW_LINE>// Try using URI.getPath();<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>displayName = uri.getPath();<NEW_LINE>} catch (URISyntaxException ignore) {<NEW_LINE>}<NEW_LINE>// Try URL-decoding the URL<NEW_LINE>if (displayName == null) {<NEW_LINE>try {<NEW_LINE>displayName = URLDecoder.decode(url.toString(), "UTF-8");<NEW_LINE>} catch (UnsupportedEncodingException ignore) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (displayName == null) {<NEW_LINE>displayName = "";<NEW_LINE>}<NEW_LINE>// Remove path from filename<NEW_LINE>if (displayName.lastIndexOf('/') >= 0) {<NEW_LINE>displayName = displayName.substring(displayName.lastIndexOf('/') + 1);<NEW_LINE>}<NEW_LINE>// Open the file<NEW_LINE>log.info("Opening file from url=" + url + " filename=" + displayName);<NEW_LINE>OpenFileWorker worker = new OpenFileWorker(url);<NEW_LINE>open(worker, displayName, parent, true);<NEW_LINE>}
URI uri = url.toURI();
902,370
void addGraphNode(int node, float[] value) throws IOException {<NEW_LINE>NeighborQueue candidates;<NEW_LINE>final int nodeLevel = getRandomGraphLevel(ml, random);<NEW_LINE>int curMaxLevel <MASK><NEW_LINE>int[] eps = new int[] { hnsw.entryNode() };<NEW_LINE>// if a node introduces new levels to the graph, add this new node on new levels<NEW_LINE>for (int level = nodeLevel; level > curMaxLevel; level--) {<NEW_LINE>hnsw.addNode(level, node);<NEW_LINE>}<NEW_LINE>// for levels > nodeLevel search with topk = 1<NEW_LINE>for (int level = curMaxLevel; level > nodeLevel; level--) {<NEW_LINE>candidates = graphSearcher.searchLevel(value, 1, level, eps, vectorValues, hnsw);<NEW_LINE>eps = new int[] { candidates.pop() };<NEW_LINE>}<NEW_LINE>// for levels <= nodeLevel search with topk = beamWidth, and add connections<NEW_LINE>for (int level = Math.min(nodeLevel, curMaxLevel); level >= 0; level--) {<NEW_LINE>candidates = graphSearcher.searchLevel(value, beamWidth, level, eps, vectorValues, hnsw);<NEW_LINE>eps = candidates.nodes();<NEW_LINE>hnsw.addNode(level, node);<NEW_LINE>addDiverseNeighbors(level, node, candidates);<NEW_LINE>}<NEW_LINE>}
= hnsw.numLevels() - 1;
525,588
public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException {<NEW_LINE>InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer);<NEW_LINE>target.addField(DatabaseInfoAccessor.class);<NEW_LINE>target.addField(ParsingResultAccessor.class);<NEW_LINE>target.addField(BindValueAccessor.class);<NEW_LINE>PostgreSqlConfig config = new PostgreSqlConfig(instrumentor.getProfilerConfig());<NEW_LINE>int maxBindValueSize = config.getMaxSqlBindValueSize();<NEW_LINE>final Class<? <MASK><NEW_LINE>InstrumentUtils.findMethod(target, "execute").addScopedInterceptor(preparedStatementInterceptor, va(maxBindValueSize), POSTGRESQL_SCOPE);<NEW_LINE>InstrumentUtils.findMethod(target, "executeQuery").addScopedInterceptor(preparedStatementInterceptor, va(maxBindValueSize), POSTGRESQL_SCOPE);<NEW_LINE>InstrumentUtils.findMethod(target, "executeUpdate").addScopedInterceptor(preparedStatementInterceptor, va(maxBindValueSize), POSTGRESQL_SCOPE);<NEW_LINE>final Class<? extends Interceptor> executeQueryInterceptor = StatementExecuteQueryInterceptor.class;<NEW_LINE>InstrumentUtils.findMethod(target, "executeQuery", "java.lang.String").addScopedInterceptor(executeQueryInterceptor, POSTGRESQL_SCOPE);<NEW_LINE>final Class<? extends Interceptor> executeUpdateInterceptor = StatementExecuteUpdateInterceptor.class;<NEW_LINE>InstrumentUtils.findMethod(target, "executeUpdate", "java.lang.String").addScopedInterceptor(executeUpdateInterceptor, POSTGRESQL_SCOPE);<NEW_LINE>InstrumentUtils.findMethod(target, "execute", "java.lang.String").addScopedInterceptor(executeUpdateInterceptor, POSTGRESQL_SCOPE);<NEW_LINE>if (config.isTraceSqlBindValue()) {<NEW_LINE>final PreparedStatementBindingMethodFilter excludes = PreparedStatementBindingMethodFilter.excludes("setRowId", "setNClob", "setSQLXML");<NEW_LINE>final List<InstrumentMethod> declaredMethods = target.getDeclaredMethods(excludes);<NEW_LINE>for (InstrumentMethod method : declaredMethods) {<NEW_LINE>method.addScopedInterceptor(PreparedStatementBindVariableInterceptor.class, POSTGRESQL_SCOPE, ExecutionPolicy.BOUNDARY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return target.toBytecode();<NEW_LINE>}
extends Interceptor> preparedStatementInterceptor = PreparedStatementExecuteQueryInterceptor.class;
786,650
final PutBackupPolicyResult executePutBackupPolicy(PutBackupPolicyRequest putBackupPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putBackupPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutBackupPolicyRequest> request = null;<NEW_LINE>Response<PutBackupPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new PutBackupPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putBackupPolicyRequest));<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, "EFS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutBackupPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutBackupPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutBackupPolicyResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
323,107
public static int cliInstaller(boolean uninstall, List<String> rawArgs) {<NEW_LINE>CmdReader<CmdArgs> reader = CmdReader.of(CmdArgs.class);<NEW_LINE>CmdArgs args;<NEW_LINE>try {<NEW_LINE>args = reader.make(rawArgs.toArray(new String[0]));<NEW_LINE>} catch (InvalidCommandLineException e) {<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE><MASK><NEW_LINE>System.err.println(generateCliHelp(uninstall, reader));<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>if (args.help) {<NEW_LINE>System.out.println(generateCliHelp(uninstall, reader));<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>if (args.path.isEmpty()) {<NEW_LINE>System.err.println("ERROR: Nothing to do!");<NEW_LINE>System.err.println("--------------------------");<NEW_LINE>System.err.println(generateCliHelp(uninstall, reader));<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>final List<IdeLocation> locations = new ArrayList<IdeLocation>();<NEW_LINE>final List<CorruptedIdeLocationException> problems = new ArrayList<CorruptedIdeLocationException>();<NEW_LINE>if (args.path.contains("auto"))<NEW_LINE>autoDiscover(locations, problems);<NEW_LINE>for (String rawPath : args.path) {<NEW_LINE>if (!rawPath.equals("auto")) {<NEW_LINE>try {<NEW_LINE>IdeLocation loc = tryAllProviders(rawPath);<NEW_LINE>if (loc != null)<NEW_LINE>locations.add(loc);<NEW_LINE>else<NEW_LINE>problems.add(new CorruptedIdeLocationException("Can't find any IDE at: " + rawPath, null, null));<NEW_LINE>} catch (CorruptedIdeLocationException e) {<NEW_LINE>problems.add(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int validLocations = locations.size();<NEW_LINE>for (IdeLocation loc : locations) {<NEW_LINE>try {<NEW_LINE>if (uninstall) {<NEW_LINE>loc.uninstall();<NEW_LINE>} else {<NEW_LINE>loc.install();<NEW_LINE>}<NEW_LINE>System.out.printf("Lombok %s %s: %s\n", uninstall ? "uninstalled" : "installed", uninstall ? "from" : "to", loc.getName());<NEW_LINE>} catch (InstallException e) {<NEW_LINE>if (e.isWarning()) {<NEW_LINE>System.err.printf("Warning while installing at %s:\n", loc.getName());<NEW_LINE>} else {<NEW_LINE>System.err.printf("Installation at %s failed:\n", loc.getName());<NEW_LINE>validLocations--;<NEW_LINE>}<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE>} catch (UninstallException e) {<NEW_LINE>if (e.isWarning()) {<NEW_LINE>System.err.printf("Warning while uninstalling at %s:\n", loc.getName());<NEW_LINE>} else {<NEW_LINE>System.err.printf("Uninstall at %s failed:\n", loc.getName());<NEW_LINE>validLocations--;<NEW_LINE>}<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (CorruptedIdeLocationException problem : problems) {<NEW_LINE>System.err.println("WARNING: " + problem.getMessage());<NEW_LINE>}<NEW_LINE>if (validLocations == 0) {<NEW_LINE>System.err.println("WARNING: Zero valid locations found; so nothing was done!");<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
System.err.println("--------------------------");
717,001
public static SubGraph from(Transaction tx, Result result, boolean addBetween) {<NEW_LINE>final CypherResultSubGraph graph = new CypherResultSubGraph();<NEW_LINE>final List<String> columns = result.columns();<NEW_LINE>for (Map<String, Object> row : loop(result)) {<NEW_LINE>for (String column : columns) {<NEW_LINE>final Object <MASK><NEW_LINE>graph.addToGraph(value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (IndexDefinition def : tx.schema().getIndexes()) {<NEW_LINE>if (def.isNodeIndex() && def.getIndexType() != IndexType.LOOKUP) {<NEW_LINE>for (Label label : def.getLabels()) {<NEW_LINE>if (graph.getLabels().contains(label)) {<NEW_LINE>graph.addIndex(def);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (ConstraintDefinition def : tx.schema().getConstraints()) {<NEW_LINE>if (graph.getLabels().contains(def.getLabel())) {<NEW_LINE>graph.addConstraint(def);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (addBetween) {<NEW_LINE>graph.addRelationshipsBetweenNodes();<NEW_LINE>}<NEW_LINE>return graph;<NEW_LINE>}
value = row.get(column);
125,593
private void loadNode66() {<NEW_LINE>UaMethodNode node = new UaMethodNode(this.context, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_Open, new QualifiedName(0, "Open"), new LocalizedText("en", "Open"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), true, true);<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_Open, Identifiers.HasProperty, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_Open_InputArguments.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_Open, Identifiers.HasProperty, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_Open_OutputArguments.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_Open, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList_Open, Identifiers.HasComponent, Identifiers.CertificateGroupFolderType_DefaultHttpsGroup_TrustList<MASK><NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), false));
1,763,825
public void merge(final TypeDefinition type) {<NEW_LINE>if (null == clazz) {<NEW_LINE>clazz = type.getClazz();<NEW_LINE>} else if (null != type.getClazz() && !clazz.equals(type.getClazz())) {<NEW_LINE>throw new SchemaException("Unable to merge schemas. Conflict with type class, options are: " + clazz.getName() + " and " + type.getClazz().getName());<NEW_LINE>}<NEW_LINE>if (null != type.getSerialiser()) {<NEW_LINE>if (null == getSerialiser()) {<NEW_LINE>setSerialiser(type.getSerialiser());<NEW_LINE>} else if (!getSerialiser().getClass().equals(type.getSerialiser().getClass())) {<NEW_LINE>throw new SchemaException("Unable to merge schemas. Conflict with type (" + clazz + ") serialiser, options are: " + getSerialiser().getClass().getName() + " and " + type.getSerialiser().getClass().getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (null == validateFunctions) {<NEW_LINE>if (null != type.getValidateFunctions()) {<NEW_LINE>validateFunctions = Collections.unmodifiableList(new ArrayList<>(type.getValidateFunctions()));<NEW_LINE>}<NEW_LINE>} else if (null != type.getValidateFunctions()) {<NEW_LINE>// Use a set to deduplicate the functions<NEW_LINE>final LinkedHashSet<Predicate> newValidateFunctions = new LinkedHashSet<>(validateFunctions.size(), type.getValidateFunctions().size());<NEW_LINE>newValidateFunctions.addAll(validateFunctions);<NEW_LINE>newValidateFunctions.addAll(type.getValidateFunctions());<NEW_LINE>validateFunctions = Collections.unmodifiableList(<MASK><NEW_LINE>}<NEW_LINE>if (null == aggregateFunction) {<NEW_LINE>aggregateFunction = type.getAggregateFunction();<NEW_LINE>} else if (null != type.getAggregateFunction() && !aggregateFunction.equals(type.getAggregateFunction())) {<NEW_LINE>throw new SchemaException("Unable to merge schemas. Conflict with type (" + clazz + ") aggregate function, options are: " + aggregateFunction + " and " + type.getAggregateFunction());<NEW_LINE>}<NEW_LINE>if (null == description) {<NEW_LINE>description = type.getDescription();<NEW_LINE>} else if (null != type.getDescription() && !description.contains(type.getDescription())) {<NEW_LINE>description = description + " | " + type.getDescription();<NEW_LINE>}<NEW_LINE>}
new ArrayList<>(newValidateFunctions));