Generates a PromotionDetails regarding the parameters.

@param canBePromoted Boolean
@param isSnapshot Boolean
@param unPromotedDependencies List<String>
@param doNotUseArtifacts List<Artifact>
@return PromotionDetails
@throws IOException
970546
public static PromotionDetails createPromotionDetails(final Boolean canBePromoted, final Boolean isSnapshot, final List<String> unPromotedDependencies, final List<Artifact> doNotUseArtifacts) throws IOException{
		try{
			final PromotionDetails promotionDetails = new PromotionDetails();

			promotionDetails.setPromotable(canBePromoted);
			promotionDetails.setSnapshot(isSnapshot);
			promotionDetails.setUnPromotedDependencies(unPromotedDependencies);
			promotionDetails.setDoNotUseArtifacts(doNotUseArtifacts);

			return promotionDetails;
		}
		catch(Exception e){
			throw new IOException(e);
		}
	}
382910
@Override
  @Deprecated
  public NettyChannelBuilder usePlaintext(boolean skipNegotiation) {
    if (skipNegotiation) {
      negotiationType(NegotiationType.PLAINTEXT);
    } else {
      negotiationType(NegotiationType.PLAINTEXT_UPGRADE);
    }
    return this;
  }
1199932
@GET
    @Produces(MediaType.APPLICATION_JSON)
    @Path("/{gavc}" + ServerAPI.SET_DO_NOT_USE)
    public Response getDoNotUse(@PathParam("gavc") final String gavc){
        if(LOG.isInfoEnabled()) {
            LOG.info(String.format("Got a get doNotUse artifact request [%s]", gavc));
        }

        final DbArtifact artifact = getArtifactHandler().getArtifact(gavc);

        return Response.ok(artifact.getDoNotUse()).build();
    }
1076307
public void addLicenseToArtifact(final String gavc, final String licenseId) {
        final DbArtifact dbArtifact = getArtifact(gavc);

        // Don't need to access the DB if the job is already done
        if(dbArtifact.getLicenses().contains(licenseId)){
            return;
        }

        final DbLicense dbLicense = repositoryHandler.getLicense(licenseId);
        if(dbLicense == null){
            throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND)
                    .entity("License " + licenseId + " does not exist.").build());
        }

        repositoryHandler.addLicenseToArtifact(dbArtifact, dbLicense.getName());
    }
526400
public final Artifact createArtifact(String groupId, String artifactId, String version) {
		return createArtifact(groupId, artifactId, version, "runtime", "jar"); //$NON-NLS-1$ //$NON-NLS-2$
	}
1234897
protected function getActionsColumn($canShowDetails, $canActivityDelete)
    {
        return function ($row) use($canShowDetails, $canActivityDelete) {
            $btns = [];
            $html = app('html');
            if ($canShowDetails) {
                if ($row->name === 'JOBRESULTS_CREATED') {
                    $btns[] = $html->create('li', $html->link(handles('antares::automation/show/' . $row->job_id), trans('antares/logger::messages.show_full_log'), ['data-icon' => 'desktop-windows']));
                } else {
                    $btns[] = $html->create('li', $html->link(handles('antares::logger/activity/show/' . $row->id), trans('antares/logger::messages.show_details'), ['data-icon' => 'desktop-windows']));
                }
            }
            if ($canActivityDelete) {
                $btns[] = $html->create('li', $html->link(handles('antares::logger/activity/delete/' . $row->id), trans('antares/logger::messages.delete'), ['class' => "triggerable confirm", 'data-icon' => 'delete', 'data-title' => trans('antares/logger::messages.delete_ask'), 'data-description' => trans('antares/logger::messages.delete_message', ['id' => $row->id])]));
            }
            if (empty($btns)) {
                return '';
            }
            $section = $html->create('div', $html->create('section', $html->create('ul', $html->raw(implode('', $btns)))), ['class' => 'mass-actions-menu', 'data-id' => $row->id])->get();
            return '<i class="zmdi zmdi-more"></i>' . $html->raw($section)->get();
        };
    }
