content
stringlengths 40
137k
|
---|
"protected void clickOnTodayAssignment(ActionEvent todayAssignmentAe, Proxy proxy, GUIHome guiHome) {\n if (!(todayAssignmentAe.getActionCommand().equals(\"String_Node_Str\"))) {\n JButton pressedButton = (JButton) todayAssignmentAe.getSource();\n StringTokenizer cmdToken = new StringTokenizer(buttonTodayAssignment[0].getText(), \"String_Node_Str\");\n String cmd = cmdToken.nextToken();\n if (cmd.equals(\"String_Node_Str\")) {\n calendarState = CalendarState.NORMAL;\n SimpleDateFormat dateMonth = new SimpleDateFormat(\"String_Node_Str\");\n Date date = new Date();\n String strMonthNumber = dateMonth.format(date);\n int monthNumber = Integer.parseInt(strMonthNumber);\n try {\n updateCalendar(monthNumber, proxy);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n HashMap<Integer, Assignment> listAssignment = proxy.getAssignmentList();\n Assignment a = listAssignment.get(pressedButton.getDisplayedMnemonicIndex());\n if (guiHome instanceof GUICustomer) {\n GUIAssignmentInformationCustomer guiAssignment = new GUIAssignmentInformationCustomer(a, email, (GUICustomer) guiHome);\n guiAssignment.setVisible(true);\n } else {\n GUIAssignmentInformationDogsitter guiAssignment = new GUIAssignmentInformationDogsitter(a, email, (GUIDogSitter) guiHome);\n guiAssignment.setVisible(true);\n }\n }\n }\n}\n"
|
"protected void writeFile(final String name, final byte[] content) throws IOException {\n final File file = new File(db.getDirectory(), name);\n final LockFile lck = new LockFile(file, db.getFS());\n if (!lck.lock())\n throw new ObjectWritingException(MessageFormat.format(CLIText.get().cantWrite, file));\n try {\n lck.write(content);\n } catch (IOException ioe) {\n throw new ObjectWritingException(MessageFormat.format(CLIText.get().cantWrite, file));\n }\n if (!lck.commit())\n throw new ObjectWritingException(MessageFormat.format(CLIText.get().cantWrite, file));\n}\n"
|
"private ImmutablePair<ArtifactDescriptor, PluginClass> getPluginEntry(NamespaceId namespace, Id.Artifact parentArtifactId, Map.Entry<byte[], byte[]> column) {\n ArtifactColumn artifactColumn = ArtifactColumn.parse(column.getKey());\n Id.Namespace artifactNamespace = artifactColumn.artifactId.getNamespace();\n if (!Id.Namespace.SYSTEM.equals(artifactNamespace) && !artifactNamespace.equals(namespace.toId())) {\n return null;\n }\n PluginData pluginData = GSON.fromJson(Bytes.toString(column.getValue()), PluginData.class);\n if (pluginData.usableBy.versionIsInRange(parentArtifactId.getVersion())) {\n ArtifactDescriptor artifactDescriptor = new ArtifactDescriptor(artifactColumn.artifactId.toArtifactId(), Locations.getLocationFromAbsolutePath(locationFactory, pluginData.getArtifactLocationPath()));\n return ImmutablePair.of(artifactDescriptor, pluginData.pluginClass);\n }\n return null;\n}\n"
|
"private String queueCommand(BaseCmd cmdObj, Map<String, String> params) throws Exception {\n UserContext ctx = UserContext.current();\n Long callerUserId = ctx.getCallerUserId();\n Account caller = ctx.getCaller();\n if (cmdObj instanceof BaseAsyncCmd) {\n Long objectId = null;\n String objectUuid = null;\n if (cmdObj instanceof BaseAsyncCreateCmd) {\n BaseAsyncCreateCmd createCmd = (BaseAsyncCreateCmd) cmdObj;\n _dispatcher.dispatchCreateCmd(createCmd, params);\n objectId = createCmd.getEntityId();\n objectUuid = createCmd.getEntityUuid();\n params.put(\"String_Node_Str\", objectId.toString());\n } else {\n ApiDispatcher.processParameters(cmdObj, params);\n }\n BaseAsyncCmd asyncCmd = (BaseAsyncCmd) cmdObj;\n if (callerUserId != null) {\n params.put(\"String_Node_Str\", callerUserId.toString());\n }\n if (caller != null) {\n params.put(\"String_Node_Str\", String.valueOf(caller.getId()));\n }\n long startEventId = ctx.getStartEventId();\n asyncCmd.setStartEventId(startEventId);\n Long eventId = EventUtils.saveScheduledEvent((callerUserId == null) ? User.UID_SYSTEM : callerUserId, asyncCmd.getEntityOwnerId(), asyncCmd.getEventType(), asyncCmd.getEventDescription(), startEventId);\n if (startEventId == 0) {\n startEventId = eventId;\n }\n params.put(\"String_Node_Str\", String.valueOf(startEventId));\n ctx.setAccountId(asyncCmd.getEntityOwnerId());\n Long instanceId = (objectId == null) ? asyncCmd.getInstanceId() : objectId;\n AsyncJobVO job = new AsyncJobVO(callerUserId, caller.getId(), cmdObj.getClass().getName(), ApiGsonHelper.getBuilder().create().toJson(params), instanceId, asyncCmd.getInstanceType());\n long jobId = _asyncMgr.submitAsyncJob(job);\n if (jobId == 0L) {\n String errorMsg = \"String_Node_Str\" + job.getCmd();\n s_logger.warn(errorMsg);\n throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, errorMsg);\n }\n if (objectId != null) {\n String objUuid = (objectUuid == null) ? objectId.toString() : objectUuid;\n return ((BaseAsyncCreateCmd) asyncCmd).getResponse(jobId, objUuid);\n }\n SerializationContext.current().setUuidTranslation(true);\n return ApiResponseSerializer.toSerializedString(asyncCmd.getResponse(jobId), asyncCmd.getResponseType());\n } else {\n _dispatcher.dispatch(cmdObj, params);\n if (cmdObj instanceof BaseListCmd && !(cmdObj instanceof ListVMsCmd) && !(cmdObj instanceof ListRoutersCmd) && !(cmdObj instanceof ListSecurityGroupsCmd) && !(cmdObj instanceof ListTagsCmd) && !(cmdObj instanceof ListEventsCmd) && !(cmdObj instanceof ListVMGroupsCmd) && !(cmdObj instanceof ListProjectsCmd) && !(cmdObj instanceof ListProjectAccountsCmd) && !(cmdObj instanceof ListProjectInvitationsCmd) && !(cmdObj instanceof ListHostsCmd) && !(cmdObj instanceof ListVolumesCmd) && !(cmdObj instanceof ListUsersCmd) && !(cmdObj instanceof ListAccountsCmd) && !(cmdObj instanceof ListStoragePoolsCmd) && !(cmdObj instanceof ListDiskOfferingsCmd)) {\n buildAsyncListResponse((BaseListCmd) cmdObj, caller);\n }\n SerializationContext.current().setUuidTranslation(true);\n return ApiResponseSerializer.toSerializedString((ResponseObject) cmdObj.getResponseObject(), cmdObj.getResponseType());\n }\n}\n"
|
"public JobOutput getJobDetails(Loader loader, String jobID) throws IOException {\n YamlLoader yamlLoader = (YamlLoader) loader;\n String appHome = yamlLoader.getjHome() + File.separator;\n YamlConfig yamlConfig = (YamlConfig) yamlLoader.getYamlConfiguration();\n String agentHome = RemotingUtil.getAgentHome(yamlConfig);\n Remoter remoter = RemotingUtil.getRemoter(yamlLoader, appHome);\n String logsHistory = null;\n SupportedHadoopDistributions hadoopVersion = RemotingUtil.getHadoopVersion(yamlConfig);\n String user = yamlConfig.getMaster().getUser();\n logsHistory = changeLogHistoryPathAccToHadoopVersion(HADOOP_HOME, hadoopVersion, user);\n CommandWritableBuilder builder = new CommandWritableBuilder();\n boolean isYarn = yamlConfig.getEnableYarn().equals(Enable.TRUE);\n String logfilePath = null;\n String relLocalPath = null;\n if (!isYarn) {\n logfilePath = getLogFilePath(jobID, remoter, logsHistory, builder);\n relLocalPath = Constants.JOB_JARS_LOC + yamlLoader.getJumbuneJobName();\n String relRemotePath = relLocalPath + RUMEN;\n StringBuilder stringAppender = new StringBuilder(agentHome);\n stringAppender.append(File.separator).append(relRemotePath).append(File.separator);\n String pathToRumenDir = stringAppender.toString();\n String jsonFilepath = pathToRumenDir + JSON_FILE;\n String topologyFilePath = pathToRumenDir + TOPOLOGY_FILE;\n builder.getCommandBatch().clear();\n builder.addCommand(MKDIR_CMD + pathToRumenDir, false, null, CommandType.FS);\n remoter.fireAndForgetCommand(builder.getCommandWritable());\n String remoteHadoopLib = HADOOP_HOME + LIB;\n Properties props = loadHadoopJarConfigurationProperties();\n String coreJar;\n if (SupportedHadoopDistributions.HADOOP_NON_YARN.equals(hadoopVersion)) {\n coreJar = HADOOP_HOME + props.getProperty(\"String_Node_Str\");\n } else {\n coreJar = HADOOP_HOME + WILDCARD;\n }\n String commonsLoggingJar = agentHome + LIB + props.getProperty(\"String_Node_Str\");\n String commonsCliJar = remoteHadoopLib + props.getProperty(\"String_Node_Str\");\n String commonsConfigurationJar = agentHome + LIB + props.getProperty(\"String_Node_Str\");\n String commonsLangJar = agentHome + LIB + props.getProperty(\"String_Node_Str\");\n String jacksonMapperAslJar = agentHome + LIB + props.getProperty(\"String_Node_Str\");\n String jacksonMapperCoreJar = agentHome + LIB + props.getProperty(\"String_Node_Str\");\n String rumenJar = agentHome + LIB + props.getProperty(\"String_Node_Str\") + \"String_Node_Str\" + Versioning.BUILD_VERSION + Versioning.DISTRIBUTION_NAME + \"String_Node_Str\";\n StringBuilder sb = new StringBuilder(JAVA_CP_CMD);\n checkHadoopVersionsForRumen(hadoopVersion, logfilePath, jsonFilepath, topologyFilePath, coreJar, commonsLoggingJar, commonsCliJar, commonsConfigurationJar, commonsLangJar, jacksonMapperAslJar, jacksonMapperCoreJar, rumenJar, sb);\n LOGGER.debug(\"String_Node_Str\" + sb.toString() + \"String_Node_Str\");\n startRumenProcessing(remoter, relLocalPath, relRemotePath, sb);\n remoter = RemotingUtil.getRemoter(yamlLoader, appHome);\n remoter.receiveLogFiles(relLocalPath, relRemotePath);\n LOGGER.debug(\"String_Node_Str\" + relRemotePath);\n Gson gson = new Gson();\n JobDetails jobDetails = extractJobDetails(appHome, relLocalPath, gson);\n return convertToFinalOutput(jobDetails);\n } else {\n String relativeRemotePath = Constants.JOB_JARS_LOC + yamlLoader.getJumbuneJobName() + File.separator + jobID;\n String remotePath = agentHome + relativeRemotePath;\n builder.addCommand(MKDIR_CMD + remotePath, false, null, CommandType.FS);\n builder.addCommand(CHMOD_CMD + remotePath, false, null, CommandType.FS);\n remoter.fireAndForgetCommand(builder.getCommandWritable());\n checkAndgetCurrentLogFilePathForYarn(remoter, logsHistory, yamlLoader.getYamlConfiguration(), agentHome, remotePath, jobID);\n relLocalPath = Constants.JOB_JARS_LOC + yamlLoader.getJumbuneJobName();\n remoter.receiveLogFiles(relLocalPath, relativeRemotePath);\n String absolutePath = appHome + relLocalPath + jobID + File.separator;\n String fileName = checkAndGetHistFile(absolutePath);\n String localPath = absolutePath + fileName;\n java.lang.reflect.Method method = null;\n Class<?> yarnJobStatsUtility = null;\n try {\n yarnJobStatsUtility = Class.forName(YARN_JOB_STATS_UTILITY_CLASS);\n method = yarnJobStatsUtility.getDeclaredMethod(YARN_JOB_STATS_UTILITY_CLASS_PARSE_METHOD, String.class);\n return (JobOutput) method.invoke(yarnJobStatsUtility.newInstance(), localPath);\n } catch (Exception e) {\n LOGGER.error(\"String_Node_Str\", e);\n }\n }\n return null;\n}\n"
|
"public static void handleGroupInstanceTerminatedEvent(String appId, String groupId, String instanceId) {\n if (log.isDebugEnabled()) {\n log.debug(\"String_Node_Str\" + groupId + \"String_Node_Str\" + appId + \"String_Node_Str\" + instanceId);\n }\n Applications applications = ApplicationHolder.getApplications();\n Application application = applications.getApplication(appId);\n if (application == null) {\n log.warn(String.format(\"String_Node_Str\", appId));\n return;\n }\n Group group = application.getGroupRecursively(groupId);\n if (group == null) {\n log.warn(String.format(\"String_Node_Str\", groupId));\n return;\n }\n GroupInstance groupInstance = group.getInstanceContexts(instanceId);\n GroupStatus status = GroupStatus.Terminated;\n if (context != null) {\n if (context.isStateTransitionValid(status)) {\n context.setStatus(status);\n GroupMonitor monitor = getGroupMonitor(appId, groupId);\n ApplicationMonitor applicationMonitor = AutoscalerContext.getInstance().getAppMonitor(appId);\n if (monitor != null) {\n if (monitor.hasMonitors() && applicationMonitor.isTerminating()) {\n for (Monitor monitor1 : monitor.getAliasToActiveMonitorsMap().values()) {\n monitor1.destroy();\n }\n }\n GroupLevelNetworkPartitionContext networkPartitionContext = monitor.getNetworkPartitionContext(context.getNetworkPartitionId());\n networkPartitionContext.removeClusterGroupContext(instanceId);\n if (context.getPartitionId() != null) {\n networkPartitionContext.getPartitionCtxt(context.getPartitionId()).removeActiveInstance(context);\n }\n monitor.removeInstance(instanceId);\n group.removeInstance(instanceId);\n ApplicationHolder.persistApplication(application);\n ApplicationsEventPublisher.sendGroupInstanceTerminatedEvent(appId, groupId, instanceId);\n monitor.setStatus(status, instanceId);\n }\n } else {\n log.warn(\"String_Node_Str\" + groupId + \"String_Node_Str\" + instanceId + \"String_Node_Str\" + context.getStatus() + \"String_Node_Str\" + status);\n }\n } else {\n log.warn(\"String_Node_Str\" + groupId + \"String_Node_Str\" + instanceId);\n }\n}\n"
|
"public void clicked(InputEvent event, float x, float y) {\n ui.getWorld().resume();\n ui.getWorld().setCutMode(false);\n if (testScene.isChecked())\n ui.getWorld().setTestScene(scenes.getSelected());\n ui.getWorld().setCurrentScene(scenes.getSelected(), initScene.isChecked());\n ui.setCurrentScreen(Screens.SCENE_SCREEN);\n}\n"
|
"private String getAvailabilityString(ArrayList<ArrayList<String>> timeslots) {\n if (timeslots == null || timeslots.size() == 0) {\n return null;\n }\n for (ArrayList<String> timeslotTimes : timeslots) {\n if (timeslotTimes.size() != 2) {\n Log.e(TAG, \"String_Node_Str\");\n return null;\n }\n Timeslot start = buildTimeslot(timeslotTimes.get(0));\n Timeslot end = buildTimeslot(timeslotTimes.get(1));\n if (start.day.equals(end.day)) {\n availability += start.day + \"String_Node_Str\";\n if (start.period.equals(end.period)) {\n availability += start.hour + \"String_Node_Str\" + start.minute + \"String_Node_Str\" + end.hour + \"String_Node_Str\" + end.minute + end.period;\n } else {\n availability += start.hour + \"String_Node_Str\" + start.minute + start.period + \"String_Node_Str\" + end.hour + \"String_Node_Str\" + end.minute + end.period;\n }\n } else {\n availability += start.day + \"String_Node_Str\" + start.hour + \"String_Node_Str\" + start.minute + start.period + \"String_Node_Str\" + end.day + \"String_Node_Str\" + end.hour + \"String_Node_Str\" + end.minute + end.period;\n }\n if (timeslots.indexOf(timeslotTimes) != timeslots.size() - 1) {\n availability += \"String_Node_Str\";\n }\n }\n return availability;\n}\n"
|
"public void addChild(DLNAResource child, boolean isNew) {\n if (child == null) {\n LOGGER.error(\"String_Node_Str\", getName());\n LOGGER.debug(\"String_Node_Str\", new NullPointerException(\"String_Node_Str\"));\n return;\n }\n child.parent = this;\n child.masterParent = masterParent;\n if (parent != null) {\n defaultRenderer = parent.getDefaultRenderer();\n }\n if (PMS.filter(defaultRenderer, child)) {\n LOGGER.debug(\"String_Node_Str\" + child.getName() + \"String_Node_Str\" + defaultRenderer.getRendererName());\n return;\n }\n try {\n if (child.isValid()) {\n LOGGER.trace(\"String_Node_Str\", isNew ? \"String_Node_Str\" : \"String_Node_Str\", child.getName(), child.getClass().getName());\n if (allChildrenAreFolders && !child.isFolder()) {\n allChildrenAreFolders = false;\n }\n child.resHash = Math.abs(child.getSystemName().hashCode() + resumeHash());\n DLNAResource resumeRes = null;\n boolean addResumeFile = false;\n ResumeObj r = ResumeObj.create(child);\n if (r != null) {\n resumeRes = child.clone();\n resumeRes.resume = r;\n resumeRes.resHash = child.resHash;\n addResumeFile = true;\n }\n boolean parserV2 = child.media != null && defaultRenderer != null && defaultRenderer.isMediaParserV2();\n if (parserV2) {\n String mimeType = defaultRenderer.getFormatConfiguration().match(child.media);\n if (mimeType != null) {\n if (!configuration.isDisableSubtitles() && child.isSubsFile() && defaultRenderer.isSubtitlesStreamingSupported()) {\n OutputParams params = new OutputParams(configuration);\n Player.setAudioAndSubs(child.getSystemName(), child.media, params);\n if (params.sid.isExternal() && defaultRenderer.isExternalSubtitlesFormatSupported(params.sid)) {\n child.media_subtitle = params.sid;\n child.media_subtitle.setSubsStreamable(true);\n LOGGER.trace(\"String_Node_Str\");\n } else {\n LOGGER.trace(\"String_Node_Str\");\n }\n } else {\n LOGGER.trace(\"String_Node_Str\");\n }\n if (!FormatConfiguration.MIMETYPE_AUTO.equals(mimeType)) {\n LOGGER.trace(\"String_Node_Str\", child.media.getMimeType(), child.getName(), mimeType);\n child.media.setMimeType(mimeType);\n }\n LOGGER.trace(\"String_Node_Str\", child.getName(), child.media.getMimeType());\n } else {\n LOGGER.trace(\"String_Node_Str\", child.getName());\n }\n } else if (child.media != null && defaultRenderer != null) {\n LOGGER.trace(\"String_Node_Str\", child.getName(), defaultRenderer);\n }\n if (child.format != null) {\n String configurationSkipExtensions = configuration.getDisableTranscodeForExtensions();\n String rendererSkipExtensions = null;\n if (defaultRenderer != null) {\n rendererSkipExtensions = defaultRenderer.getStreamedExtensions();\n }\n boolean skip = child.format.skip(configurationSkipExtensions, rendererSkipExtensions);\n skipTranscode = skip;\n if (skip) {\n LOGGER.trace(\"String_Node_Str\", child.getName());\n }\n if (child.format.transcodable() || child.media != null) {\n if (child.media == null) {\n child.media = new DLNAMediaInfo();\n }\n Player player = null;\n String name = getName();\n if (!configuration.isHideRecentlyPlayedFolder()) {\n player = child.player;\n } else {\n for (Player p : PlayerFactory.getPlayers()) {\n String end = \"String_Node_Str\" + p.id() + \"String_Node_Str\";\n if (name.endsWith(end)) {\n nametruncate = name.lastIndexOf(end);\n player = p;\n LOGGER.trace(\"String_Node_Str\");\n break;\n } else if (parent != null && parent.getName().endsWith(end)) {\n parent.nametruncate = parent.getName().lastIndexOf(end);\n player = p;\n LOGGER.trace(\"String_Node_Str\");\n break;\n }\n }\n }\n if (player == null) {\n player = PlayerFactory.getPlayer(child);\n }\n if (player != null && !allChildrenAreFolders) {\n String configurationForceExtensions = configuration.getForceTranscodeForExtensions();\n String rendererForceExtensions = null;\n if (defaultRenderer != null) {\n rendererForceExtensions = defaultRenderer.getTranscodedExtensions();\n }\n boolean forceTranscode = child.format.skip(configurationForceExtensions, rendererForceExtensions);\n if (forceTranscode) {\n LOGGER.trace(\"String_Node_Str\", child.getName());\n }\n boolean hasEmbeddedSubs = false;\n boolean hasAnySubs = child.media.getSubtitleTracksList().size() > 0 || child.isSubsFile();\n boolean hasSubsToTranscode = false;\n if (!configuration.isDisableSubtitles() && hasAnySubs) {\n for (DLNAMediaSubtitle s : child.media.getSubtitleTracksList()) {\n hasEmbeddedSubs = (hasEmbeddedSubs || s.isEmbedded());\n }\n if (!parserV2) {\n if (child.isSubsFile() && defaultRenderer != null && defaultRenderer.isSubtitlesStreamingSupported()) {\n OutputParams params = new OutputParams(configuration);\n Player.setAudioAndSubs(child.getSystemName(), child.media, params);\n if (params.sid.isExternal() && defaultRenderer.isExternalSubtitlesFormatSupported(params.sid)) {\n child.media_subtitle = params.sid;\n child.media_subtitle.setSubsStreamable(true);\n LOGGER.trace(\"String_Node_Str\");\n } else {\n LOGGER.trace(\"String_Node_Str\");\n }\n } else {\n LOGGER.trace(\"String_Node_Str\");\n }\n }\n if (child.isSubsFile()) {\n if (child.media_subtitle == null) {\n forceTranscode = true;\n hasSubsToTranscode = true;\n LOGGER.trace(\"String_Node_Str\", child.getName());\n } else {\n LOGGER.trace(\"String_Node_Str\", child.getName());\n }\n } else if (hasEmbeddedSubs && child.media_subtitle != null) {\n if (defaultRenderer != null && !defaultRenderer.isEmbeddedSubtitlesFormatSupported(child.media_subtitle)) {\n forceTranscode = true;\n hasSubsToTranscode = true;\n LOGGER.trace(\"String_Node_Str\", child.getName());\n } else {\n LOGGER.trace(\"String_Node_Str\", child.getName());\n }\n }\n }\n boolean isIncompatible = false;\n String audioTracksList = child.getName() + child.media.getAudioTracksList().toString();\n if (!child.format.isCompatible(child.media, defaultRenderer)) {\n isIncompatible = true;\n LOGGER.trace(\"String_Node_Str\", child.getName());\n } else if (configuration.isEncodedAudioPassthrough() && (audioTracksList.contains(\"String_Node_Str\") || audioTracksList.contains(\"String_Node_Str\"))) {\n isIncompatible = true;\n LOGGER.trace(\"String_Node_Str\", child.getName());\n } else if (defaultRenderer != null && defaultRenderer.isKeepAspectRatio() && !\"String_Node_Str\".equals(child.media.getAspectRatioContainer())) {\n isIncompatible = true;\n LOGGER.trace(\"String_Node_Str\", child.getName(), child.media.getAspectRatioContainer());\n } else if (defaultRenderer != null && defaultRenderer.isMaximumResolutionSpecified() && (child.media.getWidth() > defaultRenderer.getMaxVideoWidth() || child.media.getHeight() > defaultRenderer.getMaxVideoHeight())) {\n isIncompatible = true;\n LOGGER.trace(\"String_Node_Str\", child.getName());\n }\n boolean preferTranscode = isIncompatible || hasSubsToTranscode;\n if (forceTranscode || (preferTranscode && !isSkipTranscode())) {\n child.player = player;\n if (resumeRes != null) {\n resumeRes.player = player;\n }\n if (parserV2) {\n LOGGER.trace(\"String_Node_Str\", child.getName(), player.toString(), child.media.getMimeType());\n } else {\n LOGGER.trace(\"String_Node_Str\", child.getName(), player.toString());\n }\n } else {\n LOGGER.trace(\"String_Node_Str\", child.getName());\n }\n if ((child.format.isVideo() || child.format.isAudio()) && child.isTranscodeFolderAvailable()) {\n VirtualFolder transcodeFolder = getTranscodeFolder(true);\n if (transcodeFolder != null) {\n VirtualFolder fileTranscodeFolder = new FileTranscodeVirtualFolder(child.getDisplayName(), null);\n DLNAResource newChild = child.clone();\n newChild.player = player;\n newChild.media = child.media;\n fileTranscodeFolder.addChildInternal(newChild);\n LOGGER.trace(\"String_Node_Str\", child.getName(), player.toString());\n transcodeFolder.updateChild(fileTranscodeFolder);\n }\n }\n if (child.format.isVideo() && child.isSubSelectable() && !(this instanceof SubSelFile)) {\n VirtualFolder vf = getSubSelector(true);\n if (vf != null) {\n DLNAResource newChild = child.clone();\n newChild.setPlayer(player);\n newChild.setMedia(child.media);\n LOGGER.trace(\"String_Node_Str\" + child.getName() + \"String_Node_Str\" + player.toString());\n vf.addChild(new SubSelFile(newChild));\n }\n }\n for (ExternalListener listener : ExternalFactory.getExternalListeners()) {\n if (listener instanceof AdditionalResourceFolderListener) {\n try {\n ((AdditionalResourceFolderListener) listener).addAdditionalFolder(this, child);\n } catch (Throwable t) {\n LOGGER.error(\"String_Node_Str\", listener.getClass(), t);\n }\n }\n }\n } else if (!child.format.isCompatible(child.media, defaultRenderer) && !child.isFolder()) {\n LOGGER.trace(\"String_Node_Str\", child.getName(), defaultRenderer.getRendererName());\n children.remove(child);\n }\n }\n if (resumeRes != null && resumeRes.media != null) {\n resumeRes.media.setThumbready(false);\n }\n if (child.format.getSecondaryFormat() != null && child.media != null && defaultRenderer != null && defaultRenderer.supportsFormat(child.format.getSecondaryFormat())) {\n DLNAResource newChild = child.clone();\n newChild.setFormat(newChild.format.getSecondaryFormat());\n LOGGER.trace(\"String_Node_Str\", newChild.format.toString(), newChild.getName());\n newChild.first = child;\n child.second = newChild;\n if (!newChild.format.isCompatible(newChild.media, defaultRenderer)) {\n Player player = PlayerFactory.getPlayer(newChild);\n newChild.setPlayer(player);\n LOGGER.trace(\"String_Node_Str\", newChild.format.toString(), newChild.getPlayer().name(), newChild.getName());\n }\n if (child.media != null && child.media.isSecondaryFormatValid()) {\n addChild(newChild);\n LOGGER.trace(\"String_Node_Str\", newChild.format.toString(), newChild.getName());\n } else {\n LOGGER.trace(\"String_Node_Str\", newChild.format.toString(), newChild.getName());\n }\n }\n }\n if (addResumeFile) {\n addChildInternal(resumeRes);\n }\n if (isNew) {\n addChildInternal(child);\n }\n }\n } catch (Throwable t) {\n LOGGER.error(\"String_Node_Str\", child.getName(), t);\n child.parent = null;\n children.remove(child);\n }\n}\n"
|
"public void render(Context context, Result result) {\n String finalName = context.getRequestPath().replaceFirst(PUBLIC_PREFIX, \"String_Node_Str\");\n URL url = null;\n if (ninjaProperties.isDev()) {\n File possibleFileInSrc = new File(srcDir + File.separator + ASSETS_PREFIX + finalName);\n if (possibleFileInSrc.exists()) {\n try {\n url = possibleFileInSrc.toURI().toURL();\n } catch (MalformedURLException malformedURLException) {\n logger.error(\"String_Node_Str\", malformedURLException);\n }\n }\n }\n if (url == null) {\n url = this.getClass().getClassLoader().getResource(ASSETS_PREFIX + finalName);\n }\n if (url == null) {\n context.finalizeHeadersWithoutFlashAndSessionCookie(Results.notFound());\n } else {\n try {\n URLConnection urlConnection = url.openConnection();\n Long lastModified = urlConnection.getLastModified();\n httpCacheToolkit.addEtag(context, result, lastModified);\n if (result.getStatusCode() == Result.SC_304_NOT_MODIFIED) {\n context.finalizeHeaders(result);\n } else {\n result.status(200);\n String mimeType = mimeTypes.getContentType(context, finalName);\n if (!mimeType.isEmpty()) {\n result.contentType(mimeType);\n }\n ResponseStreams responseStreams = context.finalizeHeaders(result);\n InputStream inputStream = urlConnection.getInputStream();\n OutputStream outputStream = responseStreams.getOutputStream();\n ByteStreams.copy(inputStream, outputStream);\n IOUtils.closeQuietly(inputStream);\n IOUtils.closeQuietly(outputStream);\n }\n } catch (FileNotFoundException e) {\n logger.error(\"String_Node_Str\", e);\n } catch (IOException e) {\n logger.error(\"String_Node_Str\", e);\n }\n }\n}\n"
|
"private void bluetoothStateChangeHandler(int prevState, int newState) {\n if (prevState != newState) {\n if (newState == BluetoothAdapter.STATE_ON || newState == BluetoothAdapter.STATE_OFF) {\n boolean isUp = (newState == BluetoothAdapter.STATE_ON);\n sendBluetoothStateCallback(isUp);\n if (isUp) {\n if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)) {\n Intent i = new Intent(IBluetoothGatt.class.getName());\n doBind(i, mConnection, Context.BIND_AUTO_CREATE | Context.BIND_IMPORTANT, UserHandle.CURRENT);\n }\n } else {\n if (!isUp && canUnbindBluetoothService()) {\n sendBluetoothServiceDownCallback();\n unbindAndFinish();\n }\n }\n }\n Intent intent = new Intent(BluetoothAdapter.ACTION_STATE_CHANGED);\n intent.putExtra(BluetoothAdapter.EXTRA_PREVIOUS_STATE, prevState);\n intent.putExtra(BluetoothAdapter.EXTRA_STATE, newState);\n intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);\n if (DBG)\n Log.d(TAG, \"String_Node_Str\" + prevState + \"String_Node_Str\" + newState);\n mContext.sendBroadcastAsUser(intent, UserHandle.ALL, BLUETOOTH_PERM);\n }\n}\n"
|
"public Map<String, Object> readProperties(Element element, String... propertyKeys) {\n Scanner s = getScanner();\n s.setRange(Range.exact((String) element.getId()));\n if (propertyKeys != null) {\n s.fetchColumnFamily(new Text(Constants.LABEL));\n for (String key : propertyKeys) {\n s.fetchColumnFamily(new Text(key));\n }\n }\n Map<String, Object> props = new PropertyParser().parse(s);\n s.close();\n return props;\n}\n"
|
"public View getView(int position, View convertView, ViewGroup parent) {\n int itemType = this.getItemViewType(position);\n switch(itemType) {\n case WAKELOCK_TYPE:\n WakelockStats wakelock = (WakelockStats) getItem(position);\n WakelockViewHolder viewHolder;\n if (convertView == null) {\n viewHolder = new WakelockViewHolder();\n LayoutInflater inflater = LayoutInflater.from(getContext());\n convertView = inflater.inflate(R.layout.fragment_wakelocks_listitem, parent, false);\n viewHolder.name = (TextView) convertView.findViewById(R.id.textviewWakelockName);\n viewHolder.wakeTime = (TextView) convertView.findViewById(R.id.textviewWakelockTime);\n viewHolder.wakeCount = (TextView) convertView.findViewById(R.id.textViewWakelockCount);\n convertView.setTag(viewHolder);\n } else {\n viewHolder = (WakelockViewHolder) convertView.getTag();\n }\n viewHolder.name.setText(wakelock.getName());\n viewHolder.name.setSelected(true);\n viewHolder.wakeTime.setText(String.valueOf(wakelock.getDurationAllowedFormatted()));\n viewHolder.wakeCount.setText(String.valueOf(wakelock.getAllowedCount()));\n viewHolder.wakeCount.measure(View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED), View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));\n int height = viewHolder.wakeCount.getMeasuredHeight();\n int width = viewHolder.wakeCount.getMeasuredWidth();\n if (height > width) {\n viewHolder.wakeCount.setLayoutParams(new LinearLayout.LayoutParams(height, height));\n } else {\n viewHolder.wakeCount.setLayoutParams(new LinearLayout.LayoutParams(width, width));\n }\n float correctedStat = wakelock.getAllowedCount() - mLowCount;\n float point = 120 - ((correctedStat / mScale) * 120);\n float[] hsv = { point, 1, 1 };\n viewHolder.wakeCount.setBackgroundColor(Color.HSVToColor(hsv));\n break;\n case CATEGORY_TYPE:\n CategoryViewHolder categoryViewHolder = null;\n if (convertView == null) {\n categoryViewHolder = new CategoryViewHolder();\n LayoutInflater inflater = LayoutInflater.from(getContext());\n convertView = inflater.inflate(R.layout.fragment_wakelocks_listgroup, parent, false);\n categoryViewHolder.name = (TextView) convertView.findViewById(R.id.textviewCategoryName);\n convertView.setTag(categoryViewHolder);\n } else {\n categoryViewHolder = (CategoryViewHolder) convertView.getTag();\n }\n if (position == mCategoryBlockedIndex) {\n categoryViewHolder.name.setText(R.string.category_unbounced);\n } else if (position == mCategorySafeIndex) {\n categoryViewHolder.name.setText(\"String_Node_Str\");\n } else if (position == mCategoryUnknownIndex) {\n categoryViewHolder.name.setText(\"String_Node_Str\");\n } else if (position == mCategoryUnsafeIndex) {\n categoryViewHolder.name.setText(\"String_Node_Str\");\n } else {\n categoryViewHolder.name.setText(\"String_Node_Str\");\n }\n break;\n }\n return convertView;\n}\n"
|
"public boolean marshalSingleValue(XPathFragment xPathFragment, MarshalRecord marshalRecord, Object object, Object objectValue, CoreAbstractSession session, NamespaceResolver namespaceResolver, MarshalContext marshalContext) {\n objectValue = xmlCompositeObjectMapping.convertObjectValueToDataValue(objectValue, session, marshalRecord.getMarshaller());\n if (null == objectValue) {\n return xmlCompositeObjectMapping.getNullPolicy().compositeObjectMarshal(xPathFragment, marshalRecord, object, session, namespaceResolver);\n }\n XPathFragment groupingFragment = marshalRecord.openStartGroupingElements(namespaceResolver);\n if (xPathFragment.hasAttribute) {\n ObjectBuilder tob = (ObjectBuilder) xmlCompositeObjectMapping.getReferenceDescriptor().getObjectBuilder();\n MappingNodeValue textMappingNodeValue = (MappingNodeValue) tob.getRootXPathNode().getTextNode().getMarshalNodeValue();\n Mapping textMapping = textMappingNodeValue.getMapping();\n if (textMapping.isAbstractDirectMapping()) {\n DirectMapping xmlDirectMapping = (DirectMapping) textMapping;\n Object fieldValue = xmlDirectMapping.getFieldValue(xmlDirectMapping.valueFromObject(objectValue, xmlDirectMapping.getField(), session), session, marshalRecord);\n QName schemaType = ((Field) xmlDirectMapping.getField()).getSchemaTypeForValue(fieldValue, session);\n if (fieldValue != null) {\n marshalRecord.attribute(xPathFragment, namespaceResolver, fieldValue, schemaType);\n } else {\n XMLMarshalException ex = XMLMarshalException.nullValueNotAllowed(this.xmlCompositeObjectMapping.getAttributeName(), this.xmlCompositeObjectMapping.getDescriptor().getJavaClass().getName());\n try {\n marshalRecord.getMarshaller().getErrorHandler().warning(new SAXParseException(null, null, ex));\n } catch (Exception saxException) {\n throw ex;\n }\n }\n marshalRecord.closeStartGroupingElements(groupingFragment);\n return true;\n } else {\n return textMappingNodeValue.marshalSingleValue(xPathFragment, marshalRecord, objectValue, textMapping.getAttributeValueFromObject(objectValue), session, namespaceResolver, marshalContext);\n }\n }\n boolean isSelfFragment = xPathFragment.isSelfFragment;\n marshalRecord.closeStartGroupingElements(groupingFragment);\n UnmarshalKeepAsElementPolicy keepAsElementPolicy = xmlCompositeObjectMapping.getKeepAsElementPolicy();\n if (null != keepAsElementPolicy && (keepAsElementPolicy.isKeepUnknownAsElement() || keepAsElementPolicy.isKeepAllAsElement()) && objectValue instanceof Node) {\n if (isSelfFragment) {\n NodeList children = ((org.w3c.dom.Element) objectValue).getChildNodes();\n for (int i = 0, childrenLength = children.getLength(); i < childrenLength; i++) {\n Node next = children.item(i);\n short nodeType = next.getNodeType();\n if (nodeType == Node.ELEMENT_NODE) {\n marshalRecord.node(next, marshalRecord.getNamespaceResolver());\n return true;\n } else if (nodeType == Node.TEXT_NODE) {\n marshalRecord.characters(((Text) next).getNodeValue());\n return true;\n }\n }\n return false;\n } else {\n marshalRecord.node((Node) objectValue, marshalRecord.getNamespaceResolver());\n return true;\n }\n }\n Descriptor descriptor = (Descriptor) xmlCompositeObjectMapping.getReferenceDescriptor();\n if (descriptor == null) {\n descriptor = (Descriptor) session.getDescriptor(objectValue.getClass());\n } else if (descriptor.hasInheritance()) {\n Class objectValueClass = objectValue.getClass();\n if (!(objectValueClass == descriptor.getJavaClass())) {\n descriptor = (Descriptor) session.getDescriptor(objectValueClass);\n }\n }\n if (descriptor != null) {\n marshalRecord.beforeContainmentMarshal(objectValue);\n ObjectBuilder objectBuilder = (ObjectBuilder) descriptor.getObjectBuilder();\n CoreAttributeGroup group = marshalRecord.getCurrentAttributeGroup();\n CoreAttributeItem item = group.getItem(getMapping().getAttributeName());\n CoreAttributeGroup nestedGroup = XMLRecord.DEFAULT_ATTRIBUTE_GROUP;\n if (item != null) {\n if (item.getGroups() != null) {\n nestedGroup = item.getGroup(descriptor.getJavaClass());\n }\n if (nestedGroup == null) {\n nestedGroup = item.getGroup() == null ? XMLRecord.DEFAULT_ATTRIBUTE_GROUP : item.getGroup();\n }\n }\n marshalRecord.pushAttributeGroup(nestedGroup);\n if (!(isSelfFragment || xPathFragment.nameIsText)) {\n xPathNode.startElement(marshalRecord, xPathFragment, object, session, namespaceResolver, objectBuilder, objectValue);\n }\n List extraNamespaces = null;\n if (!marshalRecord.hasEqualNamespaceResolvers()) {\n extraNamespaces = objectBuilder.addExtraNamespacesToNamespaceResolver(descriptor, marshalRecord, session, true, false);\n writeExtraNamespaces(extraNamespaces, marshalRecord, session);\n }\n if (!isSelfFragment) {\n marshalRecord.addXsiTypeAndClassIndicatorIfRequired(descriptor, (Descriptor) xmlCompositeObjectMapping.getReferenceDescriptor(), (Field) xmlCompositeObjectMapping.getField(), false);\n }\n objectBuilder.buildRow(marshalRecord, objectValue, session, marshalRecord.getMarshaller(), xPathFragment);\n marshalRecord.afterContainmentMarshal(object, objectValue);\n marshalRecord.popAttributeGroup();\n if (!(isSelfFragment || xPathFragment.nameIsText())) {\n marshalRecord.endElement(xPathFragment, namespaceResolver);\n }\n marshalRecord.removeExtraNamespacesFromNamespaceResolver(extraNamespaces, session);\n } else {\n if (Constants.UNKNOWN_OR_TRANSIENT_CLASS.equals(xmlCompositeObjectMapping.getReferenceClassName())) {\n throw XMLMarshalException.descriptorNotFoundInProject(objectValue.getClass().getName());\n }\n if (!(isSelfFragment || xPathFragment.nameIsText())) {\n xPathNode.startElement(marshalRecord, xPathFragment, object, session, namespaceResolver, null, objectValue);\n }\n QName schemaType = ((Field) xmlCompositeObjectMapping.getField()).getSchemaTypeForValue(objectValue, session);\n updateNamespaces(schemaType, marshalRecord, ((Field) xmlCompositeObjectMapping.getField()));\n marshalRecord.characters(schemaType, objectValue, null, false);\n if (!(isSelfFragment || xPathFragment.nameIsText())) {\n marshalRecord.endElement(xPathFragment, namespaceResolver);\n }\n }\n return true;\n}\n"
|
"public void run() {\n Island island = plugin.getGrid().getIsland(targetPlayer);\n final IslandPreLevelEvent event = new IslandPreLevelEvent(targetPlayer, island, score);\n event.setLongPointsToNextLevel(pointsToNextLevel);\n plugin.getServer().getPluginManager().callEvent(event);\n long oldLevel = plugin.getPlayers().getIslandLevel(targetPlayer);\n if (!event.isCancelled()) {\n if (oldLevel != event.getLevel()) {\n plugin.getPlayers().setIslandLevel(targetPlayer, event.getLevel());\n plugin.getPlayers().save(targetPlayer);\n }\n if (plugin.getPlayers().inTeam(targetPlayer)) {\n for (UUID member : plugin.getPlayers().getMembers(targetPlayer)) {\n if (plugin.getPlayers().getIslandLevel(member) != event.getLevel()) {\n plugin.getPlayers().setIslandLevel(member, event.getLevel());\n plugin.getPlayers().save(member);\n }\n }\n }\n if (plugin.getPlayers().inTeam(targetPlayer)) {\n UUID leader = plugin.getPlayers().getTeamLeader(targetPlayer);\n if (leader != null) {\n TopTen.topTenAddEntry(leader, event.getLongLevel());\n }\n } else {\n TopTen.topTenAddEntry(targetPlayer, event.getLongLevel());\n }\n }\n final IslandPostLevelEvent event3 = new IslandPostLevelEvent(targetPlayer, island, event.getLongLevel(), event.getLongPointsToNextLevel());\n plugin.getServer().getPluginManager().callEvent(event3);\n if (!event3.isCancelled()) {\n if (sender != null) {\n if (!(sender instanceof Player)) {\n if (!report) {\n Util.sendMessage(sender, ChatColor.GREEN + plugin.myLocale().islandislandLevelis.replace(\"String_Node_Str\", String.valueOf(plugin.getPlayers().getIslandLevel(targetPlayer))));\n } else {\n for (String line : reportLines) {\n Util.sendMessage(sender, line);\n }\n Util.sendMessage(sender, ChatColor.GREEN + plugin.myLocale().islandislandLevelis.replace(\"String_Node_Str\", String.valueOf(plugin.getPlayers().getIslandLevel(targetPlayer))));\n if (event.getLongPointsToNextLevel() >= 0) {\n String toNextLevel = ChatColor.GREEN + plugin.myLocale().islandrequiredPointsToNextLevel.replace(\"String_Node_Str\", String.valueOf(event.getLongPointsToNextLevel()));\n toNextLevel = toNextLevel.replace(\"String_Node_Str\", String.valueOf(plugin.getPlayers().getIslandLevel(targetPlayer) + 1));\n Util.sendMessage(sender, toNextLevel);\n }\n }\n } else {\n if (!report) {\n if (plugin.getPlayers().getIslandLevel(targetPlayer) != oldLevel) {\n plugin.getMessages().tellOfflineTeam(targetPlayer, ChatColor.GREEN + plugin.myLocale().islandislandLevelis.replace(\"String_Node_Str\", String.valueOf(plugin.getPlayers().getIslandLevel(targetPlayer))));\n }\n if (sender instanceof Player && ((Player) sender).isOnline()) {\n String message = ChatColor.GREEN + plugin.myLocale(((Player) sender).getUniqueId()).islandislandLevelis.replace(\"String_Node_Str\", String.valueOf(plugin.getPlayers().getIslandLevel(targetPlayer)));\n if (Settings.deathpenalty != 0) {\n message += \"String_Node_Str\" + plugin.myLocale(((Player) sender).getUniqueId()).levelDeaths.replace(\"String_Node_Str\", String.valueOf(deathHandicap));\n }\n Util.sendMessage(sender, message);\n if (event.getLongPointsToNextLevel() >= 0) {\n String toNextLevel = ChatColor.GREEN + plugin.myLocale(((Player) sender).getUniqueId()).islandrequiredPointsToNextLevel.replace(\"String_Node_Str\", String.valueOf(event.getLongPointsToNextLevel()));\n toNextLevel = toNextLevel.replace(\"String_Node_Str\", String.valueOf(plugin.getPlayers().getIslandLevel(targetPlayer) + 1));\n Util.sendMessage(sender, toNextLevel);\n }\n }\n } else {\n if (((Player) sender).isOnline()) {\n for (String line : reportLines) {\n Util.sendMessage(sender, line);\n }\n }\n Util.sendMessage(sender, ChatColor.GREEN + plugin.myLocale().islandislandLevelis + \"String_Node_Str\" + ChatColor.WHITE + plugin.getPlayers().getIslandLevel(targetPlayer));\n if (event.getLongPointsToNextLevel() >= 0) {\n String toNextLevel = ChatColor.GREEN + plugin.myLocale().islandrequiredPointsToNextLevel.replace(\"String_Node_Str\", String.valueOf(event.getLongPointsToNextLevel()));\n toNextLevel = toNextLevel.replace(\"String_Node_Str\", String.valueOf(plugin.getPlayers().getIslandLevel(targetPlayer) + 1));\n Util.sendMessage(sender, toNextLevel);\n }\n }\n }\n }\n }\n}\n"
|
"public Path toPath(float width, float height, int numSample) {\n final float[] pts = GestureUtilities.temporalSampling(this, numSample);\n final RectF rect = boundingBox;\n GestureUtilities.translate(pts, -rect.left, -rect.top);\n float sx = width / rect.width();\n float sy = height / rect.height();\n float scale = sx > sy ? sy : sx;\n GestureUtilities.scale(pts, scale, scale);\n float mX = 0;\n float mY = 0;\n Path path = null;\n final int count = pts.length;\n for (int i = 0; i < count; i += 2) {\n float x = pts[i];\n float y = pts[i + 1];\n if (path == null) {\n path = new Path();\n path.moveTo(x, y);\n mX = x;\n mY = y;\n } else {\n float dx = Math.abs(x - mX);\n float dy = Math.abs(y - mY);\n if (dx >= TOUCH_TOLERANCE || dy >= TOUCH_TOLERANCE) {\n path.quadTo(mX, mY, (x + mX) / 2, (y + mY) / 2);\n mX = x;\n mY = y;\n }\n }\n }\n return path;\n}\n"
|
"private Section getFreeSection(int requiredLength) {\n int start = 0;\n int length = 0;\n int closestStart = 0;\n int closestLength = Integer.MAX_VALUE;\n int i;\n for (i = 2; i < this.filledSectorArray.size(); i++) {\n if (this.filledSectorArray.get(i)) {\n if ((length >= requiredLength) && (length < closestLength)) {\n closestLength = length;\n closestStart = start;\n if (closestLength == requiredLength) {\n break;\n }\n length = 0;\n }\n } else {\n if (length == 0) {\n start = i;\n }\n length++;\n }\n }\n if (closestStart <= 0) {\n closestStart = i;\n }\n return (closestStart != 0) ? new Section(closestStart, requiredLength) : null;\n}\n"
|
"public int getCapacity() {\n return _queueMaxCapacity;\n}\n"
|
"public boolean checkTrigger(GameEvent event, Game game) {\n if (event.getType() == EventType.SPELL_CAST && event.getZone() == Zone.LIBRARY) {\n Spell spell = game.getStack().getSpell(event.getTargetId());\n if (spell != null && spell.getControllerId().equals(super.getControllerId()) && (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY))) {\n for (Effect effect : this.getEffects()) {\n effect.setTargetPointer(new FixedTarget(event.getTargetId()));\n }\n return true;\n }\n }\n return false;\n}\n"
|
"public PacketTile getDescPacket() {\n return new PacketTile(this, getSaveData());\n}\n"
|
"public boolean doRemove(XtentisPort port, Object wsObj) throws RemoteException {\n if (wsObj != null) {\n WSCustomForm wsForm = (WSCustomForm) wsObj;\n port.deleteCustomForm(new WSDeleteCustomForm(new WSCustomFormPK(wsForm.getDatamodel(), wsForm.getEntity(), cmd.getObjName())));\n return true;\n }\n return false;\n}\n"
|
"public Bitmap apply(Bitmap bitmap, float scaleFactor, boolean highQuality) {\n Canvas canvas = new Canvas(bitmap);\n applyHelper(canvas, bitmap.getWidth(), bitmap.getHeight());\n return bitmap;\n}\n"
|
"private void leavingServletContainer(Request req, Response res) {\n if (interceptors == null)\n return;\n for (ServletContainerInterceptor interceptor : interceptors) {\n try {\n interceptor.postInvoke(req, res);\n } catch (Throwable th) {\n log.log(Level.SEVERE, INTERNAL_ERROR, th);\n }\n }\n}\n"
|
"public int read(int address, boolean word, long cycles) {\n PortReg reg = portMap[address - offset];\n if (word && reg == PortReg.IV_L) {\n return (readPort(PortReg.IV_H, cycles) << 8) | readPort(reg, cycles);\n } else if (word && ioPair != null) {\n return read_port(reg, cycles) | (ioPair.read_port(reg, cycles) << 8);\n }\n return read_port(reg, cycles);\n}\n"
|
"public boolean equals(Object obj) {\n if (this == obj) {\n return true;\n if (obj == null)\n return false;\n if (getClass() != obj.getClass())\n return false;\n Relation other = (Relation) obj;\n if (id == null) {\n if (other.id != null)\n return false;\n } else if (!id.equals(other.id))\n return false;\n if (type == null) {\n if (other.type != null)\n return false;\n } else if (!type.equals(other.type))\n return false;\n if (version == null) {\n if (other.version != null)\n return false;\n } else if (!version.equals(other.version))\n return false;\n return true;\n}\n"
|
"public Object invokeTriggerFunction(List<WindowBufferItem> events) {\n return triggerFunction.trigger(events);\n}\n"
|
"public int getInt(String property) {\n return ((JsonObject) current).has(property) ? ((JsonObject) current).get(property).getAsInt() : 0;\n}\n"
|
"public IComplexNDArray get(NDArrayIndex... indexes) {\n ensureNotCleanedUp();\n indexes = Indices.adjustIndices(shape(), indexes);\n int[] offsets = Indices.offsets(indexes);\n int[] shape = Indices.shape(shape(), indexes);\n if (!Indices.isContiguous(indexes)) {\n IComplexNDArray ret = Nd4j.createComplex(shape);\n if (ret.isVector() && isVector()) {\n int[] indices = indexes[0].indices();\n for (int i = 0; i < ret.length(); i++) {\n ret.putScalar(i, getDouble(indices[i]));\n }\n return ret;\n }\n if (!ret.isVector()) {\n for (int i = 0; i < ret.slices(); i++) {\n INDArray putSlice = slice(i).get(Arrays.copyOfRange(indexes, 1, indexes.length));\n ret.putSlice(i, putSlice);\n }\n } else {\n INDArray putSlice = slice(0).get(Arrays.copyOfRange(indexes, 1, indexes.length));\n ret.putSlice(0, putSlice);\n }\n return ret;\n }\n if (ArrayUtil.prod(shape) >= length())\n return this;\n int[] strides = ArrayUtil.copy(stride());\n return subArray(offsets, shape, strides);\n}\n"
|
"public void run() {\n try {\n startCassandraProcess();\n startupLatch.countDown();\n } catch (InterruptedException e) {\n throw new IllegalStateException(e);\n }\n}\n"
|
"private static AbstractAlgorithm createPartialNone(final SolutionSpace solutionSpace, final NodeChecker checker, final FLASHStrategy strategy) {\n PhaseAnonymityProperty binaryAnonymityProperty = PhaseAnonymityProperty.K_ANONYMITY;\n NodeAction binaryTriggerSkip = new NodeAction() {\n public boolean appliesTo(Transformation node) {\n return node.hasProperty(solutionSpace.getPropertyKAnonymous()) || node.hasProperty(solutionSpace.getPropertyNotKAnonymous());\n }\n };\n NodeAction binaryTriggerTag = new NodeAction() {\n public void action(Transformation node) {\n if (node.hasProperty(solutionSpace.getPropertyKAnonymous())) {\n node.setPropertyToNeighbours(solutionSpace.getPropertyKAnonymous());\n } else {\n node.setPropertyToNeighbours(solutionSpace.getPropertyNotKAnonymous());\n }\n }\n public boolean appliesTo(Transformation node) {\n return node.hasProperty(solutionSpace.getPropertyKAnonymous()) || node.hasProperty(solutionSpace.getPropertyNotKAnonymous());\n }\n };\n NodeAction binaryTriggerCheck = new NodeActionInverse(binaryTriggerSkip);\n NodeAction binaryTriggerEvaluate = new NodeActionConstant(false);\n PredictiveProperty linearAnonymityProperty = solutionSpace.getPropertyAnonymous();\n NodeAction linearTriggerSkip = new NodeAction() {\n public boolean appliesTo(Transformation node) {\n return node.hasProperty(solutionSpace.getPropertyVisited()) || node.hasProperty(solutionSpace.getPropertyNotKAnonymous());\n }\n };\n NodeAction linearTriggerEvaluate = new NodeActionConstant(false);\n NodeAction linearTriggerCheck = new NodeAction() {\n public boolean appliesTo(Transformation node) {\n return !node.hasProperty(solutionSpace.getPropertyChecked()) && !node.hasProperty(solutionSpace.getPropertyNotKAnonymous());\n }\n };\n NodeAction linearTriggerTag = new NodeAction() {\n public void action(Transformation node) {\n node.setProperty(solutionSpace.getPropertyVisited());\n }\n public boolean appliesTo(Transformation node) {\n return true;\n }\n };\n NodeAction triggerFireEvent = new NodeActionOR(linearTriggerSkip) {\n protected boolean additionalConditionAppliesTo(Transformation node) {\n return node.hasProperty(solutionSpace.getPropertySuccessorsPruned());\n }\n };\n FLASHConfiguration config = FLASHConfiguration.createTwoPhaseConfiguration(new FLASHPhaseConfiguration(binaryAnonymityProperty, binaryTriggerTag, binaryTriggerCheck, binaryTriggerEvaluate, binaryTriggerSkip), new FLASHPhaseConfiguration(linearAnonymityProperty, linearTriggerTag, linearTriggerCheck, linearTriggerEvaluate, linearTriggerSkip), triggerFireEvent, StorageStrategy.ALL, true, false);\n return new FLASHAlgorithmImpl(solutionSpace, checker, strategy, config);\n}\n"
|
"public static void addApplication(ApplicationBean appDefinition, ConfigurationContext ctxt, String userName, String tenantDomain) throws RestAPIException {\n try {\n if (AutoscalerServiceClient.getInstance().getApplication(appDefinition.getApplicationId()) != null) {\n String msg = \"String_Node_Str\" + appDefinition.getApplicationId();\n throw new RestAPIException(msg);\n }\n } catch (RemoteException e) {\n throw new RestAPIException(\"String_Node_Str\", e);\n }\n ApplicationContext applicationContext = ObjectConverter.convertApplicationDefinitionToStubApplicationContext(appDefinition);\n applicationContext.setTenantId(ApplicationManagementUtil.getTenantId(ctxt));\n applicationContext.setTenantDomain(tenantDomain);\n applicationContext.setTenantAdminUsername(userName);\n if (appDefinition.getProperty() != null) {\n org.apache.stratos.autoscaler.stub.Properties properties = new org.apache.stratos.autoscaler.stub.Properties();\n for (PropertyBean propertyBean : appDefinition.getProperty()) {\n org.apache.stratos.autoscaler.stub.Property property = new org.apache.stratos.autoscaler.stub.Property();\n property.setName(propertyBean.getName());\n property.setValue(propertyBean.getValue());\n properties.addProperties(property);\n }\n applicationContext.setProperties(properties);\n }\n try {\n AutoscalerServiceClient.getInstance().addApplication(applicationContext);\n String[] cartridgeNames;\n String[] cartridgeGroupNames;\n StratosManagerServiceClient smServiceClient = getStratosManagerServiceClient();\n List<CartridgeReferenceBean> cartridges = appDefinition.getComponents().getCartridges();\n if (cartridges != null) {\n cartridgeNames = new HashSet<String>();\n for (CartridgeReferenceBean cartridge : cartridges) {\n cartridgeNames.add(cartridge.getType());\n }\n smServiceClient.addUsedCartridgesInApplications(appDefinition.getApplicationId(), (String[]) cartridgeNames.toArray());\n }\n List<GroupReferenceBean> cartridgeGroups = appDefinition.getComponents().getGroups();\n if (cartridgeGroups != null) {\n cartridgeGroupNames = new HashSet<String>();\n for (GroupReferenceBean cartridgeGroup : cartridgeGroups) {\n cartridgeGroupNames.add(cartridgeGroup.getName());\n }\n smServiceClient.addUsedCartridgeGroupsInApplications(appDefinition.getApplicationId(), (String[]) cartridgeGroupNames.toArray());\n }\n } catch (AutoscalerServiceApplicationDefinitionExceptionException e) {\n throw new RestAPIException(e);\n } catch (RemoteException e) {\n throw new RestAPIException(e);\n }\n}\n"
|
"public void run() {\n if ((pos2.getX() - pos1.getX()) < 48) {\n MainUtil.setSimpleCuboid(world, new Location(world, pos1.getX(), 0, pos1.getZ()), new Location(world, pos2.getX() + 1, 1, pos2.getZ() + 1), new PlotBlock((short) 7, (byte) 0));\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setSimpleCuboid(world, new Location(world, pos1.getX(), dpw.PLOT_HEIGHT + 1, pos1.getZ()), new Location(world, pos2.getX() + 1, maxy + 1, pos2.getZ() + 1), new PlotBlock((short) 0, (byte) 0));\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setCuboid(world, new Location(world, pos1.getX(), 1, pos1.getZ()), new Location(world, pos2.getX() + 1, dpw.PLOT_HEIGHT, pos2.getZ() + 1), filling);\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setCuboid(world, new Location(world, pos1.getX(), dpw.PLOT_HEIGHT, pos1.getZ()), new Location(world, pos2.getX() + 1, dpw.PLOT_HEIGHT + 1, pos2.getZ() + 1), plotfloor);\n TaskManager.runTask(whenDone);\n }\n }, 5);\n }\n }, 5);\n }\n }, 5);\n return;\n }\n final int startX = (pos1.getX() / 16) * 16;\n final int startZ = (pos1.getZ() / 16) * 16;\n final int chunkX = 16 + pos2.getX();\n final int chunkZ = 16 + pos2.getZ();\n final Location l1 = MainUtil.getPlotBottomLoc(world, plot.id);\n final Location l2 = MainUtil.getPlotTopLoc(world, plot.id);\n final int plotMinX = l1.getX() + 1;\n final int plotMinZ = l1.getZ() + 1;\n final int plotMaxX = l2.getX();\n final int plotMaxZ = l2.getZ();\n Location mn = null;\n Location mx = null;\n for (int i = startX; i < chunkX; i += 16) {\n for (int j = startZ; j < chunkZ; j += 16) {\n final Plot plot1 = MainUtil.getPlot(new Location(world, i, 0, j));\n if ((plot1 != null) && (!plot1.getId().equals(plot.getId()))) {\n break;\n }\n final Plot plot2 = MainUtil.getPlot(new Location(world, i + 15, 0, j));\n if ((plot2 != null) && (!plot2.getId().equals(plot.getId()))) {\n break;\n }\n final Plot plot3 = MainUtil.getPlot(new Location(world, i + 15, 0, j + 15));\n if ((plot3 != null) && (!plot3.getId().equals(plot.getId()))) {\n break;\n }\n final Plot plot4 = MainUtil.getPlot(new Location(world, i, 0, j + 15));\n if ((plot4 != null) && (!plot4.getId().equals(plot.getId()))) {\n break;\n }\n final Plot plot5 = MainUtil.getPlot(new Location(world, i + 15, 0, j + 15));\n if ((plot5 != null) && (!plot5.getId().equals(plot.getId()))) {\n break;\n }\n if (mn == null) {\n mn = new Location(world, Math.max(i - 1, plotMinX), 0, Math.max(j - 1, plotMinZ));\n mx = new Location(world, Math.min(i + 16, plotMaxX), 0, Math.min(j + 16, plotMaxZ));\n } else if ((mx.getZ() < (j + 15)) || (mx.getX() < (i + 15))) {\n mx = new Location(world, Math.min(i + 16, plotMaxX), 0, Math.min(j + 16, plotMaxZ));\n }\n final int I = i;\n final int J = j;\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n BukkitUtil.regenerateChunk(world, I / 16, J / 16);\n }\n }, PseudoRandom.random(40));\n }\n }\n final Location max = mx;\n final Location min = mn;\n if (min == null) {\n MainUtil.setSimpleCuboid(world, new Location(world, pos1.getX(), 0, pos1.getZ()), new Location(world, pos2.getX() + 1, 1, pos2.getZ() + 1), new PlotBlock((short) 7, (byte) 0));\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setSimpleCuboid(world, new Location(world, pos1.getX(), dpw.PLOT_HEIGHT + 1, pos1.getZ()), new Location(world, pos2.getX() + 1, maxy + 1, pos2.getZ() + 1), new PlotBlock((short) 0, (byte) 0));\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setCuboid(world, new Location(world, pos1.getX(), 1, pos1.getZ()), new Location(world, pos2.getX() + 1, dpw.PLOT_HEIGHT, pos2.getZ() + 1), filling);\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setCuboid(world, new Location(world, pos1.getX(), dpw.PLOT_HEIGHT, pos1.getZ()), new Location(world, pos2.getX() + 1, dpw.PLOT_HEIGHT + 1, pos2.getZ() + 1), plotfloor);\n }\n }, 5);\n }\n }, 5);\n }\n }, 5);\n return;\n } else {\n if (min.getX() < plotMinX) {\n min.setX(plotMinX);\n }\n if (min.getZ() < plotMinZ) {\n min.setZ(plotMinZ);\n }\n if (max.getX() > plotMaxX) {\n max.setX(plotMaxX);\n }\n if (max.getZ() > plotMaxZ) {\n max.setZ(plotMaxZ);\n }\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setSimpleCuboid(world, new Location(world, plotMinX, 0, plotMinZ), new Location(world, min.getX() + 1, 1, min.getZ() + 1), new PlotBlock((short) 7, (byte) 0));\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setSimpleCuboid(world, new Location(world, plotMinX, dpw.PLOT_HEIGHT + 1, plotMinZ), new Location(world, min.getX() + 1, maxy + 1, min.getZ() + 1), new PlotBlock((short) 0, (byte) 0));\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setCuboid(world, new Location(world, plotMinX, 1, plotMinZ), new Location(world, min.getX() + 1, dpw.PLOT_HEIGHT + 1, min.getZ() + 1), filling);\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setCuboid(world, new Location(world, plotMinX, dpw.PLOT_HEIGHT, plotMinZ), new Location(world, min.getX() + 1, dpw.PLOT_HEIGHT + 1, min.getZ() + 1), plotfloor);\n }\n }, 1);\n }\n }, 1);\n }\n }, 1);\n }\n }, 21);\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setSimpleCuboid(world, new Location(world, min.getX(), 0, plotMinZ), new Location(world, max.getX() + 1, 1, min.getZ() + 1), new PlotBlock((short) 7, (byte) 0));\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setSimpleCuboid(world, new Location(world, min.getX(), dpw.PLOT_HEIGHT + 1, plotMinZ), new Location(world, max.getX() + 1, maxy + 1, min.getZ() + 1), new PlotBlock((short) 0, (byte) 0));\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setCuboid(world, new Location(world, min.getX(), 1, plotMinZ), new Location(world, max.getX() + 1, dpw.PLOT_HEIGHT, min.getZ() + 1), filling);\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setCuboid(world, new Location(world, min.getX(), dpw.PLOT_HEIGHT, plotMinZ), new Location(world, max.getX() + 1, dpw.PLOT_HEIGHT + 1, min.getZ() + 1), plotfloor);\n }\n }, 1);\n }\n }, 1);\n }\n }, 1);\n }\n }, 25);\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setSimpleCuboid(world, new Location(world, max.getX(), 0, plotMinZ), new Location(world, plotMaxX + 1, 1, min.getZ() + 1), new PlotBlock((short) 7, (byte) 0));\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setSimpleCuboid(world, new Location(world, max.getX(), dpw.PLOT_HEIGHT + 1, plotMinZ), new Location(world, plotMaxX + 1, maxy + 1, min.getZ() + 1), new PlotBlock((short) 0, (byte) 0));\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setCuboid(world, new Location(world, max.getX(), 1, plotMinZ), new Location(world, plotMaxX + 1, dpw.PLOT_HEIGHT, min.getZ() + 1), filling);\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setCuboid(world, new Location(world, max.getX(), dpw.PLOT_HEIGHT, plotMinZ), new Location(world, plotMaxX + 1, dpw.PLOT_HEIGHT + 1, min.getZ() + 1), plotfloor);\n }\n }, 1);\n }\n }, 1);\n }\n }, 1);\n }\n }, 29);\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setSimpleCuboid(world, new Location(world, plotMinX, 0, min.getZ()), new Location(world, min.getX() + 1, 1, max.getZ() + 1), new PlotBlock((short) 7, (byte) 0));\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setSimpleCuboid(world, new Location(world, plotMinX, dpw.PLOT_HEIGHT + 1, min.getZ()), new Location(world, min.getX() + 1, maxy + 1, max.getZ() + 1), new PlotBlock((short) 0, (byte) 0));\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setCuboid(world, new Location(world, plotMinX, 1, min.getZ()), new Location(world, min.getX() + 1, dpw.PLOT_HEIGHT, max.getZ() + 1), filling);\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setCuboid(world, new Location(world, plotMinX, dpw.PLOT_HEIGHT, min.getZ()), new Location(world, min.getX() + 1, dpw.PLOT_HEIGHT + 1, max.getZ() + 1), plotfloor);\n }\n }, 1);\n }\n }, 1);\n }\n }, 1);\n }\n }, 33);\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setSimpleCuboid(world, new Location(world, plotMinX, 0, max.getZ()), new Location(world, min.getX() + 1, 1, plotMaxZ + 1), new PlotBlock((short) 7, (byte) 0));\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setSimpleCuboid(world, new Location(world, plotMinX, dpw.PLOT_HEIGHT + 1, max.getZ()), new Location(world, min.getX() + 1, maxy + 1, plotMaxZ + 1), new PlotBlock((short) 0, (byte) 0));\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setCuboid(world, new Location(world, plotMinX, 1, max.getZ()), new Location(world, min.getX() + 1, dpw.PLOT_HEIGHT, plotMaxZ + 1), filling);\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setCuboid(world, new Location(world, plotMinX, dpw.PLOT_HEIGHT, max.getZ()), new Location(world, min.getX() + 1, dpw.PLOT_HEIGHT + 1, plotMaxZ + 1), plotfloor);\n }\n }, 1);\n }\n }, 1);\n }\n }, 1);\n }\n }, 37);\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setSimpleCuboid(world, new Location(world, min.getX(), 0, max.getZ()), new Location(world, max.getX() + 1, 1, plotMaxZ + 1), new PlotBlock((short) 7, (byte) 0));\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setSimpleCuboid(world, new Location(world, min.getX(), dpw.PLOT_HEIGHT + 1, max.getZ()), new Location(world, max.getX() + 1, maxy + 1, plotMaxZ + 1), new PlotBlock((short) 0, (byte) 0));\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setCuboid(world, new Location(world, min.getX(), 1, max.getZ()), new Location(world, max.getX() + 1, dpw.PLOT_HEIGHT, plotMaxZ + 1), filling);\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setCuboid(world, new Location(world, min.getX(), dpw.PLOT_HEIGHT, max.getZ()), new Location(world, max.getX() + 1, dpw.PLOT_HEIGHT + 1, plotMaxZ + 1), plotfloor);\n }\n }, 1);\n }\n }, 1);\n }\n }, 1);\n }\n }, 41);\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setSimpleCuboid(world, new Location(world, max.getX(), 0, min.getZ()), new Location(world, plotMaxX + 1, 1, max.getZ() + 1), new PlotBlock((short) 7, (byte) 0));\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setSimpleCuboid(world, new Location(world, max.getX(), dpw.PLOT_HEIGHT + 1, min.getZ()), new Location(world, plotMaxX + 1, maxy + 1, max.getZ() + 1), new PlotBlock((short) 0, (byte) 0));\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setCuboid(world, new Location(world, max.getX(), 1, min.getZ()), new Location(world, plotMaxX + 1, dpw.PLOT_HEIGHT, max.getZ() + 1), filling);\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setCuboid(world, new Location(world, max.getX(), dpw.PLOT_HEIGHT, min.getZ()), new Location(world, plotMaxX + 1, dpw.PLOT_HEIGHT + 1, max.getZ() + 1), plotfloor);\n }\n }, 1);\n }\n }, 1);\n }\n }, 1);\n }\n }, 45);\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setSimpleCuboid(world, new Location(world, max.getX(), 0, max.getZ()), new Location(world, plotMaxX + 1, 1, plotMaxZ + 1), new PlotBlock((short) 7, (byte) 0));\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setSimpleCuboid(world, new Location(world, max.getX(), dpw.PLOT_HEIGHT + 1, max.getZ()), new Location(world, plotMaxX + 1, maxy + 1, plotMaxZ + 1), new PlotBlock((short) 0, (byte) 0));\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setCuboid(world, new Location(world, max.getX(), 1, max.getZ()), new Location(world, plotMaxX + 1, dpw.PLOT_HEIGHT, plotMaxZ + 1), filling);\n TaskManager.runTaskLater(new Runnable() {\n public void run() {\n MainUtil.setCuboid(world, new Location(world, max.getX(), dpw.PLOT_HEIGHT, max.getZ()), new Location(world, plotMaxX + 1, dpw.PLOT_HEIGHT + 1, plotMaxZ + 1), plotfloor);\n TaskManager.runTask(whenDone);\n }\n }, 1);\n }\n }, 1);\n }\n }, 1);\n }\n }, 49);\n }\n}\n"
|
"public void initialize(AbstractSession session) throws DescriptorException {\n if (getHistoryPolicy() != null) {\n session.getProject().setHasGenericHistorySupport(true);\n }\n if (isIsolated()) {\n session.getProject().setHasIsolatedClasses(true);\n }\n if (!shouldIsolateObjectsInUnitOfWork() && !shouldBeReadOnly()) {\n session.getProject().setHasNonIsolatedUOWClasses(true);\n }\n if (isInitialized(INITIALIZED) || isInvalid()) {\n return;\n }\n setInitializationStage(INITIALIZED);\n if (isChildDescriptor()) {\n getInheritancePolicy().getParentDescriptor().initialize(session);\n if (getInheritancePolicy().getParentDescriptor().isIsolated()) {\n setIsIsolated(true);\n }\n getInheritancePolicy().initializeOptimisticLocking();\n }\n if (shouldOrderMappings()) {\n Vector mappings = getMappings();\n Object[] mappingsArray = new Object[mappings.size()];\n for (int index = 0; index < mappings.size(); index++) {\n mappingsArray[index] = mappings.elementAt(index);\n }\n Arrays.sort(mappingsArray, new MappingCompare());\n mappings = NonSynchronizedVector.newInstance(mappingsArray.length);\n for (int index = 0; index < mappingsArray.length; index++) {\n mappings.addElement(mappingsArray[index]);\n }\n setMappings(mappings);\n }\n for (Enumeration mappingsEnum = getMappings().elements(); mappingsEnum.hasMoreElements(); ) {\n DatabaseMapping mapping = (DatabaseMapping) mappingsEnum.nextElement();\n validateMappingType(mapping);\n mapping.initialize(session);\n if (mapping.isLockableMapping()) {\n getLockableMappings().add(mapping);\n }\n if ((mapping.isForeignReferenceMapping()) && (((ForeignReferenceMapping) mapping).getIndirectionPolicy() instanceof ProxyIndirectionPolicy)) {\n session.getProject().setHasProxyIndirection(true);\n }\n if ((usesOptimisticLocking() && getOptimisticLockingPolicy().isCascaded()) || hasCascadeLockingPolicies()) {\n prepareCascadeLockingPolicy(mapping);\n }\n if (mapping.derivesId()) {\n derivesIdMappings.put(mapping.getAttributeName(), mapping);\n }\n Helper.addAllUniqueToVector(getFields(), mapping.getFields());\n }\n if (hasMappingsPostCalculateChangesOnDeleted()) {\n session.getProject().setHasMappingsPostCalculateChangesOnDeleted(true);\n }\n if (!isAggregateDescriptor()) {\n if (!isChildDescriptor()) {\n if (usesOptimisticLocking()) {\n getOptimisticLockingPolicy().initializeProperties();\n }\n }\n }\n for (Iterator queryKeys = getQueryKeys().values().iterator(); queryKeys.hasNext(); ) {\n QueryKey queryKey = (QueryKey) queryKeys.next();\n queryKey.initialize(this);\n }\n if (hasInheritance()) {\n getInheritancePolicy().initialize(session);\n if (getInheritancePolicy().isChildDescriptor()) {\n for (Iterator iterator = getInheritancePolicy().getParentDescriptor().getMappings().iterator(); iterator.hasNext(); ) {\n DatabaseMapping mapping = (DatabaseMapping) iterator.next();\n if (mapping.isAggregateObjectMapping() || ((mapping.isForeignReferenceMapping() && (!mapping.isDirectCollectionMapping())) && (!((ForeignReferenceMapping) mapping).usesIndirection()))) {\n getLockableMappings().add(mapping);\n }\n if (mapping.isDerivedIdMapping()) {\n this.hasDerivedId = true;\n }\n }\n }\n }\n if (hasInheritance() && shouldOrderMappings()) {\n Vector mappings = getMappings();\n Object[] mappingsArray = new Object[mappings.size()];\n for (int index = 0; index < mappings.size(); index++) {\n mappingsArray[index] = mappings.elementAt(index);\n }\n Arrays.sort(mappingsArray, new MappingCompare());\n mappings = NonSynchronizedVector.newInstance(mappingsArray.length);\n for (int index = 0; index < mappingsArray.length; index++) {\n mappings.addElement(mappingsArray[index]);\n }\n setMappings(mappings);\n }\n setAllFields((Vector) getFields().clone());\n getObjectBuilder().initialize(session);\n if (shouldOrderMappings()) {\n for (int index = getObjectBuilder().getPrimaryKeyMappings().size() - 1; index >= 0; index--) {\n DatabaseMapping mapping = getObjectBuilder().getPrimaryKeyMappings().get(index);\n if ((mapping != null) && mapping.isDirectToFieldMapping()) {\n getMappings().remove(mapping);\n getMappings().add(0, mapping);\n DatabaseField field = ((AbstractDirectMapping) mapping).getField();\n getFields().remove(field);\n getFields().add(0, field);\n getAllFields().remove(field);\n getAllFields().add(0, field);\n }\n }\n }\n if (usesOptimisticLocking() && (!isChildDescriptor())) {\n getOptimisticLockingPolicy().initialize(session);\n }\n if (hasInterfacePolicy() || isDescriptorForInterface()) {\n interfaceInitialization(session);\n }\n if (hasWrapperPolicy()) {\n getWrapperPolicy().initialize(session);\n }\n if (hasReturningPolicy()) {\n getReturningPolicy().initialize(session);\n }\n getQueryManager().initialize(session);\n getEventManager().initialize(session);\n getCopyPolicy().initialize(session);\n getInstantiationPolicy().initialize(session);\n if (getHistoryPolicy() != null) {\n getHistoryPolicy().initialize(session);\n } else if (hasInheritance()) {\n ClassDescriptor parentDescriptor = getInheritancePolicy().getParentDescriptor();\n if ((parentDescriptor != null) && (parentDescriptor.getHistoryPolicy() != null)) {\n setHistoryPolicy((HistoryPolicy) parentDescriptor.getHistoryPolicy().clone());\n }\n }\n if (this.getCMPPolicy() != null) {\n this.getCMPPolicy().initialize(this, session);\n }\n if (hasFetchGroupManager()) {\n getFetchGroupManager().initialize(session);\n }\n if ((getObjectChangePolicyInternal() == null) && (ChangeTracker.class.isAssignableFrom(getJavaClass()))) {\n if (Arrays.asList(getJavaClass().getInterfaces()).contains(PersistenceWeavedChangeTracking.class)) {\n if (supportsChangeTracking(session.getProject())) {\n setObjectChangePolicy(new AttributeChangeTrackingPolicy());\n }\n }\n }\n getObjectChangePolicy().initialize(session, this);\n if (getUnitOfWorkCacheIsolationLevel() == UNDEFINED_ISOLATATION) {\n if (isIsolated()) {\n setUnitOfWorkCacheIsolationLevel(ISOLATE_CACHE_ALWAYS);\n } else {\n setUnitOfWorkCacheIsolationLevel(ISOLATE_NEW_DATA_AFTER_TRANSACTION);\n }\n }\n if (getIdValidation() == null) {\n if (getPrimaryKeyFields().size() > 1) {\n setIdValidation(IdValidation.NULL);\n } else {\n setIdValidation(IdValidation.ZERO);\n }\n }\n if (this.defaultReadAllQueryRedirector == null) {\n this.defaultReadAllQueryRedirector = this.defaultQueryRedirector;\n }\n if (this.defaultReadObjectQueryRedirector == null) {\n this.defaultReadObjectQueryRedirector = this.defaultQueryRedirector;\n }\n if (this.defaultReportQueryRedirector == null) {\n this.defaultReportQueryRedirector = this.defaultQueryRedirector;\n }\n if (this.defaultInsertObjectQueryRedirector == null) {\n this.defaultInsertObjectQueryRedirector = this.defaultQueryRedirector;\n }\n if (this.defaultUpdateObjectQueryRedirector == null) {\n this.defaultUpdateObjectQueryRedirector = this.defaultQueryRedirector;\n }\n}\n"
|
"private void addKeys() throws Exception {\n for (int i = 0; i <= 30; i++) {\n int flags = 1 << i;\n String key = new String();\n key = duplicateStr(String.format(\"String_Node_Str\", i + 1), 32);\n addKey(flags, i, key);\n }\n addKey(0x200, 0x1000, duplicateStr(\"String_Node_Str\", 32));\n addKey(0xe000, 0x1001, duplicateStr(\"String_Node_Str\", 16));\n addKey(0xffffffff, 0x2000, duplicateStr(\"String_Node_Str\", 16));\n addKey(0x10000, 0x3031, \"String_Node_Str\");\n}\n"
|
"void animateScroll(float curScroll, float newScroll, final Runnable postRunnable) {\n if (mScrollAnimator != null && mScrollAnimator.isRunning()) {\n setStackScroll(mFinalAnimatedScroll);\n mScroller.startScroll(0, progressToScrollRange(mFinalAnimatedScroll), 0, 0, 0);\n }\n stopScroller();\n stopBoundScrollAnimation();\n mFinalAnimatedScroll = newScroll;\n mScrollAnimator = ObjectAnimator.ofFloat(this, STACK_SCROLL, getStackScroll(), newScroll);\n mScrollAnimator.setDuration(mContext.getResources().getInteger(R.integer.recents_animate_task_stack_scroll_duration));\n mScrollAnimator.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN);\n mScrollAnimator.addListener(new AnimatorListenerAdapter() {\n public void onAnimationEnd(Animator animation) {\n if (postRunnable != null) {\n postRunnable.run();\n }\n mScrollAnimator.removeAllListeners();\n }\n });\n mScrollAnimator.start();\n}\n"
|
"public org.hl7.fhir.dstu2.model.Immunization convertImmunization(org.hl7.fhir.dstu3.model.Immunization src) throws FHIRException {\n if (src == null || src.isEmpty())\n return null;\n org.hl7.fhir.dstu2.model.Immunization tgt = new org.hl7.fhir.dstu2.model.Immunization();\n copyDomainResource(src, tgt);\n for (org.hl7.fhir.dstu3.model.Identifier t : src.getIdentifier()) tgt.addIdentifier(convertIdentifier(t));\n tgt.setStatus(src.getStatus().toCode());\n tgt.setDate(src.getDate());\n tgt.setVaccineCode(convertCodeableConcept(src.getVaccineCode()));\n tgt.setPatient(convertReference(src.getPatient()));\n tgt.setWasNotGiven(src.getWasNotGiven());\n tgt.setReported(src.getReported());\n tgt.setPerformer(convertReference(src.getPerformer()));\n tgt.setRequester(convertReference(src.getRequester()));\n tgt.setEncounter(convertReference(src.getEncounter()));\n tgt.setManufacturer(convertReference(src.getManufacturer()));\n tgt.setLocation(convertReference(src.getLocation()));\n tgt.setLotNumber(src.getLotNumber());\n tgt.setExpirationDate(src.getExpirationDate());\n tgt.setSite(convertCodeableConcept(src.getSite()));\n tgt.setRoute(convertCodeableConcept(src.getRoute()));\n tgt.setDoseQuantity(convertSimpleQuantity(src.getDoseQuantity()));\n for (org.hl7.fhir.dstu3.model.Annotation t : src.getNote()) tgt.addNote(convertAnnotation(t));\n tgt.setExplanation(convertImmunizationExplanationComponent(src.getExplanation()));\n for (org.hl7.fhir.dstu3.model.Immunization.ImmunizationReactionComponent t : src.getReaction()) tgt.addReaction(convertImmunizationReactionComponent(t));\n for (org.hl7.fhir.dstu3.model.Immunization.ImmunizationVaccinationProtocolComponent t : src.getVaccinationProtocol()) tgt.addVaccinationProtocol(convertImmunizationVaccinationProtocolComponent(t));\n return tgt;\n}\n"
|
"private ApplicationWithPrograms deployApp(NamespaceId namespaceId, String appName, String configStr, ProgramTerminator programTerminator, ArtifactDetail artifactDetail) throws Exception {\n authorizationEnforcer.enforce(namespaceId, authenticationContext.getPrincipal(), Action.WRITE);\n ApplicationClass appClass = Iterables.getFirst(artifactDetail.getMeta().getClasses().getApps(), null);\n if (appClass == null) {\n throw new InvalidArtifactException(String.format(\"String_Node_Str\", artifactDetail.getDescriptor().getArtifactId(), namespaceId));\n }\n AppDeploymentInfo deploymentInfo = new AppDeploymentInfo(artifactDetail.getDescriptor(), namespaceId, appClass.getClassName(), appName, configStr);\n Manager<AppDeploymentInfo, ApplicationWithPrograms> manager = managerFactory.create(programTerminator);\n ApplicationWithPrograms applicationWithPrograms = manager.deploy(deploymentInfo).get();\n privilegesManager.grant(applicationWithPrograms.getApplicationId(), authenticationContext.getPrincipal(), EnumSet.allOf(Action.class));\n return applicationWithPrograms;\n}\n"
|
"protected void done() {\n if (epubcheckResult == false) {\n gui.setBorderStateError();\n gui.addLogMessageToTextLog(\"String_Node_Str\" + \"String_Node_Str\");\n if (report.getErrorCount() > 0 && report.getWarningCount() > 0) {\n resultMessage = String.format(__(\"String_Node_Str\"), report.getWarningCount(), report.getErrorCount());\n } else if (report.getErrorCount() > 0) {\n resultMessage = String.format(__(\"String_Node_Str\"), report.getErrorCount());\n } else if (report.getWarningCount() > 0) {\n gui.setBorderStateWarning();\n resultMessage = String.format(__(\"String_Node_Str\"), report.getWarningCount());\n } else {\n resultMessage = __(\"String_Node_Str\");\n }\n gui.addLogMessage(\"String_Node_Str\" + resultMessage + \"String_Node_Str\");\n if (guiManager.getMacApp() != null) {\n if (report.getWarningCount() + report.getErrorCount() > 0) {\n guiManager.getMacApp().setDockIconBadge(new Integer(report.getWarningCount() + report.getErrorCount()).toString());\n } else {\n guiManager.getMacApp().setDockIconBadge(\"String_Node_Str\");\n }\n }\n if (expanded) {\n if (guiManager.getExpandedSave() == ExpandedSaveMode.ALWAYS) {\n saveEpubFromExpandedFolder();\n } else if (epubFile.exists()) {\n epubFile.delete();\n gui.addLogMessage(Severity.WARNING, \"String_Node_Str\" + __(\"String_Node_Str\") + \"String_Node_Str\");\n }\n }\n } else {\n gui.setBorderStateValid();\n resultMessage = __(\"String_Node_Str\");\n gui.addLogMessage(\"String_Node_Str\" + resultMessage + \"String_Node_Str\");\n if (guiManager.getMacApp() != null) {\n guiManager.getMacApp().setDockIconBadge(\"String_Node_Str\");\n }\n if (guiManager.getExpandedSave() != ExpandedSaveMode.NEVER) {\n saveEpubFromExpandedFolder();\n }\n }\n gui.scrollToBottom();\n timestamp_end = System.currentTimeMillis();\n double timestamp_diff = timestamp_end - timestamp_begin;\n DecimalFormat df = new DecimalFormat(\"String_Node_Str\");\n String timestamp_result = df.format(timestamp_diff / 1000);\n gui.getStatusBar().update(null, __(\"String_Node_Str\") + \"String_Node_Str\" + String.format(__(\"String_Node_Str\"), timestamp_result) + \"String_Node_Str\" + resultMessage);\n gui.enableButtonsAfterValidation();\n if (guiManager.getMenuOptionAutoSaveLogfile()) {\n if (expanded && expandedBasedir != null && expandedBasedir.exists()) {\n gui.saveLogfile(new File(expandedBasedir, epubFile.getName().replaceAll(epubFileExtRegex, \"String_Node_Str\")));\n } else {\n gui.saveLogfile(new File(epubFile.getAbsolutePath().replaceAll(epubFileExtRegex, \"String_Node_Str\")));\n }\n }\n}\n"
|
"private void sendP2PMessage(Object message, final ResponseListener<Object> listener) {\n JSONObject _payload = new JSONObject();\n try {\n _payload.put(\"String_Node_Str\", \"String_Node_Str\");\n _payload.put(\"String_Node_Str\", getFullAppId());\n _payload.put(\"String_Node_Str\", message);\n } catch (JSONException ex) {\n }\n final JSONObject payload = _payload;\n if (isConnected()) {\n socket.sendMessage(payload, null);\n if (listener != null)\n listener.onSuccess(null);\n } else {\n ResponseListener<Object> connectListener = new ResponseListener<Object>() {\n\n public void onError(ServiceCommandError error) {\n if (listener != null)\n listener.onError(error);\n }\n public void onSuccess(Object object) {\n socket.sendMessage(payload, null);\n if (listener != null)\n listener.onSuccess(null);\n }\n };\n join(joinListener);\n }\n}\n"
|
"void convert(Attributes attributes, Stack<PermissionContainer> stack) throws SAXException {\n PermissionContainer container = stack.peek();\n String[] parts = attributes.getValue(\"String_Node_Str\").split(\"String_Node_Str\");\n String[] coords = parts[0].split(\"String_Node_Str\");\n Coordinate start;\n if (coords.length == 2) {\n start = new Coordinate(getInt(coords[0]), 0, getInt(coords[1]));\n } else if (coords.length >= 3) {\n start = new Coordinate(getInt(coords[0]), getInt(coords[1]), getInt(coords[2]));\n } else {\n throw new SAXException(\"String_Node_Str\" + parts[0]);\n }\n Dimension dimension = (parts.length >= 2) ? Dimension.get(parts[1]) : Dimension.EARTH;\n parts = attributes.getValue(\"String_Node_Str\").split(\"String_Node_Str\");\n coords = parts[0].split(\"String_Node_Str\");\n Coordinate end;\n if (coords.length == 2) {\n end = new Coordinate(getInt(coords[0]), 127, getInt(coords[1]));\n } else if (coords.length >= 3) {\n end = new Coordinate(getInt(coords[0]), getInt(coords[1]), getInt(coords[2]));\n }\n if (!((Config) stack.firstElement()).dimensions.contains(dimension)) {\n ((Config) stack.firstElement()).dimensions.add(dimension);\n }\n DimensionAreaStorage.setInstance(((Config) stack.firstElement()).dimensions.get(dimension).areas);\n Area area = new Area(attributes.getValue(\"String_Node_Str\"), start, end);\n if (attributes.getIndex(\"String_Node_Str\") >= 0) {\n area.owner = attributes.getValue(\"String_Node_Str\").toLowerCase();\n }\n area.fullInit();\n if (container instanceof Config) {\n ((Config) container).dimensions.get(dimension).add(area);\n } else {\n ((Area) container).areas.add(area);\n }\n stack.push(area);\n}\n"
|
"public static AsyncResponseHandler bindAsyncResponse(AsyncResponse asyncResponse, ListenableFuture<?> futureResponse, Executor httpResponseExecutor) {\n FutureCallback<Object> callback = toFutureCallback(asyncResponse);\n Futures.addCallback(futureResponse, callback, httpResponseExecutor);\n return new AsyncResponseHandler(asyncResponse, futureResponse);\n}\n"
|
"public void test() {\n org.eclipse.persistence.sessions.DatabaseSession testSession = null;\n try {\n Project project = new ConstructorProject();\n project.setLogin(getSession().getLogin());\n org.eclipse.persistence.sessions.DatabaseSession testSession = project.createDatabaseSession();\n testSession.dontLogMessages();\n testSession.login();\n testSession.logout();\n } catch (org.eclipse.persistence.exceptions.EclipseLinkException exception) {\n caughtException = exception;\n } catch (Exception e) {\n throw new org.eclipse.persistence.testing.framework.TestWarningException(\"String_Node_Str\");\n }\n}\n"
|
"public void onBeginDrag(View v) {\n TaskView tv = (TaskView) v;\n tv.setClipViewInStack(false);\n tv.setTouchEnabled(false);\n final ViewParent parent = mSv.getParent();\n if (parent != null) {\n parent.requestDisallowInterceptTouchEvent(true);\n }\n mSv.addIgnoreTask(tv.getTask());\n mCurrentTasks = new ArrayList<Task>(mSv.getStack().getStackTasks());\n MutableBoolean isFrontMostTask = new MutableBoolean(false);\n Task anchorTask = mSv.findAnchorTask(mCurrentTasks, isFrontMostTask);\n TaskStackLayoutAlgorithm layoutAlgorithm = mSv.getStackAlgorithm();\n TaskStackViewScroller stackScroller = mSv.getScroller();\n if (anchorTask != null) {\n mSv.getCurrentTaskTransforms(mCurrentTasks, mCurrentTaskTransforms);\n float prevAnchorTaskScroll = 0;\n boolean pullStackForward = mCurrentTasks.size() > 0;\n if (pullStackForward) {\n prevAnchorTaskScroll = layoutAlgorithm.getStackScrollForTask(anchorTask);\n }\n mSv.updateLayoutAlgorithm(false);\n float newStackScroll = stackScroller.getStackScroll();\n if (isFrontMostTask.value) {\n newStackScroll = stackScroller.getBoundedStackScroll(newStackScroll);\n } else if (pullStackForward) {\n float anchorTaskScroll = layoutAlgorithm.getStackScrollForTaskIgnoreOverrides(anchorTask);\n float stackScrollOffset = (anchorTaskScroll - prevAnchorTaskScroll);\n if (layoutAlgorithm.getFocusState() != TaskStackLayoutAlgorithm.STATE_FOCUSED) {\n stackScrollOffset *= 0.75f;\n }\n newStackScroll = stackScroller.getBoundedStackScroll(stackScroller.getStackScroll() + stackScrollOffset);\n }\n mSv.bindVisibleTaskViews(newStackScroll, true);\n mSv.getLayoutTaskTransforms(newStackScroll, TaskStackLayoutAlgorithm.STATE_UNFOCUSED, mCurrentTasks, true, mFinalTaskTransforms);\n mTargetStackScroll = newStackScroll;\n }\n}\n"
|
"public void RelayRequestMsg() {\n ConnectMsg.Request req = new ConnectMsg.Request(gSrc, gSrc, utility, true, age);\n RelayRequestMsg.ClientToServer msg = new RelayRequestMsg.ClientToServer(gSrc, gDest, remoteClientId, req);\n msg.setTimeoutId(UUID.nextUUID());\n try {\n ChannelBuffer buffer = msg.toByteArray();\n opCodeCorrect(buffer, msg);\n RelayRequestMsg.ClientToServer res = RelayRequestMsgFactory.Request.fromBuffer(buffer);\n } catch (MessageDecodingException ex) {\n Logger.getLogger(EncodingDecodingTest.class.getName()).log(Level.SEVERE, null, ex);\n assert (false);\n } catch (MessageEncodingException ex) {\n Logger.getLogger(EncodingDecodingTest.class.getName()).log(Level.SEVERE, null, ex);\n assert (false);\n }\n ParentKeepAliveMsg.Pong msg2 = new ParentKeepAliveMsg.Pong(gSrc, gDest, UUID.nextUUID());\n msg2.setTimeoutId(UUID.nextUUID());\n try {\n ChannelBuffer buffer = msg2.toByteArray();\n opCodeCorrect(buffer, msg2);\n RelayRequestMsg.ServerToClient res = RelayRequestMsgFactory.Response.fromBuffer(buffer);\n } catch (MessageDecodingException ex) {\n Logger.getLogger(EncodingDecodingTest.class.getName()).log(Level.SEVERE, null, ex);\n assert (false);\n } catch (MessageEncodingException ex) {\n Logger.getLogger(EncodingDecodingTest.class.getName()).log(Level.SEVERE, null, ex);\n assert (false);\n }\n}\n"
|
"void scroll(Object contentViewCore, int yVel, int y) {\n try {\n float density = mActivity.getResources().getDisplayMetrics().density + 1;\n Utils.callMethod(contentViewCore, \"String_Node_Str\", SystemClock.uptimeMillis(), 0, (int) (yVel * density));\n return;\n } catch (Throwable t) {\n }\n try {\n Integer x = (Integer) Utils.callMethod(contentViewCore, \"String_Node_Str\");\n ViewGroup containerView = (ViewGroup) Utils.callMethod(contentViewCore, \"String_Node_Str\");\n XposedHelpers.findMethodExact(containerView.getClass(), \"String_Node_Str\", int.class, int.class).invoke(containerView, x, y);\n } catch (Throwable t) {\n XposedBridge.log(TAG + t);\n }\n}\n"
|
"protected void uploadContent(HttpServletRequest req, HttpServletResponse resp) throws IOException {\n String sessionId = extractSessionId(req);\n RepositoryHttpEndpointImpl elem = repoHttpManager.getHttpRepoItemElem(sessionId);\n if (elem == null) {\n resp.setStatus(HttpServletResponse.SC_NOT_FOUND);\n return;\n }\n elem.stopCurrentTimer();\n elem.fireStartedEventIfFirstTime();\n try (InputStream requestInputStream = req.getInputStream()) {\n OutputStream repoItemOutputStream = elem.getRepoItemOutputStream();\n Range range = parseContentRange(req, resp);\n if (range != null) {\n if (range.start > elem.getWrittenBytes()) {\n resp.setStatus(HttpServletResponse.SC_NOT_IMPLEMENTED);\n resp.getOutputStream().println(\"String_Node_Str\" + \"String_Node_Str\");\n } else if (range.end == elem.getWrittenBytes()) {\n resp.setStatus(SC_OK);\n resp.getOutputStream().println(\"String_Node_Str\" + \"String_Node_Str\");\n } else if (range.start < elem.getWrittenBytes() && range.end > elem.getWrittenBytes()) {\n Range copyRange = new Range();\n copyRange.start = elem.getWrittenBytes() - range.start;\n copyRange.end = range.end - range.start;\n copyStreamsRange(requestInputStream, repoItemOutputStream, copyRange);\n resp.setStatus(SC_OK);\n } else if (range.start == elem.getWrittenBytes()) {\n IOUtils.copy(requestInputStream, repoItemOutputStream);\n resp.setStatus(SC_OK);\n }\n } else {\n boolean isMultipart = ServletFileUpload.isMultipartContent(req);\n if (isMultipart) {\n uploadMultipart(req, resp, repoItemOutputStream);\n } else {\n boolean isMultipart = ServletFileUpload.isMultipartContent(req);\n if (isMultipart) {\n uploadMultipart(req, resp, repoItemOutputStream);\n } else {\n try {\n log.info(\"String_Node_Str\" + req.getContentLength() + \"String_Node_Str\");\n int bytes = IOUtils.copy(requestInputStream, repoItemOutputStream);\n resp.setStatus(SC_OK);\n log.info(\"String_Node_Str\" + bytes);\n } catch (Exception e) {\n log.warn(\"String_Node_Str\", e);\n elem.fireSessionErrorEvent(e);\n resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);\n }\n }\n }\n }\n } finally {\n elem.stopInTimeout();\n }\n}\n"
|
"private void getSuggestedWords(final int sessionId, final int sequenceNumber, final OnGetSuggestedWordsCallback callback) {\n final Keyboard keyboard = mKeyboardSwitcher.getKeyboard();\n final Suggest suggest = mSuggest;\n if (keyboard == null || suggest == null) {\n callback.onGetSuggestedWords(SuggestedWords.EMPTY);\n return;\n }\n final SettingsValues currentSettings = mSettings.getCurrent();\n final int[] additionalFeaturesOptions = currentSettings.mAdditionalFeaturesSettingValues;\n if (DEBUG) {\n if (mWordComposer.isComposingWord() || mWordComposer.isBatchMode()) {\n final String previousWord = mWordComposer.getPreviousWordForSuggestion();\n final String rereadPrevWord = getNthPreviousWordForSuggestion(currentSettings, mWordComposer.isComposingWord() ? 2 : 1);\n if (!TextUtils.equals(previousWord, rereadPrevWord)) {\n throw new RuntimeException(\"String_Node_Str\" + previousWord + \"String_Node_Str\" + rereadPrevWord);\n }\n }\n }\n suggest.getSuggestedWords(mWordComposer, mWordComposer.getPreviousWord(), keyboard.getProximityInfo(), currentSettings.mBlockPotentiallyOffensive, currentSettings.mCorrectionEnabled, additionalFeaturesOptions, sessionId, sequenceNumber, callback);\n}\n"
|
"public boolean tryRemove(ChunkLocation location) {\n if (location.x() < 7 && location.z() < 7) {\n return true;\n }\n CRefCounter chunk = get(location);\n if (chunk == null) {\n return false;\n }\n if (!chunk.hasStrongRefs()) {\n TridentChunk c = chunk.unwrap();\n if (chunk.hasWeakRefs()) {\n }\n remove(location);\n c.unload();\n return true;\n }\n return false;\n}\n"
|
"public void dispose() {\n super.dispose();\n chartModel = null;\n if (previewPainter != null) {\n previewPainter.dispose();\n }\n previewPainter = null;\n sSubType = null;\n sType = null;\n sDimension = null;\n vSubTypeNames = null;\n orientation = null;\n}\n"
|
"public static void main(String[] args) {\n long result = 0;\n for (int i = 1; i <= 10; i++) {\n result += firstIncorrectTerm(i);\n }\n System.out.println(result);\n}\n"
|
"public void record(File file) {\n count += 1;\n size += file.length();\n lastModified = max(lastModified, file.lastModified());\n hashCodeSum += file.hashCode();\n log.trace(\"String_Node_Str\", file, this);\n}\n"
|
"public void onListItemClick(ListView listView, View view, int position, long id) {\n super.onListItemClick(listView, view, position, id);\n mCallbacks.onItemSelected(searchresult.getResults().get(position).getNr(), searchresult.getResults().get(position).getId(), searchresult.getResults().get(position).getPage());\n}\n"
|
"public void start() {\n super.start();\n sum = 0D;\n}\n"
|
"private void _pointSearch(RStarNode start, SpatialPoint point) {\n HyperRectangle searchRegion = new HyperRectangle(point.getCords());\n HyperRectangle intersection = start.getMBR().getIntersection(searchRegion);\n if (intersection != null) {\n if (start.isLeaf()) {\n float[] searchPoints = point.getCords();\n for (Long pointer : start.childPointers) {\n PointDTO dto = storage.loadPoint(pointer);\n float[] candidates = dto.coords;\n boolean found = true;\n for (int i = 0; i < candidates.length; i++) {\n if (candidates[i] != searchPoints[i])\n found = false;\n break;\n }\n if (found) {\n _pointSearchResult = dto.oid;\n }\n }\n } else {\n for (Long pointer : root.childPointers) {\n if (_pointSearchResult != -1)\n break;\n try {\n RStarNode childNode = storage.loadNode(pointer);\n _pointSearch(childNode, point);\n } catch (FileNotFoundException e) {\n System.err.println(\"String_Node_Str\");\n }\n }\n }\n }\n}\n"
|
"public boolean hasNext() {\n if (current == null || !current.hasNext()) {\n if (page > 0) {\n List<T> values = complete(submit(req(\"String_Node_Str\", url, page++), handler));\n if (values == null || values.isEmpty()) {\n page = -1;\n }\n current = values.iterator();\n } else {\n return false;\n }\n }\n return current.hasNext();\n}\n"
|
"public ObjectProxy make(IocMaking ing, IocObject iobj) {\n Mirror<?> mirror = ing.getMirrors().getMirror(iobj.getType(), ing.getObjectName());\n ObjectProxy op = new ObjectProxy();\n if (iobj.isSingleton() && null != ing.getObjectName())\n ing.getContext().save(iobj.getScope(), ing.getObjectName(), op);\n try {\n DefaultWeaver dw = new DefaultWeaver();\n op.setWeaver(dw);\n if (null != iobj.getEvents()) {\n IocEventSet iocEventSet = iobj.getEvents();\n op.setFetch(createTrigger(mirror, iocEventSet.getFetch()));\n dw.setCreate(createTrigger(mirror, iocEventSet.getCreate()));\n dw.setDepose(createTrigger(mirror, iocEventSet.getDepose()));\n }\n ValueProxy[] vps = new ValueProxy[Lang.length(iobj.getArgs())];\n for (int i = 0; i < vps.length; i++) vps[i] = ing.makeValue(iobj.getArgs()[i]);\n dw.setArgs(vps);\n Object[] args = new Object[vps.length];\n for (int i = 0; i < args.length; i++) args[i] = vps[i].get(ing);\n dw.setBorning((Borning<?>) mirror.getBorning(args));\n FieldInjector[] fields = new FieldInjector[iobj.getFields().length];\n for (int i = 0; i < fields.length; i++) {\n IocField ifld = iobj.getFields()[i];\n try {\n ValueProxy vp = ing.makeValue(ifld.getValue());\n fields[i] = FieldInjector.create(mirror, ifld.getName(), vp);\n } catch (Exception e) {\n throw Lang.wrapThrow(e, \"String_Node_Str\", ifld.getName());\n }\n }\n dw.setFields(fields);\n op.setWeaver(dw);\n } catch (Throwable e) {\n ing.getContext().remove(iobj.getScope(), ing.getObjectName());\n throw Lang.wrapThrow(e);\n }\n return op;\n}\n"
|
"public void intervalAdded(ListDataEvent e) {\n final Product[] propertySourceProducts = binningFormModel.getPropertyValue(BinningFormModel.PROPERTY_KEY_SOURCE_PRODUCTS);\n final Product[] newSourceProducts = sourceProductList.getSourceProducts();\n for (Product newSourceProduct : newSourceProducts) {\n if ((propertySourceProducts == null || !ArrayUtils.isMemberOf(newSourceProduct, propertySourceProducts)) && newSourceProduct.isMultiSize()) {\n MultiSizeIssue0.maybeResample(newSourceProduct);\n }\n }\n contentsChanged(e);\n}\n"
|
"public Fraction getFractionWithMaxDigits(int maxDigitsForDenominator) {\n int lastIndex = integerList.size();\n Fraction previousFraction = null;\n for (int i = 0; i < lastIndex; i++) {\n Fraction fraction = getFraction(i, new Fraction((integerList.get(i)).intValue(), 1));\n if (fraction.getDenominatorDigits() > maxDigitsForDenominator)\n return previousFraction;\n previousFraction = fraction;\n }\n return previousFraction;\n}\n"
|
"public void handleInit() {\n size = 10;\n Integer curMaxId = worldBossDao.selectMaxId();\n if (curMaxId == null) {\n curMaxId = 1;\n } else {\n byte[] data = worldBossDao.selectWorldBossRecords(curMaxId);\n if (data != null) {\n worldBossData = JsonUtils.string2Object(new String(CompressUtil.decompressBytes(data), Charset.forName(\"String_Node_Str\")), WorldRecord.class);\n List<HurtRecord> list = new ArrayList<>(worldBossData.getHurtMap().values());\n Collections.sort(list, SORT);\n int n = list.size() > size ? size : list.size();\n for (int i = 0; i < n; i++) {\n treeMap.put(list.get(i), list.get(i));\n }\n }\n }\n if (worldBossData == null) {\n worldBossData = new WorldRecord();\n }\n try {\n wbLock.lock();\n maxId = (curMaxId / 1000);\n } finally {\n idLock.unlock();\n }\n checkActivity();\n Calendar c = Calendar.getInstance();\n int second = c.get(Calendar.SECOND);\n timerService.scheduleAtFixedRate(new Runnable() {\n public void run() {\n try {\n checkActivity();\n } catch (Exception e) {\n ServerLogger.err(e, \"String_Node_Str\");\n }\n }\n }, 60 - second, 60, TimeUnit.SECONDS);\n timerService.scheduleAtFixedRate(new Runnable() {\n public void run() {\n try {\n if (worldBossData.getbUpdate().get()) {\n saveData();\n worldBossData.setbUpdate(false);\n }\n } catch (Exception e) {\n ServerLogger.err(e, \"String_Node_Str\");\n }\n }\n }, 1, 1, TimeUnit.MINUTES);\n}\n"
|
"private void onContentLoaded(List<Content> contents) {\n if (getActivity() != null) {\n if (contents != null && contents.size() > 0) {\n Collections.sort(contents);\n displayContent(contents);\n } else if (getAdapter() == null || getAdapter().getItemCount() == 0) {\n setEmpty(false);\n }\n }\n}\n"
|
"private static FootPrint getProxyCameraFootPrint(Footprint footprint) {\n if (footprint == null)\n return null;\n return new FootPrint(footprint.getGSD(), MathUtils.coord2DToLatLong(footprint.getVertexInGlobalFrame()));\n}\n"
|
"public void write(UriInfo uriInfo, Writer w, EntitiesResponse response) {\n String baseUri = uriInfo.getBaseUri().toString();\n EdmEntitySet ees = response.getEntitySet();\n String entitySetName = ees.getName();\n DateTime utc = new DateTime().withZone(DateTimeZone.UTC);\n String updated = InternalUtil.toString(utc);\n XMLWriter2 writer = XMLFactoryProvider2.getInstance().newXMLWriterFactory2().createXMLWriter(w);\n writer.startDocument();\n writer.startElement(new QName2(\"String_Node_Str\"), atom);\n writer.writeNamespace(\"String_Node_Str\", m);\n writer.writeNamespace(\"String_Node_Str\", d);\n writer.writeAttribute(\"String_Node_Str\", baseUri);\n writeElement(writer, \"String_Node_Str\", entitySetName, \"String_Node_Str\", \"String_Node_Str\");\n writeElement(writer, \"String_Node_Str\", baseUri + uriInfo.getPath());\n writeElement(writer, \"String_Node_Str\", updated);\n writeElement(writer, \"String_Node_Str\", null, \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", entitySetName, \"String_Node_Str\", entitySetName);\n Integer inlineCount = response.getInlineCount();\n if (inlineCount != null) {\n writeElement(writer, \"String_Node_Str\", inlineCount.toString());\n }\n for (OEntity entity : response.getEntities()) {\n writer.startElement(\"String_Node_Str\");\n writeEntry(writer, entity, entity.getProperties(), entity.getLinks(), baseUri, updated, ees, true);\n writer.endElement(\"String_Node_Str\");\n }\n if (response.getSkipToken() != null) {\n UriBuilder builder = uriInfo.getRequestUriBuilder().replaceQueryParam(\"String_Node_Str\", response.getSkipToken());\n List<String> topParam = uriInfo.getQueryParameters().get(\"String_Node_Str\");\n if (topParam != null) {\n long top = Long.valueOf(topParam.get(0));\n top -= response.getEntities().size();\n if (top > 0) {\n builder.replaceQueryParam(\"String_Node_Str\", top);\n } else {\n builder.replaceQueryParam(\"String_Node_Str\");\n }\n }\n String nextHref = builder.build().toString();\n writeElement(writer, \"String_Node_Str\", null, \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", nextHref);\n }\n writer.endDocument();\n}\n"
|
"public void perform(final GraphRewrite event, final EvaluationContext context, final ArchiveModel payload) {\n if (payload.getUnzippedDirectory() != null) {\n Decompiler decompiler = new ProcyonDecompiler(new ProcyonConfiguration().setIncludeNested(false));\n String archivePath = ((FileModel) payload).getFilePath();\n File archive = new File(archivePath);\n File outputDir = new File(payload.getUnzippedDirectory().getFilePath());\n if (payload instanceof WarArchiveModel) {\n outputDir = outputDir.toPath().resolve(\"String_Node_Str\").resolve(\"String_Node_Str\").toFile();\n }\n try {\n DecompilationResult result = decompiler.decompileArchive(archive, outputDir);\n Map<String, String> decompiledOutputFiles = result.getDecompiledFiles();\n FileModelService fileService = new FileModelService(event.getGraphContext());\n for (String decompiledOutputFile : decompiledOutputFileSet) {\n FileModel decompiledFileModel = fileService.getUniqueByProperty(FileModel.FILE_PATH, decompiledOutputFile);\n if (decompiledFileModel == null) {\n FileModel parentFileModel = fileService.findByPath(Paths.get(decompiledOutputFile).getParent().toString());\n decompiledFileModel = fileService.createByFilePath(parentFileModel, decompiledOutputFile);\n decompiledFileModel.setParentArchive(payload);\n }\n ProjectModel projectModel = payload.getProjectModel();\n decompiledFileModel.setProjectModel(projectModel);\n projectModel.addFileModel(decompiledFileModel);\n if (decompiledOutputFile.endsWith(\"String_Node_Str\")) {\n if (!(decompiledFileModel instanceof JavaSourceFileModel)) {\n decompiledFileModel = GraphService.addTypeToModel(event.getGraphContext(), decompiledFileModel, JavaSourceFileModel.class);\n }\n JavaSourceFileModel decompiledSourceFileModel = (JavaSourceFileModel) decompiledFileModel;\n Path classFilepath = Paths.get(decompiledOutputFile.substring(0, decompiledOutputFile.length() - 5) + \"String_Node_Str\");\n FileModel classFileModel = fileService.getUniqueByProperty(FileModel.FILE_PATH, classFilepath);\n if (classFileModel != null && classFileModel instanceof JavaClassFileModel) {\n JavaClassFileModel classModel = (JavaClassFileModel) classFileModel;\n classModel.getJavaClass().setDecompiledSource(decompiledSourceFileModel);\n decompiledSourceFileModel.setPackageName(classModel.getPackageName());\n }\n }\n payload.addDecompiledFileModel(decompiledFileModel);\n }\n } catch (final DecompilationException exc) {\n throw new WindupException(\"String_Node_Str\" + archivePath + \"String_Node_Str\" + exc.getMessage(), exc);\n }\n }\n}\n"
|
"public String getPerMatch() {\n Double match = Double.parseDouble(getNumMatch());\n return TextFormatFactory.createStandardPercent(match / getSum());\n}\n"
|
"public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n final Activity callingActivity = getActivity();\n LayoutInflater inflater = callingActivity.getLayoutInflater();\n final View view = inflater.inflate(R.layout.fragment_pwgen, null);\n Typeface monoTypeface = Typeface.createFromAsset(callingActivity.getAssets(), \"String_Node_Str\");\n builder.setView(view);\n SharedPreferences prefs = getActivity().getApplicationContext().getSharedPreferences(\"String_Node_Str\", Context.MODE_PRIVATE);\n CheckBox checkBox = (CheckBox) view.findViewById(R.id.numerals);\n checkBox.setChecked(!prefs.getBoolean(\"String_Node_Str\", false));\n checkBox = (CheckBox) view.findViewById(R.id.symbols);\n checkBox.setChecked(prefs.getBoolean(\"String_Node_Str\", false));\n checkBox = (CheckBox) view.findViewById(R.id.uppercase);\n checkBox.setChecked(!prefs.getBoolean(\"String_Node_Str\", false));\n checkBox = (CheckBox) view.findViewById(R.id.ambiguous);\n checkBox.setChecked(!prefs.getBoolean(\"String_Node_Str\", false));\n checkBox = (CheckBox) view.findViewById(R.id.pronounceable);\n checkBox.setChecked(!prefs.getBoolean(\"String_Node_Str\", true));\n TextView textView = (TextView) view.findViewById(R.id.lengthNumber);\n textView.setText(Integer.toString(prefs.getInt(\"String_Node_Str\", 20)));\n ((TextView) view.findViewById(R.id.passwordText)).setTypeface(monoTypeface);\n builder.setPositiveButton(getResources().getString(R.string.dialog_ok), new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n EditText edit = (EditText) callingActivity.findViewById(R.id.crypto_password_edit);\n EditText generate = (EditText) view.findViewById(R.id.passwordText);\n edit.append(generate.getText());\n }\n });\n builder.setNegativeButton(getResources().getString(R.string.dialog_cancel), new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n }\n });\n builder.setNeutralButton(getResources().getString(R.string.pwgen_generate), null);\n final AlertDialog ad = builder.setTitle(\"String_Node_Str\").create();\n ad.setOnShowListener(new DialogInterface.OnShowListener() {\n public void onShow(DialogInterface dialog) {\n setPreferences();\n EditText editText = (EditText) view.findViewById(R.id.passwordText);\n editText.setText(pwgen.generate(getActivity().getApplicationContext()).get(0));\n Button b = ad.getButton(AlertDialog.BUTTON_NEUTRAL);\n b.setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n setPreferences();\n EditText editText = (EditText) view.findViewById(R.id.passwordText);\n editText.setText(pwgen.generate(callingActivity.getApplicationContext()).get(0));\n }\n });\n }\n });\n return ad;\n}\n"
|
"private Library resolveLibrary(String identifier) {\n return libraries.get(identifier);\n}\n"
|
"public static void safeClose(ResultSet rs) {\n if (null != rs)\n try {\n if (!rs.isClosed())\n rs.close();\n } catch (Throwable e) {\n }\n}\n"
|
"public void testServerSideClose() throws Exception {\n MiniAcceptor acceptor = new MiniAcceptor(SERVER_PORT);\n ManagedConnection out = new ManagedConnection(\"String_Node_Str\", SERVER_PORT);\n out.initialize();\n out.buildAndStartQueues();\n Connection in = acceptor.accept();\n assertTrue(\"String_Node_Str\", out.isOpen());\n assertTrue(\"String_Node_Str\", !out.runnerDied());\n in.close();\n try {\n out.receive();\n fail(\"String_Node_Str\");\n } catch (BadPacketException e) {\n fail(\"String_Node_Str\", e);\n } catch (IOException e) {\n }\n sleep(100);\n assertTrue(\"String_Node_Str\", !out.isOpen());\n assertTrue(\"String_Node_Str\", out.runnerDied());\n acceptor = new com.limegroup.gnutella.MiniAcceptor(PORT);\n out = new ManagedConnection(\"String_Node_Str\", PORT);\n out.initialize();\n out.buildAndStartQueues();\n in = acceptor.accept();\n assertTrue(\"String_Node_Str\", out.isOpen());\n assertTrue(\"String_Node_Str\", !out.runnerDied());\n in.close();\n Message m = new PingRequest((byte) 3);\n m.hop();\n out.send(m);\n out.send(new PingRequest((byte) 3));\n sleep(100);\n assertTrue(\"String_Node_Str\", !out.isOpen());\n assertTrue(\"String_Node_Str\", out.runnerDied());\n sleep(2000);\n}\n"
|
"public void handleCoreEvent(CoreEvent event) {\n final PageEditorInput input = (PageEditorInput) getEditorInput();\n XWikiEclipsePage page = input.getPage();\n String targetPageId = null;\n DataManager dataManager = null;\n if (event.getSource() instanceof DataManager) {\n dataManager = (DataManager) event.getSource();\n }\n boolean updatePage = false;\n switch(event.getType()) {\n case OBJECT_STORED:\n XWikiEclipseObject object = (XWikiEclipseObject) event.getData();\n targetPageId = object.getPageId();\n updatePage = page.getDataManager().equals(dataManager) && page.getId().equals(targetPageId);\n break;\n case OBJECT_REMOVED:\n updatePage = page.getDataManager().equals(dataManager) && page.getId().equals(targetPageId);\n break;\n case DATA_MANAGER_CONNECTED:\n updatePage = page.getDataManager().equals(dataManager);\n Display.getDefault().syncExec(new Runnable() {\n public void run() {\n PageEditor.this.updateInfo();\n }\n });\n break;\n case REFRESH:\n Object data = event.getData();\n if (data instanceof DataManager || data instanceof XWikiEclipsePageSummary || data instanceof XWikiEclipseSpaceSummary) {\n if (data instanceof XWikiEclipsePageSummary) {\n return;\n } else if (data instanceof DataManager) {\n DataManager aDataManager = (DataManager) data;\n if (!aDataManager.equals(page.getDataManager()))\n return;\n } else if (data instanceof XWikiEclipseSpaceSummary) {\n XWikiEclipseSpaceSummary space = (XWikiEclipseSpaceSummary) data;\n if (!space.getDataManager().equals(page.getDataManager()) || !space.getId().equals(page.getSpace()))\n return;\n }\n if (isDirty()) {\n MessageBox messageBox = new MessageBox(Display.getCurrent().getShells()[0], SWT.YES | SWT.NO | SWT.CANCEL | SWT.ICON_QUESTION);\n messageBox.setMessage(String.format(\"String_Node_Str\", page.getId()));\n messageBox.setText(\"String_Node_Str\");\n this.setFocus();\n int result = messageBox.open();\n if (result == SWT.YES) {\n this.doSave(null);\n return;\n } else if (result == SWT.CANCEL) {\n return;\n }\n }\n doRevertToSaved();\n updatePage = true;\n }\n break;\n case PAGE_REMOVED:\n XWikiEclipsePage aPage = (XWikiEclipsePage) event.getData();\n if (aPage.getXWikiEclipseId().equals(page.getXWikiEclipseId())) {\n this.close(false);\n }\n break;\n case SPACE_REMOVED:\n XWikiEclipseSpaceSummary aSpace = (XWikiEclipseSpaceSummary) event.getData();\n if (aSpace.getDataManager().equals(page.getDataManager()) && aSpace.getId().equals(page.getSpace())) {\n this.close(false);\n }\n break;\n case DATA_MANAGER_UNREGISTERED:\n DataManager aDataManager = (DataManager) event.getData();\n if (aDataManager.equals(page.getDataManager())) {\n this.close(false);\n }\n break;\n }\n try {\n if (updatePage) {\n if (!isDirty()) {\n final XWikiEclipsePage newPage = page.getDataManager().getPage(page.getWiki(), page.getSpace(), page.getName(), page.getLanguage());\n if (page.getMajorVersion() != newPage.getMajorVersion()) {\n final ISourceViewer sourceViewer = getSourceViewer();\n if (sourceViewer != null) {\n Display.getDefault().syncExec(new Runnable() {\n public void run() {\n int caretOffset = sourceViewer.getTextWidget().getCaretOffset();\n int topPixel = sourceViewer.getTextWidget().getTopPixel();\n try {\n doSetInput(new PageEditorInput(newPage, input.isReadOnly()));\n } catch (CoreException e) {\n CoreLog.logError(\"String_Node_Str\", e);\n }\n sourceViewer.getTextWidget().setCaretOffset(caretOffset);\n sourceViewer.getTextWidget().setTopPixel(topPixel);\n updateInfo();\n doSave(new NullProgressMonitor());\n }\n });\n }\n }\n }\n }\n }\n}\n"
|
"protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {\n String valueStr = value.toString();\n if (valueStr == null || valueStr.length() == 0 || valueStr.trim().length() == 0) {\n LOG.warn(\"String_Node_Str\");\n return;\n }\n double[] dValues = null;\n if (!this.dataPurifier.isFilter(valueStr)) {\n return;\n }\n long startO = System.currentTimeMillis();\n context.getCounter(Constants.SHIFU_GROUP_COUNTER, \"String_Node_Str\").increment(1L);\n if (Math.random() >= this.modelConfig.getStats().getSampleRate()) {\n return;\n }\n context.getCounter(Constants.SHIFU_GROUP_COUNTER, \"String_Node_Str\").increment(1L);\n dValues = getDoubleArrayByRawArray(CommonUtils.split(valueStr, this.dataSetDelimiter));\n count += 1L;\n if (count % 2000L == 0) {\n LOG.info(\"String_Node_Str\", count, Thread.currentThread().getName());\n }\n for (int i = 0; i < this.columnConfigList.size(); i++) {\n ColumnConfig columnConfig = this.columnConfigList.get(i);\n if (columnConfig.getColumnFlag() == ColumnFlag.Meta || (this.hasCandidates && !ColumnFlag.Candidate.equals(columnConfig.getColumnFlag()))) {\n continue;\n }\n CorrelationWritable cw = CorrelationMultithreadedMapper.finalCorrelationMap.get(i);\n synchronized (cw) {\n cw.setColumnIndex(i);\n cw.setCount(cw.getCount() + 1d);\n cw.setSum(cw.getSum() + dValues[i]);\n double squaredSum = dValues[i] * dValues[i];\n cw.setSumSquare(cw.getSumSquare() + squaredSum);\n double[] xySum = cw.getXySum();\n if (xySum == null) {\n xySum = new double[this.columnConfigList.size()];\n cw.setXySum(xySum);\n }\n double[] xxSum = cw.getXxSum();\n if (xxSum == null) {\n xxSum = new double[this.columnConfigList.size()];\n cw.setXxSum(xxSum);\n }\n double[] yySum = cw.getYySum();\n if (yySum == null) {\n yySum = new double[this.columnConfigList.size()];\n cw.setYySum(yySum);\n }\n double[] adjustCount = cw.getAdjustCount();\n if (adjustCount == null) {\n adjustCount = new double[this.columnConfigList.size()];\n cw.setAdjustCount(adjustCount);\n }\n double[] adjustSumX = cw.getAdjustSumX();\n if (adjustSumX == null) {\n adjustSumX = new double[this.columnConfigList.size()];\n cw.setAdjustSumX(adjustSumX);\n }\n double[] adjustSumY = cw.getAdjustSumY();\n if (adjustSumY == null) {\n adjustSumY = new double[this.columnConfigList.size()];\n cw.setAdjustSumY(adjustSumY);\n }\n for (int j = 0; j < this.columnConfigList.size(); j++) {\n ColumnConfig otherColumnConfig = this.columnConfigList.get(j);\n if (otherColumnConfig.getColumnFlag() == ColumnFlag.Meta) {\n continue;\n }\n if (i > j && !this.isComputeAll) {\n continue;\n }\n if (dValues[i] != Double.MIN_VALUE && dValues[j] != Double.MIN_VALUE) {\n xySum[j] += dValues[i] * dValues[j];\n xxSum[j] += squaredSum;\n yySum[j] += dValues[j] * dValues[j];\n adjustCount[j] += 1d;\n adjustSumX[j] += dValues[i];\n adjustSumY[j] += dValues[j];\n }\n }\n }\n LOG.debug(\"String_Node_Str\", (System.currentTimeMillis() - startO), Thread.currentThread().getName());\n }\n}\n"
|
"private boolean startsWith(char[] buffer, char[] phrase) {\n if (phrase.length > buffer.length)\n return false;\n for (int i = 0; i < phrase.length; i++) {\n if (buffer[i] != phrase[i])\n return false;\n }\n return true;\n}\n"
|
"public void xPathNode(XPathNode xPathNode, NullCapableValue nullCapableValue) {\n if (!(isNullRepresentedByXsiNil() || marshalNullRepresentation == XMLNullRepresentationType.XSI_NIL)) {\n if (xPathNode.getXPathFragment().isAttribute()) {\n return;\n }\n }\n XPathNode parentNode = xPathNode.getParent();\n parentNode.setNullCapableValue(nullCapableValue);\n}\n"
|
"public void configField(SchemaField iField) {\n if (checkFeature(iField, ValidationFieldFeatures.ENABLED) || checkFeature(iField, ValidationFieldFeatures.REQUIRED) || checkFeature(iField, ValidationFieldFeatures.MAX) || checkFeature(iField, ValidationFieldFeatures.MIN) || checkFeature(iField, ValidationFieldFeatures.MATCH))\n iField.setFeature(ValidationFieldFeatures.ENABLED, true);\n else\n iField.setFeature(ValidationFieldFeatures.ENABLED, false);\n}\n"
|
"private boolean setOpenGroup0(int groupIndex, boolean open) {\n if (_opens == null) {\n if (open)\n return true;\n int length = getGroupCount();\n _opens = new boolean[length];\n for (int i = 0; i < length; i++) _opens[i] = true;\n }\n if (_opens[groupIndex] != open) {\n _opens[groupIndex] = open;\n fireEvent(GroupsDataEvent.GROUPS_CHANGED, groupIndex, groupIndex, groupIndex);\n return true;\n }\n return false;\n}\n"
|
"protected boolean isSelectionValid(SelectionChangedEvent event) {\n boolean highlightOKButton = true;\n IStructuredSelection selection = (IStructuredSelection) event.getSelection();\n if (selection == null || selection.size() != 1) {\n highlightOKButton = false;\n } else {\n RepositoryNode node = (RepositoryNode) selection.getFirstElement();\n if (filterReferenceNode && !ProjectManager.getInstance().isInCurrentMainProject(node)) {\n highlightOKButton = false;\n }\n }\n return highlightOKButton;\n}\n"
|
"public Object getValue(int row, int col) {\n return data.elementAt(row)[col];\n}\n"
|
"public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) {\n if (meta % 4 == 1) {\n if (world.difficultySetting.getDifficultyId() > 2)\n world.createExplosion(null, x, y, z, 1.75f, false);\n else\n world.createExplosion(null, x, y, z, 2f, false);\n }\n}\n"
|
"private void generateEnvironment() {\n List<BGArea> tmpAreas = areaManager.loadAreas(psf.getAreaKeys());\n List<BusinessGroup> groups = businessGroupService.loadBusinessGroups(psf.getGroupKeys());\n Set<BGArea> areas = new HashSet<BGArea>();\n areas.addAll(tmpAreas);\n List<BGArea> areaByGroups = areaManager.findBGAreasOfBusinessGroups(groups);\n areas.addAll(areaByGroups);\n role = psf.getRole();\n ICourse course = CourseFactory.loadCourse(ores);\n isGlobalAuthor = false;\n isGuestOnly = false;\n isCoach = false;\n isCourseAdmin = false;\n if (role.equals(PreviewSettingsForm.ROLE_GUEST)) {\n isGuestOnly = true;\n } else if (role.equals(PreviewSettingsForm.ROLE_COURSECOACH)) {\n isCoach = true;\n } else if (role.equals(PreviewSettingsForm.ROLE_COURSEADMIN)) {\n isCourseAdmin = true;\n } else if (role.equals(PreviewSettingsForm.ROLE_GLOBALAUTHOR)) {\n isGlobalAuthor = true;\n }\n final OLATResource courseResource = course.getCourseEnvironment().getCourseGroupManager().getCourseResource();\n final CourseGroupManager cgm = new PreviewCourseGroupManager(courseResource, new ArrayList<BusinessGroup>(groups), new ArrayList<BGArea>(areas), isCoach, isCourseAdmin);\n final UserNodeAuditManager auditman = new PreviewAuditManager();\n final AssessmentManager am = new PreviewAssessmentManager();\n final CoursePropertyManager cpm = new PreviewCoursePropertyManager();\n final Structure runStructure = course.getEditorTreeModel().createStructureForPreview();\n final String title = course.getCourseTitle();\n final CourseConfig courseConfig = course.getCourseEnvironment().getCourseConfig();\n simCourseEnv = new PreviewCourseEnvironment(title, runStructure, psf.getDate(), course.getCourseFolderContainer(), course.getCourseBaseContainer(), course.getResourceableId(), cpm, cgm, auditman, am, courseConfig);\n simIdentEnv = new IdentityEnvironment();\n simIdentEnv.setRoles(new Roles(false, false, false, isGlobalAuthor, isGuestOnly, false, false));\n final Identity ident = new PreviewIdentity();\n simIdentEnv.setIdentity(ident);\n simIdentEnv.setAttributes(psf.getAttributesMap());\n}\n"
|
"public void updateEntity() {\n if (++ticksSinceLastAtack > 40) {\n Entity e = MobHelper.getNearestTargetWithinAABB(worldObj, xCoord + 0.5, yCoord - 3.0, zCoord + 0.5, 5.0F, GenericUtils.selectorLiving);\n if (e != null) {\n ticksSinceLastAtack = 0;\n e.attackEntityFrom(DamageSource.generic, 2);\n lastxCoord = e.posX - xCoord - 0.5;\n lastyCoord = e.posY + e.height * 0.5 - yCoord - 0.1;\n lastzCoord = e.posZ - zCoord - 0.5;\n }\n }\n}\n"
|
"public Resource findResource(final String workspaceUri) {\n if (!WorkspaceResourceFinderUtil.isValidWorkspaceUri(workspaceUri))\n return null;\n final String normalizedUriString = WorkspaceResourceFinderUtil.normalizeUriString(workspaceUri);\n File modelFile = new File(normalizedUriString);\n if (modelFile.exists()) {\n return getExistingVdbResource(modelFile);\n }\n Resource fileResource = null;\n final Collection<Resource> fileResources = this.vdbResourceFiles;\n fileResource = getResourceStartsWithHttp(fileResources, normalizedUriString);\n if (fileResource != null)\n return fileResource;\n fileResource = getResourceStartsWithPathSeparator(fileResources, normalizedUriString);\n if (fileResource != null)\n return fileResource;\n fileResource = getResourceByLocation(fileResources, normalizedUriString);\n if (fileResource != null)\n return fileResource;\n return null;\n}\n"
|
"public void keyPressed(KeyEvent e) {\n if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {\n e.consume();\n _frame.cancelFullScreen();\n }\n}\n"
|
"public static int unsignedArrayCompare(char[] a, int aoff, int alen, char[] b, int boff, int blen) {\n int compareLen = Math.min(alen, blen);\n for (int i = 0; i < compareLen; ++i) {\n int curA = a[aoff + i] & 0xFFFF;\n int curB = b[boff + i] & 0xFFFF;\n if (curA != curB)\n return curA - curB;\n }\n return alen - blen;\n}\n"
|
"public void renderGraphLabels(Graph graph) {\n textFont(uniEdgeMiniLabelFont);\n for (UnidirectionalEdge e : graph.getUnidirectionalEdges()) {\n if (!e.isCurved()) {\n if (e.showLabel() && e.hasLabel() && e.getLabel().getFont() != null) {\n renderEdgeLabel(e.getLabel());\n }\n if (e.showMiniLabels()) {\n renderEdgeMiniLabels(e);\n }\n }\n }\n textFont(biEdgeMiniLabelFont);\n for (BidirectionalEdge e : graph.getBidirectionalEdges()) {\n if (!e.isCurved()) {\n if (e.showLabel() && e.hasLabel()) {\n renderEdgeLabel(e.getLabel());\n }\n if (e.showMiniLabels()) {\n renderEdgeMiniLabels(e);\n }\n }\n }\n for (UndirectedEdge e : graph.getUndirectedEdges()) {\n if (e.showLabel() && !e.isCurved() && e.hasLabel()) {\n renderEdgeLabel(e.getLabel());\n }\n }\n for (Node n : graph.getNodes()) {\n if (n.showLabel() && n.hasLabel()) {\n renderNodeLabel(n.getLabel());\n }\n }\n}\n"
|
"public DbMaintainer createDbMaintainer() {\n ScriptRunner scriptRunner = createScriptRunner();\n ScriptSource scriptSource = createScriptSource();\n ExecutedScriptInfoSource executedScriptInfoSource = createExecutedScriptInfoSource();\n boolean cleanDbEnabled = PropertyUtils.getBoolean(PROPERTY_CLEANDB_ENABLED, configuration);\n boolean fromScratchEnabled = PropertyUtils.getBoolean(PROPERTY_FROM_SCRATCH_ENABLED, configuration);\n boolean keepRetryingAfterError = PropertyUtils.getBoolean(PROPERTY_KEEP_RETRYING_AFTER_ERROR_ENABLED, configuration);\n boolean disableConstraintsEnabled = PropertyUtils.getBoolean(PROPERTY_DISABLE_CONSTRAINTS_ENABLED, configuration);\n boolean updateSequencesEnabled = PropertyUtils.getBoolean(PROPERTY_UPDATE_SEQUENCES_ENABLED, configuration);\n DBCleaner dbCleaner = createDbCleaner();\n DBClearer dbClearer = createDbClearer();\n ConstraintsDisabler constraintsDisabler = createConstraintsDisabler();\n SequenceUpdater sequenceUpdater = createSequenceUpdater();\n Class<DbMaintainer> clazz = ConfigUtils.getConfiguredClass(DbMaintainer.class, configuration);\n return createInstanceOfType(clazz, false, new Class<?>[] { ScriptRunner.class, ScriptSource.class, ExecutedScriptInfoSource.class, boolean.class, boolean.class, boolean.class, boolean.class, boolean.class, DBClearer.class, DBCleaner.class, ConstraintsDisabler.class, SequenceUpdater.class }, new Object[] { scriptRunner, scriptSource, executedScriptInfoSource, fromScratchEnabled, keepRetryingAfterError, cleanDbEnabled, disableConstraintsEnabled, updateSequencesEnabled, dbClearer, dbCleaner, constraintsDisabler, sequenceUpdater });\n}\n"
|
"public void addCommonsComponents() {\n Label findLabel = new Label(composite, SWT.NONE);\n findLabel.setText(\"String_Node_Str\");\n searchText = new Text(composite, SWT.BORDER);\n GridData gridData = new GridData();\n gridData.widthHint = 150;\n searchText.setBackground(EntryState.NONE.getColor());\n searchText.setLayoutData(gridData);\n searchText.setToolTipText(\"String_Node_Str\");\n ToolBar toolBarActions = new ToolBar(composite, SWT.FLAT | SWT.RIGHT);\n toolBarActions.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));\n downTableButton = new ToolItem(toolBarActions, SWT.PUSH);\n downTableButton.setImage(org.talend.commons.ui.runtime.image.ImageProvider.getImage(org.talend.commons.ui.runtime.image.ImageProvider.getImageDesc(EImage.DOWN_ICON)));\n downTableButton.setToolTipText(\"String_Node_Str\");\n upTableButton = new ToolItem(toolBarActions, SWT.PUSH);\n upTableButton.setImage(org.talend.commons.ui.runtime.image.ImageProvider.getImage(org.talend.commons.ui.runtime.image.ImageProvider.getImageDesc(EImage.UP_ICON)));\n upTableButton.setToolTipText(\"String_Node_Str\");\n hightLightAllButton = new ToolItem(toolBarActions, SWT.CHECK);\n hightLightAllButton.setImage(org.talend.commons.ui.runtime.image.ImageProvider.getImage(org.talend.commons.ui.runtime.image.ImageProvider.getImageDesc(EImage.HIGHTLIGHT_ICON)));\n hightLightAllButton.setToolTipText(\"String_Node_Str\");\n hightLightAllButton.setSelection(false);\n addCommonsComponentListeners();\n}\n"
|
"public void run() {\n PlayerCombatClass CCQuitter = plugin.getPCC(name);\n CCQuitter.setScheduledtask(false);\n if (!(plugin.isPlrOnline(CCQuitter.getPlayerName()))) {\n plugin.logit(CCQuitter.getPlayerName() + \"String_Node_Str\");\n if (CCQuitter.isTagged()) {\n CCQuitter.setPvplogged(true);\n if (plugin.getPenalty().equals(\"String_Node_Str\")) {\n if (plugin.getInventoryClear()) {\n plugin.dropitemsandclearPCCitems(CCQuitter.getTaggedBy(), CCQuitter.getPlayerName());\n }\n }\n }\n } else {\n CCQuitter.removeTaggedBy();\n plugin.getPCC(CCQuitter.getTaggedBy()).removeFromTaggedPlayers(CCQuitter.getPlayerName());\n }\n}\n"
|
"public void run() {\n try {\n synchronized (lock) {\n ChartView view = (ChartView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(VIEW_ID, \"String_Node_Str\" + (SEC_ID++), IWorkbenchPage.VIEW_ACTIVATE);\n view.setChart(chart);\n }\n } catch (PartInitException e) {\n Status s = new Status(Status.ERROR, Activator.PLUGIN_ID, Status.ERROR, e.getMessage(), e);\n Activator.getDefault().getLog().log(s);\n }\n}\n"
|
"private void prepareSortedStacks() throws DataException, IOException {\n allSortedFactRows = new ArrayList();\n int levelSize = 0;\n int measureSize = 0;\n while (true) {\n int maxLevelCount = 0;\n int aggregationIndex = -1;\n int[] levelSortType = null;\n for (int i = 0; i < aggregationCalculators.length; i++) {\n if (sortedFactRows[i] == null && ((aggregationCalculators[i].aggregation.getLevels() != null && aggregationCalculators[i].aggregation.getLevels().length > maxLevelCount) || aggregationCalculators[i].aggregation.getLevels() == null)) {\n aggregationIndex = i;\n maxLevelCount = levelIndex[i].length;\n levelSortType = aggregationCalculators[i].aggregation.getSortTypes();\n }\n }\n if (aggregationIndex == -1) {\n break;\n }\n if (memoryCacheSize != 0) {\n if (levelSize == 0)\n levelSize = getLevelSize(aggregationCalculators[aggregationIndex].aggregation.getLevels());\n else {\n if (aggregationCalculators[aggregationIndex].aggregation.getLevels() != null)\n levelSize += getArraySize(aggregationCalculators[aggregationIndex].aggregation.getLevels().length);\n }\n if (measureSize == 0)\n measureSize = getMeasureSize();\n else\n measureSize += getArraySize(dataSet4Aggregation.getMetaInfo().getMeasureInfos().length);\n }\n Comparator comparator = new Row4AggregationComparator(levelSortType);\n DiskSortedStack diskSortedStack = new DiskSortedStack(100, false, comparator, Row4Aggregation.getCreator());\n if (memoryCacheSize == 0) {\n diskSortedStack.setBufferSize(10000);\n diskSortedStack.setUseMemoryOnly(true);\n }\n DiskSortedStackWrapper diskSortedStackReader = new DiskSortedStackWrapper(diskSortedStack, levelIndex[aggregationIndex]);\n this.allSortedFactRows.add(diskSortedStackReader);\n for (int i = 0; i < aggregationCalculators.length; i++) {\n if (sortedFactRows[i] == null && cover(levelIndex[aggregationIndex], levelIndex[i])) {\n sortedFactRows[i] = diskSortedStackReader;\n }\n }\n }\n if (memoryCacheSize > 0) {\n int rowSize = 16 + (4 + (levelSize + measureSize) - 1) / 8 * 8;\n int bufferSize = (int) (this.memoryCacheSize / rowSize);\n for (int i = 0; i < allSortedFactRows.size(); i++) {\n DiskSortedStackWrapper diskSortedStackReader = (DiskSortedStackWrapper) allSortedFactRows.get(i);\n diskSortedStackReader.getDiskSortedStack().setBufferSize(bufferSize);\n }\n }\n}\n"
|
"public void testActiveStatus() throws Exception {\n serviceClient.checkAvailability(service);\n}\n"
|
"private List<Map<String, Double>> calcStkDailyMACD(List<Double> stockPrice, int paramSHORT, int paramLONG, int paramM) {\n List<Map<String, Double>> result = new ArrayList<Map<String, Double>>();\n double shortEMA = getMa(stockPrice, paramLONG - paramSHORT, paramSHORT);\n double longEMA = getMa(stockPrice, 0, paramLONG);\n double diffValue = getDIFFValue(shortEMA, longEMA);\n double deaValue = diffValue;\n double close;\n int i = paramLONG;\n double shortSmoth = 2 / (paramSHORT + 1);\n double longSmoth = 2 / (paramLONG + 1);\n do {\n close = stockPrice.get(i);\n Map<String, Double> indicatorValue = new HashMap<String, Double>();\n shortEMA = shortSmoth * close + (paramSHORT - 1) / (paramSHORT + 1) * shortEMA;\n longEMA = longSmoth * close + (paramLONG - 1) / (paramLONG + 1) * longEMA;\n diffValue = getDIFFValue(shortEMA, longEMA);\n indicatorValue.put(VALUE_DIFF, diffValue);\n deaValue = 2 / (paramM + 1) * diffValue + (paramM - 1) / (paramM + 1) * deaValue;\n indicatorValue.put(VALUE_DEA, deaValue);\n double macdValue = 2 * (diffValue - deaValue);\n if (macdValue >= 0) {\n indicatorValue.put(VALUE_RMACD, macdValue);\n } else {\n indicatorValue.put(VALUE_FMACD, macdValue);\n }\n result.add(indicatorValue);\n i++;\n } while (i < stockPrice.size());\n return result;\n}\n"
|
"private void storeState(long hash, OpTime opTime) throws OplogManagerPersistException {\n Preconditions.checkState(isRunning(), \"String_Node_Str\");\n Status<?> result = retrier.retry(() -> {\n try (WriteMongodTransaction transaction = connection.openWriteTransaction()) {\n Status<Long> deleteResult = transaction.execute(new Request(OPLOG_DB, null, true, null), DeleteCommand.INSTANCE, new DeleteArgument.Builder(OPLOG_COL).addStatement(new DeleteStatement(DOC_QUERY, false)).build());\n if (!deleteResult.isOK()) {\n return deleteResult;\n }\n Status<InsertResult> insertResult = transaction.execute(new Request(\"String_Node_Str\", null, true, null), InsertCommand.INSTANCE, new InsertArgument.Builder(\"String_Node_Str\").addDocument(new BsonDocumentBuilder().appendUnsafe(KEY, new BsonDocumentBuilder().appendUnsafe(\"String_Node_Str\", newLong(hash)).appendUnsafe(\"String_Node_Str\", new BsonDocumentBuilder().appendUnsafe(\"String_Node_Str\", newLong(opTime.getSecs().longValue())).appendUnsafe(\"String_Node_Str\", newLong(opTime.getTerm().longValue())).build()).build()).build()).build());\n if (insertResult.isOK() && insertResult.getResult().getN() != 1) {\n return Status.from(ErrorCode.OPERATION_FAILED, \"String_Node_Str\");\n }\n return insertResult;\n }\n });\n if (!result.isOK()) {\n throw new OplogManagerPersistException(result.getErrorCode(), result.getErrorMsg());\n }\n}\n"
|
"public static void logInfo(String msg, int level) {\n if (logLevel == -42)\n if (CreeperConfig.logLevel != -42)\n logLevel = CreeperConfig.logLevel;\n if (level <= logLevel) {\n log.info(\"String_Node_Str\" + msg);\n record(\"String_Node_Str\" + msg);\n }\n}\n"
|
"public static ResourceLocation file(File root) {\n if (!root.exists())\n return new ErrorResourceLocation(root);\n try {\n return new FileSystemResourceLocation(root.getAbsoluteFile().getCanonicalFile());\n } catch (Exception e) {\n return new ErrorResourceLocation(root);\n }\n}\n"
|
"public void onError(Throwable e) {\n e.printStackTrace();\n AlertDialog dialogTip = new AlertDialog.Builder(getContext()).setMessage(R.string.error_mnemonics).setNegativeButton(R.string.cancel, (dialog, which) -> dialog.cancel()).create();\n dialogTip.show();\n customProgressDialog.cancel();\n etMnemonic.requestFocus();\n btnImportAccount.setEnabled(true);\n}\n"
|
"public void queryStatus() throws CloudRuntimeException {\n String status = \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + SSH_NETCONF_TERMINATOR;\n send(status);\n parseOkReply(receive());\n}\n"
|
"public void testOnClickClose() throws Exception {\n OnKeyboardActionListener keyboardActionListener = Mockito.mock(OnKeyboardActionListener.class);\n FrameKeyboardViewClickListener listener = new FrameKeyboardViewClickListener(keyboardActionListener);\n Mockito.verifyZeroInteractions(keyboardActionListener);\n View view = new View(RuntimeEnvironment.application);\n view.setId(R.id.quick_keys_popup_close);\n listener.onClick(view);\n Mockito.verify(keyboardActionListener).onKey(KeyCodes.CANCEL, null, 0, null, true);\n Mockito.verifyNoMoreInteractions(keyboardActionListener);\n}\n"
|
"public void fillContextMenu(IMenuManager menu) {\n Object obj = ((TreeSelection) this.getContext().getSelection()).getFirstElement();\n if (obj instanceof IFolder) {\n IFolder folder = (IFolder) obj;\n if (ResourceService.isSubFolder(ResourceManager.getAnalysisFolder(), folder)) {\n CreateNewAnalysisAction createAnalysisAction = new CreateNewAnalysisAction(folder);\n menu.add(createAnalysisAction);\n }\n }\n}\n"
|
"public int docID() {\n return print(DOC_ID, primeDoc);\n}\n"
|
"private Class generateArrayValue(JavaClass arrayClass, JavaClass componentClass, JavaClass nestedClass, TypeMappingInfo typeMappingInfo) {\n String packageName;\n String qualifiedClassName;\n if (componentClass.isArray()) {\n packageName = componentClass.getPackageName();\n qualifiedClassName = nestedClass.getQualifiedName() + ARRAY_CLASS_NAME_SUFFIX;\n } else {\n if (componentClass.isPrimitive()) {\n packageName = ARRAY_PACKAGE_NAME;\n qualifiedClassName = packageName + \"String_Node_Str\" + componentClass.getName() + ARRAY_CLASS_NAME_SUFFIX;\n } else {\n packageName = ARRAY_PACKAGE_NAME + \"String_Node_Str\" + componentClass.getPackageName();\n if (componentClass.isMemberClass()) {\n qualifiedClassName = componentClass.getName();\n qualifiedClassName = qualifiedClassName.substring(qualifiedClassName.indexOf('$') + 1);\n qualifiedClassName = ARRAY_PACKAGE_NAME + \"String_Node_Str\" + componentClass.getPackageName() + \"String_Node_Str\" + qualifiedClassName + ARRAY_CLASS_NAME_SUFFIX;\n } else {\n qualifiedClassName = ARRAY_PACKAGE_NAME + \"String_Node_Str\" + componentClass.getQualifiedName() + ARRAY_CLASS_NAME_SUFFIX;\n }\n }\n if (componentClass.isPrimitive() || helper.isBuiltInJavaType(componentClass)) {\n NamespaceInfo namespaceInfo = getPackageToNamespaceMappings().get(packageName);\n if (namespaceInfo == null) {\n namespaceInfo = new NamespaceInfo();\n namespaceInfo.setNamespace(ARRAY_NAMESPACE);\n namespaceInfo.setNamespaceResolver(new NamespaceResolver());\n getPackageToNamespaceMappings().put(packageName, namespaceInfo);\n }\n } else {\n NamespaceInfo namespaceInfo = getNamespaceInfoForPackage(componentClass.getPackage(), componentClass.getPackageName());\n getPackageToNamespaceMappings().put(packageName, namespaceInfo);\n }\n }\n String qualifiedInternalClassName = qualifiedClassName.replace('.', '/');\n String superClassName;\n if (componentClass.isArray()) {\n superClassName = \"String_Node_Str\";\n } else {\n superClassName = \"String_Node_Str\";\n }\n ClassWriter cw = new ClassWriter(false);\n cw.visit(Constants.V1_5, Constants.ACC_PUBLIC + Constants.ACC_SUPER, qualifiedInternalClassName, superClassName, null, null);\n CodeVisitor cv = cw.visitMethod(Constants.ACC_PUBLIC, \"String_Node_Str\", \"String_Node_Str\", null, null);\n cv.visitVarInsn(Constants.ALOAD, 0);\n cv.visitMethodInsn(Constants.INVOKESPECIAL, superClassName, \"String_Node_Str\", \"String_Node_Str\");\n cv.visitInsn(Constants.RETURN);\n cv.visitMaxs(1, 1);\n if (componentClass.isArray()) {\n cv = cw.visitMethod(Constants.ACC_PROTECTED, \"String_Node_Str\", \"String_Node_Str\", null, null);\n cv.visitLdcInsn(Type.getType(\"String_Node_Str\" + nestedClass.getQualifiedName().replace('.', '/') + \"String_Node_Str\"));\n cv.visitInsn(Constants.ARETURN);\n cv.visitMaxs(1, 1);\n }\n cv = cw.visitMethod(Constants.ACC_PROTECTED, \"String_Node_Str\", \"String_Node_Str\", null, null);\n JavaClass baseComponentClass = getBaseComponentType(componentClass);\n if (baseComponentClass.isPrimitive()) {\n cv.visitFieldInsn(Constants.GETSTATIC, getObjectType(baseComponentClass).getQualifiedName().replace('.', '/'), \"String_Node_Str\", \"String_Node_Str\");\n } else {\n cv.visitLdcInsn(Type.getType(\"String_Node_Str\" + baseComponentClass.getQualifiedName().replace('.', '/') + \"String_Node_Str\"));\n }\n cv.visitInsn(Constants.ARETURN);\n cv.visitMaxs(1, 1);\n RuntimeVisibleAnnotations getAdaptedValueMethodAnnotations = new RuntimeVisibleAnnotations();\n Annotation xmlElementAnnotation = new Annotation(\"String_Node_Str\");\n xmlElementAnnotation.add(\"String_Node_Str\", \"String_Node_Str\");\n xmlElementAnnotation.add(\"String_Node_Str\", Type.getType(\"String_Node_Str\" + getObjectType(nestedClass).getName().replace('.', '/') + \"String_Node_Str\"));\n getAdaptedValueMethodAnnotations.annotations.add(xmlElementAnnotation);\n cv = cw.visitMethod(Constants.ACC_PUBLIC, \"String_Node_Str\", \"String_Node_Str\", null, getAdaptedValueMethodAnnotations);\n cv.visitVarInsn(Constants.ALOAD, 0);\n cv.visitFieldInsn(Constants.GETFIELD, qualifiedInternalClassName, \"String_Node_Str\", \"String_Node_Str\");\n cv.visitInsn(Constants.ARETURN);\n cv.visitMaxs(1, 1);\n return generateClassFromBytes(qualifiedClassName, cw.toByteArray());\n}\n"
|
"private static boolean groupDoesNotExist(ServiceConfiguration configuration, AWSAutoScalingAutoScalingGroupResourceAction action) throws Exception {\n if (!Boolean.TRUE.equals(action.info.getCreatedEnoughToDelete()))\n return true;\n DescribeAutoScalingGroupsType describeAutoScalingGroupsType = MessageHelper.createMessage(DescribeAutoScalingGroupsType.class, action.info.getEffectiveUserId());\n AutoScalingGroupNames autoScalingGroupNames = new AutoScalingGroupNames();\n ArrayList<String> member = Lists.newArrayList(action.info.getPhysicalResourceId());\n autoScalingGroupNames.setMember(member);\n describeAutoScalingGroupsType.setAutoScalingGroupNames(autoScalingGroupNames);\n DescribeAutoScalingGroupsResponseType describeAutoScalingGroupsResponseType = AsyncRequests.<DescribeAutoScalingGroupsType, DescribeAutoScalingGroupsResponseType>sendSync(configuration, describeAutoScalingGroupsType);\n if (action.doesGroupNotExist(describeAutoScalingGroupsResponseType)) {\n return true;\n }\n return false;\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.