idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,462,467
public void execute() {<NEW_LINE>DomUtils.fillIFrame(frame.getIFrame(), htmlOutput);<NEW_LINE>DomUtils.forwardWheelEvent(frame.getIFrame().getContentDocument(), parentElement);<NEW_LINE>int contentHeight = frame.getWindow().getDocument().getDocumentElement().getOffsetHeight();<NEW_LINE><MASK><NEW_LINE>callbackContent.setWidth("100%");<NEW_LINE>frame.getElement().getStyle().setWidth(100, Unit.PCT);<NEW_LINE>frame.getElement().getStyle().setHeight(contentHeight, Unit.PX);<NEW_LINE>host_.notifyHeightChanged();<NEW_LINE>Command heightHandler = () -> {<NEW_LINE>// reset height so we can shrink it if necessary<NEW_LINE>frame.getElement().getStyle().setHeight(0, Unit.PX);<NEW_LINE>// delay calculating the height so any images can load<NEW_LINE>new Timer() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>int newHeight = frame.getWindow().getDocument().getDocumentElement().getOffsetHeight();<NEW_LINE>callbackContent.setHeight(newHeight + "px");<NEW_LINE>frame.getElement().getStyle().setHeight(newHeight, Unit.PX);<NEW_LINE>host_.notifyHeightChanged();<NEW_LINE>}<NEW_LINE>}.schedule(50);<NEW_LINE>};<NEW_LINE>MutationObserver.Builder builder = new MutationObserver.Builder(heightHandler);<NEW_LINE>builder.attributes(true);<NEW_LINE>builder.characterData(true);<NEW_LINE>builder.childList(true);<NEW_LINE>builder.subtree(true);<NEW_LINE>MutationObserver observer = builder.get();<NEW_LINE>observer.observe(frame.getIFrame().getContentDocument().getBody());<NEW_LINE>}
callbackContent.setHeight(contentHeight + "px");
1,711,517
public boolean visit(SQLBetweenExpr x) {<NEW_LINE>if (x.isNot()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>String begin;<NEW_LINE>if (x.beginExpr instanceof SQLCharExpr) {<NEW_LINE>begin = (String) ((SQLCharExpr) x.beginExpr).getValue();<NEW_LINE>} else if (x.beginExpr instanceof SQLNullExpr) {<NEW_LINE>begin = x.beginExpr.toString();<NEW_LINE>} else {<NEW_LINE>Object value = SQLEvalVisitorUtils.eval(this.getDbType(), x.beginExpr, this.getParameters(), false);<NEW_LINE>if (value != null) {<NEW_LINE>begin = value.toString();<NEW_LINE>} else {<NEW_LINE>begin <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>String end;<NEW_LINE>if (x.endExpr instanceof SQLCharExpr) {<NEW_LINE>end = (String) ((SQLCharExpr) x.endExpr).getValue();<NEW_LINE>} else if (x.endExpr instanceof SQLNullExpr) {<NEW_LINE>end = x.endExpr.toString();<NEW_LINE>} else {<NEW_LINE>Object value = SQLEvalVisitorUtils.eval(this.getDbType(), x.endExpr, this.getParameters(), false);<NEW_LINE>if (value != null) {<NEW_LINE>end = value.toString();<NEW_LINE>} else {<NEW_LINE>end = x.endExpr.toString();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Column column = getColumn(x);<NEW_LINE>if (column == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Condition condition = new Condition(column, "between");<NEW_LINE>this.conditions.add(condition);<NEW_LINE>condition.getValues().add(begin);<NEW_LINE>condition.getValues().add(end);<NEW_LINE>return true;<NEW_LINE>}
= x.beginExpr.toString();
382,535
public void generateGetDataType() {<NEW_LINE>for (ClassOutline classOutline : outline.getClasses()) {<NEW_LINE>JDefinedClass implClass = classOutline.implClass;<NEW_LINE>int mods = JMod.PUBLIC;<NEW_LINE>JType returnType = strType;<NEW_LINE>// JType returnType = objType;<NEW_LINE>JMethod dynamicMethod = implClass.method(mods, implClass, "getDataType");<NEW_LINE>dynamicMethod.type(returnType);<NEW_LINE>JBlock body = dynamicMethod.body();<NEW_LINE>JVar jvarParam = dynamicMethod.param(String.class, GET_SET_PARAM);<NEW_LINE>// TODO use generics instead of casting<NEW_LINE>JFieldVar fieldVar = implClass.fields().get("dataTypeMap");<NEW_LINE>JConditional cond = null;<NEW_LINE>JType[] args = {};<NEW_LINE>cond = body._if(fieldVar.invoke("containsKey").arg(jvarParam));<NEW_LINE>cond._then()._return(JExpr.cast(strType, implClass.fields().get("dataTypeMap").invoke("get").arg(jvarParam)));<NEW_LINE>if (!implClass._extends().equals(objType))<NEW_LINE>cond._else()._return(JExpr._super().invoke(dynamicMethod).arg(jvarParam));<NEW_LINE>else<NEW_LINE>cond._else().<MASK><NEW_LINE>}<NEW_LINE>}
_return(JExpr._null());
353,101
private static void initFileHandler(Logger rootLogger) {<NEW_LINE>if (!logDir.get().isEmpty()) {<NEW_LINE>File dir = new <MASK><NEW_LINE>dir.mkdirs();<NEW_LINE>File file = new File(dir, "gapic.log");<NEW_LINE>for (int i = 0; i < 10; i++) {<NEW_LINE>if (!file.exists() || file.canWrite()) {<NEW_LINE>try {<NEW_LINE>FileHandler fileHandler = new FileHandler(file.getAbsolutePath());<NEW_LINE>fileHandler.setFormatter(new LogFormatter());<NEW_LINE>fileHandler.setLevel(Level.ALL);<NEW_LINE>rootLogger.addHandler(fileHandler);<NEW_LINE>return;<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.err.println("Failed to create log file " + file + ":");<NEW_LINE>e.printStackTrace(System.err);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Try a different name next.<NEW_LINE>file = new File(dir, "gapic-" + i + ".log");<NEW_LINE>}<NEW_LINE>// Give up.<NEW_LINE>System.err.println("Failed to create log file in " + logDir.get());<NEW_LINE>}<NEW_LINE>}
File(logDir.get());
392,805
public short parseFile(File f) throws Exception {<NEW_LINE>String filename = f.getAbsolutePath();<NEW_LINE>String classname = filename.substring(this.basedir.length() + 1).replaceAll("/", ".");<NEW_LINE>classname = classname.substring(0, classname.length() - 5);<NEW_LINE>BufferedReader in = new BufferedReader(new FileReader(f));<NEW_LINE>String line;<NEW_LINE>int lineNo = 1;<NEW_LINE>short rc = 0;<NEW_LINE>while ((line = in.readLine()) != null) {<NEW_LINE>Matcher m = pattern.matcher(line);<NEW_LINE>if (m.matches()) {<NEW_LINE>String number = m.group(1);<NEW_LINE>if (this.points.containsKey(number)) {<NEW_LINE>System.out.println("Duplicate Trace Point: " + number);<NEW_LINE>System.out.println(" " + this.points.get(number));<NEW_LINE>System.out.println(" " + classname + ":" + lineNo);<NEW_LINE>rc = 1;<NEW_LINE>}<NEW_LINE>// The original extractor put out 4 values for each trace point<NEW_LINE>// out.println(number+".class="+classname);<NEW_LINE>// out.println(number+".line="+lineNo);<NEW_LINE>// out.println(number+".value="+m.group(2));<NEW_LINE>this.points.put(number, classname + ":" + lineNo);<NEW_LINE>out.println(number + "=" <MASK><NEW_LINE>}<NEW_LINE>lineNo++;<NEW_LINE>}<NEW_LINE>in.close();<NEW_LINE>return rc;<NEW_LINE>}
+ m.group(2));
365,995
void serAdd(T value) {<NEW_LINE>if (cancelled) {<NEW_LINE>Operators.onDiscard(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LinkedArrayNode<T> t = tail;<NEW_LINE>if (t == null) {<NEW_LINE>t = new LinkedArrayNode<>(value);<NEW_LINE>head = t;<NEW_LINE>tail = t;<NEW_LINE>} else {<NEW_LINE>if (t.count == LinkedArrayNode.DEFAULT_CAPACITY) {<NEW_LINE>LinkedArrayNode<T> n = new LinkedArrayNode<>(value);<NEW_LINE>t.next = n;<NEW_LINE>tail = n;<NEW_LINE>} else {<NEW_LINE>t.array[t.count++] = value;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (cancelled) {<NEW_LINE>// this case could mean serDrainLoop "won" and cleared an old view of the nodes first,<NEW_LINE>// then we added "from scratch", so we remain with a single-element node containing `value`<NEW_LINE>// => we can simply discard `value`<NEW_LINE>Operators.onDiscard(value, actual.currentContext());<NEW_LINE>}<NEW_LINE>}
value, actual.currentContext());
969,556
public static void drawRain(float sizeMin, float sizeMax, float xspeed, float yspeed, float density, float intensity, float stroke, Color color) {<NEW_LINE>rand.setSeed(0);<NEW_LINE>float padding = sizeMax * 0.9f;<NEW_LINE>Tmp.r1.setCentered(Core.camera.position.x, Core.camera.position.y, Core.graphics.getWidth() / renderer.minScale(), Core.graphics.getHeight() / renderer.minScale());<NEW_LINE>Tmp.r1.grow(padding);<NEW_LINE>Core.camera.bounds(Tmp.r2);<NEW_LINE>int total = (int) (Tmp.r1.area() / density * intensity);<NEW_LINE>Lines.stroke(stroke);<NEW_LINE>float alpha = Draw.getColor().a;<NEW_LINE>Draw.color(color);<NEW_LINE>for (int i = 0; i < total; i++) {<NEW_LINE>float scl = rand.random(0.5f, 1f);<NEW_LINE>float scl2 = rand.random(0.5f, 1f);<NEW_LINE>float size = rand.random(sizeMin, sizeMax);<NEW_LINE>float x = (rand.random(0f, world.unitWidth()) + Time.time * xspeed * scl2);<NEW_LINE>float y = (rand.random(0f, world.unitHeight()) - Time.time * yspeed * scl);<NEW_LINE>float tint = rand.random(1f) * alpha;<NEW_LINE>x -= Tmp.r1.x;<NEW_LINE>y -= Tmp.r1.y;<NEW_LINE>x = Mathf.mod(<MASK><NEW_LINE>y = Mathf.mod(y, Tmp.r1.height);<NEW_LINE>x += Tmp.r1.x;<NEW_LINE>y += Tmp.r1.y;<NEW_LINE>if (Tmp.r3.setCentered(x, y, size).overlaps(Tmp.r2)) {<NEW_LINE>Draw.alpha(tint);<NEW_LINE>Lines.lineAngle(x, y, Angles.angle(xspeed * scl2, -yspeed * scl), size / 2f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
x, Tmp.r1.width);
1,365,845
private byte[] encrypt(SecretKeySpec skeySpec, String password) {<NEW_LINE>try {<NEW_LINE>Cipher cipher = Cipher.getInstance(ALGORITHM);<NEW_LINE>cipher.init(Cipher.ENCRYPT_MODE, skeySpec);<NEW_LINE>return cipher.doFinal(password.getBytes(ENCODING));<NEW_LINE>} catch (NoSuchAlgorithmException e) {<NEW_LINE>Activator.logError(Messages.PasswordProvider_ERR_NoSuchAlgorithm, e);<NEW_LINE>} catch (NoSuchPaddingException e) {<NEW_LINE>Activator.logError(Messages.PasswordProvider_ERR_NoSuchPadding, e);<NEW_LINE>} catch (InvalidKeyException e) {<NEW_LINE>Activator.logError(Messages.PasswordProvider_ERR_InvalidKey, e);<NEW_LINE>} catch (IllegalBlockSizeException e) {<NEW_LINE>Activator.<MASK><NEW_LINE>} catch (BadPaddingException e) {<NEW_LINE>IdeLog.logWarning(Activator.getDefault(), Messages.PasswordProvider_ERR_BadPadding, e);<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>Activator.logError(Messages.PasswordProvider_ERR_UnsupportedEncoding, e);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
logError(Messages.PasswordProvider_ERR_IllegalBlockSize, e);
1,335,530
private Object decodeLocationNew(Channel channel, SocketAddress remoteAddress, String sentence) {<NEW_LINE>Parser parser = new Parser(PATTERN_NEW, sentence);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>position.set(Position.KEY_ALARM, decodeAlarm<MASK><NEW_LINE>position.setDeviceTime(parser.nextDateTime());<NEW_LINE>Network network = new Network();<NEW_LINE>network.addCellTower(CellTower.from(parser.nextInt(), parser.nextInt(), parser.nextHexInt(), parser.nextHexInt()));<NEW_LINE>position.set(Position.KEY_BATTERY, parser.nextDouble());<NEW_LINE>position.set(Position.KEY_BATTERY_LEVEL, parser.nextInt());<NEW_LINE>position.set(Position.KEY_STATUS, parser.nextHexInt());<NEW_LINE>if (parser.hasNext(5)) {<NEW_LINE>position.setValid(parser.next().equals("A"));<NEW_LINE>position.setFixTime(position.getDeviceTime());<NEW_LINE>position.set(Position.KEY_SATELLITES, parser.nextInt());<NEW_LINE>position.setSpeed(UnitsConverter.knotsFromKph(parser.nextInt()));<NEW_LINE>position.setLatitude(parser.nextDouble());<NEW_LINE>position.setLongitude(parser.nextDouble());<NEW_LINE>} else {<NEW_LINE>String[] points = parser.next().split("\\|");<NEW_LINE>for (String point : points) {<NEW_LINE>String[] wifi = point.split(":");<NEW_LINE>String mac = wifi[0].replaceAll("(..)", "$1:");<NEW_LINE>network.addWifiAccessPoint(WifiAccessPoint.from(mac.substring(0, mac.length() - 1), Integer.parseInt(wifi[1])));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>position.setNetwork(network);<NEW_LINE>return position;<NEW_LINE>}
(parser.nextInt()));
641,190
private OutputStream hasRemoteObjectWithPrefix(org.omg.CORBA_2_3.portable.InputStream in, ResponseHandler reply) throws Throwable {<NEW_LINE>String arg0 = (String) in.read_value(String.class);<NEW_LINE>String arg1 = (String) in.read_value(String.class);<NEW_LINE>String arg2 = (String) in.read_value(String.class);<NEW_LINE>String arg3 = (String) in.read_value(String.class);<NEW_LINE>String arg4 = (String) in.read_value(String.class);<NEW_LINE>boolean result;<NEW_LINE>try {<NEW_LINE>result = target.hasRemoteObjectWithPrefix(arg0, arg1, arg2, arg3, arg4);<NEW_LINE>} catch (NamingException ex) {<NEW_LINE>String id = "IDL:javax/naming/NamingEx:1.0";<NEW_LINE>org.omg.CORBA_2_3.portable.OutputStream out = (org.omg.CORBA_2_3.portable.OutputStream) reply.createExceptionReply();<NEW_LINE>out.write_string(id);<NEW_LINE>out.<MASK><NEW_LINE>return out;<NEW_LINE>}<NEW_LINE>OutputStream out = reply.createReply();<NEW_LINE>out.write_boolean(result);<NEW_LINE>return out;<NEW_LINE>}
write_value(ex, NamingException.class);
1,730,208
private static void appendDiff(StringBuilder buf, Diff diff, Diff prevDiff) {<NEW_LINE>if (diff == null)<NEW_LINE>return;<NEW_LINE>String prefix = keyPrefix(diff.key);<NEW_LINE>if (!prefix.isEmpty()) {<NEW_LINE>if (prevDiff == null || !prefix.equals(keyPrefix(prevDiff.key))) {<NEW_LINE>if (prevDiff != null)<NEW_LINE>buf.append("\n\n");<NEW_LINE>buf.append("#---- ").append<MASK><NEW_LINE>} else if (prevDiff != null) {<NEW_LINE>// append empty line only if necessary<NEW_LINE>if (!((prevDiff.value1 != null && prevDiff.value2 == null && diff.value1 != null && diff.value2 == null) || (prevDiff.value1 == null && prevDiff.value2 != null && diff.value1 == null && diff.value2 != null)))<NEW_LINE>buf.append('\n');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (diff.value1 != null)<NEW_LINE>buf.append("- ").append(diff.key).append(diff.value1).append('\n');<NEW_LINE>if (diff.value2 != null)<NEW_LINE>buf.append("+ ").append(diff.key).append(diff.value2).append('\n');<NEW_LINE>if (prefix.isEmpty())<NEW_LINE>buf.append('\n');<NEW_LINE>}
(prefix).append(" ----\n\n");
1,319,816
public int pfindByFields(Object[] fvals, int[] findex) {<NEW_LINE>ListBase1 mems = code.mems;<NEW_LINE>int len = mems.size();<NEW_LINE>int fcount = findex.length;<NEW_LINE>Object[] vals = new Object[fcount];<NEW_LINE>int low = 1, high = len;<NEW_LINE>while (low <= high) {<NEW_LINE>int mid = (low + high) >> 1;<NEW_LINE>Record r = (<MASK><NEW_LINE>for (int f = 0; f < fcount; ++f) {<NEW_LINE>vals[f] = r.getNormalFieldValue(findex[f]);<NEW_LINE>}<NEW_LINE>int value = Variant.compareArrays(vals, fvals);<NEW_LINE>if (value < 0) {<NEW_LINE>low = mid + 1;<NEW_LINE>} else if (value > 0) {<NEW_LINE>high = mid - 1;<NEW_LINE>} else {<NEW_LINE>// key found<NEW_LINE>return mid;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return -low;<NEW_LINE>}
Record) mems.get(mid);
1,040,277
public Future<Void> doProtocolAssetImport(Agent<?, ?, ?> agent, byte[] fileData, Consumer<AssetTreeNode[]> onDiscovered) throws RuntimeException {<NEW_LINE>Protocol<?> protocol = getProtocolInstance(agent.getId());<NEW_LINE>if (protocol == null) {<NEW_LINE>throw new UnsupportedOperationException("Agent is either invalid, disabled or mis-configured: " + agent);<NEW_LINE>}<NEW_LINE>if (!(protocol instanceof ProtocolAssetImport)) {<NEW_LINE>throw new UnsupportedOperationException("Agent protocol doesn't support asset import");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>synchronized (agentDiscoveryImportFutureMap) {<NEW_LINE>okToContinueWithImportOrDiscovery(agent.getId());<NEW_LINE>Runnable task = () -> {<NEW_LINE>try {<NEW_LINE>if (gatewayService.getLocallyRegisteredGatewayId(agent.getId(), null) != null) {<NEW_LINE>// TODO: Implement gateway instance discovery using client event bus<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ProtocolAssetImport assetImport = (ProtocolAssetImport) protocol;<NEW_LINE>Future<Void> discoveryFuture = assetImport.startAssetImport(fileData, onDiscovered);<NEW_LINE>discoveryFuture.get();<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>LOG.info("Protocol asset import was cancelled");<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.log(Level.WARNING, "Failed to do protocol asset import: Agent = " + agent, e);<NEW_LINE>} finally {<NEW_LINE>LOG.fine("Finished protocol asset import: Agent = " + agent);<NEW_LINE>agentDiscoveryImportFutureMap.remove(agent.getId());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>Future<Void> future = executorService.submit(task, null);<NEW_LINE>agentDiscoveryImportFutureMap.put(agent.getId(), future);<NEW_LINE>return future;<NEW_LINE>}<NEW_LINE>}
LOG.fine("Initiating protocol asset import: Agent = " + agent);
161,708
private Pair<Long, Long> calcOperatorInterval(FilterOperator filterOperator) {<NEW_LINE>if (filterOperator.getSinglePath() != null && !IoTDBConstant.TIME.equals(filterOperator.getSinglePath().getMeasurement())) {<NEW_LINE>throw new SQLParserException(DELETE_ONLY_SUPPORT_TIME_EXP_ERROR_MSG);<NEW_LINE>}<NEW_LINE>long time = Long.parseLong(((BasicFunctionOperator<MASK><NEW_LINE>switch(filterOperator.getFilterType()) {<NEW_LINE>case LESSTHAN:<NEW_LINE>return new Pair<>(Long.MIN_VALUE, time - 1);<NEW_LINE>case LESSTHANOREQUALTO:<NEW_LINE>return new Pair<>(Long.MIN_VALUE, time);<NEW_LINE>case GREATERTHAN:<NEW_LINE>return new Pair<>(time + 1, Long.MAX_VALUE);<NEW_LINE>case GREATERTHANOREQUALTO:<NEW_LINE>return new Pair<>(time, Long.MAX_VALUE);<NEW_LINE>case EQUAL:<NEW_LINE>return new Pair<>(time, time);<NEW_LINE>default:<NEW_LINE>throw new SQLParserException(DELETE_RANGE_ERROR_MSG);<NEW_LINE>}<NEW_LINE>}
) filterOperator).getValue());
1,156,288
public void visitToken(final DetailAST ast) {<NEW_LINE>final boolean containsTag = containsInheritDocTag(ast);<NEW_LINE>if (containsTag && !JavadocTagInfo.INHERIT_DOC.isValidOn(ast)) {<NEW_LINE>log(ast, MSG_KEY_TAG_NOT_VALID_ON, JavadocTagInfo.INHERIT_DOC.getText());<NEW_LINE>} else {<NEW_LINE>boolean check = true;<NEW_LINE>if (javaFiveCompatibility) {<NEW_LINE>final DetailAST defOrNew = ast<MASK><NEW_LINE>if (defOrNew.findFirstToken(TokenTypes.EXTENDS_CLAUSE) != null || defOrNew.findFirstToken(TokenTypes.IMPLEMENTS_CLAUSE) != null || defOrNew.getType() == TokenTypes.LITERAL_NEW) {<NEW_LINE>check = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (check && containsTag && !AnnotationUtil.hasOverrideAnnotation(ast)) {<NEW_LINE>log(ast, MSG_KEY_ANNOTATION_MISSING_OVERRIDE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getParent().getParent();
1,263,778
private String computeSecondRowText(String presenceString, Resources r, final Imps.ProviderSettings.QueryMap settings, boolean showPresence) {<NEW_LINE>String secondRowText;<NEW_LINE>StringBuffer secondRowTextBuffer = new StringBuffer();<NEW_LINE>if (showPresence && presenceString.length() > 0) {<NEW_LINE>secondRowTextBuffer.append(presenceString);<NEW_LINE>secondRowTextBuffer.append(" - ");<NEW_LINE>}<NEW_LINE>if (settings.getServer() != null && settings.getServer().length() > 0) {<NEW_LINE>secondRowTextBuffer.append(settings.getServer());<NEW_LINE>} else if (settings.getDomain() != null & settings.getDomain().length() > 0) {<NEW_LINE>secondRowTextBuffer.append(settings.getDomain());<NEW_LINE>}<NEW_LINE>if (settings.getPort() != 5222 && settings.getPort() != 0)<NEW_LINE>secondRowTextBuffer.append(':').<MASK><NEW_LINE>if (settings.getUseTor()) {<NEW_LINE>secondRowTextBuffer.append(" - ");<NEW_LINE>secondRowTextBuffer.append(r.getString(R.string._via_orbot));<NEW_LINE>}<NEW_LINE>secondRowText = secondRowTextBuffer.toString();<NEW_LINE>return secondRowText;<NEW_LINE>}
append(settings.getPort());
393,520
private void printCurrentLocation() {<NEW_LINE><MASK><NEW_LINE>StackFrame frame;<NEW_LINE>try {<NEW_LINE>frame = threadInfo.getCurrentFrame();<NEW_LINE>} catch (IncompatibleThreadStateException exc) {<NEW_LINE>MessageOutput.println("<location unavailable>");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (frame == null) {<NEW_LINE>MessageOutput.println("No frames on the current call stack");<NEW_LINE>} else {<NEW_LINE>Location loc = frame.location();<NEW_LINE>printBaseLocation(threadInfo.getThread().name(), loc);<NEW_LINE>// Output the current source line, if possible<NEW_LINE>if (loc.lineNumber() != -1) {<NEW_LINE>String line;<NEW_LINE>try {<NEW_LINE>line = Env.sourceLine(loc, loc.lineNumber());<NEW_LINE>} catch (java.io.IOException e) {<NEW_LINE>line = null;<NEW_LINE>}<NEW_LINE>if (line != null) {<NEW_LINE>MessageOutput.println("source line number and line", new Object[] { new Integer(loc.lineNumber()), line });<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>MessageOutput.println();<NEW_LINE>}
ThreadInfo threadInfo = ThreadInfo.getCurrentThreadInfo();
1,303,122
DownloadPerAgeStats downloadsPerAgeStats() {<NEW_LINE>Stopwatch stopwatch = Stopwatch.createStarted();<NEW_LINE>logger.debug("Calculating downloads per age percentages");<NEW_LINE>DownloadPerAgeStats result = new DownloadPerAgeStats();<NEW_LINE>String percentage = "SELECT CASE\n" + " WHEN (SELECT CAST(COUNT(*) AS FLOAT) AS COUNT\n" + " FROM INDEXERNZBDOWNLOAD\n" + " WHERE AGE > %d) > 0\n" + " THEN SELECT CAST(100 AS FLOAT) / (CAST(COUNT(i.*) AS FLOAT)/ x.COUNT)\n" + "FROM INDEXERNZBDOWNLOAD i,\n" + "( SELECT COUNT(*) AS COUNT\n" + "FROM INDEXERNZBDOWNLOAD\n" + "WHERE AGE > %d) AS x\n" + "ELSE 0 END";<NEW_LINE>result.setPercentOlder1000(((Double) entityManager.createNativeQuery(String.format(percentage, 1000, 1000)).getResultList().get(0)).intValue());<NEW_LINE>result.setPercentOlder2000(((Double) entityManager.createNativeQuery(String.format(percentage, 2000, 2000)).getResultList().get(0)).intValue());<NEW_LINE>result.setPercentOlder3000(((Double) entityManager.createNativeQuery(String.format(percentage, 3000, 3000)).getResultList().get(0)).intValue());<NEW_LINE>result.setAverageAge((Integer) entityManager.createNativeQuery("SELECT AVG(AGE) FROM INDEXERNZBDOWNLOAD").getResultList().get(0));<NEW_LINE>logger.debug(LoggingMarkers.PERFORMANCE, "Calculated downloads per age percentages . Took {}ms", stopwatch.elapsed(TimeUnit.MILLISECONDS));<NEW_LINE><MASK><NEW_LINE>return result;<NEW_LINE>}
result.setDownloadsPerAge(downloadsPerAge());
864,093
private void pingDcomConnection(Node node) throws CommandValidationException {<NEW_LINE>try {<NEW_LINE>SshConnector connector = node.getSshConnector();<NEW_LINE>SshAuth auth = connector.getSshAuth();<NEW_LINE>String host = connector.getSshHost();<NEW_LINE>if (!StringUtils.ok(host)) {<NEW_LINE>host = node.getNodeHost();<NEW_LINE>}<NEW_LINE>String username = auth.getUserName();<NEW_LINE>String password = resolvePassword(auth.getPassword());<NEW_LINE>String installdir = node.getInstallDirUnixStyle();<NEW_LINE>String domain = node.getWindowsDomain();<NEW_LINE>if (!StringUtils.ok(domain)) {<NEW_LINE>domain = host;<NEW_LINE>}<NEW_LINE>if (!StringUtils.ok(installdir)) {<NEW_LINE>throw new CommandValidationException(Strings.get("dcom.no.installdir"));<NEW_LINE>}<NEW_LINE>pingDcomConnection(host, domain, username, password, getInstallRoot(installdir));<NEW_LINE>}// very complicated catch copied from pingssh above...<NEW_LINE>catch (CommandValidationException cve) {<NEW_LINE>throw cve;<NEW_LINE>} catch (Exception e) {<NEW_LINE>String m1 = e.getMessage();<NEW_LINE>String m2 = "";<NEW_LINE>Throwable e2 = e.getCause();<NEW_LINE>if (e2 != null) {<NEW_LINE>m2 = e2.getMessage();<NEW_LINE>}<NEW_LINE>String msg = Strings.get("ssh.bad.connect", <MASK><NEW_LINE>logger.warning(StringUtils.cat(": ", msg, m1, m2));<NEW_LINE>throw new CommandValidationException(StringUtils.cat(NL, msg, m1, m2));<NEW_LINE>}<NEW_LINE>}
node.getNodeHost(), "DCOM");
258,994
public Long countWithJobWithPath(String job, String... paths) throws Exception {<NEW_LINE>EntityManager em = this.entityManagerContainer().get(Item.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Long> cq = cb.createQuery(Long.class);<NEW_LINE>Root<Item> root = cq.from(Item.class);<NEW_LINE>Predicate p = cb.equal(root.get(Item_.bundle), job);<NEW_LINE>p = cb.and(p, cb.equal(root.get(Item_.itemCategory), ItemCategory.pp));<NEW_LINE>for (int i = 0; (i < paths.length && i < 8); i++) {<NEW_LINE>p = cb.and(p, cb.equal(root.get(("path" + i)), paths[i]));<NEW_LINE>}<NEW_LINE>cq.select(cb.count(root)).where(p);<NEW_LINE>return em.<MASK><NEW_LINE>}
createQuery(cq).getSingleResult();
1,404,390
public static Path archiveCompiledResources(final Path archiveOut, final Path databindingResourcesRoot, final Path compiledRoot, final List<Path> compiledArtifacts) throws IOException {<NEW_LINE>final Path relativeDatabindingProcessedResources = databindingResourcesRoot.getRoot().relativize(databindingResourcesRoot);<NEW_LINE>try (ZipBuilder builder = ZipBuilder.createFor(archiveOut)) {<NEW_LINE>for (Path artifact : compiledArtifacts) {<NEW_LINE>Path relativeName = artifact;<NEW_LINE>// remove compiled resources prefix<NEW_LINE>if (artifact.startsWith(compiledRoot)) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>// remove databinding prefix<NEW_LINE>if (relativeName.startsWith(relativeDatabindingProcessedResources)) {<NEW_LINE>relativeName = relativeName.subpath(relativeDatabindingProcessedResources.getNameCount(), relativeName.getNameCount());<NEW_LINE>}<NEW_LINE>builder.addEntry(relativeName.toString(), Files.readAllBytes(artifact), ZipEntry.STORED, ResourceCompiler.getCompiledType(relativeName.toString()).asComment());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return archiveOut;<NEW_LINE>}
relativeName = compiledRoot.relativize(relativeName);
9,617
private void writeUnCompressedData(ByteBuf out) {<NEW_LINE>int flushableBytes = buffer.readableBytes();<NEW_LINE>if (flushableBytes == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>checksum.reset();<NEW_LINE>checksum.update(buffer.internalNioBuffer(buffer.readerIndex(), flushableBytes));<NEW_LINE>final int check = (int) checksum.getValue();<NEW_LINE>out.ensureWritable(flushableBytes + HEADER_LENGTH);<NEW_LINE>final int idx = out.writerIndex();<NEW_LINE>out.setBytes(idx + HEADER_LENGTH, buffer, 0, flushableBytes);<NEW_LINE>out.setInt(idx, MAGIC_NUMBER);<NEW_LINE>out.setByte(idx + TOKEN_OFFSET, (byte) BLOCK_TYPE_NON_COMPRESSED);<NEW_LINE>out.setIntLE(idx + COMPRESSED_LENGTH_OFFSET, flushableBytes);<NEW_LINE>out.setIntLE(idx + DECOMPRESSED_LENGTH_OFFSET, flushableBytes);<NEW_LINE>out.<MASK><NEW_LINE>out.writerIndex(idx + HEADER_LENGTH + flushableBytes);<NEW_LINE>buffer.clear();<NEW_LINE>}
setIntLE(idx + CHECKSUM_OFFSET, check);
46,974
public void process(Record<K, V> record) {<NEW_LINE>final Headers headers = record.headers();<NEW_LINE>headersObject.set(headers);<NEW_LINE>final Optional<RecordMetadata> optional <MASK><NEW_LINE>if (optional.isPresent()) {<NEW_LINE>final RecordMetadata recordMetadata = optional.get();<NEW_LINE>topicObject.set(recordMetadata.topic());<NEW_LINE>}<NEW_LINE>final Iterable<Header> eventTypeHeader = headers.headers(kafkaStreamsConsumerProperties.getEventTypeHeaderKey());<NEW_LINE>if (eventTypeHeader != null && eventTypeHeader.iterator().hasNext()) {<NEW_LINE>String eventTypeFromHeader = new String(eventTypeHeader.iterator().next().value());<NEW_LINE>final String[] eventTypesFromBinding = StringUtils.commaDelimitedListToStringArray(kafkaStreamsConsumerProperties.getEventTypes());<NEW_LINE>for (String eventTypeFromBinding : eventTypesFromBinding) {<NEW_LINE>if (eventTypeFromHeader.equals(eventTypeFromBinding)) {<NEW_LINE>matched.set(true);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
= this.context.recordMetadata();
1,177,686
public static ListDistributedProductResponse unmarshall(ListDistributedProductResponse listDistributedProductResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDistributedProductResponse.setRequestId(_ctx.stringValue("ListDistributedProductResponse.RequestId"));<NEW_LINE>listDistributedProductResponse.setSuccess(_ctx.booleanValue("ListDistributedProductResponse.Success"));<NEW_LINE>listDistributedProductResponse.setCode(_ctx.stringValue("ListDistributedProductResponse.Code"));<NEW_LINE>listDistributedProductResponse.setErrorMessage(_ctx.stringValue("ListDistributedProductResponse.ErrorMessage"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotal(_ctx.integerValue("ListDistributedProductResponse.Data.Total"));<NEW_LINE>List<Items> info = new ArrayList<Items>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDistributedProductResponse.Data.Info.Length"); i++) {<NEW_LINE>Items items = new Items();<NEW_LINE>items.setSourceUid(_ctx.stringValue<MASK><NEW_LINE>items.setTargetUid(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].TargetUid"));<NEW_LINE>items.setProductKey(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].ProductKey"));<NEW_LINE>items.setSourceInstanceId(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].SourceInstanceId"));<NEW_LINE>items.setTargetInstanceId(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].TargetInstanceId"));<NEW_LINE>items.setGmtCreate(_ctx.longValue("ListDistributedProductResponse.Data.Info[" + i + "].GmtCreate"));<NEW_LINE>items.setTargetAliyunId(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].TargetAliyunId"));<NEW_LINE>items.setSourceRegion(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].SourceRegion"));<NEW_LINE>items.setTargetRegion(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].TargetRegion"));<NEW_LINE>items.setSourceInstanceName(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].SourceInstanceName"));<NEW_LINE>items.setTargetInstanceName(_ctx.stringValue("ListDistributedProductResponse.Data.Info[" + i + "].TargetInstanceName"));<NEW_LINE>info.add(items);<NEW_LINE>}<NEW_LINE>data.setInfo(info);<NEW_LINE>listDistributedProductResponse.setData(data);<NEW_LINE>return listDistributedProductResponse;<NEW_LINE>}
("ListDistributedProductResponse.Data.Info[" + i + "].SourceUid"));
1,374,041
public void onSetting(PluginSetting setting) {<NEW_LINE>if (setting.getValue().length() > 0)<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_INFO, String.format("'%s', '%s'", setting.getName(), setting.getValue())));<NEW_LINE>else<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_INFO, setting.getName()));<NEW_LINE>if (setting.getName().equalsIgnoreCase("interval")) {<NEW_LINE>try {<NEW_LINE>interval = Integer.parseInt(setting.getValue());<NEW_LINE>if (interval < 500) {<NEW_LINE>interval = 500;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_WARNING, "Invalid interval '" + setting<MASK><NEW_LINE>}<NEW_LINE>} else if (setting.getName().equalsIgnoreCase("timeout")) {<NEW_LINE>timeoutUrl = setting.getValue();<NEW_LINE>} else if (setting.getName().equalsIgnoreCase("start")) {<NEW_LINE>// Stop any running timer<NEW_LINE>stopTimer();<NEW_LINE>// Start a new timer<NEW_LINE>startTimer();<NEW_LINE>} else if (setting.getName().equalsIgnoreCase("stop")) {<NEW_LINE>// Stop any running timer<NEW_LINE>stopTimer();<NEW_LINE>} else<NEW_LINE>Common.logger.add(new LogEntry(LogEntry.PB_LOG_WARNING, "Unknown setting '" + setting.getName() + "'"));<NEW_LINE>}
.getValue() + "'"));
306,029
private String buildDefaultName() {<NEW_LINE>String defaultName = "";<NEW_LINE>//<NEW_LINE>// City<NEW_LINE>defaultName = appendToName(defaultName, address.getCity());<NEW_LINE>//<NEW_LINE>// Address1<NEW_LINE>defaultName = appendToName(defaultName, address.getAddress1());<NEW_LINE>// Company Name<NEW_LINE><MASK><NEW_LINE>if (isValidUniqueName(defaultName)) {<NEW_LINE>return defaultName;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Address2<NEW_LINE>{<NEW_LINE>defaultName = appendToName(defaultName, address.getAddress2());<NEW_LINE>if (isValidUniqueName(defaultName)) {<NEW_LINE>return defaultName;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Address3<NEW_LINE>{<NEW_LINE>defaultName = appendToName(defaultName, address.getAddress3());<NEW_LINE>if (isValidUniqueName(defaultName)) {<NEW_LINE>return defaultName;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Address4<NEW_LINE>{<NEW_LINE>defaultName = appendToName(defaultName, address.getAddress4());<NEW_LINE>if (isValidUniqueName(defaultName)) {<NEW_LINE>return defaultName;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Country<NEW_LINE>if (defaultName.isEmpty()) {<NEW_LINE>final CountryId countryId = CountryId.ofRepoId(address.getC_Country_ID());<NEW_LINE>final String countryName = countriesRepo.getCountryNameById(countryId).getDefaultValue();<NEW_LINE>defaultName = appendToName(defaultName, countryName);<NEW_LINE>}<NEW_LINE>return defaultName;<NEW_LINE>}
defaultName = appendToName(defaultName, companyName);
1,652,805
private static synchronized void initializeVersions(ClasspathMultiReleaseJar jar) {<NEW_LINE>Path filePath = Paths.get(jar.zipFilename);<NEW_LINE>try {<NEW_LINE>if (Files.exists(filePath)) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>URI uri = URI.create("jar:" + filePath.toUri());<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>jar.fs = FileSystems.getFileSystem(uri);<NEW_LINE>} catch (FileSystemNotFoundException e) {<NEW_LINE>// move on<NEW_LINE>}<NEW_LINE>if (jar.fs == null) {<NEW_LINE>jar.fs = FileSystems.newFileSystem(uri<MASK><NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException | FileSystemNotFoundException | ProviderNotFoundException | FileSystemAlreadyExistsException | IOException | SecurityException e) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>Util.log(e, "Failed to initialize versions for: " + jar);<NEW_LINE>jar.supportedVersions = new Path[0];<NEW_LINE>}<NEW_LINE>if (jar.fs == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>jar.rootPath = jar.fs.getPath("/");<NEW_LINE>int earliestJavaVersion = ClassFileConstants.MAJOR_VERSION_9;<NEW_LINE>long latestJDK = CompilerOptions.versionToJdkLevel(jar.compliance);<NEW_LINE>int latestJavaVer = (int) (latestJDK >> 16);<NEW_LINE>List<Path> versions = new ArrayList<>();<NEW_LINE>for (int i = latestJavaVer; i >= earliestJavaVersion; i--) {<NEW_LINE>// $NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$<NEW_LINE>Path path = jar.fs.getPath("/", "META-INF", "versions", "" + (i - 44));<NEW_LINE>if (Files.exists(path)) {<NEW_LINE>versions.add(jar.rootPath.relativize(path));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>jar.supportedVersions = versions.toArray(new Path[versions.size()]);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if ((jar.supportedVersions == null || jar.supportedVersions.length <= 0) && (jar.fs != null && jar.fs.isOpen())) {<NEW_LINE>try {<NEW_LINE>jar.fs.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>// ignore<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, new HashMap<>());
1,039,552
private void resizeTable(int newCapacity) {<NEW_LINE>// newCapacity always a power of two<NEW_LINE>int[] oldTable = table;<NEW_LINE>int oldCapacity = oldTable.length;<NEW_LINE>if (oldCapacity >= MAXIMUM_CAPACITY) {<NEW_LINE>threshold = Integer.MAX_VALUE;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int newThreshold = 1 + (int) (newCapacity * LOAD_FACTOR);<NEW_LINE>int[] newTable = newTable(newCapacity);<NEW_LINE><MASK><NEW_LINE>int mask = newTable.length - 1;<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>long oldEntry = entries[i];<NEW_LINE>int hash = getHash(oldEntry);<NEW_LINE>int tableIndex = hash & mask;<NEW_LINE>int next = newTable[tableIndex];<NEW_LINE>newTable[tableIndex] = i;<NEW_LINE>entries[i] = ((long) hash << 32) | (NEXT_MASK & next);<NEW_LINE>}<NEW_LINE>this.threshold = newThreshold;<NEW_LINE>this.table = newTable;<NEW_LINE>}
long[] entries = this.entries;
1,418,469
// initialize<NEW_LINE>public String modelChange(PO po, int type) throws Exception {<NEW_LINE>boolean IsLiberoEnabled = "Y".equals(Env.getContext(po.getCtx(), "#IsLiberoEnabled"));<NEW_LINE>log.info(po.get_TableName() + " Type: " + type);<NEW_LINE>if (!IsLiberoEnabled)<NEW_LINE>return null;<NEW_LINE>if (po instanceof MDDOrderLine && (TYPE_AFTER_CHANGE == type && po.is_ValueChanged(MDDOrderLine.COLUMNNAME_QtyDelivered))) {<NEW_LINE>MDDOrderLine orderLine = (MDDOrderLine) po;<NEW_LINE>MWMInOutBoundLine outboundLine = <MASK><NEW_LINE>if (outboundLine != null && outboundLine.getWM_InOutBoundLine_ID() > 0 && orderLine.getQtyOrdered().compareTo(orderLine.getQtyDelivered()) >= 0) {<NEW_LINE>BigDecimal pickedQuantity = outboundLine.getPickedQty();<NEW_LINE>BigDecimal totalPickedQuantity = pickedQuantity.add(orderLine.getQtyDelivered());<NEW_LINE>outboundLine.setPickedQty(totalPickedQuantity);<NEW_LINE>outboundLine.saveEx();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
(MWMInOutBoundLine) orderLine.getWM_InOutBoundLine();
1,154,103
private void tryProvisionGroups(List<CorpGroupSnapshot> corpGroups) {<NEW_LINE>log.debug(String.format("Attempting to provision groups with urns %s", corpGroups.stream().map(CorpGroupSnapshot::getUrn).collect(Collectors.toList())));<NEW_LINE>// 1. Check if this user already exists.<NEW_LINE>try {<NEW_LINE>final Set<Urn> urnsToFetch = corpGroups.stream().map(CorpGroupSnapshot::getUrn).collect(Collectors.toSet());<NEW_LINE>final Map<Urn, Entity> existingGroups = _entityClient.batchGet(urnsToFetch, _systemAuthentication);<NEW_LINE>log.debug(String.format("Fetched GMS groups with urns %s", existingGroups.keySet()));<NEW_LINE>final List<CorpGroupSnapshot> groupsToCreate = new ArrayList<>();<NEW_LINE>for (CorpGroupSnapshot extractedGroup : corpGroups) {<NEW_LINE>if (existingGroups.containsKey(extractedGroup.getUrn())) {<NEW_LINE>final Entity groupEntity = existingGroups.get(extractedGroup.getUrn());<NEW_LINE>final CorpGroupSnapshot corpGroupSnapshot = groupEntity.getValue().getCorpGroupSnapshot();<NEW_LINE>// If more than the key aspect exists, then the group already "exists".<NEW_LINE>if (corpGroupSnapshot.getAspects().size() <= 1) {<NEW_LINE>log.debug(String.format("Extracted group that does not yet exist %s. Provisioning...", corpGroupSnapshot.getUrn()));<NEW_LINE>groupsToCreate.add(extractedGroup);<NEW_LINE>}<NEW_LINE>log.debug(String.format("Group %s already exists. Skipping provisioning", corpGroupSnapshot.getUrn()));<NEW_LINE>} else {<NEW_LINE>// Should not occur until we stop returning default Key aspects for unrecognized entities.<NEW_LINE>log.debug(String.format("Extracted group that does not yet exist %s. Provisioning...", extractedGroup.getUrn()));<NEW_LINE>groupsToCreate.add(extractedGroup);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Urn> groupsToCreateUrns = groupsToCreate.stream().map(CorpGroupSnapshot::getUrn).collect(Collectors.toList());<NEW_LINE>log.debug(String<MASK><NEW_LINE>// Now batch create all entities identified to create.<NEW_LINE>_entityClient.batchUpdate(groupsToCreate.stream().map(groupSnapshot -> new Entity().setValue(Snapshot.create(groupSnapshot))).collect(Collectors.toSet()), _systemAuthentication);<NEW_LINE>log.debug(String.format("Successfully provisioned groups with urns %s", groupsToCreateUrns));<NEW_LINE>} catch (RemoteInvocationException e) {<NEW_LINE>// Failing provisioning is something worth throwing about.<NEW_LINE>throw new RuntimeException(String.format("Failed to provision groups with urns %s.", corpGroups.stream().map(CorpGroupSnapshot::getUrn).collect(Collectors.toList())), e);<NEW_LINE>}<NEW_LINE>}
.format("Provisioning groups with urns %s", groupsToCreateUrns));
17,770
public static void write(XmlSerializer serializer, List<Identifier> identifiers, String title, List<Author> authors, TableOfContents tableOfContents) throws IllegalArgumentException, IllegalStateException, IOException {<NEW_LINE>serializer.startDocument(Constants.CHARACTER_ENCODING, false);<NEW_LINE>serializer.setPrefix(EpubWriter.EMPTY_NAMESPACE_PREFIX, NAMESPACE_NCX);<NEW_LINE>serializer.startTag(NAMESPACE_NCX, NCXTags.ncx);<NEW_LINE>// serializer.writeNamespace("ncx", NAMESPACE_NCX);<NEW_LINE>// serializer.attribute("xmlns", NAMESPACE_NCX);<NEW_LINE>serializer.attribute(EpubWriter.EMPTY_NAMESPACE_PREFIX, NCXAttributes.version, NCXAttributeValues.version);<NEW_LINE>serializer.startTag(NAMESPACE_NCX, NCXTags.head);<NEW_LINE>for (Identifier identifier : identifiers) {<NEW_LINE>writeMetaElement(identifier.getScheme(), identifier.getValue(), serializer);<NEW_LINE>}<NEW_LINE>writeMetaElement("generator", Constants.EPUBLIB_GENERATOR_NAME, serializer);<NEW_LINE>writeMetaElement("depth", String.valueOf(tableOfContents.calculateDepth()), serializer);<NEW_LINE>writeMetaElement("totalPageCount", "0", serializer);<NEW_LINE>writeMetaElement("maxPageNumber", "0", serializer);<NEW_LINE>serializer.endTag(NAMESPACE_NCX, "head");<NEW_LINE>serializer.startTag(NAMESPACE_NCX, NCXTags.docTitle);<NEW_LINE>serializer.startTag(NAMESPACE_NCX, NCXTags.text);<NEW_LINE>// write the first title<NEW_LINE>serializer.text(StringUtil.defaultIfNull(title));<NEW_LINE>serializer.endTag(NAMESPACE_NCX, NCXTags.text);<NEW_LINE>serializer.endTag(NAMESPACE_NCX, NCXTags.docTitle);<NEW_LINE>for (Author author : authors) {<NEW_LINE>serializer.startTag(NAMESPACE_NCX, NCXTags.docAuthor);<NEW_LINE>serializer.startTag(NAMESPACE_NCX, NCXTags.text);<NEW_LINE>serializer.text(author.getLastname() + ", " + author.getFirstname());<NEW_LINE>serializer.<MASK><NEW_LINE>serializer.endTag(NAMESPACE_NCX, NCXTags.docAuthor);<NEW_LINE>}<NEW_LINE>serializer.startTag(NAMESPACE_NCX, NCXTags.navMap);<NEW_LINE>writeNavPoints(tableOfContents.getTocReferences(), 1, serializer);<NEW_LINE>serializer.endTag(NAMESPACE_NCX, NCXTags.navMap);<NEW_LINE>serializer.endTag(NAMESPACE_NCX, "ncx");<NEW_LINE>serializer.endDocument();<NEW_LINE>}
endTag(NAMESPACE_NCX, NCXTags.text);
16,760
static void computeTBNNormalized(Vec3f pa, Vec3f pb, Vec3f pc, Vec2f ta, Vec2f tb, Vec2f tc, Vec3f[] norm) {<NEW_LINE>MeshTempState instance = MeshTempState.getInstance();<NEW_LINE>Vec3f n = instance.vec3f1;<NEW_LINE>Vec3f v1 = instance.vec3f2;<NEW_LINE>Vec3f v2 = instance.vec3f3;<NEW_LINE>// compute Normal |(v1-v0)X(v2-v0)|<NEW_LINE>v1.sub(pb, pa);<NEW_LINE>v2.sub(pc, pa);<NEW_LINE>n.cross(v1, v2);<NEW_LINE>norm[0].set(n);<NEW_LINE>// TODO: make sure each triangle area (size) will be considered<NEW_LINE>norm[0].normalize();<NEW_LINE>v1.set(0, tb.x - ta.x, tb.y - ta.y);<NEW_LINE>v2.set(0, tc.x - ta.x, <MASK><NEW_LINE>if (v1.y * v2.z == v1.z * v2.y) {<NEW_LINE>MeshUtil.generateTB(pa, pb, pc, norm);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// compute Tangent and Binomal<NEW_LINE>v1.x = pb.x - pa.x;<NEW_LINE>v2.x = pc.x - pa.x;<NEW_LINE>n.cross(v1, v2);<NEW_LINE>norm[1].x = -n.y / n.x;<NEW_LINE>norm[2].x = -n.z / n.x;<NEW_LINE>v1.x = pb.y - pa.y;<NEW_LINE>v2.x = pc.y - pa.y;<NEW_LINE>n.cross(v1, v2);<NEW_LINE>norm[1].y = -n.y / n.x;<NEW_LINE>norm[2].y = -n.z / n.x;<NEW_LINE>v1.x = pb.z - pa.z;<NEW_LINE>v2.x = pc.z - pa.z;<NEW_LINE>n.cross(v1, v2);<NEW_LINE>norm[1].z = -n.y / n.x;<NEW_LINE>norm[2].z = -n.z / n.x;<NEW_LINE>norm[1].normalize();<NEW_LINE>norm[2].normalize();<NEW_LINE>}
tc.y - ta.y);
791,908
private void autoAssignMappings() {<NEW_LINE>if (getWizard().getSettings().getDataPipes().size() > 1) {<NEW_LINE>try {<NEW_LINE>getWizard().getRunnableContext().run(true, true, (monitor -> getWizard().getSettings().sortDataPipes(monitor)));<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>log.error(e.getTargetException());<NEW_LINE>} catch (InterruptedException ignored) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>loadAndUpdateColumnsModel();<NEW_LINE>for (TreeItem item : mappingViewer.getTree().getItems()) {<NEW_LINE>Object element = item.getData();<NEW_LINE>if (element instanceof DatabaseMappingContainer) {<NEW_LINE>DatabaseMappingContainer container = (DatabaseMappingContainer) element;<NEW_LINE>try {<NEW_LINE>setMappingTarget(container, container.getTargetName(), true);<NEW_LINE>} catch (DBException e) {<NEW_LINE>DBWorkbench.getPlatformUI().showError(DTUIMessages.database_consumer_page_mapping_title_mapping_error, NLS.bind(DTUIMessages.database_consumer_page_mapping_message_error_auto_mapping_source_table, container.getSource()<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>updateMappingsAndButtons();<NEW_LINE>updatePageCompletion();<NEW_LINE>}
.getName()), e);
1,524,154
private void defineConfigurationsForSourceSet(SourceSet sourceSet, ConfigurationContainer configurations) {<NEW_LINE>String implementationConfigurationName = sourceSet.getImplementationConfigurationName();<NEW_LINE>String runtimeOnlyConfigurationName = sourceSet.getRuntimeOnlyConfigurationName();<NEW_LINE>String compileOnlyConfigurationName = sourceSet.getCompileOnlyConfigurationName();<NEW_LINE>String compileClasspathConfigurationName = sourceSet.getCompileClasspathConfigurationName();<NEW_LINE>String annotationProcessorConfigurationName = sourceSet.getAnnotationProcessorConfigurationName();<NEW_LINE>String runtimeClasspathConfigurationName = sourceSet.getRuntimeClasspathConfigurationName();<NEW_LINE>String sourceSetName = sourceSet.toString();<NEW_LINE>Configuration implementationConfiguration = configurations.maybeCreate(implementationConfigurationName);<NEW_LINE>implementationConfiguration.setVisible(false);<NEW_LINE>implementationConfiguration.<MASK><NEW_LINE>implementationConfiguration.setCanBeConsumed(false);<NEW_LINE>implementationConfiguration.setCanBeResolved(false);<NEW_LINE>DeprecatableConfiguration compileOnlyConfiguration = (DeprecatableConfiguration) configurations.maybeCreate(compileOnlyConfigurationName);<NEW_LINE>compileOnlyConfiguration.setVisible(false);<NEW_LINE>compileOnlyConfiguration.setCanBeConsumed(false);<NEW_LINE>compileOnlyConfiguration.setCanBeResolved(false);<NEW_LINE>compileOnlyConfiguration.setDescription("Compile only dependencies for " + sourceSetName + ".");<NEW_LINE>ConfigurationInternal compileClasspathConfiguration = (ConfigurationInternal) configurations.maybeCreate(compileClasspathConfigurationName);<NEW_LINE>compileClasspathConfiguration.setVisible(false);<NEW_LINE>compileClasspathConfiguration.extendsFrom(compileOnlyConfiguration, implementationConfiguration);<NEW_LINE>compileClasspathConfiguration.setDescription("Compile classpath for " + sourceSetName + ".");<NEW_LINE>compileClasspathConfiguration.setCanBeConsumed(false);<NEW_LINE>jvmPluginServices.configureAsCompileClasspath(compileClasspathConfiguration);<NEW_LINE>ConfigurationInternal annotationProcessorConfiguration = (ConfigurationInternal) configurations.maybeCreate(annotationProcessorConfigurationName);<NEW_LINE>annotationProcessorConfiguration.setVisible(false);<NEW_LINE>annotationProcessorConfiguration.setDescription("Annotation processors and their dependencies for " + sourceSetName + ".");<NEW_LINE>annotationProcessorConfiguration.setCanBeConsumed(false);<NEW_LINE>annotationProcessorConfiguration.setCanBeResolved(true);<NEW_LINE>jvmPluginServices.configureAsRuntimeClasspath(annotationProcessorConfiguration);<NEW_LINE>Configuration runtimeOnlyConfiguration = configurations.maybeCreate(runtimeOnlyConfigurationName);<NEW_LINE>runtimeOnlyConfiguration.setVisible(false);<NEW_LINE>runtimeOnlyConfiguration.setCanBeConsumed(false);<NEW_LINE>runtimeOnlyConfiguration.setCanBeResolved(false);<NEW_LINE>runtimeOnlyConfiguration.setDescription("Runtime only dependencies for " + sourceSetName + ".");<NEW_LINE>ConfigurationInternal runtimeClasspathConfiguration = (ConfigurationInternal) configurations.maybeCreate(runtimeClasspathConfigurationName);<NEW_LINE>runtimeClasspathConfiguration.setVisible(false);<NEW_LINE>runtimeClasspathConfiguration.setCanBeConsumed(false);<NEW_LINE>runtimeClasspathConfiguration.setCanBeResolved(true);<NEW_LINE>runtimeClasspathConfiguration.setDescription("Runtime classpath of " + sourceSetName + ".");<NEW_LINE>runtimeClasspathConfiguration.extendsFrom(runtimeOnlyConfiguration, implementationConfiguration);<NEW_LINE>jvmPluginServices.configureAsRuntimeClasspath(runtimeClasspathConfiguration);<NEW_LINE>sourceSet.setCompileClasspath(compileClasspathConfiguration);<NEW_LINE>sourceSet.setRuntimeClasspath(sourceSet.getOutput().plus(runtimeClasspathConfiguration));<NEW_LINE>sourceSet.setAnnotationProcessorPath(annotationProcessorConfiguration);<NEW_LINE>compileClasspathConfiguration.deprecateForDeclaration(implementationConfigurationName, compileOnlyConfigurationName);<NEW_LINE>runtimeClasspathConfiguration.deprecateForDeclaration(implementationConfigurationName, compileOnlyConfigurationName, runtimeOnlyConfigurationName);<NEW_LINE>}
setDescription("Implementation only dependencies for " + sourceSetName + ".");
1,542,648
public static FindProjectStatisticalDataResponse unmarshall(FindProjectStatisticalDataResponse findProjectStatisticalDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>findProjectStatisticalDataResponse.setRequestId(_ctx.stringValue("FindProjectStatisticalDataResponse.RequestId"));<NEW_LINE>findProjectStatisticalDataResponse.setCode(_ctx.integerValue("FindProjectStatisticalDataResponse.Code"));<NEW_LINE>findProjectStatisticalDataResponse.setMessage(_ctx.stringValue("FindProjectStatisticalDataResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setCurrentPage(_ctx.integerValue("FindProjectStatisticalDataResponse.Data.CurrentPage"));<NEW_LINE>data.setPageNumber<MASK><NEW_LINE>data.setTotal(_ctx.longValue("FindProjectStatisticalDataResponse.Data.Total"));<NEW_LINE>List<ServiceStatisticData> monitorStatisticData = new ArrayList<ServiceStatisticData>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("FindProjectStatisticalDataResponse.Data.MonitorStatisticData.Length"); i++) {<NEW_LINE>ServiceStatisticData serviceStatisticData = new ServiceStatisticData();<NEW_LINE>serviceStatisticData.setAvgRt(_ctx.floatValue("FindProjectStatisticalDataResponse.Data.MonitorStatisticData[" + i + "].AvgRt"));<NEW_LINE>serviceStatisticData.setMaxRt(_ctx.floatValue("FindProjectStatisticalDataResponse.Data.MonitorStatisticData[" + i + "].MaxRt"));<NEW_LINE>serviceStatisticData.setMinRt(_ctx.floatValue("FindProjectStatisticalDataResponse.Data.MonitorStatisticData[" + i + "].MinRt"));<NEW_LINE>Total total = new Total();<NEW_LINE>total.setTotal(_ctx.longValue("FindProjectStatisticalDataResponse.Data.MonitorStatisticData[" + i + "].Total.Total"));<NEW_LINE>total.setErrorNum(_ctx.longValue("FindProjectStatisticalDataResponse.Data.MonitorStatisticData[" + i + "].Total.ErrorNum"));<NEW_LINE>serviceStatisticData.setTotal(total);<NEW_LINE>ProjectInfoData projectInfoData = new ProjectInfoData();<NEW_LINE>projectInfoData.setProjectName(_ctx.stringValue("FindProjectStatisticalDataResponse.Data.MonitorStatisticData[" + i + "].ProjectInfoData.ProjectName"));<NEW_LINE>serviceStatisticData.setProjectInfoData(projectInfoData);<NEW_LINE>monitorStatisticData.add(serviceStatisticData);<NEW_LINE>}<NEW_LINE>data.setMonitorStatisticData(monitorStatisticData);<NEW_LINE>findProjectStatisticalDataResponse.setData(data);<NEW_LINE>return findProjectStatisticalDataResponse;<NEW_LINE>}
(_ctx.integerValue("FindProjectStatisticalDataResponse.Data.PageNumber"));
142,026
public void marshall(SearchRequest searchRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (searchRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(searchRequest.getCursor(), CURSOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(searchRequest.getExpr(), EXPR_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(searchRequest.getFilterQuery(), FILTERQUERY_BINDING);<NEW_LINE>protocolMarshaller.marshall(searchRequest.getHighlight(), HIGHLIGHT_BINDING);<NEW_LINE>protocolMarshaller.marshall(searchRequest.getPartial(), PARTIAL_BINDING);<NEW_LINE>protocolMarshaller.marshall(searchRequest.getQuery(), QUERY_BINDING);<NEW_LINE>protocolMarshaller.marshall(searchRequest.getQueryOptions(), QUERYOPTIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(searchRequest.getQueryParser(), QUERYPARSER_BINDING);<NEW_LINE>protocolMarshaller.marshall(searchRequest.getReturn(), RETURN_BINDING);<NEW_LINE>protocolMarshaller.marshall(searchRequest.getSize(), SIZE_BINDING);<NEW_LINE>protocolMarshaller.marshall(searchRequest.getSort(), SORT_BINDING);<NEW_LINE>protocolMarshaller.marshall(searchRequest.getStart(), START_BINDING);<NEW_LINE>protocolMarshaller.marshall(searchRequest.getStats(), STATS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
searchRequest.getFacet(), FACET_BINDING);
1,374,687
public void run() {<NEW_LINE>// NOI18N<NEW_LINE>ProgressHandle progress = getProgressHandle();<NEW_LINE>JComponent bar = ProgressHandleFactory.createProgressComponent(progress);<NEW_LINE>// NOI18N<NEW_LINE>stopButton = new JButton(org.openide.util.NbBundle.getMessage(RepositoryStep.class, "BK2022"));<NEW_LINE>stopButton.addActionListener(new ActionListener() {<NEW_LINE><NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>cancel();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>progressComponent = new JPanel();<NEW_LINE>progressComponent.setLayout(new BorderLayout(6, 0));<NEW_LINE>progressLabel = new JLabel();<NEW_LINE>progressLabel.setText(getDisplayName());<NEW_LINE>progressComponent.<MASK><NEW_LINE>progressComponent.add(bar, BorderLayout.CENTER);<NEW_LINE>progressComponent.add(stopButton, BorderLayout.LINE_END);<NEW_LINE>WizardStepProgressSupport.super.startProgress();<NEW_LINE>panel.setVisible(true);<NEW_LINE>panel.add(progressComponent);<NEW_LINE>panel.revalidate();<NEW_LINE>}
add(progressLabel, BorderLayout.NORTH);
98,517
private static int binarysearch(byte[] rawlist, int start, int end) {<NEW_LINE>int floor = 0;<NEW_LINE>int ceiling = (rawindex.length) / raw_block;<NEW_LINE>int middle, off, len, d;<NEW_LINE>while (floor < ceiling - 1) {<NEW_LINE>middle <MASK><NEW_LINE>off = rawindex[middle * raw_block];<NEW_LINE>len = rawindex[middle * raw_block + raw_block - 1] & 0x1F;<NEW_LINE>d = compare(rawlist, start, end - start, rawdata, off, len);<NEW_LINE>if (d < 0)<NEW_LINE>ceiling = middle;<NEW_LINE>else if (d > 0)<NEW_LINE>floor = middle;<NEW_LINE>else<NEW_LINE>return middle * 12;<NEW_LINE>}<NEW_LINE>int tmp = floor * raw_block;<NEW_LINE>off = rawindex[tmp++];<NEW_LINE>long lengths = (long) rawindex[tmp++] << 32 | rawindex[tmp++] & 0xFFFFFFFFL;<NEW_LINE>floor *= 12;<NEW_LINE>for (int i = 0; i < 12; i++) {<NEW_LINE>len = (int) (lengths >> (i * 5)) & 0x1F;<NEW_LINE>if (compare(rawlist, start, end, rawdata, off, len) == 0)<NEW_LINE>return floor;<NEW_LINE>off += len;<NEW_LINE>floor++;<NEW_LINE>}<NEW_LINE>return -1;<NEW_LINE>}
= (floor + ceiling) / 2;
1,146,784
public static void main(String[] args) throws DataFormatException, IOException {<NEW_LINE>// START SNIPPET: patientUse<NEW_LINE>MyPatient patient = new MyPatient();<NEW_LINE>patient.setPetName(new StringType("Fido"));<NEW_LINE>patient.getImportantDates().<MASK><NEW_LINE>patient.getImportantDates().add(new DateTimeType("2014-01-26T11:11:11"));<NEW_LINE>patient.addName().setFamily("Smith").addGiven("John").addGiven("Quincy").addSuffix("Jr");<NEW_LINE>IParser p = FhirContext.forDstu2().newXmlParser().setPrettyPrint(true);<NEW_LINE>String messageString = p.encodeResourceToString(patient);<NEW_LINE>System.out.println(messageString);<NEW_LINE>// END SNIPPET: patientUse<NEW_LINE>// START SNIPPET: patientParse<NEW_LINE>IParser parser = FhirContext.forDstu2().newXmlParser();<NEW_LINE>MyPatient newPatient = parser.parseResource(MyPatient.class, messageString);<NEW_LINE>// END SNIPPET: patientParse<NEW_LINE>{<NEW_LINE>FhirContext ctx2 = FhirContext.forDstu2();<NEW_LINE>RuntimeResourceDefinition def = ctx2.getResourceDefinition(patient);<NEW_LINE>System.out.println(ctx2.newXmlParser().setPrettyPrint(true).encodeResourceToString(def.toProfile()));<NEW_LINE>}<NEW_LINE>}
add(new DateTimeType("2010-01-02"));
5,083
public GrammarSlotTypeSource unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GrammarSlotTypeSource grammarSlotTypeSource = new GrammarSlotTypeSource();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><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("s3BucketName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>grammarSlotTypeSource.setS3BucketName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("s3ObjectKey", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>grammarSlotTypeSource.setS3ObjectKey(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("kmsKeyArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>grammarSlotTypeSource.setKmsKeyArn(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 grammarSlotTypeSource;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
715,417
public static SourceAttachmentResult updateSourceAttachment(IPackageFragmentRoot root, SourceAttachmentAttribute changedAttributes, IProgressMonitor monitor) {<NEW_LINE>ClasspathEntryWrapper entryWrapper = null;<NEW_LINE>try {<NEW_LINE>entryWrapper = getClasspathEntry(root);<NEW_LINE>} catch (Exception e) {<NEW_LINE>return new SourceAttachmentResult(e.getMessage(), null);<NEW_LINE>}<NEW_LINE>IJavaProject javaProject = root.getJavaProject();<NEW_LINE>IClasspathEntry newClasspathEntry = newClasspathEntry(entryWrapper.original, <MASK><NEW_LINE>if (newClasspathEntry != null && !entryWrapper.original.equals(newClasspathEntry)) {<NEW_LINE>try {<NEW_LINE>if (entryWrapper.containerPath != null) {<NEW_LINE>updateContainerClasspath(javaProject, entryWrapper.containerPath, newClasspathEntry);<NEW_LINE>} else if (entryWrapper.original.getReferencingEntry() != null) {<NEW_LINE>updateReferencedClasspathEntry(javaProject, newClasspathEntry, monitor);<NEW_LINE>} else {<NEW_LINE>updateProjectClasspath(javaProject, newClasspathEntry, monitor);<NEW_LINE>}<NEW_LINE>} catch (CoreException e) {<NEW_LINE>JavaLanguageServerPlugin.logException("Updating the project ClasspathEntry ", e);<NEW_LINE>return new SourceAttachmentResult("Update the ClasspathEntry to the project failure. Reason: \"" + e.getMessage() + "\"", null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new SourceAttachmentResult(null, null);<NEW_LINE>}
changedAttributes, javaProject.getProject());
604,940
public void createChatThread() {<NEW_LINE>ChatClient chatClient = createChatClient();<NEW_LINE>CommunicationUserIdentifier user1 = new CommunicationUserIdentifier("Id 1");<NEW_LINE><MASK><NEW_LINE>// BEGIN: com.azure.communication.chat.chatclient.createchatthread#createchatthreadoptions<NEW_LINE>// Initialize the list of chat thread participants<NEW_LINE>List<ChatParticipant> participants = new ArrayList<ChatParticipant>();<NEW_LINE>ChatParticipant firstParticipant = new ChatParticipant().setCommunicationIdentifier(user1).setDisplayName("Participant Display Name 1");<NEW_LINE>ChatParticipant secondParticipant = new ChatParticipant().setCommunicationIdentifier(user2).setDisplayName("Participant Display Name 2");<NEW_LINE>participants.add(firstParticipant);<NEW_LINE>participants.add(secondParticipant);<NEW_LINE>// Create the chat thread<NEW_LINE>CreateChatThreadOptions createChatThreadOptions = new CreateChatThreadOptions("Topic").setParticipants(participants);<NEW_LINE>CreateChatThreadResult result = chatClient.createChatThread(createChatThreadOptions);<NEW_LINE>// Retrieve the chat thread and the id<NEW_LINE>ChatThreadProperties chatThread = result.getChatThread();<NEW_LINE>String chatThreadId = chatThread.getId();<NEW_LINE>// END: com.azure.communication.chat.chatclient.createchatthread#createchatthreadoptions<NEW_LINE>}
CommunicationUserIdentifier user2 = new CommunicationUserIdentifier("Id 2");
44,243
public static void gen_CharStream(JavaResourceTemplateLocations locations) {<NEW_LINE>try {<NEW_LINE>final File file = new File(Options.getOutputDirectory(), "CharStream.java");<NEW_LINE>final OutputFile outputFile = new OutputFile(file, charStreamVersion, new String[] { Options.USEROPTION__STATIC, Options.USEROPTION__SUPPORT_CLASS_VISIBILITY_PUBLIC });<NEW_LINE>if (!outputFile.needToWrite) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final PrintWriter ostr = outputFile.getPrintWriter();<NEW_LINE>if (cu_to_insertion_point_1.size() != 0 && ((Token) cu_to_insertion_point_1.get(0)).kind == PACKAGE) {<NEW_LINE>for (int i = 1; i < cu_to_insertion_point_1.size(); i++) {<NEW_LINE>if (((Token) cu_to_insertion_point_1.get(i)).kind == SEMICOLON) {<NEW_LINE>cline = ((Token) (cu_to_insertion_point_1.get(0))).beginLine;<NEW_LINE>ccol = ((Token) (cu_to_insertion_point_1.get(0))).beginColumn;<NEW_LINE>for (int j = 0; j <= i; j++) {<NEW_LINE>printToken((Token) (cu_to_insertion_point_1.get(j)), ostr);<NEW_LINE>}<NEW_LINE>ostr.println("");<NEW_LINE>ostr.println("");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>OutputFileGenerator generator = new OutputFileGenerator(locations.getCharStreamTemplateResourceUrl(), Options.getOptions());<NEW_LINE>generator.generate(ostr);<NEW_LINE>ostr.close();<NEW_LINE>} catch (IOException e) {<NEW_LINE>System.<MASK><NEW_LINE>JavaCCErrors.semantic_error("Could not open file CharStream.java for writing.");<NEW_LINE>throw new Error();<NEW_LINE>}<NEW_LINE>}
err.println("Failed to create CharStream " + e);
890,966
public Request<ListThingRegistrationTasksRequest> marshall(ListThingRegistrationTasksRequest listThingRegistrationTasksRequest) {<NEW_LINE>if (listThingRegistrationTasksRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(ListThingRegistrationTasksRequest)");<NEW_LINE>}<NEW_LINE>Request<ListThingRegistrationTasksRequest> request = new DefaultRequest<ListThingRegistrationTasksRequest>(listThingRegistrationTasksRequest, "AWSIot");<NEW_LINE>request.setHttpMethod(HttpMethodName.GET);<NEW_LINE>String uriResourcePath = "/thing-registration-tasks";<NEW_LINE>if (listThingRegistrationTasksRequest.getNextToken() != null) {<NEW_LINE>request.addParameter("nextToken", StringUtils.fromString<MASK><NEW_LINE>}<NEW_LINE>if (listThingRegistrationTasksRequest.getMaxResults() != null) {<NEW_LINE>request.addParameter("maxResults", StringUtils.fromInteger(listThingRegistrationTasksRequest.getMaxResults()));<NEW_LINE>}<NEW_LINE>if (listThingRegistrationTasksRequest.getStatus() != null) {<NEW_LINE>request.addParameter("status", StringUtils.fromString(listThingRegistrationTasksRequest.getStatus()));<NEW_LINE>}<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.0");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
(listThingRegistrationTasksRequest.getNextToken()));
316,344
public DialogAction unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DialogAction dialogAction = new DialogAction();<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("type", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dialogAction.setType(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("slotToElicit", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dialogAction.setSlotToElicit(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("slotElicitationStyle", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dialogAction.setSlotElicitationStyle(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 dialogAction;<NEW_LINE>}
class).unmarshall(context));
545,452
public static final <E extends Collection<? super String>> E addNeighbors(String geohash, int length, E neighbors) {<NEW_LINE>String north = neighbor(geohash<MASK><NEW_LINE>if (north != null) {<NEW_LINE>neighbors.add(neighbor(north, length, -1, 0));<NEW_LINE>neighbors.add(north);<NEW_LINE>neighbors.add(neighbor(north, length, +1, 0));<NEW_LINE>}<NEW_LINE>neighbors.add(neighbor(geohash, length, -1, 0));<NEW_LINE>neighbors.add(neighbor(geohash, length, +1, 0));<NEW_LINE>String south = neighbor(geohash, length, 0, -1);<NEW_LINE>if (south != null) {<NEW_LINE>neighbors.add(neighbor(south, length, -1, 0));<NEW_LINE>neighbors.add(south);<NEW_LINE>neighbors.add(neighbor(south, length, +1, 0));<NEW_LINE>}<NEW_LINE>return neighbors;<NEW_LINE>}
, length, 0, +1);
893,566
private String formatAnnotationAttribute(Annotation.Attribute attribute) {<NEW_LINE>List<String> values = attribute.getValues();<NEW_LINE>if (attribute.getType().equals(Class.class)) {<NEW_LINE>return formatValues(values, (value) -> String.format("%s.class", getUnqualifiedName(value)));<NEW_LINE>}<NEW_LINE>if (Enum.class.isAssignableFrom(attribute.getType())) {<NEW_LINE>return formatValues(values, (value) -> {<NEW_LINE>String enumValue = value.substring(value.lastIndexOf(".") + 1);<NEW_LINE>String enumClass = value.substring(0, value.lastIndexOf("."));<NEW_LINE>return String.format("%s.%s"<MASK><NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (attribute.getType().equals(String.class)) {<NEW_LINE>return formatValues(values, (value) -> String.format("\"%s\"", value));<NEW_LINE>}<NEW_LINE>return formatValues(values, (value) -> String.format("%s", value));<NEW_LINE>}
, getUnqualifiedName(enumClass), enumValue);
436,770
private static ConstructingObjectParser<Hyperparameters, Void> createParser(boolean ignoreUnknownFields) {<NEW_LINE>ConstructingObjectParser<Hyperparameters, Void> parser = new ConstructingObjectParser<>("classification_hyperparameters", ignoreUnknownFields, a -> new Hyperparameters((String) a[0], (double) a[1], (double) a[2], (double) a[3], (double) a[4], (double) a[5], (double) a[6], (double) a[7], (int) a[8], (int) a[9], (int) a[10], (int) a[11], (int) a[12], (double) a[13], (double) a[14]));<NEW_LINE>parser.declareString(constructorArg(), CLASS_ASSIGNMENT_OBJECTIVE);<NEW_LINE>parser.declareDouble(constructorArg(), ALPHA);<NEW_LINE>parser.declareDouble(constructorArg(), DOWNSAMPLE_FACTOR);<NEW_LINE>parser.declareDouble(constructorArg(), ETA);<NEW_LINE>parser.declareDouble(constructorArg(), ETA_GROWTH_RATE_PER_TREE);<NEW_LINE>parser.<MASK><NEW_LINE>parser.declareDouble(constructorArg(), GAMMA);<NEW_LINE>parser.declareDouble(constructorArg(), LAMBDA);<NEW_LINE>parser.declareInt(constructorArg(), MAX_ATTEMPTS_TO_ADD_TREE);<NEW_LINE>parser.declareInt(constructorArg(), MAX_OPTIMIZATION_ROUNDS_PER_HYPERPARAMETER);<NEW_LINE>parser.declareInt(constructorArg(), MAX_TREES);<NEW_LINE>parser.declareInt(constructorArg(), NUM_FOLDS);<NEW_LINE>parser.declareInt(constructorArg(), NUM_SPLITS_PER_FEATURE);<NEW_LINE>parser.declareDouble(constructorArg(), SOFT_TREE_DEPTH_LIMIT);<NEW_LINE>parser.declareDouble(constructorArg(), SOFT_TREE_DEPTH_TOLERANCE);<NEW_LINE>return parser;<NEW_LINE>}
declareDouble(constructorArg(), FEATURE_BAG_FRACTION);
1,734,170
public AbstractFile[] ls() throws IOException {<NEW_LINE>List<LsEntry> files <MASK><NEW_LINE>try (SFTPConnectionHandler connHandler = (SFTPConnectionHandler) ConnectionPool.getConnectionHandler(connHandlerFactory, fileURL, true)) {<NEW_LINE>// Makes sure the connection is started, if not starts it<NEW_LINE>connHandler.checkConnection();<NEW_LINE>files = connHandler.channelSftp.ls(absPath);<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("failed to ls %s", getURL());<NEW_LINE>}<NEW_LINE>int nbFiles = files.size();<NEW_LINE>// File doesn't exist, return an empty file array<NEW_LINE>if (nbFiles == 0)<NEW_LINE>return new AbstractFile[] {};<NEW_LINE>AbstractFile[] children = new AbstractFile[nbFiles];<NEW_LINE>FileURL childURL;<NEW_LINE>String filename;<NEW_LINE>int fileCount = 0;<NEW_LINE>String parentPath = fileURL.getPath();<NEW_LINE>if (!parentPath.endsWith(SEPARATOR))<NEW_LINE>parentPath += SEPARATOR;<NEW_LINE>// Fill AbstractFile array and discard '.' and '..' files<NEW_LINE>for (LsEntry file : files) {<NEW_LINE>filename = file.getFilename();<NEW_LINE>// Discard '.' and '..' files, dunno why these are returned<NEW_LINE>if (filename.equals(".") || filename.equals(".."))<NEW_LINE>continue;<NEW_LINE>childURL = (FileURL) fileURL.clone();<NEW_LINE>childURL.setPath(parentPath + filename);<NEW_LINE>children[fileCount++] = FileFactory.getFile(childURL, this, Collections.singletonMap("attributes", new SFTPFileAttributes(childURL, file.getAttrs())));<NEW_LINE>}<NEW_LINE>// Create new array of the exact file count<NEW_LINE>if (fileCount < nbFiles) {<NEW_LINE>AbstractFile[] newChildren = new AbstractFile[fileCount];<NEW_LINE>System.arraycopy(children, 0, newChildren, 0, fileCount);<NEW_LINE>return newChildren;<NEW_LINE>}<NEW_LINE>return children;<NEW_LINE>}
= new ArrayList<LsEntry>();
81,910
Statement generateJumpStatement(Decompiler.Block sourceBlock, BasicBlock target) {<NEW_LINE>Decompiler.Block <MASK><NEW_LINE>if (targetBlock == null) {<NEW_LINE>int targetIndex = indexer.indexOf(target.getIndex());<NEW_LINE>if (targetIndex >= sourceBlock.end) {<NEW_LINE>throw new IllegalStateException("Could not find block for basic block $" + target.getIndex());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (target.getIndex() == indexer.nodeAt(targetBlock.end)) {<NEW_LINE>BreakStatement breakStmt = new BreakStatement();<NEW_LINE>breakStmt.setLocation(currentLocation);<NEW_LINE>breakStmt.setTarget(targetBlock.statement);<NEW_LINE>return breakStmt;<NEW_LINE>} else {<NEW_LINE>ContinueStatement contStmt = new ContinueStatement();<NEW_LINE>contStmt.setLocation(currentLocation);<NEW_LINE>contStmt.setTarget(targetBlock.statement);<NEW_LINE>return contStmt;<NEW_LINE>}<NEW_LINE>}
targetBlock = getTargetBlock(sourceBlock, target);
1,784,878
NodeView newNodeView(final NodeModel model, final MapView map, final Container parent, final int index) {<NEW_LINE>final NodeView newView = new NodeView(model, map, parent);<NEW_LINE>parent.add(newView, index);<NEW_LINE>newView<MASK><NEW_LINE>if (map.isDisplayable())<NEW_LINE>updateNewView(newView);<NEW_LINE>else<NEW_LINE>newView.addHierarchyListener(new HierarchyListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void hierarchyChanged(HierarchyEvent e) {<NEW_LINE>NodeView view = (NodeView) e.getComponent();<NEW_LINE>if (displayed(view, e)) {<NEW_LINE>view.removeHierarchyListener(this);<NEW_LINE>updateNewView(view);<NEW_LINE>} else if (removed(view, e)) {<NEW_LINE>view.removeHierarchyListener(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>private boolean removed(NodeView view, HierarchyEvent e) {<NEW_LINE>return 0 != (e.getChangeFlags() & HierarchyEvent.PARENT_CHANGED) && view.getParent() == null;<NEW_LINE>}<NEW_LINE><NEW_LINE>private boolean displayed(NodeView view, HierarchyEvent e) {<NEW_LINE>return 0 != (e.getChangeFlags() & HierarchyEvent.DISPLAYABILITY_CHANGED) && view.isDisplayable();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return newView;<NEW_LINE>}
.setMainView(newMainView(newView));
1,131,084
public static ListDingtalkOpenPlatformConfigsResponse unmarshall(ListDingtalkOpenPlatformConfigsResponse listDingtalkOpenPlatformConfigsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDingtalkOpenPlatformConfigsResponse.setRequestId(_ctx.stringValue("ListDingtalkOpenPlatformConfigsResponse.RequestId"));<NEW_LINE>listDingtalkOpenPlatformConfigsResponse.setHttpStatusCode(_ctx.stringValue("ListDingtalkOpenPlatformConfigsResponse.HttpStatusCode"));<NEW_LINE>listDingtalkOpenPlatformConfigsResponse.setSuccess<MASK><NEW_LINE>listDingtalkOpenPlatformConfigsResponse.setCode(_ctx.stringValue("ListDingtalkOpenPlatformConfigsResponse.Code"));<NEW_LINE>listDingtalkOpenPlatformConfigsResponse.setMessage(_ctx.stringValue("ListDingtalkOpenPlatformConfigsResponse.Message"));<NEW_LINE>List<Config> configs = new ArrayList<Config>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDingtalkOpenPlatformConfigsResponse.Configs.Length"); i++) {<NEW_LINE>Config config = new Config();<NEW_LINE>config.setAppId(_ctx.stringValue("ListDingtalkOpenPlatformConfigsResponse.Configs[" + i + "].AppId"));<NEW_LINE>config.setAppSecret(_ctx.stringValue("ListDingtalkOpenPlatformConfigsResponse.Configs[" + i + "].AppSecret"));<NEW_LINE>config.setCreateTime(_ctx.stringValue("ListDingtalkOpenPlatformConfigsResponse.Configs[" + i + "].CreateTime"));<NEW_LINE>config.setUpdateTime(_ctx.stringValue("ListDingtalkOpenPlatformConfigsResponse.Configs[" + i + "].UpdateTime"));<NEW_LINE>configs.add(config);<NEW_LINE>}<NEW_LINE>listDingtalkOpenPlatformConfigsResponse.setConfigs(configs);<NEW_LINE>return listDingtalkOpenPlatformConfigsResponse;<NEW_LINE>}
(_ctx.booleanValue("ListDingtalkOpenPlatformConfigsResponse.Success"));
837,215
public Request<PutIdentityPolicyRequest> marshall(PutIdentityPolicyRequest putIdentityPolicyRequest) {<NEW_LINE>if (putIdentityPolicyRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(PutIdentityPolicyRequest)");<NEW_LINE>}<NEW_LINE>Request<PutIdentityPolicyRequest> request = new DefaultRequest<PutIdentityPolicyRequest>(putIdentityPolicyRequest, "AmazonSimpleEmailService");<NEW_LINE>request.addParameter("Action", "PutIdentityPolicy");<NEW_LINE>request.addParameter("Version", "2010-12-01");<NEW_LINE>String prefix;<NEW_LINE>if (putIdentityPolicyRequest.getIdentity() != null) {<NEW_LINE>prefix = "Identity";<NEW_LINE>String identity = putIdentityPolicyRequest.getIdentity();<NEW_LINE>request.addParameter(prefix, StringUtils.fromString(identity));<NEW_LINE>}<NEW_LINE>if (putIdentityPolicyRequest.getPolicyName() != null) {<NEW_LINE>prefix = "PolicyName";<NEW_LINE><MASK><NEW_LINE>request.addParameter(prefix, StringUtils.fromString(policyName));<NEW_LINE>}<NEW_LINE>if (putIdentityPolicyRequest.getPolicy() != null) {<NEW_LINE>prefix = "Policy";<NEW_LINE>String policy = putIdentityPolicyRequest.getPolicy();<NEW_LINE>request.addParameter(prefix, StringUtils.fromString(policy));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
String policyName = putIdentityPolicyRequest.getPolicyName();
1,350,377
private Set<IFileStore> loadFilteredItems() {<NEW_LINE>String uris = Platform.getPreferencesService().getString(IndexPlugin.PLUGIN_ID, IPreferenceConstants.FILTERED_INDEX_URIS, null, null);<NEW_LINE>if (StringUtil.isEmpty(uris)) {<NEW_LINE>// Don't return emptySet because we expect to be able to modify the return value<NEW_LINE>return new HashSet<IFileStore>(0);<NEW_LINE>}<NEW_LINE>String[] urisSplit = uris.split(ITEM_DELIMITER);<NEW_LINE>Set<IFileStore> filteredItems = new HashSet<IFileStore>(urisSplit.length);<NEW_LINE>for (String uriString : urisSplit) {<NEW_LINE>try {<NEW_LINE>URI uri = new URI(uriString);<NEW_LINE>IFileStore item = EFS.getStore(uri);<NEW_LINE>filteredItems.add(item);<NEW_LINE>} catch (URISyntaxException e) {<NEW_LINE>IdeLog.logError(IndexPlugin.getDefault(), e.getMessage(), e);<NEW_LINE>} catch (CoreException e) {<NEW_LINE>IdeLog.logError(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return filteredItems;<NEW_LINE>}
IndexPlugin.getDefault(), e);
424,454
private void doAddPane(@Nonnull final AbstractProjectViewPane newPane) {<NEW_LINE>ApplicationManager.getApplication().assertIsDispatchThread();<NEW_LINE>int index;<NEW_LINE>final ContentManager manager = getContentManager();<NEW_LINE>for (index = 0; index < manager.getContentCount(); index++) {<NEW_LINE>Content content = manager.getContent(index);<NEW_LINE>String id = content.getUserData(ID_KEY);<NEW_LINE>AbstractProjectViewPane pane = myId2Pane.get(id);<NEW_LINE>int comp = PANE_WEIGHT_COMPARATOR.compare(pane, newPane);<NEW_LINE>LOG.assertTrue(comp != 0, "Project view pane " + newPane + " has the same weight as " + pane + ". Please make sure that you overload getWeight() and return a distinct weight value.");<NEW_LINE>if (comp > 0) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String id = newPane.getId();<NEW_LINE>myId2Pane.put(id, newPane);<NEW_LINE>String[] subIds = newPane.getSubIds();<NEW_LINE>subIds = subIds.length == 0 ? new String[] { null } : subIds;<NEW_LINE>boolean first = true;<NEW_LINE>for (String subId : subIds) {<NEW_LINE>final String title = subId != null ? newPane.getPresentableSubIdName(subId) : newPane.getTitle();<NEW_LINE>final Content content = getContentManager().getFactory().createContent(getComponent(), title, false);<NEW_LINE>content.setTabName(title);<NEW_LINE>content.putUserData(ID_KEY, id);<NEW_LINE>content.putUserData(SUB_ID_KEY, subId);<NEW_LINE>content.putUserData(ToolWindow.SHOW_CONTENT_ICON, Boolean.TRUE);<NEW_LINE>Image icon = subId != null ? newPane.getPresentableSubIdIcon(<MASK><NEW_LINE>content.setIcon(icon);<NEW_LINE>content.setPopupIcon(subId != null ? AllIcons.General.Bullet : newPane.getIcon());<NEW_LINE>content.setPreferredFocusedComponent(() -> {<NEW_LINE>final AbstractProjectViewPane current = getCurrentProjectViewPane();<NEW_LINE>return current != null ? current.getComponentToFocus() : null;<NEW_LINE>});<NEW_LINE>content.setBusyObject(this);<NEW_LINE>if (first && subId != null) {<NEW_LINE>content.setSeparator(newPane.getTitle());<NEW_LINE>}<NEW_LINE>manager.addContent(content, index++);<NEW_LINE>first = false;<NEW_LINE>}<NEW_LINE>}
subId) : newPane.getIcon();
1,793,538
public void onError(java.lang.Exception e) {<NEW_LINE>byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;<NEW_LINE>org.apache.thrift.TSerializable msg;<NEW_LINE>remove_index_result result = new remove_index_result();<NEW_LINE>if (e instanceof rpc_management_exception) {<NEW_LINE>result.ex = (rpc_management_exception) e;<NEW_LINE>result.setExIsSet(true);<NEW_LINE>msg = result;<NEW_LINE>} else if (e instanceof org.apache.thrift.transport.TTransportException) {<NEW_LINE>_LOGGER.error("TTransportException inside handler", e);<NEW_LINE>fb.close();<NEW_LINE>return;<NEW_LINE>} else if (e instanceof org.apache.thrift.TApplicationException) {<NEW_LINE>_LOGGER.error("TApplicationException inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = (org.apache.thrift.TApplicationException) e;<NEW_LINE>} else {<NEW_LINE>_LOGGER.error("Exception inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fcall.sendResponse(fb, msg, msgType, seqid);<NEW_LINE>} catch (java.lang.Exception ex) {<NEW_LINE>_LOGGER.error("Exception writing to internal frame buffer", ex);<NEW_LINE>fb.close();<NEW_LINE>}<NEW_LINE>}
INTERNAL_ERROR, e.getMessage());
1,025,782
public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, MixinInfo mixinInfo) throws Exception {<NEW_LINE>if (this.plugin == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (this.mode == CompatibilityMode.FAILED) {<NEW_LINE>throw new IllegalStateException("Companion plugin failure for [" + this.parent + "] plugin [" + this.<MASK><NEW_LINE>}<NEW_LINE>if (this.mode == CompatibilityMode.COMPATIBLE) {<NEW_LINE>try {<NEW_LINE>this.applyLegacy(this.mdPostApply, targetClassName, targetClass, mixinClassName, mixinInfo);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>this.mode = CompatibilityMode.FAILED;<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>this.plugin.postApply(targetClassName, targetClass, mixinClassName, mixinInfo);<NEW_LINE>} catch (AbstractMethodError ex) {<NEW_LINE>this.mode = CompatibilityMode.COMPATIBLE;<NEW_LINE>this.initReflection();<NEW_LINE>this.postApply(targetClassName, targetClass, mixinClassName, mixinInfo);<NEW_LINE>}<NEW_LINE>}
plugin.getClass() + "]");
856,865
public List<ExecutableElement> findMethods() {<NEW_LINE>Iterable<? extends Element> list = eu.getMembers(te.asType(), new ElementUtilities.ElementAcceptor() {<NEW_LINE><NEW_LINE>public boolean accept(Element e, TypeMirror type) {<NEW_LINE>if (e.getKind() == ElementKind.METHOD) {<NEW_LINE>TypeElement te = (TypeElement) e.getEnclosingElement();<NEW_LINE>if (te.getQualifiedName().contentEquals("java.lang.Object")) {<NEW_LINE>// NOI18N<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// match name<NEW_LINE>if (!e.getSimpleName().toString().equals(factoryMethodName)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>ExecutableElement method = (ExecutableElement) e;<NEW_LINE>// match static<NEW_LINE>boolean isStatic = method.getModifiers().contains(Modifier.STATIC);<NEW_LINE>if (isStatic != staticFlag) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>List<ExecutableElement> retList <MASK><NEW_LINE>for (Element e : list) {<NEW_LINE>ExecutableElement ee = (ExecutableElement) e;<NEW_LINE>retList.add(ee);<NEW_LINE>}<NEW_LINE>return retList;<NEW_LINE>}
= new ArrayList<ExecutableElement>();
993,695
private BigDecimal retrieveAllocatedAmt(final org.compiere.model.I_C_Invoice invoice, final TypedAccessor<BigDecimal> amountAccessor) {<NEW_LINE>BigDecimal sum = BigDecimal.ZERO;<NEW_LINE>for (final I_C_AllocationLine line : retrieveAllocationLines(invoice)) {<NEW_LINE>final I_C_AllocationHdr ah = line.getC_AllocationHdr();<NEW_LINE>final BigDecimal <MASK><NEW_LINE>if (null != ah && ah.getC_Currency_ID() != invoice.getC_Currency_ID()) {<NEW_LINE>final BigDecimal lineAmtConv = // Amt<NEW_LINE>Services.get(ICurrencyBL.class).// Amt<NEW_LINE>convert(// CurFrom_ID<NEW_LINE>lineAmt, // CurTo_ID<NEW_LINE>CurrencyId.ofRepoId(ah.getC_Currency_ID()), // ConvDate<NEW_LINE>CurrencyId.ofRepoId(invoice.getC_Currency_ID()), TimeUtil.asLocalDate(ah.getDateTrx()), CurrencyConversionTypeId.ofRepoIdOrNull(invoice.getC_ConversionType_ID()), ClientId.ofRepoId(line.getAD_Client_ID()), OrgId.ofRepoId(line.getAD_Org_ID()));<NEW_LINE>sum = sum.add(lineAmtConv);<NEW_LINE>} else {<NEW_LINE>sum = sum.add(lineAmt);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sum;<NEW_LINE>}
lineAmt = amountAccessor.getValue(line);
1,495,672
protected boolean doEmpty() throws SQLException {<NEW_LINE>boolean empty = queryDBObjects(ObjectType.SCALAR_FUNCTION, ObjectType.AGGREGATE, ObjectType.CLR_SCALAR_FUNCTION, ObjectType.CLR_TABLE_VALUED_FUNCTION, ObjectType.TABLE_VALUED_FUNCTION, ObjectType.STORED_PROCEDURE, ObjectType.CLR_STORED_PROCEDURE, ObjectType.USER_TABLE, ObjectType.SYNONYM, ObjectType.SEQUENCE_OBJECT, ObjectType.FOREIGN_KEY, ObjectType.VIEW).isEmpty();<NEW_LINE>if (empty) {<NEW_LINE>int objectCount = jdbcTemplate.queryForInt("SELECT count(*) FROM " + "( " + "SELECT t.name FROM sys.types t INNER JOIN sys.schemas s ON t.schema_id = s.schema_id " + "WHERE t.is_user_defined = 1 AND s.name = ? " + <MASK><NEW_LINE>empty = objectCount == 0;<NEW_LINE>}<NEW_LINE>return empty;<NEW_LINE>}
"Union " + "SELECT name FROM sys.assemblies WHERE is_user_defined=1" + ") R", name);
221,993
public void run() {<NEW_LINE>final Set<String> ALL_QUERIES = new HashSet(Arrays.asList(SkuType.INAPP, SkuType.SUBS));<NEW_LINE>List<Purchase> purchases = new ArrayList<>();<NEW_LINE>Set<String> completedQueries = new HashSet();<NEW_LINE>Set<<MASK><NEW_LINE>mBillingClient.queryPurchasesAsync(SkuType.INAPP, new PurchasesResponseListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onQueryPurchasesResponse(@NonNull BillingResult billingResult, @NonNull List<Purchase> inAppPurchases) {<NEW_LINE>if (billingResult.getResponseCode() == BillingResponseCode.OK) {<NEW_LINE>purchases.addAll(inAppPurchases);<NEW_LINE>}<NEW_LINE>billingResults.add(billingResult);<NEW_LINE>completedQueries.add(SkuType.INAPP);<NEW_LINE>if (completedQueries.containsAll(ALL_QUERIES) || !areSubscriptionsSupported()) {<NEW_LINE>onQueryPurchasesFinished(aggregateBillingResults(billingResults), purchases, promise);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (areSubscriptionsSupported()) {<NEW_LINE>mBillingClient.queryPurchasesAsync(SkuType.SUBS, new PurchasesResponseListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onQueryPurchasesResponse(@NonNull BillingResult billingResult, @NonNull List<Purchase> subscriptionPurchases) {<NEW_LINE>if (billingResult.getResponseCode() == BillingResponseCode.OK) {<NEW_LINE>purchases.addAll(subscriptionPurchases);<NEW_LINE>}<NEW_LINE>billingResults.add(billingResult);<NEW_LINE>completedQueries.add(SkuType.SUBS);<NEW_LINE>if (completedQueries.containsAll(ALL_QUERIES)) {<NEW_LINE>onQueryPurchasesFinished(aggregateBillingResults(billingResults), purchases, promise);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
BillingResult> billingResults = new HashSet();
170,624
public Request<ModifyVpcAttributeRequest> marshall(ModifyVpcAttributeRequest modifyVpcAttributeRequest) {<NEW_LINE>if (modifyVpcAttributeRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<ModifyVpcAttributeRequest> request = new DefaultRequest<ModifyVpcAttributeRequest>(modifyVpcAttributeRequest, "AmazonEC2");<NEW_LINE><MASK><NEW_LINE>request.addParameter("Version", "2016-11-15");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (modifyVpcAttributeRequest.getEnableDnsHostnames() != null) {<NEW_LINE>request.addParameter("EnableDnsHostnames.Value", StringUtils.fromBoolean(modifyVpcAttributeRequest.getEnableDnsHostnames()));<NEW_LINE>}<NEW_LINE>if (modifyVpcAttributeRequest.getEnableDnsSupport() != null) {<NEW_LINE>request.addParameter("EnableDnsSupport.Value", StringUtils.fromBoolean(modifyVpcAttributeRequest.getEnableDnsSupport()));<NEW_LINE>}<NEW_LINE>if (modifyVpcAttributeRequest.getVpcId() != null) {<NEW_LINE>request.addParameter("VpcId", StringUtils.fromString(modifyVpcAttributeRequest.getVpcId()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
request.addParameter("Action", "ModifyVpcAttribute");
1,122,491
public TaskRunSortCriteria unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>TaskRunSortCriteria taskRunSortCriteria = new TaskRunSortCriteria();<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("Column", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>taskRunSortCriteria.setColumn(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("SortDirection", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>taskRunSortCriteria.setSortDirection(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 taskRunSortCriteria;<NEW_LINE>}
class).unmarshall(context));
1,268,538
private Collection<IProblem> validateFrames(IParseRootNode ast) {<NEW_LINE>Collection<IProblem> problems = new ArrayList<IProblem>();<NEW_LINE>try {<NEW_LINE>List<HTMLElementNode> framesetNodes = (List<HTMLElementNode>) FRAMESET_TAG.evaluate(ast);<NEW_LINE>if (!CollectionsUtil.isEmpty(framesetNodes)) {<NEW_LINE>// verify only one FRAMESET child of HTML<NEW_LINE>for (int i = 0; i < framesetNodes.size(); i++) {<NEW_LINE>// Skip the first one<NEW_LINE>if (i != 0) {<NEW_LINE>// We want to verify we have at most one frameset child of html<NEW_LINE>HTMLElementNode <MASK><NEW_LINE>IRange range = framesetNode.getNameNode().getNameRange();<NEW_LINE>int offset = range.getStartingOffset();<NEW_LINE>int length = range.getLength();<NEW_LINE>problems.add(createProblem(ProblemType.RepeatedFrameset, Messages.HTMLTidyValidator_RepeatedFrameset, offset, length));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Check NOFRAMES<NEW_LINE>List<HTMLElementNode> noFramesNodes = (List<HTMLElementNode>) NOFRAMES_TAG.evaluate(ast);<NEW_LINE>HTMLElementNode noFrames = null;<NEW_LINE>if (!CollectionsUtil.isEmpty(noFramesNodes)) {<NEW_LINE>noFrames = noFramesNodes.get(0);<NEW_LINE>}<NEW_LINE>if (noFrames == null) {<NEW_LINE>// If there's an html/body, add warning to insert implicit noFrames<NEW_LINE>List<HTMLElementNode> bodyNode = (List<HTMLElementNode>) BODY_TAG.evaluate(ast);<NEW_LINE>if (!CollectionsUtil.isEmpty(bodyNode)) {<NEW_LINE>IRange range = bodyNode.iterator().next().getNameNode().getNameRange();<NEW_LINE>int offset = range.getStartingOffset();<NEW_LINE>problems.add(createProblem(ProblemType.InsertImplicitNoFrames, Messages.HTMLTidyValidator_InsertImplicitNoFrames, offset, range.getLength()));<NEW_LINE>} else {<NEW_LINE>HTMLElementNode invalidContentNode = invalidContentNode(ast);<NEW_LINE>if (invalidContentNode != null) {<NEW_LINE>IRange range = invalidContentNode.getNameNode().getNameRange();<NEW_LINE>problems.add(createProblem(ProblemType.MissingNoFrames, Messages.HTMLTidyValidator_MissingNoFrames, range.getStartingOffset(), range.getLength()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>HTMLElementNode invalidContentNode = invalidContentNode(ast);<NEW_LINE>if (invalidContentNode != null) {<NEW_LINE>IRange range = invalidContentNode.getNameNode().getNameRange();<NEW_LINE>problems.add(createProblem(ProblemType.ElementNotInsideNoFrames, MessageFormat.format(Messages.HTMLTidyValidator_ElementNotInsideNoFrames, invalidContentNode.getElementName()), range.getStartingOffset(), range.getLength()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>IdeLog.logError(HTMLPlugin.getDefault(), e);<NEW_LINE>}<NEW_LINE>return problems;<NEW_LINE>}
framesetNode = framesetNodes.get(i);
1,749,657
public OAuth2AccessToken enhance(OAuth2AccessToken accessToken, OAuth2Authentication authentication) {<NEW_LINE>final Map<String, Object> additionalInfo = new HashMap<>();<NEW_LINE>// UserDO userDo = (UserDO)authentication.getPrincipal();<NEW_LINE>// additionalInfo.put("loginName", userDo.getLoginName());<NEW_LINE>// if (!Constants.ENVIRONMENT_INTERNAL.equals(authProperties.getEnvironment())) {<NEW_LINE>// additionalInfo.put("userId", userDo.getAliyunPk());<NEW_LINE>// } else {<NEW_LINE>// additionalInfo.put("userId", userDo.getBucId());<NEW_LINE>// }<NEW_LINE>// ((DefaultOAuth2AccessToken)accessToken).setAdditionalInformation(additionalInfo);<NEW_LINE>Map details = (Map) authentication.getUserAuthentication().getDetails();<NEW_LINE>additionalInfo.put(AuthJwtConstants.JWT_APP_ID_CLAIM_KEY<MASK><NEW_LINE>additionalInfo.put(AuthJwtConstants.JWT_APP_SECRET_CLAIM_KEY, details.get("client_secret"));<NEW_LINE>((DefaultOAuth2AccessToken) accessToken).setAdditionalInformation(additionalInfo);<NEW_LINE>return accessToken;<NEW_LINE>}
, details.get("client_id"));
1,371,586
private BucketReduceResult mergeConsecutiveBuckets(BucketReduceResult current, int mergeInterval, ReduceContext reduceContext) {<NEW_LINE>List<Bucket> mergedBuckets = new ArrayList<>();<NEW_LINE>List<Bucket> sameKeyedBuckets = new ArrayList<>();<NEW_LINE>double key = current.preparedRounding.round(current.buckets.get(0).key);<NEW_LINE>for (int i = 0; i < current.buckets.size(); i++) {<NEW_LINE>Bucket bucket = current.buckets.get(i);<NEW_LINE>if (i % mergeInterval == 0 && sameKeyedBuckets.isEmpty() == false) {<NEW_LINE>mergedBuckets.add(reduceBucket(sameKeyedBuckets, reduceContext));<NEW_LINE>sameKeyedBuckets.clear();<NEW_LINE>key = current.preparedRounding.round(bucket.key);<NEW_LINE>}<NEW_LINE>sameKeyedBuckets.add(new Bucket(Math.round(key), bucket.docCount<MASK><NEW_LINE>}<NEW_LINE>if (sameKeyedBuckets.isEmpty() == false) {<NEW_LINE>mergedBuckets.add(reduceBucket(sameKeyedBuckets, reduceContext));<NEW_LINE>}<NEW_LINE>return new BucketReduceResult(mergedBuckets, current.roundingIdx, mergeInterval, current.preparedRounding, current.min, current.max);<NEW_LINE>}
, format, bucket.aggregations));
183,517
public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('s0') select symbol, sum(price) from " + "SupportMarketDataBean#length(10) " + "output every 6 events " + "order by volume*sum(price), symbol";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>sendEvent(env, "IBM", 2);<NEW_LINE>sendEvent(env, "KGB", 1);<NEW_LINE>sendEvent(env, "CMU", 3);<NEW_LINE>sendEvent(env, "IBM", 6);<NEW_LINE>env.milestone(0);<NEW_LINE>sendEvent(env, "CAT", 6);<NEW_LINE><MASK><NEW_LINE>String[] fields = "symbol".split(",");<NEW_LINE>env.assertPropsPerRowNewOnly("s0", fields, new Object[][] { { "CAT" }, { "CAT" }, { "CMU" }, { "IBM" }, { "IBM" }, { "KGB" } });<NEW_LINE>env.undeployAll();<NEW_LINE>}
sendEvent(env, "CAT", 5);
200,624
private static void saveWaypointsWithoutTransaction(final Geocache cache) {<NEW_LINE>final String geocode = cache.getGeocode();<NEW_LINE>final List<Waypoint> waypoints = cache.getWaypoints();<NEW_LINE>if (CollectionUtils.isNotEmpty(waypoints)) {<NEW_LINE>final List<String> currentWaypointIds = new ArrayList<>();<NEW_LINE>for (final Waypoint waypoint : waypoints) {<NEW_LINE>final ContentValues values = createWaypointValues(geocode, waypoint);<NEW_LINE>if (waypoint.getId() < 0) {<NEW_LINE>final long rowId = database.<MASK><NEW_LINE>waypoint.setId((int) rowId);<NEW_LINE>} else {<NEW_LINE>database.update(dbTableWaypoints, values, "_id = ?", new String[] { Integer.toString(waypoint.getId(), 10) });<NEW_LINE>}<NEW_LINE>currentWaypointIds.add(Integer.toString(waypoint.getId()));<NEW_LINE>}<NEW_LINE>removeOutdatedWaypointsOfCache(cache, currentWaypointIds);<NEW_LINE>}<NEW_LINE>}
insert(dbTableWaypoints, null, values);
784,985
@JSONP<NEW_LINE>@NoCache<NEW_LINE>@Path("/cache")<NEW_LINE>@Produces({ MediaType.APPLICATION_JSON })<NEW_LINE>public Response flushIndiciesCache(@Context final HttpServletRequest request, @Context final HttpServletResponse response) {<NEW_LINE>final InitDataObject init = auth(request, response);<NEW_LINE>final <MASK><NEW_LINE>final List<String> indices = api.listDotCMSIndices();<NEW_LINE>final Map<String, Integer> data = APILocator.getESIndexAPI().flushCaches(indices);<NEW_LINE>String message = Try.of(() -> LanguageUtil.get(APILocator.getCompanyAPI().getDefaultCompany(), "maintenance.index.cache.flush.message")).get();<NEW_LINE>message = message.replace("{0}", String.valueOf(data.get("successfulShards")));<NEW_LINE>message = message.replace("{1}", String.valueOf(data.get("failedShards")));<NEW_LINE>sendAdminMessage(message, MessageSeverity.INFO, init.getUser(), 5000);<NEW_LINE>return Response.ok(new ResponseEntityView(data)).build();<NEW_LINE>}
ContentletIndexAPI api = APILocator.getContentletIndexAPI();
863,107
public ObjectNode searchService(@RequestParam(defaultValue = StringUtils.EMPTY) String namespaceId, @RequestParam(defaultValue = StringUtils.EMPTY) String expr, @RequestParam(required = false) boolean responsibleOnly) throws NacosException {<NEW_LINE>Map<String, Collection<String>> serviceNameMap = new HashMap<>(16);<NEW_LINE>int totalCount = 0;<NEW_LINE>if (StringUtils.isNotBlank(namespaceId)) {<NEW_LINE>Collection<String> names = getServiceOperator().searchServiceName(namespaceId, expr, responsibleOnly);<NEW_LINE><MASK><NEW_LINE>totalCount = names.size();<NEW_LINE>} else {<NEW_LINE>for (String each : getServiceOperator().listAllNamespace()) {<NEW_LINE>Collection<String> names = getServiceOperator().searchServiceName(each, expr, responsibleOnly);<NEW_LINE>serviceNameMap.put(each, names);<NEW_LINE>totalCount += names.size();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ObjectNode result = JacksonUtils.createEmptyJsonNode();<NEW_LINE>result.replace("services", JacksonUtils.transferToJsonNode(serviceNameMap));<NEW_LINE>result.put("count", totalCount);<NEW_LINE>return result;<NEW_LINE>}
serviceNameMap.put(namespaceId, names);
801,176
public List<FileUploadPartEntity> beginUpload(String path, BeginUploadPathBody body) throws ApiException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// verify the required parameter 'path' is set<NEW_LINE>if (path == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'path' when calling beginUpload");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/file_actions/begin_upload/{path}".replaceAll("\\{" + "path" + "\\}", apiClient.escapeString(path.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams <MASK><NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>GenericType<List<FileUploadPartEntity>> localVarReturnType = new GenericType<List<FileUploadPartEntity>>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
= new ArrayList<Pair>();
88,357
public static CraftingStatus create(IncrementalUpdateHelper changes, CraftingCpuLogic logic) {<NEW_LINE>boolean full = changes.isFullUpdate();<NEW_LINE>ImmutableList.Builder<CraftingStatusEntry<MASK><NEW_LINE>for (var what : changes) {<NEW_LINE>long storedCount = logic.getStored(what);<NEW_LINE>long activeCount = logic.getWaitingFor(what);<NEW_LINE>long pendingCount = logic.getPendingOutputs(what);<NEW_LINE>var sentStack = what;<NEW_LINE>if (!full && changes.getSerial(what) != null) {<NEW_LINE>// The item was already sent to the client, so we can skip the item stack<NEW_LINE>sentStack = null;<NEW_LINE>}<NEW_LINE>var entry = new CraftingStatusEntry(changes.getOrAssignSerial(what), sentStack, storedCount, activeCount, pendingCount);<NEW_LINE>newEntries.add(entry);<NEW_LINE>if (entry.isDeleted()) {<NEW_LINE>changes.removeSerial(what);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long elapsedTime = logic.getElapsedTimeTracker().getElapsedTime();<NEW_LINE>long remainingItems = logic.getElapsedTimeTracker().getRemainingItemCount();<NEW_LINE>long startItems = logic.getElapsedTimeTracker().getStartItemCount();<NEW_LINE>return new CraftingStatus(full, elapsedTime, remainingItems, startItems, newEntries.build());<NEW_LINE>}
> newEntries = ImmutableList.builder();
100,976
public void syncWithInvoice(@NonNull final RemittanceAdviceLineInvoiceDetails remittanceAdviceLineInvoiceDetails) {<NEW_LINE>Amount.assertSameCurrency(remittedAmount, remittanceAdviceLineInvoiceDetails.getInvoiceAmtInREMADVCurrency(<MASK><NEW_LINE>invoiceId = remittanceAdviceLineInvoiceDetails.getInvoiceId();<NEW_LINE>billBPartnerId = remittanceAdviceLineInvoiceDetails.getBillBPartnerId();<NEW_LINE>invoiceAmt = remittanceAdviceLineInvoiceDetails.getInvoiceAmt();<NEW_LINE>invoiceCurrencyId = remittanceAdviceLineInvoiceDetails.getInvoiceCurrencyId();<NEW_LINE>invoiceAmtInREMADVCurrency = remittanceAdviceLineInvoiceDetails.getInvoiceAmtInREMADVCurrency();<NEW_LINE>overUnderAmtInREMADVCurrency = remittanceAdviceLineInvoiceDetails.getOverUnderAmtInREMADVCurrency();<NEW_LINE>isInvoiceResolved = true;<NEW_LINE>isAmountValid = remittanceAdviceLineInvoiceDetails.getOverUnderAmtInREMADVCurrency().signum() == 0;<NEW_LINE>isInvoiceDocTypeValid = remittanceAdviceLineInvoiceDetails.getInvoiceDocType().equals(externalInvoiceDocBaseType);<NEW_LINE>isInvoiceDateValid = remittanceAdviceLineInvoiceDetails.getInvoiceDate().equals(dateInvoiced);<NEW_LINE>}
), remittanceAdviceLineInvoiceDetails.getOverUnderAmtInREMADVCurrency());
1,719,980
private static OFActionSetVlanVid decode_set_vlan_id(String actionToDecode, OFVersion version) {<NEW_LINE>Matcher n = Pattern.compile("((?:0x)?\\d+)").matcher(actionToDecode);<NEW_LINE>if (n.matches()) {<NEW_LINE>if (n.group(1) != null) {<NEW_LINE>try {<NEW_LINE>VlanVid vlanid = VlanVid.ofVlan(ParseUtils.parseHexOrDecShort(n.group(1)));<NEW_LINE>OFActionSetVlanVid a = OFFactories.getFactory(version).actions().buildSetVlanVid().setVlanVid(vlanid).build();<NEW_LINE>log.debug("action {}", a);<NEW_LINE>return a;<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>log.debug("Invalid VLAN in: {} (error ignored)", actionToDecode);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
log.debug("Invalid action: '{}'", actionToDecode);
1,295,488
public static void configure(LineReader reader, Reader r) throws IOException {<NEW_LINE>BufferedReader br;<NEW_LINE>if (r instanceof BufferedReader) {<NEW_LINE>br = (BufferedReader) r;<NEW_LINE>} else {<NEW_LINE>br = new BufferedReader(r);<NEW_LINE>}<NEW_LINE>reader.getVariables().putIfAbsent(LineReader.EDITING_MODE, "emacs");<NEW_LINE>reader.setKeyMap(LineReader.MAIN);<NEW_LINE>if ("vi".equals(reader.getVariable(LineReader.EDITING_MODE))) {<NEW_LINE>reader.getKeyMaps().put(LineReader.MAIN, reader.getKeyMaps().get(LineReader.VIINS));<NEW_LINE>} else if ("emacs".equals(reader.getVariable(LineReader.EDITING_MODE))) {<NEW_LINE>reader.getKeyMaps().put(LineReader.MAIN, reader.getKeyMaps().get(LineReader.EMACS));<NEW_LINE>}<NEW_LINE>new InputRC<MASK><NEW_LINE>if ("vi".equals(reader.getVariable(LineReader.EDITING_MODE))) {<NEW_LINE>reader.getKeyMaps().put(LineReader.MAIN, reader.getKeyMaps().get(LineReader.VIINS));<NEW_LINE>} else if ("emacs".equals(reader.getVariable(LineReader.EDITING_MODE))) {<NEW_LINE>reader.getKeyMaps().put(LineReader.MAIN, reader.getKeyMaps().get(LineReader.EMACS));<NEW_LINE>}<NEW_LINE>}
(reader).parse(br);
742,479
private void htmlDocSelectorSignatures() {<NEW_LINE>if (!signatures.isEmpty()) {<NEW_LINE>// NOI18N<NEW_LINE>documentation.append("<table align='right' style='width:95%; background-color:").append(getColorString(TABLE_BACKGROUNDCOLOR)).append("; padding:12px;margin-right:6px;'><tr><td>");<NEW_LINE>for (Signature signature : signatures) {<NEW_LINE>// NOI18N<NEW_LINE>documentation.append("<table width='100%' style='font-weight: bold;font-size: small; color:").append(getColorString(SIGNATURE_COLOR)).append("'><tr>\n");<NEW_LINE>// NOI18N<NEW_LINE>documentation.append("<td>");<NEW_LINE>// NOI18N<NEW_LINE>documentation.append(String.format("jQuery('%s')", sample));<NEW_LINE>// NOI18N<NEW_LINE>documentation.append("</td><td style='vertical-align: bottom; text-align: right;'>");<NEW_LINE>// NOI18N<NEW_LINE>documentation.append(String.format("version added: <a style='color: %s' href='http://api.jquery.com/category/version/%s/'>%s</a>", getColorString(SIGNATURE_VERSION), signature.fromVersion, signature.fromVersion));<NEW_LINE>// NOI18N<NEW_LINE>documentation.append("</td>");<NEW_LINE>// NOI18N<NEW_LINE>documentation.append("</tr></table>\n");<NEW_LINE>// NOI18N<NEW_LINE>documentation.append("<hr style='width: 100%; height: 2px'/>");<NEW_LINE>for (Argument argument : signature.arguments) {<NEW_LINE>// NOI18N<NEW_LINE>documentation.append("<p style='font-size: small; margin-bottom:6px'>");<NEW_LINE>// NOI18N<NEW_LINE>documentation.append("<b>").append(argument<MASK><NEW_LINE>documentation.append(argument.description);<NEW_LINE>// NOI18N<NEW_LINE>documentation.append("</p>");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>documentation.append("</td></tr></table>");<NEW_LINE>}<NEW_LINE>}
.name).append("</b>: ");
1,629,035
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {<NEW_LINE>_logger.debug("postHandle");<NEW_LINE>final Apps app = (Apps) <MASK><NEW_LINE>String sessionId = (String) WebContext.getAttribute(WebConstants.CURRENT_USER_SESSION_ID);<NEW_LINE>final UserInfo userInfo = WebContext.getUserInfo();<NEW_LINE>_logger.debug("sessionId : " + sessionId + " ,appId : " + app.getId());<NEW_LINE>HistoryLoginApps historyLoginApps = new HistoryLoginApps();<NEW_LINE>historyLoginApps.setAppId(app.getId());<NEW_LINE>historyLoginApps.setSessionId(sessionId);<NEW_LINE>historyLoginApps.setAppName(app.getName());<NEW_LINE>historyLoginApps.setUserId(userInfo.getId());<NEW_LINE>historyLoginApps.setUsername(userInfo.getUsername());<NEW_LINE>historyLoginApps.setDisplayName(userInfo.getDisplayName());<NEW_LINE>historyLoginApps.setInstId(userInfo.getInstId());<NEW_LINE>historyLoginAppsService.insert(historyLoginApps);<NEW_LINE>WebContext.removeAttribute(WebConstants.CURRENT_SINGLESIGNON_URI);<NEW_LINE>WebContext.removeAttribute(WebConstants.SINGLE_SIGN_ON_APP_ID);<NEW_LINE>}
WebContext.getAttribute(WebConstants.AUTHORIZE_SIGN_ON_APP);
1,472,268
public void addBox(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) {<NEW_LINE>minX /= 16.0;<NEW_LINE>minY /= 16.0;<NEW_LINE>minZ /= 16.0;<NEW_LINE>maxX /= 16.0;<NEW_LINE>maxY /= 16.0;<NEW_LINE>maxZ /= 16.0;<NEW_LINE>double aX = minX * this.x.getStepX() + minY * this.y.getStepX() + minZ * this.z.getStepX();<NEW_LINE>double aY = minX * this.x.getStepY() + minY * this.y.getStepY() + minZ <MASK><NEW_LINE>double aZ = minX * this.x.getStepZ() + minY * this.y.getStepZ() + minZ * this.z.getStepZ();<NEW_LINE>double bX = maxX * this.x.getStepX() + maxY * this.y.getStepX() + maxZ * this.z.getStepX();<NEW_LINE>double bY = maxX * this.x.getStepY() + maxY * this.y.getStepY() + maxZ * this.z.getStepY();<NEW_LINE>double bZ = maxX * this.x.getStepZ() + maxY * this.y.getStepZ() + maxZ * this.z.getStepZ();<NEW_LINE>if (this.x.getStepX() + this.y.getStepX() + this.z.getStepX() < 0) {<NEW_LINE>aX += 1;<NEW_LINE>bX += 1;<NEW_LINE>}<NEW_LINE>if (this.x.getStepY() + this.y.getStepY() + this.z.getStepY() < 0) {<NEW_LINE>aY += 1;<NEW_LINE>bY += 1;<NEW_LINE>}<NEW_LINE>if (this.x.getStepZ() + this.y.getStepZ() + this.z.getStepZ() < 0) {<NEW_LINE>aZ += 1;<NEW_LINE>bZ += 1;<NEW_LINE>}<NEW_LINE>minX = Math.min(aX, bX);<NEW_LINE>minY = Math.min(aY, bY);<NEW_LINE>minZ = Math.min(aZ, bZ);<NEW_LINE>maxX = Math.max(aX, bX);<NEW_LINE>maxY = Math.max(aY, bY);<NEW_LINE>maxZ = Math.max(aZ, bZ);<NEW_LINE>this.boxes.add(new AABB(minX, minY, minZ, maxX, maxY, maxZ));<NEW_LINE>}
* this.z.getStepY();
512,215
/*<NEW_LINE>* Reset context so as to resume to regular parse loop<NEW_LINE>*/<NEW_LINE>protected void resetStacks() {<NEW_LINE>this.astPtr = -1;<NEW_LINE>this.astLengthPtr = -1;<NEW_LINE>this.patternPtr = -1;<NEW_LINE>this.patternLengthPtr = -1;<NEW_LINE>this.expressionPtr = -1;<NEW_LINE>this.expressionLengthPtr = -1;<NEW_LINE>this.typeAnnotationLengthPtr = -1;<NEW_LINE>this.typeAnnotationPtr = -1;<NEW_LINE>this.identifierPtr = -1;<NEW_LINE>this.identifierLengthPtr = -1;<NEW_LINE>this.intPtr = -1;<NEW_LINE>// need to reset for further reuse<NEW_LINE>this.nestedMethod[<MASK><NEW_LINE>this.variablesCounter[this.nestedType] = 0;<NEW_LINE>this.switchNestingLevel = 0;<NEW_LINE>this.switchWithTry = false;<NEW_LINE>this.dimensions = 0;<NEW_LINE>this.realBlockStack[this.realBlockPtr = 0] = 0;<NEW_LINE>this.recoveredStaticInitializerStart = 0;<NEW_LINE>this.listLength = 0;<NEW_LINE>this.listTypeParameterLength = 0;<NEW_LINE>this.genericsIdentifiersLengthPtr = -1;<NEW_LINE>this.genericsLengthPtr = -1;<NEW_LINE>this.genericsPtr = -1;<NEW_LINE>this.valueLambdaNestDepth = -1;<NEW_LINE>this.recordNestedMethodLevels = new HashMap<>();<NEW_LINE>this.recordPatternSwitches = new HashMap<>();<NEW_LINE>this.recordNullSwitches = new HashMap<>();<NEW_LINE>}
this.nestedType = 0] = 0;
1,011,427
public DeleteCommentResponse deleteComment(DeleteCommentRequest request) {<NEW_LINE>DeleteCommentResponse response = new DeleteCommentResponse();<NEW_LINE>try {<NEW_LINE>request.requestCheck();<NEW_LINE>String commentId = request.getCommentId();<NEW_LINE>Comment comment = commentMapper.selectByPrimaryKey(commentId);<NEW_LINE>if (comment == null || !comment.getIsDeleted()) {<NEW_LINE>throw new CommentException(CommentRetCode.CURRENT_COMMENT_NOT_EXIST.getCode(), CommentRetCode.CURRENT_COMMENT_NOT_EXIST.getMessage());<NEW_LINE>}<NEW_LINE>comment.setDeletionUserId(request.getUserId());<NEW_LINE>comment.setIsDeleted(true);<NEW_LINE>comment.setDeletionTime(new Date());<NEW_LINE>Example example <MASK><NEW_LINE>Example.Criteria criteria = example.createCriteria();<NEW_LINE>criteria.andEqualTo("commentId", commentId);<NEW_LINE>commentPictureMapper.deleteByExample(example);<NEW_LINE>response.setCode(CommentRetCode.SUCCESS.getCode());<NEW_LINE>response.setMsg(CommentRetCode.SUCCESS.getMessage());<NEW_LINE>} catch (Exception e) {<NEW_LINE>ExceptionProcessorUtil.handleException(response, e);<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>}
= new Example(CommentPicture.class);
409,581
public CreateExplainabilityExportResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateExplainabilityExportResult createExplainabilityExportResult = new CreateExplainabilityExportResult();<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 createExplainabilityExportResult;<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("ExplainabilityExportArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createExplainabilityExportResult.setExplainabilityExportArn(context.getUnmarshaller(String.<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 createExplainabilityExportResult;<NEW_LINE>}
class).unmarshall(context));
394,643
private void detachSingle(SQLiteDatabase db, InstanceAdapter entityAdapter) {<NEW_LINE>TaskAdapter original = entityAdapter.taskAdapter();<NEW_LINE>TaskAdapter cloneAdapter = original.duplicate();<NEW_LINE>// first prepare the original to resemble the same instance but as a new, detached task<NEW_LINE>original.set(TaskAdapter.SYNC_ID, null);<NEW_LINE>original.set(TaskAdapter.SYNC_VERSION, null);<NEW_LINE>original.set(TaskAdapter.SYNC1, null);<NEW_LINE>original.set(TaskAdapter.SYNC2, null);<NEW_LINE>original.set(TaskAdapter.SYNC3, null);<NEW_LINE>original.set(TaskAdapter.SYNC4, null);<NEW_LINE>original.set(TaskAdapter.SYNC5, null);<NEW_LINE>original.set(TaskAdapter.SYNC6, null);<NEW_LINE>original.set(TaskAdapter.SYNC7, null);<NEW_LINE>original.set(TaskAdapter.SYNC8, null);<NEW_LINE>original.set(TaskAdapter._UID, null);<NEW_LINE>original.set(TaskAdapter._DIRTY, true);<NEW_LINE>original.set(TaskAdapter.ORIGINAL_INSTANCE_ID, null);<NEW_LINE>original.set(TaskAdapter.ORIGINAL_INSTANCE_SYNC_ID, null);<NEW_LINE>original.set(TaskAdapter.ORIGINAL_INSTANCE_TIME, null);<NEW_LINE>original.unset(TaskAdapter.COMPLETED);<NEW_LINE>original.commit(db);<NEW_LINE>// wipe INSTANCE_ORIGINAL_TIME from instances entry<NEW_LINE>ContentValues noOriginalTime = new ContentValues();<NEW_LINE>noOriginalTime.putNull(TaskContract.Instances.INSTANCE_ORIGINAL_TIME);<NEW_LINE>db.update(TaskDatabaseHelper.Tables.INSTANCES, noOriginalTime, "_ID = ?", new String[] { String.valueOf(entityAdapter.id()) });<NEW_LINE>// reset the clone to be a deleted instance<NEW_LINE>cloneAdapter.set(TaskAdapter._DELETED, true);<NEW_LINE>// remove joined field values<NEW_LINE>cloneAdapter.unset(TaskAdapter.LIST_ACCESS_LEVEL);<NEW_LINE>cloneAdapter.unset(TaskAdapter.LIST_COLOR);<NEW_LINE>cloneAdapter.unset(TaskAdapter.LIST_NAME);<NEW_LINE>cloneAdapter.unset(TaskAdapter.LIST_OWNER);<NEW_LINE><MASK><NEW_LINE>cloneAdapter.unset(TaskAdapter.ACCOUNT_NAME);<NEW_LINE>cloneAdapter.unset(TaskAdapter.ACCOUNT_TYPE);<NEW_LINE>cloneAdapter.commit(db);<NEW_LINE>// note, we don't have to create an instance for the clone because it's deleted<NEW_LINE>}
cloneAdapter.unset(TaskAdapter.LIST_VISIBLE);
1,144,480
protected String buildString() {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>String ls = System.getProperty("line.separator");<NEW_LINE>sb.append("[DNS Header (").append(length()).append(" bytes)]").append(ls);<NEW_LINE>sb.append(" ID: ").append("0x" + ByteArrays.toHexString(id, "")).append(ls);<NEW_LINE>sb.append(" QR: ").append(response ? "response" : "query").append(ls);<NEW_LINE>sb.append(" OPCODE: ").append(opCode).append(ls);<NEW_LINE>sb.append(" Authoritative Answer: ").append(authoritativeAnswer).append(ls);<NEW_LINE>sb.append(" Truncated: ").append(truncated).append(ls);<NEW_LINE>sb.append(" Recursion Desired: ").append(recursionDesired).append(ls);<NEW_LINE>sb.append(" Recursion Available: ").append(recursionAvailable).append(ls);<NEW_LINE>sb.append(" Reserved Bit: ").append(reserved ? 1 : 0).append(ls);<NEW_LINE>sb.append(" Authentic Data: ").append(authenticData).append(ls);<NEW_LINE>sb.append(" Checking Disabled: ").append(checkingDisabled).append(ls);<NEW_LINE>sb.append(" RCODE: ").append(rCode).append(ls);<NEW_LINE>sb.append(" QDCOUNT: ").append(qdCount).append(ls);<NEW_LINE>sb.append(" ANCOUNT: ").append<MASK><NEW_LINE>sb.append(" NSCOUNT: ").append(nsCount).append(ls);<NEW_LINE>sb.append(" ARCOUNT: ").append(arCount).append(ls);<NEW_LINE>byte[] headerRawData = getRawData();<NEW_LINE>for (DnsQuestion question : questions) {<NEW_LINE>sb.append(" Question:").append(ls).append(question.toString(" ", headerRawData));<NEW_LINE>}<NEW_LINE>for (DnsResourceRecord answer : answers) {<NEW_LINE>sb.append(" Answer:").append(ls).append(answer.toString(" ", headerRawData));<NEW_LINE>}<NEW_LINE>for (DnsResourceRecord authority : authorities) {<NEW_LINE>sb.append(" Authority:").append(ls).append(authority.toString(" ", headerRawData));<NEW_LINE>}<NEW_LINE>for (DnsResourceRecord info : additionalInfo) {<NEW_LINE>sb.append(" Additional:").append(ls).append(info.toString(" ", headerRawData));<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>}
(anCount).append(ls);
1,678,594
public void processNewResult(Object result) {<NEW_LINE>Database db = ResultUtil.findDatabase(result);<NEW_LINE>boolean nonefound = true;<NEW_LINE>List<OutlierResult> oresults = OutlierResult.getOutlierResults(result);<NEW_LINE>List<OrderingResult> orderings = ResultUtil.getOrderingResults(result);<NEW_LINE>// Outlier results are the main use case.<NEW_LINE>for (OutlierResult o : oresults) {<NEW_LINE>final OrderingResult or = o.getOrdering();<NEW_LINE>Relation<O> relation = db.<MASK><NEW_LINE>Metadata.hierarchyOf(or).addChild(computeSimilarityMatrixImage(relation, or.order(relation.getDBIDs()).iter()));<NEW_LINE>// Process them only once.<NEW_LINE>orderings.remove(or);<NEW_LINE>nonefound = false;<NEW_LINE>}<NEW_LINE>// FIXME: find appropriate place to add the derived result<NEW_LINE>// otherwise apply an ordering to the database IDs.<NEW_LINE>for (OrderingResult or : orderings) {<NEW_LINE>Relation<O> relation = db.getRelation(distance.getInputTypeRestriction());<NEW_LINE>DBIDIter iter = or.order(relation.getDBIDs()).iter();<NEW_LINE>Metadata.hierarchyOf(or).addChild(computeSimilarityMatrixImage(relation, iter));<NEW_LINE>nonefound = false;<NEW_LINE>}<NEW_LINE>if (nonefound) {<NEW_LINE>// Use the database ordering.<NEW_LINE>// But be careful to NOT cause a loop, process new databases only.<NEW_LINE>List<Database> iter = ResultUtil.filterResults(result, Database.class);<NEW_LINE>for (Database database : iter) {<NEW_LINE>// Get an arbitrary representation<NEW_LINE>Relation<O> relation = database.getRelation(distance.getInputTypeRestriction());<NEW_LINE>Metadata.hierarchyOf(db).addChild(computeSimilarityMatrixImage(relation, relation.iterDBIDs()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getRelation(distance.getInputTypeRestriction());
873,683
public void paint(Graphics g) {<NEW_LINE>// do this for self-painting editors in Options window - because<NEW_LINE>// we've turned off most property changes, the background won't be<NEW_LINE>// painted correctly otherwise<NEW_LINE>Color c = getBackground();<NEW_LINE>Color old = g.getColor();<NEW_LINE>g.setColor(c);<NEW_LINE>g.fillRect(0, 0, getWidth(), getHeight());<NEW_LINE>g.setColor(old);<NEW_LINE>super.paint(g);<NEW_LINE>if (focused) {<NEW_LINE>// NOI18N<NEW_LINE>Color bdr = UIManager.getColor("Tree.selectionBorderColor");<NEW_LINE>if (bdr == null) {<NEW_LINE>// Button focus color doesn't work on win classic - better to<NEW_LINE>// get the color from a value we know will work - Tim<NEW_LINE>if (getForeground().equals(Color.BLACK)) {<NEW_LINE>// typical<NEW_LINE>bdr <MASK><NEW_LINE>} else {<NEW_LINE>bdr = getForeground().darker();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>g.setColor(bdr);<NEW_LINE>g.drawRect(1, 1, getWidth() - 3, getHeight() - 3);<NEW_LINE>}<NEW_LINE>g.setColor(old);<NEW_LINE>}
= getBackground().darker();
1,802,777
protected void testUnitToPred() {<NEW_LINE>System.out.println("=====test unitToPred ");<NEW_LINE>Set maps = unitToPreds.entrySet();<NEW_LINE>for (Iterator iter = maps.iterator(); iter.hasNext(); ) {<NEW_LINE>Map.Entry entry = (Map.Entry) iter.next();<NEW_LINE>JPegStmt key = <MASK><NEW_LINE>Tag tag = (Tag) key.getTags().get(0);<NEW_LINE>System.out.println("---key= " + tag + " " + key);<NEW_LINE>List list = (List) entry.getValue();<NEW_LINE>// if (list.size()>0){<NEW_LINE>System.out.println("**pred set: size: " + list.size());<NEW_LINE>Iterator it = list.iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>JPegStmt stmt = (JPegStmt) it.next();<NEW_LINE>Tag tag1 = (Tag) stmt.getTags().get(0);<NEW_LINE>System.out.println(tag1 + " " + stmt);<NEW_LINE>}<NEW_LINE>// }<NEW_LINE>}<NEW_LINE>System.out.println("=========unitToPred--ends--------");<NEW_LINE>}
(JPegStmt) entry.getKey();
1,825,474
private void addCheckDependsOn(SuiteSpec suite) {<NEW_LINE>final ExpressionValue testSuites = expressionValue(builder.propertyExpression(builder.<MASK><NEW_LINE>if (builder.dsl == BuildInitDsl.GROOVY) {<NEW_LINE>final Expression suiteDependedUpon = builder.propertyExpression(testSuites, suite.getName());<NEW_LINE>builder.taskMethodInvocation("Include " + suite.getName() + " as part of the check lifecycle", "check", Task.class.getSimpleName(), "dependsOn", suiteDependedUpon);<NEW_LINE>} else {<NEW_LINE>final ExpressionValue namedMethod = new MethodInvocationExpression(testSuites, "named", Collections.singletonList(new StringValue(suite.getName())));<NEW_LINE>builder.taskMethodInvocation("Include " + suite.getName() + " as part of the check lifecycle", "check", Task.class.getSimpleName(), "dependsOn", namedMethod);<NEW_LINE>}<NEW_LINE>}
propertyExpression("testing"), "suites"));
551,028
private static int executeBackup(ScheduledAction scheduledAction, SQLiteDatabase db) {<NEW_LINE>if (!shouldExecuteScheduledBackup(scheduledAction))<NEW_LINE>return 0;<NEW_LINE>ExportParams params = ExportParams.<MASK><NEW_LINE>// HACK: the tag isn't updated with the new date, so set the correct by hand<NEW_LINE>params.setExportStartTime(new Timestamp(scheduledAction.getLastRunTime()));<NEW_LINE>Boolean result = false;<NEW_LINE>try {<NEW_LINE>// wait for async task to finish before we proceed (we are holding a wake lock)<NEW_LINE>result = new ExportAsyncTask(GnuCashApplication.getAppContext(), db).execute(params).get();<NEW_LINE>} catch (InterruptedException | ExecutionException e) {<NEW_LINE>Crashlytics.logException(e);<NEW_LINE>Log.e(LOG_TAG, e.getMessage());<NEW_LINE>}<NEW_LINE>if (!result) {<NEW_LINE>Log.i(LOG_TAG, "Backup/export did not occur. There might have been no" + " new transactions to export or it might have crashed");<NEW_LINE>// We don't know if something failed or there weren't transactions to export,<NEW_LINE>// so fall on the safe side and return as if something had failed.<NEW_LINE>// FIXME: Change ExportAsyncTask to distinguish between the two cases<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>return 1;<NEW_LINE>}
parseCsv(scheduledAction.getTag());
1,665,698
public void describeModel(DescribeModelRequest request, StreamObserver<ManagementResponse> responseObserver) {<NEW_LINE>String requestId = UUID.randomUUID().toString();<NEW_LINE>RequestInput input = new RequestInput(requestId);<NEW_LINE>String modelName = request.getModelName();<NEW_LINE>String modelVersion = request.getModelVersion();<NEW_LINE>boolean customized = request.getCustomized();<NEW_LINE>if ("all".equals(modelVersion) || !customized) {<NEW_LINE>String resp;<NEW_LINE>try {<NEW_LINE>resp = JsonUtils.GSON_PRETTY.toJson(ApiUtils.getModelDescription(modelName, modelVersion));<NEW_LINE>sendResponse(responseObserver, resp);<NEW_LINE>} catch (ModelNotFoundException | ModelVersionNotFoundException e) {<NEW_LINE>sendErrorResponse(responseObserver, Status.NOT_FOUND, e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>Job job = new GRPCJob(responseObserver, modelName, modelVersion, input);<NEW_LINE>try {<NEW_LINE>if (!ModelManager.getInstance().addJob(job)) {<NEW_LINE>String responseMessage = ApiUtils.getDescribeErrorResponseMessage(modelName);<NEW_LINE>InternalServerException e = new InternalServerException(responseMessage);<NEW_LINE>sendException(responseObserver, e, "InternalServerException.()");<NEW_LINE>}<NEW_LINE>} catch (ModelNotFoundException | ModelVersionNotFoundException e) {<NEW_LINE>sendErrorResponse(responseObserver, Status.INTERNAL, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
input.updateHeaders("describe", "True");
182,576
protected void loadValidators(Table component, Table.Column column) {<NEW_LINE>List<Element> validatorElements = column.getXmlDescriptor().elements("validator");<NEW_LINE>if (!validatorElements.isEmpty()) {<NEW_LINE>for (Element validatorElement : validatorElements) {<NEW_LINE>Consumer<?> validator = loadValidator(validatorElement);<NEW_LINE>if (validator != null) {<NEW_LINE>component.addValidator(column, validator);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (column.isEditable()) {<NEW_LINE>if (!(column.getId() instanceof MetaPropertyPath)) {<NEW_LINE>throw new GuiDevelopmentException(String.format("Column '%s' has editable=true, but there is no " + "property of an entity with this id", column<MASK><NEW_LINE>}<NEW_LINE>MetaPropertyPath propertyPath = (MetaPropertyPath) column.getId();<NEW_LINE>Consumer<?> validator = getDefaultValidator(propertyPath.getMetaProperty());<NEW_LINE>if (validator != null) {<NEW_LINE>component.addValidator(column, validator);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getId()), context);
1,818,904
public Optional<Design> read(InputStream resourceAsStream) {<NEW_LINE>Parser parser = ParserBuilder.createDefaultParser();<NEW_LINE>try {<NEW_LINE>parser.parse(resourceAsStream, DXFParser.DEFAULT_ENCODING);<NEW_LINE>} catch (ParseException e) {<NEW_LINE>throw new RuntimeException("Could not parse file", e);<NEW_LINE>}<NEW_LINE>DXFDocument doc = parser.getDocument();<NEW_LINE>Group group = new Group();<NEW_LINE>Iterator layerIterator = doc.getDXFLayerIterator();<NEW_LINE>while (layerIterator.hasNext()) {<NEW_LINE>DXFLayer layer = (DXFLayer) layerIterator.next();<NEW_LINE>Group layerGroup = new Group();<NEW_LINE>layerGroup.setName(layer.getName());<NEW_LINE>Group circlesGroup = parseCircles(layer);<NEW_LINE>circlesGroup.setName("Circles");<NEW_LINE>if (!circlesGroup.getChildren().isEmpty()) {<NEW_LINE>layerGroup.addChild(circlesGroup);<NEW_LINE>}<NEW_LINE>Group linesGroup = new Group();<NEW_LINE>linesGroup.setName("Lines");<NEW_LINE>parseLines(layer, linesGroup);<NEW_LINE>if (!linesGroup.getChildren().isEmpty()) {<NEW_LINE>layerGroup.addChild(linesGroup);<NEW_LINE>}<NEW_LINE>if (!layerGroup.getChildren().isEmpty()) {<NEW_LINE>group.addChild(layerGroup);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>group.setPosition(new Point2D<MASK><NEW_LINE>Design design = new Design();<NEW_LINE>List<Entity> entities = new ArrayList<>();<NEW_LINE>if (!group.getChildren().isEmpty()) {<NEW_LINE>entities.add(group);<NEW_LINE>}<NEW_LINE>design.setEntities(entities);<NEW_LINE>return Optional.of(design);<NEW_LINE>}
.Double(0, 0));
715,776
public void createPartControl(Composite parent) {<NEW_LINE>GridLayout layout <MASK><NEW_LINE>layout.marginHeight = 5;<NEW_LINE>layout.marginWidth = 5;<NEW_LINE>parent.setLayout(layout);<NEW_LINE>parent.setBackground(ColorUtil.getInstance().getColor(SWT.COLOR_WHITE));<NEW_LINE>parent.setBackgroundMode(SWT.INHERIT_FORCE);<NEW_LINE>window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();<NEW_LINE>canvas = new FigureCanvas(parent);<NEW_LINE>canvas.setLayoutData(new GridData(GridData.FILL_BOTH));<NEW_LINE>canvas.setScrollBarVisibility(FigureCanvas.NEVER);<NEW_LINE>canvas.addControlListener(new ControlListener() {<NEW_LINE><NEW_LINE>boolean lock = false;<NEW_LINE><NEW_LINE>public void controlResized(ControlEvent e) {<NEW_LINE>org.eclipse.swt.graphics.Rectangle r = canvas.getClientArea();<NEW_LINE>if (!lock) {<NEW_LINE>lock = true;<NEW_LINE>if (ChartUtil.isShowDescriptionAllowSize(r.height)) {<NEW_LINE>CounterLoadDateView.this.setContentDescription(desc);<NEW_LINE>} else {<NEW_LINE>CounterLoadDateView.this.setContentDescription("");<NEW_LINE>}<NEW_LINE>r = canvas.getClientArea();<NEW_LINE>lock = false;<NEW_LINE>}<NEW_LINE>xyGraph.setSize(r.width, r.height);<NEW_LINE>}<NEW_LINE><NEW_LINE>public void controlMoved(ControlEvent e) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>xyGraph = new XYGraph();<NEW_LINE>xyGraph.setShowLegend(false);<NEW_LINE>xyGraph.setShowTitle(false);<NEW_LINE>canvas.setContents(xyGraph);<NEW_LINE>xyGraph.primaryXAxis.setDateEnabled(true);<NEW_LINE>xyGraph.primaryXAxis.setShowMajorGrid(true);<NEW_LINE>xyGraph.primaryYAxis.setAutoScale(true);<NEW_LINE>xyGraph.primaryYAxis.setShowMajorGrid(true);<NEW_LINE>provider = new CircularBufferDataProvider(true);<NEW_LINE>provider.setBufferSize(288);<NEW_LINE>provider.setCurrentXDataArray(new double[] {});<NEW_LINE>provider.setCurrentYDataArray(new double[] {});<NEW_LINE>// create the trace<NEW_LINE>trace = new Trace("TOTAL", xyGraph.primaryXAxis, xyGraph.primaryYAxis, provider);<NEW_LINE>// set trace property<NEW_LINE>trace.setPointStyle(PointStyle.NONE);<NEW_LINE>trace.getXAxis().setFormatPattern("HH:mm");<NEW_LINE>trace.getYAxis().setFormatPattern("#,##0");<NEW_LINE>trace.setLineWidth(PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH));<NEW_LINE>trace.setTraceType(TraceType.AREA);<NEW_LINE>trace.setTraceColor(ColorUtil.getInstance().getColor(SWT.COLOR_DARK_CYAN));<NEW_LINE>xyGraph.primaryXAxis.setTitle("");<NEW_LINE>xyGraph.primaryYAxis.setTitle("");<NEW_LINE>xyGraph.addTrace(trace);<NEW_LINE>}
= new GridLayout(1, true);
448,400
public static List<JSONDocumentFilterDescriptor> ofCollection(@Nullable final Collection<DocumentFilterDescriptor> filters, @NonNull final JSONDocumentLayoutOptions options) {<NEW_LINE>if (filters == null || filters.isEmpty()) {<NEW_LINE>return ImmutableList.of();<NEW_LINE>}<NEW_LINE>final ImmutableList<DocumentFilterDescriptor> filtersOrdered = filters.stream().sorted(Comparator.comparing(DocumentFilterDescriptor::getSortNo)).collect(ImmutableList.toImmutableList());<NEW_LINE>final ImmutableList<JSONDocumentFilterDescriptor> defaultFiltersList = filtersOrdered.stream().filter(filter -> !filter.isFrequentUsed()).map(filter -> new JSONDocumentFilterDescriptor(filter, options)).collect(ImmutableList.toImmutableList());<NEW_LINE>JSONDocumentFilterDescriptor defaultFiltersGroup = !defaultFiltersList.isEmpty() ? new JSONDocumentFilterDescriptor("Filter", defaultFiltersList) : null;<NEW_LINE>final ImmutableList.Builder<JSONDocumentFilterDescriptor> result = ImmutableList.builder();<NEW_LINE>for (final DocumentFilterDescriptor filter : filtersOrdered) {<NEW_LINE>if (filter.isFrequentUsed()) {<NEW_LINE>result.add(<MASK><NEW_LINE>} else if (defaultFiltersGroup != null) {<NEW_LINE>result.add(defaultFiltersGroup);<NEW_LINE>defaultFiltersGroup = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (defaultFiltersGroup != null) {<NEW_LINE>result.add(defaultFiltersGroup);<NEW_LINE>defaultFiltersGroup = null;<NEW_LINE>}<NEW_LINE>return result.build();<NEW_LINE>}
new JSONDocumentFilterDescriptor(filter, options));
1,498,220
final StartRestoreJobResult executeStartRestoreJob(StartRestoreJobRequest startRestoreJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(startRestoreJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StartRestoreJobRequest> request = null;<NEW_LINE>Response<StartRestoreJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StartRestoreJobRequestProtocolMarshaller(protocolFactory).marshall<MASK><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, "Backup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartRestoreJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StartRestoreJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartRestoreJobResultJsonUnmarshaller());<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>}
(super.beforeMarshalling(startRestoreJobRequest));
1,323,313
public boolean testConnection(ConnectionContext context, final IConnectionRunnable connectRunnable) {<NEW_LINE>// WORKAROUND: getting contents after the control is disabled will return empty string if not called here<NEW_LINE>hostText.getText();<NEW_LINE>loginCombo.getText();<NEW_LINE>passwordText.getText();<NEW_LINE>remotePathText.getText();<NEW_LINE>lockUI(true);<NEW_LINE>((GridData) progressMonitorPart.getLayoutData()).exclude = false;<NEW_LINE>listener.layoutShell();<NEW_LINE>try {<NEW_LINE>final IBaseRemoteConnectionPoint connectionPoint = isNew ? ftpConnectionPoint : (IBaseRemoteConnectionPoint) CoreIOPlugin.getConnectionPointManager().cloneConnectionPoint(ftpConnectionPoint);<NEW_LINE>savePropertiesTo(connectionPoint);<NEW_LINE>if (context == null) {<NEW_LINE>// $codepro.audit.disable questionableAssignment<NEW_LINE>context = new ConnectionContext();<NEW_LINE>context.setBoolean(ConnectionContext.QUICK_CONNECT, true);<NEW_LINE>}<NEW_LINE>context.setBoolean(ConnectionContext.NO_PASSWORD_PROMPT, true);<NEW_LINE>CoreIOPlugin.setConnectionContext(connectionPoint, context);<NEW_LINE>ModalContext.run(new IRunnableWithProgress() {<NEW_LINE><NEW_LINE>public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>if (connectRunnable != null) {<NEW_LINE>connectRunnable.beforeConnect(connectionPoint);<NEW_LINE>}<NEW_LINE>connectionPoint.connect(monitor);<NEW_LINE>if (connectRunnable != null) {<NEW_LINE>connectRunnable.afterConnect(connectionPoint, monitor);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>connectionPoint.disconnect(monitor);<NEW_LINE>} catch (CoreException e) {<NEW_LINE>IdeLog.logWarning(FTPUIPlugin.getDefault(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (CoreException e) {<NEW_LINE>throw new InvocationTargetException(e);<NEW_LINE>} finally {<NEW_LINE>CoreIOPlugin.clearConnectionContext(connectionPoint);<NEW_LINE>monitor.done();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, true, progressMonitorPart, getShell().getDisplay());<NEW_LINE>return connectionTested = true;<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>e.getCause();<NEW_LINE>} catch (InvocationTargetException e) {<NEW_LINE>showErrorDialog(e.getTargetException());<NEW_LINE>} catch (CoreException e) {<NEW_LINE>showErrorDialog(e);<NEW_LINE>} finally {<NEW_LINE>if (!progressMonitorPart.isDisposed()) {<NEW_LINE>((GridData) progressMonitorPart.<MASK><NEW_LINE>listener.layoutShell();<NEW_LINE>lockUI(false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getLayoutData()).exclude = true;
487,374
private final OpDefNode generateLambda(TreeNode syntaxTreeNode, ModuleNode cm) throws AbortException {<NEW_LINE>TreeNode[<MASK><NEW_LINE>int arity = (children.length - 2) / 2;<NEW_LINE>Context ctxt = new Context(moduleTable, errors);<NEW_LINE>symbolTable.pushContext(ctxt);<NEW_LINE>FormalParamNode[] params = new FormalParamNode[arity];<NEW_LINE>int argPos = 1;<NEW_LINE>for (int i = 0; i < arity; i++) {<NEW_LINE>params[i] = new // parameters of a lambda expression<NEW_LINE>// parameters of a lambda expression<NEW_LINE>FormalParamNode(// parameters of a lambda expression<NEW_LINE>children[argPos].getUS(), // have arity 0.<NEW_LINE>0, children[argPos], symbolTable, cm);<NEW_LINE>argPos = argPos + 2;<NEW_LINE>}<NEW_LINE>// for<NEW_LINE>// /***********************************************************************<NEW_LINE>// * Convert the FormalParamNode array params to the OpDeclNode array *<NEW_LINE>// * odn. *<NEW_LINE>// ***********************************************************************/<NEW_LINE>// OpDeclNode[] odn = new OpDeclNode[params.length] ;<NEW_LINE>// for (int i = 0; i < params.length; i++) {<NEW_LINE>// odn[i] = new OpDeclNode(params[i].getName(),<NEW_LINE>// BoundSymbolKind,<NEW_LINE>// ConstantLevel,<NEW_LINE>// params.length, // arity<NEW_LINE>// cm, // ModuleNode<NEW_LINE>// null, // SymbolTable<NEW_LINE>// params[i].stn); // TreeNode<NEW_LINE>// }; // for<NEW_LINE>pushFormalParams(params);<NEW_LINE>ExprNode body = generateExpression(children[children.length - 1], cm);<NEW_LINE>popFormalParams();<NEW_LINE>symbolTable.popContext();<NEW_LINE>return new // The operator name is "LAMBDA"<NEW_LINE>// The operator name is "LAMBDA"<NEW_LINE>OpDefNode(// The node kind for a lambda expression<NEW_LINE>S_lambda, // the array of formal parameters<NEW_LINE>UserDefinedOpKind, // localness, which is meaningless<NEW_LINE>params, // the body (an expression node)<NEW_LINE>false, // the module<NEW_LINE>body, // the symbol table, which is null for an<NEW_LINE>cm, // OpDefNode representing a lambda expression.<NEW_LINE>null, // Is defined. Its value should not matter.<NEW_LINE>// Is defined. Its value should not matter.<NEW_LINE>syntaxTreeNode, // Source<NEW_LINE>true, null);<NEW_LINE>}
] children = syntaxTreeNode.heirs();
638,510
public String bulkEdit(@RequestParam(required = false) String[] selectedUsers, @RequestParam(required = false) final String[] selectedSpaces, HttpServletRequest req) {<NEW_LINE>Profile <MASK><NEW_LINE>boolean isAdmin = utils.isAdmin(authUser);<NEW_LINE>String operation = req.getParameter("operation");<NEW_LINE>String selection = req.getParameter("selection");<NEW_LINE>if (isAdmin && ("all".equals(selection) || selectedUsers != null)) {<NEW_LINE>// find all user objects even if there are more than 10000 users in the system<NEW_LINE>Pager pager = new Pager(1, "_docid", false, ScooldUtils.getConfig().maxItemsPerPage());<NEW_LINE>List<Profile> profiles;<NEW_LINE>LinkedList<Map<String, Object>> toUpdate = new LinkedList<>();<NEW_LINE>List<String> spaces = (selectedSpaces == null || selectedSpaces.length == 0) ? Collections.emptyList() : Arrays.asList(selectedSpaces);<NEW_LINE>do {<NEW_LINE>String query = (selection == null || "selected".equals(selection)) ? Config._ID + ":(\"" + String.join("\" \"", selectedUsers) + "\")" : "*";<NEW_LINE>profiles = pc.findQuery(Utils.type(Profile.class), query, pager);<NEW_LINE>profiles.stream().filter(p -> !utils.isMod(p)).forEach(p -> {<NEW_LINE>if ("add".equals(operation)) {<NEW_LINE>p.getSpaces().addAll(spaces);<NEW_LINE>} else if ("remove".equals(operation)) {<NEW_LINE>p.getSpaces().removeAll(spaces);<NEW_LINE>} else {<NEW_LINE>p.setSpaces(new HashSet<String>(spaces));<NEW_LINE>}<NEW_LINE>Map<String, Object> profile = new HashMap<>();<NEW_LINE>profile.put(Config._ID, p.getId());<NEW_LINE>profile.put("spaces", p.getSpaces());<NEW_LINE>toUpdate.add(profile);<NEW_LINE>});<NEW_LINE>} while (!profiles.isEmpty());<NEW_LINE>// always patch outside the loop because we modify _docid values!!!<NEW_LINE>LinkedList<Map<String, Object>> batch = new LinkedList<>();<NEW_LINE>while (!toUpdate.isEmpty()) {<NEW_LINE>batch.add(toUpdate.pop());<NEW_LINE>if (batch.size() >= 100) {<NEW_LINE>// partial batch update<NEW_LINE>pc.invokePatch("_batch", batch, Map.class);<NEW_LINE>batch.clear();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!batch.isEmpty()) {<NEW_LINE>pc.invokePatch("_batch", batch, Map.class);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return "redirect:" + PEOPLELINK + (isAdmin ? "?" + req.getQueryString() : "");<NEW_LINE>}
authUser = utils.getAuthUser(req);
740,178
public static Cipher createSymmetricCipher(SecretKey symmetricCryptoKey, int encryptMode, Provider cryptoProvider, byte[] initVector) {<NEW_LINE>try {<NEW_LINE>Cipher cipher;<NEW_LINE>if (cryptoProvider != null) {<NEW_LINE>cipher = Cipher.getInstance(JceEncryptionConstants.SYMMETRIC_CIPHER_METHOD, cryptoProvider);<NEW_LINE>} else {<NEW_LINE>cipher = Cipher.getInstance(JceEncryptionConstants.SYMMETRIC_CIPHER_METHOD);<NEW_LINE>}<NEW_LINE>if (initVector != null) {<NEW_LINE>cipher.init(encryptMode, <MASK><NEW_LINE>} else {<NEW_LINE>cipher.init(encryptMode, symmetricCryptoKey);<NEW_LINE>}<NEW_LINE>return cipher;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new AmazonClientException("Unable to build cipher: " + e.getMessage() + "\nMake sure you have the JCE unlimited strength policy files installed and " + "configured for your JVM: http://www.ngs.ac.uk/tools/jcepolicyfiles", e);<NEW_LINE>}<NEW_LINE>}
symmetricCryptoKey, new IvParameterSpec(initVector));
380,179
public void execute(JobExecutionContext jobExecutionContext) {<NEW_LINE>ExecutorService executorService = ExecutorUtils.getJobWorkers();<NEW_LINE>ExecutorUtils.printThreadPoolStatus(executorService, "JOB_WORKERS", scheduleLogger);<NEW_LINE>executorService.submit(() -> {<NEW_LINE>TriggerKey triggerKey = jobExecutionContext.getTrigger().getKey();<NEW_LINE>ScheduleJob scheduleJob = (ScheduleJob) jobExecutionContext.getMergedJobDataMap().get(QuartzHandler.getJobDataKey(triggerKey));<NEW_LINE>if (scheduleJob == null) {<NEW_LINE>scheduleLogger.warn(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Long id = scheduleJob.getId();<NEW_LINE>if (scheduleJob.getStartDate().getTime() > System.currentTimeMillis() || scheduleJob.getEndDate().getTime() < System.currentTimeMillis()) {<NEW_LINE>Object[] args = { id, DateUtils.toyyyyMMddHHmmss(System.currentTimeMillis()), DateUtils.toyyyyMMddHHmmss(scheduleJob.getStartDate()), DateUtils.toyyyyMMddHHmmss(scheduleJob.getEndDate()), scheduleJob.getCronExpression() };<NEW_LINE>scheduleLogger.warn("ScheduleJob({}), currentTime:{} is not within the planned execution time, startTime:{}, endTime:{}, cronExpression:{}", args);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String jobType = scheduleJob.getJobType().trim();<NEW_LINE>ScheduleService scheduleService = (ScheduleService) SpringContextHolder.getBean(jobType + "ScheduleService");<NEW_LINE>if (StringUtils.isEmpty(jobType) || scheduleService == null) {<NEW_LINE>scheduleLogger.warn("Unknown job type {}, jobId:{}", jobType, scheduleJob.getId());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>String lockKey = CheckEntityEnum.CRONJOB.getSource().toUpperCase() + Constants.AT_SYMBOL + id + Constants.AT_SYMBOL + "EXECUTED";<NEW_LINE>if (!LockFactory.getLock(lockKey, 500, LockType.REDIS).getLock()) {<NEW_LINE>scheduleLogger.warn("ScheduleJob({}) has been executed by other instance", id);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>scheduleService.execute(id);<NEW_LINE>} catch (Exception e) {<NEW_LINE>scheduleLogger.error("ScheduleJob({}) execute error:{}", id, e.getMessage());<NEW_LINE>scheduleLogger.error(e.getMessage(), e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
"ScheduleJob({}) is not found", triggerKey.getName());
499,863
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see javax.jms.JMSProducer#send(javax.jms.Destination, javax.jms.Message)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public JMSProducer send(Destination dest, Message msg) throws MessageFormatRuntimeException, InvalidDestinationRuntimeException, MessageNotWriteableRuntimeException, JMSRuntimeException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(this, tc, "send", new Object[] { dest, msg });<NEW_LINE>try {<NEW_LINE>// Inherit non-conflicting producer properties<NEW_LINE>inheritProducerProperties(msg);<NEW_LINE>messageProducer.send_internal(dest, msg, _completionListerner);<NEW_LINE>} catch (MessageFormatException mfe) {<NEW_LINE>throw (MessageFormatRuntimeException) JmsErrorUtils.<MASK><NEW_LINE>} catch (InvalidDestinationException ide) {<NEW_LINE>throw (InvalidDestinationRuntimeException) JmsErrorUtils.getJMS2Exception(ide, InvalidDestinationRuntimeException.class);<NEW_LINE>} catch (MessageNotWriteableException mnwe) {<NEW_LINE>throw (MessageNotWriteableRuntimeException) JmsErrorUtils.getJMS2Exception(mnwe, MessageNotWriteableRuntimeException.class);<NEW_LINE>} catch (JMSException jmse) {<NEW_LINE>throw (JMSRuntimeException) JmsErrorUtils.getJMS2Exception(jmse, JMSRuntimeException.class);<NEW_LINE>} finally {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(this, tc, "send", new Object[] { this });<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
getJMS2Exception(mfe, MessageFormatRuntimeException.class);