content stringlengths 40 137k |
|---|
"public static final void main(String[] args0) {\n final List<String> args = new ArrayList<>(Arrays.asList(args0));\n try {\n final Capsule capsule = myCapsule(args);\n if (capsule.getClass().equals(Capsule.class) && capsule.wrapper && !capsule.isEmptyCapsule()) {\n runMain(capsule.jarFile, args);\n System.exit(0);\n }\n if (propertyDefined(PROP_VERSION, PROP_PRINT_JRES, PROP_TREE, PROP_RESOLVE)) {\n if (propertyDefined(PROP_VERSION))\n capsule.printVersion(args);\n if (propertyDefined(PROP_MODES))\n capsule.printModes(args);\n if (propertyDefined(PROP_TREE))\n capsule.printDependencyTree(args);\n if (propertyDefined(PROP_RESOLVE))\n capsule.resolve(args);\n if (propertyDefined(PROP_PRINT_JRES))\n capsule.printJVMs(args);\n return;\n }\n if (capsule.isEmptyCapsule())\n throw new RuntimeException(\"String_Node_Str\" + capsule.jarFile + \"String_Node_Str\" + capsule.jarFile + \"String_Node_Str\");\n System.exit(capsule.launch(args));\n } catch (Throwable t) {\n System.err.print(\"String_Node_Str\" + t.getMessage());\n if (hasContext() && (t.getMessage() == null || t.getMessage().length() < 50))\n System.err.print(\"String_Node_Str\" + reportContext());\n if (getLogLevel(System.getProperty(PROP_LOG_LEVEL)) >= LOG_VERBOSE) {\n System.err.println();\n t.printStackTrace(System.err);\n } else\n System.err.println(\"String_Node_Str\" + PROP_LOG_LEVEL + \"String_Node_Str\");\n System.exit(1);\n }\n}\n"
|
"public void testIDPSelection() throws Exception {\n RequestDispatcher dispatcher = createMock(RequestDispatcher.class);\n entryPoint.setIdpSelectionPath(\"String_Node_Str\");\n expect(request.getParameter(SAMLEntryPoint.LOGIN_PARAMETER)).andReturn(\"String_Node_Str\");\n expect(request.getRequestDispatcher(\"String_Node_Str\")).andReturn(dispatcher);\n expect(request.getHeader(\"String_Node_Str\")).andReturn(\"String_Node_Str\");\n expect(request.getHeader(org.springframework.security.saml.SAMLConstants.PAOS_HTTP_HEADER)).andReturn(null);\n dispatcher.forward(request, response);\n replay(dispatcher);\n replayMock();\n entryPoint.commence(request, response, null);\n verifyMock();\n verify(dispatcher);\n}\n"
|
"public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {\n if (scrollListener != null) {\n scrollListener.onScroll(view, firstVisibleItem, visibleItemCount, totalItemCount);\n }\n if (getAdapter() == null || getAdapter().getCount() == 0)\n return;\n if (areHeadersSticky) {\n if (getChildCount() != 0) {\n View viewToWatch = super.getChildAt(0);\n for (int i = 1; i < getChildCount(); i++) {\n int firstChildDistance;\n if (clippingToPadding) {\n firstChildDistance = Math.abs((viewToWatch.getTop() - getPaddingTop()));\n } else {\n firstChildDistance = Math.abs(viewToWatch.getTop());\n }\n int secondChildDistance;\n if (clippingToPadding) {\n secondChildDistance = Math.abs((getChildAt(i).getTop() - getPaddingTop()) - headerHeight);\n } else {\n secondChildDistance = Math.abs(getChildAt(i).getTop() - headerHeight);\n }\n if (!(Boolean) viewToWatch.getTag() || ((Boolean) getChildAt(i).getTag() && secondChildDistance < firstChildDistance)) {\n viewToWatch = getChildAt(i);\n }\n }\n if ((Boolean) viewToWatch.getTag()) {\n if (headerHeight < 0)\n headerHeight = viewToWatch.findViewById(R.id.header_view).getHeight();\n if (firstVisibleItem == 0 && getChildAt(0).getTop() > 0 && !clippingToPadding) {\n headerBottomPosition = 0;\n } else {\n if (clippingToPadding) {\n headerBottomPosition = Math.min(viewToWatch.getTop(), headerHeight + getPaddingTop());\n headerBottomPosition = headerBottomPosition < getPaddingTop() ? headerHeight + getPaddingTop() : headerBottomPosition;\n } else {\n headerBottomPosition = Math.min(viewToWatch.getTop(), headerHeight);\n headerBottomPosition = headerBottomPosition < 0 ? headerHeight : headerBottomPosition;\n }\n }\n } else {\n headerBottomPosition = headerHeight;\n if (clippingToPadding) {\n headerBottomPosition += getPaddingTop();\n }\n }\n }\n if (Build.VERSION.SDK_INT < 11) {\n if (!clippingToPadding && getPaddingTop() > 0) {\n if (getChildAt(0).getTop() > 0) {\n if (firstVisibleItem > 0)\n firstVisibleItem -= 1;\n }\n }\n }\n if (oldHeaderId != ((StickyListHeadersAdapter) getAdapter()).getHeaderId(firstVisibleItem)) {\n headerHasChanged = true;\n header = ((StickyListHeadersAdapter) getAdapter()).getHeaderView(firstVisibleItem, header);\n header.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, headerHeight));\n }\n oldHeaderId = ((StickyListHeadersAdapter) getAdapter()).getHeaderId(firstVisibleItem);\n for (int i = 0; i < getChildCount(); i++) {\n if ((Boolean) getChildAt(i).getTag()) {\n if (getChildAt(i).getTop() < (clippingToPadding ? getPaddingTop() : 0)) {\n getChildAt(i).findViewById(R.id.header_view).setVisibility(View.INVISIBLE);\n } else {\n getChildAt(i).findViewById(R.id.header_view).setVisibility(View.VISIBLE);\n }\n }\n }\n }\n}\n"
|
"public void onSaveInstanceState(Bundle outState) {\n outState.putString(REDIRECT_PAGE_STATE_ITEM, mRedirectPage);\n outState.putBoolean(FLOW_FINISHED, mFlowFinished);\n}\n"
|
"public void start(BundleContext context) throws Exception {\n super.start(context);\n plugin = this;\n}\n"
|
"public void loginTrustedWithCertificateChainPasses() throws Exception {\n final String methodName = \"String_Node_Str\";\n try {\n mockery.checking(new Expectations() {\n {\n one(userRegistry).mapCertificate(certificateChain);\n will(returnValue(CERTIFICATE_USER_NAME));\n }\n });\n IdentityAssertionLoginModule module = new IdentityAssertionLoginModule();\n Subject subject = new Subject();\n CallbackHandler callbackHandler = null;\n Map sharedState = createSharedState(true, null, certificateChain);\n Map options = null;\n module.initialize(subject, callbackHandler, sharedState, options);\n assertTrue(module.login());\n } catch (Throwable t) {\n outputMgr.failWithThrowable(methodName, t);\n }\n}\n"
|
"public void testRefreshPoolsSortsStackDerivedPools() {\n List<Subscription> subscriptions = Util.newList();\n List<Pool> pools = Util.newList();\n Pool p = TestUtil.createPool(TestUtil.createProduct());\n p.setLinkedStackId(\"String_Node_Str\");\n pools.add(p);\n when(mockSubAdapter.getSubscriptions(any(Owner.class))).thenReturn(subscriptions);\n Page page = mock(Page.class);\n when(page.getPageData()).thenReturn(pools);\n when(mockPoolCurator.listAvailableEntitlementPools(any(Consumer.class), any(Owner.class), anyString(), any(Date.class), anyBoolean(), any(PageRequest.class))).thenReturn(page);\n this.manager.getRefresher().add(getOwner()).run();\n ArgumentCaptor<List> poolCaptor = ArgumentCaptor.forClass(List.class);\n verify(this.poolRulesMock).updatePools(poolCaptor.capture());\n assertEquals(1, poolCaptor.getValue().size());\n assertEquals(p, poolCaptor.getValue().get(0));\n}\n"
|
"public void testList() {\n long backlogId = 1l;\n List<UserStory> userStoriesMock = Arrays.asList(PojoHelper.userStory(\"String_Node_Str\"), PojoHelper.userStory(\"String_Node_Str\"), PojoHelper.userStory(\"String_Node_Str\"));\n expect(userStoryDaoMock.getStories(backlogId)).andReturn(userStoriesMock);\n replay(userStoryDaoMock);\n List<UserStory> result = userStoryService.list(backlogId);\n verify(userStoryDaoMock);\n assertThat(result).isNotNull().isEqualTo(userStoriesMock);\n}\n"
|
"public static ArtifactEvent getPersistEvent(RemotePersistEvent1 remEvent) {\n ArtifactEvent event = new ArtifactEvent(remEvent.getBranchGuid());\n event.setNetworkSender(getNetworkSender(remEvent.getNetworkSender()));\n event.setTransactionId(remEvent.getTransactionId());\n for (RemoteBasicGuidArtifact1 remGuidArt : remEvent.getArtifacts()) {\n EventModType modType = EventModType.getType(remGuidArt.getModTypeGuid());\n if (modType == null) {\n OseeLog.logf(Activator.class, Level.WARNING, \"String_Node_Str\", remGuidArt);\n } else {\n if (modType == EventModType.Modified) {\n event.getArtifacts().add(getEventModifiedBasicGuidArtifact(modType, remGuidArt));\n } else if (modType == EventModType.ChangeType) {\n event.getArtifacts().add(getEventChangeTypeBasicGuidArtifact(modType, remGuidArt));\n } else {\n if (modType == EventModType.Modified) {\n event.getArtifacts().add(getEventModifiedBasicGuidArtifact(modType, remGuidArt));\n } else if (modType == EventModType.ChangeType) {\n event.getArtifacts().add(getEventChangeTypeBasicGuidArtifact(modType, remGuidArt));\n } else {\n event.getArtifacts().add(getEventBasicGuidArtifact(modType, remGuidArt));\n }\n }\n }\n for (RemoteBasicGuidRelation1 guidRel : remEvent.getRelations()) {\n EventBasicGuidRelation relEvent = getEventBasicGuidRelation(guidRel);\n if (relEvent == null) {\n OseeLog.logf(Activator.class, Level.WARNING, \"String_Node_Str\", guidRel);\n } else {\n event.getRelations().add(relEvent);\n }\n }\n for (RemoteBasicGuidRelationReorder1 guidReorder : remEvent.getRelationReorders()) {\n event.getRelationOrderRecords().add(getDefaultBasicGuidRelationReorder(guidReorder));\n }\n return event;\n } catch (OseeCoreException ex) {\n OseeLog.log(Activator.class, Level.SEVERE, \"String_Node_Str\", ex);\n }\n return null;\n}\n"
|
"boolean isPrototype(StringBuffer source) {\n String s = source.toString();\n if (s.matches(\"String_Node_Str\") || s.matches(\"String_Node_Str\") || s.matches(\"String_Node_Str\") || s.matches(\"String_Node_Str\") || s.matches(\"String_Node_Str\") || s.matches(\"String_Node_Str\") || s.matches(\"String_Node_Str\")) {\n return true;\n }\n if (s.matches(\"String_Node_Str\") || s.matches(\"String_Node_Str\") || s.matches(\"String_Node_Str\") || s.matches(\"String_Node_Str\") || s.matches(\"String_Node_Str\") || s.matches(\"String_Node_Str\") || s.matches(\"String_Node_Str\") || s.matches(\"String_Node_Str\") || s.matches(\"String_Node_Str\") || s.matches(\"String_Node_Str\") || s.matches(\"String_Node_Str\") || s.matches(\"String_Node_Str\") || s.matches(\"String_Node_Str\") || s.matches(\"String_Node_Str\") || s.matches(\"String_Node_Str\")) {\n int braceIndex = s.indexOf('{');\n int semicolonIndex = s.indexOf(';');\n if (braceIndex == -1) {\n return false;\n }\n if (semicolonIndex == -1) {\n return true;\n }\n return braceIndex < semicolonIndex;\n }\n return false;\n}\n"
|
"public static EObject resolveObject(EObject proxy) {\n if (proxy != null && proxy.eIsProxy()) {\n ResourceSet resourceSet = ProxyRepositoryFactory.getInstance().getRepositoryFactoryFromProvider().getResourceManager().resourceSet;\n proxy = (EObject) EcoreUtil.resolve(proxy, resourceSet);\n }\n return proxy;\n}\n"
|
"public boolean isCacheDisableSelective() {\n return getCaching() == null || getCaching().equals(\"String_Node_Str\");\n}\n"
|
"public void run() {\n monitorWrap = new EventLoopProgressMonitor(monitor);\n monitorWrap.beginTask(\"String_Node_Str\", IProgressMonitor.UNKNOWN);\n breakInfiniteLoop = false;\n while (true) {\n if (monitorWrap.isCanceled() || breakInfiniteLoop) {\n break;\n }\n }\n if (monitorWrap.isCanceled()) {\n source.stopPreviewProcess();\n } else {\n monitorWrap.done();\n }\n}\n"
|
"private void paused() {\n pauseMenu.getGraphics().drawImage(pauseBg, 0, 0, null);\n menu = new ListMenu(list, 80, 300, 370, 40, new Runnable() {\n public void run() {\n gameContinue();\n }\n });\n pauseMenu.add(menu);\n menu.display();\n}\n"
|
"public void checkManager(long userId, long managedUserId) throws SecurityException {\n checkManager(userId);\n if (!getUserPermissions(userId).contains(managedUserId)) {\n throw new SecurityException(\"String_Node_Str\");\n }\n}\n"
|
"public void removeSelectedBuddy() {\n removeBuddy(getSelectedFriend());\n}\n"
|
"private void setPathEntity(Location location) {\n LivingEntity ride = getRide();\n if (ride instanceof CraftCreature) {\n CraftCreature livingEntity = (CraftCreature) ride;\n if (hasNewAI()) {\n if (ride.getLocation().distanceSquared(location) > 64.0D) {\n Vector distance = new Vector(location.getX() - ride.getLocation().getX(), location.getY() - ride.getLocation().getY(), location.getZ() - ride.getLocation().getZ()).normalize().multiply(8);\n ((CraftLivingEntity) ride).getHandle().al().a(ride.getLocation().getX() + distance.getX(), ride.getLocation().getY() + distance.getY(), ride.getLocation().getZ() + distance.getZ(), getSpeed());\n } else {\n ((CraftLivingEntity) ride).getHandle().al().a(location.getX(), location.getY(), location.getZ(), getSpeed());\n }\n } else {\n ((CraftCreature) ride).getHandle().setPathEntity(new PathEntity(new PathPoint[] { new PathPoint(location.getBlockX(), location.getBlockY(), location.getBlockZ()) }));\n }\n }\n}\n"
|
"public boolean canSmelt() {\n ItemStack slot0 = getStackInSlot(0);\n if (slot0.isEmpty()) {\n return false;\n } else {\n ItemStack output = SteamingRegistry.getSteamingResult(slot0);\n if (output == null) {\n return false;\n }\n ItemStack slot2 = getStackInSlot(2);\n if (slot2 == null) {\n return true;\n }\n if (!slot2.isItemEqual(output)) {\n return false;\n }\n int result = slot2.getCount() + output.getCount();\n return result <= getInventoryStackLimit() && result <= slot2.getMaxStackSize();\n }\n}\n"
|
"private Collection<InterfaceDefinition> getInterfaces(final NetworkConfig networkConfig) throws UnknownHostException {\n final Map<String, String> addressDomainMap;\n final TcpIpConfig tcpIpConfig = networkConfig.getJoin().getTcpIpConfig();\n if (tcpIpConfig.isEnabled()) {\n addressDomainMap = new LinkedHashMap<String, String>();\n final Collection<String> possibleAddresses = TcpIpJoiner.getConfigurationMembers(node.config);\n for (String possibleAddress : possibleAddresses) {\n final String s = AddressUtil.getAddressHolder(possibleAddress).getAddress();\n if (AddressUtil.isIpAddress(s)) {\n if (!addressDomainMap.containsKey(s)) {\n addressDomainMap.put(s, null);\n }\n } else {\n try {\n final Collection<String> addresses = resolveDomainNames(s);\n for (String address : addresses) {\n addressDomainMap.put(address, s);\n }\n } catch (UnknownHostException e) {\n logger.warning(\"String_Node_Str\" + s + \"String_Node_Str\");\n }\n }\n }\n } else {\n addressDomainMap = Collections.emptyMap();\n }\n final Collection<InterfaceDefinition> interfaces = new HashSet<InterfaceDefinition>();\n if (networkConfig.getInterfaces().isEnabled()) {\n final Collection<String> configInterfaces = networkConfig.getInterfaces().getInterfaces();\n for (String configInterface : configInterfaces) {\n if (AddressUtil.isIpAddress(configInterface)) {\n String hostname = findHostnameMatchingInterface(addressDomainMap, configInterface);\n interfaces.add(new InterfaceDefinition(hostname, configInterface));\n } else {\n logger.info(\"String_Node_Str\" + configInterface + \"String_Node_Str\");\n }\n }\n log(Level.INFO, \"String_Node_Str\" + \"String_Node_Str\" + interfaces);\n } else if (tcpIpConfig.isEnabled()) {\n for (Entry<String, String> entry : addressDomainMap.entrySet()) {\n interfaces.add(new InterfaceDefinition(entry.getValue(), entry.getKey()));\n }\n log(Level.INFO, \"String_Node_Str\" + \"String_Node_Str\" + interfaces);\n }\n return interfaces;\n}\n"
|
"public void translate(Stack<GraphTargetItem> stack, List<GraphTargetItem> output, java.util.HashMap<Integer, String> regNames, HashMap<String, GraphTargetItem> variables, HashMap<String, GraphTargetItem> functions) {\n GraphTargetItem target = stack.pop();\n GraphTargetItem lockCenter = stack.pop();\n GraphTargetItem constrain = stack.pop();\n boolean hasConstrains = true;\n if (constrain instanceof DirectValueTreeItem) {\n if (Double.compare(constrain.toNumber(), 0) == 0) {\n hasConstrains = false;\n }\n }\n GraphTargetItem x1 = null;\n GraphTargetItem y1 = null;\n GraphTargetItem x2 = null;\n GraphTargetItem y2 = null;\n if (hasConstrains) {\n y2 = stack.pop();\n x2 = stack.pop();\n y1 = stack.pop();\n x1 = stack.pop();\n }\n output.add(new StartDragTreeItem(this, target, lockCenter, constrain, x1, y1, x2, y2));\n}\n"
|
"protected void updateSharesAndQuote() {\n if (hasSource())\n return;\n if (type == PortfolioTransaction.Type.SELL || type == PortfolioTransaction.Type.DELIVERY_OUTBOUND) {\n boolean hasPosition = false;\n if (portfolio != null) {\n CurrencyConverter converter = new CurrencyConverterImpl(getExchangeRateProviderFactory(), CurrencyUnit.EUR);\n PortfolioSnapshot snapshot = PortfolioSnapshot.create(portfolio, converter, date);\n SecurityPosition position = snapshot.getPositionsBySecurity().get(security);\n if (position != null) {\n setShares(position.getShares());\n setTotal(position.calculateValue().getAmount());\n hasPosition = true;\n }\n }\n if (!hasPosition) {\n setShares(0);\n setQuote(BigDecimal.valueOf(security.getSecurityPrice(date).getValue() / Values.Quote.divider()));\n }\n } else {\n setQuote(new BigDecimal(security.getSecurityPrice(date).getValue() / Values.Quote.divider()));\n }\n}\n"
|
"public void createWithReject() {\n Assume.assumeTrue(ActivitiDetector.isActivitiEnabledForUsers());\n UserTO userTO = getUniqueSampleTO(\"String_Node_Str\");\n MembershipTO membershipTO = new MembershipTO();\n membershipTO.setRoleId(9L);\n userTO.addMembership(membershipTO);\n userTO = createUser(userTO);\n assertNotNull(userTO);\n assertEquals(1, userTO.getMemberships().size());\n assertEquals(9, userTO.getMemberships().get(0).getRoleId());\n assertEquals(\"String_Node_Str\", userTO.getStatus());\n WorkflowFormTO form = userService.getFormForUser(userTO.getId());\n assertNotNull(form);\n assertNotNull(form.getTaskId());\n assertNull(form.getOwner());\n UserService userService2 = setupCredentials(userService, UserService.class, \"String_Node_Str\", ADMIN_PWD);\n try {\n userService2.claimForm(form.getTaskId());\n fail();\n } catch (SyncopeClientCompositeErrorException scce) {\n assertNotNull(scce.getException(SyncopeClientExceptionType.Workflow));\n }\n UserService userService3 = setupCredentials(userService, \"String_Node_Str\", ADMIN_PWD);\n form = userService3.claimForm(form.getTaskId());\n assertNotNull(form);\n assertNotNull(form.getTaskId());\n assertNotNull(form.getOwner());\n Map<String, WorkflowFormPropertyTO> props = form.getPropertyMap();\n props.get(\"String_Node_Str\").setValue(Boolean.FALSE.toString());\n props.get(\"String_Node_Str\").setValue(\"String_Node_Str\");\n form.setProperties(props.values());\n userTO = userService3.submitForm(form);\n assertNotNull(userTO);\n assertEquals(\"String_Node_Str\", userTO.getStatus());\n super.resetRestTemplate();\n}\n"
|
"protected Class loadClass(String name, boolean resolve) throws ClassFormatError, ClassNotFoundException {\n name = name.intern();\n synchronized (name) {\n Class c = findLoadedClass(name);\n if (c == null)\n c = loadClassByDelegation(name);\n if (c == null)\n c = findClass(name);\n if (c == null)\n c = delegateToParent(name);\n if (resolve)\n resolveClass(c);\n return c;\n }\n}\n"
|
"public static void registerName(String classDesc, String methodName, String methodDesc, String name) {\n if (\"String_Node_Str\".equals(name)) {\n return;\n }\n Map<String, String[]> methodsToParameters = classesToMethodsToParameters.get(classDesc);\n if (methodsToParameters == null) {\n methodsToParameters = new HashMap<String, String[]>();\n classesToMethodsToParameters.put(classDesc, methodsToParameters);\n }\n String methodKey = memberName + memberDesc;\n String[] parameterNames = methodsToParameters.get(methodKey);\n if (parameterNames == null) {\n int numParameters = Type.getArgumentTypes(methodDesc).length;\n parameterNames = numParameters == 0 ? NO_PARAMETERS : new String[numParameters];\n methodsToParameters.put(methodKey, parameterNames);\n }\n for (int i = 0, n = parameterNames.length; i < n; i++) {\n if (parameterNames[i] == null) {\n parameterNames[i] = name;\n break;\n }\n }\n}\n"
|
"public static void setItemInHand(Player player, HumanNPC npc, String material) {\n Material mat = StringUtils.parseMaterial(material);\n if (mat == null) {\n player.sendMessage(ChatColor.RED + \"String_Node_Str\");\n return;\n }\n if (mat != Material.AIR && !player.getInventory().contains(mat)) {\n player.sendMessage(ChatColor.RED + \"String_Node_Str\");\n return;\n }\n if (npc.isType(\"String_Node_Str\")) {\n player.sendMessage(ChatColor.GRAY + \"String_Node_Str\");\n return;\n }\n int slot = player.getInventory().first(mat);\n ItemStack item = decreaseItemStack(player.getInventory().getItem(slot));\n player.getInventory().setItem(slot, item);\n ArrayList<Integer> items = npc.getNPCData().getItems();\n int olditem = items.get(0);\n items.set(0, mat.getId());\n npc.getNPCData().setItems(items);\n if (mat != null && mat != Material.AIR) {\n npc.getInventory().setItem(0, new ItemStack(mat, 1));\n } else {\n npc.getInventory().setItem(0, null);\n }\n NPCDataManager.addItems(npc, items);\n if ((olditem != 0 && items.get(0) == 0)) {\n NPCManager.removeForRespawn(npc.getUID());\n NPCManager.register(npc.getUID(), npc.getOwner());\n }\n player.sendMessage(StringUtils.wrap(npc.getName()) + \"String_Node_Str\" + StringUtils.wrap(MessageUtils.getMaterialName(mat.getId())) + \"String_Node_Str\");\n}\n"
|
"public void renderPlot(IPrimitiveRenderer ipr, Plot p) throws ChartException {\n if (!p.isVisible()) {\n return;\n }\n final boolean bFirstInSequence = (iSeriesIndex == 0);\n final boolean bLastInSequence = (iSeriesIndex == iSeriesCount - 1);\n final PlotWithAxes pwa = (PlotWithAxes) getComputations();\n if (bFirstInSequence) {\n renderBackground(ipr, p);\n renderAxesStructure(ipr, p);\n }\n if (getSeries() != null || ChartUtil.isDataEmpty(rtc)) {\n ScriptHandler.callFunction(getRunTimeContext().getScriptHandler(), ScriptHandler.BEFORE_DRAW_SERIES, getSeries(), this, getRunTimeContext().getScriptContext());\n getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.BEFORE_DRAW_SERIES, getSeries());\n if (p.getClientArea().isVisible()) {\n renderSeries(ipr, p, srh);\n }\n ScriptHandler.callFunction(getRunTimeContext().getScriptHandler(), ScriptHandler.AFTER_DRAW_SERIES, getSeries(), this, getRunTimeContext().getScriptContext());\n getRunTimeContext().notifyStructureChange(IStructureDefinitionListener.AFTER_DRAW_SERIES, getSeries());\n renderAxesDecoration(ipr, srh);\n }\n if (bLastInSequence) {\n final Location panningOffset = getPanningOffset();\n try {\n if (isDimension3D()) {\n fDeferredCacheManager.process3DEvent(null, get3DEngine(), panningOffset.getX(), panningOffset.getY());\n }\n fDeferredCacheManager.flushAll();\n } catch (ChartException ex) {\n throw new ChartException(ChartEnginePlugin.ID, ChartException.RENDERING, ex);\n }\n final AllAxes aax = pwa.getAxes();\n final OneAxis[] oaxa = new OneAxis[2 + aax.getOverlayCount() + (aax.getAncillaryBase() != null ? 1 : 0)];\n oaxa[0] = aax.getPrimaryBase();\n oaxa[1] = aax.getPrimaryOrthogonal();\n for (int i = 0; i < aax.getOverlayCount(); i++) {\n oaxa[2 + i] = aax.getOverlay(i);\n }\n if (aax.getAncillaryBase() != null) {\n oaxa[2 + aax.getOverlayCount()] = aax.getAncillaryBase();\n }\n renderAxesLabels(ipr, p, oaxa);\n try {\n if (isDimension3D()) {\n getDeferredCache().process3DEvent(get3DEngine(), panningOffset.getX(), panningOffset.getY());\n }\n getDeferredCache().flush();\n } catch (ChartException ex) {\n throw new ChartException(ChartEnginePlugin.ID, ChartException.RENDERING, ex);\n }\n }\n}\n"
|
"public net.minecraft.server.Chunk getHandle() {\n net.minecraft.server.Chunk c = weakChunk.get();\n if (c == null) {\n c = worldServer.c(x, z);\n weakChunk = new WeakReference<net.minecraft.server.Chunk>(c);\n }\n return c;\n}\n"
|
"public void selectionChanged(IWorkbenchPart part, ISelection selection) {\n if (SessionHandleAdapter.getInstance().getReportDesignHandle() != null) {\n if (part != null && !ReportPlugin.getDefault().containIgnoreViewID(part.getSite().getId())) {\n handleSelectionChanged(new StructuredSelection());\n }\n }\n}\n"
|
"public void setOfStrings() {\n SetSchema setSchema = deserialize(\"String_Node_Str\", SetSchema.class);\n Set<String> stringSet = setSchema.strings();\n assertEquals(3, stringSet.size());\n assertTrue(stringSet.contains(\"String_Node_Str\"));\n assertTrue(stringSet.contains(\"String_Node_Str\"));\n assertTrue(stringSet.contains(\"String_Node_Str\"));\n}\n"
|
"private void pasteValue(CellBuffer buffer, NCell destCell, boolean pasteFormula, int rowOffset, int columnOffset, boolean transpose, int rowOrigin, int columnOrigin) {\n if (pasteFormula) {\n String formula = buffer.getFormula();\n if (formula != null) {\n FormulaEngine engine = getFormulaEignin();\n FormulaExpression expr = engine.shift(formula, rowOffset, columnOffset, new FormulaParseContext(destSheet, null));\n if (!expr.hasError() && transpose) {\n expr = engine.transpose(expr.getFormulaString(), rowOrigin, columnOrigin, new FormulaParseContext(destSheet, null));\n }\n if (!expr.hasError()) {\n destCell.setFormulaValue(expr.getFormulaString());\n }\n return;\n }\n }\n destCell.setValue(buffer.getValue());\n}\n"
|
"private void grantUriPermissionLocked(int callingUid, String targetPkg, Uri uri, int modeFlags, HistoryRecord activity) {\n modeFlags &= (Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);\n if (modeFlags == 0) {\n return;\n }\n final IPackageManager pm = ActivityThread.getPackageManager();\n if (!ContentResolver.SCHEME_CONTENT.equals(uri.getScheme())) {\n return;\n }\n String name = uri.getAuthority();\n ProviderInfo pi = null;\n ContentProviderRecord cpr = (ContentProviderRecord) mProvidersByName.get(name);\n if (cpr != null) {\n pi = cpr.info;\n } else {\n try {\n pi = pm.resolveContentProvider(name, PackageManager.GET_URI_PERMISSION_PATTERNS);\n } catch (RemoteException ex) {\n }\n }\n if (pi == null) {\n Log.w(TAG, \"String_Node_Str\" + name);\n return;\n }\n int targetUid;\n try {\n targetUid = pm.getPackageUid(targetPkg);\n if (targetUid < 0) {\n return;\n }\n } catch (RemoteException ex) {\n return;\n }\n if (checkHoldingPermissionsLocked(pm, pi, targetUid, modeFlags)) {\n if (DEBUG_URI_PERMISSION)\n Log.v(TAG, \"String_Node_Str\" + targetPkg + \"String_Node_Str\" + uri);\n return;\n }\n if (!pi.grantUriPermissions) {\n throw new SecurityException(\"String_Node_Str\" + pi.packageName + \"String_Node_Str\" + pi.name + \"String_Node_Str\" + uri + \"String_Node_Str\");\n }\n if (pi.uriPermissionPatterns != null) {\n final int N = pi.uriPermissionPatterns.length;\n boolean allowed = false;\n for (int i = 0; i < N; i++) {\n if (pi.uriPermissionPatterns[i] != null && pi.uriPermissionPatterns[i].match(uri.getPath())) {\n allowed = true;\n break;\n }\n }\n if (!allowed) {\n throw new SecurityException(\"String_Node_Str\" + pi.packageName + \"String_Node_Str\" + pi.name + \"String_Node_Str\" + uri);\n }\n }\n if (!checkHoldingPermissionsLocked(pm, pi, callingUid, modeFlags)) {\n if (!checkUriPermissionLocked(uri, callingUid, modeFlags)) {\n throw new SecurityException(\"String_Node_Str\" + callingUid + \"String_Node_Str\" + uri);\n }\n }\n HashMap<Uri, UriPermission> targetUris = mGrantedUriPermissions.get(targetUid);\n if (targetUris == null) {\n targetUris = new HashMap<Uri, UriPermission>();\n mGrantedUriPermissions.put(targetUid, targetUris);\n }\n UriPermission perm = targetUris.get(uri);\n if (perm == null) {\n perm = new UriPermission(targetUid, uri);\n targetUris.put(uri, perm);\n }\n perm.modeFlags |= modeFlags;\n if (activity == null) {\n perm.globalModeFlags |= modeFlags;\n } else if ((modeFlags & Intent.FLAG_GRANT_READ_URI_PERMISSION) != 0) {\n perm.readActivities.add(activity);\n if (activity.readUriPermissions == null) {\n activity.readUriPermissions = new HashSet<UriPermission>();\n }\n activity.readUriPermissions.add(perm);\n } else if ((modeFlags & Intent.FLAG_GRANT_WRITE_URI_PERMISSION) != 0) {\n perm.writeActivities.add(activity);\n if (activity.writeUriPermissions == null) {\n activity.writeUriPermissions = new HashSet<UriPermission>();\n }\n activity.writeUriPermissions.add(perm);\n }\n}\n"
|
"public File loadFile() throws IOException {\n return topFS.loadFile(fullPath);\n}\n"
|
"public static String[] stringToArray(final String data, final String delim) {\n if (data == null) {\n return new String[0];\n }\n return tokens;\n}\n"
|
"private double calculateAmount(Reward reward) {\n LoggerUtil.getInstance().debug(\"String_Node_Str\" + reward.getCoin());\n LoggerUtil.getInstance().debug(\"String_Node_Str\" + reward.getGain());\n double amount = reward.getCoin() * reward.getGain();\n LoggerUtil.getInstance().debug(\"String_Node_Str\" + amount);\n if (reward.getParty().size() > 1) {\n amount /= reward.getParty().size();\n LoggerUtil.getInstance().debug(\"String_Node_Str\" + amount);\n }\n if (reward.isIntegerCurrency()) {\n amount = round(amount, 0, BigDecimal.ROUND_HALF_UP);\n LoggerUtil.getInstance().debug(\"String_Node_Str\" + amount);\n } else {\n amount = round(amount, 2, BigDecimal.ROUND_HALF_UP);\n LoggerUtil.getInstance().debug(\"String_Node_Str\" + amount);\n }\n return amount;\n}\n"
|
"protected void performSaveAs(IProgressMonitor progressMonitor) {\n Shell shell = getSite().getShell();\n final IEditorInput input = getEditorInput();\n IDocumentProvider provider = getDocumentProvider();\n IEditorInput newInput;\n if (input instanceof IURIEditorInput && !(input instanceof IFileEditorInput)) {\n super.performSaveAs(progressMonitor);\n return;\n }\n IProject rootProject = ReponsitoryContextBridge.getRootProject();\n final IFolder defaultValidFolder = rootProject.getFolder(\"String_Node_Str\").getFolder(\"String_Node_Str\");\n ILabelProvider lp = new WorkbenchLabelProvider();\n ITreeContentProvider cp = new WorkbenchContentProvider();\n FolderSelectionDialog dialog = new FolderSelectionDialog(shell, lp, cp);\n dialog.setTitle(\"String_Node_Str\");\n dialog.setMessage(\"String_Node_Str\");\n dialog.setInput(rootProject);\n dialog.addFilter(new ViewerFilter() {\n public boolean select(Viewer viewer, Object parentElement, Object element) {\n if (element instanceof IFolder) {\n IFolder folder = (IFolder) element;\n if (\"String_Node_Str\".equals(folder.getName()) || \"String_Node_Str\".equals(folder.getName())) {\n return true;\n } else {\n return defaultValidFolder.getFullPath().isPrefixOf(folder.getFullPath()) && !folder.getName().endsWith(SVN_FOLDER_NAME);\n }\n }\n return false;\n }\n });\n dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));\n if (dialog.open() == Window.CANCEL) {\n if (progressMonitor != null)\n progressMonitor.setCanceled(true);\n return;\n }\n Object elements = dialog.getResult()[0];\n String fileName = getValidFileName(dialog.getFileName());\n IResource elem = (IResource) elements;\n if (elem instanceof IFolder) {\n IPath filePath = ((IFolder) elem).getFullPath();\n filePath = filePath.append(fileName);\n if (filePath == null) {\n if (progressMonitor != null)\n progressMonitor.setCanceled(true);\n return;\n }\n IWorkspace workspace = ResourcesPlugin.getWorkspace();\n IFile file = workspace.getRoot().getFile(filePath);\n while (fileExist(file)) {\n InputDialog inputDialog = new InputDialog(getSite().getShell(), \"String_Node_Str\", \"String_Node_Str\", filePath.lastSegment(), null);\n if (inputDialog.open() == InputDialog.CANCEL) {\n return;\n } else {\n IPath lseg = filePath.removeLastSegments(1);\n IPath append = lseg.append(inputDialog.getValue());\n file = workspace.getRoot().getFile(append);\n }\n }\n newInput = new FileEditorInput(file);\n if (provider == null) {\n return;\n }\n boolean success = false;\n try {\n provider.aboutToChange(newInput);\n file = createIFile(file, getViewer().getDocument().get());\n newInput = new FileEditorInput(file);\n success = true;\n } catch (CoreException x) {\n final IStatus status = x.getStatus();\n if (status == null || status.getSeverity() != IStatus.CANCEL) {\n String title = \"String_Node_Str\";\n String msg = \"String_Node_Str\";\n MessageDialog.openError(shell, title, msg);\n }\n } finally {\n provider.changed(newInput);\n if (success)\n setInput(newInput);\n }\n if (progressMonitor != null)\n progressMonitor.setCanceled(!success);\n }\n}\n"
|
"public void createCatalog(ClusterName targetCluster, CatalogMetadata catalogMetadata) throws UnsupportedException, ExecutionException {\n session = sessions.get(targetCluster.getName());\n String catalogName = catalogMetadata.getName().getQualifiedName();\n Map<Selector, Selector> catalogOptions = catalogMetadata.getOptions();\n String stringOptions = getStringOptions(catalogOptions);\n CreateCatalogStatement catalogStatement = new CreateCatalogStatement(catalogName, true, stringOptions);\n Result result = CassandraExecutor.execute(catalogStatement.toString(), session);\n if (result.hasError()) {\n ErrorResult error = (ErrorResult) result;\n getTypeErrorException(error);\n }\n}\n"
|
"private void fillChengWeights() {\n for (Bookmark data : trainList) {\n int user = data.getUserID();\n int resource = data.getResourceID();\n List<Integer> tags = data.getTags();\n Map<Integer, Double> tagUserWeights = null;\n if (user >= userTagWeights.size()) {\n tagUserWeights = new LinkedHashMap<Integer, Double>();\n userTagWeights.add(tagUserWeights);\n } else {\n tagUserWeights = userTagWeights.get(user);\n }\n Map<Integer, Double> tagResourceWeights = resourceTagWeights.get(resource);\n if (tagResourceWeights == null) {\n tagResourceWeights = new HashMap<Integer, Double>();\n }\n for (Integer tag : tags) {\n if (!tagUserWeights.containsKey(tag)) {\n tagUserWeights.put(tag, huangApproach.getUserTagWeight(user, tag));\n }\n if (!tagResourceWeights.containsKey(tag)) {\n tagResourceWeights.put(tag, huangApproach.getItemTagWeight(resource, tag));\n }\n }\n resourceTagWeights.put(resource, tagResourceWeights);\n }\n}\n"
|
"public static String readPassword(final CommandSession session, final String pwdPrintStr) throws Exception {\n session.getConsole().println(pwdPrintStr);\n try (BufferedReader bReader = new BufferedReader(new InputStreamReader(session.getKeyboard(), StandardCharsets.UTF_8))) {\n return bReader.readLine();\n }\n}\n"
|
"public Receiver newReceiver() {\n ODReceiver rcvr = new ODReceiver();\n rcvr.setCompletionTime(_completionTime);\n System.out.println(\"String_Node_Str\" + _completionTime);\n return rcvr;\n}\n"
|
"public void onDraw(Canvas canvas) {\n if (m_hasImage && null == m_image) {\n return;\n }\n float verticalPosition = drawBase(canvas);\n verticalPosition = drawBitmap(canvas, verticalPosition);\n if (null != m_item.m_desLines && 0 != m_item.m_desLines.length && null != m_item.m_desLines[0]) {\n if (hasImage) {\n verticalPosition += Utilities.getDp(4.0F);\n }\n drawDes(canvas, verticalPosition);\n }\n}\n"
|
"public void testExtractDisplayId12() {\n String extractedDisplayId = extractDisplayId(uri8);\n assertNull(extractedDisplayId);\n}\n"
|
"public void execute() {\n propagateInput();\n if (!oldMetaDataList.isEmpty() && !newMetaDataList.isEmpty() && !oldMetaDataList.get(0).sameMetadataAs(newMetaDataList.get(0))) {\n node.setPropertyValue(EParameterName.SCHEMA_TYPE.getName(), EmfComponent.BUILTIN);\n }\n metadataOutputChanges.clear();\n List<IConnection> initTraceList = new ArrayList<IConnection>();\n for (IConnection connection : node.getOutgoingConnections()) {\n if (connection.getLineStyle().hasConnectionCategory(IConnectionCategory.DATA)) {\n IODataComponent dataComponent = inAndOut.getDataComponent(connection);\n if (!connection.getMetadataTable().sameMetadataAs(dataComponent.getTable())) {\n IMetadataTable table = connection.getMetadataTable();\n if (table == null || table.getListColumns().isEmpty()) {\n initTraceList.add(connection);\n }\n INode connTar = connection.getTarget();\n boolean openDialog = false;\n Map<String, Boolean> jobletMap = new HashMap<String, Boolean>();\n if (isForTemlate()) {\n openDialog = true;\n } else {\n openDialog = getPropagate(connection, jobletMap);\n }\n if (openDialog) {\n IElementParameter schemaParam = null;\n if (connection != null) {\n IMetadataTable connTable = connection.getMetadataTable();\n IMetadataTable dataTable = dataComponent.getTable();\n for (IElementParameter param : ((Node) connection.getTarget()).getElementParameters()) {\n if (param.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE) && dataTable.getAttachedConnector().equals(connection.getConnectorName())) {\n schemaParam = param;\n break;\n }\n }\n if (schemaParam != null) {\n ChangeMetadataCommand cmd = new ChangeMetadataCommand(connection.getTarget(), schemaParam, connTable, dataTable);\n cmd.execute(true);\n metadataOutputChanges.add(cmd);\n }\n for (IElementParameter param : ((Node) connection.getSource()).getElementParameters()) {\n if (param.getFieldType().equals(EParameterFieldType.SCHEMA_TYPE) && param.getContext().equals(connection.getConnectorName())) {\n schemaParam = param;\n break;\n }\n }\n if (schemaParam != null) {\n ChangeMetadataCommand cmd = new ChangeMetadataCommand(connection.getSource(), schemaParam, connTable, dataTable);\n cmd.execute(true);\n metadataOutputChanges.add(cmd);\n }\n if (((Node) connTar).isJoblet()) {\n IElementParameter param = connTar.getElementParameter(connection.getTarget().getUniqueName());\n if (param != null) {\n IMetadataTable originaleOutputTable = connTar.getMetadataFromConnector(param.getContext());\n if (originaleOutputTable != null) {\n MetadataToolHelper.copyTable(dataTable, originaleOutputTable);\n }\n }\n } else if (((Node) connTar).getJobletNode() != null) {\n IElementParameter param = ((Node) connTar).getJobletNode().getElementParameter(connection.getTarget().getUniqueName());\n if (param != null) {\n IMetadataTable originaleOutputTable = ((Node) connTar).getJobletNode().getMetadataFromConnector(param.getContext());\n if (originaleOutputTable != null) {\n MetadataToolHelper.copyTable(dataTable, originaleOutputTable);\n }\n }\n }\n }\n if (((Node) connTar).isJoblet()) {\n changeCollapsedState(true, jobletMap, connTar);\n }\n } else {\n final Node target = (Node) connection.getTarget();\n if (target != null && target.getExternalNode() != null) {\n if (GlobalServiceRegister.getDefault().isServiceRegistered(IXmlMapService.class)) {\n final IXmlMapService service = (IXmlMapService) GlobalServiceRegister.getDefault().getService(IXmlMapService.class);\n if (service.isXmlMapComponent(target.getExternalNode())) {\n IODataComponent output = new IODataComponent(connection, dataComponent.getTable());\n target.metadataInputChanged(output, connection.getUniqueName());\n }\n }\n }\n }\n }\n if (connection instanceof Connection) {\n ((Connection) connection).updateName();\n }\n }\n }\n node.setExternalData(newExternalData);\n List<IMetadataTable> cloneNewMetadata = new ArrayList<IMetadataTable>();\n if (newMetaDataList != null) {\n for (IMetadataTable t : newMetaDataList) {\n cloneNewMetadata.add(t.clone(true));\n }\n }\n node.setMetadataList(cloneNewMetadata);\n for (IConnection conn : initTraceList) {\n if (conn instanceof Connection) {\n ((Connection) conn).initTraceParamters();\n }\n }\n for (Connection connection : connectionsToDelete.keySet()) {\n connection.disconnect();\n INode prevNode = connection.getSource();\n INodeConnector nodeConnectorSource, nodeConnectorTarget;\n nodeConnectorSource = prevNode.getConnectorFromType(connection.getLineStyle());\n nodeConnectorSource.setCurLinkNbOutput(nodeConnectorSource.getCurLinkNbOutput() - 1);\n INode nextNode = connection.getTarget();\n nodeConnectorTarget = nextNode.getConnectorFromType(connection.getLineStyle());\n nodeConnectorTarget.setCurLinkNbInput(nodeConnectorTarget.getCurLinkNbInput() - 1);\n inAndOut.getOuputs().remove(connectionsToDelete.get(connection));\n }\n ((Process) node.getProcess()).checkProcess();\n if (!isMetaLanguage) {\n refreshCodeView();\n ComponentSettings.switchToCurComponentSettingsView();\n }\n}\n"
|
"private static void tryExtractDiskImage(Object rspecSliverObject, Resource omnSliver) throws MissingRspecElementException {\n if (rspecSliverObject instanceof JAXBElement) {\n if (((JAXBElement<?>) rspecSliverObject).getDeclaredType().equals(DiskImageContents.class)) {\n DiskImageContents diskImageContents = (DiskImageContents) ((JAXBElement<?>) rspecSliverObject).getValue();\n String diskImageURL = diskImageContents.getUrl();\n Resource diskImage = omnSliver.getModel().createResource(diskImageURL);\n diskImage.addProperty(RDF.type, Omn_domain_pc.DiskImage);\n String name = diskImageContents.getName();\n if (name == null) {\n throw new MissingRspecElementException(\"String_Node_Str\");\n }\n diskImage.addLiteral(Omn_domain_pc.hasDiskimageLabel, name);\n String os = diskImageContents.getOs();\n if (os != null) {\n diskImage.addLiteral(Omn_domain_pc.hasDiskimageOS, os);\n }\n String version = diskImageContents.getVersion();\n if (version != null) {\n diskImage.addLiteral(Omn_domain_pc.hasDiskimageVersion, version);\n }\n String url = diskImageContents.getUrl();\n if (url != null) {\n diskImage.addLiteral(Omn_domain_pc.hasDiskimageURI, url);\n }\n String description = diskImageContents.getDescription();\n if (description != null) {\n diskImage.addLiteral(Omn_domain_pc.hasDiskimageDescription, description);\n }\n boolean alreadyExists = false;\n if (omnSliver.hasProperty(Omn_domain_pc.hasDiskImage)) {\n StmtIterator diskImages = omnSliver.listProperties(Omn_domain_pc.hasDiskImage);\n while (diskImages.hasNext()) {\n Statement diskImageStatement = diskImages.next();\n Resource diskImageResource = diskImageStatement.getObject().asResource();\n if (diskImageResource.hasProperty(Omn_domain_pc.hasDiskimageLabel)) {\n String diskImageLabel = diskImageResource.getProperty(Omn_domain_pc.hasDiskimageLabel).getObject().asLiteral().getString();\n if (diskImageLabel.equals(name)) {\n alreadyExists = true;\n }\n }\n }\n }\n }\n if (!alreadyExists) {\n omnSliver.addProperty(Omn_domain_pc.hasDiskImage, diskImage);\n }\n } catch (final ClassCastException e) {\n RequestConverter.LOG.finer(e.getMessage());\n } catch (final InvalidPropertyURIException e) {\n RequestConverter.LOG.info(e.getMessage());\n }\n}\n"
|
"private void triggerAfterHostChildAdded(Component child) {\n List<ShadowElement> shadowRoots = getShadowRoots();\n if (!shadowRoots.isEmpty()) {\n try {\n initIndexCacheMap();\n final int indexOf = getChildren().indexOf(child);\n for (ShadowElement se : new LinkedList<ShadowElement>(shadowRoots)) {\n if (se instanceof ShadowElementCtrl) {\n ((ShadowElementCtrl) se).afterHostChildAdded(child, indexOf);\n }\n }\n } finally {\n destroyIndexCacheMap();\n }\n }\n}\n"
|
"PathInfo<T> get(String path) {\n char[] cs = path.toLowerCase().toCharArray();\n PathNode<T> wild = null;\n PathNode<T> node = this;\n int i = 0;\n for (; i < cs.length; i++) {\n if (node.isStar) {\n wild = node;\n }\n char c = cs[i];\n if (null == node.chars)\n break;\n int index = Arrays.binarySearch(node.chars, c);\n if (index < 0)\n break;\n node = node.children[index];\n }\n if (i == cs.length) {\n return new PathInfo<T>(-1, path, node.obj);\n } else if (null != wild && wild.isStar)\n return new PathInfo<T>(i, path.substring(i), wild.obj);\n return new PathInfo<T>(0, path, null);\n}\n"
|
"public Sink createInstance() {\n return new Panels(images);\n}\n"
|
"public void releaseCacheManager(URI uri, ClassLoader classLoader) {\n final URI managerURI = getManagerUri(uri);\n final ClassLoader managerClassLoader = getManagerClassLoader(classLoader);\n ConcurrentMap<URI, CacheManager> cacheManagersByURI = cacheManagers.get(managerClassLoader);\n if (cacheManagersByURI != null) {\n cacheManagersByURI.remove(managerURI);\n if (cacheManagersByURI.size() == 0) {\n cacheManagers.remove(managerClassLoader);\n }\n }\n}\n"
|
"private String getContents(IClassFile cf) {\n String source = null;\n if (cf != null) {\n try {\n IBuffer buffer = cf.getBuffer();\n if (buffer != null) {\n source = buffer.getContents();\n }\n if (source == null) {\n source = disassemble(cf);\n }\n } catch (JavaModelException e) {\n logger.log(Level.SEVERE, String.format(\"String_Node_Str\", e.toString()), e);\n }\n if (source == null) {\n source = \"String_Node_Str\";\n }\n }\n return source;\n}\n"
|
"public static void main(String[] args) throws FileNotFoundException, MalformedURLException {\n int i = 0;\n String doc = null;\n String jar = null;\n boolean tangTests = false;\n while (i < args.length) {\n if (args[i].equals(\"String_Node_Str\")) {\n i++;\n doc = args[i];\n } else if (args[i].equals(\"String_Node_Str\")) {\n i++;\n jar = args[i];\n } else if (args[i].equals(\"String_Node_Str\")) {\n tangTests = true;\n }\n i++;\n }\n final Tint t;\n if (jar != null) {\n File f = new File(jar);\n if (!f.exists()) {\n throw new FileNotFoundException(jar);\n }\n t = new Tint(new URL[] { f.toURI().toURL() }, tangTests);\n } else {\n t = new Tint(new URL[0], tangTests);\n }\n if (doc != null) {\n PrintStream out = new PrintStream(new FileOutputStream(new File(doc)));\n out.println(\"String_Node_Str\");\n out.println(\"String_Node_Str\");\n String currentPackage = \"String_Node_Str\";\n for (Node n : t.getNamesUsedAndSet()) {\n String fullName = n.getFullName();\n String[] tok = fullName.split(\"String_Node_Str\");\n StringBuffer sb = new StringBuffer(tok[0]);\n for (int j = 1; j < tok.length; j++) {\n if (tok[j].matches(\"String_Node_Str\") || j > 4) {\n break;\n } else\n sb.append(\"String_Node_Str\" + tok[j]);\n }\n String pack = sb.toString();\n if (!currentPackage.equals(pack)) {\n currentPackage = pack;\n out.println(t.endPackage());\n out.println(t.startPackage(currentPackage));\n }\n out.println(t.toHtmlString(n, currentPackage));\n }\n out.println(t.endPackage());\n out.println(\"String_Node_Str\");\n out.println(\"String_Node_Str\");\n for (Field f : t.modules.keySet()) {\n String moduleName = ReflectionUtilities.getFullName(f);\n String declaringClassName = ReflectionUtilities.getFullName(f.getDeclaringClass());\n out.println(\"String_Node_Str\" + moduleName + \"String_Node_Str\");\n out.println(\"String_Node_Str\");\n out.println(t.modules.get(f).toPrettyString());\n out.println(\"String_Node_Str\");\n }\n out.println(\"String_Node_Str\");\n for (String s : t.usages.keySet()) {\n out.println(\"String_Node_Str\" + s + \"String_Node_Str\");\n for (Node n : t.usages.getValuesForKey(s)) {\n out.println(\"String_Node_Str\" + n.getFullName() + \"String_Node_Str\");\n }\n }\n out.println(\"String_Node_Str\");\n out.close();\n }\n}\n"
|
"public void sendChunks(int viewDistance) {\n int centX = ((int) Math.floor(loc.getX())) >> 4;\n int centZ = ((int) Math.floor(loc.getZ())) >> 4;\n PacketPlayOutMapChunkBulk bulk = new PacketPlayOutMapChunkBulk();\n int length = 0;\n for (int x = (centX - viewDistance / 2); x <= (centX + viewDistance / 2); x += 1) {\n for (int z = (centZ - viewDistance / 2); z <= (centZ + viewDistance / 2); z += 1) {\n ChunkLocation location = ChunkLocation.create(x, z);\n if (knownChunks.contains(location))\n continue;\n PacketPlayOutChunkData data = ((TridentChunk) world().chunkAt(x, z, true)).asPacket();\n length += (10 + data.getData().length);\n bulk.addEntry(data);\n knownChunks.add(location);\n if (length >= 0x1DAE40) {\n connection.sendPacket(bulk);\n bulk = new PacketPlayOutMapChunkBulk();\n length = 0;\n }\n }\n }\n connection.sendPacket(bulk);\n}\n"
|
"private void createLicenseContentSection(Composite parent) {\n Composite composite = new Composite(parent, SWT.NONE);\n GridLayout layout = new GridLayout();\n layout.marginWidth = 0;\n layout.marginHeight = 0;\n composite.setLayout(layout);\n GridData gd = new GridData(GridData.FILL_BOTH);\n composite.setLayoutData(gd);\n Label label = new Label(composite, SWT.NONE);\n label.setText(Messages.getString(\"String_Node_Str\"));\n if (TalendPropertiesUtil.isEnabledUseBrowser()) {\n licenseTextBox = new Browser(composite, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.READ_ONLY);\n licenseTextBox.setBackground(licenseTextBox.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));\n initializeDialogUnits(licenseTextBox);\n gd = new GridData(SWT.FILL, SWT.FILL, true, true);\n licenseTextBox.setLayoutData(gd);\n } else {\n licenseText = new Text(composite, SWT.MULTI | SWT.BORDER | SWT.READ_ONLY | SWT.V_SCROLL | SWT.H_SCROLL);\n initializeDialogUnits(licenseText);\n licenseText.setLayoutData(new GridData(GridData.FILL_BOTH));\n }\n createLicenseAcceptSection(composite);\n setControl(composite);\n}\n"
|
"public boolean postfire() throws IllegalActionException {\n if (!((((CompositeActor) getContainer()).inputPortList()).isEmpty()) && _getActiveActorsCount() != 0) {\n System.out.println(\"String_Node_Str\" + _notDone);\n return _notDone;\n } else {\n return false;\n }\n}\n"
|
"public void appendExtensionSourceCode_A$StringBuilder$String_StringIsNull() throws Exception {\n StringBuilder buf = new StringBuilder();\n String code = null;\n DefaultGeneratorUtil.appendExtensionSourceCode(buf, code);\n}\n"
|
"public IContentProposal[] getProposals(String contents, int position) {\n List<IComponent> relatedComponent = TalendEditorPaletteFactory.getRelatedComponents(componentsFactory, contents);\n if (componentAssistant != null) {\n relatedComponent = componentAssistant.filterComponents(relatedComponent);\n }\n ArrayList<IContentProposal> list = new ArrayList<IContentProposal>();\n for (String proposal : proposals) {\n if (proposal == null) {\n continue;\n }\n String tmp = proposal.toLowerCase();\n if (!hasStarChar) {\n if (tmp.contains(contents) && components.get(proposal) != null) {\n list.add(new ContentProposal(proposal, components.get(proposal).getLongName()));\n }\n } else if (Pattern.matches(contents, tmp) && components.get(proposal) != null) {\n list.add(new ContentProposal(proposal, components.get(proposal).getLongName()));\n }\n }\n return list.toArray(new IContentProposal[0]);\n}\n"
|
"public String getClassName() {\n if (isInvisible || isTrap) {\n return \"String_Node_Str\";\n } else {\n return method.getDeclaringClass().toString();\n }\n}\n"
|
"private void addVariableComponent(VariableComponent variableComponent) throws SBOLValidationException {\n variableComponent.setSBOLDocument(this.getSBOLDocument());\n variableComponent.setCombinatorialDerivation(this);\n for (URI cdURI : variableComponent.getVariantDerivationURIs()) {\n CombinatorialDerivation cd = this.getSBOLDocument().getCombinatorialDerivation(cdURI);\n Set<URI> visited = new HashSet<>();\n visited.add(this.getIdentity());\n try {\n SBOLValidate.checkCombinatorialDerivationCycle(this.getSBOLDocument(), cd, visited);\n } catch (SBOLValidationException e) {\n throw new SBOLValidationException(\"String_Node_Str\", variableComponent);\n }\n }\n addChildSafely(variableComponent, variableComponents, \"String_Node_Str\");\n}\n"
|
"public Collection<Column> columnSlice(Key from, Key to) {\n NavigableMap<OurKey, IndexColumn> resultMap = columns;\n if (from != null) {\n OurKey fromKey = new OurKey(from.getKey(), new byte[0]);\n resultMap = columns.tailMap(fromKey, from.isInclusive());\n }\n if (to != null) {\n OurKey toKey = new OurKey(to.getKey(), null);\n resultMap = resultMap.headMap(toKey, to.isInclusive());\n }\n List<Column> results = new ArrayList<Column>();\n for (IndexColumn c : resultMap.values()) {\n Column col = new Column();\n col.setName(c.getPrimaryKey());\n results.add(col);\n }\n return results;\n}\n"
|
"public void handle(MessageContext context, IHandlerChain chain) {\n QueueingConsumer currentConsumer = (QueueingConsumer) context.getOtherParams().get(\"String_Node_Str\");\n try {\n while (!stop) {\n try {\n QueueingConsumer.Delivery delivery = currentConsumer.nextDelivery();\n final Message msg = MessageFactory.createMessage(delivery);\n if (msg == null)\n continue;\n if (msg.getMessageType().equals(MessageType.QueueMessage)) {\n this.doUncompress(context, msg);\n }\n context.setConsumeMsgs(new ArrayList<Message>(1) {\n {\n this.add(msg);\n }\n });\n if (msg.getMessageType().equals(MessageType.BroadcastMessage) && context.getNoticeListener() != null) {\n IMessageReceiveListener noticeListener = context.getNoticeListener();\n noticeListener.onMessage(msg);\n } else {\n process(context);\n }\n } catch (InterruptedException e) {\n logger.info(\"String_Node_Str\");\n } catch (Exception e) {\n ExceptionHelper.logException(logger, e, \"String_Node_Str\");\n }\n }\n } catch (Exception e) {\n ExceptionHelper.logException(logger, e, \"String_Node_Str\");\n } finally {\n synchronized (context.getChannel()) {\n try {\n if (context.getChannel().isOpen()) {\n context.getChannel().basicCancel(context.getConsumerTag());\n }\n } catch (IOException e1) {\n ExceptionHelper.logException(logger, e1, \"String_Node_Str\");\n }\n }\n chain.handle(context);\n }\n}\n"
|
"private GraphTargetItem classTraits(int packageInternalNs, List<String> importedClasses, int privateNs, boolean isDynamic, boolean isFinal, List<Integer> openedNamespaces, String packageName, int namespace, boolean isInterface, String nameStr, GraphTargetItem extendsStr, List<GraphTargetItem> implementsStr, List<AssignableAVM2Item> variables) throws IOException, ParseException, CompilationException {\n GraphTargetItem ret = null;\n ParsedSymbol s = null;\n List<GraphTargetItem> traits = new ArrayList<>();\n String classNameStr = nameStr;\n openedNamespaces = new ArrayList<>(openedNamespaces);\n int protectedNs = 0;\n int publicNs = namespace;\n int protectedStaticNs = 0;\n openedNamespaces.add(protectedNs = abc.constants.addNamespace(new Namespace(Namespace.KIND_PROTECTED, abc.constants.getStringId(packageName.isEmpty() ? classNameStr : packageName + \"String_Node_Str\" + classNameStr, true))));\n openedNamespaces.add(protectedStaticNs = abc.constants.addNamespace(new Namespace(Namespace.KIND_STATIC_PROTECTED, abc.constants.getStringId(packageName.isEmpty() ? classNameStr : packageName + \"String_Node_Str\" + classNameStr, true))));\n List<Integer> indices = new ArrayList<>();\n List<String> names = new ArrayList<>();\n List<String> namespaces = new ArrayList<>();\n AVM2SourceGenerator.parentNamesAddNames(abc, otherABCs, AVM2SourceGenerator.resolveType(((TypeItem) ((UnresolvedAVM2Item) extendsStr).resolve(null, new ArrayList<GraphTargetItem>(), new ArrayList<String>(), abc, otherABCs, new ArrayList<MethodBody>(), new ArrayList<AssignableAVM2Item>())), abc), indices, names, namespaces);\n for (int i = 0; i < names.size(); i++) {\n if (namespaces.get(i).isEmpty()) {\n continue;\n }\n openedNamespaces.add(abc.constants.getNamespaceId(new Namespace(Namespace.KIND_STATIC_PROTECTED, abc.constants.getStringId(namespaces.get(i) + \"String_Node_Str\" + names.get(i), true)), 0, true));\n }\n Reference<Boolean> staticNeedsActivation = new Reference<>(false);\n List<GraphTargetItem> staticInit = new ArrayList<>();\n List<AssignableAVM2Item> sinitVariables = new ArrayList<>();\n GraphTargetItem constr = traits(sinitVariables, staticNeedsActivation, staticInit, importedClasses, privateNs, protectedNs, publicNs, packageInternalNs, protectedStaticNs, openedNamespaces, packageName, classNameStr, isInterface, traits);\n if (isInterface) {\n return new InterfaceAVM2Item(openedNamespaces, isFinal, namespace, classNameStr, implementsStr, traits);\n } else {\n return new ClassAVM2Item(openedNamespaces, protectedNs, isDynamic, isFinal, namespace, classNameStr, extendsStr, implementsStr, staticInit, staticNeedsActivation.getVal(), sinitVariables, constr, traits);\n }\n}\n"
|
"protected String exec(AppCommandParser parser, Session session, Output out) throws ShellException, RemoteException {\n assertCurrentIsNode(session);\n boolean createNode = parser.options().containsKey(\"String_Node_Str\");\n boolean suppliedNode = parser.options().containsKey(\"String_Node_Str\");\n Node node = null;\n if (createNode) {\n node = getServer().getDb().createNode();\n } else if (suppliedNode) {\n node = getNodeById(Long.parseLong(parser.options().get(\"String_Node_Str\")));\n } else {\n throw new ShellException(\"String_Node_Str\" + \"String_Node_Str\");\n }\n if (parser.options().get(\"String_Node_Str\") == null) {\n throw new ShellException(\"String_Node_Str\" + \"String_Node_Str\");\n }\n RelationshipType type = this.getRelationshipType(parser.options().get(\"String_Node_Str\"));\n Direction direction = this.getDirection(parser.options().get(\"String_Node_Str\"));\n Node currentNode = getCurrent(session).asNode();\n Node startNode = direction == Direction.OUTGOING ? currentNode : node;\n Node endNode = direction == Direction.OUTGOING ? node : currentNode;\n Relationship relationship = startNode.createRelationshipTo(endNode, type);\n boolean verbose = parser.options().containsKey(\"String_Node_Str\");\n if (createNode && verbose) {\n out.println(\"String_Node_Str\" + getDisplayName(getServer(), session, node, false) + \"String_Node_Str\");\n }\n if (verbose) {\n out.println(\"String_Node_Str\" + getDisplayName(getServer(), session, relationship, true) + \"String_Node_Str\");\n }\n return null;\n}\n"
|
"public void testGetTeams() throws InterruptedException {\n try {\n Thread.sleep(1500);\n handler.getTeams(SUMMONER_ID_1);\n handler.getTeams(TEAM_ID);\n } catch (RequestException ex) {\n System.out.println(\"String_Node_Str\");\n System.out.println(ex.getMessage());\n }\n}\n"
|
"public void add() {\n count.incrementAndGet();\n rateWindow.incrementForTimestamp(timer.now());\n}\n"
|
"public boolean checkTrigger(GameEvent event, Game game) {\n if (event.getTargetId().equals(this.getSourceId())) {\n Permanent permanent = game.getPermanent(event.getTargetId());\n if (permanent != null && permanent.isCreature()) {\n NumberOfTimesPermanentTargetedATurnWatcher watcher = (NumberOfTimesPermanentTargetedATurnWatcher) game.getState().getWatchers().get(NumberOfTimesPermanentTargetedATurnWatcher.class.getName());\n if (watcher != null && watcher.notMoreThanOnceTargetedThisTurn(permanent, game)) {\n for (Effect effect : getEffects()) {\n effect.setTargetPointer(new FixedTarget(event.getSourceId()));\n }\n return true;\n }\n }\n }\n return false;\n}\n"
|
"public void limitCluster(final String clusterName, final String nodeGroupName, final int activeComputeNodeNum) {\n try {\n if (activeComputeNodeNum < 0) {\n System.out.println(\"String_Node_Str\" + activeComputeNodeNum);\n return;\n }\n ClusterRead cluster = restClient.get(clusterName);\n if (cluster == null) {\n CommandsUtils.printCmdFailure(Constants.OUTPUT_OP_ADJUSTMENT, null, null, Constants.OUTPUT_OP_ADJUSTMENT_FAILED, \"String_Node_Str\" + clusterName + \"String_Node_Str\");\n return;\n }\n if (!cluster.validateLimit(nodeGroupName, activeComputeNodeNum)) {\n return;\n }\n restClient.limitCluster(clusterName, nodeGroupName, activeComputeNodeNum);\n CommandsUtils.printCmdSuccess(Constants.OUTPUT_OP_ADJUSTMENT, null, Constants.OUTPUT_OP_ADJUSTMENT_SUCCEEDED);\n } catch (CliRestException e) {\n CommandsUtils.printCmdFailure(Constants.OUTPUT_OP_ADJUSTMENT, null, null, Constants.OUTPUT_OP_ADJUSTMENT_FAILED, e.getMessage());\n }\n}\n"
|
"private boolean canSmelt() {\n return worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 1 ? myTank.getFluidAmount() > 9 : worldObj.getBlockMetadata(xCoord, yCoord, zCoord) > 0 && hasPrimary() ? getPrimaryTileEntity().canSmelt() : false;\n}\n"
|
"public static DispoItemData jsonObjToDispoItem(JSONObject jsonObject) {\n DispoItemData dispoItem = new DispoItemData();\n try {\n if (jsonObject.has(\"String_Node_Str\")) {\n dispoItem.setName(jsonObject.getString(\"String_Node_Str\"));\n }\n if (jsonObject.has(\"String_Node_Str\")) {\n dispoItem.setGuid(jsonObject.getString(\"String_Node_Str\"));\n }\n if (jsonObject.has(\"String_Node_Str\")) {\n dispoItem.setStatus(jsonObject.getString(\"String_Node_Str\"));\n }\n if (jsonObject.has(\"String_Node_Str\")) {\n dispoItem.setTotalPoints(jsonObject.getString(\"String_Node_Str\"));\n }\n if (jsonObject.has(\"String_Node_Str\")) {\n dispoItem.setNeedsRerun(jsonObject.getBoolean(\"String_Node_Str\"));\n }\n if (jsonObject.has(\"String_Node_Str\")) {\n dispoItem.setVersion(jsonObject.getString(\"String_Node_Str\"));\n }\n if (jsonObject.has(\"String_Node_Str\")) {\n dispoItem.setAssignee(jsonObject.getString(\"String_Node_Str\"));\n }\n if (jsonObject.has(\"String_Node_Str\")) {\n dispoItem.setCategory(jsonObject.getString(\"String_Node_Str\"));\n }\n if (jsonObject.has(\"String_Node_Str\")) {\n dispoItem.setMachine(jsonObject.getString(\"String_Node_Str\"));\n }\n if (jsonObject.has(\"String_Node_Str\")) {\n dispoItem.setElapsedTime(jsonObject.getString(\"String_Node_Str\"));\n }\n if (jsonObject.has(\"String_Node_Str\")) {\n dispoItem.setAborted(jsonObject.getBoolean(\"String_Node_Str\"));\n }\n if (jsonObject.has(\"String_Node_Str\")) {\n dispoItem.setItemNotes(jsonObject.getString(\"String_Node_Str\"));\n }\n if (jsonObject.has(\"String_Node_Str\")) {\n dispoItem.setFileNumber(jsonObject.getString(\"String_Node_Str\"));\n }\n if (jsonObject.has(\"String_Node_Str\")) {\n dispoItem.setItemNotes(jsonObject.getString(\"String_Node_Str\"));\n }\n } catch (JSONException ex) {\n throw new OseeCoreException(\"String_Node_Str\", ex);\n }\n return dispoItem;\n}\n"
|
"public void onViewCreated(View view, Bundle savedInstanceState) {\n super.onViewCreated(view, savedInstanceState);\n final Context context = getActivity().getApplicationContext();\n typeSpinner.setSelection(commandAdapter.getPosition(MissionItemType.WAYPOINT));\n final Waypoint item = (Waypoint) this.itemRender.getMissionItem();\n final NumericWheelAdapter delayAdapter = new NumericWheelAdapter(context, 0, 60, \"String_Node_Str\");\n delayAdapter.setItemResource(R.layout.wheel_text_centered);\n final CardWheelHorizontalView delayPicker = (CardWheelHorizontalView) view.findViewById(R.id.waypointDelayPicker);\n delayPicker.setViewAdapter(delayAdapter);\n delayPicker.setCurrentValue((int) item.getDelay());\n delayPicker.addChangingListener(this);\n final NumericWheelAdapter altitudeAdapter = new NumericWheelAdapter(context, MIN_ALTITUDE, MAX_ALTITUDE, \"String_Node_Str\");\n altitudeAdapter.setItemResource(R.layout.wheel_text_centered);\n final CardWheelHorizontalView altitudePicker = (CardWheelHorizontalView) view.findViewById(R.id.altitudePicker);\n altitudePicker.setViewAdapter(altitudeAdapter);\n altitudePicker.setCurrentItem(altitudeAdapter.getItemIndex((int) item.getCoordinate().getAltitude().valueInMeters()));\n altitudePicker.addChangingListener(this);\n}\n"
|
"private void paintOverlay(Graphics2D g2) {\n if (provisionalGUITile != null) {\n if (hexMap.isTilePainted(provisionalGUITile.getTileId())) {\n provisionalGUITile.paintTile(g2, center.x, center.y);\n }\n } else {\n if (hexMap.isTilePainted(currentGUITile.getTiled())) {\n currentGUITile.paintTile(g2, center.x, center.y);\n }\n }\n}\n"
|
"public void displayData(SessionDetailModel data, SessionDetailQueryEnum query) {\n switch(query) {\n case SESSIONS:\n displaySessionData(data);\n displayTrackColor(data);\n break;\n case FEEDBACK:\n updateFeedbackButton(data);\n break;\n case SPEAKERS:\n displaySpeakersData(data);\n break;\n case TAG_METADATA:\n displayTags(data);\n displayTrackColor(data);\n break;\n case RELATED:\n displayRelatedSessions(data);\n break;\n case RESERVATION_STATUS:\n updateReservationStatusAndSeatAvailability(data);\n break;\n case RESERVATION_RESULT:\n updateReservationResult(data);\n break;\n case RESERVATION_PENDING:\n updateReservationPending(data);\n break;\n case RESERVATION_FAILED:\n showRequestFailed();\n updateReservationStatus(data);\n break;\n case RESERVATION_SEAT_AVAILABILITY:\n updateSeatsAvailability(data);\n break;\n case AUTH_REGISTRATION:\n updateAuthRegistration(data);\n break;\n default:\n break;\n }\n}\n"
|
"private static Size parseSize(String sizeWithUnits) throws GssFunctionException {\n int unitIndex = CharMatcher.JAVA_LETTER.indexIn(sizeWithUnits);\n String size = unitIndex > 0 ? sizeWithUnits.substring(0, unitIndex) : sizeWithUnits;\n String units = unitIndex > 0 ? sizeWithUnits.substring(unitIndex) : CssNumericNode.NO_UNITS;\n checkSize(size, units, null, null, isUnitOptional);\n return new Size(size, units);\n}\n"
|
"public RemoteServiceCalled convertFromSObject(SRemoteServiceCalled input, RemoteServiceCalled result, DatabaseSession session) throws BimserverDatabaseException {\n if (input == null) {\n return null;\n }\n result.setName(input.getName());\n result.setEnabled(input.getEnabled());\n result.setDescription(input.getDescription());\n result.setPluginDescriptor((PluginDescriptor) session.get(StorePackage.eINSTANCE.getPluginDescriptor(), input.getPluginDescriptorId(), Query.getDefault()));\n result.setSettings((ObjectType) session.get(StorePackage.eINSTANCE.getObjectType(), input.getSettingsId(), Query.getDefault()));\n result.setUserSettings((UserSettings) session.get(StorePackage.eINSTANCE.getUserSettings(), input.getUserSettingsId(), Query.getDefault()));\n return result;\n}\n"
|
"public boolean updateFaceLines(int[] faceIdxs, int offset, int len, FeatureIndexArray features) {\n int nFaces = len;\n int nFeatures = features.numFeatures();\n PolygonalMesh mesh = getMesh();\n boolean modified = false;\n if (nFeatures > 0) {\n for (int i = 0; i < nFaces; ++i) {\n if (i >= nFeatures) {\n break;\n }\n if (faceIdxs[i + offset] != features.getFeature(i)) {\n features.chop(0, i);\n nFeatures = i;\n modified = true;\n break;\n }\n }\n }\n if (nFaces < nFeatures) {\n features.chop(0, nFaces);\n nFeatures = nFaces;\n modified = true;\n }\n int[] offsets = mesh.getFeatureIndexOffsets();\n for (int i = nFeatures; i < nFaces; ++i) {\n int faceIdx = faceIdxs[i + offset];\n int v0 = offsets[faceIdx];\n int nv = offsets[faceIdx + 1] - offsets[faceIdx];\n features.beginFeature(faceIdx);\n for (int j = 1; j < nv; ++j) {\n int v1 = v0 + 1;\n features.addVertex(v0);\n features.addVertex(v1);\n v0 = v1;\n }\n features.addVertex(v0);\n features.addVertex(offsets[faceIdx]);\n features.endFeature();\n modified = true;\n }\n return modified;\n}\n"
|
"private static final void run(final String workflowPathname, final String designPathname, final String destPathname, final String jobDescription, final String jobEnvironment, final boolean uploadOnly, final long millisSinceEpoch) {\n checkNotNull(workflowPathname, \"String_Node_Str\");\n checkNotNull(designPathname, \"String_Node_Str\");\n checkNotNull(destPathname, \"String_Node_Str\");\n final String desc;\n final String env;\n if (jobDescription == null) {\n desc = \"String_Node_Str\";\n } else {\n desc = jobDescription;\n }\n if (jobEnvironment == null) {\n env = \"String_Node_Str\";\n } else {\n env = jobEnvironment;\n }\n try {\n final Configuration conf = ((HadoopEoulsanRuntime) EoulsanRuntime.getRuntime()).getConfiguration();\n final URI paramURI;\n if (workflowPathname.indexOf(\"String_Node_Str\") != -1)\n paramURI = new URI(workflowPathname);\n else\n paramURI = new File(workflowPathname).getAbsoluteFile().toURI();\n final URI designURI;\n if (designPathname.indexOf(\"String_Node_Str\") != -1)\n designURI = new URI(designPathname);\n else\n designURI = new File(designPathname).getAbsoluteFile().toURI();\n final URI destURI = new URI(destPathname);\n final Path paramPath = new Path(paramURI.toString());\n final Path designPath = new Path(designURI.toString());\n FileSystem paramFs = paramPath.getFileSystem(conf);\n if (!paramFs.exists(paramPath))\n throw new FileNotFoundException(paramPath.toString());\n FileSystem designFs = designPath.getFileSystem(conf);\n if (!designFs.exists(designPath))\n throw new FileNotFoundException(designPath.toString());\n final ExecutorArguments arguments = new HadoopExecutorArguments(millisSinceEpoch, paramPath, designPath, destPath);\n arguments.setJobDescription(desc);\n arguments.setJobEnvironment(env);\n Main.getInstance().createLogFileAndFlushLog(arguments.getLogPathname() + File.separator + \"String_Node_Str\");\n final Executor e = new Executor(arguments);\n final Step uploadStep = new HadoopUploadStep(new DataFile(destURI.toString()), conf);\n final List<Step> firstSteps;\n if (uploadOnly) {\n firstSteps = Arrays.asList(new Step[] { uploadStep, new TerminalStep(), new CopyDesignAndWorkflowFilesToOutputStep() });\n } else {\n firstSteps = Arrays.asList(uploadStep, new CopyDesignAndWorkflowFilesToOutputStep());\n }\n final List<Step> lastSteps = Collections.singletonList((Step) new HDFSDataDownloadStep());\n e.execute(firstSteps, lastSteps);\n } catch (FileNotFoundException e) {\n Common.errorExit(e, \"String_Node_Str\" + e.getMessage());\n } catch (EoulsanException e) {\n Common.errorExit(e, \"String_Node_Str\" + Globals.APP_NAME_LOWER_CASE + \"String_Node_Str\" + e.getMessage());\n } catch (EoulsanRuntimeException e) {\n Common.errorExit(e, \"String_Node_Str\" + Globals.APP_NAME_LOWER_CASE + \"String_Node_Str\" + e.getMessage());\n } catch (IOException e) {\n Common.errorExit(e, \"String_Node_Str\" + e.getMessage());\n } catch (URISyntaxException e) {\n Common.errorExit(e, \"String_Node_Str\" + e.getMessage());\n }\n}\n"
|
"public void hangupURLShouldBeReturnedWhenThereAreNoMessagesInOutbox() {\n ivrContext.callState(CallState.ALL_TREES_COMPLETED);\n String patientId = \"String_Node_Str\";\n tamaIVRContextForTest.patientId(patientId);\n when(voiceOutboxService.getNumberPendingMessages(patientId)).thenReturn(0);\n assertEquals(TAMACallFlowController.HANG_UP_URL, tamaCallFlowController.urlFor(kooKooIVRContext));\n}\n"
|
"public void setEvidence(Assignment assignment) {\n ((HashMapAssignment) assignment).entrySet().stream().forEach(entry -> {\n try {\n this.setVarEvidence(entry.getKey(), entry.getValue().doubleValue());\n } catch (ExceptionHugin exceptionHugin) {\n exceptionHugin.printStackTrace();\n }\n });\n}\n"
|
"public boolean marshal(XPathFragment xPathFragment, MarshalRecord marshalRecord, Object object, CoreAbstractSession session, NamespaceResolver namespaceResolver) {\n if (xmlAnyCollectionMapping.isReadOnly()) {\n return false;\n }\n CoreContainerPolicy cp = xmlAnyCollectionMapping.getContainerPolicy();\n Object collection = xmlAnyCollectionMapping.getAttributeAccessor().getAttributeValueFromObject(object);\n if (null == collection) {\n AbstractNullPolicy wrapperNP = xmlAnyCollectionMapping.getWrapperNullPolicy();\n if (wrapperNP != null && wrapperNP.getMarshalNullRepresentation().equals(XMLNullRepresentationType.XSI_NIL)) {\n marshalRecord.nilSimple(namespaceResolver);\n return true;\n } else {\n return false;\n }\n }\n Object iterator = cp.iteratorFor(collection);\n if (null != iterator && cp.hasNext(iterator)) {\n XPathFragment groupingFragment = marshalRecord.openStartGroupingElements(namespaceResolver);\n marshalRecord.closeStartGroupingElements(groupingFragment);\n } else {\n return marshalRecord.emptyCollection(xPathFragment, namespaceResolver, xmlAnyCollectionMapping.getWrapperNullPolicy() != null);\n }\n if (marshalRecord.getMarshaller().isApplicationJSON()) {\n List<XPathFragment> frags = new ArrayList();\n List<List> values = new ArrayList<List>();\n List mixedValues = new ArrayList();\n XPathFragment xmlRootFragment;\n while (cp.hasNext(iterator)) {\n Object nextValue = cp.next(iterator, session);\n nextValue = xmlAnyCollectionMapping.convertObjectValueToDataValue(nextValue, session, marshalRecord.getMarshaller());\n XPathFragment frag = getXPathFragmentForValue(nextValue, marshalRecord, marshalRecord.getMarshaller());\n if (frag != null) {\n if (frag == SIMPLE_FRAGMENT) {\n mixedValues.add(nextValue);\n } else {\n int index = frags.indexOf(frag);\n if (index > -1) {\n values.get(index).add(nextValue);\n } else {\n frags.add(frag);\n List valuesList = new ArrayList();\n valuesList.add(nextValue);\n values.add(valuesList);\n }\n }\n }\n }\n if (mixedValues.size() > 0) {\n frags.add(SIMPLE_FRAGMENT);\n values.add(mixedValues);\n }\n for (int i = 0; i < frags.size(); i++) {\n XPathFragment nextFragment = frags.get(i);\n List listValue = values.get(i);\n if (nextFragment != null) {\n int valueSize = listValue.size();\n if (valueSize > 1 || !marshalRecord.getMarshaller().isReduceAnyArrays()) {\n marshalRecord.startCollection();\n }\n for (int j = 0; j < valueSize; j++) {\n marshalSingleValue(nextFragment, marshalRecord, object, listValue.get(j), session, namespaceResolver, ObjectMarshalContext.getInstance());\n }\n if (valueSize > 1 || !marshalRecord.getMarshaller().isReduceAnyArrays()) {\n marshalRecord.endCollection();\n }\n }\n }\n return true;\n } else {\n Object objectValue;\n marshalRecord.startCollection();\n while (cp.hasNext(iterator)) {\n objectValue = cp.next(iterator, session);\n objectValue = xmlAnyCollectionMapping.convertObjectValueToDataValue(objectValue, session, marshalRecord.getMarshaller());\n marshalSingleValue(xPathFragment, marshalRecord, object, objectValue, session, namespaceResolver, ObjectMarshalContext.getInstance());\n }\n marshalRecord.endCollection();\n return true;\n }\n}\n"
|
"public synchronized Count getMatchCount(final NewsItem article, final int numTokens, final Hashtable matchCounts) {\n setupAll();\n return super.getMatchCount(article, numTokens, matchCounts);\n}\n"
|
"public boolean moveItem(EntityRef fromInventory, EntityRef instigator, int slotFrom, EntityRef toInventory, int slotTo, int count) {\n Collection<EntityRef> clientTempEntities = new HashSet<>();\n if (moveItemAmountFillClientTempEntities(fromInventory, instigator, slotFrom, toInventory, slotTo, count, clientTempEntities)) {\n return false;\n }\n MoveItemAmountRequest request = new MoveItemAmountRequest(instigator, fromInventory, slotFrom, toInventory, slotTo, count, changeId++);\n pendingMoves.put(request.getChangeId(), request);\n localPlayer.getClientEntity().send(request);\n return true;\n}\n"
|
"private void fillBetweenPoints(Level level, Point from, Point to, int floor) {\n if (from.y == to.y || from.x == to.x) {\n Painter.fill(level, Math.min(from.x, to.x), Math.min(from.y, to.y), spaceBetween(from.x, to.x) + 2, spaceBetween(from.y, to.y) + 2, floor);\n return;\n }\n if (corners == null) {\n corners = new Point[4];\n corners[0] = new Point(left + 2, top + 2);\n corners[1] = new Point(right - 2, top + 2);\n corners[2] = new Point(right - 2, bottom - 2);\n corners[3] = new Point(left + 2, bottom - 2);\n }\n for (Point c : corners) {\n if ((c.x == from.x || c.y == from.y) && (c.x == to.x || c.y == to.y)) {\n Painter.drawLine(level, from, c, floor);\n Painter.drawLine(level, c, to, floor);\n return;\n }\n }\n Point side;\n if (from.y == top + 2 || from.y == bottom - 2) {\n if (spaceBetween(left, from.x) + spaceBetween(left, to.x) <= spaceBetween(right, from.x) + spaceBetween(right, to.x)) {\n side = new Point(left + 1, top + height() / 2);\n } else {\n side = new Point(right - 1, top + height() / 2);\n }\n } else {\n if (spaceBetween(top, from.y) + spaceBetween(top, to.y) <= spaceBetween(bottom, from.y) + spaceBetween(bottom, to.y)) {\n side = new Point(left + width() / 2, top + 1);\n } else {\n side = new Point(left + width() / 2, bottom - 1);\n }\n }\n fillBetweenPoints(level, from, side, floor);\n fillBetweenPoints(level, side, to, floor);\n}\n"
|
"public void rhoDRDownTest3() throws ParseException, LearningProblemUnsupportedException {\n AbstractReasonerComponent reasoner = TestOntologies.getTestOntology(TestOntology.KRK_ZERO_ONE);\n baseURI = reasoner.getBaseURI();\n ComponentManager cm = ComponentManager.getInstance();\n AbstractLearningProblem lp = cm.learningProblem(PosNegLPStandard.class, reasoner);\n OCEL la = cm.learningAlgorithm(OCEL.class, lp, reasoner);\n Set<NamedClass> ignoredConcepts = new TreeSet<NamedClass>();\n ignoredConcepts.add(new NamedClass(\"String_Node_Str\"));\n ignoredConcepts.add(new NamedClass(\"String_Node_Str\"));\n Set<NamedClass> usedConcepts = Helper.computeConceptsUsingIgnoreList(reasoner, ignoredConcepts);\n ClassHierarchy classHierarchy = reasoner.getClassHierarchy().cloneAndRestrict(usedConcepts);\n classHierarchy.thinOutSubsumptionHierarchy();\n System.out.println(\"String_Node_Str\");\n RhoDRDown op = new RhoDRDown();\n op.setReasoner(reasoner);\n Description concept = KBParser.parseConcept(\"String_Node_Str\");\n Set<Description> results = op.refine(concept, 8);\n for (Description result : results) {\n System.out.println(result.toString(\"String_Node_Str\", null));\n }\n int desiredResultSize = 8;\n if (results.size() != desiredResultSize) {\n System.out.println(results.size() + \"String_Node_Str\" + desiredResultSize + \"String_Node_Str\");\n }\n assertTrue(results.size() == desiredResultSize);\n}\n"
|
"private void handleIncomingData(LttngEvent e) {\n long eventTime = e.getTimestamp().getValue();\n ITmfTrace inTrace = e.getParentTrace();\n LttngTraceState traceModel = traceToTraceStateModel.get(inTrace);\n updateSynEvent(e);\n if (eventTime >= dispatchTime && eventIndex >= dispatchIndex) {\n syntheticEvent.setSequenceInd(SequenceInd.BEFORE);\n fmainRequest.handleData(syntheticEvent);\n syntheticEvent.setSequenceInd(SequenceInd.UPDATE);\n fstateUpdateProcessor.process(syntheticEvent, traceModel);\n syntheticEvent.setSequenceInd(SequenceInd.AFTER);\n fmainRequest.handleData(syntheticEvent);\n } else {\n syntheticEvent.setSequenceInd(SequenceInd.UPDATE);\n fstateUpdateProcessor.process(syntheticEvent, traceModel);\n }\n eventIndex++;\n}\n"
|
"public void handleRequest(RequestPacket requestPacket, Channel channel) {\n logger.info(\"String_Node_Str\", requestPacket, channel);\n final TBase<?, ?> request = SerializationUtils.deserialize(requestPacket.getPayload(), deserializerFactory, null);\n TBase response;\n if (request == null) {\n TResult tResult = new TResult(false);\n tResult.setMessage(\"String_Node_Str\");\n response = tResult;\n } else {\n ProfilerRequestCommandService service = commandServiceRegistry.getRequestService(request);\n if (service == null) {\n TResult tResult = new TResult(false);\n tResult.setMessage(\"String_Node_Str\");\n response = tResult;\n } else {\n response = service.requestCommandService(request);\n }\n }\n byte[] payload = SerializationUtils.serialize(response, serializerFactory, null);\n if (payload != null) {\n channel.write(new ResponsePacket(requestPacket.getRequestId(), payload));\n }\n}\n"
|
"private void _checkupEntityFieldsWithDatabase(NutEntity<?> en) {\n Connection conn = null;\n try {\n conn = Trans.getConnectionAuto(datasource);\n expert.setupEntityField(conn, en);\n } catch (Exception e) {\n if (log.isDebugEnabled())\n log.debugf(\"String_Node_Str\", en.getType().getName(), en.getTableName(), e.getClass().getName(), e.getMessage());\n } finally {\n Trans.closeConnectionAuto(conn);\n }\n}\n"
|
"public void onPlayerBlockPlace(final HangingPlaceEvent e) {\n if (DEBUG) {\n plugin.getLogger().info(e.getEventName());\n plugin.getLogger().info(\"String_Node_Str\" + e.getBlock().getType());\n plugin.getLogger().info(\"String_Node_Str\" + e.getEntity().getType());\n }\n if (Settings.allowAutoActivator && e.getPlayer().getName().equals(\"String_Node_Str\")) {\n return;\n }\n if (inWorld(e.getPlayer())) {\n if (e.getPlayer().isOp() || VaultHelper.checkPerm(e.getPlayer(), Settings.PERMPREFIX + \"String_Node_Str\")) {\n return;\n }\n Island island = plugin.getGrid().getProtectedIslandAt(e.getBlock().getLocation());\n if (island == null) {\n if (!Settings.defaultWorldSettings.get(SettingsFlag.PLACE_BLOCKS)) {\n Util.sendMessage(e.getPlayer(), ChatColor.RED + plugin.myLocale(e.getPlayer().getUniqueId()).islandProtected);\n e.setCancelled(true);\n }\n return;\n }\n if (island.getIgsFlag(SettingsFlag.PLACE_BLOCKS) || island.getMembers().contains(e.getPlayer().getUniqueId())) {\n String type = e.getEntity().getType().toString();\n if (e.getEntity().getType().equals(EntityType.ITEM_FRAME) || e.getEntity().getType().equals(EntityType.PAINTING)) {\n if (Settings.limitedBlocks.containsKey(type) && Settings.limitedBlocks.get(type) > -1) {\n int count = island.getTileEntityCount(Material.valueOf(type), e.getEntity().getWorld());\n if (Settings.limitedBlocks.get(type) <= count) {\n Util.sendMessage(e.getPlayer(), ChatColor.RED + (plugin.myLocale(e.getPlayer().getUniqueId()).entityLimitReached.replace(\"String_Node_Str\", Util.prettifyText(type))).replace(\"String_Node_Str\", String.valueOf(Settings.limitedBlocks.get(type))));\n e.setCancelled(true);\n return;\n }\n }\n }\n } else {\n Util.sendMessage(e.getPlayer(), ChatColor.RED + plugin.myLocale(e.getPlayer().getUniqueId()).islandProtected);\n e.setCancelled(true);\n }\n }\n}\n"
|
"public void createDocument() {\n final DocumentCreateResult<BaseDocument> doc = db.collection(COLLECTION_NAME).createDocument(new BaseDocument(), null).execute();\n assertThat(doc, is(notNullValue()));\n assertThat(doc.getId(), is(notNullValue()));\n assertThat(doc.getKey(), is(notNullValue()));\n assertThat(doc.getRev(), is(notNullValue()));\n assertThat(doc.getNew().isPresent(), is(false));\n assertThat(doc.getId(), is(COLLECTION_NAME + \"String_Node_Str\" + doc.getKey()));\n}\n"
|
"public StepResult execute(final StepContext context, final StepStatus status) {\n final Data inData = context.getInputData(this.inputFormat);\n final Data outData = context.getOutputData(DataFormats.FASTQC_REPORT_HTML, inData);\n final DataFile inFile;\n if (inData.getFormat().getMaxFilesCount() > 1) {\n inFile = inData.getDataFile(0);\n } else {\n inFile = inData.getDataFile();\n }\n final DataFile reportFile = outData.getDataFile();\n SequenceFile seqFile = null;\n try {\n seqFile = SequenceFactory.getSequenceFile(inFile.toFile());\n } catch (SequenceFormatException | IOException e) {\n return status.createStepResult(e, \"String_Node_Str\" + e.getMessage());\n }\n final OverRepresentedSeqs os = new OverRepresentedSeqs();\n final List<AbstractQCModule> modules = Lists.newArrayList(new BasicStats(), new PerBaseQualityScores(), new PerTileQualityScores(), new PerSequenceQualityScores(), new PerBaseSequenceContent(), new PerSequenceGCContent(), new NContent(), new SequenceLengthDistribution(), os.duplicationLevelModule(), os, new AdapterContent(), new KmerContent());\n try {\n processSequences(modules, seqFile);\n createReport(modules, seqFile, reportFile.toFile());\n status.setDescription(\"String_Node_Str\" + inFile + \"String_Node_Str\" + reportFile.getName() + \"String_Node_Str\");\n modules.clear();\n return status.createStepResult();\n } catch (final SequenceFormatException e) {\n return status.createStepResult(e, \"String_Node_Str\" + e.getMessage());\n } catch (final IOException e) {\n return status.createStepResult(e, \"String_Node_Str\" + e.getMessage());\n } catch (final XMLStreamException e) {\n return status.createStepResult(e, \"String_Node_Str\" + e.getMessage());\n }\n}\n"
|
"public void keyEvent(KeyEvent event, EntityRef entity) {\n if (focus != null) {\n focus.onKeyEvent(event);\n }\n if (event.isDown() && !event.isConsumed() && event.getKey() == Keyboard.Key.ESCAPE) {\n if (!screens.isEmpty() && screens.peek().isEscapeToCloseAllowed()) {\n popScreen();\n event.consume();\n }\n }\n}\n"
|
"public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View rootView = inflater.inflate(R.layout.fragment_add_stop, container, false);\n Bundle args = getArguments();\n if (args != null && args.containsKey(\"String_Node_Str\")) {\n atw = (ArrivalTimeWidget) args.getSerializable(\"String_Node_Str\");\n } else {\n throw new IllegalStateException(\"String_Node_Str\");\n }\n setHasOptionsMenu(true);\n getActivity().setTitle(\"String_Node_Str\");\n stopListView = (ListView) rootView.findViewById(R.id.lvStopList);\n progressBar = (ProgressBar) getActivity().findViewById(R.id.pbLoading);\n progressBar.setVisibility(View.VISIBLE);\n TransLocClient client = ServiceGenerator.createService(TransLocClient.class, Utils.BASE_URL, TRANSLOC_API_KEY, atw.getAgencyID(), STOP);\n stopsSub = client.stops(atw.getAgencyID()).observeOn(AndroidSchedulers.mainThread()).subscribe(this::populateStopsListView, e -> handleServiceErrors(getActivity(), STOP, e, progressBar));\n return rootView;\n}\n"
|
"public void before() throws Exception {\n cConf.set(Constants.Dataset.Manager.ADDRESS, \"String_Node_Str\");\n cConf.setBoolean(Constants.Dangerous.UNRECOVERABLE_RESET, true);\n Configuration txConf = HBaseConfiguration.create();\n CConfigurationUtil.copyTxProperties(cConf, txConf);\n Impersonator impersonator = new Impersonator(cConf, null, null);\n Injector injector = Guice.createInjector(new ConfigModule(cConf, txConf), new DiscoveryRuntimeModule().getInMemoryModules(), new AuthorizationTestModule(), new AuthorizationEnforcementModule().getInMemoryModules(), new AuthenticationContextModules().getMasterModule(), new TransactionInMemoryModule(), new AbstractModule() {\n protected void configure() {\n bind(MetricsCollectionService.class).to(NoOpMetricsCollectionService.class).in(Singleton.class);\n install(new FactoryModuleBuilder().implement(DatasetDefinitionRegistry.class, DefaultDatasetDefinitionRegistry.class).build(DatasetDefinitionRegistryFactory.class));\n bind(RemoteDatasetFramework.class);\n }\n });\n txManager = new TransactionManager(txConf);\n txManager.startAndWait();\n InMemoryTxSystemClient txSystemClient = new InMemoryTxSystemClient(txManager);\n TransactionSystemClientService txSystemClientService = new DelegatingTransactionSystemClientService(txSystemClient);\n DiscoveryService discoveryService = injector.getInstance(DiscoveryService.class);\n DiscoveryServiceClient discoveryServiceClient = injector.getInstance(DiscoveryServiceClient.class);\n MetricsCollectionService metricsCollectionService = injector.getInstance(MetricsCollectionService.class);\n AuthenticationContext authenticationContext = injector.getInstance(AuthenticationContext.class);\n framework = new RemoteDatasetFramework(cConf, discoveryServiceClient, registryFactory, authenticationContext);\n SystemDatasetInstantiatorFactory datasetInstantiatorFactory = new SystemDatasetInstantiatorFactory(locationFactory, framework, cConf);\n DatasetAdminService datasetAdminService = new DatasetAdminService(framework, cConf, locationFactory, datasetInstantiatorFactory, new NoOpMetadataStore(), impersonator);\n ImmutableSet<HttpHandler> handlers = ImmutableSet.<HttpHandler>of(new DatasetAdminOpHTTPHandler(datasetAdminService));\n opExecutorService = new DatasetOpExecutorService(cConf, discoveryService, metricsCollectionService, handlers);\n opExecutorService.startAndWait();\n ImmutableMap<String, DatasetModule> modules = ImmutableMap.<String, DatasetModule>builder().put(\"String_Node_Str\", new InMemoryTableModule()).put(\"String_Node_Str\", new CoreDatasetsModule()).putAll(DatasetMetaTableUtil.getModules()).build();\n InMemoryDatasetFramework mdsFramework = new InMemoryDatasetFramework(registryFactory, modules);\n ExploreFacade exploreFacade = new ExploreFacade(new DiscoveryExploreClient(cConf, discoveryServiceClient), cConf);\n TransactionExecutorFactory txExecutorFactory = new DynamicTransactionExecutorFactory(txSystemClient);\n AuthorizationEnforcer authorizationEnforcer = injector.getInstance(AuthorizationEnforcer.class);\n DatasetTypeManager typeManager = new DatasetTypeManager(cConf, locationFactory, txSystemClientService, txExecutorFactory, mdsFramework, DEFAULT_MODULES, impersonator);\n DatasetInstanceManager instanceManager = new DatasetInstanceManager(txSystemClientService, txExecutorFactory, mdsFramework);\n PrivilegesManager privilegesManager = injector.getInstance(PrivilegesManager.class);\n DatasetTypeService typeService = new DatasetTypeService(typeManager, namespaceQueryAdmin, namespacedLocationFactory, authorizationEnforcer, privilegesManager, authenticationContext, cConf, impersonator);\n DatasetOpExecutor opExecutor = new LocalDatasetOpExecutor(cConf, discoveryServiceClient, opExecutorService);\n DatasetInstanceService instanceService = new DatasetInstanceService(typeManager, instanceManager, opExecutor, exploreFacade, namespaceQueryAdmin, authorizationEnforcer, authorizerInstantiator, authenticationContext);\n instanceService.setAuditPublisher(inMemoryAuditPublisher);\n service = new DatasetService(cConf, discoveryService, discoveryServiceClient, typeManager, metricsCollectionService, new InMemoryDatasetOpExecutor(framework), new HashSet<DatasetMetricsReporter>(), typeService, instanceService);\n service.startAndWait();\n EndpointStrategy endpointStrategy = new RandomEndpointStrategy(discoveryServiceClient.discover(Constants.Service.DATASET_MANAGER));\n Preconditions.checkNotNull(endpointStrategy.pick(5, TimeUnit.SECONDS), \"String_Node_Str\", service);\n createNamespace(Id.Namespace.SYSTEM);\n createNamespace(NAMESPACE_ID);\n}\n"
|
"public void startRequest(MRCRequest rq) {\n try {\n final getxattrRequest rqArgs = (getxattrRequest) rq.getRequestArgs();\n final VolumeManager vMan = master.getVolumeManager();\n final FileAccessManager faMan = master.getFileAccessManager();\n validateContext(rq);\n Path p = new Path(rqArgs.getPath());\n VolumeInfo volume = vMan.getVolumeByName(p.getComp(0));\n StorageManager sMan = vMan.getStorageManager(volume.getId());\n PathResolver res = new PathResolver(sMan, p);\n faMan.checkSearchPermission(sMan, res, rq.getDetails().userId, rq.getDetails().superUser, rq.getDetails().groupIds);\n res.checkIfFileDoesNotExist();\n FileMetadata file = res.getFile();\n String target = sMan.getSoftlinkTarget(file.getId());\n if (target != null) {\n rqArgs.setPath(target);\n p = new Path(target);\n if (!vMan.hasVolume(p.getComp(0))) {\n finishRequest(rq, new ErrorRecord(ErrorClass.USER_EXCEPTION, ErrNo.ENOENT, \"String_Node_Str\" + target + \"String_Node_Str\"));\n return;\n }\n volume = vMan.getVolumeByName(p.getComp(0));\n sMan = vMan.getStorageManager(volume.getId());\n res = new PathResolver(sMan, p);\n file = res.getFile();\n }\n String value = null;\n if (rqArgs.getName().startsWith(\"String_Node_Str\"))\n value = MRCHelper.getSysAttrValue(master.getConfig(), sMan, master.getOSDStatusManager(), volume, res.toString(), file, rqArgs.getName().substring(9));\n else {\n value = sMan.getXAttr(file.getId(), rq.getDetails().userId, rqArgs.getName());\n if (value == null)\n value = sMan.getXAttr(file.getId(), StorageManager.GLOBAL_ID, rqArgs.getName());\n if (value == null)\n value = \"String_Node_Str\";\n }\n rq.setResponse(new getxattrResponse(value));\n finishRequest(rq);\n } catch (UserException exc) {\n Logging.logMessage(Logging.LEVEL_TRACE, this, exc);\n finishRequest(rq, new ErrorRecord(ErrorClass.USER_EXCEPTION, exc.getErrno(), exc.getMessage(), exc));\n } catch (Throwable exc) {\n finishRequest(rq, new ErrorRecord(ErrorClass.INTERNAL_SERVER_ERROR, \"String_Node_Str\", exc));\n }\n}\n"
|
"public String toString() {\n StringBuffer b = new StringBuffer();\n if (PrecedenceTest.needsBrackets(getOpBox(), this))\n b.append(\"String_Node_Str\");\n b.append(getOpBox().getValue().toString());\n if (PrecedenceTest.needsBrackets(getOpBox(), this))\n b.append(\"String_Node_Str\");\n b.append(\"String_Node_Str\");\n return b.toString();\n}\n"
|
"boolean isChecksumValid() {\n long fileChecksum = readBEIntFrom(4, 0);\n System.out.println(fileChecksum);\n int count = mapContent.length - 8;\n int currentChecksum = 0;\n for (int i = 8; i < count; i += 4) {\n long currentInt = readBytesFrom(4, i);\n currentChecksum = (int) ((currentChecksum * 2) ^ currentInt);\n if (i < 40) {\n System.out.println(i + \"String_Node_Str\" + currentInt + \"String_Node_Str\" + currentChecksum);\n }\n if (currentChecksum == fileChecksum) {\n System.out.println(\"String_Node_Str\" + i);\n }\n }\n if (currentChecksum != fileChecksum) {\n return false;\n }\n return true;\n}\n"
|
"protected final void checkForHits(final GL2 gl) {\n Set<String> hitTypes = pickingManager.getHitTypes(uniqueID);\n if (hitTypes == null)\n return;\n contextMenuCreator.clear();\n for (String pickingType : hitTypes) {\n ArrayList<Pick> alHits = null;\n alHits = pickingManager.getHits(uniqueID, pickingType);\n if (alHits != null && alHits.size() != 0) {\n for (int iCount = 0; iCount < alHits.size(); iCount++) {\n Pick tempPick = alHits.get(iCount);\n int externalID = tempPick.getID();\n if (externalID == -1) {\n continue;\n }\n PickingMode ePickingMode = tempPick.getPickingMode();\n handlePicking(pickingType, ePickingMode, externalID, tempPick);\n try {\n handlePickingEvents(PickingType.valueOf(pickingType), ePickingMode, externalID, tempPick);\n } catch (Exception e) {\n System.out.println(\"String_Node_Str\" + e.toString());\n }\n pickingManager.flushHits(uniqueID, pickingType);\n }\n }\n }\n if (contextMenuCreator.hasMenuItems())\n contextMenuCreator.open(this);\n}\n"
|
"public <X> X getData(String key) {\n return (X) additionalData.get(key);\n}\n"
|
"public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_camera);\n rotation = getWindowManager().getDefaultDisplay().getRotation();\n iv_flash = (ImageView) findViewById(R.id.iv_flash);\n iv_flash.setOnClickListener(new RLOnClickListener() {\n public void onClickX(View view) {\n isFlashEnabled = !isFlashEnabled;\n Parameters parameters = camera.getParameters();\n parameters.setFlashMode(isFlashEnabled ? Parameters.FLASH_MODE_TORCH : Parameters.FLASH_MODE_OFF);\n camera.setParameters(parameters);\n iv_flash.setImageDrawable(getResources().getDrawable(isFlashEnabled ? R.drawable.btn_camera_flash_off : R.drawable.btn_camera_flash_on));\n }\n });\n iv_yes = (ImageView) findViewById(R.id.iv_yes);\n iv_yes.setOnClickListener(new RLOnClickListener() {\n public void onClickX(View arg0) {\n try {\n Bitmap bMap = BitmapFactory.decodeByteArray(data, 0, data.length);\n Bitmap bMapRotate;\n float degrees = 0f;\n switch(rotation) {\n case Surface.ROTATION_0:\n degrees = 90f;\n break;\n case Surface.ROTATION_90:\n degrees = 0f;\n break;\n case Surface.ROTATION_180:\n degrees = 270f;\n break;\n case Surface.ROTATION_270:\n degrees = 180f;\n break;\n }\n Matrix matrix = new Matrix();\n matrix.reset();\n matrix.postRotate(degrees);\n bMapRotate = Bitmap.createBitmap(bMap, 0, 0, bMap.getWidth(), bMap.getHeight(), matrix, true);\n bMap = bMapRotate;\n String savePath = getIntent().getStringExtra(\"String_Node_Str\");\n BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(savePath));\n bMap.compress(Bitmap.CompressFormat.JPEG, 100, bos);\n bos.flush();\n bos.close();\n setResult(RESULT_OK, getIntent());\n finish();\n overridePendingTransition(R.anim.reload, R.anim.reload);\n } catch (Exception e) {\n e.printStackTrace();\n }\n iv_yes.setVisibility(View.GONE);\n iv_no.setVisibility(View.GONE);\n }\n });\n iv_no = (ImageView) findViewById(R.id.iv_no);\n iv_no.setOnClickListener(new RLOnClickListener() {\n public void onClickX(View arg0) {\n camera.startPreview();\n iv_yes.setVisibility(View.GONE);\n iv_no.setVisibility(View.GONE);\n }\n });\n SurfaceView surfaceView = (SurfaceView) this.findViewById(R.id.sv_camera);\n surfaceView.setFocusable(true);\n surfaceView.setFocusableInTouchMode(true);\n findViewById(R.id.iv_camera).setOnClickListener(new View.OnClickListener() {\n public void onClick(View v) {\n if (!isReady) {\n camera.autoFocus(RLCameraActivity.this);\n isReady = true;\n } else {\n camera.startPreview();\n isReady = false;\n }\n }\n });\n SurfaceHolder holder = surfaceView.getHolder();\n holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);\n holder.addCallback(this);\n}\n"
|
"public boolean handles(ReadableArchive archive) {\n try {\n if (archive.exists(EJB_JAR_XML) || archive.exists(SUN_EJB_JAR_XML) || archive.exists(GF_EJB_JAR_XML)) {\n return true;\n }\n GenericAnnotationDetector detector = new GenericAnnotationDetector(sniffer.getAnnotationTypes());\n return detector.hasAnnotationInArchive(archive);\n } catch (IOException ioe) {\n }\n return false;\n}\n"
|
"private AppResourceProvider getOrRegisterApp(String applicationName) {\n AppResourceProvider resourceProvider = apps.get(applicationName);\n if (resourceProvider == null) {\n try {\n initRootDirAndContext();\n resourceProvider = new AppResourceProvider(rootDir, applicationName);\n apps.put(applicationName, resourceProvider);\n } catch (Exception e) {\n logger.warning(e.toString());\n }\n }\n return resourceProvider;\n}\n"
|
"public Optional<AnnotationObject> getPrediction(int aBegin, int aEnd, String aLabel) {\n return predictions.values().stream().filter(f -> f.getOffset().getBeginCharacter() == aBegin && f.getOffset().getEndCharacter() == aEnd).filter(f -> f.getAnnotation().equals(aLabel)).max(Comparator.comparingInt(TokenObject::getId));\n}\n"
|
"final void makeOutputJar() throws IOException {\n if (outputJar == null) {\n if (outputFile == null) {\n throw new IllegalStateException(\"String_Node_Str\");\n }\n outputJar = new JarOutputStream(new FileOutputStream(outputFile));\n }\n}\n"
|
"protected void setupDatabase(Database database) throws Exception {\n dropAndCreateTable(new CreateTableStatement(null, TABLE_NAME).addPrimaryKeyColumn(\"String_Node_Str\", \"String_Node_Str\").addColumn(COLUMN_NAME, \"String_Node_Str\"), database);\n dropAndCreateTable(new CreateTableStatement(TestContext.ALT_SCHEMA, TABLE_NAME).addPrimaryKeyColumn(\"String_Node_Str\", \"String_Node_Str\").addColumn(COLUMN_NAME, \"String_Node_Str\"), database);\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.