817111
public static PdfAction gotoLocalPage(String dest, boolean isName) {
        PdfAction action = new PdfAction();
        action.put(PdfName.S, PdfName.GOTO);
        if (isName)
            action.put(PdfName.D, new PdfName(dest));
        else
            action.put(PdfName.D, new PdfString(dest, null));
        return action;
    }
1194243
Collection<ProposalResponse> sendInstallProposal(InstallProposalRequest installProposalRequest, Collection<Peer> peers)
            throws ProposalException, InvalidArgumentException {

        checkChannelState();
        checkPeers(peers);
        if (null == installProposalRequest) {
            throw new InvalidArgumentException("InstallProposalRequest is null");
        }

        try {
            TransactionContext transactionContext = getTransactionContext(installProposalRequest.getUserContext());
            transactionContext.verify(false);  // Install will have no signing cause it's not really targeted to a channel.
            transactionContext.setProposalWaitTime(installProposalRequest.getProposalWaitTime());
            InstallProposalBuilder installProposalbuilder = InstallProposalBuilder.newBuilder();
            installProposalbuilder.context(transactionContext);
            installProposalbuilder.setChaincodeLanguage(installProposalRequest.getChaincodeLanguage());
            installProposalbuilder.chaincodeName(installProposalRequest.getChaincodeName());
            installProposalbuilder.chaincodePath(installProposalRequest.getChaincodePath());
            installProposalbuilder.chaincodeVersion(installProposalRequest.getChaincodeVersion());
            installProposalbuilder.setChaincodeSource(installProposalRequest.getChaincodeSourceLocation());
            installProposalbuilder.setChaincodeInputStream(installProposalRequest.getChaincodeInputStream());
            installProposalbuilder.setChaincodeMetaInfLocation(installProposalRequest.getChaincodeMetaInfLocation());

            FabricProposal.Proposal deploymentProposal = installProposalbuilder.build();
            SignedProposal signedProposal = getSignedProposal(transactionContext, deploymentProposal);

            return sendProposalToPeers(peers, signedProposal, transactionContext);
        } catch (Exception e) {
            throw new ProposalException(e);
        }

    }
