content stringlengths 40 137k |
|---|
"private void btnRightActionPerformed(java.awt.event.ActionEvent evt) {\n this.selected = true;\n if (connectedDialog != null) {\n connectedDialog.removeDialog();\n connectedDialog = null;\n }\n if (mode == FeedbackMode.SELECT && (evt.getModifiers() & ActionEvent.CTRL_MASK) == ActionEvent.CTRL_MASK) {\n session.sendPlayerInteger(gameId, 0);\n } else if (mode == FeedbackMode.END) {\n GamePanel gamePanel = MageFrame.getGame(gameId);\n if (gamePanel != null) {\n gamePanel.removeGame();\n }\n } else {\n session.sendPlayerBoolean(gameId, false);\n }\n}\n"
|
"public void postInitialize(AbstractSession session) throws DescriptorException {\n DatabaseMapping mapping = getReferenceDescriptor().getMappingForAttributeName(this.mappedBy);\n if (mapping instanceof XMLCompositeCollectionMapping) {\n XMLCompositeCollectionMapping oppositeMapping = (XMLCompositeCollectionMapping) mapping;\n oppositeMapping.setInverseReferenceMapping(this);\n }\n if (mapping instanceof XMLCompositeObjectMapping) {\n XMLCompositeObjectMapping oppositeMapping = (XMLCompositeObjectMapping) mapping;\n oppositeMapping.setInverseReferenceMapping(this);\n }\n if (mapping instanceof XMLObjectReferenceMapping) {\n XMLObjectReferenceMapping oppositeMapping = (XMLObjectReferenceMapping) mapping;\n oppositeMapping.setInverseReferenceMapping(this);\n }\n if (mapping instanceof XMLChoiceObjectMapping) {\n XMLChoiceObjectMapping oppositeMapping = (XMLChoiceObjectMapping) mapping;\n Collection<XMLMapping> nestedMappings = oppositeMapping.getChoiceElementMappings().values();\n for (XMLMapping next : nestedMappings) {\n if (next instanceof XMLCompositeObjectMapping) {\n XMLCompositeObjectMapping compositeMapping = ((XMLCompositeObjectMapping) next);\n if (compositeMapping.getReferenceClass() == this.getDescriptor().getJavaClass() || this.getDescriptor().getJavaClass().isAssignableFrom(compositeMapping.getReferenceClass())) {\n compositeMapping.setInverseReferenceMapping(this);\n }\n } else if (next instanceof XMLObjectReferenceMapping) {\n XMLObjectReferenceMapping refMapping = ((XMLObjectReferenceMapping) next);\n if (refMapping.getReferenceClass() == this.getDescriptor().getJavaClass()) {\n refMapping.setInverseReferenceMapping(this);\n }\n }\n }\n }\n if (mapping instanceof XMLChoiceCollectionMapping) {\n XMLChoiceCollectionMapping oppositeMapping = (XMLChoiceCollectionMapping) mapping;\n Collection<XMLMapping> nestedMappings = oppositeMapping.getChoiceElementMappings().values();\n for (XMLMapping next : nestedMappings) {\n if (next instanceof XMLCompositeCollectionMapping) {\n XMLCompositeCollectionMapping compositeMapping = ((XMLCompositeCollectionMapping) next);\n if (compositeMapping.getReferenceClass() == this.getDescriptor().getJavaClass()) {\n compositeMapping.setInverseReferenceMapping(this);\n }\n } else if (next instanceof XMLCollectionReferenceMapping) {\n XMLCollectionReferenceMapping refMapping = ((XMLCollectionReferenceMapping) next);\n if (refMapping.getReferenceClass() == this.getDescriptor().getJavaClass()) {\n refMapping.setInverseReferenceMapping(this);\n }\n }\n }\n }\n}\n"
|
"public List<T> getColumnSets(String catalogName, String schemaPattern, String tablePattern) throws SQLException {\n if (debug)\n incrementCount(catalogName, schemaPattern);\n List<T> tables = new ArrayList<T>();\n if (tablePattern == null) {\n addMatchingColumnSets(catalogName, schemaPattern, tablePattern, tables);\n } else {\n String[] patterns = cleanPatterns(tablePattern.split(\"String_Node_Str\"));\n for (String pattern : patterns) {\n addMatchingColumnSets(catalogName, schemaPattern, pattern, tables);\n }\n }\n return tables;\n}\n"
|
"public boolean finalizeDeployment(Commands cmds, VirtualMachineProfile<ConsoleProxyVO> profile, DeployDestination dest, ReservationContext context) {\n NicProfile controlNic = (NicProfile) profile.getParameter(VirtualMachineProfile.Param.ControlNic);\n CheckSshCommand check = new CheckSshCommand(profile.getInstanceName(), controlNic.getIp4Address(), 3922, 5, 20);\n cmds.addCommand(\"String_Node_Str\", check);\n ConsoleProxyVO proxy = profile.getVirtualMachine();\n DataCenter dc = dest.getDataCenter();\n List<NicVO> nics = _nicDao.listBy(proxy.getId());\n for (NicVO nic : nics) {\n NetworkVO network = _networkDao.findById(nic.getNetworkId());\n if ((network.getTrafficType() == TrafficType.Public && dc.getNetworkType() == NetworkType.Advanced) || (network.getTrafficType() == TrafficType.Guest && dc.getNetworkType() == NetworkType.Basic)) {\n proxy.setPublicIpAddress(nic.getIp4Address());\n proxy.setPublicNetmask(nic.getNetmask());\n proxy.setPublicMacAddress(nic.getMacAddress());\n } else if (network.getTrafficType() == TrafficType.Management) {\n proxy.setPrivateIpAddress(nic.getIp4Address());\n proxy.setPrivateMacAddress(nic.getMacAddress());\n }\n }\n _consoleProxyDao.update(proxy.getId(), proxy);\n return true;\n}\n"
|
"private void waitForSuccessfulPing(final URL serviceUrl) throws InterruptedException, ExecutionException, TimeoutException {\n Tasks.waitFor(HttpURLConnection.HTTP_OK, new Callable<Integer>() {\n public Integer call() throws Exception {\n HttpURLConnection conn = (HttpURLConnection) serviceUrl.openConnection();\n try {\n return conn.getResponseCode();\n } finally {\n conn.disconnect();\n }\n }\n }, 10, TimeUnit.SECONDS);\n}\n"
|
"public final DataSet populate(Object oResultSetDef, DataSet ds) throws ChartException {\n if (oResultSetDef instanceof IResultSetDataSet) {\n final IResultSetDataSet rsds = (IResultSetDataSet) oResultSetDef;\n final long lRowCount = rsds.getSize();\n if (lRowCount <= 0) {\n throw new ChartException(ChartEngineExtensionPlugin.ID, ChartException.ZERO_DATASET, \"String_Node_Str\", Messages.getResourceBundle(getULocale()));\n }\n int dataType = rsds.getDataType(0);\n boolean isBigDecimal = false;\n int i = 0;\n final BubbleEntry[] bea = new BubbleEntry[(int) lRowCount];\n Object[][] values = null;\n if (dataType == IConstants.NUMERICAL) {\n values = new Object[(int) lRowCount][2];\n while (rsds.hasNext()) {\n Object[] o = rsds.next();\n Object[] newO = new Object[2];\n newO[0] = o[0];\n newO[1] = o[1];\n values[i++] = newO;\n if (!isBigDecimal && NumberUtil.isBigDecimal(o[0]) || NumberUtil.isBigDecimal(o[1])) {\n isBigDecimal = true;\n }\n }\n }\n if (isBigDecimal) {\n i = 0;\n for (Object[] o : values) {\n validateBubbleEntryData(o);\n Object value = o[0];\n Object size = o[1];\n bea[i++] = new BubbleEntry(NumberUtil.asBigNumber((Number) value, null), NumberUtil.asBigNumber((Number) size, null));\n }\n } else {\n for (i = 0; i < values.length; i++) {\n validateBubbleEntryData(values[i]);\n Object value = values[i][0];\n Object size = values[i][1];\n if (dataType == IConstants.NUMERICAL) {\n bea[i] = new BubbleEntry(value, size);\n } else if (dataType == IConstants.DATE_TIME) {\n bea[i] = new BubbleEntry(value == null ? null : value, size);\n } else {\n bea[i] = new BubbleEntry(value, size, i + 1);\n }\n }\n }\n if (ds == null) {\n ds = BubbleDataSetImpl.create(bea);\n } else {\n ds.setValues(bea);\n }\n ((DataSetImpl) ds).setIsBigNumber(isBigDecimal);\n } else {\n throw new ChartException(ChartEngineExtensionPlugin.ID, ChartException.DATA_SET, \"String_Node_Str\", new Object[] { ds, oResultSetDef }, Messages.getResourceBundle(getULocale()));\n }\n return ds;\n}\n"
|
"public void onSuccess(PullResponse pullResponse) {\n messageDispatcher.processReceivedMessages(pullResponse.getReceivedMessagesList());\n if (pullResponse.getReceivedMessagesCount() == 0) {\n executor.schedule(new Runnable() {\n public void run() {\n Duration newBackoff = backoff.multipliedBy(2);\n if (newBackoff.isLongerThan(MAX_BACKOFF)) {\n newBackoff = MAX_BACKOFF;\n }\n pullMessages(newBackoff);\n }\n }, backoff.getMillis(), TimeUnit.MILLISECONDS);\n return;\n }\n messageDispatcher.processReceivedMessages(pullResponse.getReceivedMessagesList(), new Runnable() {\n public void run() {\n pullMessages(INITIAL_BACKOFF);\n }\n });\n}\n"
|
"public JsonNode migrate(final JsonNode input) throws SwaggerMigrationException {\n Objects.requireNonNull(input);\n final JsonNode node = input.path(\"String_Node_Str\");\n if (node.isMissingNode())\n return postMigrate(input);\n if (!node.isTextual())\n throw new SwaggerMigrationException(\"String_Node_Str\");\n final String dataType = node.textValue();\n final JsonPatch patch = Optional.fromNullable(patches.get(dataType)).or(DEFAULT_PATCH);\n return SwaggerMigrators.fromPatch(patch).migrate(input);\n}\n"
|
"public void enableModuleAndDependencies(Module module) {\n for (DependencyInfo info : module.getModuleInfo().getDependencies()) {\n Module dependency = getLatestModuleVersion(info.getId());\n if (info.getMaxVersion().compareTo(dependency.getVersion()) <= 0) {\n enableModuleAndDependencies(dependency);\n }\n }\n enableModule(module);\n}\n"
|
"private void createAnnotations(SourceFile sourceFile) {\n AnnotationModelEvent event = new AnnotationModelEvent(this);\n clear(event);\n List<Line> lines = sourceFile.getLines();\n List<Long> tmp = new ArrayList<>();\n for (Line line : lines) {\n if (line.getCount() != 0) {\n tmp.add(line.getCount());\n }\n }\n Long[] counts = tmp.toArray(new Long[0]);\n Arrays.sort(counts);\n float outlierThreshold = 0;\n if (!tmp.isEmpty()) {\n final int q1 = (int) Math.floor(0.25 * counts.length);\n final int q3 = (int) Math.floor(0.75 * counts.length);\n outlierThreshold = counts[q3] + (1.5f * (counts[q3] - counts[q1]));\n }\n for (int i = 0; i < lines.size(); i++) {\n try {\n Line line = lines.get((i + 1) % lines.size());\n String type = COVERAGE;\n if (line.getCount() == 0) {\n type = NO_COVERAGE;\n } else if (line.getCount() > outlierThreshold) {\n type = THOROUGH_COVERAGE;\n }\n if (line.exists()) {\n GcovAnnotation ca = new GcovAnnotation(document.getLineOffset(i), document.getLineLength(i), line.getCount(), type);\n annotations.add(ca);\n event.annotationAdded(ca);\n }\n } catch (BadLocationException e) {\n }\n }\n fireModelChanged(event);\n annotated = true;\n}\n"
|
"public void runCoalescedRequest(long startIndex) throws Exception {\n fTrace = setupTrace(DIRECTORY + File.separator + TEST_STREAM);\n TmfSignalManager.register(this);\n TmfTestTriggerSignal signal = new TmfTestTriggerSignal(this, startIndex, false);\n TmfSignalManager.dispatchSignal(signal);\n request1.waitForCompletion();\n request2.waitForCompletion();\n request3.waitForCompletion();\n try {\n assertEquals(\"String_Node_Str\", NB_EVENTS - startIndex, requestedEvents1.size());\n assertTrue(\"String_Node_Str\", request1.isCompleted());\n assertFalse(\"String_Node_Str\", request1.isCancelled());\n assertEquals(\"String_Node_Str\", NB_EVENTS - startIndex, requestedEvents2.size());\n assertTrue(\"String_Node_Str\", request2.isCompleted());\n assertFalse(\"String_Node_Str\", request2.isCancelled());\n assertEquals(\"String_Node_Str\", NB_EVENTS - startIndex, requestedEvents3.size());\n assertTrue(\"String_Node_Str\", request3.isCompleted());\n assertFalse(\"String_Node_Str\", request3.isCancelled());\n for (int i = 0; i < NB_EVENTS; i++) {\n assertEquals(\"String_Node_Str\", i + 1 + request1.getIndex(), requestedEvents1.get(i).getTimestamp().getValue());\n assertEquals(\"String_Node_Str\", i + 1 + request2.getIndex(), requestedEvents2.get(i).getTimestamp().getValue());\n assertEquals(\"String_Node_Str\", i + 1 + request3.getIndex(), requestedEvents3.get(i).getTimestamp().getValue());\n }\n } finally {\n TmfSignalManager.deregister(this);\n fTrace.dispose();\n fTrace = null;\n }\n}\n"
|
"public void addGeneratedProfiles(String expId, String folderPath, String inputFileName, String metaData, String grVersion, String uploader, boolean isPrivate) throws SQLException, IOException {\n Experiment e = expMethods.getExperiment(expId);\n File profileFolder = new File(folderPath);\n if (!profileFolder.exists()) {\n throw new IOException(\"String_Node_Str\");\n }\n for (File f : profileFolder.listFiles()) {\n if (!f.getName().equals(inputFileName)) {\n FileTuple ft = fileMethods.addGeneratedFile(e.getID(), FileTuple.PROFILE, f.getPath(), inputFileName, metaData, uploader, isPrivate, grVersion);\n fileMethods.fileReadyForDownload(ft.id);\n }\n }\n}\n"
|
"public boolean isInSlidingKeyInput() {\n if (mMiniKeyboard != null && mMiniKeyboardPopup.isShowing()) {\n return mMiniKeyboard.isInSlidingKeyInput();\n } else {\n return mPointerQueue.isInSlidingKeyInput();\n }\n}\n"
|
"public boolean apply(Game game, Ability source) {\n Permanent permanent = game.getPermanentEntering(source.getSourceId());\n int zccDiff = 0;\n if (permanent == null) {\n permanent = game.getPermanentEntering(source.getSourceId());\n }\n if (permanent != null) {\n Watcher watcher = game.getState().getWatchers().get(\"String_Node_Str\", source.getSourceId());\n if (watcher != null && watcher.conditionMet()) {\n return true;\n }\n }\n return false;\n}\n"
|
"public void onscroll(Object pos, Object max) {\n if (Objects.isNull(pos) || Objects.isNull(max))\n return;\n Number position = (Number) pos;\n Number maximum = (Number) max;\n double currentY = (position.doubleValue() < 0) ? 0 : position.doubleValue();\n double ratio = (currentY * 100) / maximum.doubleValue();\n Integer browserMaxScroll = (Integer) previewEngine.executeScript(\"String_Node_Str\");\n double browserScrollOffset = (Double.valueOf(browserMaxScroll) * ratio) / 100.0;\n previewEngine.executeScript(String.format(\"String_Node_Str\", browserScrollOffset));\n}\n"
|
"private void clearTempFile() {\n File tmpDir = new File(session.getTempDir());\n if (!tmpDir.exists() || !tmpDir.isDirectory()) {\n return;\n }\n File[] tmpFiles = tmpDir.listFiles();\n if (tmpFiles != null) {\n for (int i = 0; i < tmpFiles.length; i++) {\n if (!tmpFiles[i].delete()) {\n tmpFiles[i].deleteOnExit();\n }\n }\n }\n if (!tmpDir.delete()) {\n tmpDir.deleteOnExit();\n }\n}\n"
|
"static Object wrap(Object object) {\n try {\n if (object == null) {\n return NULL;\n }\n if (object instanceof JSONObject || object instanceof JSONArray || object instanceof Byte || object instanceof Character || object instanceof Short || object instanceof Integer || object instanceof Long || object instanceof Boolean || object instanceof Float || object instanceof Double || object instanceof String || NULL.equals(object)) {\n return object;\n }\n if (object instanceof Collection) {\n return new JSONArray((Collection) object);\n }\n if (object.getClass().isArray()) {\n return new JSONArray(object);\n }\n if (object instanceof Map) {\n return new JSONObject((Map) object);\n }\n Package objectPackage = object.getClass().getPackage();\n String objectPackageName = (objectPackage != null ? objectPackage.getName() : \"String_Node_Str\");\n if (objectPackageName.startsWith(\"String_Node_Str\") || objectPackageName.startsWith(\"String_Node_Str\") || object.getClass().getClassLoader() == null) {\n return object.toString();\n }\n return new JSONObject(object);\n } catch (Exception exception) {\n return null;\n }\n}\n"
|
"public void update(TournamentView tournament) {\n if (tournament == null) {\n return;\n }\n if (!firstInitDone) {\n Component c = this.getParent();\n while (c != null && !(c instanceof TournamentPane)) {\n c = c.getParent();\n }\n if (c != null) {\n ((TournamentPane) c).setTitle(\"String_Node_Str\" + tournament.getTournamentName() + \"String_Node_Str\");\n }\n txtName.setText(tournament.getTournamentName());\n txtType.setText(tournament.getTournamentType());\n txtStartTime.setText(df.format(tournament.getStartTime()));\n txtEndTime.setText(\"String_Node_Str\");\n firstInitDone = true;\n }\n switch(tournament.getTournamentState()) {\n case \"String_Node_Str\":\n String constructionTime = \"String_Node_Str\";\n if (tournament.getStepStartTime() != null) {\n constructionTime = Format.getDuration(tournament.getConstructionTime() - (tournament.getServerTime().getTime() - tournament.getStepStartTime().getTime()) / 1000);\n }\n txtTournamentState.setText(new StringBuilder(tournament.getTournamentState()).append(\"String_Node_Str\").append(constructionTime).append(\"String_Node_Str\").toString());\n break;\n case \"String_Node_Str\":\n String duelingTime = Format.getDuration((tournament.getServerTime().getTime() - tournament.getStepStartTime().getTime()) / 1000);\n txtTournamentState.setText(new StringBuilder(tournament.getTournamentState()).append(\"String_Node_Str\").append(duelingTime).append(\"String_Node_Str\").toString());\n break;\n default:\n txtTournamentState.setText(tournament.getTournamentState());\n break;\n }\n if (txtEndTime == null) {\n return;\n }\n if (txtEndTime.getText().equals(\"String_Node_Str\") && tournament.getEndTime() != null) {\n txtEndTime.setText(df.format(tournament.getEndTime()));\n }\n playersModel.loadData(tournament);\n matchesModel.loadData(tournament);\n this.tablePlayers.repaint();\n this.tableMatches.repaint();\n btnQuitTournament.setVisible(false);\n if (tournament.getEndTime() == null) {\n for (TournamentPlayerView player : tournament.getPlayers()) {\n if (player.getName().equals(session.getUserName())) {\n if (!player.hasQuit()) {\n btnQuitTournament.setVisible(true);\n }\n break;\n }\n }\n }\n}\n"
|
"public void selectMenuItemByIndexpath(String indexPath) {\n int[] indexItems = MenuUtilBase.splitIndexPath(indexPath);\n checkPathLength(indexItems.length);\n try {\n final IMenuItemComponent item = navigateToMenuItem(getAndCheckMenu(), indexItems);\n checkIsNull(item);\n item.selectMenuItem();\n if (EnvironmentUtils.isMacOS() && item.isShowing()) {\n closeMenu(getAndCheckMenu(), indexItems);\n }\n } catch (StepExecutionException e) {\n try {\n closeMenu(getAndCheckMenu(), indexItems);\n } catch (StepExecutionException e1) {\n if (getLog().isInfoEnabled()) {\n getLog().info(\"String_Node_Str\");\n }\n }\n throwMenuItemNotFound();\n }\n}\n"
|
"private void setCurrentWorker(SwingWorker<?, ?> worker) {\n if (worker != null) {\n view.getProgressBar().setVisible(true);\n view.getProgressBar().setIndeterminate(true);\n view.getProgressBar().setValue(0);\n worker.addPropertyChangeListener(new PropertyChangeListener() {\n public void propertyChange(PropertyChangeEvent evt) {\n if (\"String_Node_Str\".equals(evt.getPropertyName())) {\n view.getProgressBar().setValue((Integer) evt.getNewValue());\n }\n }\n }\n });\n}\n"
|
"public void pinchDetected(GlimpsePinchGestureEvent event) {\n GlimpseAxisLayout1D layout = getAxisLayout(event.getTargetStack());\n if (layout == null)\n return;\n Axis1D targetAxis = layout.getAxis(event.getTargetStack());\n zoom(targetAxis, layout.isHorizontal(), event.getX(), event.getY(), event.getScale());\n validateAxes(targetAxis);\n}\n"
|
"public void putBlock(int x, int y, Block block) {\n if (0 <= x && x < WIDTH && 0 <= y && y < HEIGHT) {\n if (block.getItem().getInteract() != null) {\n interactable.add(new BlockEntry(x, y, block));\n ArrayList<Float> a = new ArrayList<Float>();\n for (int i = 0; i < monsters.size(); ++i) a.add(0f);\n inTime.add(a);\n }\n map[y][x] = block;\n }\n}\n"
|
"private void drawPoints(Renderer renderer, RenderProps props, boolean selected) {\n Shading savedShading = renderer.setPointShading(props);\n renderer.setPointColoring(props, selected);\n switch(props.getPointStyle()) {\n case POINT:\n {\n int size = props.getPointSize();\n if (size > 0) {\n renderer.drawPoints(myRob, gidx, PointStyle.POINT, size);\n }\n break;\n }\n case SPHERE:\n {\n double rad = props.getPointRadius();\n if (rad > 0) {\n renderer.drawPoints(myRob, PointStyle.SPHERE, rad);\n }\n break;\n }\n }\n renderer.setShading(savedShading);\n}\n"
|
"public void startPrussianFormationRound(OperatingRound_1835 or) {\n interruptedRound = or;\n String roundName;\n if (interruptedRound == null) {\n roundName = \"String_Node_Str\" + previousRound.getId();\n } else {\n roundName = \"String_Node_Str\" + or.getId() + \"String_Node_Str\" + getCurrentPhase().getId();\n }\n createRound(PrussianFormationRound.class, roundName).start();\n}\n"
|
"public boolean applies(GameEvent event, Ability source, Game game) {\n if (event.getPlayerId().equals(source.getControllerId())) {\n Player player = game.getPlayer(source.getControllerId());\n if (player != null) {\n return player.chooseUse(Outcome.Benefit, \"String_Node_Str\", game);\n }\n }\n return false;\n}\n"
|
"protected Path decompressTile(int tileIndex, int level) throws IOException {\n Path tileFile = PathUtils.get(cacheDir, PathUtils.getFileNameWithoutExtension(imageFile).toLowerCase() + \"String_Node_Str\" + String.valueOf(tileIndex) + \"String_Node_Str\" + String.valueOf(level) + \"String_Node_Str\");\n if ((!Files.exists(tileFile)) || (diffLastModifiedTimes(tileFile.toFile(), imageFile.toFile()) < 0L)) {\n final OpjExecutor decompress = new OpjExecutor(OpenJpegExecRetriever.getOpjDecompress());\n final Map<String, String> params = new HashMap<String, String>() {\n {\n put(\"String_Node_Str\", GetIterativeShortPathNameW(imageFile.toString()));\n put(\"String_Node_Str\", String.valueOf(level));\n put(\"String_Node_Str\", \"String_Node_Str\");\n }\n };\n String tileFileName;\n if (org.apache.commons.lang.SystemUtils.IS_OS_WINDOWS && (tileFile.getParent() != null)) {\n tileFileName = Utils.GetIterativeShortPathNameW(tileFile.getParent().toString()) + File.separator + tileFile.getName(tileFile.getNameCount() - 1);\n } else {\n tileFileName = tileFile.toString();\n }\n params.put(\"String_Node_Str\", tileFileName);\n params.put(\"String_Node_Str\", String.valueOf(tileIndex));\n params.put(\"String_Node_Str\", String.valueOf(DataBuffer.getDataTypeSize(this.getSampleModel().getDataType())));\n params.put(\"String_Node_Str\", \"String_Node_Str\");\n if (decompress.execute(params) != 0) {\n logger.severe(decompress.getLastError());\n tileFile = null;\n } else {\n logger.fine(\"String_Node_Str\" + String.valueOf(tileIndex) + \"String_Node_Str\" + String.valueOf(level));\n }\n }\n return tileFile;\n}\n"
|
"public void apply(ProgramIR programIR) {\n assembly = new StringBuilder();\n assembly.append(\"String_Node_Str\");\n assembly.append(\"String_Node_Str\");\n assembly.append(\"String_Node_Str\");\n indent = \"String_Node_Str\";\n programIR.getFunctionMap().values().forEach(this::visit);\n assembly.append(\"String_Node_Str\");\n for (StringLiteral s : programIR.getStringPool().values()) {\n assembly.append(s.getLabel()).append(\"String_Node_Str\").append(\"String_Node_Str\").append(s.getVal()).append(\"String_Node_Str\");\n }\n options.out.print(assembly.toString());\n}\n"
|
"public void run() {\n final List<TermModel> filteredTags = new ArrayList<>();\n if (TextUtils.isEmpty(text)) {\n filteredTags.addAll(allTags);\n } else {\n for (TermModel tag : allTags) {\n if (tag.getName().toLowerCase(Locale.getDefault()).contains(text.toLowerCase(Locale.getDefault()))) {\n filteredTags.add(tag);\n }\n }\n }\n ((Activity) mContext).runOnUiThread(new Runnable() {\n public void run() {\n mFilteredTags = filteredTags;\n notifyDataSetChanged();\n }\n });\n}\n"
|
"private static int calcCritHit(BattlePlayer playerAttacker, BattlePlayer playerDefender) {\n Pokemon attacker = playerAttacker.getPokemon();\n Pokemon defender = playerDefender.getPokemon();\n int critMult = 1;\n if (defender.hasAbility(Ability.BATTLE_ARMOR)) {\n return critMult;\n }\n Random generator = new Random();\n double ran = (double) generator.nextDouble() * 100;\n double chance = 6.25;\n if (attacker.getAbility() == Ability.SUPER_LUCK) {\n chance = chance * 2;\n }\n if (defender.getAbility() == Ability.BATTLE_ARMOR || defender.getAbility() == Ability.SHELL_ARMOR) {\n ran = 100;\n }\n if (ran <= chance) {\n critMult = 2;\n if (attacker.getAbility() == Ability.SNIPER) {\n critMult = 3;\n }\n playerDefender.setTookACrit(true);\n }\n return critMult;\n}\n"
|
"public void recordAllCountsWithTimes(final String[] names, final int[] counts, final long[] times) {\n for (int index = 0; index < names.length; index++) {\n String name = names[index];\n int count = counts[index];\n long now = times[index];\n recordCountWithTime(name, count, now);\n }\n}\n"
|
"protected String buildExportZip(ProcessItem processItem, IProgressMonitor progressMonitor) throws ProcessorException {\n Map<ExportChoice, Object> exportChoiceMap = JobScriptsManagerFactory.getDefaultExportChoiceMap();\n exportChoiceMap.put(ExportChoice.needLauncher, false);\n exportChoiceMap.put(ExportChoice.needJobItem, false);\n if (CommonsPlugin.isDebugMode()) {\n exportChoiceMap.put(ExportChoice.needSourceCode, true);\n } else {\n exportChoiceMap.put(ExportChoice.needSourceCode, false);\n }\n exportChoiceMap.put(ExportChoice.binaries, true);\n exportChoiceMap.put(ExportChoice.includeLibs, true);\n if (progressMonitor.isCanceled()) {\n throw new ProcessorException(new InterruptedException());\n }\n final String archiveFilePath = Path.fromOSString(CorePlugin.getDefault().getPreferenceStore().getString(ITalendCorePrefConstants.FILE_PATH_TEMP)) + \"String_Node_Str\" + getFilePathPrefix() + \"String_Node_Str\" + process.getName() + \"String_Node_Str\";\n try {\n exportChoiceMap.put(ExportChoice.needContext, true);\n String contextName = processItem.getProcess().getDefaultContext();\n exportChoiceMap.put(ExportChoice.contextName, contextName);\n buildJob(archiveFilePath, processItem, processItem.getProperty().getVersion(), contextName, exportChoiceMap, JobExportType.POJO, progressMonitor);\n } catch (Exception e) {\n throw new ProcessorException(e);\n }\n ProcessorUtilities.resetExportConfig();\n return archiveFilePath;\n}\n"
|
"public final boolean updateLatestQuotes(List<Security> securities, List<Exception> errors) {\n Map<String, List<Security>> symbol2security = securities.stream().filter(s -> s.getTickerSymbol() != null).collect(Collectors.groupingBy(s -> s.getTickerSymbol().toUpperCase(Locale.ROOT)));\n String symbolString = symbol2security.keySet().stream().collect(Collectors.joining(\"String_Node_Str\"));\n boolean isUpdated = false;\n String url = MessageFormat.format(LATEST_URL, symbolString.toString());\n String line = null;\n try (BufferedReader reader = openReader(url, errors)) {\n if (reader == null)\n return false;\n while ((line = reader.readLine()) != null) {\n String[] values = line.split(\"String_Node_Str\");\n if (values.length != 7) {\n errors.add(new IOException(MessageFormat.format(Messages.MsgUnexpectedValue, line)));\n return false;\n }\n String symbol = stripQuotes(values[0]);\n List<Security> forSymbol = symbol2security.remove(symbol);\n if (forSymbol == null) {\n errors.add(new IOException(MessageFormat.format(Messages.MsgUnexpectedSymbol, symbol, line)));\n continue;\n }\n try {\n LatestSecurityPrice price = buildPrice(values);\n for (Security security : forSymbol) {\n boolean isAdded = security.setLatest(price);\n isUpdated = isUpdated || isAdded;\n }\n } catch (NumberFormatException | ParseException e) {\n errors.add(new IOException(MessageFormat.format(Messages.MsgErrorsConvertingValue, line), e));\n }\n }\n for (String symbol : symbol2security.keySet()) errors.add(new IOException(MessageFormat.format(Messages.MsgMissingResponse, symbol)));\n } catch (NumberFormatException | ParseException e) {\n errors.add(new IOException(MessageFormat.format(Messages.MsgErrorsConvertingValue, line), e));\n } catch (IOException e) {\n errors.add(e);\n }\n return isUpdated;\n}\n"
|
"void chooseModelFolder() {\n final ChooseDialog dlg = new ChooseDialog(DdlImporterUiI18n.CHOOSE_MODEL_FOLDER_DIALOG_TITLE, DdlImporterUiI18n.CHOOSE_MODEL_FOLDER_DIALOG_MSG, new ChooseDialogContentProvider() {\n public final IResource[] getChildren(final IContainer container) {\n final List<IResource> children = new ArrayList<IResource>();\n try {\n for (final IResource resource : container.members()) if (resource instanceof IContainer)\n children.add(resource);\n } catch (final CoreException error) {\n throw CoreModelerPlugin.toRuntimeException(error);\n }\n return children.toArray(new IResource[children.size()]);\n }\n public final boolean hasChildren(final IContainer container) {\n try {\n for (final IResource resource : container.members()) if (resource instanceof IContainer)\n return true;\n } catch (final CoreException error) {\n throw CoreModelerPlugin.toRuntimeException(error);\n }\n return false;\n }\n });\n if (importer.modelFolder() != null)\n dlg.setInitialSelection(importer.modelFolder());\n final IResource choice = showChooseDialog(dlg);\n if (choice == null)\n return;\n modelFolderFld.setText(choice.toString());\n modelNameFld.setFocus();\n}\n"
|
"private void initFloatingLabel() {\n addTextChangedListener(new TextWatcher() {\n\n public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n }\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n }\n public void afterTextChanged(Editable s) {\n if (s.length() == 0) {\n if (floatingLabelShown) {\n floatingLabelShown = false;\n getLabelAnimator().reverse();\n }\n } else if (!floatingLabelShown) {\n floatingLabelShown = true;\n if (getLabelAnimator().isStarted()) {\n getLabelAnimator().reverse();\n } else {\n getLabelAnimator().start();\n }\n }\n }\n });\n if (highlightFloatingLabel) {\n innerFocusChangeListener = new OnFocusChangeListener() {\n public void onFocusChange(View v, boolean hasFocus) {\n if (hasFocus) {\n if (getLabelFocusAnimator().isStarted()) {\n getLabelFocusAnimator().reverse();\n } else {\n getLabelFocusAnimator().start();\n }\n } else {\n getLabelFocusAnimator().reverse();\n }\n if (outerFocusChangeListener != null) {\n outerFocusChangeListener.onFocusChange(v, hasFocus);\n }\n }\n };\n super.setOnFocusChangeListener(innerFocusChangeListener);\n }\n }\n}\n"
|
"public void onResize(ResizeEvent event) {\n resizeGrid(contactHistoryGrid, container, true);\n}\n"
|
"public Set<Service> get(String type, String pool) {\n Preconditions.checkNotNull(type, \"String_Node_Str\");\n Preconditions.checkNotNull(pool, \"String_Node_Str\");\n return ImmutableSet.copyOf(filter(getAll(), and(matchesType(type), matchesPool(pool))));\n}\n"
|
"public void before() throws Exception {\n service = new ReportService();\n service.setReportDataDao(mockReportDataDao);\n service.setReportIndexDao(mockReportIndexDao);\n List<ReportData> list = Lists.newArrayList();\n list.add(createReport(LocalDate.parse(\"String_Node_Str\"), \"String_Node_Str\", \"String_Node_Str\"));\n list.add(createReport(LocalDate.parse(\"String_Node_Str\"), \"String_Node_Str\", \"String_Node_Str\"));\n results = new DateRangeResourceList<>(list, START_DATE, END_DATE);\n ReportIndex index = ReportIndex.create();\n index.setIdentifier(IDENTIFIER);\n indices = new ReportTypeResourceList<>(Lists.newArrayList(index), ReportType.STUDY);\n}\n"
|
"private void copyLive(Chunk chunk, ArrayList<Chunk> old) {\n ByteBuffer buff = fileStore.readFully(chunk.start, chunk.length);\n Chunk.fromHeader(buff, chunk.start);\n int chunkLength = chunk.length;\n markMetaChanged();\n while (buff.position() < chunkLength) {\n int start = buff.position();\n int pageLength = buff.getInt();\n buff.getShort();\n int mapId = DataUtils.readVarInt(buff);\n MVMap<Object, Object> map = (MVMap<Object, Object>) getMap(mapId);\n if (map == null) {\n buff.position(start + pageLength);\n continue;\n }\n buff.position(start);\n Page page = new Page(map, 0);\n page.read(buff, chunk.id, buff.position(), chunk.length);\n for (int i = 0; i < page.getKeyCount(); i++) {\n Object k = page.getKey(i);\n Page p = map.getPage(k);\n if (p == null) {\n } else if (p.getPos() == 0) {\n } else {\n Chunk c = getChunk(p.getPos());\n if (old.contains(c)) {\n Object value = map.remove(k);\n map.put(k, value);\n }\n }\n }\n }\n}\n"
|
"private HitEnum buildHitEnum() throws IOException {\n HitEnum e = buildHitFindingHitEnum();\n e = new OverlapMergingHitEnumWrapper(e);\n if (getOption(OPTION_RETURN_DEBUG_GRAPH, FALSE)) {\n e = new GraphvizHitEnum(e);\n }\n return e;\n}\n"
|
"public void LabelChanged(ComponentEvent e) {\n AttributeEvent attre = (AttributeEvent) e.getData();\n if (attre.getSource() == null || attre.getValue() == null) {\n return;\n }\n String newLabel = (String) attre.getValue();\n String oldLabel = attre.getOldValue() != null ? (String) attre.getOldValue() : \"String_Node_Str\";\n Attribute<String> lattr = (Attribute<String>) attre.getAttribute();\n if (!IsCorrectLabel(newLabel, comps, attre.getSource(), e.getSource().getFactory(), true)) {\n if (IsCorrectLabel(oldLabel, comps, attre.getSource(), e.getSource().getFactory(), false))\n attre.getSource().setValue(lattr, oldLabel);\n else\n attre.getSource().setValue(lattr, \"String_Node_Str\");\n }\n}\n"
|
"public void setAttributes(final Set<Attribute> attributes) {\n ConfigurableApplicationContext context = ApplicationContextManager.getApplicationContext();\n XStream xStream = context.getBean(XStream.class);\n try {\n xmlAttributes = URLEncoder.encode(xStream.toXML(attributes), \"String_Node_Str\");\n } catch (Throwable t) {\n LOG.error(\"String_Node_Str\", t);\n }\n}\n"
|
"public void invokeAllReadThroughEnabledGetOnNonExistentEntry() throws IOException {\n RecordingCacheLoader<Integer> recordingCacheLoader = new RecordingCacheLoader<>();\n try (CacheLoaderServer<Integer, Integer> cacheLoaderServer = new CacheLoaderServer<>(10000, recordingCacheLoader)) {\n cacheLoaderServer.open();\n CacheLoaderClient<Integer, Integer> cacheLoader = new CacheLoaderClient<>(cacheLoaderServer.getInetAddress(), cacheLoaderServer.getPort());\n CountingExpiryPolicy expiryPolicy = new CountingExpiryPolicy();\n expiryPolicyServer.setExpiryPolicy(expiryPolicy);\n MutableConfiguration<Integer, Integer> config = new MutableConfiguration<>();\n config.setExpiryPolicyFactory(FactoryBuilder.factoryOf(expiryPolicyClient));\n config.setCacheLoaderFactory(FactoryBuilder.factoryOf(cacheLoader));\n config.setReadThrough(true);\n Cache<Integer, Integer> cache = getCacheManager().createCache(getTestCacheName(), config);\n final Integer INITIAL_KEY = 123;\n final Integer MAX_KEY_VALUE = INITIAL_KEY + 4;\n Set<Integer> keys = new HashSet<>();\n for (int key = INITIAL_KEY; key <= MAX_KEY_VALUE; key++) {\n keys.add(key);\n }\n Map<Integer, Integer> resultMap = cache.invokeAll(keys, new GetEntryProcessor<Integer, Integer>());\n assertThat(expiryPolicy.getCreationCount(), greaterThanOrEqualTo(keys.size()));\n assertThat(expiryPolicy.getAccessCount(), is(0));\n assertThat(expiryPolicy.getUpdatedCount(), is(0));\n expiryPolicy.resetCount();\n }\n}\n"
|
"private void makeActions() {\n chatAction = new Action() {\n public void run() {\n ID targetID = inputIMTarget();\n if (targetID != null)\n openChatWindowForTarget(targetID);\n }\n };\n chatAction.setText(\"String_Node_Str\");\n chatAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));\n selectedDoubleClickAction = new Action() {\n public void run() {\n TreeObject treeObject = getSelectedTreeObject();\n final ID targetID = treeObject.getUserID();\n if (targetID != null)\n openChatWindowForTarget(targetID);\n }\n };\n disconnectAction = new Action() {\n public void run() {\n showMessage(\"String_Node_Str\");\n }\n };\n disconnectAction.setText(\"String_Node_Str\");\n disconnectAction.setToolTipText(\"String_Node_Str\" + ((groupID == null) ? \"String_Node_Str\" : groupID.getName()));\n disconnectAction.setEnabled(false);\n}\n"
|
"public void mousePressed(MouseEvent e) {\n if (PlatformManager.isLeftMouseButton(e)) {\n fileTable.requestFocus();\n } else if (PlatformManager.isRightMouseButton(e)) {\n AbstractFile currentFolder = getCurrentFolder();\n new TablePopupMenu(FolderPanel.this.mainFrame, currentFolder, null, false, fileTable.getFileTableModel().getMarkedFiles()).show(scrollPane, e.getX(), e.getY());\n }\n}\n"
|
"private boolean diveIteration(NetworkInventoryHandler<T> networkInventoryHandler) {\n if (getDepth().isEmpty()) {\n currentPass++;\n myPass = currentPass;\n } else {\n if (currentPass == myPass)\n return true;\n else\n myPass = currentPass;\n }\n cDepth.push(this);\n return false;\n}\n"
|
"public void setPermissions(List<String> permissions, String worldName) {\n if (worldName == null) {\n worldName = \"String_Node_Str\";\n }\n try (SQLConnection conn = backend.getSQL()) {\n conn.prepAndBind(\"String_Node_Str\", this.getIdentifier(), this.type.ordinal(), worldName).execute();\n if (permissions.size() > 0) {\n Set<String> includedPerms = new HashSet<>();\n PreparedStatement statement = conn.prepAndBind(\"String_Node_Str\", this.getIdentifier(), \"String_Node_Str\", worldName, this.type.ordinal());\n for (int i = permissions.size() - 1; i >= 0; i--) {\n if (!includedPerms.contains(permissions.get(i))) {\n statement.setString(2, permissions.get(i));\n statement.addBatch();\n includedPerms.add(permissions.get(i));\n }\n }\n statement.executeBatch();\n }\n statement.executeBatch();\n } catch (SQLException e) {\n throw new RuntimeException(e);\n }\n if (this.isVirtual()) {\n this.save();\n }\n if (this.commonPermissions == null) {\n this.fetchPermissions();\n } else {\n if (worldName.isEmpty()) {\n this.commonPermissions = new ArrayList<>(permissions);\n } else {\n this.worldsPermissions.put(worldName, new ArrayList<>(permissions));\n }\n }\n}\n"
|
"public void metaContactGroupAdded(MetaContactGroupEvent evt) {\n MetaContactGroup sourceGroup = evt.getSourceMetaContactGroup();\n this.groupAdded(sourceGroup);\n this.ensureIndexIsVisible(0);\n}\n"
|
"public void placeInWorld(IBuilderContext context, BlockPos pos, List<ItemStack> stacks) {\n context.world().setBlockState(pos, Blocks.CACTUS.getDefaultState(), 3);\n}\n"
|
"public boolean onKeyUp(int keyCode, KeyEvent event) {\n if (!canHandleEvent())\n return false;\n if (keyCode == KeyEvent.KEYCODE_DPAD_CENTER) {\n select(GridViewSpecial.ORIGINAL_SELECT, false);\n mHandler.removeCallbacks(mLongPressCallback);\n if (mListener != null)\n mListener.onImageClicked(mCurrentSelection);\n return true;\n }\n return super.onKeyUp(keyCode, event);\n}\n"
|
"public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n mDialogIcon = getArguments().getInt(\"String_Node_Str\");\n mDialogTitle = getArguments().getString(\"String_Node_Str\");\n mDialogText = getArguments().getString(\"String_Node_Str\");\n mImageUrl = (URL) getArguments().getSerializable(\"String_Node_Str\");\n mDialogType = (TYPE) getArguments().getSerializable(\"String_Node_Str\");\n mMenuItems = new LinkedHashMap<>();\n switch(mDialogType) {\n case IMAGE:\n mMenuItems.put(getString(R.string.action_img_download), new MenuActionLongClick() {\n public void execute() {\n downloadImage(mImageUrl);\n }\n public void executeLongClick() {\n changeDownloadDir();\n }\n });\n mMenuItems.put(getString(R.string.action_img_open), new MenuAction() {\n public void execute() {\n openLinkInBrowser(mImageUrl);\n }\n });\n mMenuItems.put(getString(R.string.action_img_sharelink), new MenuAction() {\n public void execute() {\n shareImage();\n }\n });\n mMenuItems.put(getString(R.string.action_img_copylink), new MenuAction() {\n public void execute() {\n copyToCipboard(mDialogTitle, mImageUrl.toString());\n }\n });\n break;\n case URL:\n mMenuItems.put(getString(R.string.action_link_open), new MenuAction() {\n public void execute() {\n try {\n openLinkInBrowser(new URL(mDialogText));\n } catch (MalformedURLException e) {\n Toast.makeText(getActivity(), getString(R.string.error_invalid_url), Toast.LENGTH_SHORT).show();\n e.printStackTrace();\n }\n }\n });\n mMenuItems.put(getString(R.string.action_link_share), new MenuAction() {\n public void execute() {\n shareLink();\n }\n });\n mMenuItems.put(getString(R.string.action_link_copy), new MenuAction() {\n public void execute() {\n copyToCipboard(mDialogTitle, mDialogText);\n }\n });\n break;\n }\n int style = DialogFragment.STYLE_NO_TITLE;\n int theme = ThemeChooser.isDarkTheme(getActivity()) ? R.style.FloatingDialog : R.style.FloatingDialogLight;\n setStyle(style, theme);\n}\n"
|
"public FileVisitResult visitFile(Path file, BasicFileAttributes attr) throws IOException {\n String filename = file.getFileName().toString();\n if (isResource(filename)) {\n paths.add(new PathSourcePath(filesystem, file));\n }\n return FileVisitResult.CONTINUE;\n}\n"
|
"private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {\n listeners.firePropertyChange(\"String_Node_Str\", \"String_Node_Str\", null);\n}\n"
|
"private void selectItem(int position) {\n currentSelectedPosition = position;\n if (drawerListView != null) {\n drawerListView.setItemChecked(position, true);\n }\n if (drawerLayout != null) {\n drawerLayout.closeDrawer(fragmentContainerView);\n }\n if (navigationDrawerCallbacks != null) {\n navigationDrawerCallbacks.onNavigationDrawerItemSelected(position);\n }\n}\n"
|
"public boolean connect(Properties props) {\n String url = props.getProperty(\"String_Node_Str\");\n String driver = props.getProperty(\"String_Node_Str\");\n try {\n if (connection != null) {\n connection.close();\n }\n if (driver.equals(\"String_Node_Str\")) {\n Util.PropertyList connectProperties = Util.parseConnectString(url);\n MDXConnection.mapPlatformRolesToMondrianRolesHelper(connectProperties);\n url = connectProperties.toString();\n }\n Class.forName(driver);\n java.sql.Connection sqlConnection = DriverManager.getConnection(url, user, password);\n connection = sqlConnection.unwrap(org.olap4j.OlapConnection.class);\n } catch (Exception e) {\n log.error(Messages.getInstance().getErrorString(\"String_Node_Str\", \"String_Node_Str\" + driver + \"String_Node_Str\" + url), e);\n return false;\n }\n return true;\n}\n"
|
"public void addContact(Contacts contacts) throws ContactAlreadyExistsException {\n if (contactsDao.findContactByLastNameAndFirstName(contacts.getLastName(), contacts.getFirstName()).size() > 0)\n throw new ContactAlreadyExistsException(contacts.getLastName());\n else\n contactsDao.addContact(contacts);\n}\n"
|
"public void deleteObjectPhysical(Project project, IRepositoryViewObject objToDelete, String version, boolean fromEmptyRecycleBin) throws PersistenceException {\n if (\"String_Node_Str\".equals(version)) {\n version = null;\n }\n if (objToDelete.getRepositoryObjectType() == ERepositoryObjectType.PROCESS || objToDelete.getRepositoryObjectType() == ERepositoryObjectType.JOBLET) {\n if (coreSerivce.isAlreadyBuilt(project)) {\n coreSerivce.removeItemRelations(objToDelete.getProperty().getItem());\n }\n }\n List<IRepositoryViewObject> allVersionToDelete = getAllVersion(project, objToDelete.getId(), false);\n for (IRepositoryViewObject currentVersion : allVersionToDelete) {\n if (version == null || currentVersion.getVersion().equals(version)) {\n Item currentItem = currentVersion.getProperty().getItem();\n if (currentItem.getParent() instanceof FolderItem) {\n ((FolderItem) currentItem.getParent()).getChildren().remove(currentItem);\n }\n currentItem.setParent(null);\n List<Resource> affectedResources = xmiResourceManager.getAffectedResources(currentVersion.getProperty());\n for (Resource resource : affectedResources) {\n deleteResource(resource);\n }\n }\n }\n if (!fromEmptyRecycleBin) {\n saveProject(project);\n }\n}\n"
|
"public void drawHighlighted(Canvas c, Highlight[] indices) {\n for (int i = 0; i < indices.length; i++) {\n ScatterDataSet set = mChart.getScatterData().getDataSetByIndex(indices[i].getDataSetIndex());\n if (set == null || !set.isHighlightEnabled())\n continue;\n mHighlightPaint.setColor(set.getHighLightColor());\n int xIndex = indices[i].getXIndex();\n if (xIndex > mChart.getXChartMax() * mAnimator.getPhaseX())\n continue;\n float yValue = set.getYValForXIndex(xIndex);\n if (yValue == Float.NaN)\n continue;\n float y = yValue * mAnimator.getPhaseY();\n float[] pts = new float[] { xIndex, mChart.getYChartMax(), xIndex, mChart.getYChartMin(), 0, y, mChart.getXChartMax(), y };\n mChart.getTransformer(set.getAxisDependency()).pointValuesToPixel(pts);\n c.drawLines(pts, mHighlightPaint);\n }\n}\n"
|
"private static List<Cluster> populateClusterModels(Path clusterOutputPath, Configuration conf) throws IOException {\n List<Cluster> clusterModels = new ArrayList<Cluster>();\n Cluster cluster = null;\n Path finalClustersPath = finalClustersPath(conf, clusterOutputPath);\n Iterator<?> it = new SequenceFileDirValueIterator<Writable>(finalClustersPath, PathType.LIST, PathFilters.partFilter(), null, false, conf);\n while (it.hasNext()) {\n ClusterWritable next = (ClusterWritable) it.next();\n cluster = (Cluster) next.getValue();\n cluster.configure(conf);\n clusterModels.add(cluster);\n }\n return clusterModels;\n}\n"
|
"public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {\n TileEntity tile = world.getTileEntity(pos);\n if (tile instanceof TileFusionCraftingCore) {\n ((TileFusionCraftingCore) tile).updateInjectors();\n }\n if (!world.isRemote) {\n FMLNetworkHandler.openGui(player, DraconicEvolution.instance, GuiHandler.GUIID_FUSION_CRAFTING, world, pos.getX(), pos.getY(), pos.getZ());\n }\n return true;\n}\n"
|
"public void testImportStatic1() {\n runConformTest(new String[] { \"String_Node_Str\", \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\" + \"String_Node_Str\" }, \"String_Node_Str\");\n GroovyCompilationUnitDeclaration gcud = getCUDeclFor(\"String_Node_Str\");\n ImportReference[] irs = gcud.imports;\n assertEquals(\"String_Node_Str\", irs[0].toString().trim());\n assertTrue(irs[0].isStatic());\n}\n"
|
"private void setupUnitTypePager() {\n FragmentManager fm = getSupportFragmentManager();\n mUnitTypeViewPager = (ViewPager) findViewById(R.id.unit_pager);\n mUnitTypeViewPager.setAdapter(new FragmentStatePagerAdapter(fm) {\n public int getCount() {\n return mCalc.getUnitTypeSize();\n }\n public Fragment getItem(int pos) {\n return ConvKeysFragment.newInstance(pos);\n }\n public CharSequence getPageTitle(int pos) {\n return mCalc.getUnitTypeName(pos % mCalc.getUnitTypeSize());\n }\n });\n TabPageIndicator unitTypePageIndicator = (TabPageIndicator) findViewById(R.id.titles);\n unitTypePageIndicator.setViewPager(mUnitTypeViewPager);\n unitTypePageIndicator.setVisibility(View.VISIBLE);\n unitTypePageIndicator.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {\n public void onPageSelected(int pos) {\n mCalc.setUnitTypePos(pos);\n if (mCalc.getCurrUnitType().containsDynamicUnits())\n mCalc.refreshAllDynamicUnits(false);\n int currUnitTypePos = mUnitTypeViewPager.getCurrentItem();\n clearUnitSelection(currUnitTypePos - 1);\n clearUnitSelection(currUnitTypePos);\n clearUnitSelection(currUnitTypePos + 1);\n mCalc.getCurrUnitType().clearUnitSelection();\n if (unitPosToSelectAfterScroll != -1) {\n ConvKeysFragment frag = getConvKeyFrag(mUnitTypeViewPager.getCurrentItem());\n if (frag != null)\n frag.selectUnitAtUnitArrayPos(unitPosToSelectAfterScroll);\n unitPosToSelectAfterScroll = -1;\n }\n updateScreen(false);\n mDisplay.setSelectionToEnd();\n }\n public void onPageScrolled(int pos, float posOffset, int posOffsetPixels) {\n }\n public void onPageScrollStateChanged(int state) {\n }\n });\n mUnitTypeViewPager.setCurrentItem(mCalc.getUnitTypePos());\n}\n"
|
"private Chart getConvertedChart(Chart currentChart, String sNewSubType, Orientation newOrientation, String sNewDimension) {\n Chart helperModel = currentChart.copyInstance();\n ChartCacheManager.getInstance().cacheSeries(ChartUIUtil.getAllOrthogonalSeriesDefinitions(helperModel));\n if ((currentChart instanceof ChartWithAxes)) {\n if (currentChart.getType().equals(TYPE_LITERAL)) {\n if (!currentChart.getSubType().equals(sNewSubType)) {\n currentChart.setSubType(sNewSubType);\n EList axes = ((Axis) ((ChartWithAxes) currentChart).getAxes().get(0)).getAssociatedAxes();\n for (int i = 0; i < axes.size(); i++) {\n ((Axis) axes.get(i)).setPercent(false);\n EList seriesdefinitions = ((Axis) axes.get(i)).getSeriesDefinitions();\n for (int j = 0; j < seriesdefinitions.size(); j++) {\n Series series = ((SeriesDefinition) seriesdefinitions.get(j)).getDesignTimeSeries();\n series.setStacked(false);\n }\n }\n }\n } else if (currentChart.getType().equals(BarChart.TYPE_LITERAL) || currentChart.getType().equals(TubeChart.TYPE_LITERAL) || currentChart.getType().equals(ConeChart.TYPE_LITERAL) || currentChart.getType().equals(PyramidChart.TYPE_LITERAL) || currentChart.getType().equals(StockChart.TYPE_LITERAL) || currentChart.getType().equals(AreaChart.TYPE_LITERAL) || currentChart.getType().equals(LineChart.TYPE_LITERAL) || currentChart.getType().equals(ScatterChart.TYPE_LITERAL) || currentChart.getType().equals(DifferenceChart.TYPE_LITERAL) || currentChart.getType().equals(GanttChart.TYPE_LITERAL)) {\n currentChart.setType(TYPE_LITERAL);\n currentChart.setSubType(sNewSubType);\n Text title = currentChart.getTitle().getLabel().getCaption();\n if (title.getValue() == null || title.getValue().trim().length() == 0 || title.getValue().trim().equals(oldType.getDefaultTitle().trim())) {\n title.setValue(getDefaultTitle());\n }\n Axis xAxis = ((Axis) ((ChartWithAxes) currentChart).getAxes().get(0));\n xAxis.setCategoryAxis(false);\n EList axes = ((Axis) ((ChartWithAxes) currentChart).getAxes().get(0)).getAssociatedAxes();\n ArrayList axisTypes = new ArrayList();\n for (int i = 0, seriesIndex = 0; i < axes.size(); i++) {\n if (!ChartPreviewPainter.isLivePreviewActive()) {\n ((Axis) axes.get(i)).setType(AxisType.LINEAR_LITERAL);\n }\n ((Axis) axes.get(i)).setPercent(false);\n EList seriesdefinitions = ((Axis) axes.get(i)).getSeriesDefinitions();\n for (int j = 0; j < seriesdefinitions.size(); j++) {\n Series series = ((SeriesDefinition) seriesdefinitions.get(j)).getDesignTimeSeries();\n series = getConvertedSeries(series, seriesIndex++);\n series.setStacked(false);\n ((SeriesDefinition) seriesdefinitions.get(j)).getSeries().clear();\n ((SeriesDefinition) seriesdefinitions.get(j)).getSeries().add(series);\n axisTypes.add(((Axis) axes.get(i)).getType());\n }\n }\n ((ChartWithAxes) currentChart).setOrientation(newOrientation);\n currentChart.setDimension(getDimensionFor(sNewDimension));\n currentChart.setSampleData(getConvertedSampleData(currentChart.getSampleData(), ((Axis) ((ChartWithAxes) currentChart).getAxes().get(0)).getType(), axisTypes));\n } else {\n return null;\n }\n } else {\n currentChart = ChartWithAxesImpl.create();\n currentChart.setType(TYPE_LITERAL);\n currentChart.setSubType(sNewSubType);\n ((ChartWithAxes) currentChart).setOrientation(newOrientation);\n currentChart.setDimension(getDimensionFor(sNewDimension));\n if (helperModel.getInteractivity() != null) {\n currentChart.getInteractivity().setEnable(helperModel.getInteractivity().isEnable());\n currentChart.getInteractivity().setLegendBehavior(helperModel.getInteractivity().getLegendBehavior());\n }\n ((Axis) ((ChartWithAxes) currentChart).getAxes().get(0)).setOrientation(Orientation.HORIZONTAL_LITERAL);\n ((Axis) ((ChartWithAxes) currentChart).getAxes().get(0)).setCategoryAxis(false);\n ((Axis) ((Axis) ((ChartWithAxes) currentChart).getAxes().get(0)).getAssociatedAxes().get(0)).setOrientation(Orientation.VERTICAL_LITERAL);\n ((Axis) ((Axis) ((ChartWithAxes) currentChart).getAxes().get(0)).getAssociatedAxes().get(0)).setType(AxisType.LINEAR_LITERAL);\n currentChart.setBlock(helperModel.getBlock());\n currentChart.setDescription(helperModel.getDescription());\n currentChart.setGridColumnCount(helperModel.getGridColumnCount());\n currentChart.setSampleData(helperModel.getSampleData());\n currentChart.setScript(helperModel.getScript());\n currentChart.setSeriesThickness(helperModel.getSeriesThickness());\n currentChart.setUnits(helperModel.getUnits());\n if (helperModel.getType().equals(PieChart.TYPE_LITERAL) || helperModel.getType().equals(MeterChart.TYPE_LITERAL)) {\n ((Axis) ((ChartWithAxes) currentChart).getAxes().get(0)).getSeriesDefinitions().clear();\n ((Axis) ((ChartWithAxes) currentChart).getAxes().get(0)).getSeriesDefinitions().add(((ChartWithoutAxes) helperModel).getSeriesDefinitions().get(0));\n ((Axis) ((Axis) ((ChartWithAxes) currentChart).getAxes().get(0)).getAssociatedAxes().get(0)).getSeriesDefinitions().clear();\n ((Axis) ((Axis) ((ChartWithAxes) currentChart).getAxes().get(0)).getAssociatedAxes().get(0)).getSeriesDefinitions().addAll(((SeriesDefinition) ((Axis) ((ChartWithAxes) currentChart).getAxes().get(0)).getSeriesDefinitions().get(0)).getSeriesDefinitions());\n Series series = ((SeriesDefinition) ((Axis) ((ChartWithAxes) currentChart).getAxes().get(0)).getSeriesDefinitions().get(0)).getDesignTimeSeries();\n ((SeriesDefinition) ((Axis) ((ChartWithAxes) currentChart).getAxes().get(0)).getSeriesDefinitions().get(0)).getSeries().clear();\n ((SeriesDefinition) ((Axis) ((ChartWithAxes) currentChart).getAxes().get(0)).getSeriesDefinitions().get(0)).getSeries().add(series);\n EList seriesdefinitions = ((Axis) ((Axis) ((ChartWithAxes) currentChart).getAxes().get(0)).getAssociatedAxes().get(0)).getSeriesDefinitions();\n for (int j = 0; j < seriesdefinitions.size(); j++) {\n series = ((SeriesDefinition) seriesdefinitions.get(j)).getDesignTimeSeries();\n series = getConvertedSeries(series, j);\n series.getLabel().setVisible(false);\n series.setStacked(false);\n ((SeriesDefinition) seriesdefinitions.get(j)).getSeries().clear();\n ((SeriesDefinition) seriesdefinitions.get(j)).getSeries().add(series);\n }\n } else {\n return null;\n }\n currentChart.getLegend().setItemType(LegendItemType.SERIES_LITERAL);\n currentChart.getTitle().getLabel().getCaption().setValue(CHART_TITLE);\n }\n if (!((ChartWithAxes) currentChart).getOrientation().equals(newOrientation)) {\n ((ChartWithAxes) currentChart).setOrientation(newOrientation);\n }\n if (!currentChart.getDimension().equals(getDimensionFor(sNewDimension))) {\n currentChart.setDimension(getDimensionFor(sNewDimension));\n }\n return currentChart;\n}\n"
|
"private void processLogicalBinaryOp(BinaryExprNode node) {\n if (node.getOp() == BinaryExprNode.BinaryOps.LOGIC_AND) {\n node.getLhs().setTrueBB(new BasicBlock(currentFunc, \"String_Node_Str\"));\n node.getLhs().setFalseBB(node.getFalseBB());\n node.getLhs().accept(this);\n currentBB = node.getLhs().getTrueBB();\n } else if (node.getOp() == BinaryExprNode.BinaryOps.LOGIC_OR) {\n node.getLhs().setTrueBB(node.getTrueBB());\n node.getLhs().setFalseBB(new BasicBlock(currentFunc, \"String_Node_Str\"));\n node.getLhs().accept(this);\n currentBB = node.getLhs().getFalseBB();\n } else {\n throw new CompilerError(\"String_Node_Str\");\n }\n node.getRhs().setTrueBB(node.getTrueBB());\n node.getRhs().setFalseBB(node.getFalseBB());\n node.getRhs().accept(this);\n}\n"
|
"public void onTouchEvent(MotionEvent event) {\n switch(event.getActionMasked()) {\n case MotionEvent.ACTION_DOWN:\n mMinTouchOffset = mMaxTouchOffset = mTextView.getOffsetForPosition(eventX, eventY);\n if (mGestureStayedInTapRegion) {\n if (mDoubleTap) {\n final float deltaX = x - mDownPositionX;\n final float deltaY = y - mDownPositionY;\n final float distanceSquared = deltaX * deltaX + deltaY * deltaY;\n ViewConfiguration viewConfiguration = ViewConfiguration.get(mTextView.getContext());\n int doubleTapSlop = viewConfiguration.getScaledDoubleTapSlop();\n boolean stayedInArea = distanceSquared < doubleTapSlop * doubleTapSlop;\n if (stayedInArea && isPositionOnText(x, y)) {\n startSelectionActionModeWithSelectionAndStartDrag();\n mDiscardNextActionUp = true;\n }\n }\n }\n mDownPositionX = x;\n mDownPositionY = y;\n mGestureStayedInTapRegion = true;\n break;\n case MotionEvent.ACTION_POINTER_DOWN:\n case MotionEvent.ACTION_POINTER_UP:\n if (mTextView.getContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT)) {\n updateMinAndMaxOffsets(event);\n }\n break;\n case MotionEvent.ACTION_MOVE:\n final ViewConfiguration viewConfiguration = ViewConfiguration.get(mTextView.getContext());\n if (mGestureStayedInTapRegion) {\n final float deltaX = event.getX() - mDownPositionX;\n final float deltaY = event.getY() - mDownPositionY;\n final float distanceSquared = deltaX * deltaX + deltaY * deltaY;\n int doubleTapTouchSlop = viewConfiguration.getScaledDoubleTapTouchSlop();\n if (distanceSquared > doubleTapTouchSlop * doubleTapTouchSlop) {\n mGestureStayedInTapRegion = false;\n }\n }\n if (mStartHandle != null && mStartHandle.isShowing()) {\n break;\n }\n if (mStartOffset != -1) {\n final int rawOffset = mTextView.getOffsetForPosition(event.getX(), event.getY());\n int offset = rawOffset;\n int firstWordStart = getWordStart(mStartOffset);\n int firstWordEnd = getWordEnd(mStartOffset);\n if (offset > firstWordEnd || offset < firstWordStart) {\n int fingerOffset = viewConfiguration.getScaledTouchSlop();\n float mx = event.getX();\n float my = event.getY();\n if (mx > fingerOffset)\n mx -= fingerOffset;\n if (my > fingerOffset)\n my -= fingerOffset;\n offset = mTextView.getOffsetForPosition(mx, my);\n if (mTextView.getWidth() - fingerOffset > mx) {\n final WordIterator wordIterator = getWordIteratorWithText();\n final int precedingOffset = wordIterator.preceding(offset);\n if (mStartOffset < offset) {\n offset = Math.max(precedingOffset - 1, 0);\n } else {\n if (precedingOffset == WordIterator.DONE) {\n offset = 0;\n } else {\n offset = wordIterator.preceding(precedingOffset);\n }\n }\n }\n if (offset == WordIterator.DONE)\n offset = rawOffset;\n int newStart = mStartOffset < offset ? getWordStart(mStartOffset) : getWordEnd(mStartOffset);\n Selection.setSelection((Spannable) mTextView.getText(), newStart, offset);\n }\n }\n break;\n case MotionEvent.ACTION_UP:\n if (mDragAcceleratorActive) {\n mTextView.getParent().requestDisallowInterceptTouchEvent(false);\n show();\n int startOffset = mTextView.getSelectionStart();\n int endOffset = mTextView.getSelectionEnd();\n if (endOffset < startOffset) {\n int tmp = endOffset;\n endOffset = startOffset;\n startOffset = tmp;\n Selection.setSelection((Spannable) mTextView.getText(), startOffset, endOffset);\n }\n mStartHandle.showAtLocation(startOffset);\n mEndHandle.showAtLocation(endOffset);\n mDragAcceleratorActive = false;\n mStartOffset = -1;\n }\n break;\n }\n}\n"
|
"public void testProviderPropertiesWithSQLLine() throws IOException {\n copyFromLocal(SIMPLE_PRODUCTS_TABLE);\n initCatalog();\n SchemaCatalog schemaCatalog = getSchemaCatalog();\n catalog(\"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\");\n catalog(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\");\n catalog(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\", SIMPLE_PRODUCTS_TABLE);\n Format format = Format.getFormat(\"String_Node_Str\");\n ProviderDef providerDef = schemaCatalog.findProviderDefFor(\"String_Node_Str\", format);\n assertNotNull(\"String_Node_Str\", providerDef);\n boolean result = shell(\"String_Node_Str\", PROVIDER_SQL_SELECT_FILE, \"String_Node_Str\", getPlatformName());\n assertTrue(\"String_Node_Str\", result);\n}\n"
|
"public IStatus doAction() {\n try {\n ((XSDTreeContentProvider) page.getTreeViewer().getContentProvider()).getXSDSchemaAsString();\n XSDElementDeclaration decl = xsdElem;\n if (decl == null) {\n ISelection selection = page.getTreeViewer().getSelection();\n decl = (XSDElementDeclaration) ((IStructuredSelection) selection).getFirstElement();\n }\n Set<String> list = new HashSet<String>();\n Util.getForeingKeyInDataModel(list, page.getXObject().getParent());\n if (list.contains(decl.getName())) {\n MessageDialog.openWarning(page.getSite().getShell(), \"String_Node_Str\", \"String_Node_Str\" + decl.getName() + \"String_Node_Str\");\n return Status.CANCEL_STATUS;\n }\n ArrayList<Object> objList = new ArrayList<Object>();\n IStructuredContentProvider provider = (IStructuredContentProvider) page.getTreeViewer().getContentProvider();\n Object[] objs = Util.getAllObject(page.getSite(), objList, provider);\n Util.deleteReference(decl, objs);\n XSDTypeDefinition current = decl.getTypeDefinition();\n schema.getContents().remove(decl);\n schema.update();\n xsdElem = null;\n page.refresh();\n page.markDirty();\n } catch (Exception e) {\n e.printStackTrace();\n MessageDialog.openError(page.getSite().getShell(), \"String_Node_Str\", \"String_Node_Str\" + e.getLocalizedMessage());\n return Status.CANCEL_STATUS;\n }\n return Status.OK_STATUS;\n}\n"
|
"private void getShiftAffactedEditPart(List toSelect, List deSelect) {\n if (lastSelectedShiftPart == null || lastSelectedShiftPart == getSourceEditPart()) {\n toSelect.add(getSourceEditPart());\n return;\n }\n if (lastSelectedShiftPart instanceof TreeNodeEditPart) {\n AbstractInOutTreeEditPart treePart = XmlMapUtil.getAbstractInOutTreePart((TreeNodeEditPart) lastSelectedShiftPart);\n if (treePart != null) {\n List<TreeNodeEditPart> partList = new ArrayList<TreeNodeEditPart>();\n getChildNodeList(partList, treePart.getChildren());\n int index = partList.indexOf(lastSelectedShiftPart);\n int index2 = partList.indexOf(getSourceEditPart());\n if (index2 != -1) {\n for (int i = Math.min(index, index2); i < Math.max(index, index2) + 1; i++) {\n if (!toSelect.contains(partList.get(i))) {\n toSelect.add(partList.get(i));\n }\n }\n List selectedEditParts = getCurrentViewer().getSelectedEditParts();\n for (int i = 0; i < selectedEditParts.size(); i++) {\n if (partList.contains(selectedEditParts.get(i)) && !toSelect.contains(selectedEditParts.get(i))) {\n deSelect.add(selectedEditParts.get(i));\n }\n }\n }\n }\n }\n}\n"
|
"protected void onSaveInstanceState(Bundle icicle) {\n icicle.putBoolean(DO_LAUNCH_ICICLE, mDoLaunch);\n icicle.putString(TEMP_FILE_PATH_ICICLE, mTempFile.getAbsolutePath());\n}\n"
|
"private void handleAuthError(AccountStore.AuthenticationErrorType error, String errorMessage) {\n if (error != AccountStore.AuthenticationErrorType.NEEDS_2FA) {\n mLoginListener.track(AnalyticsTracker.Stat.LOGIN_FAILED, error.getClass().getSimpleName(), error.toString(), errorMessage);\n if (mIsSocialLogin) {\n mLoginListener.track(AnalyticsTracker.Stat.LOGIN_SOCIAL_FAILURE, error.getClass().getSimpleName(), error.toString(), errorMessage);\n }\n }\n switch(error) {\n case INCORRECT_USERNAME_OR_PASSWORD:\n case NOT_AUTHENTICATED:\n showPasswordError();\n break;\n case NEEDS_2FA:\n saveCredentialsInSmartLock(mLoginListener, mEmailAddress, mPassword);\n if (isSocialLogin) {\n mLoginListener.needs2faSocialConnect(mEmailAddress, mRequestedPassword, mIdToken, mService);\n } else {\n mLoginListener.needs2fa(mEmailAddress, mRequestedPassword);\n }\n break;\n case INVALID_REQUEST:\n default:\n AppLog.e(T.NUX, \"String_Node_Str\" + errorMessage);\n ToastUtils.showToast(getActivity(), errorMessage == null ? getString(R.string.error_generic) : errorMessage);\n break;\n }\n}\n"
|
"protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (debug)\n Log.d(TAG, \"String_Node_Str\" + requestCode + \"String_Node_Str\" + resultCode);\n switch(requestCode) {\n case REQUEST_CODE_ASK_PASSWORD:\n if (resultCode == RESULT_OK) {\n salt = data.getStringExtra(\"String_Node_Str\");\n masterKey = data.getStringExtra(\"String_Node_Str\");\n String timeout = mPreferences.getString(Preferences.PREFERENCE_LOCK_TIMEOUT, Preferences.PREFERENCE_LOCK_TIMEOUT_DEFAULT_VALUE);\n int timeoutMinutes = 5;\n try {\n timeoutMinutes = Integer.valueOf(timeout);\n } catch (NumberFormatException e) {\n Log.d(TAG, \"String_Node_Str\");\n }\n try {\n service.setTimeoutMinutes(timeoutMinutes);\n service.setSalt(salt);\n service.setPassword(masterKey);\n } catch (RemoteException e1) {\n e1.printStackTrace();\n }\n boolean externalAccess = mPreferences.getBoolean(Preferences.PREFERENCE_ALLOW_EXTERNAL_ACCESS, false);\n boolean isLocal = isIntentLocal();\n if (isLocal || externalAccess) {\n actionDispatch();\n } else {\n showDialogAllowExternalAccess();\n }\n break;\n case REQUEST_CODE_ALLOW_EXTERNAL_ACCESS:\n actionDispatch();\n break;\n }\n } else {\n setResult(RESULT_CANCELED);\n finish();\n }\n}\n"
|
"protected boolean doExecute() throws Exception {\n String categorie = \"String_Node_Str\";\n String accessQuery = \"String_Node_Str\";\n TalendDefinitionFileUpdate talendDefinitionFileUpdate = new TalendDefinitionFileUpdate();\n if (-1 == talendDefinitionFileUpdate.indexOf(accessQuery)) {\n talendDefinitionFileUpdate.add(categorie, categorie + System.getProperty(\"String_Node_Str\") + accessQuery);\n rc = talendDefinitionFileUpdate.replace(this.getClass().getName());\n }\n return false;\n}\n"
|
"public boolean existsDatabase() {\n if (Files.exists(filepath) || db == null) {\n return true;\n }\n if (db.isClosed()) {\n return true;\n }\n if (db.getCatalog().size() > 0) {\n return true;\n }\n return false;\n}\n"
|
"public boolean isTransient() {\n return false;\n}\n"
|
"public void exportAllTransactions(File file, Client client) throws IOException {\n List<? extends Transaction> transactions = Stream.concat(client.getAccounts().stream(), client.getPortfolios().stream()).flatMap(l -> l.getTransactions().stream()).sorted(new Transaction.ByDate()).collect(Collectors.toList());\n try (Writer writer = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8)) {\n CSVPrinter printer = new CSVPrinter(writer);\n printer.setStrategy(CSVExporter.STRATEGY);\n writeHeader(printer);\n for (Transaction t : transactions) {\n if (t instanceof AccountTransaction) {\n AccountTransaction ta = (AccountTransaction) t;\n if (ta.getSecurity() != null && (ta.getType() == AccountTransaction.Type.INTEREST || ta.getType() == AccountTransaction.Type.DIVIDENDS))\n writeDividend(printer, ta, dateFormat);\n } else if (t instanceof PortfolioTransaction) {\n PortfolioTransaction tp = (PortfolioTransaction) t;\n switch(tp.getType()) {\n case BUY:\n case DELIVERY_INBOUND:\n writeBuySell(printer, tp, \"String_Node_Str\", dateFormat);\n break;\n case SELL:\n case DELIVERY_OUTBOUND:\n writeBuySell(printer, tp, \"String_Node_Str\", dateFormat);\n break;\n default:\n }\n }\n }\n }\n}\n"
|
"public List<ComponentETagPair<Calendar>> getHiddenComponents() throws InvalidComponentException, DavException, InvalidMacException, GeneralSecurityException, IOException {\n List<ComponentETagPair<Calendar>> exposedComponentPairs = super.getComponents();\n List<ComponentETagPair<Calendar>> recoveredComponentPairs = new LinkedList<ComponentETagPair<Calendar>>();\n for (ComponentETagPair<Calendar> exposedComponentPair : exposedComponentPairs) {\n Calendar exposedComponent = exposedComponentPair.getComponent();\n XProperty protectedComponent = (XProperty) exposedComponent.getProperty(PROPERTY_NAME_FLOCK_HIDDEN_CALENDAR);\n if (protectedComponent == null)\n recoveredComponentPairs.add(exposedComponentPair);\n else {\n String recoveredComponentText = HidingUtil.decodeAndDecryptIfNecessary(masterCipher, protectedComponent.getValue());\n StringReader stringReader = new StringReader(recoveredComponentText);\n CalendarBuilder calendarBuilder = new CalendarBuilder();\n try {\n Calendar recoveredComponent = calendarBuilder.build(stringReader);\n recoveredComponentPairs.add(new ComponentETagPair<Calendar>(recoveredComponent, exposedComponentPair.getETag()));\n } catch (ParserException e) {\n Log.e(TAG, \"String_Node_Str\", e);\n throw new InvalidComponentException(\"String_Node_Str\", true, CalDavConstants.CALDAV_NAMESPACE, getPath(), e);\n }\n }\n }\n return recoveredComponentPairs;\n}\n"
|
"public static StateXWidgetPage getCurrentAtsWorkPage(AbstractWorkflowArtifact awa) {\n for (StateXWidgetPage statePage : getStatePagesOrderedByOrdinal(awa)) {\n if (awa.getStateMgr().getCurrentStateName().equals(statePage.getName())) {\n return statePage;\n }\n }\n return null;\n}\n"
|
"public HostResponse newHostResponse(HostJoinVO host, EnumSet<HostDetails> details) {\n HostResponse hostResponse = new HostResponse();\n hostResponse.setId(host.getUuid());\n hostResponse.setCapabilities(host.getCapabilities());\n hostResponse.setClusterId(host.getClusterUuid());\n hostResponse.setCpuNumber(host.getCpus());\n hostResponse.setZoneId(host.getZoneUuid());\n hostResponse.setDisconnectedOn(host.getDisconnectedOn());\n hostResponse.setHypervisor(host.getHypervisorType());\n hostResponse.setHostType(host.getType());\n hostResponse.setLastPinged(new Date(host.getLastPinged()));\n hostResponse.setManagementServerId(host.getManagementServerId());\n hostResponse.setName(host.getName());\n hostResponse.setPodId(host.getPodUuid());\n hostResponse.setRemoved(host.getRemoved());\n hostResponse.setCpuSpeed(host.getSpeed());\n hostResponse.setState(host.getStatus());\n hostResponse.setIpAddress(host.getPrivateIpAddress());\n hostResponse.setVersion(host.getVersion());\n hostResponse.setCreated(host.getCreated());\n if (details.contains(HostDetails.all) || details.contains(HostDetails.capacity) || details.contains(HostDetails.stats) || details.contains(HostDetails.events)) {\n hostResponse.setOsCategoryId(host.getOsCategoryUuid());\n hostResponse.setOsCategoryName(host.getOsCategoryName());\n hostResponse.setZoneName(host.getZoneName());\n hostResponse.setPodName(host.getPodName());\n if (host.getClusterId() > 0) {\n hostResponse.setClusterName(host.getClusterName());\n hostResponse.setClusterType(host.getClusterType().toString());\n }\n }\n DecimalFormat decimalFormat = new DecimalFormat(\"String_Node_Str\");\n if (host.getType() == Host.Type.Routing) {\n if (details.contains(HostDetails.all) || details.contains(HostDetails.capacity)) {\n Long mem = host.getMemReservedCapacity() + host.getMemUsedCapacity();\n Long cpu = host.getCpuReservedCapacity() + host.getCpuReservedCapacity();\n hostResponse.setMemoryAllocated(mem);\n hostResponse.setMemoryTotal(host.getTotalMemory());\n String hostTags = host.getTag();\n hostResponse.setHostTags(host.getTag());\n String haTag = ApiDBUtils.getHaTag();\n if (haTag != null && !haTag.isEmpty() && hostTags != null && !hostTags.isEmpty()) {\n if (haTag.equalsIgnoreCase(hostTags)) {\n hostResponse.setHaHost(true);\n } else {\n hostResponse.setHaHost(false);\n }\n } else {\n hostResponse.setHaHost(false);\n }\n hostResponse.setHypervisorVersion(host.getHypervisorVersion());\n String cpuAlloc = decimalFormat.format(((float) cpu / (float) (host.getCpus() * host.getSpeed())) * 100f) + \"String_Node_Str\";\n hostResponse.setCpuAllocated(cpuAlloc);\n String cpuWithOverprovisioning = new Float(host.getCpus() * host.getSpeed() * ApiDBUtils.getCpuOverprovisioningFactor()).toString();\n hostResponse.setCpuWithOverprovisioning(cpuWithOverprovisioning);\n }\n if (details.contains(HostDetails.all) || details.contains(HostDetails.stats)) {\n String cpuUsed = null;\n HostStats hostStats = ApiDBUtils.getHostStatistics(host.getId());\n if (hostStats != null) {\n float cpuUtil = (float) hostStats.getCpuUtilization();\n cpuUsed = decimalFormat.format(cpuUtil) + \"String_Node_Str\";\n hostResponse.setCpuUsed(cpuUsed);\n hostResponse.setMemoryUsed((new Double(hostStats.getUsedMemory())).longValue());\n hostResponse.setNetworkKbsRead((new Double(hostStats.getNetworkReadKBs())).longValue());\n hostResponse.setNetworkKbsWrite((new Double(hostStats.getNetworkWriteKBs())).longValue());\n }\n }\n } else if (host.getType() == Host.Type.SecondaryStorage) {\n StorageStats secStorageStats = ApiDBUtils.getSecondaryStorageStatistics(host.getId());\n if (secStorageStats != null) {\n hostResponse.setDiskSizeTotal(secStorageStats.getCapacityBytes());\n hostResponse.setDiskSizeAllocated(secStorageStats.getByteUsed());\n }\n }\n hostResponse.setLocalStorageActive(ApiDBUtils.isLocalStorageActiveOnHost(host.getId()));\n if (details.contains(HostDetails.all) || details.contains(HostDetails.events)) {\n Set<com.cloud.host.Status.Event> possibleEvents = host.getStatus().getPossibleEvents();\n if ((possibleEvents != null) && !possibleEvents.isEmpty()) {\n String events = \"String_Node_Str\";\n Iterator<com.cloud.host.Status.Event> iter = possibleEvents.iterator();\n while (iter.hasNext()) {\n com.cloud.host.Status.Event event = iter.next();\n events += event.toString();\n if (iter.hasNext()) {\n events += \"String_Node_Str\";\n }\n }\n hostResponse.setEvents(events);\n }\n }\n hostResponse.setResourceState(host.getResourceState().toString());\n hostResponse.setJobId(host.getJobUuid());\n hostResponse.setJobStatus(host.getJobStatus());\n hostResponse.setObjectName(\"String_Node_Str\");\n return hostResponse;\n}\n"
|
"public short readShort(int byteIndex) {\n return view.getInt16(byteIndex, littleEndian);\n}\n"
|
"public static void updateLessonResource(Context context, Lesson lesson, String locale) throws IOException {\n File fileIdx = new File(lesson.mResourcePath);\n InputStream is = context.getAssets().open(\"String_Node_Str\" + locale);\n OutputStream os = new java.io.FileOutputStream(fileIdx);\n IOUtils.copy(is, os);\n}\n"
|
"public void mustFailToParsePacketThatsTooLong() throws Exception {\n ExternalAddressNatPmpResponse origResp = new ExternalAddressNatPmpResponse(1, 0xFFFFFFFFL, TEST_ADDRESS);\n byte[] buffer = origResp.dump();\n buffer = Arrays.copyOf(buffer, buffer.length + 1);\n ExternalAddressNatPmpRequest parsedReq = new ExternalAddressNatPmpRequest(buffer);\n}\n"
|
"public void testFailXMLStreamReaderWithNullClass() throws Exception {\n try {\n InputStream stream = ClassLoader.getSystemResourceAsStream(DOUBLE_ERROR_XML);\n XMLStreamReader xmlStreamReader = XML_INPUT_FACTORY.createXMLStreamReader(stream);\n unmarshaller.unmarshal(xmlStreamReader, (Class) null);\n } catch (IllegalArgumentException e) {\n return;\n }\n fail(\"String_Node_Str\");\n}\n"
|
"public void testAddChild() throws OseeCoreException {\n when(container1.getRelation(node1, DEFAULT_HIERARCHY, node2, INCLUDE_DELETED)).thenReturn(null);\n when(container2.getRelation(node1, DEFAULT_HIERARCHY, node2, INCLUDE_DELETED)).thenReturn(null);\n when(relationFactory.createRelation(eq(node1), eq(DEFAULT_HIERARCHY), eq(node2), Matchers.anyString())).thenReturn(relation1);\n when(orderFactory.createOrderManager(node1)).thenReturn(orderManager1);\n when(orderFactory.createOrderManager(node1)).thenReturn(orderManager1);\n when(orderManager1.getSorterId(Default_Hierarchical__Child)).thenReturn(UNORDERED);\n when(node1.getArtifactType()).thenReturn(artifactType1);\n when(node2.getArtifactType()).thenReturn(artifactType2);\n when(validity.getMaximumRelationsAllowed(Default_Hierarchical__Child, artifactType1, SIDE_A)).thenReturn(10);\n when(validity.getMaximumRelationsAllowed(Default_Hierarchical__Child, artifactType2, SIDE_B)).thenReturn(10);\n manager.addChild(session, node1, node2);\n verify(container1).getRelation(node1, DEFAULT_HIERARCHY, node2, INCLUDE_DELETED);\n verify(container2).getRelation(node1, DEFAULT_HIERARCHY, node2, INCLUDE_DELETED);\n verify(orderManager1).getSorterId(Default_Hierarchical__Child);\n verify(orderManager1).setOrder(eq(Default_Hierarchical__Child), eq(UNORDERED), sortedListCaptor.capture());\n verify(container1).add(DEFAULT_HIERARCHY.getGuid(), relation1);\n verify(container2).add(DEFAULT_HIERARCHY.getGuid(), relation1);\n}\n"
|
"public void validate(UIValidationContext validator) {\n DirectoryResource folder = targetDirectory.getValue();\n if (folder == null || (folder.exists() && (!folder.isDirectory() || !folder.listResources().isEmpty()))) {\n validator.addValidationError(targetDirectory, \"String_Node_Str\");\n }\n}\n"
|
"public boolean apply(Game game, Ability source) {\n Player controller = game.getPlayer(source.getControllerId());\n if (controller != null) {\n Cards revealedCards = new CardsImpl();\n for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {\n if (!Objects.equals(playerId, controller.getId())) {\n Player opponent = game.getPlayer(playerId);\n if (opponent != null) {\n Cards cards = new CardsImpl(opponent.getHand());\n opponent.revealCards(opponent.getName() + \"String_Node_Str\", cards, game);\n revealedCards.addAll(cards);\n }\n }\n }\n TargetCard target = new TargetCard(Zone.HAND, new FilterNonlandCard(\"String_Node_Str\"));\n controller.chooseTarget(Outcome.Benefit, revealedCards, target, source, game);\n Card card = game.getCard(target.getFirstTarget());\n if (card != null) {\n game.informPlayers(\"String_Node_Str\" + GameLog.getColoredObjectName(card) + ']');\n Permanent sourcePermanent = game.getPermanent(source.getSourceId());\n if (sourcePermanent != null) {\n sourcePermanent.addInfo(\"String_Node_Str\", CardUtil.addToolTipMarkTags(\"String_Node_Str\" + card.getName()), game);\n }\n game.addEffect(new AlhammarretHighArbiterCantCastEffect(card.getName()), source);\n }\n return true;\n }\n return false;\n}\n"
|
"public String processCode(String code) throws IllegalActionException {\n StringBuffer result = new StringBuffer();\n int currentPos = code.indexOf(\"String_Node_Str\");\n if (currentPos < 0) {\n return code;\n }\n result.append(code.substring(0, currentPos));\n while (currentPos < code.length()) {\n int openParenIndex = code.indexOf(\"String_Node_Str\", currentPos + 1);\n int closeParenIndex = _findCloseParen(code, openParenIndex);\n if (closeParenIndex < 0) {\n result.append(code.substring(currentPos));\n return result.toString();\n }\n int nextPos = code.indexOf(\"String_Node_Str\", closeParenIndex + 1);\n if (nextPos < 0) {\n nextPos = code.length();\n }\n String subcode = code.substring(currentPos, nextPos);\n if ((currentPos > 0) && (code.charAt(currentPos - 1) == '\\\\')) {\n result.append(subcode);\n currentPos = nextPos;\n continue;\n }\n String macro = code.substring(currentPos + 1, openParenIndex);\n macro = macro.trim();\n if (!CodeGenerator._macros.contains(macro)) {\n result.append(subcode.substring(0, 1));\n result.append(processCode(subcode.substring(1)));\n } else {\n String name = code.substring(openParenIndex + 1, closeParenIndex);\n name = name.trim();\n if (macro.equals(\"String_Node_Str\")) {\n result.append(getReference(name));\n } else if (macro.equals(\"String_Node_Str\")) {\n TypedIOPort port = getPort(name);\n if (port == null) {\n throw new IllegalActionException(name + \"String_Node_Str\");\n }\n result.append(cType(port.getType()));\n } else if (macro.equals(\"String_Node_Str\") || macro.equals(\"String_Node_Str\")) {\n TypedIOPort port = getPort(name);\n if (port == null) {\n throw new IllegalActionException(name + \"String_Node_Str\");\n }\n if (macro.equals(\"String_Node_Str\")) {\n result.append(\"String_Node_Str\");\n }\n result.append(codeGenType(port.getType()));\n } else if (macro.equals(\"String_Node_Str\")) {\n result.append(getParameterValue(name, _component));\n } else if (macro.equals(\"String_Node_Str\")) {\n result.append(getSize(name));\n } else if (macro.equals(\"String_Node_Str\")) {\n result.append(generateName(_component));\n result.append(\"String_Node_Str\" + name);\n } else if (macro.equals(\"String_Node_Str\")) {\n result.append(_component.getClassName().replace('.', '_'));\n result.append(\"String_Node_Str\" + name);\n } else if (macro.equals(\"String_Node_Str\")) {\n result.append(getNewInvocation(name));\n } else if (macro.equals(\"String_Node_Str\")) {\n result.append(getFunctionInvocation(name, false));\n } else if (macro.equals(\"String_Node_Str\")) {\n result.append(getFunctionInvocation(name, true));\n } else {\n throw new IllegalActionException(\"String_Node_Str\");\n }\n result.append(code.substring(closeParenIndex + 1, nextPos));\n }\n currentPos = nextPos;\n }\n return result.toString();\n}\n"
|
"private void setupMasterPage(MasterPageDesign page, MasterPageHandle handle) {\n setupStyledElement(page, handle);\n page.setPageType(handle.getPageType());\n DimensionValue effectWidth = handle.getPageWidth();\n DimensionValue effectHeight = handle.getPageHeight();\n DimensionType width = null;\n DimensionType height = null;\n if (effectWidth != null) {\n width = new DimensionType(effectWidth.getMeasure(), effectWidth.getUnits());\n }\n if (effectHeight != null) {\n height = new DimensionType(effectHeight.getMeasure(), effectHeight.getUnits());\n }\n page.setPageSize(width, height);\n page.setOrientation(handle.getOrientation());\n DimensionType top = createDimension(handle.getTopMargin(), true);\n DimensionType left = createDimension(handle.getLeftMargin(), true);\n DimensionType bottom = createDimension(handle.getBottomMargin(), true);\n DimensionType right = createDimension(handle.getRightMargin(), true);\n page.setMargin(top, left, bottom, right);\n}\n"
|
"private void fixDocumentURIPrefix() throws SBOLValidationException {\n String documentURIPrefixAll = extractDocumentURIPrefix();\n if (documentURIPrefixAll != null && documentURIPrefixAll.length() >= 9) {\n setDefaultURIprefix(documentURIPrefixAll);\n }\n String documentURIPrefix = documentURIPrefixAll;\n for (TopLevel topLevel : getTopLevels()) {\n if (documentURIPrefixAll.length() < 9) {\n documentURIPrefix = URIcompliance.extractURIprefix(topLevel.getIdentity());\n String documentURIPrefix2 = URIcompliance.extractURIprefix(URI.create(URIcompliance.extractSimpleNamespace(topLevel.getIdentity())));\n if (documentURIPrefix2 != null) {\n documentURIPrefix = documentURIPrefix2;\n }\n }\n if (!topLevel.getIdentity().equals(URIcompliance.createCompliantURI(documentURIPrefix, topLevel.getDisplayId(), topLevel.getVersion()))) {\n String newDisplayId = topLevel.getIdentity().toString().replaceAll(documentURIPrefix, \"String_Node_Str\");\n String newVersion = \"String_Node_Str\";\n if (topLevel.isSetVersion()) {\n newDisplayId = newDisplayId.replace(\"String_Node_Str\" + topLevel.getVersion(), \"String_Node_Str\");\n newVersion = topLevel.getVersion();\n }\n newDisplayId = URIcompliance.fixDisplayId(newDisplayId);\n while (getTopLevel(URIcompliance.createCompliantURI(documentURIPrefix, newDisplayId, newVersion)) != null) {\n newDisplayId = newDisplayId.replaceAll(\"String_Node_Str\", \"String_Node_Str\");\n }\n TopLevel newTopLevel = this.createCopy(topLevel, newDisplayId, newVersion);\n removeTopLevel(topLevel);\n updateReferences(topLevel.getIdentity(), newTopLevel.getIdentity());\n updateReferences(topLevel.getPersistentIdentity(), newTopLevel.getPersistentIdentity());\n }\n }\n}\n"
|
"private String killInstance(AdminCommandContext context) {\n String msg = initializeInstance();\n if (msg != null)\n return msg;\n String nodeName = instance.getNodeRef();\n Node node = nodes.getNode(nodeName);\n NodeUtils nodeUtils = new NodeUtils(habitat, logger);\n ArrayList<String> command = new ArrayList<String>();\n command.add(\"String_Node_Str\");\n command.add(\"String_Node_Str\");\n command.add(instanceName);\n String humanCommand = makeCommandHuman(command);\n String firstErrorMessage = Strings.get(\"String_Node_Str\", instanceName, nodeName, humanCommand);\n if (logger.isLoggable(Level.FINE))\n logger.fine(\"String_Node_Str\" + humanCommand + \"String_Node_Str\" + nodeName);\n nodeUtils.runAdminCommandOnNode(node, command, context, firstErrorMessage, humanCommand, null);\n ActionReport killreport = context.getActionReport();\n if (killreport.getActionExitCode() != ActionReport.ExitCode.SUCCESS) {\n return killreport.getMessage();\n }\n return null;\n}\n"
|
"public void executeTask(TaskPacket iTask) {\n if (!(iTask instanceof SimpleGuiTask)) {\n return;\n }\n SimpleGuiTask guiTask = (SimpleGuiTask) iTask;\n System.out.println(\"String_Node_Str\" + guiTask.getGuiAction());\n switch(guiTask.getGuiAction()) {\n case SET_WORK_AREA:\n {\n WorkAreaGuiTask task = (WorkAreaGuiTask) guiTask;\n setWorkArea(task.getPosition(), task.getBuildingPos().x, task.getBuildingPos().y);\n }\n break;\n case BUILD:\n {\n GeneralGuiTask task = (GeneralGuiTask) guiTask;\n grid.constructBuildingAt(task.getPosition(), task.getType());\n }\n break;\n case MOVE_TO:\n {\n MoveToGuiTask task = (MoveToGuiTask) guiTask;\n moveSelectedTo(task.getPosition(), task.getSelection());\n }\n break;\n case QUICK_SAVE:\n try {\n grid.save(guiInterface.getUIState());\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n break;\n case DESTROY_BUILDING:\n {\n ShortPoint2D buildingPos = ((DestroyBuildingGuiTask) guiTask).getPosition();\n Building building = ((Building) grid.getBuildingAt(buildingPos.x, buildingPos.y));\n if (building != null) {\n building.kill();\n }\n }\n break;\n case DESTROY_MOVABLES:\n killSelectedMovables(((MovableGuiTask) guiTask).getSelection());\n break;\n case START_WORKING:\n case STOP_WORKING:\n stopOrStartWorking(((MovableGuiTask) guiTask).getSelection(), guiTask.getGuiAction() == EGuiAction.STOP_WORKING);\n break;\n case CONVERT:\n convertMovables((ConvertGuiTask) guiTask);\n break;\n case SET_BUILDING_PRIORITY:\n setBuildingPriority((SetBuildingPriorityGuiTask) guiTask);\n break;\n case SET_MATERIAL_DISTRIBUTION_SETTINGS:\n {\n SetMaterialDistributionSettingsGuiTask task = (SetMaterialDistributionSettingsGuiTask) guiTask;\n grid.setMaterialDistributionSettings(task.getManagerPosition(), task.getMaterialType(), task.getProbabilities());\n }\n break;\n case SET_MATERIAL_PRIORITIES:\n {\n SetMaterialPrioritiesGuiTask task = (SetMaterialPrioritiesGuiTask) guiTask;\n grid.setMaterialPrioritiesSetting(task.getManagerPosition(), task.getMaterialTypeForPriority());\n }\n break;\n default:\n break;\n }\n}\n"
|
"private void createButtons(Composite section) {\n Button refreshButton = new Button(section, SWT.PUSH);\n GridDataFactory.fillDefaults().grab(true, false).applyTo(refreshButton);\n refreshButton.setText(\"String_Node_Str\");\n refreshButton.addSelectionListener(new SelectionAdapter() {\n\n public void widgetSelected(SelectionEvent event) {\n validateSettings();\n }\n });\n}\n"
|
"public int scheduleAsyncDelayedTask(Object plugin, Runnable task) {\n return scheduleAsyncRepeatingTaskInternal(plugin, task, 0, -1);\n}\n"
|
"public Where<ModelClass> and(SQLCondition condition) {\n conditionGroup.and(condition);\n return this;\n}\n"
|
"public void setByte(final int index, final byte value) throws IOException {\n setInteger(index, (int) value);\n}\n"
|
"public void satisfiesInvolves_validInput() {\n TurboUser user = new TurboUser(REPO, \"String_Node_Str\", \"String_Node_Str\");\n TurboIssue issue = new TurboIssue(REPO, 1, \"String_Node_Str\", \"String_Node_Str\", LocalDateTime.now(), true);\n issue.setAssignee(user);\n IModel model = TestUtils.modelWith(issue, user);\n assertTrue(Qualifier.process(model, Parser.parse(\"String_Node_Str\"), issue));\n assertTrue(Qualifier.process(model, Parser.parse(\"String_Node_Str\"), issue));\n assertTrue(Qualifier.process(model, Parser.parse(\"String_Node_Str\"), issue));\n assertTrue(Qualifier.process(model, Parser.parse(\"String_Node_Str\"), issue));\n assertTrue(Qualifier.process(model, Parser.parse(\"String_Node_Str\"), issue));\n assertTrue(Qualifier.process(model, Parser.parse(\"String_Node_Str\"), issue));\n issue = new TurboIssue(REPO, 1, \"String_Node_Str\", \"String_Node_Str\", null, false);\n assertTrue(Qualifier.process(model, Parser.parse(\"String_Node_Str\"), issue));\n assertTrue(Qualifier.process(model, Parser.parse(\"String_Node_Str\"), issue));\n assertFalse(Qualifier.process(model, Parser.parse(\"String_Node_Str\"), issue));\n assertTrue(Qualifier.process(model, Parser.parse(\"String_Node_Str\"), issue));\n assertFalse(Qualifier.process(model, Parser.parse(\"String_Node_Str\"), issue));\n}\n"
|
"public final Stroke getCachedStroke(LineAttributes lia) {\n if (lia == null)\n return null;\n Stroke s = (Stroke) _htLineStyles.get(lia);\n if (s == null) {\n BasicStroke bs = null;\n if (lia.getStyle().getValue() == LineStyle.DASHED) {\n float[] faStyle = new float[] { 6.0f, 4.0f };\n bs = new BasicStroke(lia.getThickness(), BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, faStyle, 0);\n } else if (lia.getStyle().getValue() == LineStyle.DOTTED) {\n float[] faStyle = new float[] { 1.0f, 4.0f };\n bs = new BasicStroke(lia.getThickness(), BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, faStyle, 0);\n } else if (lia.getStyle().getValue() == LineStyle.SOLID) {\n bs = new BasicStroke(lia.getThickness(), BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);\n }\n if (bs != null) {\n _htLineStyles.put(lia, bs);\n }\n return bs;\n }\n return s;\n}\n"
|
"public void setKey(Comparable key) {\n ParamChecks.nullNotPermitted(key, \"String_Node_Str\");\n Comparable old = this.key;\n try {\n this.vetoableChangeSupport.fireVetoableChange(\"String_Node_Str\", old, key);\n this.key = key;\n this.propertyChangeSupport.firePropertyChange(\"String_Node_Str\", old, key);\n } catch (PropertyVetoException e) {\n throw new IllegalArgumentException(e);\n }\n}\n"
|
"static void putPrimitiveValue(Object lastObject, Value value, Field field) {\n checkNotNull(field);\n try {\n field.set(checkNotNull(lastObject), getValueObject(value, field));\n } catch (Exception ex) {\n throw new RuntimeException(ex);\n }\n}\n"
|
"public boolean sendToServerSingleRC(List<NameValuePair> qparams, String strAPIUrl) throws paloexception {\n try {\n HttpEntity entity = sendToServer(qparams, strAPIUrl);\n CSVReader csv = new CSVReader(entity.getContent(), \"String_Node_Str\", \"String_Node_Str\", ';', '\"', '\\\\', false, 0);\n String[] result = csv.readNext();\n boolean bStatus = Boolean.getBoolean(result[0]);\n csv.close();\n entity.consumeContent();\n return bStatus;\n } catch (Exception e) {\n throw new paloexception(e.getMessage());\n }\n}\n"
|
"public int read(byte[] buffer, int off, int len) throws IOException {\n int attempts = 0;\n for (; ; ) {\n if (checkCancellation())\n throw new OperationCanceledException();\n try {\n return in.read(buffer, off, len);\n } catch (InterruptedIOException e) {\n if (e.bytesTransferred != 0)\n return e.bytesTransferred;\n if (++attempts == numAttempts)\n throw new InterruptedIOException(readTimeoutMessage);\n }\n }\n}\n"
|
"public boolean replaceEvent(GameEvent event, Ability source, Game game) {\n ManaCosts attackBlockManaTax = getManaCostToPay(event, source, game);\n if (attackBlockManaTax != null) {\n return handleManaCosts(attackBlockManaTax.copy(), event, source, game);\n }\n Cost attackBlockOtherTax = getOtherCostToPay(event, source, game);\n if (attackBlockOtherTax != null) {\n return handleOtherCosts(attackBlockOtherTax, event, source, game);\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.