content stringlengths 40 137k |
|---|
"public void showInformationDialog(String info) {\n Alert information = new Alert(Alert.AlertType.INFORMATION, info);\n information.setHeaderText(\"String_Node_Str\");\n information.showAndWait();\n}\n"
|
"private List<CandidateProgram<Action>> generatePopulation() {\n Random rGen = new Random();\n ArrayList<ArrayList<String>> storage = new ArrayList<ArrayList<String>>();\n FullInitialiser<Object> f = new FullInitialiser<Object>(model);\n List<CandidateProgram<Object>> firstPass = f.getInitialPopulation();\n for (CandidateProgram<Object> c : firstPass) {\n AntRepresentation b = (AntRepresentation) semMod.codeToBehaviour(c.getRootNode());\n if (!b.isConstant()) {\n storage.add(b.getAntRepresentation());\n }\n }\n ArrayList<String> result;\n String oB = (\"String_Node_Str\");\n String cB = (\"String_Node_Str\");\n int partSize = 10;\n while (storage.size() < model.getPopulationSize()) {\n int cFunc = rGen.nextInt(model.getFunctions().size());\n result = new ArrayList<String>();\n if (cFunc == 0) {\n ArrayList<String> part1 = storage.get(rGen.nextInt(storage.size()));\n ArrayList<String> part2 = storage.get(rGen.nextInt(storage.size()));\n while (getMoves(part1) > partSize) {\n part1 = storage.get(rGen.nextInt(storage.size()));\n }\n while (getMoves(part2) > partSize) {\n part2 = storage.get(rGen.nextInt(storage.size()));\n }\n result.add(oB);\n for (String p : part1) {\n result.add(p);\n }\n result.add(cB);\n result.add(oB);\n for (String p : part2) {\n result.add(p);\n }\n result.add(cB);\n } else if (cFunc == 1) {\n ArrayList<String> p1 = storage.get(rGen.nextInt(storage.size()));\n ArrayList<String> p2 = storage.get(rGen.nextInt(storage.size()));\n while (getMoves(p1) > partSize) {\n p1 = storage.get(rGen.nextInt(storage.size()));\n }\n while (getMoves(p2) > partSize) {\n p2 = storage.get(rGen.nextInt(storage.size()));\n }\n result = semMod.joinPaths(p1, p2, \"String_Node_Str\");\n } else if (cFunc == 2) {\n ArrayList<String> p1 = storage.get(rGen.nextInt(storage.size()));\n ArrayList<String> p2 = storage.get(rGen.nextInt(storage.size()));\n while (getMoves(p1) > partSize) {\n p1 = storage.get(rGen.nextInt(storage.size()));\n }\n while (getMoves(p2) > partSize) {\n p2 = storage.get(rGen.nextInt(storage.size()));\n }\n result = semMod.joinPaths(p1, p2, \"String_Node_Str\");\n ArrayList<String> p3 = storage.get(rGen.nextInt(storage.size()));\n while (getMoves(p3) > partSize) {\n p3 = storage.get(rGen.nextInt(storage.size()));\n }\n result = semMod.joinPaths(result, p3, \"String_Node_Str\");\n }\n result = semMod.condenseAntRep(result);\n if (!storage.contains(result) && result.size() > 2) {\n storage.add(result);\n }\n }\n List<CandidateProgram<Action>> firstGen = new ArrayList<CandidateProgram<Action>>();\n int i = 1;\n for (ArrayList<String> toProg : storage) {\n Node<Action> holder = semMod.behaviourToCode(new AntRepresentation(toProg));\n firstGen.add(new CandidateProgram<Action>(holder, model));\n i++;\n }\n storage = null;\n return firstGen;\n}\n"
|
"public void testAbstractCovariance_GRE272_2() {\n runNegativeTest(new String[] { \"String_Node_Str\", \"String_Node_Str\" + \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\" + \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\" + \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\" + \"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\" + \"String_Node_Str\" }, \"String_Node_Str\");\n}\n"
|
"public Dimension getSize() {\n return screenSize;\n}\n"
|
"public void checkAttribute(ManagedType<?> managedType, MetamodelBuildingContext context) {\n Class<?> expressionType = getJavaType();\n Class<?> elementType = null;\n if (fetches.length != 0) {\n ManagedType<?> entityType = context.getEntityMetamodel().getManagedType(getElementType().getJavaType());\n if (entityType == null) {\n context.addError(\"String_Node_Str\" + Arrays.toString(fetches) + \"String_Node_Str\" + getLocation() + \"String_Node_Str\");\n } else {\n ScalarTargetResolvingExpressionVisitor visitor = new ScalarTargetResolvingExpressionVisitor(entityType, context.getEntityMetamodel(), context.getJpqlFunctions());\n for (int i = 0; i < fetches.length; i++) {\n final String fetch = fetches[i];\n final String errorLocation;\n if (fetches.length == 1) {\n errorLocation = \"String_Node_Str\";\n } else {\n errorLocation = \"String_Node_Str\" + (i + 1) + \"String_Node_Str\";\n }\n visitor.clear();\n try {\n context.getExpressionFactory().createPathExpression(fetch).accept(visitor);\n } catch (SyntaxErrorException ex) {\n context.addError(\"String_Node_Str\" + errorLocation + \"String_Node_Str\" + fetch + \"String_Node_Str\" + getLocation() + \"String_Node_Str\" + ex.getMessage());\n } catch (IllegalArgumentException ex) {\n context.addError(\"String_Node_Str\" + errorLocation + \"String_Node_Str\" + fetch + \"String_Node_Str\" + getLocation() + \"String_Node_Str\" + ex.getMessage());\n }\n }\n }\n }\n if (isCollection()) {\n elementType = getElementType().getJavaType();\n if (isUpdatable()) {\n } else {\n if (isIndexed()) {\n if (getCollectionType() == PluralAttribute.CollectionType.MAP) {\n expressionType = Map.class;\n } else {\n expressionType = List.class;\n }\n } else {\n expressionType = Collection.class;\n }\n }\n }\n if (isSubview()) {\n ManagedViewTypeImpl<?> subviewType = (ManagedViewTypeImpl<?>) getElementType();\n if (isCollection()) {\n elementType = subviewType.getEntityClass();\n } else {\n expressionType = subviewType.getEntityClass();\n }\n }\n if (isCorrelated()) {\n if (isUpdatable()) {\n context.addError(\"String_Node_Str\" + getLocation());\n }\n validateTypesCompatible(managedType, stripThisFromMapping(correlationBasis), Object.class, null, true, context, ExpressionLocation.CORRELATION_BASIS, getLocation());\n if (correlated != null) {\n validateTypesCompatible(context.getEntityMetamodel().managedType(correlated), stripThisFromMapping(correlationResult), expressionType, elementType, true, context, ExpressionLocation.CORRELATION_RESULT, getLocation());\n try {\n context.createMacroAwareExpressionFactory().createBooleanExpression(correlationExpression, false);\n } catch (SyntaxErrorException ex) {\n context.addError(\"String_Node_Str\" + ExpressionLocation.CORRELATION_EXPRESSION + \"String_Node_Str\" + correlationExpression + \"String_Node_Str\" + getLocation() + \"String_Node_Str\" + ex.getMessage());\n } catch (IllegalArgumentException ex) {\n context.addError(\"String_Node_Str\" + ExpressionLocation.CORRELATION_EXPRESSION + \"String_Node_Str\" + getLocation() + \"String_Node_Str\" + ex.getMessage());\n }\n }\n } else if (isSubquery() || isQueryParameter()) {\n } else {\n boolean subtypesAllowed = !isUpdatable();\n if (!isCollection() && Collection.class.isAssignableFrom(expressionType)) {\n Class<?>[] typeArguments = getTypeArguments();\n elementType = typeArguments[typeArguments.length - 1];\n }\n String mapping = stripThisFromMapping(this.mapping);\n validateTypesCompatible(managedType, mapping, expressionType, elementType, subtypesAllowed, context, ExpressionLocation.MAPPING, getLocation());\n if (isUpdatable() && declaringType.isUpdatable()) {\n UpdatableExpressionVisitor visitor = new UpdatableExpressionVisitor(managedType.getJavaType());\n try {\n context.getExpressionFactory().createPathExpression(mapping).accept(visitor);\n Map<Method, Class<?>[]> possibleTargets = visitor.getPossibleTargets();\n if (possibleTargets.size() > 1) {\n context.addError(\"String_Node_Str\" + getLocation() + \"String_Node_Str\" + possibleTargets);\n }\n } catch (SyntaxErrorException ex) {\n context.addError(\"String_Node_Str\" + mapping + \"String_Node_Str\" + getLocation() + \"String_Node_Str\" + ex.getMessage());\n } catch (IllegalArgumentException ex) {\n context.addError(\"String_Node_Str\" + getLocation() + \"String_Node_Str\" + ex.getMessage());\n }\n }\n }\n}\n"
|
"final void handleBackup(Packet packet) {\n try {\n String name = packet.name;\n int blockId = packet.blockId;\n Q q = getQ(name);\n if (packet.operation == ClusterOperation.BLOCKING_QUEUE_BACKUP_ADD) {\n Data data = packet.getValueData();\n q.doBackup(true, data, blockId, (int) packet.longValue);\n } else if (packet.operation == ClusterOperation.BLOCKING_QUEUE_BACKUP_REMOVE) {\n q.doBackup(false, null, blockId, (int) packet.longValue);\n }\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n releasePacket(packet);\n }\n}\n"
|
"public Binding bindings() {\n if (binding != null) {\n return binding;\n }\n if (state != State.STARTED && state != State.PRE_RUNNING) {\n throw new IllegalStateException(\"String_Node_Str\" + id + \"String_Node_Str\" + State.STARTED + \"String_Node_Str\" + State.PRE_RUNNING + \"String_Node_Str\" + state);\n }\n binding = BindingUtil.binding(executor, id);\n return binding;\n}\n"
|
"public void testApiInvocationAndEventTest() throws Exception {\n thriftTestServer.clearTables();\n HttpResponse serviceResponse = apiStore.addApplication(APP_NAME, APIThrottlingTier.UNLIMITED.getState(), \"String_Node_Str\", \"String_Node_Str\");\n verifyResponse(serviceResponse);\n SubscriptionRequest subscriptionRequest = new SubscriptionRequest(API_NAME, user.getUserName());\n subscriptionRequest.setApplicationName(APP_NAME);\n subscriptionRequest.setTier(APIMIntegrationConstants.API_TIER.UNLIMITED);\n serviceResponse = apiStore.subscribe(subscriptionRequest);\n verifyResponse(serviceResponse);\n APPKeyRequestGenerator generateAppKeyRequest = new APPKeyRequestGenerator(APP_NAME);\n String responseString = apiStore.generateApplicationKey(generateAppKeyRequest).getData();\n JSONObject response = new JSONObject(responseString);\n String accessToken = response.getJSONObject(\"String_Node_Str\").getJSONObject(\"String_Node_Str\").get(\"String_Node_Str\").toString();\n consumerKey = response.getJSONObject(\"String_Node_Str\").getJSONObject(\"String_Node_Str\").get(\"String_Node_Str\").toString();\n Assert.assertNotNull(\"String_Node_Str\" + responseString, accessToken);\n requestHeaders.put(APIMIntegrationConstants.AUTHORIZATION_HEADER, \"String_Node_Str\" + accessToken);\n String invokeURL = getAPIInvocationURLHttp(API_CONTEXT, API_VERSION);\n serviceResponse = HTTPSClientUtils.doGet(invokeURL + \"String_Node_Str\", requestHeaders);\n Assert.assertEquals(HttpStatus.SC_OK, serviceResponse.getResponseCode(), \"String_Node_Str\");\n testRequestEvent();\n testResponseEvent();\n}\n"
|
"private static void jj_la1_init_2() {\n jj_la1_2 = new int[] { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0000000, 0xc0000000, 0x0, 0xc0000000, 0x0, 0xc8ffffff, 0x0, 0x0, 0x0, 0xc0000000, 0x0, 0x0, 0x0, 0xc0000000, 0x0, 0x0, 0x0, 0xc0000000, 0x0, 0xc0000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8000000, 0x0, 0x0, 0x0, 0x0, 0xc0000000, 0xc8000000, 0x0, 0xc0ffffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0000000, 0x0, 0x0, 0xc8000000, 0xc0000000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc8ffffff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc8ffffff, 0x0, 0x0, 0x0, 0x0, 0xc0000000, 0xc0000000, 0xc0000000, 0xc0000000, 0x1, 0x0, 0x0, 0x80ffffff, 0xc0ffffff, 0x0, 0x0, 0xfffe, 0xff0000, 0x0, 0xc8ffffff };\n}\n"
|
"public void testRecord() throws Exception {\n statServiceClient.recordCount(\"String_Node_Str\", 1);\n serviceBundle.flush();\n triggerLatchWhen(o -> replicator.count.get() == 1);\n waitForLatch(20);\n ok = replicator.count == 1 || die();\n}\n"
|
"private void kalmanFilter(Matrix C, Matrix z) {\n Date now = new Date();\n double dt = (now.getTime() - lastTime) / 1000.0;\n lastTime = now.getTime();\n Matrix A = getMotionModel(dt);\n Matrix x_pre = A.times(x);\n Matrix P_pre = A.times(P).times(A.transpose());\n P_pre = P_pre.plus(R);\n x_pre.set(HEADING_GLOBAL_ROW, 0, clampAngle(x_pre.get(HEADING_GLOBAL_ROW, 0)));\n x_pre.set(HEADING_VEL_ROW, 0, clampAngle(x_pre.get(HEADING_VEL_ROW, 0)));\n Matrix residual = z.minus(C.times(x));\n Matrix K = C;\n K = K.times(P_pre);\n K = K.times(C.transpose());\n K = K.plus(Q);\n K = P_pre.times(C.transpose()).times(K.inverse());\n x = x_pre.plus(K.times(residual));\n P = Matrix.identity(5, 5).minus(K.times(C));\n P = P.times(P_pre);\n x.set(HEADING_GLOBAL_ROW, 0, clampAngle(x.get(HEADING_GLOBAL_ROW, 0)));\n x.set(HEADING_VEL_ROW, 0, clampAngle(x.get(HEADING_VEL_ROW, 0)));\n}\n"
|
"public CommandResult execute(CommandSource source, CommandContext context) throws CommandException {\n Optional<Player> optionalInvitedPlayer = context.<Player>getOne(\"String_Node_Str\");\n if (optionalInvitedPlayer.isPresent()) {\n if (source instanceof Player) {\n Player senderPlayer = (Player) source;\n Player invitedPlayer = optionalInvitedPlayer.get();\n Optional<Faction> optionalSenderFaction = FactionLogic.getFactionByPlayerUUID(senderPlayer.getUniqueId());\n if (optionalSenderFaction.isPresent()) {\n Faction senderFaction = optionalSenderFaction.get();\n if (MainLogic.isPlayerLimit()) {\n int playerCount = 0;\n playerCount += senderFaction.Leader.equals(\"String_Node_Str\") ? 0 : 1;\n playerCount += senderFaction.Officers.isEmpty() ? 0 : senderFaction.Officers.size();\n playerCount += senderFaction.Members.isEmpty() ? 0 : senderFaction.Members.size();\n if (playerCount >= MainLogic.getPlayerLimit()) {\n senderPlayer.sendMessage(Text.of(PluginInfo.ErrorPrefix, TextColors.RED, PluginMessages.YOU_CANT_INVITE_MORE_PLAYERS_TO_YOUR_FACTION + \"String_Node_Str\" + PluginMessages.FACTIONS_PLAYER_LIMIT_HAS_BEEN_REACHED));\n return CommandResult.success();\n }\n }\n if (FactionLogic.getFactionName(invitedPlayer.getUniqueId()).equals(\"String_Node_Str\")) {\n try {\n Invite invite = new Invite(senderFaction.Name, invitedPlayer.getUniqueId());\n EagleFactions.InviteList.add(invite);\n invitedPlayer.sendMessage(Text.of(PluginInfo.PluginPrefix, TextColors.GREEN, PluginMessages.FACTION + \"String_Node_Str\", TextColors.GOLD, senderFaction.Name, TextColors.GREEN, \"String_Node_Str\" + PluginMessages.HAS_SENT_YOU_AN_INVITE + \"String_Node_Str\" + PluginMessages.YOU_HAVE_TWO_MINUTES_TO_ACCEPT_IT + \"String_Node_Str\" + PluginMessages.TYPE + \"String_Node_Str\", TextColors.GOLD, \"String_Node_Str\" + senderFaction.Name, TextColors.WHITE, \"String_Node_Str\" + PluginMessages.TO_JOIN));\n senderPlayer.sendMessage(Text.of(PluginInfo.PluginPrefix, TextColors.GREEN, PluginMessages.YOU_INVITED + \"String_Node_Str\", TextColors.GOLD, invitedPlayer.getName(), TextColors.GREEN, \"String_Node_Str\" + PluginMessages.TO_YOUR_FACTION));\n Task.Builder taskBuilder = Sponge.getScheduler().createTaskBuilder();\n taskBuilder.execute(new Runnable() {\n public void run() {\n if (EagleFactions.InviteList.contains(invite) && EagleFactions.InviteList != null) {\n EagleFactions.InviteList.remove(invite);\n }\n }\n }).delay(2, TimeUnit.MINUTES).name(\"String_Node_Str\").submit(EagleFactions.getEagleFactions());\n return CommandResult.success();\n } catch (Exception exception) {\n exception.printStackTrace();\n }\n } else {\n source.sendMessage(Text.of(PluginInfo.ErrorPrefix, TextColors.RED, PluginMessages.PLAYER_IS_ALREADY_IN_A_FACTION));\n }\n } else {\n source.sendMessage(Text.of(PluginInfo.ErrorPrefix, TextColors.RED, PluginMessages.YOU_MUST_BE_IN_FACTION_IN_ORDER_TO_USE_THIS_COMMAND));\n }\n } else {\n source.sendMessage(Text.of(PluginInfo.ErrorPrefix, TextColors.RED, PluginMessages.ONLY_IN_GAME_PLAYERS_CAN_USE_THIS_COMMAND));\n }\n } else {\n source.sendMessage(Text.of(PluginInfo.ErrorPrefix, TextColors.RED, PluginMessages.WRONG_COMMAND_ARGUMENTS));\n source.sendMessage(Text.of(TextColors.RED, PluginMessages.USAGE + \"String_Node_Str\"));\n }\n return CommandResult.success();\n}\n"
|
"protected void handleMousePressed(final MouseEvent event) {\n if (!event.getButton().equals(MouseButton.PRIMARY)) {\n return;\n }\n if (cacheWhenStationary) {\n setCache(false);\n }\n final Point2D cursorPosition = getCursorPositionInContainer(event);\n storeClickValuesForDrag(cursorPosition.getX(), cursorPosition.getY());\n dragActive = true;\n event.consume();\n}\n"
|
"public Vertex addVertex(Object id) {\n if (id == null) {\n id = AccumuloGraphUtils.generateId();\n }\n String idStr = id.toString();\n Vertex vert = null;\n if (!globals.getConfig().getSkipExistenceChecks()) {\n vert = getVertex(myID);\n if (vert != null) {\n throw ExceptionFactory.vertexWithIdAlreadyExists(myID);\n }\n }\n vert = new AccumuloVertex(globals, myID);\n globals.getVertexWrapper().writeVertex(vert);\n globals.checkedFlush();\n globals.getCaches().cache(vert, Vertex.class);\n return vert;\n}\n"
|
"public void execute(Bundle bundle) {\n Exception e = (Exception) bundle.getSerializable(QBServiceConsts.EXTRA_ERROR);\n ErrorUtils.showError(BaseActivity.this, e);\n hideProgress();\n}\n"
|
"public void perform(Arguments arguments, PrintStream output) throws Exception {\n DatasetTypeId type = cliConfig.getCurrentNamespace().datasetType(arguments.get(ArgumentName.DATASET_TYPE.toString()));\n DatasetTypeMeta datasetTypeMeta = datasetTypeClient.get(type);\n Table table = Table.builder().setHeader(\"String_Node_Str\", \"String_Node_Str\").setRows(ImmutableList.of(datasetTypeMeta), new RowMaker<DatasetTypeMeta>() {\n public List<?> makeRow(DatasetTypeMeta object) {\n return Lists.newArrayList(object.getName(), Joiner.on(\"String_Node_Str\").join(object.getModules()));\n }\n }).build();\n cliConfig.getTableRenderer().render(cliConfig, output, table);\n}\n"
|
"public void commitPending(long currentTime) {\n TickStage.checkStage(TickStage.FINALIZE, regionThread);\n List<DynamicBlockUpdate> l;\n while ((l = pendingLists.poll()) != null) {\n for (DynamicBlockUpdate update : l) {\n add(update);\n }\n }\n processed.clear();\n PointAlone p;\n while ((p = resetPending.poll()) != null) {\n int packed = DynamicBlockUpdate.getPointPacked(p);\n if (!processed.add(packed)) {\n continue;\n }\n int bx = p.getBlockX() & Region.BLOCKS.MASK;\n int by = p.getBlockY() & Region.BLOCKS.MASK;\n int bz = p.getBlockZ() & Region.BLOCKS.MASK;\n removeAll(DynamicBlockUpdate.getBlockPacked(bx, by, bz));\n Chunk c = region.getChunkFromBlock(bx, by, bz, LoadOption.NO_LOAD);\n if (c == null) {\n continue;\n }\n Block b = c.getBlock(bx, by, bz);\n Material m = b.getMaterial();\n if (m instanceof DynamicMaterial) {\n DynamicMaterial dm = (DynamicMaterial) m;\n long nextUpdate = dm.onPlacement(b, region, currentTime);\n if (nextUpdate > 0) {\n add(new DynamicBlockUpdate(bx, by, bz, nextUpdate, currentTime, null));\n }\n }\n }\n while ((p = pending.poll()) != null) {\n int packed = DynamicBlockUpdate.getPointPacked(p);\n if (!processed.add(packed)) {\n continue;\n }\n int bx = p.getBlockX() & Region.BLOCKS.MASK;\n int by = p.getBlockY() & Region.BLOCKS.MASK;\n int bz = p.getBlockZ() & Region.BLOCKS.MASK;\n Object hint = p.getHint();\n long updateTime = p.getUpdateTime();\n add(new DynamicBlockUpdate(bx, by, bz, updateTime, currentTime, hint));\n }\n processed.clear();\n}\n"
|
"void tearDown() {\n resetTmpDir();\n}\n"
|
"public float[] getWorldCoordinates(float x, float y) {\n float[] worldCoordinates;\n float[] w = new float[] { x, y };\n if (hasTransforms()) {\n final CoordinateTransformList<CoordinateTransform> ctl = getTransformList();\n ctl.applyInPlace(w);\n }\n if (z == null) {\n worldCoordinates = w;\n } else {\n worldCoordinates = new float[] { w[0], w[1], z.floatValue() };\n }\n return worldCoordinates;\n}\n"
|
"private ServiceRegistration[] removeProxyServiceRegistrations(RemoteServiceEndpointDescription sed) {\n List results = new ArrayList();\n for (Iterator i = discoveredRemoteServiceRegistrations.keySet().iterator(); i.hasNext(); ) {\n ID containerID = (ID) i.next();\n RemoteServiceRegistration reg = (RemoteServiceRegistration) discoveredRemoteServiceRegistrations.get(containerID);\n ServiceRegistration sr = reg.removeServiceRegistration(sed);\n if (reg != null) {\n ServiceRegistration sr = reg.removeServiceRegistration(sed);\n if (sr != null)\n results.add(sr);\n if (reg.isEmpty()) {\n reg.dispose();\n discoveredRemoteServiceRegistrations.remove(containerID);\n }\n }\n }\n return (ServiceRegistration[]) results.toArray(new ServiceRegistration[] {});\n}\n"
|
"public void startDocument() throws SAXException {\n if (unmarshaller.getIDResolver() != null && parentRecord == null) {\n unmarshaller.getIDResolver().startDocument(unmarshaller.getErrorHandler());\n }\n}\n"
|
"public void turnLeft() {\n if (direction != RIGHT)\n direction = LEFT;\n already_turned = true;\n}\n"
|
"private ProjectedCRS parseProjectedCRS(final int mode, final Element parent, final boolean isBaseCRS) throws ParseException {\n final Element element = parent.pullElement(mode, isBaseCRS ? new String[] { WKTKeywords.BaseProjCRS } : new String[] { WKTKeywords.ProjectedCRS, WKTKeywords.ProjCRS, WKTKeywords.ProjCS });\n if (element == null) {\n return null;\n }\n final boolean isWKT1 = element.getKeywordIndex() == 2;\n final String name = element.pullString(\"String_Node_Str\");\n final SingleCRS geoCRS = parseGeodeticCRS(MANDATORY, element, 2, WKTKeywords.ellipsoidal);\n if (!(geoCRS instanceof GeographicCRS)) {\n throw new LocalizedParseException(errorLocale, Errors.Keys.IllegalCRSType_1, new Object[] { geoCRS.getClass() }, element.offset);\n }\n final Unit<Length> linearUnit = parseScaledUnit(element, WKTKeywords.LengthUnit, SI.METRE);\n final boolean ignoreUnits = isWKT1 && usesCommonUnits;\n final Conversion conversion = parseDerivingConversion(MANDATORY, element, isWKT1 ? null : WKTKeywords.Conversion, ignoreUnits ? SI.METRE : linearUnit, ignoreUnits ? NonSI.DEGREE_ANGLE : geoCRS.getCoordinateSystem().getAxis(0).getUnit().asType(Angle.class));\n final CoordinateSystem cs;\n try {\n cs = parseCoordinateSystem(element, WKTKeywords.Cartesian, 2, isWKT1, linearUnit, geoCRS.getDatum());\n final Map<String, ?> properties = parseMetadataAndClose(element, name, conversion);\n return crsFactory.createProjectedCRS(properties, (GeographicCRS) geoCRS, conversion, (CartesianCS) cs);\n } catch (FactoryException exception) {\n throw element.parseFailed(exception);\n }\n}\n"
|
"public boolean handle(World world, BlockPos pos, EnumFacing direction, ItemStack stack, EntityPlayer player, IStripesActivator activator) {\n Vec3 origin = Utils.convert(pos).add(Utils.convert(direction, -1));\n IBlockSource source = new Source(world, Utils.convertFloor(origin), direction);\n IBehaviorDispenseItem behaviour = (IBehaviorDispenseItem) BlockDispenser.dispenseBehaviorRegistry.getObject(stack.getItem());\n if (behaviour != null) {\n ItemStack output = behaviour.dispense(source, stack.copy());\n if (output.stackSize > 0) {\n activator.sendItem(output, direction.getOpposite());\n }\n return true;\n }\n return false;\n}\n"
|
"public void detach() {\n if (documentModel != null)\n documentModel.detach();\n}\n"
|
"protected void processPossibleIncludes(EClass previousType, CanInclude canInclude) throws QueryException, BimserverDatabaseException {\n if (currentObject != null) {\n if (canInclude.hasIncludes()) {\n for (Include include : canInclude.getIncludes()) {\n processPossibleInclude(canInclude, include);\n }\n if (canInclude instanceof Include) {\n processPossibleInclude(null, (Include) canInclude);\n }\n }\n}\n"
|
"private void resolvePendingState() {\n pendingStateCommand = null;\n if (pendingState == null) {\n pendingStateLoop = 0;\n return;\n }\n pendingStateLoop++;\n if (pendingStateLoop > LOOP_MAXIMUM) {\n pendingStateLoop = 0;\n throw new IllegalStateException(\"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\");\n }\n if (isResolvingState) {\n throw new IllegalStateException(\"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\");\n }\n isResolvingState = true;\n JsArrayInteger modifiedRows = JavaScriptObject.createArray().cast();\n State<T> oldState = state;\n PendingState<T> pending = pendingState;\n int pageStart = pending.getPageStart();\n int pageSize = pending.getPageSize();\n int pageEnd = pageStart + pageSize;\n int rowDataCount = pending.getRowDataSize();\n pending.keyboardSelectedRow = Math.max(0, Math.min(pending.keyboardSelectedRow, rowDataCount - 1));\n if (KeyboardSelectionPolicy.DISABLED == keyboardSelectionPolicy) {\n pending.keyboardSelectedRow = 0;\n pending.keyboardSelectedRowValue = null;\n } else if (pending.keyboardSelectedRowChanged) {\n pending.keyboardSelectedRowValue = rowDataCount > 0 ? pending.getRowDataValue(pending.keyboardSelectedRow) : null;\n } else if (pending.keyboardSelectedRowValue != null) {\n int bestMatchIndex = findIndexOfBestMatch(pending, pending.keyboardSelectedRowValue, pending.keyboardSelectedRow);\n if (bestMatchIndex >= 0) {\n pending.keyboardSelectedRow = bestMatchIndex;\n pending.keyboardSelectedRowValue = rowDataCount > 0 ? pending.getRowDataValue(pending.keyboardSelectedRow) : null;\n } else {\n pending.keyboardSelectedRow = 0;\n pending.keyboardSelectedRowValue = null;\n }\n }\n try {\n if (KeyboardSelectionPolicy.BOUND_TO_SELECTION == keyboardSelectionPolicy && selectionModel != null && pending.viewTouched) {\n T oldValue = oldState.getSelectedValue();\n Object oldKey = getRowValueKey(oldValue);\n T newValue = rowDataCount > 0 ? pending.getRowDataValue(pending.getKeyboardSelectedRow()) : null;\n Object newKey = getRowValueKey(newValue);\n if (newKey != null) {\n boolean oldValueWasSelected = (oldValue == null) ? false : selectionModel.isSelected(oldValue);\n boolean newValueWasSelected = (newValue == null) ? false : selectionModel.isSelected(newValue);\n if (oldValueWasSelected) {\n selectionModel.setSelected(oldValue, false);\n }\n pending.selectedValue = newValue;\n if (newValue != null && !newValueWasSelected) {\n selectionModel.setSelected(newValue, true);\n }\n }\n }\n } catch (RuntimeException e) {\n isResolvingState = false;\n throw e;\n }\n boolean keyboardRowChanged = pending.keyboardSelectedRowChanged || (oldState.getKeyboardSelectedRow() != pending.keyboardSelectedRow) || (oldState.getKeyboardSelectedRowValue() == null && pending.keyboardSelectedRowValue != null);\n for (int i = pageStart; i < pageStart + rowDataCount; i++) {\n T rowValue = pending.getRowDataValue(i - pageStart);\n boolean isSelected = (rowValue != null && selectionModel != null && selectionModel.isSelected(rowValue));\n boolean wasSelected = oldState.isRowSelected(i);\n if (isSelected) {\n pending.selectedRows.add(i);\n if (!wasSelected) {\n modifiedRows.push(i);\n }\n } else if (wasSelected) {\n modifiedRows.push(i);\n }\n }\n if (pendingStateCommand != null) {\n isResolvingState = false;\n return;\n }\n pendingStateLoop = 0;\n state = pendingState;\n pendingState = null;\n boolean replacedEmptyRange = false;\n for (Range replacedRange : pending.replacedRanges) {\n int start = replacedRange.getStart();\n int length = replacedRange.getLength();\n if (length == 0) {\n replacedEmptyRange = true;\n }\n for (int i = start; i < start + length; i++) {\n modifiedRows.push(i);\n }\n }\n if (modifiedRows.length() > 0 && keyboardRowChanged) {\n modifiedRows.push(oldState.getKeyboardSelectedRow());\n modifiedRows.push(pending.keyboardSelectedRow);\n }\n List<Range> modifiedRanges = calculateModifiedRanges(modifiedRows, pageStart, pageEnd);\n Range range0 = modifiedRanges.size() > 0 ? modifiedRanges.get(0) : null;\n Range range1 = modifiedRanges.size() > 1 ? modifiedRanges.get(1) : null;\n int replaceDiff = 0;\n for (Range range : modifiedRanges) {\n replaceDiff += range.getLength();\n }\n int oldPageStart = oldState.getPageStart();\n int oldPageSize = oldState.getPageSize();\n int oldRowDataCount = oldState.getRowDataSize();\n boolean redrawRequired = pending.redrawRequired;\n if (pageStart != oldPageStart) {\n redrawRequired = true;\n } else if (rowDataCount < oldRowDataCount) {\n redrawRequired = true;\n } else if (range1 == null && range0 != null && range0.getStart() == pageStart && (replaceDiff >= oldRowDataCount || replaceDiff > oldPageSize)) {\n redrawRequired = true;\n } else if (replaceDiff >= REDRAW_MINIMUM && replaceDiff > REDRAW_THRESHOLD * oldRowDataCount) {\n redrawRequired = true;\n } else if (replacedEmptyRange && oldRowDataCount == 0) {\n redrawRequired = true;\n }\n updateLoadingState();\n try {\n if (redrawRequired) {\n SafeHtmlBuilder sb = new SafeHtmlBuilder();\n view.replaceAllChildren(pending.rowData, selectionModel, pending.keyboardStealFocus);\n view.resetFocus();\n } else if (range0 != null) {\n {\n int absStart = range0.getStart();\n int relStart = absStart - pageStart;\n SafeHtmlBuilder sb = new SafeHtmlBuilder();\n List<T> replaceValues = pending.rowData.subList(relStart, relStart + range0.getLength());\n view.replaceChildren(replaceValues, relStart, selectionModel, pending.keyboardStealFocus);\n }\n if (range1 != null) {\n int absStart = range1.getStart();\n int relStart = absStart - pageStart;\n SafeHtmlBuilder sb = new SafeHtmlBuilder();\n List<T> replaceValues = pending.rowData.subList(relStart, relStart + range1.getLength());\n view.replaceChildren(replaceValues, relStart, selectionModel, pending.keyboardStealFocus);\n }\n view.resetFocus();\n } else if (keyboardRowChanged) {\n int oldSelectedRow = oldState.getKeyboardSelectedRow();\n if (oldSelectedRow >= 0 && oldSelectedRow < rowDataCount) {\n view.setKeyboardSelected(oldSelectedRow, false, false);\n }\n int newSelectedRow = pending.getKeyboardSelectedRow();\n if (newSelectedRow >= 0 && newSelectedRow < rowDataCount) {\n view.setKeyboardSelected(newSelectedRow, true, pending.keyboardStealFocus);\n }\n }\n } catch (Error e) {\n throw new RuntimeException(e);\n } finally {\n isResolvingState = false;\n }\n}\n"
|
"public static void main(String[] args) {\n if (args.length < 1)\n usage();\n Command command = COMMANDS.get(args[0]);\n if (command == null)\n error(\"String_Node_Str\" + args[0]);\n List<String> arguments = asList(args).subList(1, args.length);\n try {\n command.execute(arguments);\n } catch (IOException e) {\n fatal(e);\n }\n}\n"
|
"private void invoke(ClientMessage request) {\n try {\n ClientInvocation invocation = new ClientInvocation(instance, request, null);\n ClientInvocationFuture future = invocation.invoke();\n future.get();\n } catch (Exception e) {\n throw rethrow(e);\n }\n}\n"
|
"public void check(CallGraph cg) {\n classes: for (ClassAnnotation ca : classAnnotations) {\n IClass cls = cg.getClassHierarchy().lookupClass(TypeReference.findOrCreate(ClassLoaderReference.Application, ca.className));\n IClass at = cg.getClassHierarchy().lookupClass(TypeReference.findOrCreate(ClassLoaderReference.Application, ca.annotationTypeName));\n for (Annotation a : cls.getAnnotations()) {\n if (a.getType().equals(at.getReference())) {\n continue classes;\n }\n }\n Assert.assertFalse(\"String_Node_Str\" + at + \"String_Node_Str\" + cls, false);\n }\n annot: for (MethodAnnotation ma : methodAnnotations) {\n IClass at = cg.getClassHierarchy().lookupClass(TypeReference.findOrCreate(ClassLoaderReference.Application, ma.annotationTypeName));\n annot: for (CGNode n : cg) {\n if (n.getMethod().getSignature().equals(ma.methodSig)) {\n for (Annotation a : n.getMethod().getAnnotations()) {\n if (a.getType().equals(at.getReference())) {\n continue annot;\n }\n }\n Assert.assertFalse(\"String_Node_Str\" + at, false);\n }\n }\n }\n}\n"
|
"public void serialize() {\n File dir = new File(APP.DIR_LAYOUTS, \"String_Node_Str\");\n if (!Util.isValidatedDirectory(dir)) {\n LOGGER.error(\"String_Node_Str\", dir);\n return;\n }\n Set<File> filesOld = listFiles(dir).collect(toSet());\n List<Window> windows = stream(Window.WINDOWS).without(miniWindow).toList();\n LOGGER.info(\"String_Node_Str\" + windows.size() + \"String_Node_Str\");\n String sessionUniqueName = System.currentTimeMillis() + \"String_Node_Str\";\n boolean isError = false;\n Set<File> filesNew = new HashSet<>();\n for (int i = 0; i < windows.size(); i++) {\n Window w = windows.get(i);\n File f = new File(dir, \"String_Node_Str\" + sessionUniqueName + \"String_Node_Str\" + i + \"String_Node_Str\");\n filesNew.add(f);\n isError |= App.APP.serializators.toXML(new WindowState(w), f).ifError(e -> LOGGER.error(\"String_Node_Str\", e)).isError();\n if (isError)\n break;\n }\n (isError ? filesNew : filesOld).forEach(File::delete);\n}\n"
|
"public void testCancellationAwareTask2() {\n Callable task1 = new SleepingTask(5000);\n ExecutorService executor = createSingleNodeExecutorService(\"String_Node_Str\", 1);\n executor.submit(task1);\n Callable task2 = new BasicTestTask();\n Future future = executor.submit(task2);\n assertFalse(future.isDone());\n assertTrue(future.cancel(true));\n assertTrue(future.isCancelled());\n assertTrue(future.isDone());\n try {\n future.get();\n fail(\"String_Node_Str\");\n } catch (CancellationException expected) {\n } catch (Exception e) {\n fail(\"String_Node_Str\" + e);\n }\n}\n"
|
"public IStatus runInUIThread(IProgressMonitor monitor) {\n try {\n if (!getViewer().getTree().isDisposed()) {\n getViewer().setExpandedElements(m_expandedElements);\n }\n } catch (SWTException e) {\n }\n return new Status(Status.OK, Plugin.PLUGIN_ID, StringConstants.EMPTY);\n}\n"
|
"protected void configure() {\n bind(AddressService.class).to(AddressServiceImpl.class);\n bind(AdvancedExportService.class).to(AdvancedExportServiceImpl.class);\n bind(UserService.class).to(UserServiceImpl.class);\n bind(MessageServiceImpl.class).to(MessageServiceBaseImpl.class);\n bind(MailAccountServiceImpl.class).to(MailAccountServiceBaseImpl.class);\n bind(AccountManagementService.class).to(AccountManagementServiceImpl.class);\n bind(FiscalPositionService.class).to(FiscalPositionServiceImpl.class);\n bind(ProductService.class).to(ProductServiceImpl.class);\n bind(TemplateService.class).to(TemplateBaseService.class);\n bind(TemplateMessageServiceImpl.class).to(TemplateMessageServiceBaseImpl.class);\n bind(PartnerRepository.class).to(PartnerBaseRepository.class);\n bind(DurationRepository.class).to(DurationBaseRepository.class);\n bind(DurationService.class).to(DurationServiceImpl.class);\n bind(AppBaseService.class).to(AppBaseServiceImpl.class);\n bind(SequenceRepository.class).to(SequenceBaseRepository.class);\n bind(ProductRepository.class).to(ProductBaseRepository.class);\n bind(WeeklyPlanningService.class).to(WeeklyPlanningServiceImp.class);\n bind(MailServiceMessageImpl.class).to(MailServiceBaseImpl.class);\n bind(AddressRepository.class).to(AddressBaseRepository.class);\n bind(YearRepository.class).to(YearBaseRepository.class);\n bind(AppServiceImpl.class).to(AppBaseServiceImpl.class);\n bind(AppService.class).to(AppServiceImpl.class);\n bind(BankService.class).to(BankServiceImpl.class);\n bind(BankRepository.class).to(BankBaseRepository.class);\n bind(CompanyService.class).to(CompanyServiceImpl.class);\n bind(BankAddressRepository.class).to(BankAddressBaseRepository.class);\n bind(UserRepository.class).to(UserBaseRepository.class);\n bind(BankDetailsService.class).to(BankDetailsServiceImpl.class);\n bind(ImportCityService.class).to(ImportCityServiceImpl.class);\n bind(BaseBatchRepository.class).to(BaseBatchBaseRepository.class);\n bind(MailBatchRepository.class).to(MailBatchBaseRepository.class);\n bind(AlarmEngineBatchRepository.class).to(AlarmEngineBatchBaseRepository.class);\n bind(TradingNameService.class).to(TradingNameServiceImpl.class);\n bind(PartnerPriceListService.class).to(PartnerPriceListServiceImpl.class);\n bind(ICalendarEventService.class).to(ICalendarEventServiceImpl.class);\n bind(ICalendarEventRepository.class).to(ICalendarEventManagementRepository.class);\n bind(ProductMultipleQtyService.class).to(ProductMultipleQtyServiceImpl.class);\n PartnerAddressRepository.modelPartnerFieldMap.put(PartnerAddress.class.getName(), \"String_Node_Str\");\n}\n"
|
"public void testUpdateBatch() {\n List<TestEntity> entities = new ArrayList<TestEntity>();\n TestEntity entity1 = createEntity();\n TestEntity entity2 = createEntity();\n entities.add(entity1);\n entities.add(entity2);\n IShardingKey<Number> key = new ShardingKey<Number>(CLUSTER_KLSTORAGE, 1000001);\n Number[] pks = cacheClient.saveBatch(entities, key);\n List<TestEntity> before = cacheClient.findByPks(key, TestEntity.class, pks);\n for (TestEntity entity : before) {\n entity.setTestDate(new Date());\n }\n cacheClient.updateBatch(before, key);\n List<TestEntity> after = cacheClient.findByPks(key, TestEntity.class, pks);\n for (int i = 0; i < after.size(); i++) {\n Assert.assertEquals(before.get(i), after.get(i));\n }\n cacheClient.removeByPks(key, TestEntity.class, pks);\n List<TestEntity> entitiesFromDB = cacheClient.findByPks(key, TestEntity.class, pks);\n Assert.assertTrue(entitiesFromDB.isEmpty());\n}\n"
|
"private static CheckException newServiceCheckException(String correlationId, Severity severity, ServiceConfiguration config, Throwable t) {\n if (t instanceof Error) {\n return new CheckException(correlationId, t, Severity.FATAL, config);\n } else if (Severity.WARNING.ordinal() > severity.ordinal() && t instanceof RuntimeException) {\n return new CheckException(correlationId, t, Severity.WARNING, config);\n } else if (t instanceof CheckException) {\n return new CheckException(correlationId, t, severity, config);\n } else {\n return new CheckException(correlationId, t, severity, config);\n }\n}\n"
|
"private void processTasks() {\n Log.i(TAG, \"String_Node_Str\");\n TaskController taskController = new TaskController();\n QueueRecordProvider queueProv = QueueRecordProvider.get(getApplicationContext());\n QueueRecordProcessor queueProc = new QueueRecordProcessor();\n ArrayList<QueueRecord> queueRecords = queueProv.getAllQueueRecords();\n Log.i(TAG, \"String_Node_Str\" + queueRecords.size());\n if (queueRecords.size() > 0) {\n Collections.sort(queueRecords);\n for (QueueRecord q : queueRecords) {\n try {\n Log.i(TAG, \"String_Node_Str\" + q.getTask() + \"String_Node_Str\" + q.getAttempts());\n int attempts = q.getAttempts();\n String task = q.getTask();\n if (attempts > MAXIMUM_ATTEMPTS) {\n Log.d(TAG, \"String_Node_Str\" + task + \"String_Node_Str\" + attempts + \"String_Node_Str\");\n if (task.equals(TASK_SEND_MESSAGE)) {\n MessageProvider msgProv = MessageProvider.get(getApplicationContext());\n Message messageToSend = msgProv.searchForSingleRecord(q.getObject0Id());\n MessageStatusHandler.updateMessageStatus(messageToSend, getApplicationContext().getString(R.string.message_status_sending_failed));\n }\n queueProc.deleteQueueRecord(q);\n continue;\n } else if (task.equals(TASK_SEND_MESSAGE)) {\n try {\n MessageProvider msgProv = MessageProvider.get(getApplicationContext());\n Message messageToSend = msgProv.searchForSingleRecord(q.getObject0Id());\n if (checkForEarlierSendMsgQueueRecords(q)) {\n continue;\n }\n long currentTime = System.currentTimeMillis() / 1000;\n if (q.getTriggerTime() > currentTime) {\n Log.i(TAG, \"String_Node_Str\" + q.getTask() + \"String_Node_Str\" + \"String_Node_Str\" + TimeUtils.getTimeMessage(q.getTriggerTime() - currentTime));\n continue;\n }\n if (q.getRecordCount() == 0) {\n taskController.sendMessage(q, messageToSend, DO_POW, FIRST_ATTEMPT_TTL, FIRST_ATTEMPT_TTL);\n } else {\n currentTime = System.currentTimeMillis() / 1000;\n queueProc.createAndSaveQueueRecord(TASK_SEND_MESSAGE, currentTime + SUBSEQUENT_ATTEMPTS_TTL, q.getRecordCount() + 1, messageToSend, null, null);\n taskController.sendMessage(q, messageToSend, DO_POW, SUBSEQUENT_ATTEMPTS_TTL, SUBSEQUENT_ATTEMPTS_TTL);\n }\n } catch (RuntimeException e) {\n Log.i(TAG, \"String_Node_Str\" + TASK_SEND_MESSAGE + \"String_Node_Str\" + \"String_Node_Str\");\n queueProv.deleteQueueRecord(q);\n continue;\n }\n } else if (task.equals(TASK_PROCESS_OUTGOING_MESSAGE)) {\n Message messageToSend = null;\n try {\n MessageProvider msgProv = MessageProvider.get(getApplicationContext());\n messageToSend = msgProv.searchForSingleRecord(q.getObject0Id());\n } catch (RuntimeException e) {\n Log.i(TAG, \"String_Node_Str\" + TASK_PROCESS_OUTGOING_MESSAGE + \"String_Node_Str\" + \"String_Node_Str\");\n queueProv.deleteQueueRecord(q);\n continue;\n }\n PubkeyProvider pubProv = PubkeyProvider.get(App.getContext());\n Pubkey toPubkey = pubProv.searchForSingleRecord(q.getObject1Id());\n if (q.getRecordCount() == 0) {\n taskController.processOutgoingMessage(q, messageToSend, toPubkey, DO_POW, FIRST_ATTEMPT_TTL);\n } else {\n taskController.processOutgoingMessage(q, messageToSend, toPubkey, DO_POW, SUBSEQUENT_ATTEMPTS_TTL);\n }\n } else if (task.equals(TASK_DISSEMINATE_MESSAGE)) {\n PayloadProvider payProv = PayloadProvider.get(getApplicationContext());\n Payload msgPayload = payProv.searchForSingleRecord(q.getObject1Id());\n boolean msgValid = new ObjectProcessor().validateObject(msgPayload.getPayload());\n if (msgValid == false) {\n Log.d(TAG, \"String_Node_Str\" + \"String_Node_Str\");\n payProv.deletePayload(msgPayload);\n queueProv.deleteQueueRecord(q);\n MessageProvider msgProv = MessageProvider.get(getApplicationContext());\n Message messageToSend = msgProv.searchForSingleRecord(q.getObject0Id());\n PubkeyProvider pubProv = PubkeyProvider.get(App.getContext());\n Pubkey toPubkey = pubProv.searchForSingleRecord(q.getObject2Id());\n queueProc.createAndSaveQueueRecord(BackgroundService.TASK_PROCESS_OUTGOING_MESSAGE, 0, q.getRecordCount(), messageToSend, toPubkey, null);\n continue;\n }\n if (NetworkHelper.checkInternetAvailability() == true) {\n PubkeyProvider pubProv = PubkeyProvider.get(App.getContext());\n Pubkey toPubkey = pubProv.searchForSingleRecord(q.getObject2Id());\n taskController.disseminateMessage(q, msgPayload, toPubkey, DO_POW);\n } else {\n MessageProvider messageProv = MessageProvider.get(getApplicationContext());\n Message messageToSend = messageProv.searchForSingleRecord(q.getObject0Id());\n MessageStatusHandler.updateMessageStatus(messageToSend, getApplicationContext().getString(R.string.message_status_waiting_for_connection));\n }\n } else if (task.equals(TASK_CREATE_IDENTITY)) {\n taskController.createIdentity(q, DO_POW);\n } else if (task.equals(TASK_DISSEMINATE_PUBKEY)) {\n PayloadProvider payProv = PayloadProvider.get(getApplicationContext());\n Payload pubkeyPayload = payProv.searchForSingleRecord(q.getObject0Id());\n boolean pubkeyValid = new ObjectProcessor().validateObject(pubkeyPayload.getPayload());\n if (pubkeyValid) {\n if (NetworkHelper.checkInternetAvailability() == true) {\n taskController.disseminatePubkey(q, pubkeyPayload, DO_POW);\n }\n } else {\n Log.d(TAG, \"String_Node_Str\" + \"String_Node_Str\");\n queueProv.deleteQueueRecord(q);\n AddressProvider addProv = AddressProvider.get(getApplicationContext());\n Address address = addProv.searchForSingleRecord(pubkeyPayload.getRelatedAddressId());\n queueProc.createAndSaveQueueRecord(TASK_CREATE_IDENTITY, 0, q.getRecordCount(), address, null, null);\n }\n } else {\n Log.e(TAG, \"String_Node_Str\" + \"String_Node_Str\" + task);\n }\n } catch (Exception e) {\n Log.e(TAG, \"String_Node_Str\" + e.getMessage());\n queueProv.deleteQueueRecord(q);\n }\n }\n runPeriodicTasks();\n } else {\n runPeriodicTasks();\n if (checkIfDatabaseCleaningIsRequired()) {\n Intent intent = new Intent(getBaseContext(), DatabaseCleaningService.class);\n intent.putExtra(DatabaseCleaningService.EXTRA_RUN_DATABASE_CLEANING_ROUTINE, true);\n startService(intent);\n }\n }\n}\n"
|
"static Object throwClassCastExceptionUnlessNull(Object o) throws ClassCastException {\n if (o != null) {\n throw new ClassCastException();\n }\n return o;\n}\n"
|
"public boolean performOk() {\n for (int i = 0; i < propList.size(); i++) {\n try {\n String value = null;\n Text propertyText = (Text) propertyTextList.get(i);\n if (!propertyText.isDisposed() && propertyText.getText() != null && propertyText.getText().trim().length() > 0) {\n value = propertyText.getText().trim();\n }\n Expression expr = new Expression(value, (String) propertyText.getData(DataUIConstants.EXPR_TYPE));\n if (ds instanceof DesignElementHandle) {\n ((DesignElementHandle) ds).setPropertyBinding((String) bindingName.get(i), expr);\n }\n } catch (Exception e) {\n logger.log(Level.FINE, e.getMessage(), e);\n ExceptionHandler.handle(e);\n return true;\n }\n }\n return super.performOk();\n}\n"
|
"private boolean containInvalidCharacter(String password) {\n if (password.contains(Constants.NEW_LINE)) {\n return true;\n }\n return true;\n}\n"
|
"public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n Tools.HangarLog(\"String_Node_Str\" + this.getClass().getCanonicalName() + \"String_Node_Str\");\n mContext = context;\n Intent intent = new Intent(context, WatchfulService.class);\n context.startService(intent);\n}\n"
|
"public AppTimesheet getAppTimesheet() {\n return appTimesheetRepo.all().fetchOne();\n}\n"
|
"public void restoreFromBundle(Bundle bundle) {\n super.restoreFromBundle(bundle);\n int[] values = bundle.getIntArray(PRESSES);\n for (int value : values) presses.add(value);\n partialTime = bundle.getFloat(PARTIALTIME);\n}\n"
|
"protected void internalSwap(final int row1, final int row2) {\n checkRow(row1, data.getNumRows());\n checkRow(row2, data.getNumRows());\n data.swap(row1, row2);\n if (dataGeneralized != null)\n dataGeneralized.swap(row1, row2);\n if (dataAnalyzed != null)\n dataAnalyzed.swap(row1, row2);\n}\n"
|
"public int hashCode() {\n final int prime = 31;\n int result = 1;\n result = prime * result + (apiKey == null ? 0 : apiKey.hashCode());\n result = prime * result + (http404Strategy == null ? 0 : http404Strategy.hashCode());\n result = prime * result + (http429Strategy == null ? 0 : http429Strategy.hashCode());\n result = prime * result + (http500Strategy == null ? 0 : http500Strategy.hashCode());\n result = prime * result + (http503Strategy == null ? 0 : http503Strategy.hashCode());\n result = prime * result + (httpTimeoutStrategy == null ? 0 : httpTimeoutStrategy.hashCode());\n long temp;\n temp = Double.doubleToLongBits(limitingShare);\n result = prime * result + (int) (temp ^ temp >>> 32);\n result = prime * result + (limitingType == null ? 0 : limitingType.hashCode());\n result = prime * result + (rateLimiterTimeoutStrategy == null ? 0 : rateLimiterTimeoutStrategy.hashCode());\n result = prime * result + (requests == null ? 0 : requests.hashCode());\n result = prime * result + (services == null ? 0 : services.hashCode());\n return result;\n}\n"
|
"public static ItemStack addToOccupiedInventorySlot(IInventory inventory, int slot, ItemStack stack, ItemStack existingStack) {\n int stackLimit = Math.min(inventory.getInventoryStackLimit(), stack.getMaxStackSize());\n if (stack.stackSize + existingStack.stackSize > stackLimit && stackLimit > existingStack.stackSize) {\n int stackDiff = stackLimit - existingStack.stackSize;\n existingStack.stackSize = stackLimit;\n stack.stackSize -= stackDiff;\n inventory.setInventorySlotContents(slot, existingStack);\n return stack;\n }\n existingStack.stackSize += Math.min(stack.stackSize, stackLimit);\n inventory.setInventorySlotContents(slot, existingStack);\n return stackLimit >= stack.stackSize ? null : stack.splitStack(stack.stackSize - stackLimit);\n}\n"
|
"public ArrayContainer and(ArrayContainer value2) {\n ArrayContainer value1 = this;\n final int desiredcapacity = Math.min(value1.getCardinality(), value2.getCardinality());\n ArrayContainer answer = ContainerFactory.getArrayContainer();\n if (answer.content.length < desiredcapacity)\n answer.content = new short[desiredcapacity];\n answer.cardinality = Util.unsigned_intersect2by2(value1.content, value1.getCardinality(), value2.content, value2.getCardinality(), answer.content);\n return answer;\n}\n"
|
"public void openFile(String filePath) {\n try {\n if (filePath.endsWith(\"String_Node_Str\")) {\n AjdeUIManager.getDefault().getBuildConfigEditor().openFile(filePath);\n topFrame.setEditorPanel(AjdeUIManager.getDefault().getBuildConfigEditor());\n } else if (FileUtil.hasSourceSuffix(filePath)) {\n editorManager.showSourceLine(filePath, 0, false);\n } else {\n Ajde.getDefault().getErrorHandler().handleError(\"String_Node_Str\" + filePath + \"String_Node_Str\");\n }\n } catch (IOException ioe) {\n Ajde.getDefault().getErrorHandler().handleError(\"String_Node_Str\" + filePath, ioe);\n } catch (InvalidResourceException ire) {\n Ajde.getDefault().getErrorHandler().handleError(\"String_Node_Str\" + filePath, ire);\n }\n browserProjectProperties.setLastOpenSourceFilePath(filePath);\n}\n"
|
"private void maskBitmap(Bitmap bitmap, float xRatio, float yRatio, float widthRatio, float heightRatio) {\n Canvas canvas = new Canvas(bitmap);\n Paint blackFill = new Paint();\n blackFill.setColor(Color.BLACK);\n blackFill.setStyle(Paint.Style.FILL);\n float left = bitmap.getWidth() * xRatio;\n float top = bitmap.getHeight() * yRatio;\n float right = bitmap.getWidth() * (xRatio + widthRatio);\n float bottom = bitmap.getWidth() * (yRatio + heightRatio);\n canvas.drawRect(left, top, right, bottom, blackFill);\n}\n"
|
"protected Resource getPathResource(String absolutePath) {\n Resource res = registedResourceMap.get(absolutePath);\n if (res != null) {\n return res;\n }\n EMFUtil util = new EMFUtil();\n URI uri = URI.createFileURI(absolutePath);\n ResourceSet rs = EMFUtil.getInstance().getResourceSet();\n Resource resource = rs.getResource(uri, true);\n this.registedResourceMap.put(absolutePath, resource);\n return resource;\n}\n"
|
"private void convertFile(String traceFileName, String javaClassName, String script) throws IOException {\n LineNumberReader reader = new LineNumberReader(IOUtils.getBufferedReader(IOUtils.openFileInputStream(traceFileName)));\n PrintWriter javaWriter = new PrintWriter(IOUtils.getBufferedWriter(IOUtils.openFileOutputStream(javaClassName + \"String_Node_Str\", false)));\n PrintWriter scriptWriter = new PrintWriter(IOUtils.getBufferedWriter(IOUtils.openFileOutputStream(script, false)));\n javaWriter.println(\"String_Node_Str\");\n javaWriter.println(\"String_Node_Str\");\n javaWriter.println(\"String_Node_Str\");\n javaWriter.println(\"String_Node_Str\");\n String cn = javaClassName.replace('\\\\', '/');\n int idx = cn.lastIndexOf('/');\n if (idx > 0) {\n cn = cn.substring(idx + 1);\n }\n javaWriter.println(\"String_Node_Str\" + cn + \"String_Node_Str\");\n javaWriter.println(\"String_Node_Str\");\n javaWriter.println(\"String_Node_Str\");\n while (true) {\n String line = reader.readLine();\n if (line == null) {\n break;\n }\n if (line.startsWith(\"String_Node_Str\")) {\n line = \"String_Node_Str\" + line.substring(4);\n javaWriter.println(line);\n } else if (line.startsWith(\"String_Node_Str\")) {\n int end = line.indexOf(\"String_Node_Str\");\n String sql = line.substring(end + \"String_Node_Str\".length());\n sql = StringUtils.javaDecode(sql);\n line = line.substring(\"String_Node_Str\".length(), end);\n if (line.length() > 0) {\n String statement = sql;\n int count = 0;\n int time = 0;\n line = line.trim();\n if (line.length() > 0) {\n StringTokenizer tk = new StringTokenizer(line, \"String_Node_Str\");\n while (tk.hasMoreElements()) {\n String token = tk.nextToken();\n if (\"String_Node_Str\".equals(token)) {\n int len = Integer.parseInt(tk.nextToken());\n statement = sql.substring(0, len) + \"String_Node_Str\";\n } else if (\"String_Node_Str\".equals(token)) {\n count = Integer.parseInt(tk.nextToken());\n } else if (\"String_Node_Str\".equals(token)) {\n time = Integer.parseInt(tk.nextToken());\n }\n }\n }\n addToStats(statement, count, time);\n }\n scriptWriter.println(sql);\n }\n }\n javaWriter.println(\"String_Node_Str\");\n javaWriter.println('}');\n reader.close();\n javaWriter.close();\n if (stats.size() > 0) {\n scriptWriter.println(\"String_Node_Str\");\n scriptWriter.println(\"String_Node_Str\");\n scriptWriter.println(\"String_Node_Str\");\n scriptWriter.println(\"String_Node_Str\");\n scriptWriter.println(\"String_Node_Str\");\n scriptWriter.println(\"String_Node_Str\");\n scriptWriter.println(\"String_Node_Str\");\n int accumTime = 0;\n ArrayList<Stat> list = New.arrayList(stats.values());\n Collections.sort(list);\n if (timeTotal == 0) {\n timeTotal = 1;\n }\n for (Stat stat : list) {\n accumTime += stat.time;\n StringBuilder buff = new StringBuilder(100);\n buff.append(\"String_Node_Str\").append(padNumberLeft(100 * stat.time / timeTotal, 3)).append(\"String_Node_Str\").append(padNumberLeft(100 * accumTime / timeTotal, 3)).append('%').append(padNumberLeft(stat.time, 8)).append(padNumberLeft(stat.executeCount, 8)).append(padNumberLeft(stat.resultCount, 8)).append(' ').append(removeNewlines(stat.sql));\n scriptWriter.println(buff.toString());\n }\n }\n scriptWriter.close();\n}\n"
|
"public org.hl7.fhir.dstu2.model.Contract convertContract(org.hl7.fhir.dstu3.model.Contract src) throws FHIRException {\n if (src == null || src.isEmpty())\n return null;\n org.hl7.fhir.dstu2.model.Contract tgt = new org.hl7.fhir.dstu2.model.Contract();\n copyDomainResource(src, tgt);\n tgt.setIdentifier(convertIdentifier(src.getIdentifier()));\n tgt.setIssued(src.getIssued());\n tgt.setApplies(convertPeriod(src.getApplies()));\n for (org.hl7.fhir.dstu3.model.Reference t : src.getSubject()) tgt.addSubject(convertReference(t));\n for (org.hl7.fhir.dstu3.model.Reference t : src.getAuthority()) tgt.addAuthority(convertReference(t));\n for (org.hl7.fhir.dstu3.model.Reference t : src.getDomain()) tgt.addDomain(convertReference(t));\n tgt.setType(convertCodeableConcept(src.getType()));\n for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getSubType()) tgt.addSubType(convertCodeableConcept(t));\n for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getAction()) tgt.addAction(convertCodeableConcept(t));\n for (org.hl7.fhir.dstu3.model.CodeableConcept t : src.getActionReason()) tgt.addActionReason(convertCodeableConcept(t));\n for (org.hl7.fhir.dstu3.model.Contract.AgentComponent t : src.getAgent()) tgt.addActor(convertAgentComponent(t));\n for (org.hl7.fhir.dstu3.model.Contract.SignatoryComponent t : src.getSigner()) tgt.addSigner(convertSignatoryComponent(t));\n for (org.hl7.fhir.dstu3.model.Contract.ValuedItemComponent t : src.getValuedItem()) tgt.addValuedItem(convertValuedItemComponent(t));\n for (org.hl7.fhir.dstu3.model.Contract.TermComponent t : src.getTerm()) tgt.addTerm(convertTermComponent(t));\n tgt.setBinding(convertType(src.getBinding()));\n for (org.hl7.fhir.dstu3.model.Contract.FriendlyLanguageComponent t : src.getFriendly()) tgt.addFriendly(convertFriendlyLanguageComponent(t));\n for (org.hl7.fhir.dstu3.model.Contract.LegalLanguageComponent t : src.getLegal()) tgt.addLegal(convertLegalLanguageComponent(t));\n for (org.hl7.fhir.dstu3.model.Contract.ComputableLanguageComponent t : src.getRule()) tgt.addRule(convertComputableLanguageComponent(t));\n return tgt;\n}\n"
|
"public Path executePlugin(Path uriPath, String fileFormat) throws UnsupportedOperationException, IOException, CommandException {\n try {\n return GhostScriptConvertPluginUtils.executeGS(inputPath, outputPath, commandArguments);\n } catch (GhostscriptException e) {\n return null;\n }\n}\n"
|
"public Snip storageLoad(String name) {\n if (cache.containsKey(name.toUpperCase())) {\n return (Snip) cache.get(name.toUpperCase());\n }\n Application app = Application.get();\n long start = app.start();\n Snip snip = null;\n PreparedStatement statement = null;\n ResultSet result = null;\n Connection connection = ConnectionManager.getConnection();\n try {\n statement = connection.prepareStatement(\"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\" + \"String_Node_Str\");\n statement.setString(1, name.toUpperCase());\n result = statement.executeQuery();\n if (result.next()) {\n snip = createSnip(result);\n }\n } catch (SQLException e) {\n SQLLogger.warn(\"String_Node_Str\" + name, e);\n } finally {\n ConnectionManager.close(result);\n ConnectionManager.close(statement);\n ConnectionManager.close(connection);\n }\n app.stop(start, \"String_Node_Str\" + name);\n return snip;\n}\n"
|
"private Preset formatPreset(String title) {\n List<ProcessorPreset> processorPresets = new ArrayList<ProcessorPreset>();\n for (int i = 0; i < processorsListModel.getRowCount(); i++) {\n processorPresets.add(((ProcessorPreset) processorsListModel.getValueAt(i, 1)).clone());\n }\n return new Preset(title, processorPresets);\n}\n"
|
"private void setDAGParamsFromMRConf(DAG dag) {\n Configuration mrConf = this.conf;\n Map<String, String> mrParamToDAGParamMap = DeprecatedKeys.getMRToDAGParamMap();\n for (Entry<String, String> entry : mrParamToDAGParamMap.entrySet()) {\n if (mrConf.get(entry.getKey()) != null) {\n LOG.info(\"String_Node_Str\" + entry.getValue());\n dag.addConfiguration(entry.getValue(), mrConf.get(entry.getKey()));\n }\n }\n}\n"
|
"protected RemoteCustomFieldValue[] getRemoteCustomFieldValues(Map<String, List<String>> customFields) {\n if (customFields == null) {\n return EMPTY_REMOTE_CUSTOM_FIELDS;\n }\n RemoteCustomFieldValue[] result = new RemoteCustomFieldValue[customFields.size()];\n int i = 0;\n for (Entry<String, List<String>> entry : customFields.entrySet()) {\n String customeFieldId = entry.getKey();\n List<String> fieldValues = entry.getValue();\n if (fieldValues != null) {\n result[i++] = new RemoteCustomFieldValue(customeFieldId, EMPTY_PARENT_KEY, (String[]) fieldValues.toArray());\n } else {\n result[i++] = new RemoteCustomFieldValue(customeFieldId, EMPTY_PARENT_KEY, new String[0]);\n }\n }\n return result;\n}\n"
|
"public boolean executeProcess(String cmd, String tempPath) {\n try {\n log.debug(cmd);\n if (PlaybackUtil.isWindows() == false) {\n File f = new File(tempPath + \"String_Node_Str\" + Math.random() * 10000 + \"String_Node_Str\");\n FileWriter fw = new FileWriter(f);\n fw.write(\"String_Node_Str\");\n fw.write(cmd + \"String_Node_Str\");\n fw.close();\n cmd = f.getAbsolutePath();\n MakeExectuable.getInstance().setExecutable(cmd);\n }\n Runtime rt = Runtime.getRuntime();\n Process proc = rt.exec(cmd);\n StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), \"String_Node_Str\");\n StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), \"String_Node_Str\");\n errorGobbler.start();\n outputGobbler.start();\n int exitVal = proc.waitFor();\n if (exitVal == 0) {\n return true;\n }\n } catch (Exception t) {\n t.printStackTrace();\n }\n return false;\n}\n"
|
"private static ImageIcon[] loadIcons(String name) {\n ImageIcon icon = loadIcon(\"String_Node_Str\" + name + \"String_Node_Str\");\n return new ImageIcon[] { icon, icon, icon };\n}\n"
|
"protected void onCommandSuccess(ListResult<IterationChange> result) {\n if (result != null) {\n for (IterationChange iterationChange : result.getList()) {\n if (iterationChange.isDeleted()) {\n Iterator<ValueEvent> valuesIterator = valueChanges.iterator();\n while (valuesIterator.hasNext()) {\n ValueEvent valueEvent = valuesIterator.next();\n Integer iterationId = valueEvent.getIterationId();\n if (iterationId != null && iterationId == iterationChange.getIterationId()) {\n valuesIterator.remove();\n }\n }\n } else if (iterationChange.isCreated()) {\n int oldId = iterationChange.getIterationId();\n int newId = iterationChange.getNewIterationId();\n newIterationsTabItems.get(oldId).setIterationId(newId);\n for (ValueEvent valueEvent : valueChanges) {\n if (valueEvent.getIterationId() == oldId) {\n valueEvent.setIterationId(newId);\n }\n }\n }\n }\n iterationChanges.clear();\n newIterationsTabItems.clear();\n updateContactValues(contactDTO, callback, target);\n } else {\n N10N.infoNotif(I18N.CONSTANTS.infoConfirmation(), I18N.CONSTANTS.saveConfirm());\n }\n}\n"
|
"private List<TimedEvent> _getNextEventsToFire() throws IllegalActionException {\n List<TimedEvent> events = new LinkedList<TimedEvent>();\n for (Actor actor : _eventQueues.keySet()) {\n TreeSet<Time> set = _eventQueues.get(actor);\n if (!set.isEmpty()) {\n Time time = set.first();\n _currentModelTime = time;\n if (actor.prefire())\n events.add(new TimedEvent(time, actor));\n _currentModelTime = null;\n }\n if (!_eventsInExecution.contains(actor)) {\n List<IOPort> inputPorts = actor.inputPortList();\n for (IOPort port : inputPorts) {\n if (PtidesActorProperties.portIsTriggerPort(port)) {\n Receiver[][] receivers = port.getReceivers();\n for (int i = 0; i < receivers.length; i++) {\n Receiver[] recv = receivers[i];\n for (int j = 0; j < recv.length; j++) {\n PtidesActorReceiver receiver = (PtidesActorReceiver) recv[j];\n Time time = receiver.getNextTime();\n if (time != null && (isSafeToProcessStatically(time, port) || _isSafeToProcess(port, new ArrayList(), new Time(this, 0.0), time))) {\n List<TimedEvent> toRemove = new ArrayList<TimedEvent>();\n for (int k = 0; k < events.size(); k++) {\n TimedEvent event = events.get(k);\n if (event.contents == actor && event.timeStamp.equals(time))\n toRemove.add(event);\n }\n for (int k = 0; k < toRemove.size(); k++) events.remove(toRemove.get(k));\n events.add(new TimedEvent(time, port));\n }\n }\n }\n }\n }\n }\n }\n return events;\n}\n"
|
"public Type getKeyType() {\n return keyType;\n}\n"
|
"public void test(final String[] args) {\n final String config = args == null || args.length == 0 ? \"String_Node_Str\" : args[0];\n final LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(), config);\n final Logger logger = LogManager.getLogger(ConsoleAppenderJAnsiXExceptionMain.class);\n try {\n Files.getFileStore(Paths.get(\"String_Node_Str\"));\n } catch (Exception e) {\n logger.info(\"String_Node_Str\", e);\n } finally {\n Configurator.shutdown(ctx);\n }\n}\n"
|
"protected void backPressed() {\n Form form = getForm();\n if (form != null && form.isCallAfterFormBack()) {\n try {\n compService.afterFormBack(form.getName(), form.getComponentProperties());\n } catch (Throwable e) {\n ExceptionHandler.process(e);\n }\n }\n super.backPressed();\n}\n"
|
"public void pickSuggestionManually(final int index, final CharSequence suggestion, final int x, final int y) {\n final SuggestedWords suggestedWords = mSuggestionStripView.getSuggestions();\n if (suggestion.length() == 1 && isShowingPunctuationList()) {\n LatinImeLogger.logOnManualSuggestion(\"String_Node_Str\", suggestion.toString(), index, suggestedWords);\n if (ProductionFlag.IS_EXPERIMENTAL) {\n ResearchLogger.latinIME_punctuationSuggestion(index, suggestion, x, y);\n }\n final int primaryCode = suggestion.charAt(0);\n onCodeInput(primaryCode, KeyboardActionListener.SUGGESTION_STRIP_COORDINATE, KeyboardActionListener.SUGGESTION_STRIP_COORDINATE);\n return;\n }\n mConnection.beginBatchEdit();\n if (SPACE_STATE_PHANTOM == mSpaceState && suggestion.length() > 0 && !mWordComposer.isBatchMode()) {\n int firstChar = Character.codePointAt(suggestion, 0);\n if ((!mCurrentSettings.isWeakSpaceStripper(firstChar)) && (!mCurrentSettings.isWeakSpaceSwapper(firstChar))) {\n sendKeyCodePoint(Keyboard.CODE_SPACE);\n }\n }\n if (mCurrentSettings.isApplicationSpecifiedCompletionsOn() && mApplicationSpecifiedCompletions != null && index >= 0 && index < mApplicationSpecifiedCompletions.length) {\n if (mSuggestionStripView != null) {\n mSuggestionStripView.clear();\n }\n mKeyboardSwitcher.updateShiftState();\n resetComposingState(true);\n final CompletionInfo completionInfo = mApplicationSpecifiedCompletions[index];\n mConnection.commitCompletion(completionInfo);\n mConnection.endBatchEdit();\n if (ProductionFlag.IS_EXPERIMENTAL) {\n ResearchLogger.latinIME_pickApplicationSpecifiedCompletion(index, completionInfo.getText(), x, y);\n }\n return;\n }\n final String replacedWord = mWordComposer.getTypedWord().toString();\n LatinImeLogger.logOnManualSuggestion(replacedWord, suggestion.toString(), index, suggestedWords);\n if (ProductionFlag.IS_EXPERIMENTAL) {\n ResearchLogger.latinIME_pickSuggestionManually(replacedWord, index, suggestion, x, y);\n }\n mExpectingUpdateSelection = true;\n commitChosenWord(suggestion, LastComposedWord.COMMIT_TYPE_MANUAL_PICK, LastComposedWord.NOT_A_SEPARATOR);\n mConnection.endBatchEdit();\n mLastComposedWord.deactivate();\n mSpaceState = SPACE_STATE_PHANTOM;\n mKeyboardSwitcher.updateShiftState();\n final boolean showingAddToDictionaryHint = index == 0 && mSuggest != null && !AutoCorrection.isValidWord(mSuggest.getUnigramDictionaries(), suggestion, true);\n Utils.Stats.onSeparator((char) Keyboard.CODE_SPACE, WordComposer.NOT_A_COORDINATE, WordComposer.NOT_A_COORDINATE);\n if (showingAddToDictionaryHint && mIsUserDictionaryAvailable) {\n mSuggestionStripView.showAddToDictionaryHint(suggestion, mCurrentSettings.mHintToSaveText);\n } else {\n mHandler.postUpdateSuggestionStrip();\n }\n}\n"
|
"public void handleRequest(HttpServerExchange exchange, RequestContext context) throws Exception {\n DBObject content = context.getContent();\n if (content == null)\n content = new BasicDBObject();\n if (content instanceof BasicDBList) {\n ResponseHelper.endExchangeWithMessage(exchange, HttpStatus.SC_NOT_ACCEPTABLE, \"String_Node_Str\");\n return;\n }\n ObjectId etag = RequestHelper.getUpdateEtag(exchange);\n int SC = DocumentDAO.upsertDocumentPost(exchange, context.getDBName(), context.getCollectionName(), content, etag);\n if (context.getWarnings() != null && !context.getWarnings().isEmpty()) {\n DocumentRepresentationFactory.sendDocument(exchange.getRequestPath(), exchange, context, new BasicDBObject());\n }\n exchange.endExchange();\n}\n"
|
"public String getSchemaTypeNameForClassName(String className) {\n String typeName = \"String_Node_Str\";\n if (className.indexOf('$') != -1) {\n typeName = Introspector.decapitalize(className.substring(className.lastIndexOf('$') + 1));\n } else {\n typeName = Introspector.decapitalize(className.substring(className.lastIndexOf('.') + 1));\n }\n boolean inBreak = false;\n StringBuffer toReturn = new StringBuffer(typeName.length());\n for (int i = 0; i < typeName.length(); i++) {\n char next = typeName.charAt(i);\n if (Character.isDigit(next)) {\n if (!inBreak) {\n inBreak = true;\n }\n toReturn.append(next);\n } else {\n if (inBreak) {\n toReturn.append(Character.toUpperCase(next));\n } else {\n toReturn.append(next);\n }\n }\n }\n return toReturn.toString();\n}\n"
|
"public int getMinOccurs() {\n return this.minOccurs;\n}\n"
|
"public boolean doInteraction(Object arg) {\n int okCounter = 0;\n Configuration configuration = JDUtilities.getConfiguration();\n String script = configuration.getStringProperty(Configuration.PARAM_HTTPSEND_REQUESTS);\n String user = configuration.getStringProperty(Configuration.PARAM_HTTPSEND_USER);\n String pass = configuration.getStringProperty(Configuration.PARAM_HTTPSEND_PASS);\n String ip = configuration.getStringProperty(Configuration.PARAM_HTTPSEND_IP);\n retries++;\n logger.info(\"String_Node_Str\" + retries);\n ProgressController progress = new ProgressController(JDLocale.L(\"String_Node_Str\", \"String_Node_Str\"), 10);\n progress.setStatusText(JDLocale.L(\"String_Node_Str\", \"String_Node_Str\") + retries);\n if (user != null || pass != null) {\n Authenticator.setDefault(new InternalAuthenticator(user, pass));\n }\n if (script == null) {\n progress.finalize();\n return parseError(\"String_Node_Str\");\n }\n String preIp = JDUtilities.getIPAddress();\n logger.finer(\"String_Node_Str\" + preIp);\n progress.setStatusText(JDLocale.L(\"String_Node_Str\", \"String_Node_Str\") + preIp);\n script = script.replaceAll(\"String_Node_Str\", \"String_Node_Str\");\n script = script.replaceAll(\"String_Node_Str\", \"String_Node_Str\");\n script = script.replaceAll(\"String_Node_Str\", \"String_Node_Str\");\n script = script.replaceAll(\"String_Node_Str\", \"String_Node_Str\");\n script = script.replaceAll(\"String_Node_Str\", \"String_Node_Str\");\n script = script.replaceAll(\"String_Node_Str\", \"String_Node_Str\");\n Document xmlScript;\n variables = new HashMap<String, String>();\n variables.put(\"String_Node_Str\", user);\n variables.put(\"String_Node_Str\", pass);\n variables.put(\"String_Node_Str\", new BASE64Encoder().encode((user + \"String_Node_Str\" + pass).getBytes()));\n variables.put(\"String_Node_Str\", ip);\n headerProperties = new HashMap<String, String>();\n progress.increase(1);\n try {\n xmlScript = HTTPLiveHeader.parseXmlString(script, false);\n Node root = xmlScript.getChildNodes().item(0);\n if (root == null || !root.getNodeName().equalsIgnoreCase(\"String_Node_Str\")) {\n progress.finalize();\n return parseError(\"String_Node_Str\");\n }\n NodeList steps = root.getChildNodes();\n progress.addToMax(steps.getLength());\n for (int step = 0; step < steps.getLength(); step++) {\n progress.setStatusText(JDLocale.L(\"String_Node_Str\", \"String_Node_Str\") + step);\n progress.increase(1);\n Node current = steps.item(step);\n if (current.getNodeType() == 3) {\n continue;\n }\n if (!current.getNodeName().equalsIgnoreCase(\"String_Node_Str\")) {\n progress.finalize();\n return parseError(\"String_Node_Str\" + current.getNodeName());\n }\n NodeList toDos = current.getChildNodes();\n for (int toDoStep = 0; toDoStep < toDos.getLength(); toDoStep++) {\n Node toDo = toDos.item(toDoStep);\n progress.setStatusText(String.format(JDLocale.L(\"String_Node_Str\", \"String_Node_Str\"), toDo.getNodeName()));\n if (toDo.getNodeName().equalsIgnoreCase(\"String_Node_Str\")) {\n NamedNodeMap attributes = toDo.getAttributes();\n for (int attribute = 0; attribute < attributes.getLength(); attribute++) {\n String key = attributes.item(attribute).getNodeName();\n String value = attributes.item(attribute).getNodeValue();\n String[] tmp = value.split(\"String_Node_Str\");\n String[] params = new Regex(value, \"String_Node_Str\").getColumn(-1);\n if (params.length > 0) {\n String req;\n if (value.startsWith(params[0])) {\n req = \"String_Node_Str\";\n logger.finer(\"String_Node_Str\" + variables);\n logger.finer(\"String_Node_Str\" + headerProperties);\n for (int i = 0; i <= tmp.length; i++) {\n logger.finer(\"String_Node_Str\" + params[i - 1] + \"String_Node_Str\");\n req += getModifiedVariable(params[i - 1]);\n if (i < tmp.length) {\n req += tmp[i];\n }\n }\n } else {\n req = tmp[0];\n logger.finer(\"String_Node_Str\" + variables);\n logger.finer(\"String_Node_Str\" + headerProperties);\n for (int i = 1; i <= tmp.length; i++) {\n if (i > params.length) {\n continue;\n }\n logger.finer(\"String_Node_Str\" + params[i - 1] + \"String_Node_Str\");\n req += getModifiedVariable(params[i - 1]);\n if (i < tmp.length) {\n req += tmp[i];\n }\n }\n }\n value = req;\n }\n variables.put(key, value);\n }\n logger.finer(\"String_Node_Str\" + variables);\n }\n Browser br = null;\n if (toDo.getNodeName().equalsIgnoreCase(\"String_Node_Str\")) {\n if (toDo.getChildNodes().getLength() != 1) {\n progress.finalize();\n return parseError(\"String_Node_Str\");\n }\n br = doRequest(toDo.getChildNodes().item(0).getNodeValue().trim());\n if (br == null || !br.getHttpConnection().isOK()) {\n okCounter--;\n logger.severe(\"String_Node_Str\");\n } else {\n okCounter++;\n }\n }\n if (toDo.getNodeName().equalsIgnoreCase(\"String_Node_Str\")) {\n logger.finer(\"String_Node_Str\");\n if (toDo.getChildNodes().getLength() != 1) {\n progress.finalize();\n return parseError(\"String_Node_Str\");\n }\n NamedNodeMap attributes = toDo.getAttributes();\n if (attributes.getNamedItem(\"String_Node_Str\") == null) {\n progress.finalize();\n return parseError(\"String_Node_Str\" + toDo);\n }\n String[] keys = attributes.getNamedItem(\"String_Node_Str\").getNodeValue().split(\"String_Node_Str\");\n getVariables(toDo.getChildNodes().item(0).getNodeValue().trim(), keys, br);\n }\n if (toDo.getNodeName().equalsIgnoreCase(\"String_Node_Str\")) {\n NamedNodeMap attributes = toDo.getAttributes();\n Node item = attributes.getNamedItem(\"String_Node_Str\");\n logger.finer(\"String_Node_Str\" + item.getNodeValue() + \"String_Node_Str\");\n if (item == null) {\n return parseError(\"String_Node_Str\");\n }\n int seconds = JDUtilities.filterInt(item.getNodeValue());\n Thread.sleep(seconds * 1000);\n }\n }\n }\n } catch (SAXException e) {\n progress.finalize();\n return parseError(e.getMessage());\n } catch (ParserConfigurationException e) {\n e.printStackTrace();\n progress.finalize();\n return parseError(e.getMessage());\n } catch (Exception e) {\n e.printStackTrace();\n progress.finalize();\n return parseError(e.getCause() + \"String_Node_Str\" + e.getMessage());\n }\n int waittime = configuration.getIntegerProperty(Configuration.PARAM_HTTPSEND_IPCHECKWAITTIME, 0);\n int maxretries = configuration.getIntegerProperty(Configuration.PARAM_HTTPSEND_RETRIES, 0);\n int waitForIp = configuration.getIntegerProperty(Configuration.PARAM_HTTPSEND_WAITFORIPCHANGE, 10);\n logger.finer(\"String_Node_Str\" + waittime + \"String_Node_Str\");\n progress.increase(1);\n progress.setStatusText(JDLocale.L(\"String_Node_Str\", \"String_Node_Str\"));\n try {\n Thread.sleep(waittime * 1000);\n } catch (InterruptedException e) {\n }\n String afterIP = JDUtilities.getIPAddress();\n if (!JDUtilities.validateIP(afterIP)) {\n logger.warning(\"String_Node_Str\" + afterIP + \"String_Node_Str\" + JDUtilities.getConfiguration().getStringProperty(Configuration.PARAM_GLOBAL_IP_MASK, \"String_Node_Str\" + \"String_Node_Str\"));\n JDUtilities.getGUI().displayMiniWarning(String.format(JDLocale.L(\"String_Node_Str\", \"String_Node_Str\"), afterIP), null, 20);\n afterIP = \"String_Node_Str\";\n }\n progress.increase(1);\n String pattern;\n pattern = JDLocale.L(\"String_Node_Str\", \"String_Node_Str\");\n progress.setStatusText(String.format(pattern, preIp, afterIP));\n long endTime = System.currentTimeMillis() + waitForIp * 1000;\n while (System.currentTimeMillis() <= endTime && (afterIP.equalsIgnoreCase(\"String_Node_Str\") || afterIP == null || afterIP.equals(preIp))) {\n try {\n Thread.sleep(5 * 1000);\n } catch (InterruptedException e) {\n }\n afterIP = JDUtilities.getIPAddress();\n try {\n pattern = JDLocale.L(\"String_Node_Str\", \"String_Node_Str\");\n progress.setStatusText(String.format(pattern, preIp, afterIP));\n } catch (Exception e) {\n }\n logger.finer(\"String_Node_Str\" + afterIP);\n }\n logger.finer(\"String_Node_Str\" + afterIP);\n if (afterIP.equals(\"String_Node_Str\") && !afterIP.equals(preIp)) {\n logger.warning(\"String_Node_Str\");\n endTime = System.currentTimeMillis() + 120 * 1000;\n while (System.currentTimeMillis() <= endTime && (afterIP.equalsIgnoreCase(\"String_Node_Str\") || afterIP == null || afterIP.equals(preIp))) {\n try {\n Thread.sleep(20 * 1000);\n } catch (InterruptedException e) {\n }\n afterIP = JDUtilities.getIPAddress();\n try {\n pattern = JDLocale.L(\"String_Node_Str\", \"String_Node_Str\");\n progress.setStatusText(String.format(pattern, preIp, afterIP));\n } catch (Exception e) {\n }\n logger.finer(\"String_Node_Str\" + afterIP);\n }\n }\n if (!afterIP.equals(preIp) && !afterIP.equalsIgnoreCase(\"String_Node_Str\")) {\n progress.finalize();\n logger.info(\"String_Node_Str\" + afterIP);\n return true;\n }\n if (retries <= maxretries) {\n progress.finalize();\n return doInteraction(arg);\n }\n progress.finalize();\n logger.info(\"String_Node_Str\" + afterIP);\n return false;\n}\n"
|
"public static Font getFont(String family, int size, int style) {\n Font font = null;\n if (size < 0) {\n size = 0;\n }\n Font font = null;\n String key = fd.toString();\n if (JFaceResources.getFontRegistry().hasValueFor(key)) {\n font = JFaceResources.getFontRegistry().get(key);\n } else {\n JFaceResources.getFontRegistry().put(key, new FontData[] { new FontData(family, size, style) });\n font = JFaceResources.getFontRegistry().get(key);\n }\n return font;\n}\n"
|
"public ListResponse<ResourceLimitResponse> getResponse() {\n List<ResourceLimitVO> limits = (List<ResourceLimitVO>) getResponseObject();\n ListResponse<ResourceLimitResponse> response = new ListResponse<ResourceLimitResponse>();\n List<ResourceLimitResponse> limitResponses = new ArrayList<ResourceLimitResponse>();\n for (ResourceLimitVO limit : limits) {\n ResourceLimitResponse resourceLimitResponse = new ResourceLimitResponse();\n if (limit.getDomainId() != null) {\n resourceLimitResponse.setDomainId(limit.getDomainId());\n resourceLimitResponse.setDomainName(ApiDBUtils.findDomainById(limit.getDomainId()).getName());\n }\n if (limit.getAccountId() != null) {\n Account accountTemp = ApiDBUtils.findAccountById(limit.getAccountId());\n if (accountTemp != null) {\n resourceLimitResponse.setAccountName(accountTemp.getAccountName());\n resourceLimitResponse.setDomainId(accountTemp.getDomainId());\n resourceLimitResponse.setDomainName(ApiDBUtils.findDomainById(accountTemp.getDomainId()).getName());\n }\n }\n resourceLimitResponse.setResourceType(Integer.valueOf(limit.getType().ordinal()).toString());\n resourceLimitResponse.setMax(limit.getMax());\n resourceLimitResponse.setResponseName(\"String_Node_Str\");\n limitResponses.add(resourceLimitResponse);\n }\n response.setResponses(limitResponses);\n response.setResponseName(getName());\n return response;\n}\n"
|
"public Object visitAutoText(IAutoTextContent autoText, Object value) {\n if (IAutoTextContent.PAGE_NUMBER == autoText.getType()) {\n if (parent instanceof PDFLineAreaLM) {\n String originalPageNumber = autoText.getText();\n NumberFormatter nf = new NumberFormatter();\n String patternStr = autoText.getComputedStyle().getNumberFormat();\n nf.applyPattern(patternStr);\n try {\n autoText.setText(nf.format(Integer.parseInt(originalPageNumber)));\n } catch (NumberFormatException nfe) {\n autoText.setText(originalPageNumber);\n }\n }\n return handleText(autoText);\n }\n return new PDFTemplateLM(context, parent, autoText, executor);\n}\n"
|
"private void createVertex(OClass vertexClass, OClass edgeClass) {\n OrientGraph tx = new OrientGraphFactory(getDatabase().getURL()).getTx();\n OrientVertex newVertex = tx.addVertex(vertexClass.getName(), (String) null);\n OrientVertex vertex = tx.getVertex(documentModel.getObject().getIdentity());\n tx.addEdge(null, vertex, newVertex, edgeClass.getName());\n}\n"
|
"public double get(OperatingSystemMXBean bean) {\n return bean.getSystemLoadAverage();\n}\n"
|
"private void drawHeaderRowAndEvents(Canvas canvas) {\n mHeaderColumnWidth = mTimeTextWidth + mHeaderColumnPadding * 2;\n mWidthPerDay = getWidth() - mHeaderColumnWidth - mColumnGap * (mNumberOfVisibleDays - 1);\n mWidthPerDay = mWidthPerDay / mNumberOfVisibleDays;\n Calendar today = today();\n if (mAreDimensionsInvalid) {\n mEffectiveMinHourHeight = Math.max(mMinHourHeight, (int) ((getHeight() - mHeaderTextHeight - mHeaderRowPadding * 2 - mHeaderMarginBottom) / 24));\n mAreDimensionsInvalid = false;\n if (mScrollToDay != null)\n goToDate(mScrollToDay);\n mAreDimensionsInvalid = false;\n if (mScrollToHour >= 0)\n goToHour(mScrollToHour);\n mScrollToDay = null;\n mScrollToHour = -1;\n mAreDimensionsInvalid = false;\n }\n if (mIsFirstDraw) {\n mIsFirstDraw = false;\n if (mNumberOfVisibleDays >= 7 && today.get(Calendar.DAY_OF_WEEK) != mFirstDayOfWeek) {\n int difference = 7 + (today.get(Calendar.DAY_OF_WEEK) - mFirstDayOfWeek);\n mCurrentOrigin.x += (mWidthPerDay + mColumnGap) * difference;\n }\n }\n if (mCurrentScrollDirection == Direction.VERTICAL)\n mCurrentOrigin.y -= mDistanceY;\n if (mNewHourHeight > 0) {\n if (mNewHourHeight < mEffectiveMinHourHeight)\n mNewHourHeight = mEffectiveMinHourHeight;\n else if (mNewHourHeight > mMaxHourHeight)\n mNewHourHeight = mMaxHourHeight;\n mCurrentOrigin.y = (mCurrentOrigin.y / mHourHeight) * mNewHourHeight;\n mHourHeight = mNewHourHeight;\n mNewHourHeight = -1;\n }\n if (mCurrentOrigin.y < getHeight() - mHourHeight * 24 - mHeaderTextHeight - mHeaderRowPadding * 2 - mHeaderMarginBottom)\n mCurrentOrigin.y = getHeight() - mHourHeight * 24 - mHeaderTextHeight - mHeaderRowPadding * 2 - mHeaderMarginBottom;\n if (mCurrentOrigin.y > 0)\n mCurrentOrigin.y = 0;\n if (mCurrentScrollDirection == Direction.HORIZONTAL)\n mCurrentOrigin.x -= mDistanceX;\n int leftDaysWithGaps = (int) -(Math.ceil(mCurrentOrigin.x / (mWidthPerDay + mColumnGap)));\n float startFromPixel = mCurrentOrigin.x + (mWidthPerDay + mColumnGap) * leftDaysWithGaps + mHeaderColumnWidth;\n float startPixel = startFromPixel;\n Calendar day = (Calendar) today.clone();\n day.add(Calendar.HOUR, 6);\n int lineCount = (int) ((getHeight() - mHeaderTextHeight - mHeaderRowPadding * 2 - mHeaderMarginBottom) / mHourHeight) + 1;\n lineCount = (lineCount) * (mNumberOfVisibleDays + 1);\n float[] hourLines = new float[lineCount * 4];\n if (mEventRects != null) {\n for (EventRect eventRect : mEventRects) {\n eventRect.rectF = null;\n }\n }\n Calendar oldFirstVisibleDay = mFirstVisibleDay;\n mFirstVisibleDay = (Calendar) today.clone();\n mFirstVisibleDay.add(Calendar.DATE, -(Math.round(mCurrentOrigin.x / (mWidthPerDay + mColumnGap))));\n if (!mFirstVisibleDay.equals(oldFirstVisibleDay) && mScrollListener != null) {\n mScrollListener.onFirstVisibleDayChanged(mFirstVisibleDay, oldFirstVisibleDay);\n }\n for (int dayNumber = leftDaysWithGaps + 1; dayNumber <= leftDaysWithGaps + mNumberOfVisibleDays + 1; dayNumber++) {\n day = (Calendar) today.clone();\n mLastVisibleDay = (Calendar) day.clone();\n day.add(Calendar.DATE, dayNumber - 1);\n mLastVisibleDay.add(Calendar.DATE, dayNumber - 2);\n boolean sameDay = isSameDay(day, today);\n if (mEventRects == null || mRefreshEvents || (dayNumber == leftDaysWithGaps + 1 && mFetchedPeriod != (int) mWeekViewLoader.toWeekViewPeriodIndex(day) && Math.abs(mFetchedPeriod - mWeekViewLoader.toWeekViewPeriodIndex(day)) > 0.5)) {\n getMoreEvents(day);\n mRefreshEvents = false;\n }\n float start = (startPixel < mHeaderColumnWidth ? mHeaderColumnWidth : startPixel);\n if (mWidthPerDay + startPixel - start > 0) {\n if (mUseNewColoring) {\n boolean isWeekend = (day.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || day.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY);\n Paint pastPaint = isWeekend ? mPastWeekendBackgroundPaint : mPastBackgroundPaint;\n Paint futurePaint = isWeekend ? mFutureWeekendBackgroundPaint : mFutureBackgroundPaint;\n float startY = mHeaderTextHeight + mHeaderRowPadding * 2 + mTimeTextHeight / 2 + mHeaderMarginBottom + mCurrentOrigin.y;\n if (sameDay) {\n Calendar now = Calendar.getInstance();\n float beforeNow = (now.get(Calendar.HOUR_OF_DAY) + now.get(Calendar.MINUTE) / 60.0f) * mHourHeight;\n canvas.drawRect(start, startY, startPixel + mWidthPerDay, startY + beforeNow, pastPaint);\n canvas.drawRect(start, startY + beforeNow, startPixel + mWidthPerDay, getHeight(), futurePaint);\n } else if (day.before(today)) {\n canvas.drawRect(start, startY, startPixel + mWidthPerDay, getHeight(), pastPaint);\n } else {\n canvas.drawRect(start, startY, startPixel + mWidthPerDay, getHeight(), futurePaint);\n }\n } else {\n canvas.drawRect(start, mHeaderTextHeight + mHeaderRowPadding * 2 + mTimeTextHeight / 2 + mHeaderMarginBottom, startPixel + mWidthPerDay, getHeight(), sameDay ? mTodayBackgroundPaint : mDayBackgroundPaint);\n }\n }\n int i = 0;\n for (int hourNumber = 0; hourNumber < 24; hourNumber++) {\n float top = mHeaderTextHeight + mHeaderRowPadding * 2 + mCurrentOrigin.y + mHourHeight * hourNumber + mTimeTextHeight / 2 + mHeaderMarginBottom;\n if (top > mHeaderTextHeight + mHeaderRowPadding * 2 + mTimeTextHeight / 2 + mHeaderMarginBottom - mHourSeparatorHeight && top < getHeight() && startPixel + mWidthPerDay - start > 0) {\n hourLines[i * 4] = start;\n hourLines[i * 4 + 1] = top;\n hourLines[i * 4 + 2] = startPixel + mWidthPerDay;\n hourLines[i * 4 + 3] = top;\n i++;\n }\n }\n canvas.drawLines(hourLines, mHourSeparatorPaint);\n drawEvents(day, startPixel, canvas);\n if (mUseNewColoring && sameDay) {\n float startY = mHeaderTextHeight + mHeaderRowPadding * 2 + mTimeTextHeight / 2 + mHeaderMarginBottom + mCurrentOrigin.y;\n Calendar now = Calendar.getInstance();\n float beforeNow = (now.get(Calendar.HOUR_OF_DAY) + now.get(Calendar.MINUTE) / 60.0f) * mHourHeight;\n canvas.drawLine(start, startY + beforeNow, startPixel + mWidthPerDay, startY + beforeNow, mNowLinePaint);\n }\n startPixel += mWidthPerDay + mColumnGap;\n }\n canvas.drawRect(0, 0, getWidth(), mHeaderTextHeight + mHeaderRowPadding * 2, mHeaderBackgroundPaint);\n startPixel = startFromPixel;\n for (int dayNumber = leftDaysWithGaps + 1; dayNumber <= leftDaysWithGaps + mNumberOfVisibleDays + 1; dayNumber++) {\n day = (Calendar) today.clone();\n day.add(Calendar.DATE, dayNumber - 1);\n boolean sameDay = isSameDay(day, today);\n String dayLabel = getDateTimeInterpreter().interpretDate(day);\n if (dayLabel == null)\n throw new IllegalStateException(\"String_Node_Str\");\n canvas.drawText(dayLabel, startPixel + mWidthPerDay / 2, mHeaderTextHeight + mHeaderRowPadding, sameDay ? mTodayHeaderTextPaint : mHeaderTextPaint);\n startPixel += mWidthPerDay + mColumnGap;\n }\n}\n"
|
"private QuestionDataElement resolveReference(IDataReference binding, QuestionDataGroup group) {\n Enumeration en = group.getChildren().elements();\n while (target == null && en.hasMoreElements()) {\n TreeElement dme = (TreeElement) en.nextElement();\n if (!dme.isLeaf()) {\n return resolveReference(binding, (QuestionDataGroup) dme);\n } else {\n if ((dme instanceof QuestionDataElement) && ((QuestionDataElement) dme).matchesReference(binding)) {\n return (QuestionDataElement) dme;\n }\n }\n }\n return null;\n}\n"
|
"public boolean performCancel() {\n docItem.getProperty().setVersion(mainPage.getOrignalVersion());\n return super.performCancel();\n}\n"
|
"private String constructUrl(final String proxyGrantingTicketId, final String targetService) {\n try {\n return new URL(this.casServerUrl + (this.casServerUrl.endsWith(\"String_Node_Str\") ? \"String_Node_Str\" : \"String_Node_Str\") + \"String_Node_Str\" + \"String_Node_Str\" + proxyGrantingTicketId + \"String_Node_Str\" + URLEncoder.encode(targetService, \"String_Node_Str\"));\n } catch (final Exception e) {\n throw new RuntimeException(e);\n }\n}\n"
|
"public boolean isStrictInvocation(Object mock, String mockClassDesc, String mockNameAndDesc) {\n if (isInstanceMethodWithStandardBehavior(mock, mockNameAndDesc)) {\n return false;\n }\n for (Object strictMock : strictMocks) {\n if (strictMock == mockClassDesc) {\n addStrictMock(mock);\n return true;\n }\n }\n return false;\n}\n"
|
"static void restoreSpeakerMode(Context context) {\n if (DBG)\n log(\"String_Node_Str\" + sIsSpeakerEnabled);\n if (isSpeakerOn(context) != sIsSpeakerEnabled) {\n turnOnSpeaker(context, sIsSpeakerEnabled, false);\n }\n}\n"
|
"public void testWriteAndListLogEntries() throws InterruptedException {\n String logId = formatForTest(\"String_Node_Str\");\n LoggingOptions loggingOptions = logging().getOptions();\n LogName logName = LogName.create(loggingOptions.getProjectId(), logId);\n StringPayload firstPayload = StringPayload.of(\"String_Node_Str\");\n LogEntry firstEntry = LogEntry.newBuilder(firstPayload).addLabel(\"String_Node_Str\", \"String_Node_Str\").setLogName(logName).setHttpRequest(HttpRequest.newBuilder().setStatus(500).build()).setResource(MonitoredResource.newBuilder(\"String_Node_Str\").build()).build();\n JsonPayload secondPayload = JsonPayload.of(ImmutableMap.<String, Object>of(\"String_Node_Str\", \"String_Node_Str\"));\n LogEntry secondEntry = LogEntry.newBuilder(secondPayload).addLabel(\"String_Node_Str\", \"String_Node_Str\").setLogName(logName).setOperation(Operation.of(\"String_Node_Str\", \"String_Node_Str\")).setResource(MonitoredResource.newBuilder(\"String_Node_Str\").build()).build();\n logging().write(ImmutableList.of(firstEntry));\n logging().write(ImmutableList.of(secondEntry));\n EntryListOption[] options = { EntryListOption.filter(filter), EntryListOption.pageSize(1) };\n Page<LogEntry> page = logging().listLogEntries(options);\n while (Iterators.size(page.iterateAll().iterator()) < 2) {\n Thread.sleep(500);\n page = logging().listLogEntries(options);\n }\n Iterator<LogEntry> iterator = page.iterateAll().iterator();\n assertTrue(iterator.hasNext());\n LogEntry entry = iterator.next();\n assertEquals(firstPayload, entry.getPayload());\n assertEquals(logName, entry.getLogName());\n assertEquals(ImmutableMap.of(\"String_Node_Str\", \"String_Node_Str\"), entry.getLabels());\n assertEquals(\"String_Node_Str\", entry.getResource().getType());\n assertEquals(HttpRequest.newBuilder().setStatus(500).build(), entry.getHttpRequest());\n assertEquals(Severity.DEFAULT, entry.getSeverity());\n assertNull(entry.getOperation());\n assertNotNull(entry.getInsertId());\n assertNotNull(entry.getTimestamp());\n assertTrue(iterator.hasNext());\n entry = iterator.next();\n assertEquals(secondPayload, entry.getPayload());\n assertEquals(logName, entry.getLogName());\n assertEquals(ImmutableMap.of(\"String_Node_Str\", \"String_Node_Str\"), entry.getLabels());\n assertEquals(\"String_Node_Str\", entry.getResource().getType());\n assertEquals(Operation.of(\"String_Node_Str\", \"String_Node_Str\"), entry.getOperation());\n assertEquals(Severity.DEFAULT, entry.getSeverity());\n assertNull(entry.getHttpRequest());\n assertNotNull(entry.getInsertId());\n assertNotNull(entry.getTimestamp());\n options = new EntryListOption[] { EntryListOption.filter(filter), EntryListOption.sortOrder(SortingField.TIMESTAMP, SortingOrder.DESCENDING) };\n page = logging().listLogEntries(options);\n while (Iterators.size(page.iterateAll().iterator()) < 2) {\n Thread.sleep(500);\n page = logging().listLogEntries(options);\n }\n iterator = page.iterateAll().iterator();\n Long lastTimestamp = iterator.next().getTimestamp();\n while (iterator.hasNext()) {\n assertTrue(iterator.next().getTimestamp() <= lastTimestamp);\n }\n assertTrue(logging().deleteLog(logName));\n}\n"
|
"public static IViewerReportDesignHandle getDesignHandle(HttpServletRequest request, ViewerField viewer) throws Exception {\n if (viewer == null)\n return null;\n IViewerReportDesignHandle design = null;\n IReportRunnable reportRunnable = null;\n String designFile = ParameterAccessor.getReport(request, viewer.getReportDesign());\n String documentFile = ParameterAccessor.getReportDocument(request, viewer.getReportDocument(), false);\n boolean isValidDocument = ParameterAccessor.isValidFilePath(viewer.getReportDocument());\n if (documentFile != null && isValidDocument) {\n try {\n IReportDocument reportDocumentInstance = ReportEngineService.getInstance().openReportDocument(designFile, documentFile, getModuleOptions(viewer));\n if (reportDocumentInstance != null) {\n viewer.setDocumentInUrl(true);\n reportRunnable = reportDocumentInstance.getReportRunnable();\n reportDocumentInstance.close();\n }\n } catch (Exception e) {\n }\n }\n if (reportRunnable == null) {\n if (documentFile != null && designFile == null) {\n if (isValidDocument)\n throw new ViewerException(ResourceConstants.GENERAL_EXCEPTION_DOCUMENT_FILE_ERROR, new String[] { documentFile });\n else\n throw new ViewerException(ResourceConstants.GENERAL_EXCEPTION_DOCUMENT_ACCESS_ERROR, new String[] { documentFile });\n }\n if (!ParameterAccessor.isValidFilePath(viewer.getReportDesign())) {\n throw new ViewerException(ResourceConstants.GENERAL_EXCEPTION_REPORT_ACCESS_ERROR, new String[] { designFile });\n } else {\n reportRunnable = BirtUtility.getRunnableFromDesignFile(request, designFile, getModuleOptions(viewer));\n if (reportRunnable == null) {\n throw new ViewerException(ResourceConstants.GENERAL_EXCEPTION_REPORT_FILE_ERROR, new String[] { designFile });\n }\n }\n }\n if (reportRunnable != null) {\n design = new BirtViewerReportDesignHandle(IViewerReportDesignHandle.RPT_RUNNABLE_OBJECT, reportRunnable);\n }\n return design;\n}\n"
|
"public void shutdown() {\n ShutdownRequest request = new ShutdownRequest(name);\n invoke(request);\n}\n"
|
"public void run() {\n ChanApplication.getReplyManager()._onPickedFile(\"String_Node_Str\", null);\n Toast.makeText(ImagePickActivity.this, R.string.file_open_failed, Toast.LENGTH_LONG).show();\n}\n"
|
"public static void buildAndInstallCodesProject(IProgressMonitor monitor, ERepositoryObjectType codeType, boolean install) throws Exception {\n Job job = new Job(\"String_Node_Str\" + codeType.getLabel()) {\n protected IStatus run(IProgressMonitor monitor) {\n try {\n if (!BuildCacheManager.getInstance().isCodesBuild(codeType)) {\n ITalendProcessJavaProject codeProject = getCodesProject(codeType);\n codeProject.buildModules(monitor, null, null);\n if (install) {\n Map<String, Object> argumentsMap = new HashMap<>();\n argumentsMap.put(TalendProcessArgumentConstant.ARG_GOAL, TalendMavenConstants.GOAL_INSTALL);\n argumentsMap.put(TalendProcessArgumentConstant.ARG_PROGRAM_ARGUMENTS, \"String_Node_Str\");\n codeProject.buildModules(monitor, null, argumentsMap);\n BuildCacheManager.getInstance().updateCodeLastBuildDate(codeType);\n }\n }\n return org.eclipse.core.runtime.Status.OK_STATUS;\n } catch (Exception e) {\n return new org.eclipse.core.runtime.Status(IStatus.ERROR, DesignerMavenPlugin.PLUGIN_ID, 1, e.getMessage(), e);\n }\n };\n job.setUser(false);\n job.setPriority(Job.INTERACTIVE);\n job.schedule();\n } else {\n job.join();\n }\n}\n"
|
"private IDyvilHeader loadHeader(String fileName, String name, Library library) {\n InputStream is = library.getInputStream(fileName);\n if (is != null) {\n DyvilHeader header = HeaderFile.read(is);\n header.pack = this;\n this.units.add(header);\n return header;\n }\n return null;\n}\n"
|
"public void onCreate() {\n super.onCreate();\n helpStack = HSHelpStack.getInstance(this);\n HSZendeskGear zenDeskGear = new HSZendeskGear(\"String_Node_Str\", \"String_Node_Str\", \"String_Node_Str\");\n helpStack.setGear(zenDeskGear);\n}\n"
|
"public void onCreate(Bundle icicle) {\n super.onCreate(icicle);\n if (debug)\n Log.d(TAG, \"String_Node_Str\");\n frontdoor = new Intent(this, FrontDoor.class);\n if (CategoryList.isSignedIn() == false) {\n startActivity(frontdoor);\n }\n restartTimerIntent = new Intent(CryptoIntents.ACTION_RESTART_TIMER);\n String title = getResources().getString(R.string.app_name) + \"String_Node_Str\" + getResources().getString(R.string.edit_entry);\n setTitle(title);\n setContentView(R.layout.pass_edit);\n descriptionText = (EditText) findViewById(R.id.description);\n passwordText = (EditText) findViewById(R.id.password);\n usernameText = (EditText) findViewById(R.id.username);\n noteText = (EditText) findViewById(R.id.note);\n websiteText = (EditText) findViewById(R.id.website);\n Button goButton = (Button) findViewById(R.id.go);\n RowId = icicle != null ? icicle.getLong(PassList.KEY_ID) : null;\n if (RowId == null) {\n Bundle extras = getIntent().getExtras();\n RowId = extras != null ? extras.getLong(PassList.KEY_ID) : null;\n }\n entryEdited = false;\n goButton.setOnClickListener(new View.OnClickListener() {\n public void onClick(View arg0) {\n Toast.makeText(PassEdit.this, R.string.copy_to_clipboard, Toast.LENGTH_SHORT).show();\n ClipboardManager cb = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);\n cb.setText(passwordText.getText().toString());\n Intent i = new Intent(Intent.ACTION_VIEW);\n String link = websiteText.getText().toString();\n Uri u = Uri.parse(link);\n i.setData(u);\n try {\n startActivity(i);\n } catch (ActivityNotFoundException e) {\n u = Uri.parse(\"String_Node_Str\" + link);\n i.setData(u);\n try {\n startActivity(i);\n } catch (ActivityNotFoundException e2) {\n Toast.makeText(PassEdit.this, R.string.invalid_website, Toast.LENGTH_SHORT).show();\n }\n }\n }\n });\n restoreMe();\n sendBroadcast(restartTimerIntent);\n}\n"
|
"public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {\n ArrayList proposals = new ArrayList();\n ArrayList proposers = new ArrayList();\n try {\n if (viewer.getDocument() instanceof ICFEFileDocument) {\n try {\n proposers = ((ICFEFileDocument) viewer.getDocument()).getContentAssistManager().getRootAssistors();\n } catch (Exception e) {\n }\n }\n DefaultAssistState state = AssistUtils.initialiseDefaultAssistState(viewer, offset);\n Iterator proposerIter = proposers.iterator();\n while (proposerIter.hasNext()) {\n Object currProc = proposerIter.next();\n Assert.isNotNull(currProc, \"String_Node_Str\");\n ICompletionProposal[] tempProps = null;\n if (currProc instanceof IContentAssistProcessor) {\n IContentAssistProcessor currProcessor = (IContentAssistProcessor) currProc;\n tempProps = currProcessor.computeCompletionProposals(viewer, offset);\n } else if (currProc instanceof IAssistContributor) {\n IAssistContributor currContrib = (IAssistContributor) currProc;\n tempProps = currContrib.getTagProposals(state);\n }\n if (tempProps != null && tempProps.length > 0) {\n proposals.addAll(arrayToCollection(tempProps));\n } else {\n }\n }\n return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]);\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n}\n"
|
"public void addData(int col, Object data) {\n List column = (List) columns.get(col);\n column.add(data);\n if (data instanceof Data) {\n BookmarkDef bookmark = ((Data) data).getBookmark();\n if (null == bookmark) {\n return;\n }\n int rowNo = ((Integer) columnId2StartLine.get(new Integer(col))).intValue() + getColumnSize(col);\n bookmark.setColumnNo(col + 1);\n bookmark.setRowNo(rowNo);\n bookmarks.add(bookmark);\n }\n}\n"
|
"public static void createVersion3(Connection conn, Integer currentVersion) {\n if (currentVersion < 3) {\n StringBuilder createVersionTable = new StringBuilder();\n createVersionTable.append(\"String_Node_Str\");\n createVersionTable.append(\"String_Node_Str\");\n DbManager.getInstance().doExecute(createVersionTable.toString());\n String insertQuery = \"String_Node_Str\";\n DbManager.getInstance().doInsertUpdate(insertQuery);\n currentVersion.setDbVersion(3);\n }\n}\n"
|
"public int getBottomX() {\n return plotBottomLoc.getBlockX();\n}\n"
|
"public PortletAppDD getPortletAppDD(ServletContext context) throws PortletContainerException {\n PortletAppDD dd = (PortletAppDD) cache.get(context);\n if (dd == null) {\n dd = createDefinition(context);\n cache.put(context, dd);\n }\n return portletAppDD;\n}\n"
|
"public boolean injectTrackballEvent(MotionEvent ev, boolean sync) {\n final int pid = Binder.getCallingPid();\n final int uid = Binder.getCallingUid();\n final long ident = Binder.clearCallingIdentity();\n final int result = dispatchTrackball(null, ev, pid, uid);\n if (sync) {\n mKeyWaiter.waitForNextEventTarget(null, null, null, false, true);\n }\n switch(result) {\n case INJECT_NO_PERMISSION:\n throw new SecurityException(\"String_Node_Str\");\n case INJECT_SUCCEEDED:\n return true;\n }\n return false;\n}\n"
|
"public void writeText(String txt) {\n writer.openTag(\"String_Node_Str\");\n try {\n new java.math.BigDecimal(txt);\n writer.attribute(\"String_Node_Str\", \"String_Node_Str\");\n } catch (Exception e) {\n writer.attribute(\"String_Node_Str\", \"String_Node_Str\");\n }\n writer.text(txt);\n writer.closeTag(\"String_Node_Str\");\n}\n"
|
"public boolean hasChildren(Object element) {\n if (element instanceof ItemRecord) {\n File[] listFiles = ((ItemRecord) element).getFile().listFiles();\n return listFiles != null && listFiles.length > 0;\n }\n return false;\n}\n"
|
"protected Collection<Integer> getNextIndexMatch(Vector<PredicateProfile> profiles, IStorageUtilityIndexed<?> storage, QueryContext currentQueryContext) throws IllegalArgumentException {\n if (!(profiles.elementAt(0) instanceof IndexedValueLookup)) {\n throw new IllegalArgumentException(\"String_Node_Str\");\n }\n IndexedValueLookup op = (IndexedValueLookup) profiles.elementAt(0);\n EvaluationTrace trace = new EvaluationTrace(\"String_Node_Str\" + op.key + \"String_Node_Str\");\n List<Integer> ids = storage.getIDsForValue(op.key, op.value);\n if (getStorageCacheName() != null && ids.size() > 50 && ids.size() < PerformanceTuningUtil.getMaxPrefetchCaseBlock()) {\n RecordSetResultCache cue = currentQueryContext.getQueryCache(RecordSetResultCache.class);\n String bulkRecordSetKey = String.format(\"String_Node_Str\", op.key, op.value);\n cue.reportBulkRecordSet(bulkRecordSetKey, getStorageCacheName(), new LinkedHashSet(ids));\n }\n trace.setOutcome(\"String_Node_Str\" + ids.size());\n if (currentQueryContext != null) {\n currentQueryContext.reportTrace(trace);\n }\n boolean inTemporaryQueryContext = currentQueryContext.getQueryCacheOrNull(ScopeLimitedReferenceRequestCache.class) != null;\n if (defaultCacher != null && !inTemporaryQueryContext) {\n defaultCacher.cacheResult(op.key, op.value, ids);\n }\n profiles.removeElementAt(0);\n return ids;\n}\n"
|
"public int getExecutionTime(MethodInfo context, InstructionHandle ih) {\n int opcode = ih.getInstruction().getOpcode();\n if (opcode == Constants.NEW) {\n NEW insn = (NEW) ih.getInstruction();\n ObjectType type = insn.getLoadClassType(context.getConstantPoolGen());\n return computeObjectSize(getFieldSize(getObjectFields(type.getClassName())));\n } else if (opcode == Constants.NEWARRAY || opcode == Constants.ANEWARRAY) {\n int srcLine = context.getMethod().getLineNumberTable().getSourceLine(ih.getPosition());\n LoopBound annotated = null;\n try {\n Map<Integer, LoopBound> annots = project.getAnnotations(context.getCli());\n annotated = annots.get(new Integer(srcLine));\n if (annotated == null) {\n Project.logger.info(\"String_Node_Str\" + context + \"String_Node_Str\" + srcLine);\n }\n } catch (Exception exc) {\n Project.logger.warn(\"String_Node_Str\" + context + \"String_Node_Str\" + srcLine);\n }\n Interval analyzed = null;\n if (sizes == null && project.getDfaLoopBounds() != null) {\n sizes = project.getDfaLoopBounds().getArraySizes();\n }\n if (sizes == null) {\n Project.logger.info(\"String_Node_Str\" + context + \"String_Node_Str\" + srcLine);\n } else {\n List<HashedString> callString = new LinkedList<HashedString>();\n ContextMap<List<HashedString>, Interval> t = sizes.get(ih);\n if (t == null) {\n Project.logger.info(\"String_Node_Str\" + context + \"String_Node_Str\" + srcLine);\n }\n }\n if (analyzed.hasUb()) {\n if (annotated != null) {\n if (annotated.getUpperBound() > analyzed.getUb()) {\n Project.logger.warn(\"String_Node_Str\" + context + \"String_Node_Str\" + srcLine);\n }\n if (annotated.getUpperBound() < analyzed.getUb()) {\n Project.logger.warn(\"String_Node_Str\" + context + \"String_Node_Str\" + srcLine);\n }\n if (annotated.getUpperBound() == analyzed.getUb()) {\n Project.logger.info(\"String_Node_Str\" + context + \"String_Node_Str\" + srcLine);\n }\n return computeArraySize(Math.max(annotated.getUpperBound(), analyzed.getUb()));\n } else {\n return computeArraySize(analyzed.getUb());\n }\n } else {\n if (annotated != null) {\n return computeArraySize(annotated.getUpperBound());\n } else {\n Project.logger.error(\"String_Node_Str\" + context + \"String_Node_Str\" + srcLine + \"String_Node_Str\");\n return computeArraySize(4096);\n }\n }\n } else {\n return 0;\n }\n}\n"
|
"public int getPotentialCost(MapHex hex) {\n if (hex == null) {\n return 0;\n } else {\n if (specialProperty != null && ((SpecialBaseTokenLay) specialProperty).isFree()) {\n return 0;\n } else {\n return company.getBaseTokenLayCost(hex);\n }\n }\n}\n"
|
"public void actionPerformed(ActionEvent passwordAe) {\n if (passwordAe.getActionCommand().equals(\"String_Node_Str\")) {\n currentPassword = \"String_Node_Str\";\n newPassword = \"String_Node_Str\";\n confirmPassword = \"String_Node_Str\";\n currentPassword = readPassword(textCurrentPassword.getPassword());\n newPassword = readPassword(textNewPassword.getPassword());\n confirmPassword = readPassword(textPasswordConf.getPassword());\n if (currentPassword == \"String_Node_Str\" || newPassword == \"String_Node_Str\" || confirmPassword == \"String_Node_Str\") {\n JOptionPane.showMessageDialog(new JFrame(), \"String_Node_Str\", \"String_Node_Str\", JOptionPane.ERROR_MESSAGE);\n } else if (checkPassword(currentPassword)) {\n if (!(getSpecialCharacterCount(newPassword))) {\n if (changePasswordFields(newPassword, confirmPassword)) {\n JOptionPane.showMessageDialog(new JFrame(), \"String_Node_Str\", \"String_Node_Str\", JOptionPane.INFORMATION_MESSAGE);\n guiChangePassword.dispatchEvent(new WindowEvent(guiChangePassword, WindowEvent.WINDOW_CLOSING));\n }\n } else {\n JOptionPane.showMessageDialog(new JFrame(), \"String_Node_Str\", \"String_Node_Str\", JOptionPane.ERROR_MESSAGE);\n }\n }\n }\n if (passwordAe.getActionCommand().equals(\"String_Node_Str\")) {\n dispose();\n }\n}\n"
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.