874275
protected void generateBuilderFactoryContributions(MemberDescription description) {
		if (description.isTopElement()) {
			return;
		}
		if (description.getStandardContainers().isEmpty() && description.getNoBodyContainers().isEmpty()) {
			return;
		}
		List<String> modifiers = description.getModifiers();
		if (modifiers.size() <= 1) {
			// No need to create a function with the modifier's label in the name.
			modifiers = Collections.singletonList(""); //$NON-NLS-1$
		}
		final boolean enableAppenders = getCodeBuilderConfig().isISourceAppendableEnable();
		for (final String modifier : modifiers) {
			final String createFunctionName = "create" //$NON-NLS-1$
					+ Strings.toFirstUpper(modifier)
					+ Strings.toFirstUpper(description.getElementDescription().getName());

			String container = null;
			if (!description.getStandardContainers().isEmpty()) {
				container = description.getStandardContainers().iterator().next();
			} else {
				container = description.getNoBodyContainers().iterator().next();
			}

			final String createContainerFunctionName = "add" //$NON-NLS-1$
					+ Strings.toFirstUpper(container);
			final TypeReference containerBuilder = description.getContainerDescription().getBuilderInterfaceType();
			this.builderFactoryContributions.addContribution(new StringConcatenationClient() {
				@Override
				protected void appendTo(TargetStringConcatenation it) {
					it.append("\t/** Create the factory for a " + getLanguageName() + " " //$NON-NLS-1$ //$NON-NLS-2$
							+ description.getElementDescription().getElementType().getSimpleName() + "."); //$NON-NLS-1$
					it.newLine();
					it.append("\t * @param name the name of the " //$NON-NLS-1$
							+ description.getElementDescription().getName());
					it.newLine();
					it.append("\t * @param resourceSet the set of the resources that must be used for"); //$NON-NLS-1$
					it.newLine();
					it.append("\t *    containing the generated resource, and resolving types from names."); //$NON-NLS-1$
					it.newLine();
					it.append("\t * @return the factory."); //$NON-NLS-1$
					it.newLine();
					it.append("\t */"); //$NON-NLS-1$
					it.newLine();
					it.append("\t@"); //$NON-NLS-1$
					it.append(Pure.class);
					it.newLine();
					it.append("\tpublic "); //$NON-NLS-1$
					it.append(description.getElementDescription().getBuilderInterfaceType());
					it.append(" "); //$NON-NLS-1$
					it.append(createFunctionName);
					it.append("(String name, "); //$NON-NLS-1$
					it.append(ResourceSet.class);
					it.append(" resourceSet) {"); //$NON-NLS-1$
					it.newLine();
					it.append("\t\treturn "); //$NON-NLS-1$
					it.append(createFunctionName);
					it.append("(name, createResource(resourceSet));"); //$NON-NLS-1$
					it.newLine();
					it.append("\t}"); //$NON-NLS-1$
					it.newLineIfNotEmpty();
					it.newLine();
					it.append("\t/** Create the factory for a " + getLanguageName() + " " //$NON-NLS-1$ //$NON-NLS-2$
							+ description.getElementDescription().getElementType().getSimpleName() + "."); //$NON-NLS-1$
					it.newLine();
					it.append("\t * @param name the name of the " //$NON-NLS-1$
							+ description.getElementDescription().getName());
					it.newLine();
					it.append("\t * @param resource the resource that must be used for"); //$NON-NLS-1$
					it.newLine();
					it.append("\t *    containing the generated resource, and resolving types from names."); //$NON-NLS-1$
					it.newLine();
					it.append("\t * @return the factory."); //$NON-NLS-1$
					it.newLine();
					it.append("\t */"); //$NON-NLS-1$
					it.newLine();
					it.append("\t@"); //$NON-NLS-1$
					it.append(Pure.class);
					it.newLine();
					it.append("\tpublic "); //$NON-NLS-1$
					it.append(description.getElementDescription().getBuilderInterfaceType());
					it.append(" "); //$NON-NLS-1$
					it.append(createFunctionName);
					it.append("(String name, "); //$NON-NLS-1$
					it.append(Resource.class);
					it.append(" resource) {"); //$NON-NLS-1$
					it.newLine();
					it.append("\t\t"); //$NON-NLS-1$
					it.append(getScriptBuilderInterface());
					it.append(" scriptBuilder = createScript(getFooPackageName(), resource);"); //$NON-NLS-1$
					it.newLine();
					it.append("\t\t"); //$NON-NLS-1$
					it.append(containerBuilder);
					it.append(" containerBuilder = scriptBuilder."); //$NON-NLS-1$
					it.append(createContainerFunctionName);
					it.append("(getFooTypeName());"); //$NON-NLS-1$
					it.newLine();
					it.append("\t\treturn containerBuilder.add"); //$NON-NLS-1$
					it.append(Strings.toFirstUpper(modifier));
					it.append(Strings.toFirstUpper(description.getElementDescription().getName()));
					it.append("(name);"); //$NON-NLS-1$
					it.newLine();
					it.append("\t}"); //$NON-NLS-1$
					it.newLineIfNotEmpty();
					it.newLine();
				}
			});
			if (enableAppenders) {
				final String buildFunctionName = "build" //$NON-NLS-1$
						+ Strings.toFirstUpper(modifier)
						+ Strings.toFirstUpper(description.getElementDescription().getName());
				final TypeReference appender = getCodeElementExtractor().getElementAppenderImpl(
						description.getElementDescription().getName());
				this.builderFactoryContributions.addContribution(new StringConcatenationClient() {
					@Override
					protected void appendTo(TargetStringConcatenation it) {
						it.append("\t/** Create the appender for a " + getLanguageName() + " " //$NON-NLS-1$ //$NON-NLS-2$
								+ description.getElementDescription().getElementType().getSimpleName() + "."); //$NON-NLS-1$
						it.newLine();
						it.append("\t * @param name the name of the " //$NON-NLS-1$
								+ description.getElementDescription().getName());
						it.newLine();
						it.append("\t * @param resourceSet the set of the resources that must be used for"); //$NON-NLS-1$
						it.newLine();
						it.append("\t *    containing the generated resource, and resolving types from names."); //$NON-NLS-1$
						it.newLine();
						it.append("\t * @return the appender."); //$NON-NLS-1$
						it.newLine();
						it.append("\t */"); //$NON-NLS-1$
						it.newLine();
						it.append("\t@"); //$NON-NLS-1$
						it.append(Pure.class);
						it.newLine();
						it.append("\tpublic "); //$NON-NLS-1$
						it.append(appender);
						it.append(" "); //$NON-NLS-1$
						it.append(buildFunctionName);
						it.append("(String name, "); //$NON-NLS-1$
						it.append(ResourceSet.class);
						it.append(" resourceSet) {"); //$NON-NLS-1$
						it.newLine();
						it.append("\t\t"); //$NON-NLS-1$
						it.append(appender);
						it.append(" a = new "); //$NON-NLS-1$
						it.append(appender);
						it.append("("); //$NON-NLS-1$
						it.append(createFunctionName);
						it.append("(name, resourceSet));"); //$NON-NLS-1$
						it.newLine();
						it.append("\t\tgetInjector().injectMembers(a);"); //$NON-NLS-1$
						it.newLine();
						it.append("\t\treturn a;"); //$NON-NLS-1$
						it.newLine();
						it.append("\t}"); //$NON-NLS-1$
						it.newLineIfNotEmpty();
						it.newLine();
						it.append("\t/** Create the appender for a " + getLanguageName() + " " //$NON-NLS-1$ //$NON-NLS-2$
								+ description.getElementDescription().getElementType().getSimpleName() + "."); //$NON-NLS-1$
						it.newLine();
						it.append("\t * @param name the name of the " //$NON-NLS-1$
								+ description.getElementDescription().getName());
						it.newLine();
						it.append("\t * @param resource the resource that must be used for"); //$NON-NLS-1$
						it.newLine();
						it.append("\t *    containing the generated resource, and resolving types from names."); //$NON-NLS-1$
						it.newLine();
						it.append("\t * @return the appender."); //$NON-NLS-1$
						it.newLine();
						it.append("\t */"); //$NON-NLS-1$
						it.newLine();
						it.append("\t@"); //$NON-NLS-1$
						it.append(Pure.class);
						it.newLine();
						it.append("\tpublic "); //$NON-NLS-1$
						it.append(appender);
						it.append(" "); //$NON-NLS-1$
						it.append(buildFunctionName);
						it.append("(String name, "); //$NON-NLS-1$
						it.append(Resource.class);
						it.append(" resource) {"); //$NON-NLS-1$
						it.newLine();
						it.append("\t\t"); //$NON-NLS-1$
						it.append(appender);
						it.append(" a = new "); //$NON-NLS-1$
						it.append(appender);
						it.append("("); //$NON-NLS-1$
						it.append(createFunctionName);
						it.append("(name, resource));"); //$NON-NLS-1$
						it.newLine();
						it.append("\t\tgetInjector().injectMembers(a);"); //$NON-NLS-1$
						it.newLine();
						it.append("\t\treturn a;"); //$NON-NLS-1$
						it.newLine();
						it.append("\t}"); //$NON-NLS-1$
						it.newLineIfNotEmpty();
						it.newLine();
					}
				});
			}
		}
	}
