idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
264,278
public void run() {<NEW_LINE>SpinnerDialog spinnerDialog = SpinnerDialog.displayDialog(parent, parent.getResources().getString(R.string.nettest_title_waiting), parent.getResources().getString(R.string.nettest_text_waiting), false);<NEW_LINE>int ret = MoonBridge.testClientConnectivity(CONNECTION_TEST_SERVER, 443, MoonBridge.ML_PORT_FLAG_ALL);<NEW_LINE>spinnerDialog.dismiss();<NEW_LINE>String dialogSummary;<NEW_LINE>if (ret == MoonBridge.ML_TEST_RESULT_INCONCLUSIVE) {<NEW_LINE>dialogSummary = parent.getResources().getString(R.string.nettest_text_inconclusive);<NEW_LINE>} else if (ret == 0) {<NEW_LINE>dialogSummary = parent.getResources().getString(R.string.nettest_text_success);<NEW_LINE>} else {<NEW_LINE>dialogSummary = parent.getResources().getString(R.string.nettest_text_failure);<NEW_LINE>dialogSummary += <MASK><NEW_LINE>}<NEW_LINE>Dialog.displayDialog(parent, parent.getResources().getString(R.string.nettest_title_done), dialogSummary, false);<NEW_LINE>}
MoonBridge.stringifyPortFlags(ret, "\n");
701,020
private void runCraft() throws Throwable {<NEW_LINE>if (Tools.LOCAL_RENDERER == null) {<NEW_LINE>Tools.LOCAL_RENDERER = LauncherPreferences.PREF_RENDERER;<NEW_LINE>}<NEW_LINE>Logger.<MASK><NEW_LINE>Logger.getInstance().appendToLog("Info: Launcher version: " + BuildConfig.VERSION_NAME);<NEW_LINE>if (Tools.LOCAL_RENDERER.equals("vulkan_zink")) {<NEW_LINE>checkVulkanZinkIsSupported();<NEW_LINE>}<NEW_LINE>checkLWJGL3Installed();<NEW_LINE>JREUtils.jreReleaseList = JREUtils.readJREReleaseProperties();<NEW_LINE>Logger.getInstance().appendToLog("Architecture: " + Architecture.archAsString(Tools.DEVICE_ARCHITECTURE));<NEW_LINE>checkJavaArgsIsLaunchable(JREUtils.jreReleaseList.get("JAVA_VERSION"));<NEW_LINE>// appendlnToLog("Info: Custom Java arguments: \"" + LauncherPreferences.PREF_CUSTOM_JAVA_ARGS + "\"");<NEW_LINE>Logger.getInstance().appendToLog("Info: Selected Minecraft version: " + mVersionInfo.id + ((mVersionInfo.inheritsFrom == null || mVersionInfo.inheritsFrom.equals(mVersionInfo.id)) ? "" : " (" + mVersionInfo.inheritsFrom + ")"));<NEW_LINE>JREUtils.redirectAndPrintJRELog();<NEW_LINE>LauncherProfiles.update();<NEW_LINE>Tools.launchMinecraft(this, mProfile, BaseLauncherActivity.getVersionId(minecraftProfile.lastVersionId));<NEW_LINE>}
getInstance().appendToLog("--------- beggining with launcher debug");
1,390,270
private static void loadFile() throws IOException {<NEW_LINE>kits.clear();<NEW_LINE>NbtCompound rootTag = NbtIo.read(new File(configPath.toFile(), "kits.dat"));<NEW_LINE>if (rootTag == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int currentVersion = SharedConstants.getGameVersion().getWorldVersion();<NEW_LINE>final int <MASK><NEW_LINE>NbtCompound compoundTag = rootTag.getCompound("Kits");<NEW_LINE>if (fileVersion >= currentVersion) {<NEW_LINE>compoundTag.getKeys().forEach(key -> kits.put(key, compoundTag.getList(key, NbtElement.COMPOUND_TYPE)));<NEW_LINE>} else {<NEW_LINE>compoundTag.getKeys().forEach(key -> {<NEW_LINE>NbtList updatedListTag = new NbtList();<NEW_LINE>compoundTag.getList(key, NbtElement.COMPOUND_TYPE).forEach(tag -> {<NEW_LINE>Dynamic<NbtElement> oldTagDynamic = new Dynamic<>(NbtOps.INSTANCE, tag);<NEW_LINE>Dynamic<NbtElement> newTagDynamic = client.getDataFixer().update(TypeReferences.ITEM_STACK, oldTagDynamic, fileVersion, currentVersion);<NEW_LINE>updatedListTag.add(newTagDynamic.getValue());<NEW_LINE>});<NEW_LINE>kits.put(key, updatedListTag);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
fileVersion = rootTag.getInt("DataVersion");
1,307,090
private boolean validateFile(File xml) {<NEW_LINE>boolean valid = false;<NEW_LINE>try {<NEW_LINE>// logger.debug("xml = " + xml);<NEW_LINE>String ext = xml.getName().replaceAll(".+(\\..+)", "$1");<NEW_LINE>String xsdFile = schemas.get(ext);<NEW_LINE>// logger.debug("xsdFile = " + xsdFile);<NEW_LINE>File xsd = new File(xsdFile);<NEW_LINE>if (!xsd.exists()) {<NEW_LINE>// logger.debug("working dir = " + System.getProperty("user.dir"));<NEW_LINE>throw new IllegalStateException(xsd + " does not exist");<NEW_LINE>}<NEW_LINE>List<SAXParseException> errors = XMLUtil.validate(xsd, xml);<NEW_LINE>if (!errors.isEmpty()) {<NEW_LINE>System.err.<MASK><NEW_LINE>for (SAXParseException se : errors) {<NEW_LINE>System.err.println(" Line " + se.getLineNumber() + " Column " + se.getColumnNumber() + ": " + se.getMessage());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!quiet) {<NEW_LINE>System.out.println("Validated " + xml);<NEW_LINE>}<NEW_LINE>valid = true;<NEW_LINE>}<NEW_LINE>return valid;<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>System.err.println("Unexpected error");<NEW_LINE>e.printStackTrace();<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>System.err.println("Fatal validation Error: " + e.getMessage());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
println("ERROR: while validating " + xml + " the following errors were found:");
1,742,370
public JsonMapper jsonMapper(ApplicationContext context) {<NEW_LINE>String preferredMapper = context.getEnvironment().containsProperty(JSON_MAPPER_PROPERTY) ? context.getEnvironment().getProperty(JSON_MAPPER_PROPERTY) : context.<MASK><NEW_LINE>if (StringUtils.hasText(preferredMapper)) {<NEW_LINE>if ("gson".equals(preferredMapper) && ClassUtils.isPresent("com.google.gson.Gson", null)) {<NEW_LINE>return gson(context);<NEW_LINE>} else if ("jackson".equals(preferredMapper) && ClassUtils.isPresent("com.fasterxml.jackson.databind.ObjectMapper", null)) {<NEW_LINE>return jackson(context);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (ClassUtils.isPresent("com.fasterxml.jackson.databind.ObjectMapper", null)) {<NEW_LINE>return jackson(context);<NEW_LINE>} else if (ClassUtils.isPresent("com.google.gson.Gson", null)) {<NEW_LINE>return gson(context);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new IllegalStateException("Failed to configure JsonMapper. Neither jackson nor gson are present on the claspath");<NEW_LINE>}
getEnvironment().getProperty(PREFERRED_MAPPER_PROPERTY);
1,549,761
public static EObject choose_and_invoke_constructor(EProc self, EObject[] args, Constructor<?>[] cons) {<NEW_LINE>for (int i = 0; i < cons.length; i++) {<NEW_LINE>// TODO: handle reflective invocation of Pausable methods<NEW_LINE>Constructor<?> m = cons[i];<NEW_LINE>Class<?>[] pt = m.getParameterTypes();<NEW_LINE>if (pt.length != args.length)<NEW_LINE>continue;<NEW_LINE>Object[] a;<NEW_LINE>try {<NEW_LINE>a = convert_args(self, pt, args);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>// TODO: make this a null check<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// point-of-no-return<NEW_LINE>Object result;<NEW_LINE>try {<NEW_LINE>result = m.newInstance(a);<NEW_LINE>} catch (InstantiationException e) {<NEW_LINE>throw ERT.badarg(args);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>throw ERT.badarg(args);<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>throw new ErlangError(am_badaccess, args);<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>Throwable te = e.getTargetException();<NEW_LINE>if (te instanceof ErlangException) {<NEW_LINE>throw (ErlangException) te;<NEW_LINE>} else {<NEW_LINE>ETuple reason = ETuple.make(EAtom.intern(te.getClass().getName()), EString.fromString(te.getMessage()));<NEW_LINE>throw new ErlangError(reason, args);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>throw new ErlangError(am_badfun, args);<NEW_LINE>}
JavaObject.box(self, result);
1,372,993
public synchronized StringBuffer insert(int index, char[] chars) {<NEW_LINE>int currentLength = lengthInternalUnsynchronized();<NEW_LINE>if (0 <= index && index <= currentLength) {<NEW_LINE>move(chars.length, index);<NEW_LINE>if (String.COMPACT_STRINGS) {<NEW_LINE>// Check if the StringBuffer is compressed<NEW_LINE>if (count >= 0 && String.canEncodeAsLatin1(chars, 0, chars.length)) {<NEW_LINE>String.compress(chars, 0, value, index, chars.length);<NEW_LINE>count = currentLength + chars.length;<NEW_LINE>return this;<NEW_LINE>} else {<NEW_LINE>// Check if the StringBuffer is compressed<NEW_LINE>if (count >= 0) {<NEW_LINE>decompress(value.length);<NEW_LINE>}<NEW_LINE>String.decompressedArrayCopy(chars, 0, value, index, chars.length);<NEW_LINE>count = (currentLength + chars.length) | uncompressedBit;<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String.decompressedArrayCopy(chars, 0, <MASK><NEW_LINE>count = currentLength + chars.length;<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new StringIndexOutOfBoundsException(index);<NEW_LINE>}<NEW_LINE>}
value, index, chars.length);
744,748
private void loadOtherHyperlink(Hyperlink link, final boolean hasFreeplaneFileExtension) {<NEW_LINE>URI uri = link.getUri();<NEW_LINE>try {<NEW_LINE>if (!uri.isAbsolute()) {<NEW_LINE>URI absoluteUri = getAbsoluteUri(uri);<NEW_LINE>if (absoluteUri == null) {<NEW_LINE>final MapModel map = Controller.getCurrentController().getMap();<NEW_LINE>if (map.getURL() == null)<NEW_LINE>UITools.errorMessage(TextUtils.getText("map_not_saved"));<NEW_LINE>else<NEW_LINE>UITools.errorMessage(TextUtils.format("link_not_found", String.valueOf(uri)));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>uri = absoluteUri;<NEW_LINE>link = new Hyperlink(absoluteUri);<NEW_LINE>}<NEW_LINE>// DOCEAR: mindmaps can be linked in a mindmap --> therefore project-relative-paths are possible<NEW_LINE>if (!asList(FILE_SCHEME, SMB_SCHEME, FREEPLANE_SCHEME).contains(uri.getScheme())) {<NEW_LINE>try {<NEW_LINE>uri = uri.toURL().openConnection().getURL().toURI().normalize();<NEW_LINE>} catch (Exception e) {<NEW_LINE>// ignore all exceptions due to unknown protocols<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (hasFreeplaneFileExtension) {<NEW_LINE>FreeplaneUriConverter freeplaneUriConverter = new FreeplaneUriConverter();<NEW_LINE>final URL url = freeplaneUriConverter.freeplaneUrl(uri);<NEW_LINE>final <MASK><NEW_LINE>modeController.getMapController().openMap(url);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Controller.getCurrentController().getViewController().openDocument(link);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>LogUtils.warn("link " + uri + " not found", e);<NEW_LINE>UITools.errorMessage(TextUtils.format("link_not_found", uri.toString()));<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>} catch (final MalformedURLException ex) {<NEW_LINE>LogUtils.warn("URL " + uri + " not found", ex);<NEW_LINE>UITools.errorMessage(TextUtils.format("link_not_found", uri));<NEW_LINE>}<NEW_LINE>}
ModeController modeController = Controller.getCurrentModeController();
699,771
File downloadAndUnpackContractsIfRequired(ContractVerifierConfigProperties config, File defaultContractsDir) {<NEW_LINE>String contractsDirFromProp = this.project.getProperties().getProperty(CONTRACTS_DIRECTORY_PROP);<NEW_LINE>File downloadedContractsDir = StringUtils.hasText(contractsDirFromProp) ? new File(contractsDirFromProp) : null;<NEW_LINE>// reuse downloaded contracts from another mojo<NEW_LINE>if (downloadedContractsDir != null && downloadedContractsDir.exists()) {<NEW_LINE>this.log.info("Another mojo has downloaded the contracts - will reuse them from [" + downloadedContractsDir + "]");<NEW_LINE>final ContractDownloader.InclusionProperties inclusionProperties = contractDownloader().createNewInclusionProperties(downloadedContractsDir);<NEW_LINE>config.setIncludedContracts(inclusionProperties.getIncludedContracts());<NEW_LINE>config.setIncludedRootFolderAntPattern(inclusionProperties.getIncludedRootFolderAntPattern());<NEW_LINE>return downloadedContractsDir;<NEW_LINE>} else if (shouldDownloadContracts()) {<NEW_LINE>this.log.info("Download dependency is provided - will retrieve contracts from a remote location");<NEW_LINE>final ContractDownloader contractDownloader = contractDownloader();<NEW_LINE>final File downloadedContracts = contractDownloader.unpackAndDownloadContracts();<NEW_LINE>final ContractDownloader.InclusionProperties inclusionProperties = contractDownloader.createNewInclusionProperties(downloadedContracts);<NEW_LINE>config.setIncludedContracts(inclusionProperties.getIncludedContracts());<NEW_LINE>config.setIncludedRootFolderAntPattern(inclusionProperties.getIncludedRootFolderAntPattern());<NEW_LINE>this.project.getProperties().setProperty(CONTRACTS_DIRECTORY_PROP, downloadedContracts.getAbsolutePath());<NEW_LINE>return downloadedContracts;<NEW_LINE>}<NEW_LINE>this.log.<MASK><NEW_LINE>return defaultContractsDir;<NEW_LINE>}
info("Will use contracts provided in the folder [" + defaultContractsDir + "]");
1,702,095
public int[] split(int[] domain, int[] nodes) {<NEW_LINE>int[] copies = new int[nodes.length];<NEW_LINE>IntIntMap map = new IntIntHashMap();<NEW_LINE>for (int i = 0; i < nodes.length; ++i) {<NEW_LINE>copies[i] = index++;<NEW_LINE>map.put(nodes[i], copies[i] + 1);<NEW_LINE>int proto = prototypeNodes.get(nodes[i]);<NEW_LINE>prototypeNodes.add(proto);<NEW_LINE>copyIndexes.add(++copyCount[proto]);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < domain.length; ++i) {<NEW_LINE>int node = domain[i];<NEW_LINE>for (int succ : graph.outgoingEdges(node)) {<NEW_LINE>int succCopy = map.get(succ);<NEW_LINE>if (succCopy == 0) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>--succCopy;<NEW_LINE>graph.deleteEdge(node, succ);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < nodes.length; ++i) {<NEW_LINE>int node = nodes[i];<NEW_LINE>int nodeCopy = copies[i];<NEW_LINE>for (int succ : graph.outgoingEdges(node)) {<NEW_LINE>int succCopy = map.get(succ);<NEW_LINE>if (succCopy != 0) {<NEW_LINE>graph.addEdge(nodeCopy, succCopy - 1);<NEW_LINE>} else {<NEW_LINE>graph.addEdge(nodeCopy, succ);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return copies;<NEW_LINE>}
graph.addEdge(node, succCopy);
653,877
public Button createButton(String name) {<NEW_LINE>Button button = new Button();<NEW_LINE>button.setName("btn" + name);<NEW_LINE>button.setId(name);<NEW_LINE>button.setAttribute(AdempiereIdGenerator.ZK_COMPONENT_PREFIX_ATTRIBUTE, button.getId());<NEW_LINE>String text = Msg.translate(<MASK><NEW_LINE>if (!name.equals(text))<NEW_LINE>text = text.replaceAll("[&]", "");<NEW_LINE>else<NEW_LINE>text = null;<NEW_LINE>if (m_withText && text != null) {<NEW_LINE>if (m_withImage) {<NEW_LINE>button.setImage("images/" + name + "16.png");<NEW_LINE>}<NEW_LINE>button.setLabel(text);<NEW_LINE>LayoutUtils.addSclass("action-text-button", button);<NEW_LINE>} else {<NEW_LINE>button.setImage("images/" + name + "16.png");<NEW_LINE>if (text != null)<NEW_LINE>button.setTooltiptext(text);<NEW_LINE>LayoutUtils.addSclass("action-button", button);<NEW_LINE>}<NEW_LINE>buttonMap.put(name, button);<NEW_LINE>return button;<NEW_LINE>}
Env.getCtx(), name);
902,510
public void onViewCreated(View view, Bundle savedInstanceState) {<NEW_LINE><MASK><NEW_LINE>if (getArguments().containsKey(TomahawkFragment.COLLECTION_ID)) {<NEW_LINE>String collectionId = getArguments().getString(TomahawkFragment.COLLECTION_ID);<NEW_LINE>Collection collection = CollectionManager.get().getCollection(collectionId);<NEW_LINE>if (collection == null) {<NEW_LINE>getActivity().getSupportFragmentManager().popBackStack();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>getActivity().setTitle(collection.getName());<NEW_LINE>if (collection instanceof UserCollection) {<NEW_LINE>showContentHeader(R.drawable.collection_header);<NEW_LINE>} else if (collection instanceof DbCollection) {<NEW_LINE>showContentHeader(((DbCollection) collection).getIconBackgroundPath());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("No collection-id provided to CollectionPagerFragment");<NEW_LINE>}<NEW_LINE>int initialPage = -1;<NEW_LINE>if (getArguments() != null) {<NEW_LINE>if (getArguments().containsKey(TomahawkFragment.CONTAINER_FRAGMENT_PAGE)) {<NEW_LINE>initialPage = getArguments().getInt(TomahawkFragment.CONTAINER_FRAGMENT_PAGE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<FragmentInfoList> fragmentInfoLists = new ArrayList<>();<NEW_LINE>FragmentInfoList fragmentInfoList = new FragmentInfoList();<NEW_LINE>FragmentInfo fragmentInfo = new FragmentInfo();<NEW_LINE>fragmentInfo.mClass = ArtistsFragment.class;<NEW_LINE>fragmentInfo.mTitle = getString(R.string.artists);<NEW_LINE>fragmentInfo.mBundle = getChildFragmentBundle();<NEW_LINE>fragmentInfoList.addFragmentInfo(fragmentInfo);<NEW_LINE>fragmentInfoLists.add(fragmentInfoList);<NEW_LINE>fragmentInfoList = new FragmentInfoList();<NEW_LINE>fragmentInfo = new FragmentInfo();<NEW_LINE>fragmentInfo.mClass = AlbumsFragment.class;<NEW_LINE>fragmentInfo.mTitle = getString(R.string.albums);<NEW_LINE>fragmentInfo.mBundle = getChildFragmentBundle();<NEW_LINE>fragmentInfoList.addFragmentInfo(fragmentInfo);<NEW_LINE>fragmentInfoLists.add(fragmentInfoList);<NEW_LINE>fragmentInfoList = new FragmentInfoList();<NEW_LINE>fragmentInfo = new FragmentInfo();<NEW_LINE>fragmentInfo.mClass = PlaylistEntriesFragment.class;<NEW_LINE>fragmentInfo.mTitle = getString(R.string.tracks);<NEW_LINE>fragmentInfo.mBundle = getChildFragmentBundle();<NEW_LINE>fragmentInfoList.addFragmentInfo(fragmentInfo);<NEW_LINE>fragmentInfoLists.add(fragmentInfoList);<NEW_LINE>setupPager(fragmentInfoLists, initialPage, null, 2);<NEW_LINE>}
super.onViewCreated(view, savedInstanceState);
159,681
public byte[] toByteArray() {<NEW_LINE>if (this.sign == 0) {<NEW_LINE>return new byte[] { 0 };<NEW_LINE>}<NEW_LINE>BigInteger temp = this;<NEW_LINE>int bitLen = bitLength();<NEW_LINE>int iThis = getFirstNonzeroDigit();<NEW_LINE>int bytesLen = (bitLen >> 3) + 1;<NEW_LINE>byte[] bytes = new byte[bytesLen];<NEW_LINE>int firstByteNumber = 0;<NEW_LINE>int highBytes;<NEW_LINE>int digitIndex = 0;<NEW_LINE>int bytesInInteger = 4;<NEW_LINE>int digit;<NEW_LINE>int hB;<NEW_LINE>if (bytesLen - (numberLength << 2) == 1) {<NEW_LINE>bytes[0] = (byte) ((sign < 0) ? -1 : 0);<NEW_LINE>highBytes = 4;<NEW_LINE>firstByteNumber++;<NEW_LINE>} else {<NEW_LINE>hB = bytesLen & 3;<NEW_LINE>highBytes = (hB == 0) ? 4 : hB;<NEW_LINE>}<NEW_LINE>digitIndex = iThis;<NEW_LINE>bytesLen -= iThis << 2;<NEW_LINE>if (sign < 0) {<NEW_LINE>digit = -temp.digits[digitIndex];<NEW_LINE>digitIndex++;<NEW_LINE>if (digitIndex == numberLength) {<NEW_LINE>bytesInInteger = highBytes;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < bytesInInteger; i++, digit >>= 8) {<NEW_LINE>bytes[<MASK><NEW_LINE>}<NEW_LINE>while (bytesLen > firstByteNumber) {<NEW_LINE>digit = ~temp.digits[digitIndex];<NEW_LINE>digitIndex++;<NEW_LINE>if (digitIndex == numberLength) {<NEW_LINE>bytesInInteger = highBytes;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < bytesInInteger; i++, digit >>= 8) {<NEW_LINE>bytes[--bytesLen] = (byte) digit;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>while (bytesLen > firstByteNumber) {<NEW_LINE>digit = temp.digits[digitIndex];<NEW_LINE>digitIndex++;<NEW_LINE>if (digitIndex == numberLength) {<NEW_LINE>bytesInInteger = highBytes;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < bytesInInteger; i++, digit >>= 8) {<NEW_LINE>bytes[--bytesLen] = (byte) digit;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return bytes;<NEW_LINE>}
--bytesLen] = (byte) digit;
1,522,833
public void calculateWeights() {<NEW_LINE>distribution.clear();<NEW_LINE>VertexAttributes attributes = mesh.getVertexAttributes();<NEW_LINE>int indicesCount = mesh.getNumIndices();<NEW_LINE>int vertexCount = mesh.getNumVertices();<NEW_LINE>int vertexSize = (short) (attributes.vertexSize / 4), positionOffset = (short) (attributes.findByUsage(Usage.Position).offset / 4);<NEW_LINE>float[] vertices <MASK><NEW_LINE>mesh.getVertices(vertices);<NEW_LINE>if (indicesCount > 0) {<NEW_LINE>short[] indices = new short[indicesCount];<NEW_LINE>mesh.getIndices(indices);<NEW_LINE>// Calculate the Area<NEW_LINE>for (int i = 0; i < indicesCount; i += 3) {<NEW_LINE>int p1Offset = indices[i] * vertexSize + positionOffset, p2Offset = indices[i + 1] * vertexSize + positionOffset, p3Offset = indices[i + 2] * vertexSize + positionOffset;<NEW_LINE>float x1 = vertices[p1Offset], y1 = vertices[p1Offset + 1], z1 = vertices[p1Offset + 2], x2 = vertices[p2Offset], y2 = vertices[p2Offset + 1], z2 = vertices[p2Offset + 2], x3 = vertices[p3Offset], y3 = vertices[p3Offset + 1], z3 = vertices[p3Offset + 2];<NEW_LINE>float area = Math.abs((x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2f);<NEW_LINE>distribution.add(new Triangle(x1, y1, z1, x2, y2, z2, x3, y3, z3), area);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Calculate the Area<NEW_LINE>for (int i = 0; i < vertexCount; i += vertexSize) {<NEW_LINE>int p1Offset = i + positionOffset, p2Offset = p1Offset + vertexSize, p3Offset = p2Offset + vertexSize;<NEW_LINE>float x1 = vertices[p1Offset], y1 = vertices[p1Offset + 1], z1 = vertices[p1Offset + 2], x2 = vertices[p2Offset], y2 = vertices[p2Offset + 1], z2 = vertices[p2Offset + 2], x3 = vertices[p3Offset], y3 = vertices[p3Offset + 1], z3 = vertices[p3Offset + 2];<NEW_LINE>float area = Math.abs((x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) / 2f);<NEW_LINE>distribution.add(new Triangle(x1, y1, z1, x2, y2, z2, x3, y3, z3), area);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Generate cumulative distribution<NEW_LINE>distribution.generateNormalized();<NEW_LINE>}
= new float[vertexCount * vertexSize];
818,626
public StoredContext stashContext() {<NEW_LINE>final <MASK><NEW_LINE>boolean hasHeadersToCopy = false;<NEW_LINE>if (context.requestHeaders.isEmpty() == false) {<NEW_LINE>for (String header : HEADERS_TO_COPY) {<NEW_LINE>if (context.requestHeaders.containsKey(header)) {<NEW_LINE>hasHeadersToCopy = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasHeadersToCopy) {<NEW_LINE>Map<String, String> map = headers(context);<NEW_LINE>ThreadContextStruct threadContextStruct = DEFAULT_CONTEXT.putHeaders(map);<NEW_LINE>threadLocal.set(threadContextStruct);<NEW_LINE>} else {<NEW_LINE>threadLocal.set(DEFAULT_CONTEXT);<NEW_LINE>}<NEW_LINE>return () -> {<NEW_LINE>// If the node and thus the threadLocal get closed while this task<NEW_LINE>// is still executing, we don't want this runnable to fail with an<NEW_LINE>// uncaught exception<NEW_LINE>threadLocal.set(context);<NEW_LINE>};<NEW_LINE>}
ThreadContextStruct context = threadLocal.get();
165,920
public DescribeProtectionGroupResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeProtectionGroupResult describeProtectionGroupResult = new DescribeProtectionGroupResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeProtectionGroupResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("ProtectionGroup", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeProtectionGroupResult.setProtectionGroup(ProtectionGroupJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeProtectionGroupResult;<NEW_LINE>}
().unmarshall(context));
1,488,280
public static void main(String[] args) throws TwilioRestException {<NEW_LINE>TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);<NEW_LINE>String[] randomMessages = { "Working hard", "Gotta ship this feature", "Someone fucked the system again" };<NEW_LINE>int randomIndex = new Random().nextInt(randomMessages.length);<NEW_LINE>String finalMessage = (randomMessages[randomIndex]);<NEW_LINE>List<NameValuePair> params = new ArrayList<NameValuePair>();<NEW_LINE>params.add(new BasicNameValuePair("Body", "Late at work. " + finalMessage));<NEW_LINE>params.add(new BasicNameValuePair("From", YOUR_NUMBER));<NEW_LINE>params.add(<MASK><NEW_LINE>MessageFactory messageFactory = client.getAccount().getMessageFactory();<NEW_LINE>Message message = messageFactory.create(params);<NEW_LINE>System.out.println(message.getSid());<NEW_LINE>}
new BasicNameValuePair("To", HER_NUMBER));
1,428,775
public void deleteSnapshots(Collection<SnapshotId> snapshotIds, long repositoryStateId, Version repositoryMetaVersion, ActionListener<RepositoryData> listener) {<NEW_LINE>if (isReadOnly()) {<NEW_LINE>listener.onFailure(new RepositoryException(metadata.name(), "cannot delete snapshot from a readonly repository"));<NEW_LINE>} else {<NEW_LINE>threadPool.executor(ThreadPool.Names.SNAPSHOT).execute(new AbstractRunnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void doRun() throws Exception {<NEW_LINE>final Map<String, BlobMetadata> rootBlobs <MASK><NEW_LINE>final RepositoryData repositoryData = safeRepositoryData(repositoryStateId, rootBlobs);<NEW_LINE>// Cache the indices that were found before writing out the new index-N blob so that a stuck master will never<NEW_LINE>// delete an index that was created by another master node after writing this index-N blob.<NEW_LINE>final Map<String, BlobContainer> foundIndices = blobStore().blobContainer(indicesPath()).children();<NEW_LINE>doDeleteShardSnapshots(snapshotIds, repositoryStateId, foundIndices, rootBlobs, repositoryData, repositoryMetaVersion, listener);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(Exception e) {<NEW_LINE>listener.onFailure(new RepositoryException(metadata.name(), "failed to delete snapshots " + snapshotIds, e));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
= blobContainer().listBlobs();
86,232
protected <T> T executeRetrieveObject(final Type returnObjectType, final String uri, final Map<String, String> parameters) throws BigSwitchBcfApiException {<NEW_LINE>checkInvariants();<NEW_LINE>GetMethod gm = (GetMethod) createMethod("get", uri, _port);<NEW_LINE>setHttpHeader(gm);<NEW_LINE>if (parameters != null && !parameters.isEmpty()) {<NEW_LINE>List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(parameters.size());<NEW_LINE>for (Entry<String, String> e : parameters.entrySet()) {<NEW_LINE>nameValuePairs.add(new NameValuePair(e.getKey(), e.getValue()));<NEW_LINE>}<NEW_LINE>gm.setQueryString(nameValuePairs.toArray(new NameValuePair[0]));<NEW_LINE>}<NEW_LINE>executeMethod(gm);<NEW_LINE>String hash = checkResponse(gm, "BigSwitch HTTP get failed: ");<NEW_LINE>T returnValue;<NEW_LINE>try {<NEW_LINE>// CAUTIOUS: Safety margin of 2048 characters - extend if needed.<NEW_LINE>returnValue = (T) gson.fromJson(gm.getResponseBodyAsString(2048), returnObjectType);<NEW_LINE>} catch (IOException e) {<NEW_LINE>S_LOGGER.error("IOException while retrieving response body", e);<NEW_LINE>throw new BigSwitchBcfApiException(e);<NEW_LINE>} finally {<NEW_LINE>gm.releaseConnection();<NEW_LINE>}<NEW_LINE>if (returnValue instanceof ControlClusterStatus) {<NEW_LINE>if (HASH_CONFLICT.equals(hash)) {<NEW_LINE>isPrimary = true;<NEW_LINE>((ControlClusterStatus) returnValue).setTopologySyncRequested(true);<NEW_LINE>} else if (!HASH_IGNORE.equals(hash) && !isPrimary) {<NEW_LINE>isPrimary = true;<NEW_LINE>((ControlClusterStatus<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return returnValue;<NEW_LINE>}
) returnValue).setTopologySyncRequested(true);
1,402,547
public void createPrivateAccess(final CreateRecordPrivateAccessRequest request) {<NEW_LINE>I_AD_Private_Access accessRecord = queryPrivateAccess(request.getPrincipal(), request.getRecordRef()).create(<MASK><NEW_LINE>if (accessRecord == null) {<NEW_LINE>accessRecord = InterfaceWrapperHelper.newInstance(I_AD_Private_Access.class);<NEW_LINE>accessRecord.setAD_User_ID(UserId.toRepoId(request.getPrincipal().getUserId()));<NEW_LINE>accessRecord.setAD_UserGroup_ID(UserGroupId.toRepoId(request.getPrincipal().getUserGroupId()));<NEW_LINE>accessRecord.setAD_Table_ID(request.getRecordRef().getAD_Table_ID());<NEW_LINE>accessRecord.setRecord_ID(request.getRecordRef().getRecord_ID());<NEW_LINE>}<NEW_LINE>accessRecord.setAD_Org_ID(OrgId.ANY.getRepoId());<NEW_LINE>accessRecord.setIsActive(true);<NEW_LINE>saveRecord(accessRecord);<NEW_LINE>}
).firstOnly(I_AD_Private_Access.class);
1,795,960
private void deleteSearchData(Urn urn, String entityName, AspectSpec aspectSpec, RecordTemplate aspect, Boolean isKeyAspect) {<NEW_LINE>String docId;<NEW_LINE>try {<NEW_LINE>docId = URLEncoder.encode(urn.toString(), "UTF-8");<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>log.error("Failed to encode the urn with error: {}", e.toString());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (isKeyAspect) {<NEW_LINE>_entitySearchService.deleteDocument(entityName, docId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Optional<String> searchDocument;<NEW_LINE>try {<NEW_LINE>searchDocument = _searchDocumentTransformer.transformAspect(urn, aspect, aspectSpec, true);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Error in getting documents from aspect: {} for aspect {}", e, aspectSpec.getName());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!searchDocument.isPresent()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>_entitySearchService.upsertDocument(entityName, <MASK><NEW_LINE>}
searchDocument.get(), docId);
886,928
public Clustering<KMeansModel> run(Relation<NumberVector> relation) {<NEW_LINE>CFTree tree = cffactory.newTree(relation.getDBIDs(), relation);<NEW_LINE>// For efficiency, we also need the mean of each CF:<NEW_LINE>ClusteringFeature[] cfs = new ClusteringFeature[tree.leaves];<NEW_LINE>double[][] cfmeans = new double[tree.leaves][];<NEW_LINE>int z = 0;<NEW_LINE>for (LeafIterator iter = tree.leafIterator(); iter.valid(); iter.advance()) {<NEW_LINE>ClusteringFeature f = cfs[z] = iter.get();<NEW_LINE>cfmeans[z] = times(f.ls, 1. / f.n);<NEW_LINE>z++;<NEW_LINE>}<NEW_LINE>int[] assignment = new int[tree.leaves], weights = new int[k];<NEW_LINE>Arrays.fill(assignment, -1);<NEW_LINE>double[][] means = kmeans(cfmeans, cfs, assignment, weights);<NEW_LINE>// The CFTree does not store points. We have to reassign them; but rather<NEW_LINE>// than assigning them to n > k cluster features, we just assign them to the<NEW_LINE>// nearest CF, we assign them to the means directly (there currently is no<NEW_LINE>// API that would allow a user to get the means only, and no cluster<NEW_LINE>// assignment for each point).<NEW_LINE>double[] varsum = new double[k];<NEW_LINE>ModifiableDBIDs[] ids = new ModifiableDBIDs[k];<NEW_LINE>for (int i = 0; i < k; i++) {<NEW_LINE>ids[i] = DBIDUtil<MASK><NEW_LINE>}<NEW_LINE>for (DBIDIter iter = relation.iterDBIDs(); iter.valid(); iter.advance()) {<NEW_LINE>NumberVector fv = relation.get(iter);<NEW_LINE>double mindist = distance(fv, means[0]);<NEW_LINE>int minIndex = 0;<NEW_LINE>for (int i = 1; i < k; i++) {<NEW_LINE>double dist = distance(fv, means[i]);<NEW_LINE>if (dist < mindist) {<NEW_LINE>minIndex = i;<NEW_LINE>mindist = dist;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>varsum[minIndex] += mindist;<NEW_LINE>ids[minIndex].add(iter);<NEW_LINE>}<NEW_LINE>Clustering<KMeansModel> result = new Clustering<>();<NEW_LINE>for (int i = 0; i < ids.length; i++) {<NEW_LINE>KMeansModel model = new KMeansModel(means[i], varsum[i]);<NEW_LINE>result.addToplevelCluster(new Cluster<KMeansModel>(ids[i], model));<NEW_LINE>}<NEW_LINE>Metadata.of(result).setLongName("BIRCH k-Means Clustering");<NEW_LINE>return result;<NEW_LINE>}
.newArray(weights[i]);
1,407,728
public void onFilterEventDispatched(String sessionId, String uniqueSessionId, String connectionId, String streamId, String filterType, GenericMediaEvent event, Set<Participant> participants, Set<String> subscribedParticipants) {<NEW_LINE>CDR.recordFilterEventDispatched(sessionId, uniqueSessionId, connectionId, streamId, filterType, event);<NEW_LINE>JsonObject params = new JsonObject();<NEW_LINE>params.addProperty(ProtocolElements.FILTEREVENTLISTENER_CONNECTIONID_PARAM, connectionId);<NEW_LINE>params.addProperty(ProtocolElements.FILTEREVENTLISTENER_STREAMID_PARAM, streamId);<NEW_LINE>params.addProperty(ProtocolElements.FILTEREVENTLISTENER_FILTERTYPE_PARAM, filterType);<NEW_LINE>params.addProperty(ProtocolElements.FILTEREVENTLISTENER_EVENTTYPE_PARAM, event.getType());<NEW_LINE>params.addProperty(ProtocolElements.FILTEREVENTLISTENER_DATA_PARAM, event.getData().toString());<NEW_LINE>for (Participant p : participants) {<NEW_LINE>if (subscribedParticipants.contains(p.getParticipantPublicId())) {<NEW_LINE>rpcNotificationService.sendNotification(p.getParticipantPrivateId(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
), ProtocolElements.FILTEREVENTDISPATCHED_METHOD, params);
1,596,152
public void downloadFileViaToken(String token, String range, Boolean genericMimetype, Boolean inline) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'token' is set<NEW_LINE>if (token == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'token' when calling downloadFileViaToken");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/downloads/{token}".replaceAll("\\{" + "token" + "\\}", apiClient.escapeString(token.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "generic_mimetype", genericMimetype));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs<MASK><NEW_LINE>if (range != null)<NEW_LINE>localVarHeaderParams.put("Range", apiClient.parameterToString(range));<NEW_LINE>final String[] localVarAccepts = { "application/octet-stream" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);<NEW_LINE>}
("", "inline", inline));
587,380
private Object callValidation(ActionParam actionParam) {<NEW_LINE>String entityType = actionParam.getEntityType();<NEW_LINE>String entityValue = actionParam.getEntityValue();<NEW_LINE>if (entityType.equals("unknown") || entityValue.equals("unknown")) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Long actionId = actionParam.getActionId();<NEW_LINE>ActionExample actionExample = new ActionExample();<NEW_LINE>List<String> successStatuses = Arrays.asList("SUCCESS", "CANCELED", "REJECTED", <MASK><NEW_LINE>ActionExample.Criteria criteria = actionExample.createCriteria();<NEW_LINE>criteria.andActionIdEqualTo(actionId);<NEW_LINE>criteria.andEntityTypeEqualTo(entityType);<NEW_LINE>criteria.andEntityValueEqualTo(entityValue);<NEW_LINE>criteria.andStatusNotIn(successStatuses);<NEW_LINE>List<ActionDO> actionDOS = actionDAO.selectByParam(actionExample);<NEW_LINE>if (actionDOS.size() > 0) {<NEW_LINE>JSONArray array = new JSONArray();<NEW_LINE>JSONObject data = new JSONObject();<NEW_LINE>JSONObject message = new JSONObject();<NEW_LINE>message.put("Error", String.format("Current entity %s has unfinished action", entityValue));<NEW_LINE>data.put("data", message);<NEW_LINE>data.put("type", "kvlist");<NEW_LINE>array.add(data);<NEW_LINE>JSONObject result = new JSONObject();<NEW_LINE>result.put("feedbacks", array);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
Status.EXCEPTION.toString());
672,467
final DeleteExpressionResult executeDeleteExpression(DeleteExpressionRequest deleteExpressionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteExpressionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DeleteExpressionRequest> request = null;<NEW_LINE>Response<DeleteExpressionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteExpressionRequestMarshaller().marshall(super.beforeMarshalling(deleteExpressionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudSearch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteExpression");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DeleteExpressionResult> responseHandler = new StaxResponseHandler<DeleteExpressionResult>(new DeleteExpressionResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
16,010
private void uploadResultsToGcs(String destination) {<NEW_LINE>checkArgument(!<MASK><NEW_LINE>Path bucketWithFolder = Paths.get(destination, createUniqueFolderName());<NEW_LINE>String bucket = bucketWithFolder.getName(0).toString();<NEW_LINE>Path folder = bucketWithFolder.subpath(1, bucketWithFolder.getNameCount());<NEW_LINE>StorageOptions.Builder storageOptions = StorageOptions.newBuilder();<NEW_LINE>if (!isNullOrEmpty(credentialsFile)) {<NEW_LINE>try {<NEW_LINE>storageOptions.setCredentials(GoogleCredentials.fromStream(new FileInputStream(credentialsFile)));<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UncheckedIOException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Storage storage = storageOptions.build().getService();<NEW_LINE>FilesWithEntryPoint filesToUpload = generateFilesToUpload();<NEW_LINE>System.out.format("ReportUploader: going to upload %s files to %s/%s\n", filesToUpload.files().size(), bucket, folder);<NEW_LINE>if ("yes".equals(multithreadedUpload)) {<NEW_LINE>System.out.format("ReportUploader: multi-threaded upload\n");<NEW_LINE>uploadFilesToGcsMultithread(storage, bucket, folder, filesToUpload.files());<NEW_LINE>} else {<NEW_LINE>System.out.format("ReportUploader: single threaded upload\n");<NEW_LINE>filesToUpload.files().forEach((path, dataSupplier) -> {<NEW_LINE>System.out.format("ReportUploader: Uploading %s\n", path);<NEW_LINE>uploadFileToGcs(storage, bucket, folder.resolve(path), dataSupplier);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>System.out.format("ReportUploader: report uploaded to https://storage.googleapis.com/%s/%s\n", bucket, folder.resolve(filesToUpload.entryPoint()));<NEW_LINE>}
destination.isEmpty(), "destination must include at least the bucket name, but is empty");
119,916
public void compact(String tableName, CompactionConfig config) throws AccumuloSecurityException, TableNotFoundException, AccumuloException {<NEW_LINE>EXISTING_TABLE_NAME.validate(tableName);<NEW_LINE>// Ensure compaction iterators exist on a tabletserver<NEW_LINE>final String skviName = SortedKeyValueIterator.class.getName();<NEW_LINE>for (IteratorSetting setting : config.getIterators()) {<NEW_LINE>String iteratorClass = setting.getIteratorClass();<NEW_LINE>if (!testClassLoad(tableName, iteratorClass, skviName)) {<NEW_LINE>throw new AccumuloException("TabletServer could not load iterator class " + iteratorClass);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ensureStrategyCanLoad(tableName, config);<NEW_LINE>if (!UserCompactionUtils.isDefault(config.getConfigurer())) {<NEW_LINE>if (!testClassLoad(tableName, config.getConfigurer().getClassName(), CompactionConfigurer.class.getName())) {<NEW_LINE>throw new AccumuloException("TabletServer could not load " + CompactionConfigurer.class.getSimpleName() + " class " + config.getConfigurer().getClassName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!UserCompactionUtils.isDefault(config.getSelector())) {<NEW_LINE>if (!testClassLoad(tableName, config.getSelector().getClassName(), CompactionSelector.class.getName())) {<NEW_LINE>throw new AccumuloException("TabletServer could not load " + CompactionSelector.class.getSimpleName() + " class " + config.getSelector().getClassName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>TableId tableId = context.getTableId(tableName);<NEW_LINE>Text start = config.getStartRow();<NEW_LINE>Text end = config.getEndRow();<NEW_LINE>if (config.getFlush())<NEW_LINE>_flush(tableId, start, end, true);<NEW_LINE>List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableId.canonical().getBytes(UTF_8)), ByteBuffer.wrap(UserCompactionUtils.encode(config)));<NEW_LINE>Map<String, String> opts = new HashMap<>();<NEW_LINE>try {<NEW_LINE>doFateOperation(FateOperation.TABLE_COMPACT, args, opts, <MASK><NEW_LINE>} catch (TableExistsException | NamespaceExistsException e) {<NEW_LINE>// should not happen<NEW_LINE>throw new AssertionError(e);<NEW_LINE>} catch (NamespaceNotFoundException e) {<NEW_LINE>throw new TableNotFoundException(null, tableName, "Namespace not found", e);<NEW_LINE>}<NEW_LINE>}
tableName, config.getWait());
1,395,997
private static PartitionInfo createPartitionInfo(ObjectObjectCursor<String, IndexMetadata> indexMetadataEntry) {<NEW_LINE>var indexName = indexMetadataEntry.key;<NEW_LINE>var indexMetadata = indexMetadataEntry.value;<NEW_LINE>PartitionName <MASK><NEW_LINE>try {<NEW_LINE>MappingMetadata mappingMetadata = indexMetadata.mapping();<NEW_LINE>if (mappingMetadata == null) {<NEW_LINE>LOGGER.trace("Cannot resolve mapping definition of index {}", indexName);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Map<String, Object> mappingMap = mappingMetadata.sourceAsMap();<NEW_LINE>Map<String, Object> valuesMap = buildValuesMap(partitionName, mappingMap);<NEW_LINE>Settings settings = indexMetadata.getSettings();<NEW_LINE>String numberOfReplicas = NumberOfReplicas.fromSettings(settings);<NEW_LINE>return new PartitionInfo(partitionName, indexMetadata.getNumberOfShards(), numberOfReplicas, IndexMetadata.SETTING_INDEX_VERSION_CREATED.get(settings), settings.getAsVersion(IndexMetadata.SETTING_VERSION_UPGRADED, null), DocIndexMetadata.isClosed(indexMetadata, mappingMap, false), valuesMap, indexMetadata.getSettings());<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.trace("error extracting partition infos from index " + indexMetadata, e);<NEW_LINE>// must filter on null<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
partitionName = PartitionName.fromIndexOrTemplate(indexName);
809,082
private void writeContent(final ITreeWriter writer, final NodeModel node, final NodeStyleModel style, final boolean forceFormatting) throws IOException {<NEW_LINE>if (!NodeWriter.shouldWriteSharedContent(writer))<NEW_LINE>return;<NEW_LINE>if (forceFormatting || style != null) {<NEW_LINE>final XMLElement fontElement = new XMLElement();<NEW_LINE>fontElement.setName("font");<NEW_LINE>boolean isRelevant = forceFormatting;<NEW_LINE>final String fontFamilyName = forceFormatting ? nsc.getFontFamilyName(node, StyleOption.FOR_UNSELECTED_NODE) : style.getFontFamilyName();<NEW_LINE>if (fontFamilyName != null) {<NEW_LINE>fontElement.setAttribute("NAME", fontFamilyName);<NEW_LINE>isRelevant = true;<NEW_LINE>}<NEW_LINE>final Integer fontSize = forceFormatting ? Integer.valueOf(nsc.getFontSize(node, StyleOption.FOR_UNSELECTED_NODE)) : style.getFontSize();<NEW_LINE>if (fontSize != null) {<NEW_LINE>fontElement.setAttribute("SIZE", Integer.toString(fontSize));<NEW_LINE>isRelevant = true;<NEW_LINE>}<NEW_LINE>final Boolean bold = forceFormatting ? Boolean.valueOf(nsc.isBold(node, StyleOption.FOR_UNSELECTED_NODE<MASK><NEW_LINE>if (bold != null) {<NEW_LINE>fontElement.setAttribute("BOLD", bold ? "true" : "false");<NEW_LINE>isRelevant = true;<NEW_LINE>}<NEW_LINE>final Boolean strikedThrough = forceFormatting ? Boolean.valueOf(nsc.isStrikedThrough(node, StyleOption.FOR_UNSELECTED_NODE)) : style.isStrikedThrough();<NEW_LINE>if (strikedThrough != null) {<NEW_LINE>fontElement.setAttribute("STRIKETHROUGH", strikedThrough ? "true" : "false");<NEW_LINE>isRelevant = true;<NEW_LINE>}<NEW_LINE>final Boolean italic = forceFormatting ? Boolean.valueOf(nsc.isItalic(node, StyleOption.FOR_UNSELECTED_NODE)) : style.isItalic();<NEW_LINE>if (italic != null) {<NEW_LINE>fontElement.setAttribute("ITALIC", italic ? "true" : "false");<NEW_LINE>isRelevant = true;<NEW_LINE>}<NEW_LINE>if (isRelevant) {<NEW_LINE>writer.addElement(style, fontElement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
)) : style.isBold();
1,284,151
public void update() {<NEW_LINE>if (canUpdate()) {<NEW_LINE><MASK><NEW_LINE>if (con.isActiveExternalConnection(dir)) {<NEW_LINE>IFilter outputFilter = con.getOutputFilter(dir);<NEW_LINE>IFilter inputFilter = con.getInputFilter(dir);<NEW_LINE>if (outputFilter != null || inputFilter != null) {<NEW_LINE>TileEntity te = BlockEnder.getAnyTileEntitySafe(world, pos.offset(dir));<NEW_LINE>if (te != null && !(te instanceof IStorageProvider)) {<NEW_LINE>if (outputFilter instanceof IItemFilter || inputFilter instanceof IItemFilter) {<NEW_LINE>updateDirItems(dir, outputFilter, inputFilter, te);<NEW_LINE>}<NEW_LINE>if (outputFilter instanceof IFluidFilter || inputFilter instanceof IFluidFilter) {<NEW_LINE>updateDirFluids(dir, outputFilter, inputFilter, te);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
EnumFacing dir = dirsToCheck.next();
925,639
private void createQtyReportEvent(final IContextAware context, final I_PMM_Product pmmProduct, final SyncProductSupply syncProductSupply) {<NEW_LINE>logger.debug("Creating QtyReport event from {} ({})", syncProductSupply, pmmProduct);<NEW_LINE>final List<String> errors = new ArrayList<>();<NEW_LINE>final I_PMM_QtyReport_Event qtyReportEvent = InterfaceWrapperHelper.newInstance(I_PMM_QtyReport_Event.class, context);<NEW_LINE>try {<NEW_LINE>qtyReportEvent.setEvent_UUID(syncProductSupply.getUuid());<NEW_LINE>// Product<NEW_LINE>qtyReportEvent.setProduct_UUID(syncProductSupply.getProduct_uuid());<NEW_LINE>qtyReportEvent.setPMM_Product(pmmProduct);<NEW_LINE>// BPartner<NEW_LINE>final String bpartner_uuid = syncProductSupply.getBpartner_uuid();<NEW_LINE>qtyReportEvent.setPartner_UUID(bpartner_uuid);<NEW_LINE>if (!Check.isEmpty(bpartner_uuid, true)) {<NEW_LINE>final int bpartnerId = SyncUUIDs.getC_BPartner_ID(bpartner_uuid);<NEW_LINE>qtyReportEvent.setC_BPartner_ID(bpartnerId);<NEW_LINE>} else {<NEW_LINE>errors.add("@Missing@ @" + I_C_BPartner.COLUMNNAME_C_BPartner_ID + "@");<NEW_LINE>}<NEW_LINE>// C_FlatrateTerm<NEW_LINE>final String contractLine_uuid = syncProductSupply.getContractLine_uuid();<NEW_LINE>qtyReportEvent.setContractLine_UUID(contractLine_uuid);<NEW_LINE>if (!Check.isEmpty(contractLine_uuid, true)) {<NEW_LINE>final int flatrateTermId = SyncUUIDs.getC_Flatrate_Term_ID(contractLine_uuid);<NEW_LINE>qtyReportEvent.setC_Flatrate_Term_ID(flatrateTermId);<NEW_LINE>}<NEW_LINE>// QtyPromised(CU)<NEW_LINE>final BigDecimal qtyPromised = CoalesceUtil.coalesce(syncProductSupply.getQty(), BigDecimal.ZERO);<NEW_LINE>qtyReportEvent.setQtyPromised(qtyPromised);<NEW_LINE>// DatePromised<NEW_LINE>final Timestamp datePromised = TimeUtil.<MASK><NEW_LINE>qtyReportEvent.setDatePromised(datePromised);<NEW_LINE>// Is a weekly planning record?<NEW_LINE>qtyReportEvent.setIsPlanning(syncProductSupply.isWeekPlanning());<NEW_LINE>//<NEW_LINE>// Update the QtyReport event<NEW_LINE>updateFromPMMProduct(qtyReportEvent, errors);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>logger.error("Failed importing " + syncProductSupply, e);<NEW_LINE>errors.add(e.getLocalizedMessage());<NEW_LINE>} finally {<NEW_LINE>//<NEW_LINE>// check if we have errors to report<NEW_LINE>if (!errors.isEmpty()) {<NEW_LINE>final String errorMsg = Joiner.on("\n").skipNulls().join(errors);<NEW_LINE>final IMsgBL msgBL = Services.get(IMsgBL.class);<NEW_LINE>final Properties ctx = InterfaceWrapperHelper.getCtx(qtyReportEvent);<NEW_LINE>qtyReportEvent.setErrorMsg(msgBL.translate(ctx, errorMsg));<NEW_LINE>qtyReportEvent.setIsError(true);<NEW_LINE>InterfaceWrapperHelper.save(qtyReportEvent);<NEW_LINE>logger.debug("Got following errors while importing {} to {}:\n{}", syncProductSupply, qtyReportEvent, errorMsg);<NEW_LINE>} else {<NEW_LINE>InterfaceWrapperHelper.save(qtyReportEvent);<NEW_LINE>logger.debug("Imported {} to {}", syncProductSupply, qtyReportEvent);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Notify agent that we got the message<NEW_LINE>final boolean isInternalGenerated = syncProductSupply.getUuid() == null;<NEW_LINE>if (!isInternalGenerated) {<NEW_LINE>final String serverEventId = String.valueOf(qtyReportEvent.getPMM_QtyReport_Event_ID());<NEW_LINE>SyncConfirmationsSender.forCurrentTransaction(senderToProcurementWebUI).confirm(syncProductSupply, serverEventId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
asTimestamp(syncProductSupply.getDay());
1,472,962
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>String test = request.getParameter("testMethod");<NEW_LINE>String fileName = request.getParameter("fileName");<NEW_LINE>PrintWriter out = response.getWriter();<NEW_LINE>try {<NEW_LINE>out.println(getClass().getSimpleName() + " is starting " + test + "<br>");<NEW_LINE>System.out.println("-----> " + test + " starting");<NEW_LINE>if (fileName == null) {<NEW_LINE>getClass().getMethod(test, PrintWriter.class).invoke(this, out);<NEW_LINE>} else {<NEW_LINE>getClass().getMethod(test, PrintWriter.class, String.class).invoke(this, out, fileName);<NEW_LINE>}<NEW_LINE>System.out.<MASK><NEW_LINE>out.println(test + " " + SUCCESS_MESSAGE);<NEW_LINE>} catch (Throwable x) {<NEW_LINE>if (x instanceof InvocationTargetException)<NEW_LINE>x = x.getCause();<NEW_LINE>System.out.println("<----- " + test + " failed:");<NEW_LINE>x.printStackTrace(System.out);<NEW_LINE>out.println("<pre>ERROR in " + test + ":");<NEW_LINE>x.printStackTrace(out);<NEW_LINE>out.println("</pre>");<NEW_LINE>} finally {<NEW_LINE>out.flush();<NEW_LINE>out.close();<NEW_LINE>}<NEW_LINE>}
println("<----- " + test + " successful");
704,303
private ComponentAnimation replaceComponents(final Component current, final Component next, final Transition t, boolean wait, boolean dropEvents, Runnable onFinish, int growSpeed, int layoutAnimationSpeed, boolean addAnimtion) {<NEW_LINE>if (!contains(current)) {<NEW_LINE>throw new IllegalArgumentException("Component " + current + " is not contained in this Container");<NEW_LINE>}<NEW_LINE>if (t == null || !isVisible() || getComponentForm() == null) {<NEW_LINE>next.setX(current.getX());<NEW_LINE>next.setY(current.getY());<NEW_LINE>next.setWidth(current.getWidth());<NEW_LINE>next.setHeight(current.getHeight());<NEW_LINE>replace(current, next, false);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>setScrollX(0);<NEW_LINE>setScrollY(0);<NEW_LINE>next.setX(current.getX());<NEW_LINE>next.setY(current.getY());<NEW_LINE>next.setWidth(current.getWidth());<NEW_LINE>next.setHeight(current.getHeight());<NEW_LINE>next.setParent(this);<NEW_LINE>if (next instanceof Container) {<NEW_LINE>((Container) next).layoutContainer();<NEW_LINE>}<NEW_LINE>final TransitionAnimation anim = new TransitionAnimation(this, current, next, t);<NEW_LINE>anim.growSpeed = growSpeed;<NEW_LINE>anim.layoutAnimationSpeed = layoutAnimationSpeed;<NEW_LINE>// register the transition animation<NEW_LINE>if (addAnimtion) {<NEW_LINE>if (wait) {<NEW_LINE>getAnimationManager().addAnimationAndBlock(anim);<NEW_LINE>} else {<NEW_LINE>if (onFinish != null) {<NEW_LINE>getAnimationManager().addUIMutation(this, anim, onFinish);<NEW_LINE>} else {<NEW_LINE>getAnimationManager(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return anim;<NEW_LINE>}
).addUIMutation(this, anim);
1,458,265
final ListDevicesResult executeListDevices(ListDevicesRequest listDevicesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDevicesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListDevicesRequest> request = null;<NEW_LINE>Response<ListDevicesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListDevicesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDevicesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Device Farm");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDevices");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListDevicesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new ListDevicesResultJsonUnmarshaller());
737,948
public List<Handler> createHandlers(EndpointInfo edpInfo, JaxWsInstanceManager instanceMgr) {<NEW_LINE>List<HandlerInfo> handlerInfos = edpInfo.getHandlerChainsInfo().getAllHandlerInfos();<NEW_LINE>Iterator<HandlerInfo<MASK><NEW_LINE>List<Handler> handlers = new ArrayList<Handler>(handlerInfos.size());<NEW_LINE>while (handlerIter.hasNext()) {<NEW_LINE>final HandlerInfo hInfo = handlerIter.next();<NEW_LINE>Handler handler = null;<NEW_LINE>try {<NEW_LINE>handler = (Handler) instanceMgr.createInstance(hInfo.getHandlerClass(), new JaxWsHandlerChainInstanceInterceptor(this.bus, hInfo));<NEW_LINE>} catch (InstantiationException e) {<NEW_LINE>Tr.warning(tc, "warn.could.not.create.handler", e.getMessage());<NEW_LINE>} catch (IllegalAccessException e) {<NEW_LINE>Tr.warning(tc, "warn.could.not.create.handler", e.getMessage());<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>Tr.warning(tc, "warn.could.not.create.handler", e.getMessage());<NEW_LINE>} catch (InterceptException e) {<NEW_LINE>Tr.warning(tc, "warn.could.not.create.handler", e.getMessage());<NEW_LINE>}<NEW_LINE>if (handler != null) {<NEW_LINE>handlers.add(handler);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return HandlerChainInfoBuilder.sortHandlers(handlers);<NEW_LINE>}
> handlerIter = handlerInfos.iterator();
916,922
private void showNotification(BlockInfo info) {<NEW_LINE>String contentTitle = mContext.getString(R.string.dk_block_class_has_blocked, info.timeStart);<NEW_LINE>String contentText = mContext.getString(R.string.dk_block_notification_message);<NEW_LINE>Intent intent = new Intent(mContext, UniversalActivity.class);<NEW_LINE>intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);<NEW_LINE>intent.putExtra(BundleKey.FRAGMENT_INDEX, FragmentIndex.FRAGMENT_BLOCK_MONITOR);<NEW_LINE>intent.putExtra(BlockMonitorFragment.KEY_JUMP_TO_LIST, true);<NEW_LINE>PendingIntent pendingIntent;<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {<NEW_LINE>pendingIntent = PendingIntent.getActivity(mContext, 1, <MASK><NEW_LINE>} else {<NEW_LINE>pendingIntent = PendingIntent.getActivity(mContext, 1, intent, FLAG_UPDATE_CURRENT);<NEW_LINE>}<NEW_LINE>DoKitNotificationUtils.setInfoNotification(mContext, DoKitNotificationUtils.ID_SHOW_BLOCK_NOTIFICATION, contentTitle, contentText, contentText, pendingIntent);<NEW_LINE>}
intent, FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
1,028,921
private void drawAxisLines(GL2 gl, Position bottomLeft, Position topRight) {<NEW_LINE>double offset = 0.001;<NEW_LINE>gl.glLineWidth(5f);<NEW_LINE>gl.glBegin(GL_LINES);<NEW_LINE>// X Axis Line<NEW_LINE>gl.glColor4fv(yAxisColor, 0);<NEW_LINE>gl.glVertex3d(0, bottomLeft.y, offset);<NEW_LINE>gl.glVertex3d(0, topRight.y, offset);<NEW_LINE>gl.glVertex3d(<MASK><NEW_LINE>gl.glVertex3d(0, topRight.y, offset);<NEW_LINE>// Y Axis Line<NEW_LINE>gl.glColor4fv(xAxisColor, 0);<NEW_LINE>gl.glVertex3d(bottomLeft.x, 0, offset);<NEW_LINE>gl.glVertex3d(topRight.x, 0, offset);<NEW_LINE>gl.glVertex3d(bottomLeft.x, 0, offset);<NEW_LINE>gl.glVertex3d(topRight.x, 0, offset);<NEW_LINE>// Z Axis Line<NEW_LINE>gl.glColor4fv(zAxisColor, 0);<NEW_LINE>gl.glVertex3d(0, 0, bottomLeft.z);<NEW_LINE>gl.glVertex3d(0, 0, Math.max(topRight.z, -bottomLeft.z));<NEW_LINE>gl.glEnd();<NEW_LINE>}
0, bottomLeft.y, offset);
147,537
private void _loadRealms() {<NEW_LINE>List<AuthRealm> authRealmConfigs <MASK><NEW_LINE>List<String> goodRealms = new ArrayList<String>();<NEW_LINE>for (AuthRealm authRealm : authRealmConfigs) {<NEW_LINE>List<Property> propConfigs = authRealm.getProperty();<NEW_LINE>Properties props = new Properties();<NEW_LINE>for (Property p : propConfigs) {<NEW_LINE>String value = p.getValue();<NEW_LINE>props.setProperty(p.getName(), value);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Realm.instantiate(authRealm.getName(), authRealm.getClassname(), props);<NEW_LINE>goodRealms.add(authRealm.getName());<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.log(Level.SEVERE, null, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!goodRealms.isEmpty()) {<NEW_LINE>// not used String goodRealm = goodRealms.iterator().next();<NEW_LINE>try {<NEW_LINE>String defaultRealm = getSecurityService().getDefaultRealm();
= getSecurityService().getAuthRealm();
1,393,924
public void invokeAction(String command, Lookup context) throws IllegalArgumentException {<NEW_LINE>if (COMMAND_DELETE.equals(command)) {<NEW_LINE>DefaultProjectOperations.performDefaultDeleteOperation(project);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (ActionProvider.COMMAND_PRIME.equals(command)) {<NEW_LINE>// delegate to prooblem provider we know exists & is registered<NEW_LINE>NbGradleProjectImpl prjImpl = project.getLookup().lookup(NbGradleProjectImpl.class);<NEW_LINE>ActionProgress prg = ActionProgress.start(context);<NEW_LINE>LOG.log(Level.FINER, "Priming build starting for {0}", project);<NEW_LINE>if (prjImpl.isProjectPrimingRequired()) {<NEW_LINE>prjImpl.primeProject().thenAccept(gp -> {<NEW_LINE>LOG.log(Level.FINER, "Priming build of {0} finished with status {1}, ", new Object[] { project<MASK><NEW_LINE>prg.finished(!prjImpl.isProjectPrimingRequired());<NEW_LINE>}).exceptionally((e) -> {<NEW_LINE>LOG.log(Level.FINER, e, () -> String.format("Priming build errored: %s", project));<NEW_LINE>prg.finished(false);<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>// no action, but report finish to unblock potential observers<NEW_LINE>LOG.log(Level.FINER, "Priming build unncessary for {0}", project);<NEW_LINE>prg.finished(true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>NbGradleProject gp = NbGradleProject.get(project);<NEW_LINE>GradleExecConfiguration execCfg = ProjectConfigurationSupport.getEffectiveConfiguration(project, context);<NEW_LINE>ProjectConfigurationSupport.executeWithConfiguration(project, execCfg, () -> {<NEW_LINE>ActionMapping mapping = ActionToTaskUtils.getActiveMapping(command, project, context);<NEW_LINE>invokeProjectAction2(project, mapping, execCfg, context, false);<NEW_LINE>});<NEW_LINE>}
, prjImpl.isProjectPrimingRequired() });
1,701,875
public void densify(List<String> featureList) {<NEW_LINE>// Ensure we have enough space.<NEW_LINE>if (featureList.size() > featureNames.length) {<NEW_LINE>growArray(featureList.size());<NEW_LINE>}<NEW_LINE>int insertedCount = 0;<NEW_LINE>int curPos = 0;<NEW_LINE>for (String curName : featureList) {<NEW_LINE>// If we've reached the end of our old feature set, just insert.<NEW_LINE>if (curPos == size) {<NEW_LINE>featureNames[size + insertedCount] = curName;<NEW_LINE>insertedCount++;<NEW_LINE>} else {<NEW_LINE>// Check to see if our insertion candidate is the same as the current feature name.<NEW_LINE>int comparison = curName<MASK><NEW_LINE>if (comparison < 0) {<NEW_LINE>// If it's earlier, insert it.<NEW_LINE>featureNames[size + insertedCount] = curName;<NEW_LINE>insertedCount++;<NEW_LINE>} else if (comparison == 0) {<NEW_LINE>// Otherwise just bump our pointer, we've already got this feature.<NEW_LINE>curPos++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Bump the size up by the number of inserted features.<NEW_LINE>size += insertedCount;<NEW_LINE>// Sort the features<NEW_LINE>sort();<NEW_LINE>}
.compareTo(featureNames[curPos]);
80,186
public int updateRetryByLock(final HmilyTransaction hmilyTransaction) {<NEW_LINE>final int currentVersion = hmilyTransaction.getVersion();<NEW_LINE>String path = node.getHmilyTransactionRealPath(hmilyTransaction.getTransId());<NEW_LINE>try {<NEW_LINE>if (checkPath(path, true)) {<NEW_LINE>return FAIL_ROWS;<NEW_LINE>}<NEW_LINE>Stat stat = zooKeeper.exists(path, false);<NEW_LINE>if (stat == null) {<NEW_LINE>LOGGER.warn("path {} is not exists.", path);<NEW_LINE>return HmilyRepository.FAIL_ROWS;<NEW_LINE>}<NEW_LINE>if (currentVersion != stat.getVersion()) {<NEW_LINE>LOGGER.warn("current transaction data version different from zookeeper server. " + "current version: {}, server data version: {}", currentVersion, stat.getVersion());<NEW_LINE>}<NEW_LINE>hmilyTransaction.setVersion(currentVersion + 1);<NEW_LINE>hmilyTransaction.setRetry(<MASK><NEW_LINE>hmilyTransaction.setUpdateTime(new Date());<NEW_LINE>zooKeeper.setData(path, hmilySerializer.serialize(hmilyTransaction), stat.getVersion());<NEW_LINE>return HmilyRepository.ROWS;<NEW_LINE>} catch (KeeperException | InterruptedException e) {<NEW_LINE>LOGGER.error("updateRetryByLock occur a exception", e);<NEW_LINE>}<NEW_LINE>return HmilyRepository.FAIL_ROWS;<NEW_LINE>}
hmilyTransaction.getRetry() + 1);
724,787
public static Map<String, Object> generateControllerConf(String zkAddress, String clusterName, String controllerHost, String controllerPort, String dataDir, ControllerConf.ControllerMode controllerMode, boolean tenantIsolation) throws SocketException, UnknownHostException {<NEW_LINE>if (StringUtils.isEmpty(zkAddress)) {<NEW_LINE>throw new RuntimeException("zkAddress cannot be empty.");<NEW_LINE>}<NEW_LINE>if (StringUtils.isEmpty(clusterName)) {<NEW_LINE>throw new RuntimeException("clusterName cannot be empty.");<NEW_LINE>}<NEW_LINE>Map<String, Object> properties = new HashMap<>();<NEW_LINE>properties.put(ControllerConf.ZK_STR, zkAddress);<NEW_LINE>properties.<MASK><NEW_LINE>properties.put(ControllerConf.CONTROLLER_HOST, !StringUtils.isEmpty(controllerHost) ? controllerHost : NetUtils.getHostAddress());<NEW_LINE>properties.put(ControllerConf.CONTROLLER_PORT, !StringUtils.isEmpty(controllerPort) ? controllerPort : getAvailablePort());<NEW_LINE>properties.put(ControllerConf.DATA_DIR, !StringUtils.isEmpty(dataDir) ? dataDir : TMP_DIR + String.format("Controller_%s_%s/controller/data", controllerHost, controllerPort));<NEW_LINE>properties.put(ControllerConf.CONTROLLER_VIP_HOST, controllerHost);<NEW_LINE>properties.put(ControllerConf.CLUSTER_TENANT_ISOLATION_ENABLE, tenantIsolation);<NEW_LINE>properties.put(ControllerPeriodicTasksConf.DEPRECATED_RETENTION_MANAGER_FREQUENCY_IN_SECONDS, 3600 * 6);<NEW_LINE>properties.put(ControllerPeriodicTasksConf.DEPRECATED_OFFLINE_SEGMENT_INTERVAL_CHECKER_FREQUENCY_IN_SECONDS, 3600);<NEW_LINE>properties.put(ControllerPeriodicTasksConf.DEPRECATED_REALTIME_SEGMENT_VALIDATION_FREQUENCY_IN_SECONDS, 3600);<NEW_LINE>properties.put(ControllerPeriodicTasksConf.DEPRECATED_BROKER_RESOURCE_VALIDATION_FREQUENCY_IN_SECONDS, 3600);<NEW_LINE>properties.put(ControllerConf.CONTROLLER_MODE, controllerMode.toString());<NEW_LINE>return properties;<NEW_LINE>}
put(ControllerConf.HELIX_CLUSTER_NAME, clusterName);
307,356
private static PartitionMetricSample readV0(ByteBuffer buffer) {<NEW_LINE>MetricDef metricDef = KafkaMetricDef.commonMetricDef();<NEW_LINE>int brokerId = buffer.getInt();<NEW_LINE>int partition = buffer.getInt(45);<NEW_LINE>String topic = new String(buffer.array(), 49, buffer.array().length - 49, UTF_8);<NEW_LINE>PartitionMetricSample sample = new PartitionMetricSample(brokerId, <MASK><NEW_LINE>sample.record(metricDef.metricInfo(CPU_USAGE.name()), buffer.getDouble());<NEW_LINE>sample.record(metricDef.metricInfo(DISK_USAGE.name()), buffer.getDouble());<NEW_LINE>sample.record(metricDef.metricInfo(LEADER_BYTES_IN.name()), buffer.getDouble());<NEW_LINE>sample.record(metricDef.metricInfo(LEADER_BYTES_OUT.name()), buffer.getDouble());<NEW_LINE>sample.close(buffer.getLong());<NEW_LINE>return sample;<NEW_LINE>}
new TopicPartition(topic, partition));
1,407,442
private void readJoinTable(JoinTable joinTable, DeployBeanPropertyAssocMany<?> prop) {<NEW_LINE>String intTableName = getFullTableName(joinTable);<NEW_LINE>if (intTableName.isEmpty()) {<NEW_LINE>BeanTable localTable = factory.beanTable(descriptor.getBeanType());<NEW_LINE>BeanTable otherTable = factory.beanTable(prop.getTargetType());<NEW_LINE>intTableName = getM2MJoinTableName(localTable, otherTable);<NEW_LINE>}<NEW_LINE>// set the intersection table<NEW_LINE>DeployTableJoin intJoin = new DeployTableJoin();<NEW_LINE>intJoin.setTable(intTableName);<NEW_LINE>// add the source to intersection join columns<NEW_LINE>intJoin.addJoinColumn(util, true, joinTable.joinColumns(), prop.getBeanTable());<NEW_LINE>// set the intersection to dest table join columns<NEW_LINE>DeployTableJoin destJoin = prop.getTableJoin();<NEW_LINE>destJoin.addJoinColumn(util, false, joinTable.inverseJoinColumns(), prop.getBeanTable());<NEW_LINE>intJoin.setType(SqlJoinType.OUTER);<NEW_LINE>// reverse join from dest back to intersection<NEW_LINE>DeployTableJoin <MASK><NEW_LINE>prop.setIntersectionJoin(intJoin);<NEW_LINE>prop.setInverseJoin(inverseDest);<NEW_LINE>}
inverseDest = destJoin.createInverse(intTableName);
208,693
public Document[] parse(final DigestURL location, final String mimeType, final String charset, final VocabularyScraper scraper, final int timezoneOffset, final InputStream source) throws Parser.Failure, InterruptedException {<NEW_LINE>// construct a document using all cells of the document<NEW_LINE>// the first row is used as headline<NEW_LINE>// all lines are artificially terminated by a '.' to separate them as sentence for the condenser.<NEW_LINE>final List<String[]> <MASK><NEW_LINE>if (table.isEmpty())<NEW_LINE>throw new Parser.Failure("document has no lines", location);<NEW_LINE>final StringBuilder sb = new StringBuilder();<NEW_LINE>for (final String[] row : table) {<NEW_LINE>sb.append(concatRow(row)).append(' ');<NEW_LINE>}<NEW_LINE>return new Document[] { new Document(location, mimeType, charset, this, null, null, singleList(concatRow(table.get(0))), null, "", null, null, 0.0d, 0.0d, sb.toString(), null, null, null, false, new Date()) };<NEW_LINE>}
table = getTable(charset, source);
743,390
protected Map<String, Object> applyPreMapping(final Context context, final Map<String, Object> rawData) {<NEW_LINE>if (rawData == null) {<NEW_LINE>throw new RuntimeException("rawData is null");<NEW_LINE>}<NEW_LINE>long now = System.currentTimeMillis();<NEW_LINE>if (rawData.containsKey(timestampField)) {<NEW_LINE>long ts = (Long) rawData.get(timestampField);<NEW_LINE>long latestTsYet = latestTimeStamp.get();<NEW_LINE>if (ts > latestTsYet) {<NEW_LINE>latestTimeStamp.compareAndSet(latestTsYet, ts);<NEW_LINE>}<NEW_LINE>// TODO DynamicGauge.set("manits.source.timelag", (now - latestTimeStamp.get()));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>preMapperFunc.call(rawData);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// TODO DynamicCounter.increment("mantis.source.premapping.failed", "mantisJobName", jobName);<NEW_LINE>logger.warn(<MASK><NEW_LINE>}<NEW_LINE>final Map<String, Object> modifiedData = new HashMap<>(rawData);<NEW_LINE>modifiedData.put(MANTIS_META_SOURCE_NAME, jobName);<NEW_LINE>modifiedData.put(MANTIS_META_SOURCE_TIMESTAMP, now);<NEW_LINE>if (isFlattenFields) {<NEW_LINE>flattenFields(modifiedData);<NEW_LINE>}<NEW_LINE>return modifiedData;<NEW_LINE>}
"Exception applying premapping function " + e.getMessage());
720,988
public Object call(StarlarkThread thread, Tuple args, Dict<String, Object> kwargs) throws EvalException, InterruptedException, ConversionException {<NEW_LINE>if (!args.isEmpty()) {<NEW_LINE>throw new EvalException("unexpected positional arguments");<NEW_LINE>}<NEW_LINE>BazelStarlarkContext.from(thread<MASK><NEW_LINE>if (ruleClass == null) {<NEW_LINE>throw new EvalException("Invalid rule class hasn't been exported by a bzl file");<NEW_LINE>}<NEW_LINE>validateRulePropagatedAspects(ruleClass);<NEW_LINE>BuildLangTypedAttributeValuesMap attributeValues = new BuildLangTypedAttributeValuesMap(kwargs);<NEW_LINE>try {<NEW_LINE>PackageContext pkgContext = thread.getThreadLocal(PackageContext.class);<NEW_LINE>if (pkgContext == null) {<NEW_LINE>throw new EvalException("Cannot instantiate a rule when loading a .bzl file. " + "Rules may be instantiated only in a BUILD thread.");<NEW_LINE>}<NEW_LINE>RuleFactory.createAndAddRule(pkgContext.getBuilder(), ruleClass, attributeValues, pkgContext.getEventHandler(), thread.getSemantics(), thread.getCallStack());<NEW_LINE>} catch (InvalidRuleException | NameConflictException e) {<NEW_LINE>throw new EvalException(e);<NEW_LINE>}<NEW_LINE>return Starlark.NONE;<NEW_LINE>}
).checkLoadingPhase(getName());
1,015,760
private static <T extends TokenId> void logModification(MutableTokenList<T> tokenList, TokenHierarchyEventInfo eventInfo, boolean updateJoined) {<NEW_LINE>int modOffset = eventInfo.modOffset();<NEW_LINE>int removedLength = eventInfo.removedLength();<NEW_LINE>int insertedLength = eventInfo.insertedLength();<NEW_LINE>CharSequence inputSourceText = tokenList.inputSourceText();<NEW_LINE>String insertedText = "";<NEW_LINE>if (insertedLength > 0) {<NEW_LINE>insertedText = ", insTxt:\"" + CharSequenceUtilities.debugText(inputSourceText.subSequence(modOffset, modOffset + insertedLength)) + '"';<NEW_LINE>}<NEW_LINE>// Debug 10 chars around modOffset<NEW_LINE>int afterInsertOffset = modOffset + insertedLength;<NEW_LINE>CharSequence beforeText = inputSourceText.subSequence(Math.max(afterInsertOffset - 5, 0), afterInsertOffset);<NEW_LINE>CharSequence afterText = inputSourceText.subSequence(afterInsertOffset, Math.min(afterInsertOffset + 5, inputSourceText.length()));<NEW_LINE>StringBuilder sb = new StringBuilder(200);<NEW_LINE>sb.append(updateJoined ? "JOINED" : "REGULAR");<NEW_LINE>sb.append("-UPDATE: \"");<NEW_LINE>sb.append(tokenList.languagePath().mimePath<MASK><NEW_LINE>sb.append(" modOff=").append(modOffset);<NEW_LINE>sb.append(", text-around:\"").append(beforeText).append('|');<NEW_LINE>sb.append(afterText).append("\", insLen=");<NEW_LINE>sb.append(insertedLength).append(insertedText);<NEW_LINE>sb.append(", remLen=").append(removedLength);<NEW_LINE>sb.append(", tCnt=").append(tokenList.tokenCountCurrent()).append('\n');<NEW_LINE>// Use INFO level to allow to log the modification in case of failure<NEW_LINE>// when FINE level is not enabled. The "loggable" var should be checked<NEW_LINE>// for regular calls of this method.<NEW_LINE>LOG.log(Level.INFO, sb.toString());<NEW_LINE>}
()).append("\"\n");
30,105
public static void drawParticleLine(ServerPlayer player, Vec3 from, Vec3 to, String main, String accent, int count, double spread) {<NEW_LINE>ParticleOptions accentParticle = getEffect(accent);<NEW_LINE>ParticleOptions mainParticle = getEffect(main);<NEW_LINE>if (accentParticle != null)<NEW_LINE>((ServerLevel) player.level).sendParticles(player, accentParticle, true, to.x, to.y, to.z, count, <MASK><NEW_LINE>double lineLengthSq = from.distanceToSqr(to);<NEW_LINE>if (lineLengthSq == 0)<NEW_LINE>return;<NEW_LINE>// multiply(50/sqrt(lineLengthSq));<NEW_LINE>Vec3 incvec = to.subtract(from).normalize();<NEW_LINE>for (Vec3 delta = new Vec3(0.0, 0.0, 0.0); delta.lengthSqr() < lineLengthSq; delta = delta.add(incvec.scale(player.level.random.nextFloat()))) {<NEW_LINE>((ServerLevel) player.level).sendParticles(player, mainParticle, true, delta.x + from.x, delta.y + from.y, delta.z + from.z, 1, 0.0, 0.0, 0.0, 0.0);<NEW_LINE>}<NEW_LINE>}
spread, spread, spread, 0.0);
1,219,359
// enableNew<NEW_LINE>private void loadWarehouseInfo(int M_Warehouse_ID) {<NEW_LINE>if (M_Warehouse_ID == m_M_Warehouse_ID.getRepoId()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Defaults<NEW_LINE>m_M_Warehouse_ID = null;<NEW_LINE>// m_M_WarehouseName = "";<NEW_LINE>m_M_WarehouseValue = "";<NEW_LINE>m_Separator = ".";<NEW_LINE>// m_AD_Client_ID = 0;<NEW_LINE>// m_AD_Org_ID = 0;<NEW_LINE>//<NEW_LINE>String SQL = "SELECT M_Warehouse_ID, Value, Name, Separator, AD_Client_ID, AD_Org_ID " + "FROM M_Warehouse WHERE M_Warehouse_ID=?";<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.<MASK><NEW_LINE>pstmt.setInt(1, M_Warehouse_ID);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>if (rs.next()) {<NEW_LINE>m_M_Warehouse_ID = WarehouseId.ofRepoId(rs.getInt(1));<NEW_LINE>m_M_WarehouseValue = rs.getString(2);<NEW_LINE>// m_M_WarehouseName = rs.getString(3);<NEW_LINE>m_Separator = rs.getString(4);<NEW_LINE>// m_AD_Client_ID = rs.getInt(5);<NEW_LINE>// m_AD_Org_ID = rs.getInt(6);<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.error(SQL, e);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>}<NEW_LINE>}
prepareStatement(SQL, ITrx.TRXNAME_None);
1,619,186
public // preprocess any data<NEW_LINE>boolean preProcess(ConfigEntry configEntry) {<NEW_LINE>boolean valid = true;<NEW_LINE>// there is no override, use the default processorData<NEW_LINE>if (configEntry.processorData == null)<NEW_LINE>configEntry.processorData = new Object[BASE_SLOTS];<NEW_LINE>// persistToDisk<NEW_LINE>Property p = (Property) configEntry.properties.get(PROPERTY_PERSIST_TO_DISK);<NEW_LINE>String val = p != null ? (String) p.value : null;<NEW_LINE>if (val != null) {<NEW_LINE>val = val.trim();<NEW_LINE>configEntry.processorData[SLOT_PERSIST_TO_DISK] = new Boolean(val);<NEW_LINE>}<NEW_LINE>// do-not-cache<NEW_LINE>p = (Property) <MASK><NEW_LINE>val = p != null ? (String) p.value : null;<NEW_LINE>if (val != null) {<NEW_LINE>configEntry.processorData[SLOT_DO_NOT_CACHE] = new Boolean(val);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < configEntry.cacheIds.length; i++) valid &= preProcess(configEntry.cacheIds[i]);<NEW_LINE>return valid;<NEW_LINE>}
configEntry.properties.get(PROPERTY_DO_NOT_CACHE);
48,019
public static FieldValueGenerator createDayOfWeekValueGeneratorInstance(final CronField cronField, final int year, final int month, final WeekDay mondayDoWValue) {<NEW_LINE>final FieldExpression fieldExpression = cronField.getExpression();<NEW_LINE>if (fieldExpression instanceof On) {<NEW_LINE>return new OnDayOfWeekValueGenerator(cronField, year, month, mondayDoWValue);<NEW_LINE>}<NEW_LINE>// handle a range expression for day of week special<NEW_LINE>if (fieldExpression instanceof Between) {<NEW_LINE>return new BetweenDayOfWeekValueGenerator(<MASK><NEW_LINE>}<NEW_LINE>// handle And expression for day of the week as a special case<NEW_LINE>if (fieldExpression instanceof And) {<NEW_LINE>return new AndDayOfWeekValueGenerator(cronField, year, month, mondayDoWValue);<NEW_LINE>}<NEW_LINE>if (fieldExpression instanceof Every) {<NEW_LINE>return new EveryDayOfWeekValueGenerator(cronField, year, month, mondayDoWValue);<NEW_LINE>}<NEW_LINE>return forCronField(cronField);<NEW_LINE>}
cronField, year, month, mondayDoWValue);
359,306
public Manifest buildModuleManifest(JarFile source) throws IOException {<NEW_LINE>Manifest manifest = source.getManifest();<NEW_LINE>if (manifest == null) {<NEW_LINE>manifest = new Manifest();<NEW_LINE>manifest.getMainAttributes().putValue("Manifest-Version", "1.0");<NEW_LINE>}<NEW_LINE>manifest = new Manifest(manifest);<NEW_LINE>String startClass = this.mainClass;<NEW_LINE>if (startClass == null) {<NEW_LINE>startClass = manifest.getMainAttributes().getValue(MAIN_CLASS_ATTRIBUTE);<NEW_LINE>}<NEW_LINE>if (startClass == null) {<NEW_LINE>startClass = findMainMethodWithTimeoutWarning(source);<NEW_LINE>}<NEW_LINE>if (startClass == null) {<NEW_LINE>throw new IllegalStateException("Unable to find main class.");<NEW_LINE>}<NEW_LINE>manifest.getMainAttributes().putValue(MAIN_CLASS_ATTRIBUTE, startClass);<NEW_LINE>manifest.getMainAttributes().putValue(ARK_BIZ_NAME, this.bizName);<NEW_LINE>manifest.getMainAttributes().putValue(ARK_BIZ_VERSION, this.bizVersion);<NEW_LINE>manifest.getMainAttributes().putValue(PRIORITY_ATTRIBUTE, priority);<NEW_LINE>manifest.getMainAttributes().putValue(WEB_CONTEXT_PATH, webContextPath);<NEW_LINE>manifest.getMainAttributes().putValue(DENY_IMPORT_PACKAGES, StringUtils<MASK><NEW_LINE>manifest.getMainAttributes().putValue(DENY_IMPORT_CLASSES, StringUtils.setToStr(denyImportClasses, MANIFEST_VALUE_SPLIT));<NEW_LINE>manifest.getMainAttributes().putValue(DENY_IMPORT_RESOURCES, StringUtils.setToStr(denyImportResources, MANIFEST_VALUE_SPLIT));<NEW_LINE>manifest.getMainAttributes().putValue(INJECT_PLUGIN_DEPENDENCIES, setToStr(injectPluginDependencies, MANIFEST_VALUE_SPLIT));<NEW_LINE>manifest.getMainAttributes().putValue(INJECT_EXPORT_PACKAGES, StringUtils.setToStr(injectPluginExportPackages, MANIFEST_VALUE_SPLIT));<NEW_LINE>return manifest;<NEW_LINE>}
.setToStr(denyImportPackages, MANIFEST_VALUE_SPLIT));
292,169
public static void appendAttributes(StringBuilder buffer, Address startAddr, Address endAddr) {<NEW_LINE>AddressSpace space = startAddr.getAddressSpace();<NEW_LINE>long offset = startAddr.getOffset();<NEW_LINE>long size = endAddr.getOffset() - offset + 1;<NEW_LINE>if (space != endAddr.getAddressSpace()) {<NEW_LINE>throw new IllegalArgumentException("Range boundaries are not in the same address space");<NEW_LINE>}<NEW_LINE>if (size < 0) {<NEW_LINE>throw new IllegalArgumentException("Start of range comes after end of range");<NEW_LINE>}<NEW_LINE>long last = offset + size - 1;<NEW_LINE>boolean useFirst = (offset != 0);<NEW_LINE>boolean useLast = (last != -1);<NEW_LINE>SpecXmlUtils.encodeStringAttribute(buffer, "space", space.getName());<NEW_LINE>if (useFirst) {<NEW_LINE>SpecXmlUtils.<MASK><NEW_LINE>}<NEW_LINE>if (useLast) {<NEW_LINE>SpecXmlUtils.encodeUnsignedIntegerAttribute(buffer, "last", last);<NEW_LINE>}<NEW_LINE>}
encodeUnsignedIntegerAttribute(buffer, "first", offset);
1,494,273
public void addAttributeToResults(List<Result> results, SleuthkitCase caseDb, CentralRepository centralRepoDb, SearchContext context) throws DiscoveryException, SearchCancellationException {<NEW_LINE>// Get pairs of (object ID, object type name) for all files in the list of files that have<NEW_LINE>// objects detected<NEW_LINE>String selectQuery = createSetNameClause(results, BlackboardArtifact.ARTIFACT_TYPE.TSK_OBJECT_DETECTED.getTypeID(), BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DESCRIPTION.getTypeID());<NEW_LINE><MASK><NEW_LINE>if (context.searchIsCancelled()) {<NEW_LINE>throw new SearchCancellationException("The search was cancelled while Object Detected attribute was being added.");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>caseDb.getCaseDbAccessManager().select(selectQuery, callback);<NEW_LINE>} catch (TskCoreException ex) {<NEW_LINE>// NON-NLS<NEW_LINE>throw new DiscoveryException("Error looking up object detected attributes", ex);<NEW_LINE>}<NEW_LINE>}
ObjectDetectedNamesCallback callback = new ObjectDetectedNamesCallback(results);
365,157
public Either<Failure, Void> applyOutputMappings(final BpmnElementContext context, final ExecutableFlowNode element) {<NEW_LINE>final ProcessInstanceRecord record = context.getRecordValue();<NEW_LINE>final long elementInstanceKey = context.getElementInstanceKey();<NEW_LINE>final <MASK><NEW_LINE>final long processInstanceKey = record.getProcessInstanceKey();<NEW_LINE>final DirectBuffer bpmnProcessId = context.getBpmnProcessId();<NEW_LINE>final long scopeKey = getVariableScopeKey(context);<NEW_LINE>final Optional<Expression> outputMappingExpression = element.getOutputMappings();<NEW_LINE>final EventTrigger eventTrigger = eventScopeInstanceState.peekEventTrigger(elementInstanceKey);<NEW_LINE>boolean hasVariables = false;<NEW_LINE>DirectBuffer variables = null;<NEW_LINE>if (eventTrigger != null) {<NEW_LINE>variables = eventTrigger.getVariables();<NEW_LINE>hasVariables = variables.capacity() > 0;<NEW_LINE>}<NEW_LINE>if (outputMappingExpression.isPresent()) {<NEW_LINE>// set as local variables<NEW_LINE>if (hasVariables) {<NEW_LINE>variableBehavior.mergeLocalDocument(elementInstanceKey, processDefinitionKey, processInstanceKey, bpmnProcessId, variables);<NEW_LINE>}<NEW_LINE>// apply the output mappings<NEW_LINE>return expressionProcessor.evaluateVariableMappingExpression(outputMappingExpression.get(), elementInstanceKey).map(result -> {<NEW_LINE>variableBehavior.mergeDocument(scopeKey, processDefinitionKey, processInstanceKey, bpmnProcessId, result);<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>} else if (hasVariables) {<NEW_LINE>// merge/propagate the event variables by default<NEW_LINE>variableBehavior.mergeDocument(elementInstanceKey, processDefinitionKey, processInstanceKey, bpmnProcessId, variables);<NEW_LINE>} else if (isConnectedToEventBasedGateway(element) || element.getElementType() == BpmnElementType.BOUNDARY_EVENT || element.getElementType() == BpmnElementType.START_EVENT) {<NEW_LINE>// event variables are set local variables instead of temporary variables<NEW_LINE>final var localVariables = variablesState.getVariablesLocalAsDocument(elementInstanceKey);<NEW_LINE>variableBehavior.mergeDocument(scopeKey, processDefinitionKey, processInstanceKey, bpmnProcessId, localVariables);<NEW_LINE>}<NEW_LINE>return Either.right(null);<NEW_LINE>}
long processDefinitionKey = record.getProcessDefinitionKey();
477,718
public long[] transformToLongValuesSV(ProjectionBlock projectionBlock) {<NEW_LINE>if (_resultMetadata == LONG_SV_NO_DICTIONARY_METADATA) {<NEW_LINE><MASK><NEW_LINE>if (_longOutputTimes == null || _longOutputTimes.length < length) {<NEW_LINE>_longOutputTimes = new long[length];<NEW_LINE>}<NEW_LINE>if (_dateTimeTransformer instanceof EpochToEpochTransformer) {<NEW_LINE>EpochToEpochTransformer dateTimeTransformer = (EpochToEpochTransformer) _dateTimeTransformer;<NEW_LINE>dateTimeTransformer.transform(_mainTransformFunction.transformToLongValuesSV(projectionBlock), _longOutputTimes, length);<NEW_LINE>} else {<NEW_LINE>SDFToEpochTransformer dateTimeTransformer = (SDFToEpochTransformer) _dateTimeTransformer;<NEW_LINE>dateTimeTransformer.transform(_mainTransformFunction.transformToStringValuesSV(projectionBlock), _longOutputTimes, length);<NEW_LINE>}<NEW_LINE>return _longOutputTimes;<NEW_LINE>} else {<NEW_LINE>return super.transformToLongValuesSV(projectionBlock);<NEW_LINE>}<NEW_LINE>}
int length = projectionBlock.getNumDocs();
1,612,501
protected Shape clip(@NotNull final Graphics2D g2d, @NotNull final Rectangle bounds, @NotNull final C c, @NotNull final D d, @NotNull final Shape shape) {<NEW_LINE>final Shape clippedShape;<NEW_LINE>final <MASK><NEW_LINE>if (parent instanceof WebBreadcrumb) {<NEW_LINE>final WebBreadcrumb breadcrumb = (WebBreadcrumb) parent;<NEW_LINE>final double progress = breadcrumb.getProgress(c);<NEW_LINE>final boolean ltr = c.getComponentOrientation().isLeftToRight();<NEW_LINE>final Rectangle shapeBounds = shape.getBounds();<NEW_LINE>final int pw = (int) Math.round(shapeBounds.width * progress);<NEW_LINE>shapeBounds.x = ltr ? shapeBounds.x : shapeBounds.x + shapeBounds.width - pw;<NEW_LINE>shapeBounds.width = pw;<NEW_LINE>final Area area = new Area(shape);<NEW_LINE>area.intersect(new Area(shapeBounds));<NEW_LINE>clippedShape = area;<NEW_LINE>} else {<NEW_LINE>clippedShape = shape;<NEW_LINE>}<NEW_LINE>return clippedShape;<NEW_LINE>}
Container parent = c.getParent();
825,255
void syncByMaster(TextSync textSync) {<NEW_LINE>beforeDocumentModification();<NEW_LINE>ignoreDocModifications++;<NEW_LINE>boolean oldTM = DocumentUtilities.isTypingModification(doc);<NEW_LINE>DocumentUtilities.setTypingModification(doc, false);<NEW_LINE>try {<NEW_LINE>TextRegion<?> masterRegion = textSync.validMasterRegion();<NEW_LINE>CharSequence docText = DocumentUtilities.getText(doc);<NEW_LINE>CharSequence masterRegionText = docText.subSequence(masterRegion.startOffset(), masterRegion.endOffset());<NEW_LINE>String masterRegionString = null;<NEW_LINE>for (TextRegion<?> region : textSync.regionsModifiable()) {<NEW_LINE>if (region == masterRegion)<NEW_LINE>continue;<NEW_LINE><MASK><NEW_LINE>int regionEndOffset = region.endOffset();<NEW_LINE>CharSequence regionText = docText.subSequence(regionStartOffset, regionEndOffset);<NEW_LINE>if (!CharSequenceUtilities.textEquals(masterRegionText, regionText)) {<NEW_LINE>// Must re-insert<NEW_LINE>if (masterRegionString == null)<NEW_LINE>masterRegionString = masterRegionText.toString();<NEW_LINE>doc.remove(regionStartOffset, regionEndOffset - regionStartOffset);<NEW_LINE>doc.insertString(regionStartOffset, masterRegionString, null);<NEW_LINE>fixRegionStartOffset(region, regionStartOffset);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (BadLocationException e) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.log(Level.WARNING, "Invalid offset", e);<NEW_LINE>} finally {<NEW_LINE>DocumentUtilities.setTypingModification(doc, oldTM);<NEW_LINE>assert (ignoreDocModifications > 0);<NEW_LINE>ignoreDocModifications--;<NEW_LINE>afterDocumentModification();<NEW_LINE>}<NEW_LINE>updateMasterRegionBounds();<NEW_LINE>}
int regionStartOffset = region.startOffset();
1,577,393
public void parseConfiguration(List<org.flowable.bpmn.model.FormProperty> formProperties, String formKey, DeploymentEntity deployment, ProcessDefinition processDefinition) {<NEW_LINE>this.deploymentId = deployment.getId();<NEW_LINE>ExpressionManager expressionManager = Context<MASK><NEW_LINE>if (StringUtils.isNotEmpty(formKey)) {<NEW_LINE>this.formKey = expressionManager.createExpression(formKey);<NEW_LINE>}<NEW_LINE>FormTypes formTypes = Context.getProcessEngineConfiguration().getFormTypes();<NEW_LINE>for (org.flowable.bpmn.model.FormProperty formProperty : formProperties) {<NEW_LINE>FormPropertyHandler formPropertyHandler = new FormPropertyHandler();<NEW_LINE>formPropertyHandler.setId(formProperty.getId());<NEW_LINE>formPropertyHandler.setName(formProperty.getName());<NEW_LINE>AbstractFormType type = formTypes.parseFormPropertyType(formProperty);<NEW_LINE>formPropertyHandler.setType(type);<NEW_LINE>formPropertyHandler.setRequired(formProperty.isRequired());<NEW_LINE>formPropertyHandler.setReadable(formProperty.isReadable());<NEW_LINE>formPropertyHandler.setWritable(formProperty.isWriteable());<NEW_LINE>formPropertyHandler.setVariableName(formProperty.getVariable());<NEW_LINE>if (StringUtils.isNotEmpty(formProperty.getExpression())) {<NEW_LINE>Expression expression = expressionManager.createExpression(formProperty.getExpression());<NEW_LINE>formPropertyHandler.setVariableExpression(expression);<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(formProperty.getDefaultExpression())) {<NEW_LINE>Expression defaultExpression = expressionManager.createExpression(formProperty.getDefaultExpression());<NEW_LINE>formPropertyHandler.setDefaultExpression(defaultExpression);<NEW_LINE>}<NEW_LINE>formPropertyHandlers.add(formPropertyHandler);<NEW_LINE>}<NEW_LINE>}
.getProcessEngineConfiguration().getExpressionManager();
851,635
private static int enumArsc(String pkgname, String type, String name) {<NEW_LINE>Enumeration<URL> urls = null;<NEW_LINE>try {<NEW_LINE>urls = (Enumeration<URL>) Reflex.invokeVirtual(Initiator.getHostClassLoader(), "findResources", "resources.arsc", String.class);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Log.e(e);<NEW_LINE>}<NEW_LINE>if (urls == null) {<NEW_LINE>Log.e(new RuntimeException("Error! Enum<URL<resources.arsc>> == null, loader = " + Initiator.getHostClassLoader()));<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>InputStream in;<NEW_LINE>byte[<MASK><NEW_LINE>byte[] content;<NEW_LINE>int ret = 0;<NEW_LINE>ArrayList<String> rets = new ArrayList<String>();<NEW_LINE>while (urls.hasMoreElements()) {<NEW_LINE>try {<NEW_LINE>in = urls.nextElement().openStream();<NEW_LINE>ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>int ii;<NEW_LINE>while ((ii = in.read(buf)) != -1) {<NEW_LINE>baos.write(buf, 0, ii);<NEW_LINE>}<NEW_LINE>in.close();<NEW_LINE>content = baos.toByteArray();<NEW_LINE>ret = seekInArscByFileName(content, pkgname, type, name);<NEW_LINE>if (ret != 0) {<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>Log.e(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// 404<NEW_LINE>return 0;<NEW_LINE>}
] buf = new byte[4096];
1,599,698
protected View createEmbeddedView(MetaClass meta, String fqnPrefix) {<NEW_LINE>View view = new View(meta.getJavaClass(), false);<NEW_LINE>for (MetaProperty metaProperty : meta.getProperties()) {<NEW_LINE>String fqn = fqnPrefix + "." + metaProperty.getName();<NEW_LINE>if (!managedFields.containsKey(fqn)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>switch(metaProperty.getType()) {<NEW_LINE>case DATATYPE:<NEW_LINE>case ENUM:<NEW_LINE>view.<MASK><NEW_LINE>break;<NEW_LINE>case ASSOCIATION:<NEW_LINE>case COMPOSITION:<NEW_LINE>View propView;<NEW_LINE>if (!metadataTools.isEmbedded(metaProperty)) {<NEW_LINE>propView = viewRepository.getView(metaProperty.getRange().asClass(), View.MINIMAL);<NEW_LINE>} else {<NEW_LINE>// build view for embedded property<NEW_LINE>propView = createEmbeddedView(metaProperty.getRange().asClass(), fqn);<NEW_LINE>}<NEW_LINE>// in some cases JPA loads extended entities as instance of base class which leads to ClassCastException<NEW_LINE>// loading property lazy prevents this from happening<NEW_LINE>view.addProperty(metaProperty.getName(), propView);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("unknown property type");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return view;<NEW_LINE>}
addProperty(metaProperty.getName());
1,010,510
void sendTransactionData() {<NEW_LINE>ConcurrentHashMap<String, ConcurrentHashMap<String, TransactionData>> transactions = getAndResetTransactions();<NEW_LINE>boolean hasData = false;<NEW_LINE>for (Map<String, TransactionData> entry : transactions.values()) {<NEW_LINE>for (TransactionData data : entry.values()) {<NEW_LINE>if (data.getCount().get() > 0) {<NEW_LINE>hasData = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasData) {<NEW_LINE>Transaction t = Cat.newTransaction(CatConstants.CAT_SYSTEM, this.getClass().getSimpleName());<NEW_LINE>MessageTree tree = Cat.getManager().getThreadLocalMessageTree();<NEW_LINE>tree.setDomain(getDomain());<NEW_LINE>tree.setDiscardPrivate(false);<NEW_LINE>for (Map<String, TransactionData> entry : transactions.values()) {<NEW_LINE>for (TransactionData data : entry.values()) {<NEW_LINE>if (data.getCount().get() > 0) {<NEW_LINE>Transaction tmp = Cat.newTransaction(data.getType(<MASK><NEW_LINE>StringBuilder sb = new StringBuilder(32);<NEW_LINE>sb.append(CatConstants.BATCH_FLAG).append(data.getCount().get()).append(CatConstants.SPLIT);<NEW_LINE>sb.append(data.getFail().get()).append(CatConstants.SPLIT);<NEW_LINE>sb.append(data.getSum().get()).append(CatConstants.SPLIT);<NEW_LINE>sb.append(data.getDurationString()).append(CatConstants.SPLIT).append(data.getLongDurationString());<NEW_LINE>tmp.addData(sb.toString());<NEW_LINE>tmp.setSuccessStatus();<NEW_LINE>tmp.complete();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>t.setSuccessStatus();<NEW_LINE>t.complete();<NEW_LINE>}<NEW_LINE>}
), data.getName());
1,227,731
public ResponseEntity<Void> createUsersWithListInputWithHttpInfo(List<User> body) throws RestClientException {<NEW_LINE>Object postBody = body;<NEW_LINE>// verify the required parameter 'body' is set<NEW_LINE>if (body == null) {<NEW_LINE>throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling createUsersWithListInput");<NEW_LINE>}<NEW_LINE>String path = apiClient.expandPath("/user/createWithList", Collections.<String, Object>emptyMap());<NEW_LINE>final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final HttpHeaders headerParams = new HttpHeaders();<NEW_LINE>final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final MultiValueMap formParams = new LinkedMultiValueMap();<NEW_LINE>final String[] accepts = {};<NEW_LINE>final List<MediaType> accept = apiClient.selectHeaderAccept(accepts);<NEW_LINE>final String[] contentTypes = { "application/json" };<NEW_LINE>final MediaType <MASK><NEW_LINE>String[] authNames = new String[] {};<NEW_LINE>ParameterizedTypeReference<Void> returnType = new ParameterizedTypeReference<Void>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType);<NEW_LINE>}
contentType = apiClient.selectHeaderContentType(contentTypes);
317,955
protected void addChannelDependencies(ChannelConfig channelDeps, @SuppressWarnings("unused") String listenAddressName) {<NEW_LINE>// listenAddressName is used by subclasses<NEW_LINE>channelDeps.set(ZuulDependencyKeys.registry, registry);<NEW_LINE>channelDeps.set(ZuulDependencyKeys.applicationInfoManager, applicationInfoManager);<NEW_LINE>channelDeps.set(ZuulDependencyKeys.serverStatusManager, serverStatusManager);<NEW_LINE>channelDeps.set(ZuulDependencyKeys.accessLogPublisher, accessLogPublisher);<NEW_LINE>channelDeps.set(ZuulDependencyKeys.sessionCtxDecorator, sessionCtxDecorator);<NEW_LINE>channelDeps.set(ZuulDependencyKeys.requestCompleteHandler, reqCompleteHandler);<NEW_LINE>final Counter httpRequestReadTimeoutCounter = registry.counter("server.http.request.read.timeout");<NEW_LINE>channelDeps.set(ZuulDependencyKeys.httpRequestReadTimeoutCounter, httpRequestReadTimeoutCounter);<NEW_LINE>channelDeps.set(ZuulDependencyKeys.filterLoader, filterLoader);<NEW_LINE>channelDeps.set(ZuulDependencyKeys.filterUsageNotifier, usageNotifier);<NEW_LINE>channelDeps.set(ZuulDependencyKeys.eventLoopGroupMetrics, eventLoopGroupMetrics);<NEW_LINE>channelDeps.set(ZuulDependencyKeys.sslClientCertCheckChannelHandlerProvider, new NullChannelHandlerProvider());<NEW_LINE>channelDeps.set(ZuulDependencyKeys<MASK><NEW_LINE>}
.rateLimitingChannelHandlerProvider, new NullChannelHandlerProvider());
936,950
public RECIPE fromJson(@Nonnull ResourceLocation recipeId, @Nonnull JsonObject json) {<NEW_LINE>JsonElement leftIngredients = GsonHelper.isArrayNode(json, JsonConstants.LEFT_INPUT) ? GsonHelper.getAsJsonArray(json, JsonConstants.LEFT_INPUT) : GsonHelper.getAsJsonObject(json, JsonConstants.LEFT_INPUT);<NEW_LINE>INGREDIENT leftInput = getDeserializer().deserialize(leftIngredients);<NEW_LINE>JsonElement rightIngredients = GsonHelper.isArrayNode(json, JsonConstants.RIGHT_INPUT) ? GsonHelper.getAsJsonArray(json, JsonConstants.RIGHT_INPUT) : GsonHelper.getAsJsonObject(json, JsonConstants.RIGHT_INPUT);<NEW_LINE>INGREDIENT rightInput = getDeserializer().deserialize(rightIngredients);<NEW_LINE>STACK output = <MASK><NEW_LINE>if (output.isEmpty()) {<NEW_LINE>throw new JsonSyntaxException("Recipe output must not be empty.");<NEW_LINE>}<NEW_LINE>return this.factory.create(recipeId, leftInput, rightInput, output);<NEW_LINE>}
fromJson(json, JsonConstants.OUTPUT);
1,360,991
static Object floor(Object value) {<NEW_LINE>if (value instanceof Double) {<NEW_LINE>return Math.floor((Double) value);<NEW_LINE>}<NEW_LINE>if (value instanceof Float) {<NEW_LINE>return Math<MASK><NEW_LINE>}<NEW_LINE>if (value instanceof BigDecimal) {<NEW_LINE>return ((BigDecimal) value).setScale(0, RoundingMode.FLOOR);<NEW_LINE>}<NEW_LINE>if (value instanceof List) {<NEW_LINE>List list = (List) value;<NEW_LINE>for (int i = 0, l = list.size(); i < l; i++) {<NEW_LINE>Object item = list.get(i);<NEW_LINE>if (item instanceof Double) {<NEW_LINE>list.set(i, Math.floor((Double) item));<NEW_LINE>} else if (item instanceof Float) {<NEW_LINE>list.set(i, Math.floor((Float) item));<NEW_LINE>} else if (item instanceof BigDecimal) {<NEW_LINE>list.set(i, ((BigDecimal) item).setScale(0, RoundingMode.FLOOR));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>}
.floor((Float) value);
1,067,624
public double calculateFitness(TaskRequest taskRequest, VirtualMachineCurrentState targetVM, TaskTrackerState taskTrackerState) {<NEW_LINE>String targetHostAttrVal = AttributeUtilities.getAttrValue(targetVM.getCurrAvailableResources(), hostAttributeName);<NEW_LINE>if (targetHostAttrVal == null || targetHostAttrVal.isEmpty()) {<NEW_LINE>return 0.0;<NEW_LINE>}<NEW_LINE>Set<String> coTasks = coTasksGetter.call(taskRequest.getId());<NEW_LINE>Map<String, Integer> usedAttribsMap = null;<NEW_LINE>try {<NEW_LINE>usedAttribsMap = getUsedAttributesMap(coTasks, taskTrackerState);<NEW_LINE>} catch (Exception e) {<NEW_LINE>return 0.0;<NEW_LINE>}<NEW_LINE>final Integer integer = usedAttribsMap.get(targetHostAttrVal);<NEW_LINE>if (integer == null)<NEW_LINE>return 1.0;<NEW_LINE>if (usedAttribsMap.isEmpty())<NEW_LINE>return 1.0;<NEW_LINE>double avg = 0.0;<NEW_LINE>for (Integer i : usedAttribsMap.values()) avg += i;<NEW_LINE>avg = Math.ceil(avg + 1 / Math.max(expectedValues<MASK><NEW_LINE>if (integer <= avg)<NEW_LINE>return (avg - (double) integer) / avg;<NEW_LINE>return 0.0;<NEW_LINE>}
, usedAttribsMap.size()));
440,092
private Block createRawBlock(String defaultName, SectionDefinitionData def) {<NEW_LINE>Block block = new Block();<NEW_LINE>block.setLiquid(def.isLiquid());<NEW_LINE>block.setWater(def.isWater());<NEW_LINE>block.setGrass(def.isGrass());<NEW_LINE>block.<MASK><NEW_LINE>block.setHardness(def.getHardness());<NEW_LINE>block.setAttachmentAllowed(def.isAttachmentAllowed());<NEW_LINE>block.setReplacementAllowed(def.isReplacementAllowed());<NEW_LINE>block.setSupportRequired(def.isSupportRequired());<NEW_LINE>block.setPenetrable(def.isPenetrable());<NEW_LINE>block.setTargetable(def.isTargetable());<NEW_LINE>block.setClimbable(def.isClimbable());<NEW_LINE>block.setTranslucent(def.isTranslucent());<NEW_LINE>block.setDoubleSided(def.isDoubleSided());<NEW_LINE>block.setShadowCasting(def.isShadowCasting());<NEW_LINE>block.setWaving(def.isWaving());<NEW_LINE>block.setLuminance(def.getLuminance());<NEW_LINE>block.setTint(def.getTint());<NEW_LINE>if (Strings.isNullOrEmpty(def.getDisplayName())) {<NEW_LINE>block.setDisplayName(properCase(defaultName));<NEW_LINE>} else {<NEW_LINE>block.setDisplayName(def.getDisplayName());<NEW_LINE>}<NEW_LINE>block.setSounds(def.getSounds());<NEW_LINE>block.setMass(def.getMass());<NEW_LINE>block.setDebrisOnDestroy(def.isDebrisOnDestroy());<NEW_LINE>block.setFriction(def.getFriction());<NEW_LINE>block.setRestitution(def.getRestitution());<NEW_LINE>if (def.getEntity() != null) {<NEW_LINE>block.setPrefab(def.getEntity().getPrefab());<NEW_LINE>block.setKeepActive(def.getEntity().isKeepActive());<NEW_LINE>}<NEW_LINE>if (def.getInventory() != null) {<NEW_LINE>block.setStackable(def.getInventory().isStackable());<NEW_LINE>block.setDirectPickup(def.getInventory().isDirectPickup());<NEW_LINE>}<NEW_LINE>return block;<NEW_LINE>}
setIce(def.isIce());
1,847,883
public AddressSetView flowConstants(final Program program, Address flowStart, AddressSetView flowSet, final SymbolicPropogator symEval, final TaskMonitor monitor) throws CancelledException {<NEW_LINE>// follow all flows building up context<NEW_LINE>// use context to fill out addresses on certain instructions<NEW_LINE>ContextEvaluator eval = new ConstantPropagationContextEvaluator(trustWriteMemOption) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean evaluateReference(VarnodeContext context, Instruction instr, int pcodeop, Address address, int size, RefType refType) {<NEW_LINE>if ((refType.isRead() || refType.isWrite()) && adjustPagedAddress(instr, address, refType)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return super.evaluateReference(context, instr, pcodeop, address, size, refType);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Address evaluateConstant(VarnodeContext context, Instruction instr, int pcodeop, Address constant, int size, RefType refType) {<NEW_LINE>// TODO Auto-generated method stub<NEW_LINE>return super.evaluateConstant(context, instr, pcodeop, constant, size, refType);<NEW_LINE>}<NEW_LINE><NEW_LINE>private boolean adjustPagedAddress(Instruction instr, Address address, RefType refType) {<NEW_LINE>PcodeOp[] pcode = instr.getPcode();<NEW_LINE>for (PcodeOp op : pcode) {<NEW_LINE>int numin = op.getNumInputs();<NEW_LINE>if (numin < 1) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (op.getOpcode() != PcodeOp.CALLOTHER) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String opName = instr.getProgram().getLanguage().getUserDefinedOpName((int) op.getInput(0).getOffset());<NEW_LINE>if (opName != null && opName.equals("segment") && numin > 2) {<NEW_LINE>// assume this is a poorly created segment op addr<NEW_LINE>long high = <MASK><NEW_LINE>long low = address.getOffset() & 0xffff;<NEW_LINE>address = address.getNewAddress((high << 14) | (low & 0x3fff));<NEW_LINE>makeReference(instr, address, refType);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><NEW_LINE>// handle the reference on the correct read or write operand<NEW_LINE>private void makeReference(Instruction instr, Address address, RefType refType) {<NEW_LINE>int index = (refType.isRead() ? 1 : 0);<NEW_LINE>instr.addOperandReference(index, address, refType, SourceType.ANALYSIS);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return symEval.flowConstants(flowStart, flowSet, eval, true, monitor);<NEW_LINE>}
address.getOffset() >> 16;
388,479
private OracleConnectOptions toOracleConnectOptions(DataSourceRuntimeConfig dataSourceRuntimeConfig, DataSourceReactiveRuntimeConfig dataSourceReactiveRuntimeConfig, DataSourceReactiveOracleConfig dataSourceReactiveOracleConfig) {<NEW_LINE>OracleConnectOptions oracleConnectOptions;<NEW_LINE>if (dataSourceReactiveRuntimeConfig.url.isPresent()) {<NEW_LINE>String url <MASK><NEW_LINE>// clean up the URL to make migrations easier<NEW_LINE>if (url.startsWith("vertx-reactive:oracle:")) {<NEW_LINE>url = url.substring("vertx-reactive:".length());<NEW_LINE>}<NEW_LINE>oracleConnectOptions = OracleConnectOptions.fromUri(url);<NEW_LINE>} else {<NEW_LINE>oracleConnectOptions = new OracleConnectOptions();<NEW_LINE>}<NEW_LINE>if (dataSourceRuntimeConfig.username.isPresent()) {<NEW_LINE>oracleConnectOptions.setUser(dataSourceRuntimeConfig.username.get());<NEW_LINE>}<NEW_LINE>if (dataSourceRuntimeConfig.password.isPresent()) {<NEW_LINE>oracleConnectOptions.setPassword(dataSourceRuntimeConfig.password.get());<NEW_LINE>}<NEW_LINE>// credentials provider<NEW_LINE>if (dataSourceRuntimeConfig.credentialsProvider.isPresent()) {<NEW_LINE>String beanName = dataSourceRuntimeConfig.credentialsProviderName.orElse(null);<NEW_LINE>CredentialsProvider credentialsProvider = CredentialsProviderFinder.find(beanName);<NEW_LINE>String name = dataSourceRuntimeConfig.credentialsProvider.get();<NEW_LINE>Map<String, String> credentials = credentialsProvider.getCredentials(name);<NEW_LINE>String user = credentials.get(USER_PROPERTY_NAME);<NEW_LINE>String password = credentials.get(PASSWORD_PROPERTY_NAME);<NEW_LINE>if (user != null) {<NEW_LINE>oracleConnectOptions.setUser(user);<NEW_LINE>}<NEW_LINE>if (password != null) {<NEW_LINE>oracleConnectOptions.setPassword(password);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return oracleConnectOptions;<NEW_LINE>}
= dataSourceReactiveRuntimeConfig.url.get();
602,822
private void generateWebServiceFromEJB(String wsName, FileObject pkg, Node[] nodes) throws IOException {<NEW_LINE>if (nodes != null && nodes.length == 1) {<NEW_LINE>EjbReference ejbRef = nodes[0].getLookup().lookup(EjbReference.class);<NEW_LINE>if (ejbRef != null) {<NEW_LINE>DataFolder df = DataFolder.findFolder(pkg);<NEW_LINE>FileObject template = Templates.getTemplate(wiz);<NEW_LINE>FileObject templateParent = template.getParent();<NEW_LINE>if ((Boolean) wiz.getProperty(WizardProperties.IS_STATELESS_BEAN)) {<NEW_LINE>// NOI18N<NEW_LINE>template = templateParent.getFileObject("EjbWebServiceNoOp", "java");<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>template = <MASK><NEW_LINE>}<NEW_LINE>DataObject dTemplate = DataObject.find(template);<NEW_LINE>DataObject dobj = dTemplate.createFromTemplate(df, wsName);<NEW_LINE>FileObject createdFile = dobj.getPrimaryFile();<NEW_LINE>dobj = DataObject.find(createdFile);<NEW_LINE>ClassPath classPath = getClassPathForFile(project, createdFile);<NEW_LINE>if (classPath != null) {<NEW_LINE>if (classPath.findResource("javax/ejb/EJB.class") == null) {<NEW_LINE>// NOI19\8N<NEW_LINE>// ad EJB API on classpath<NEW_LINE>ContainerClassPathModifier modifier = project.getLookup().lookup(ContainerClassPathModifier.class);<NEW_LINE>if (modifier != null) {<NEW_LINE>modifier.extendClasspath(createdFile, new String[] { ContainerClassPathModifier.API_EJB });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>generateDelegateMethods(createdFile, ejbRef);<NEW_LINE>openFileInEditor(dobj);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
templateParent.getFileObject("WebServiceNoOp", "java");
1,215,042
final DeleteDomainResult executeDeleteDomain(DeleteDomainRequest deleteDomainRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteDomainRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteDomainRequest> request = null;<NEW_LINE>Response<DeleteDomainResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteDomainRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDomainRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "codeartifact");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDomain");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteDomainResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new DeleteDomainResultJsonUnmarshaller());
266,567
public GitRevision resolve(@Nullable String reference) throws RepoException, ValidationException {<NEW_LINE>console.progress("Git Origin: Initializing local repo");<NEW_LINE>String ref;<NEW_LINE>if (gitOriginOptions.useGitVersionSelector() && versionSelector != null) {<NEW_LINE>if (generalOptions.isForced() && !Strings.isNullOrEmpty(reference)) {<NEW_LINE>console.warnFmt(<MASK><NEW_LINE>ref = reference;<NEW_LINE>} else {<NEW_LINE>ref = versionSelector.selectVersion(reference, getRepository(), repoUrl, console);<NEW_LINE>checkCondition(ref != null, "Cannot find any matching version for latest_version");<NEW_LINE>}<NEW_LINE>} else if (Strings.isNullOrEmpty(reference)) {<NEW_LINE>checkCondition(getConfigRef() != null, "No reference was passed as a command line argument " + "for %s and no default reference was configured in the config file", repoUrl);<NEW_LINE>ref = getConfigRef();<NEW_LINE>} else {<NEW_LINE>ref = reference;<NEW_LINE>}<NEW_LINE>return resolveStringRef(ref);<NEW_LINE>}
"Ignoring git.version_selector as %s is being used. Using %s instead.", GeneralOptions.FORCE, reference);
1,224,173
protected void prepare() {<NEW_LINE>ProcessInfoParameter[] para = getParameter();<NEW_LINE>for (int i = 0; i < para.length; i++) {<NEW_LINE>String name = para[i].getParameterName();<NEW_LINE>if (para[i].getParameter() == null)<NEW_LINE>;<NEW_LINE>else if (name.equals("AD_User_ID"))<NEW_LINE>p_AD_User_ID = <MASK><NEW_LINE>else if (name.equals("OldPassword"))<NEW_LINE>p_OldPassword = (String) para[i].getParameter();<NEW_LINE>else if (name.equals("NewPassword"))<NEW_LINE>p_NewPassword = (String) para[i].getParameter();<NEW_LINE>else if (name.equals("NewEMail"))<NEW_LINE>p_NewEMail = (String) para[i].getParameter();<NEW_LINE>else if (name.equals("NewEMailUser"))<NEW_LINE>p_NewEMailUser = (String) para[i].getParameter();<NEW_LINE>else if (name.equals("NewEMailUserPW"))<NEW_LINE>p_NewEMailUserPW = (String) para[i].getParameter();<NEW_LINE>else<NEW_LINE>log.log(Level.SEVERE, "Unknown Parameter: " + name);<NEW_LINE>}<NEW_LINE>}
para[i].getParameterAsInt();
612,106
public void processView(EventBean[] newData, EventBean[] oldData, boolean isGenerateSynthetic) {<NEW_LINE>Object[] newDataMultiKey = processor.generateGroupKeyArrayView(newData, true);<NEW_LINE>Object[] oldDataMultiKey = processor.generateGroupKeyArrayView(oldData, false);<NEW_LINE>EventBean[] eventsPerStream = new EventBean[1];<NEW_LINE>if (newData != null) {<NEW_LINE>// apply new data to aggregates<NEW_LINE>int count = 0;<NEW_LINE>for (EventBean aNewData : newData) {<NEW_LINE>Object mk = newDataMultiKey[count];<NEW_LINE>eventsPerStream[0] = aNewData;<NEW_LINE>processor.getAggregationService().applyEnter(eventsPerStream, mk, processor.getExprEvaluatorContext());<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (oldData != null) {<NEW_LINE>// apply old data to aggregates<NEW_LINE>int count = 0;<NEW_LINE>for (EventBean anOldData : oldData) {<NEW_LINE>eventsPerStream[0] = anOldData;<NEW_LINE>processor.getAggregationService().applyLeave(eventsPerStream, oldDataMultiKey[count], processor.getExprEvaluatorContext());<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (processor.isSelectRStream()) {<NEW_LINE>processor.generateOutputBatchedViewPerKey(oldData, oldDataMultiKey, false, <MASK><NEW_LINE>}<NEW_LINE>processor.generateOutputBatchedViewPerKey(newData, newDataMultiKey, false, isGenerateSynthetic, outputLastUnordGroupNew, null, eventsPerStream);<NEW_LINE>}
isGenerateSynthetic, outputLastUnordGroupOld, null, eventsPerStream);
680,701
public void read(byte[] data) {<NEW_LINE>MySQLMessage mm = new MySQLMessage(data);<NEW_LINE>packetLength = mm.readUB3();<NEW_LINE>packetId = mm.read();<NEW_LINE>clientFlags = mm.readUB4();<NEW_LINE>maxPacketSize = mm.readUB4();<NEW_LINE>charsetIndex = (mm.read() & 0xff);<NEW_LINE>// read extra<NEW_LINE>int current = mm.position();<NEW_LINE>int len = (int) mm.readLength();<NEW_LINE>if (len > 0 && len < FILLER.length) {<NEW_LINE>byte[] ab = new byte[len];<NEW_LINE>System.arraycopy(mm.bytes(), mm.position(<MASK><NEW_LINE>this.extra = ab;<NEW_LINE>}<NEW_LINE>mm.position(current + FILLER.length);<NEW_LINE>user = mm.readStringWithNull();<NEW_LINE>password = mm.readBytesWithLength();<NEW_LINE>if (((clientFlags & Capabilities.CLIENT_CONNECT_WITH_DB) != 0) && mm.hasRemaining()) {<NEW_LINE>database = mm.readStringWithNull();<NEW_LINE>}<NEW_LINE>if ((clientFlags & Capabilities.CLIENT_MULTI_STATEMENTS) != 0) {<NEW_LINE>allowMultiStatements = true;<NEW_LINE>}<NEW_LINE>}
), ab, 0, len);
1,281,990
public static ListGatewaySlbResponse unmarshall(ListGatewaySlbResponse listGatewaySlbResponse, UnmarshallerContext _ctx) {<NEW_LINE>listGatewaySlbResponse.setRequestId(_ctx.stringValue("ListGatewaySlbResponse.RequestId"));<NEW_LINE>listGatewaySlbResponse.setHttpStatusCode(_ctx.integerValue("ListGatewaySlbResponse.HttpStatusCode"));<NEW_LINE>listGatewaySlbResponse.setMessage(_ctx.stringValue("ListGatewaySlbResponse.Message"));<NEW_LINE>listGatewaySlbResponse.setCode(_ctx.integerValue("ListGatewaySlbResponse.Code"));<NEW_LINE>listGatewaySlbResponse.setSuccess(_ctx.booleanValue("ListGatewaySlbResponse.Success"));<NEW_LINE>List<Sources> data = new ArrayList<Sources>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListGatewaySlbResponse.Data.Length"); i++) {<NEW_LINE>Sources sources = new Sources();<NEW_LINE>sources.setId(_ctx.stringValue("ListGatewaySlbResponse.Data[" + i + "].Id"));<NEW_LINE>sources.setSlbId(_ctx.stringValue("ListGatewaySlbResponse.Data[" + i + "].SlbId"));<NEW_LINE>sources.setSlbIp(_ctx.stringValue("ListGatewaySlbResponse.Data[" + i + "].SlbIp"));<NEW_LINE>sources.setSlbPort(_ctx.stringValue<MASK><NEW_LINE>sources.setType(_ctx.stringValue("ListGatewaySlbResponse.Data[" + i + "].Type"));<NEW_LINE>sources.setGatewayId(_ctx.stringValue("ListGatewaySlbResponse.Data[" + i + "].GatewayId"));<NEW_LINE>sources.setGmtCreate(_ctx.stringValue("ListGatewaySlbResponse.Data[" + i + "].GmtCreate"));<NEW_LINE>sources.setGatewaySlbMode(_ctx.stringValue("ListGatewaySlbResponse.Data[" + i + "].GatewaySlbMode"));<NEW_LINE>sources.setGatewaySlbStatus(_ctx.stringValue("ListGatewaySlbResponse.Data[" + i + "].GatewaySlbStatus"));<NEW_LINE>sources.setStatusDesc(_ctx.stringValue("ListGatewaySlbResponse.Data[" + i + "].StatusDesc"));<NEW_LINE>data.add(sources);<NEW_LINE>}<NEW_LINE>listGatewaySlbResponse.setData(data);<NEW_LINE>return listGatewaySlbResponse;<NEW_LINE>}
("ListGatewaySlbResponse.Data[" + i + "].SlbPort"));
235,251
public Mono<PowershellManager> initSession() {<NEW_LINE>ProcessBuilder pb;<NEW_LINE>if (Platform.isWindows()) {<NEW_LINE>pb = new ProcessBuilder("cmd.exe", "/c", "chcp", "65001", ">", "NUL", "&", powershellPath, "-ExecutionPolicy", "Bypass", "-NoExit", "-NoProfile", "-Command", "-");<NEW_LINE>} else {<NEW_LINE>pb = new ProcessBuilder(powershellPath, "-nologo", "-noexit", "-Command", "-");<NEW_LINE>}<NEW_LINE>pb.redirectErrorStream(true);<NEW_LINE>Supplier<PowershellManager> supplier = () -> {<NEW_LINE>try {<NEW_LINE>this.process = pb.start();<NEW_LINE>this.commandWriter = new PrintWriter(new OutputStreamWriter(new BufferedOutputStream(process.getOutputStream())<MASK><NEW_LINE>if (this.process.waitFor(4L, TimeUnit.SECONDS) && !this.process.isAlive()) {<NEW_LINE>throw new CredentialUnavailableException("Unable to execute PowerShell." + " Please make sure that it is installed in your system.");<NEW_LINE>}<NEW_LINE>this.closed = false;<NEW_LINE>} catch (InterruptedException | IOException e) {<NEW_LINE>throw new CredentialUnavailableException("Unable to execute PowerShell. " + "Please make sure that it is installed in your system", e);<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>};<NEW_LINE>return executorService != null ? Mono.fromFuture(CompletableFuture.supplyAsync(supplier, executorService)) : Mono.fromFuture(CompletableFuture.supplyAsync(supplier));<NEW_LINE>}
, StandardCharsets.UTF_8), true);
62,804
protected AbstractLayoutCache createLayoutCache() {<NEW_LINE>if (isLargeModel() && getRowHeight() > 0) {<NEW_LINE>return new FixedHeightLayoutCache();<NEW_LINE>}<NEW_LINE>return new VariableHeightLayoutCache() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setExpandedState(TreePath path, boolean isExpanded) {<NEW_LINE>int oldRowCount = getRowCount();<NEW_LINE><MASK><NEW_LINE>if (isExpanded)<NEW_LINE>onSingleChildInserted(path, oldRowCount);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void treeNodesInserted(TreeModelEvent event) {<NEW_LINE>int oldRowCount = getRowCount();<NEW_LINE>super.treeNodesInserted(event);<NEW_LINE>onSingleChildInserted(event.getTreePath(), oldRowCount);<NEW_LINE>}<NEW_LINE><NEW_LINE>private void onSingleChildInserted(TreePath path, int oldRowCount) {<NEW_LINE>if (path == null || oldRowCount + 1 != getRowCount())<NEW_LINE>return;<NEW_LINE>JTree tree = getTree();<NEW_LINE>if (tree == null || !isAutoExpandAllowed(tree) || !tree.isVisible(path))<NEW_LINE>return;<NEW_LINE>TreeModel model = tree.getModel();<NEW_LINE>if (model instanceof AsyncTreeModel && 1 == model.getChildCount(path.getLastPathComponent())) {<NEW_LINE>int pathCount = 1 + path.getPathCount();<NEW_LINE>for (int i = 0; i <= oldRowCount; i++) {<NEW_LINE>TreePath row = getPathForRow(i);<NEW_LINE>if (row != null && pathCount == row.getPathCount() && path.equals(row.getParentPath())) {<NEW_LINE>((AsyncTreeModel) model).onValidThread(() -> tree.expandPath(row));<NEW_LINE>// this code is intended to auto-expand a single child node<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
super.setExpandedState(path, isExpanded);
963,523
public com.alibaba.alink.operator.batch.dl.ctr.protos.Mmoe.MMoE buildPartial() {<NEW_LINE>com.alibaba.alink.operator.batch.dl.ctr.protos.Mmoe.MMoE result = new com.alibaba.alink.operator.batch.dl.ctr.<MASK><NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (expertsBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000001) != 0)) {<NEW_LINE>experts_ = java.util.Collections.unmodifiableList(experts_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000001);<NEW_LINE>}<NEW_LINE>result.experts_ = experts_;<NEW_LINE>} else {<NEW_LINE>result.experts_ = expertsBuilder_.build();<NEW_LINE>}<NEW_LINE>if (((from_bitField0_ & 0x00000002) != 0)) {<NEW_LINE>if (expertDnnBuilder_ == null) {<NEW_LINE>result.expertDnn_ = expertDnn_;<NEW_LINE>} else {<NEW_LINE>result.expertDnn_ = expertDnnBuilder_.build();<NEW_LINE>}<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>if (((from_bitField0_ & 0x00000004) != 0)) {<NEW_LINE>result.numExpert_ = numExpert_;<NEW_LINE>to_bitField0_ |= 0x00000002;<NEW_LINE>}<NEW_LINE>if (taskTowersBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000008) != 0)) {<NEW_LINE>taskTowers_ = java.util.Collections.unmodifiableList(taskTowers_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000008);<NEW_LINE>}<NEW_LINE>result.taskTowers_ = taskTowers_;<NEW_LINE>} else {<NEW_LINE>result.taskTowers_ = taskTowersBuilder_.build();<NEW_LINE>}<NEW_LINE>if (((from_bitField0_ & 0x00000010) != 0)) {<NEW_LINE>to_bitField0_ |= 0x00000004;<NEW_LINE>}<NEW_LINE>result.l2Regularization_ = l2Regularization_;<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
protos.Mmoe.MMoE(this);
264,079
public static ProbCNFGrammar buildTrivialGrammar() {<NEW_LINE>ProbCNFGrammar g = new ProbCNFGrammar();<NEW_LINE>ArrayList<Rule> rules <MASK><NEW_LINE>rules.add(new Rule("S", "NP,VP", (float) 1.0));<NEW_LINE>rules.add(new Rule("NP", "ARTICLE,NOUN", (float) 0.50));<NEW_LINE>rules.add(new Rule("NP", "PRONOUN,ADVERB", (float) 0.5));<NEW_LINE>rules.add(new Rule("VP", "VERB,NP", (float) 1.0));<NEW_LINE>// add terminal rules<NEW_LINE>Lexicon trivLex = LexiconExamples.buildTrivialLexicon();<NEW_LINE>ArrayList<Rule> terminalRules = new ArrayList<Rule>(trivLex.getAllTerminalRules());<NEW_LINE>rules.addAll(terminalRules);<NEW_LINE>// Add all these rules into the grammar<NEW_LINE>if (!g.addRules(rules)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return g;<NEW_LINE>}
= new ArrayList<Rule>();
615,996
public byte[] marshall(CreateLiveChannelRequest request) {<NEW_LINE>StringBuffer xmlBody = new StringBuffer();<NEW_LINE>xmlBody.append("<LiveChannelConfiguration>");<NEW_LINE>xmlBody.append("<Description>" + request.getLiveChannelDescription() + "</Description>");<NEW_LINE>xmlBody.append("<Status>" + request.getLiveChannelStatus() + "</Status>");<NEW_LINE>LiveChannelTarget target = request.getLiveChannelTarget();<NEW_LINE>xmlBody.append("<Target>");<NEW_LINE>xmlBody.append("<Type>" + target.getType() + "</Type>");<NEW_LINE>xmlBody.append("<FragDuration>" + target.getFragDuration() + "</FragDuration>");<NEW_LINE>xmlBody.append("<FragCount>" + <MASK><NEW_LINE>xmlBody.append("<PlaylistName>" + target.getPlaylistName() + "</PlaylistName>");<NEW_LINE>xmlBody.append("</Target>");<NEW_LINE>xmlBody.append("</LiveChannelConfiguration>");<NEW_LINE>byte[] rawData = null;<NEW_LINE>try {<NEW_LINE>rawData = xmlBody.toString().getBytes(DEFAULT_CHARSET_NAME);<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>throw new ClientException("Unsupported encoding " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>return rawData;<NEW_LINE>}
target.getFragCount() + "</FragCount>");
1,066,203
public JsMessage createInboundJsMessage(byte[] rawMessage, int offset, int length, Object conn) throws MessageDecodeFailedException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "createInboundJsMessage", new Object[] <MASK><NEW_LINE>CommsConnection commsConnection = null;<NEW_LINE>// try to cast the connection object to a CommsConnection<NEW_LINE>if (conn != null) {<NEW_LINE>if (conn instanceof CommsConnection) {<NEW_LINE>commsConnection = (CommsConnection) conn;<NEW_LINE>} else {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>SibTr.debug(tc, "Invalid comms connection");<NEW_LINE>ClassCastException e = new ClassCastException();<NEW_LINE>FFDCFilter.processException(e, "com.ibm.ws.sib.mfp.impl.JsMessageFactoryImpl.createInboundJsMessage", "168", this, new Object[] { MfpConstants.DM_BUFFER, rawMessage, offset, length, conn });<NEW_LINE>// FFDC but do not actually throw the exception as we might still be able to decode<NEW_LINE>// without the CommsConnection<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Trace the first 256 bytes of the buffer just in case we get passed rubbish<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>SibTr.debug(tc, "Start of buffer: ", SibTr.formatBytes(rawMessage, 0, 256));<NEW_LINE>// create a new jmo using the given data<NEW_LINE>JsMsgObject jmo = new JsMsgObject(JsHdrAccess.schema, JsPayloadAccess.schema, rawMessage, offset, length, commsConnection);<NEW_LINE>// Create a message of the appropriate specialisation<NEW_LINE>JsMessage message = createSpecialisedMessage(jmo);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "createInboundJsMessage", message);<NEW_LINE>return message;<NEW_LINE>}
{ rawMessage, offset, length });
935,014
public WorkProcessor.ProcessState<WorkProcessor<Page>> process() {<NEW_LINE>// wait for build side to be completed before fetching any probe data<NEW_LINE>// TODO: fix support for probe short-circuit: https://github.com/trinodb/trino/issues/3957<NEW_LINE>if (waitForBuild && !lookupSourceProvider.isDone()) {<NEW_LINE>return WorkProcessor.ProcessState.blocked(asVoid(lookupSourceProvider));<NEW_LINE>}<NEW_LINE>if (!joinedSourcePages.isFinished()) {<NEW_LINE>return WorkProcessor.ProcessState.ofResult(joinedSourcePages);<NEW_LINE>}<NEW_LINE>if (partitionedConsumption == null) {<NEW_LINE>partitionedConsumption = lookupSourceFactory.finishProbeOperator(lookupJoinsCount);<NEW_LINE>return WorkProcessor.ProcessState.blocked(asVoid(partitionedConsumption));<NEW_LINE>}<NEW_LINE>if (lookupPartitions == null) {<NEW_LINE>lookupPartitions = getDone(partitionedConsumption).beginConsumption();<NEW_LINE>}<NEW_LINE>if (previousPartition != null) {<NEW_LINE>// If we had no rows for the previous spill partition, we would finish before it is unspilled.<NEW_LINE>// Partition must be loaded before it can be released. // TODO remove this constraint<NEW_LINE>if (!previousPartitionLookupSource.isDone()) {<NEW_LINE>return WorkProcessor.ProcessState.blocked(asVoid(previousPartitionLookupSource));<NEW_LINE>}<NEW_LINE>previousPartition.release();<NEW_LINE>previousPartition = null;<NEW_LINE>previousPartitionLookupSource = null;<NEW_LINE>}<NEW_LINE>if (!lookupPartitions.hasNext()) {<NEW_LINE>close();<NEW_LINE>return WorkProcessor.ProcessState.finished();<NEW_LINE>}<NEW_LINE>PartitionedConsumption.Partition<Supplier<LookupSource>> partition = lookupPartitions.next();<NEW_LINE>previousPartition = partition;<NEW_LINE>previousPartitionLookupSource = partition.load();<NEW_LINE>return WorkProcessor.ProcessState<MASK><NEW_LINE>}
.ofResult(joinUnspilledPages(partition));
652,090
private ConfirmEmailInitResponse sendConfirm(AuthenticatedUser aUser, boolean sendEmail) throws ConfirmEmailException {<NEW_LINE>// delete old tokens for the user<NEW_LINE>ConfirmEmailData oldToken = findSingleConfirmEmailDataByUser(aUser);<NEW_LINE>if (oldToken != null) {<NEW_LINE>em.remove(oldToken);<NEW_LINE>}<NEW_LINE>aUser.setEmailConfirmed(null);<NEW_LINE>aUser = em.merge(aUser);<NEW_LINE>// create a fresh token for the user iff they don't have an existing token<NEW_LINE>ConfirmEmailData confirmEmailData = new ConfirmEmailData(aUser, systemConfig.getMinutesUntilConfirmEmailTokenExpires());<NEW_LINE>try {<NEW_LINE>em.persist(confirmEmailData);<NEW_LINE>ConfirmEmailInitResponse confirmEmailInitResponse = new ConfirmEmailInitResponse(true<MASK><NEW_LINE>if (sendEmail) {<NEW_LINE>sendLinkOnEmailChange(aUser, confirmEmailInitResponse.getConfirmUrl());<NEW_LINE>}<NEW_LINE>return confirmEmailInitResponse;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>String msg = "Unable to save token for " + aUser.getEmail();<NEW_LINE>throw new ConfirmEmailException(msg, ex);<NEW_LINE>}<NEW_LINE>}
, confirmEmailData, optionalConfirmEmailAddonMsg(aUser));
613,158
public DescribeFleetMetricResult describeFleetMetric(DescribeFleetMetricRequest describeFleetMetricRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeFleetMetricRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeFleetMetricRequest> request = null;<NEW_LINE>Response<DescribeFleetMetricResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeFleetMetricRequestMarshaller().marshall(describeFleetMetricRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<DescribeFleetMetricResult, JsonUnmarshallerContext> unmarshaller = new DescribeFleetMetricResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<DescribeFleetMetricResult> responseHandler = new JsonResponseHandler<DescribeFleetMetricResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(<MASK><NEW_LINE>}<NEW_LINE>}
awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
368,172
private static boolean determineIf64Bit() {<NEW_LINE>String s = System.getProperty("sun.arch.data.model");<NEW_LINE>if (s != null) {<NEW_LINE>boolean b = s.equals("64");<NEW_LINE>TDB.logInfo.debug("System architecture: " + (b ? "64 bit" : "32 bit"));<NEW_LINE>return b;<NEW_LINE>}<NEW_LINE>// Not a SUN VM<NEW_LINE><MASK><NEW_LINE>if (s == null) {<NEW_LINE>log.warn("Can't determine the data model");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>log.debug("Can't determine the data model from 'sun.arch.data.model' - using java.vm.info");<NEW_LINE>boolean b = s.contains("64");<NEW_LINE>TDB.logInfo.debug("System architecture: (from java.vm.info) " + (b ? "64 bit" : "32 bit"));<NEW_LINE>return b;<NEW_LINE>}
s = System.getProperty("java.vm.info");
1,143,226
private Set<String> parseBeanMethods(TypeElement entity, CompilationController controller) {<NEW_LINE>List<ExecutableElement> methods = ElementFilter.methodsIn(controller.getElements().getAllMembers(entity));<NEW_LINE>Set<String> result <MASK><NEW_LINE>Map<String, TypeMirror> getAttrs = new HashMap<String, TypeMirror>();<NEW_LINE>Map<String, TypeMirror> setAttrs = new HashMap<String, TypeMirror>();<NEW_LINE>for (ExecutableElement method : methods) {<NEW_LINE>if (!method.getModifiers().contains(Modifier.PUBLIC)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Object[] attribute = getAttrName(method, controller);<NEW_LINE>if (attribute == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String name = (String) attribute[1];<NEW_LINE>TypeMirror type = (TypeMirror) attribute[2];<NEW_LINE>if (attribute[0] == MethodType.GET) {<NEW_LINE>if (findAccessor(name, type, getAttrs, setAttrs, controller)) {<NEW_LINE>result.add(name);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (findAccessor(name, type, setAttrs, getAttrs, controller)) {<NEW_LINE>result.add(name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
= new HashSet<String>();
1,841,645
public void initializeDatastream(Datastream stream, List<Datastream> allDatastreams) throws DatastreamValidationException {<NEW_LINE>Validate.notNull(stream);<NEW_LINE>Validate.notNull(allDatastreams);<NEW_LINE>LOG.info(<MASK><NEW_LINE>String sourceDirectoryPath = stream.getSource().getConnectionString();<NEW_LINE>validateDirectoryPath(sourceDirectoryPath);<NEW_LINE>String destDirectoryPath = stream.getDestination().getConnectionString();<NEW_LINE>validateDirectoryPath(destDirectoryPath);<NEW_LINE>try {<NEW_LINE>if (Files.isSameFile(Paths.get(sourceDirectoryPath), Paths.get(destDirectoryPath))) {<NEW_LINE>throw new DatastreamValidationException("Source and destination paths cannot refer to the same directory");<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new DatastreamValidationException("Could not verify if source and destination paths are different", ex);<NEW_LINE>}<NEW_LINE>// single partition datastream<NEW_LINE>stream.getSource().setPartitions(1);<NEW_LINE>}
"validating datastream " + stream.toString());
371,293
private void loadNode34() {<NEW_LINE>UaMethodNode node = new UaMethodNode(this.context, Identifiers.AlarmConditionType_ShelvingState_Unshelve, new QualifiedName(0, "Unshelve"), new LocalizedText("en", "Unshelve"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), true, true);<NEW_LINE>node.addReference(new Reference(Identifiers.AlarmConditionType_ShelvingState_Unshelve, Identifiers.AlwaysGeneratesEvent, Identifiers.AuditConditionShelvingEventType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.AlarmConditionType_ShelvingState_Unshelve, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.AlarmConditionType_ShelvingState_Unshelve, Identifiers.HasComponent, Identifiers.AlarmConditionType_ShelvingState.expanded(), false));<NEW_LINE><MASK><NEW_LINE>}
this.nodeManager.addNode(node);
290,472
public BatchListIndex unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>BatchListIndex batchListIndex = new BatchListIndex();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("RangesOnIndexedValues", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchListIndex.setRangesOnIndexedValues(new ListUnmarshaller<ObjectAttributeRange>(ObjectAttributeRangeJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("IndexReference", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchListIndex.setIndexReference(ObjectReferenceJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("MaxResults", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchListIndex.setMaxResults(context.getUnmarshaller(Integer.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>batchListIndex.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return batchListIndex;<NEW_LINE>}
)).unmarshall(context));
1,523,919
final DisassociateConnectionFromLagResult executeDisassociateConnectionFromLag(DisassociateConnectionFromLagRequest disassociateConnectionFromLagRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateConnectionFromLagRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateConnectionFromLagRequest> request = null;<NEW_LINE>Response<DisassociateConnectionFromLagResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateConnectionFromLagRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociateConnectionFromLagRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Direct Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateConnectionFromLag");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociateConnectionFromLagResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateConnectionFromLagResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
857,681
public TimelineModel<Order, Truck> newModelWithNumber(int n) {<NEW_LINE>TimelineModel<Order, Truck> <MASK><NEW_LINE>int orderNumber = 1;<NEW_LINE>for (int j = 1; j <= n; j++) {<NEW_LINE>model.addGroup(new TimelineGroup<Truck>("id" + j, new Truck(String.valueOf(9 + j))));<NEW_LINE>LocalDateTime referenceDate = LocalDateTime.of(2015, Month.DECEMBER, 14, 8, 0);<NEW_LINE>for (int i = 0; i < 6; i++) {<NEW_LINE>LocalDateTime startDate = referenceDate.plusHours(3 * (Math.random() < 0.2 ? 1 : 0));<NEW_LINE>LocalDateTime endDate = startDate.plusHours(2 + (int) Math.floor(Math.random() * 4));<NEW_LINE>String imagePath = null;<NEW_LINE>if (Math.random() < 0.25) {<NEW_LINE>imagePath = "images/timeline/box.png";<NEW_LINE>}<NEW_LINE>Order order = new Order(orderNumber, imagePath);<NEW_LINE>model.add(TimelineEvent.<Order>builder().data(order).startDate(startDate).endDate(endDate).editable(true).group("id" + j).build());<NEW_LINE>orderNumber++;<NEW_LINE>referenceDate = endDate;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return model;<NEW_LINE>}
model = new TimelineModel<>();
1,136,499
public static String detectDataDirectory() {<NEW_LINE>String dataPath = System.getProperty(JBOSS_SERVER_DATA_DIR);<NEW_LINE>if (dataPath != null) {<NEW_LINE>// we assume jboss.server.data.dir is managed externally so just use it as is.<NEW_LINE>File dataDir = new File(dataPath);<NEW_LINE>if (!dataDir.exists() || !dataDir.isDirectory()) {<NEW_LINE>throw new RuntimeException("Invalid " + JBOSS_SERVER_DATA_DIR + " resources directory: " + dataPath);<NEW_LINE>}<NEW_LINE>return dataPath;<NEW_LINE>}<NEW_LINE>// we generate a dynamic jboss.server.data.dir and remove it at the end.<NEW_LINE>try {<NEW_LINE>File tempKeycloakFolder = Platform.getPlatform().getTmpDirectory();<NEW_LINE>File tmpDataDir = new File(tempKeycloakFolder, "/data");<NEW_LINE>if (tmpDataDir.mkdirs()) {<NEW_LINE>tmpDataDir.deleteOnExit();<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>dataPath = tmpDataDir.getAbsolutePath();<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>throw new RuntimeException("Could not create temporary " + JBOSS_SERVER_DATA_DIR, ioe);<NEW_LINE>}<NEW_LINE>return dataPath;<NEW_LINE>}
throw new IOException("Could not create directory " + tmpDataDir);
1,796,604
private void addBufferPoints(List<Coordinate> points, Quadtree tree, double lon0, double lat0, double lon1, double lat1, boolean addLast, boolean checkNeighbours, double bufferSize) {<NEW_LINE>double dx = (lon0 - lon1);<NEW_LINE>double dy = (lat0 - lat1);<NEW_LINE>double normLength = Math.sqrt((dx * dx) + (dy * dy));<NEW_LINE>double scale = bufferSize / normLength;<NEW_LINE>double dx2 = -dy * scale;<NEW_LINE>double dy2 = dx * scale;<NEW_LINE>addPoint(points, tree, lon0 + dx2, lat0 + dy2, checkNeighbours);<NEW_LINE>addPoint(points, tree, lon0 - dx2, lat0 - dy2, checkNeighbours);<NEW_LINE>// add a middle point if two points are too far from each other<NEW_LINE>if (normLength > 2 * bufferSize) {<NEW_LINE>addPoint(points, tree, (lon0 + lon1) / 2.0 + dx2, (lat0 + lat1) / 2.0 + dy2, checkNeighbours);<NEW_LINE>addPoint(points, tree, (lon0 + lon1) / 2.0 - dx2, (lat0 + lat1) / 2.0 - dy2, checkNeighbours);<NEW_LINE>}<NEW_LINE>if (addLast) {<NEW_LINE>addPoint(points, tree, lon1 + dx2, lat1 + dy2, checkNeighbours);<NEW_LINE>addPoint(points, tree, lon1 - <MASK><NEW_LINE>}<NEW_LINE>}
dx2, lat1 - dy2, checkNeighbours);
152,506
protected void saveEditorValue(Control control, int index, TableItem item) {<NEW_LINE>SQLQueryParameter param = (SQLQueryParameter) item.getData();<NEW_LINE>String newValue = editor.getText();<NEW_LINE>item.setText(2, newValue);<NEW_LINE>param.setValue(newValue);<NEW_LINE>param.setVariableSet(!CommonUtils.isEmpty(newValue));<NEW_LINE>if (param.isNamed()) {<NEW_LINE>final List<SQLQueryParameter> dups = dupParameters.get(param.getName());<NEW_LINE>if (dups != null) {<NEW_LINE>for (SQLQueryParameter dup : dups) {<NEW_LINE>dup.setValue(newValue);<NEW_LINE>dup.setVariableSet(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>queryContext.setVariable(param.getName(), param.getValue());<NEW_LINE>}<NEW_LINE>savedParamValues.put(param.getName().toUpperCase(Locale.ENGLISH), new SQLQueryParameterRegistry.ParameterInfo(param.getName(), newValue));<NEW_LINE>updateQueryPreview();<NEW_LINE>}
!CommonUtils.isEmpty(newValue));
1,406,779
void registerForNavigationUpdates(long id) {<NEW_LINE>final NextDirectionInfo baseNdi = new NextDirectionInfo();<NEW_LINE>IRoutingDataUpdateListener listener = () -> {<NEW_LINE>if (aidlCallbackListener != null) {<NEW_LINE>ADirectionInfo directionInfo = new ADirectionInfo(-1, -1, false);<NEW_LINE>RoutingHelper rh = app.getRoutingHelper();<NEW_LINE>if (rh.isDeviatedFromRoute()) {<NEW_LINE>directionInfo.setTurnType(TurnType.OFFR);<NEW_LINE>directionInfo.setDistanceTo((int) rh.getRouteDeviation());<NEW_LINE>} else {<NEW_LINE>NextDirectionInfo ndi = rh.getNextRouteDirectionInfo(baseNdi, true);<NEW_LINE>if (ndi != null && ndi.distanceTo > 0 && ndi.directionInfo != null) {<NEW_LINE>directionInfo.setDistanceTo(ndi.distanceTo);<NEW_LINE>directionInfo.setTurnType(ndi.directionInfo.getTurnType().getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (OsmandAidlService.AidlCallbackParams cb : aidlCallbackListener.getAidlCallbacks().values()) {<NEW_LINE>if (!aidlCallbackListener.getAidlCallbacks().isEmpty() && (cb.getKey() & KEY_ON_NAV_DATA_UPDATE) > 0) {<NEW_LINE>try {<NEW_LINE>cb.getCallback().updateNavigationInfo(directionInfo);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (aidlCallbackListenerV2 != null) {<NEW_LINE>net.osmand.aidlapi.navigation.ADirectionInfo directionInfo = new net.osmand.aidlapi.navigation.ADirectionInfo(-1, -1, false);<NEW_LINE>RoutingHelper rh = app.getRoutingHelper();<NEW_LINE>if (rh.isDeviatedFromRoute()) {<NEW_LINE>directionInfo.setTurnType(TurnType.OFFR);<NEW_LINE>directionInfo.setDistanceTo((int) rh.getRouteDeviation());<NEW_LINE>} else {<NEW_LINE>NextDirectionInfo ndi = rh.getNextRouteDirectionInfo(baseNdi, true);<NEW_LINE>if (ndi != null && ndi.distanceTo > 0 && ndi.directionInfo != null) {<NEW_LINE>directionInfo.setDistanceTo(ndi.distanceTo);<NEW_LINE>directionInfo.setTurnType(ndi.directionInfo.getTurnType().getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (OsmandAidlServiceV2.AidlCallbackParams cb : aidlCallbackListenerV2.getAidlCallbacks().values()) {<NEW_LINE>if (!aidlCallbackListenerV2.getAidlCallbacks().isEmpty() && (cb.getKey() & KEY_ON_NAV_DATA_UPDATE) > 0) {<NEW_LINE>try {<NEW_LINE>cb.getCallback().updateNavigationInfo(directionInfo);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>navUpdateCallbacks.put(id, listener);<NEW_LINE>app.getRoutingHelper().addRouteDataListener(listener);<NEW_LINE>}
e.getMessage(), e);
1,803,147
// Implement JSCoder.decode<NEW_LINE>public Object decode(byte[] frame, int offset, int indirect, JMFMessageData msg) throws JMFMessageCorruptionException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>JmfTr.entry(this, tc, "decode", new Object[] { frame, offset, indirect, msg });<NEW_LINE>Object result = null;<NEW_LINE>if (indirect < 0) {<NEW_LINE>indirect = this.indirect;<NEW_LINE>}<NEW_LINE>if (indirect > 0) {<NEW_LINE>result = new JSVaryingListImpl(frame, offset, element, indirect);<NEW_LINE>} else if (varying) {<NEW_LINE>result = new JSVaryingListImpl(frame, offset, element, 0);<NEW_LINE>} else {<NEW_LINE>result = new JSFixedListImpl(frame, offset, element);<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>JmfTr.exit(<MASK><NEW_LINE>return result;<NEW_LINE>}
this, tc, "decode", result);