309430
@Override
	protected boolean isValidProposal(String proposal, String prefix, ContentAssistContext context) {
		// A valid proposal cannot be an hidden feature
		return !Utils.isHiddenMember(proposal) && super.isValidProposal(proposal, prefix, context);
	}
770600
public HadMember doAction(HadMember o) {
        List<QualifiedName> qq=new LinkedList<QualifiedName>();
        if (o.getEntity()!=null) {
            for (QualifiedName eid:o.getEntity()) {
                qq.add(eid);
            }
        }
        return c.newHadMember(o.getCollection(), qq);
        
       /*remember, scruffy hadmember in provn, has a null in get(0)!!
	return deprecated.convertHadMember(deprecated.doAction((o.getCollection()==null) ? null: 	                                    
	                                      o.getCollection().getRef()),
	                          ((o.getEntity()==null || (o.getEntity().isEmpty())) ?
	                        	  deprecated.doAction(null) :
	                        	  deprecated.doAction((o.getEntity().get(0)==null) ? 
	                        		     null :
	                        	             o.getEntity().get(0).getRef()))); */
    }
710930
public void setPromoted(final boolean promoted) {
        this.promoted = promoted;

        for (final Artifact artifact : artifacts) {
            artifact.setPromoted(promoted);
        }

        for (final Module suModule : submodules) {
            suModule.setPromoted(promoted);
        }
    }
145304
private Artifact getArtifactResult(Artifact desiredArtifact) throws MojoExecutionException {// NOSONAR
        ArtifactRequest artifactRequest = new ArtifactRequest();
        artifactRequest.setArtifact(desiredArtifact);
        artifactRequest.setRepositories(repositoryList);
        try {
            return repositorySystem.resolveArtifact(repositorySystemSession, artifactRequest).getArtifact();
        } catch (ArtifactResolutionException e) {
            throw new MojoExecutionException(e.getMessage(), e);
        }
    }
462709
private synchronized void sendTransportCandidateOffer(TransportCandidate cand) throws NotConnectedException, InterruptedException {
        if (!cand.isNull()) {
            // Offer our new candidate...
            addOfferedCandidate(cand);
            JingleContent content = parentNegotiator.getJingleContent();
            content.addJingleTransport(getJingleTransport(cand));
            Jingle jingle = new Jingle(JingleActionEnum.TRANSPORT_INFO);
            jingle.addContent(content);

            // We SHOULD NOT be sending packets directly.
            // This circumvents the state machinery.
            // TODO - work this into the state machinery.
            session.sendFormattedJingle(jingle);
        }
    }
438334
@Deprecated
	protected boolean doValidateLambdaContents(XClosure closure, DiagnosticChain diagnostics, Map<Object, Object> context) {
		return true;
	}
1179041
@Override
	public List<ArtiDAO.Data> toArtifact(AuthzTrans trans, Artifacts artifacts) {
		List<ArtiDAO.Data> ladd = new ArrayList<ArtiDAO.Data>();
		for(Artifact arti : artifacts.getArtifact()) {
			ArtiDAO.Data data = new ArtiDAO.Data();
			data.mechid = arti.getMechid();
			data.machine = arti.getMachine();
			data.type(true).addAll(arti.getType());
			data.ca = arti.getCa();
			data.dir = arti.getDir();
			data.os_user = arti.getOsUser();
			// Optional (on way in)
			data.appName = arti.getAppName();
			data.renewDays = arti.getRenewDays();
			data.notify = arti.getNotification();
			
			// Ignored on way in for create/update
			data.sponsor = arti.getSponsor();
			data.expires = null;
			
			// Derive Optional Data from Machine (Domain) if exists
			if(data.machine!=null) {
				if(data.ca==null) {
					if(data.machine.endsWith(".att.com")) {
						data.ca = "aaf"; // default
					}
				}
				if(data.appName==null ) {
					data.appName=AAFCon.reverseDomain(data.machine);
				}
			}

			ladd.add(data);
		}
		return ladd;
	}
369825
@VisibleForTesting
  static Distribution createDistribution(io.opencensus.metrics.export.Distribution distribution) {
    Distribution.Builder builder =
        Distribution.newBuilder()
            .setBucketOptions(createBucketOptions(distribution.getBucketOptions()))
            .setCount(distribution.getCount())
            .setMean(
                distribution.getCount() == 0 ? 0 : distribution.getSum() / distribution.getCount())
            .setSumOfSquaredDeviation(distribution.getSumOfSquaredDeviations());
    setBucketCountsAndExemplars(distribution.getBuckets(), builder);
    return builder.build();
  }