/*
/////////////////////////////////////////////////////////
Package methods, output validation problem reporting
/////////////////////////////////////////////////////////
963518
protected void reportInvalidContent(int evtType)
        throws XMLStreamException
    {
        switch (mVldContent) {
        case XMLValidator.CONTENT_ALLOW_NONE:
            reportValidationProblem(ErrorConsts.ERR_VLD_EMPTY,
                                    getTopElementDesc(),
                                    ErrorConsts.tokenTypeDesc(evtType));
            break;
        case XMLValidator.CONTENT_ALLOW_WS:
            reportValidationProblem(ErrorConsts.ERR_VLD_NON_MIXED,
                                    getTopElementDesc());
            break;
        case XMLValidator.CONTENT_ALLOW_VALIDATABLE_TEXT:
        case XMLValidator.CONTENT_ALLOW_ANY_TEXT:
            /* Not 100% sure if this should ever happen... depends on
             * interpretation of 'any' content model?
             */
            reportValidationProblem(ErrorConsts.ERR_VLD_ANY,
                                    getTopElementDesc(),
                                    ErrorConsts.tokenTypeDesc(evtType));
            break;
        default: // should never occur:
            reportValidationProblem("Internal error: trying to report invalid content for "+evtType);
        }
    }
262450
public List<Project> validate(boolean validateRefs) throws IOException {
        for (Project project : projects) {
            for (ValidationEntry validationEntry : project.validationEntries) {
                MetatypeRoot metatype = validationEntry.parsedMetatype;
                metatype.setMetatypeFileName(validationEntry.fileName);
                metatype.setOcdStats(ocdStats);
                metatype.setNlsKeys(validationEntry.nlsKeys);
                metatype.validate(validateRefs);
                validationEntry.validity = metatype.getValidityState();

                File outputFile = new File(outputPath + "/" + project.name + "/" + validationEntry.fileName + getExtension(validationEntry.fileName));
                outputFile.getParentFile().mkdirs();
                int pass = 0;
                int fail = 0;
                if (!validationEntry.localizationFound) {
                    validationEntry.validity = ValidityState.Failure;
                    fail++;
                } else {
                    pass++;
                }

                fail += metatype.getErrorMessages().size();
                pass += metatype.getWarningMessages().size() + metatype.getInfoMessages().size();

                for (MetatypeDesignate designate : metatype.getDesignates()) {
                    fail += designate.getErrorMessages().size();
                    pass += designate.getWarningMessages().size() + designate.getInfoMessages().size();

                    for (MetatypeObject object : designate.getObjects()) {
                        fail += object.getErrorMessages().size();
                        pass += object.getWarningMessages().size() + object.getInfoMessages().size();

                        MetatypeOcd ocd = object.getMatchingOcd();

                        if (ocd != null) {
                            fail += ocd.getErrorMessages().size();
                            pass += ocd.getWarningMessages().size() + ocd.getInfoMessages().size();

                            for (MetatypeAd ad : ocd.getAds()) {
                                fail += ad.getErrorMessages().size();
                                pass += ad.getWarningMessages().size() + ad.getInfoMessages().size();

                                for (MetatypeAdOption option : ad.getOptions()) {
                                    fail += option.getErrorMessages().size();
                                    pass += option.getWarningMessages().size() + option.getInfoMessages().size();
                                }
                            }
                        }
                    }

                }

                PrintStream junit = new PrintStream(outputFile);
                junit.printf("<testsuite errors=\"%s\" failures=\"%s\" name=\"%s\" tests=\"%s\" time=\"\">%n", "0", fail, project.name, fail + pass);

                if (!validationEntry.localizationFound) {
                    junit.printf("<testcase classname=\"%s\" name=\"%s\">%n", project.name, "localizationFileNotFound");
                    junit.printf("<failure message=\"%s\"><![CDATA[%s]]></failure>%n", "Could not find file " + metatype.getLocalization(), "");
                    junit.printf("</testcase>%n");
                }

                String fileName = validationEntry.fileName;
                processMetatype(project, metatype, fileName, junit);

                for (MetatypeDesignate designate : metatype.getDesignates()) {
                    String pid = designate.getPid();
                    if (pid == null)
                        pid = designate.getFactoryPid();
                    processMetatype(project, designate, fileName + "." + pid, junit);

                    for (MetatypeObject object : designate.getObjects()) {
                        processMetatype(project, object, fileName + "." + pid, junit);

                        MetatypeOcd ocd = object.getMatchingOcd();

                        if (ocd != null) {
                            processMetatype(project, ocd, fileName + "." + pid, junit);

                            for (MetatypeAd ad : ocd.getAds()) {
                                String id = ad.getId();
                                processMetatype(project, ad, fileName + "." + pid + "." + id, junit);

                                for (MetatypeAdOption option : ad.getOptions()) {
                                    processMetatype(project, option, fileName + "." + pid + "." + id + "." + option, junit);
                                }
                            }
                        }
                    }
                }

                junit.printf("</testsuite>%n");

                junit.close();
                String failMsg = (fail > 0) ? "**FAILURE**" : "";
                System.out.println("Metatype validation " + failMsg + " for " + validationEntry.fileName + " written to " + outputFile.getAbsolutePath());
            }
        }

        if (!errors.isEmpty()) {
            throw new IllegalStateException("xml parse errors:\n" + errors);
        }
        return projects;
    }
1191730
private void reportErrors( Collection<RoboconfError> errors ) throws IOException {

		// Add a log entry
		getLog().info( "Generating a report for validation errors under " + MavenPluginConstants.VALIDATION_RESULT_PATH );

		// Generate the report (file and console too)
		StringBuilder sb = MavenPluginUtils.formatErrors( errors, getLog());

		// Write the report.
		// Reporting only makes sense when there is an error or a warning.
		File targetFile = new File( this.project.getBasedir(), MavenPluginConstants.VALIDATION_RESULT_PATH );
		Utils.createDirectory( targetFile.getParentFile());
		Utils.writeStringInto( sb.toString(), targetFile );
	}
1353019
function completeOutput(outputCSS = '') {


		if (OPTIONS.css_output !== '') {
			// console.log(outputCSS)


			//write output
			try {
				if (OPTIONS.format_4095_rules_legacy_limit) {
					// console.log(summary.stats.after.noRules)
					var noOutputFilesNeeded = Math.ceil(summary.stats.after.noRules / 4095);
					// console.log(noOutputFilesNeeded)
					

					if (noOutputFilesNeeded == 1) {

						outputCSS = trimCSS(outputCSS);
						outputCSS = restoreHacks(outputCSS);
						write(OPTIONS.css_output, outputCSS);
						filesizeKB = getFilesizeInKiloBytes(OPTIONS.css_output);
					} else { //group 4095 rules

						try {
							var ast = css.parse(outputCSS, { source: fileLocation });
						} catch(err) {
							console.log(error("CSS Parser2 Error: probably have something funny in your CSS, change it then please try again."));
							console.log('Reason: ' + err.reason);
							console.log('Line: ' + err.line);
							console.log('Column: ' + err.column);
							console.log('Filename: ' + err.filename);
							process.exit(1);
						}

						var rulesGroups = [];
						var rulesGroupsLen = 0;
						var rules = ast.stylesheet.rules;
						var ruleslen = rules.length;
						var ruleCount = 0;
						var groupCount = 0;

						for (i = 0; i < ruleslen; ++i) {

							if (rulesGroups[groupCount] === undefined) {
								rulesGroups[groupCount] = [];
							}
							rulesGroups[groupCount].push(rules[i]);
							ruleCount += 1;

							if (ruleCount == 4095) {
								groupCount += 1;
							}
						}
						rulesGroupsLen = rulesGroups.length;
						filesizeKB = 0;
						outputFilename = '';
						for (i = 0; i < rulesGroupsLen; i++) {

							outputAST = {
								type: 'stylesheet',
								stylesheet: {
									rules: rulesGroups[i]
								}
							};
							outputCSS = css.stringify(outputAST);

							outputCSS = trimCSS(outputCSS);
							outputCSS = restoreHacks(outputCSS);
							outputFilename = OPTIONS.css_output.substr(0, OPTIONS.css_output.length-4) + '_' + i + '.css';
							write(outputFilename, outputCSS);

							filesizeKB += getFilesizeInKiloBytes(outputFilename);
						}
					}
					
				} else {
					outputCSS = trimCSS(outputCSS);
					outputCSS = restoreHacks(outputCSS);
					if (OPTIONS.css_output === null || OPTIONS.css_output === undefined || OPTIONS.css_output == '') {
						var size = kiloByteLength(outputCSS);
						filesizeKB = size/1000;
					} else {
						write(OPTIONS.css_output, outputCSS);
						filesizeKB = getFilesizeInKiloBytes(OPTIONS.css_output);
					}
				}
				
			} catch(e) {
				console.log(error("Output file error: Something went wrong while writing the file, check your folder permissions, config_css.json and please try again."));
				console.log(e);
				process.exit(1);
			}

		} else {
			outputCSS = trimCSS(outputCSS);
			outputCSS = restoreHacks(outputCSS);
			filesizeKB = kiloByteLength(outputCSS);
		}

		summary.stats.after.totalFileSizeKB += filesizeKB;
		summary.stats.summary.savingsKB = roundTo(summary.stats.before.totalFileSizeKB - summary.stats.after.totalFileSizeKB, 4);
		summary.stats.summary.savingsPercentage = roundTo(summary.stats.summary.savingsKB / summary.stats.before.totalFileSizeKB * 100, 2);

		//write report
		if (OPTIONS.generate_report) {

			try {
				var cssdata = JSON.stringify(summary, null, '\t');
				write(REPORT_DUPLICATE_CSS, JSON.stringify(summary, null, '\t'));
			} catch(e) {
				console.log(error("Report output file error: Something went wrong while writing the file, check your folder permissions, config_css.json and please try again."));
				console.log(e);
				process.exit(1);
			}
		}

		if (OPTIONS.verbose) {

			console.log(cool('Before: ' + summary.stats.before.totalFileSizeKB + 'KB'));
			console.log(cool('After: ' + summary.stats.after.totalFileSizeKB + 'KB'));
			console.log(cool('Saved: ' + summary.stats.summary.savingsKB + 'KB (' + summary.stats.summary.savingsPercentage + '%)'));

			console.timeEnd(logoRed("Purged " + timeLabel + " in "));
		}

		if (OPTIONS.css_output === null || OPTIONS.css_output === undefined || OPTIONS.css_output == '') {
			return outputCSS;
		} else {

			// console.log(OPTIONS.css_output);
			
		}
	}
236145
@Override
	public boolean validate(final Problems problems, final String compName, final String model) {
		final char[] chars = model.toCharArray();
		for (final char c : chars) {
			if (Character.isWhitespace(c)) {
				problems.add(ValidationBundle.getMessage(MayNotContainSpacesValidator.class, "MAY_NOT_CONTAIN_WHITESPACE", compName)); // NOI18N
				return false;
			}
		}
		return true;
	}
780401
function validatePackageInformation( $package, $http, $currentStepID, &$stepMap, &$persistentData, &$errorList )
    {
        $packageName = false;
        $packageSummary = false;
        $packageVersion = false;
        $packageDescription = false;
        $packageLicence = 'GPL';
        $packageHost = false;
        $packagePackager = false;
        if ( $http->hasPostVariable( 'PackageName' ) )
        {
            $packageName = trim( $http->postVariable( 'PackageName' ) );
        }
        if ( $http->hasPostVariable( 'PackageSummary' ) )
            $packageSummary = $http->postVariable( 'PackageSummary' );
        if ( $http->hasPostVariable( 'PackageDescription' ) )
            $packageDescription = $http->postVariable( 'PackageDescription' );
        if ( $http->hasPostVariable( 'PackageVersion' ) )
            $packageVersion = trim( $http->postVariable( 'PackageVersion' ) );
        if ( $http->hasPostVariable( 'PackageLicence' ) )
            $packageLicence = $http->postVariable( 'PackageLicence' );
        if ( $http->hasPostVariable( 'PackageHost' ) )
            $packageHost = $http->postVariable( 'PackageHost' );
        if ( $http->hasPostVariable( 'PackagePackager' ) )
            $packagePackager = $http->postVariable( 'PackagePackager' );

        $persistentData['name'] = $packageName;
        $persistentData['summary'] = $packageSummary;
        $persistentData['description'] = $packageDescription;
        $persistentData['version'] = $packageVersion;
        $persistentData['licence'] = $packageLicence;
        $persistentData['host'] = $packageHost;
        $persistentData['packager'] = $packagePackager;

        $result = true;
        if ( $packageName == '' )
        {
            $errorList[] = array( 'field' => ezpI18n::tr( 'kernel/package', 'Package name' ),
                                  'description' => ezpI18n::tr( 'kernel/package', 'Package name is missing' ) );
            $result = false;
        }
        else
        {
            $existingPackage = eZPackage::fetch( $packageName, false, true );
            if ( $existingPackage )
            {
                $errorList[] = array( 'field' => ezpI18n::tr( 'kernel/package', 'Package name' ),
                                      'description' => ezpI18n::tr( 'kernel/package', 'A package named %packagename already exists, please give another name', false, array( '%packagename' => $packageName ) ) );
                $result = false;
            }
            else
            {
                // Make sure the package name contains only valid characters
                $trans = eZCharTransform::instance();
                $validPackageName = $trans->transformByGroup( $packageName, 'identifier' );
                if ( strcmp( $validPackageName, $packageName ) != 0 )
                {
                    $errorList[] = array( 'field' => ezpI18n::tr( 'kernel/package', 'Package name' ),
                                          'description' => ezpI18n::tr( 'kernel/package', "The package name %packagename is not valid, it can only contain characters in the range a-z, 0-9 and underscore.", false, array( '%packagename' => $packageName ) ) );
                    $result = false;
                }
            }
        }
        if ( !$packageSummary )
        {
            $errorList[] = array( 'field' => ezpI18n::tr( 'kernel/package', 'Summary' ),
                                  'description' => ezpI18n::tr( 'kernel/package', 'Summary is missing' ) );
            $result = false;
        }
        if ( !preg_match( "#^[0-9](\.[0-9]([a-zA-Z]+[0-9]*)?)*$#", $packageVersion ) )
        {
            $errorList[] = array( 'field' => ezpI18n::tr( 'kernel/package', 'Version' ),
                                  'description' => ezpI18n::tr( 'kernel/package', 'The version must only contain numbers (optionally followed by text) and must be delimited by dots (.), e.g. 1.0, 3.4.0beta1' ) );
            $result = false;
        }
        return $result;
    }
926258
function outputWebpack(label, error, stats) {
	if (error)
		throw new Error(error);
		
	if (stats.hasErrors()) {
		$.util.log(stats.toString({ colors: true }));
	} else {
		const time = stats.endTime - stats.startTime;
		$.util.log(chalk.bgGreen(`Built ${label} in ${time} ms`));
	}
}
404167
function validatePackageMaintainer( $package, $http, $currentStepID, &$stepMap, &$persistentData, &$errorList )
    {
        $maintainerPerson = false;
        $maintainerEmail = false;
        $maintainerRole = false;
        if ( $http->hasPostVariable( 'PackageMaintainerPerson' ) )
            $maintainerPerson = trim( $http->postVariable( 'PackageMaintainerPerson' ) );
        if ( $http->hasPostVariable( 'PackageMaintainerEmail' ) )
            $maintainerEmail = $http->postVariable( 'PackageMaintainerEmail' );
        if ( $http->hasPostVariable( 'PackageMaintainerRole' ) )
            $maintainerRole = $http->postVariable( 'PackageMaintainerRole' );

        $persistentData['maintainer_person'] = $maintainerPerson;
        $persistentData['maintainer_email'] = $maintainerEmail;
        $persistentData['maintainer_role'] = $maintainerRole;

        $result = true;
        if ( trim( $maintainerPerson ) == '' )
        {
            $errorList[] = array( 'field' => ezpI18n::tr( 'kernel/package', 'Name' ),
                                  'description' => ezpI18n::tr( 'kernel/package', 'You must enter a name of the maintainer' ) );
            $result = false;
        }
        if ( trim( $maintainerEmail ) == '' )
        {
            $errorList[] = array( 'field' => ezpI18n::tr( 'kernel/package', 'Email' ),
                                  'description' => ezpI18n::tr( 'kernel/package', 'You must enter an email address of the maintainer' ) );
            $result = false;
        }
        return $result;
    }
1108235
public final void output(final Calendar calendar, final Writer out)
            throws IOException, ValidationException {
        if (isValidating()) {
            calendar.validate();
        }

        try (FoldingWriter writer = new FoldingWriter(out, foldLength)) {
            writer.write(calendar.toString());
        }
    }
1231708
@Override
	public void validate()
	{

		boolean flagA = !controller.isEnableSQLDatabaseOutput();
		boolean flagB = controller.isMultipleOutputFiles();

		OutputCompressionEnum oce = controller.getOutputCompression();

		enableZipEncodingCompression.setSelected(controller
				.isZipCompressionEnabled());

		disableOutputCompression.setSelected(oce == OutputCompressionEnum.None);

		enableBZip2OutputCompression
				.setSelected(oce == OutputCompressionEnum.BZip2);

		activateDataFileOutput.setSelected(controller.isEnableDataFileOutput());

		outputLabel.setEnabled(flagA);
		outputPathField.setEnabled(flagA);

		enableZipEncodingCompression.setEnabled(flagA);

		outputCompression.setEnabled(flagA);
		disableOutputCompression.setEnabled(flagA);

		enable7ZipOutputCompression.setEnabled(flagA
				&& controller.is7ZipEnabled());

		enable7ZipOutputCompression
			.setSelected(oce == OutputCompressionEnum.SevenZip);

		enableBZip2OutputCompression.setEnabled(flagA);

		//Enable multiple output files only for uncompressed output
		enableMultipleOutputFiles.setEnabled(flagA&&(oce == OutputCompressionEnum.None));
		enableMultipleOutputFiles.setSelected(flagB);

		outputSizeLimitLabel.setEnabled(flagA && flagB&&(oce == OutputCompressionEnum.None));
		outputSizeLimitField.setEnabled(flagA && flagB&&(oce == OutputCompressionEnum.None));


	}
665132
@Override
	protected void validateComponent(final List<Diagnostic> diags) {
		super.validateComponent(diags);

		String[] values = getValue();

		if (values != null) {
			int max = getMaxLength();
			int min = getMinLength();
			Pattern pattern = getComponentModel().pattern;

			for (String value : values) {
				boolean invalid = false;

				if (Util.empty(value)) {
					continue;
				}

				// Minimum Length
				if (min > 0 && value.length() < min) {
					diags.add(createErrorDiagnostic(
							InternalMessages.DEFAULT_VALIDATION_ERROR_MIN_LENGTH, this,
							String.valueOf(min)));
					invalid = true;
				}

				// Maximum Length
				if (max > 0 && value.length() > max) {
					diags.add(createErrorDiagnostic(
							InternalMessages.DEFAULT_VALIDATION_ERROR_MAX_LENGTH, this,
							String.valueOf(max)));
					invalid = true;
				}

				// Pattern
				if (pattern != null) {
					Matcher matcher = pattern.matcher(value);
					if (!matcher.matches()) {
						diags.add(createErrorDiagnostic(
								InternalMessages.DEFAULT_VALIDATION_ERROR_INVALID_PATTERN, this));
						invalid = true;
					}
				}

				// Only report the first invalid item
				if (invalid) {
					break;
				}
			}
		}
	}
263663
function (file, errors, options) {
      var reports = []
        , content = file.content.split('\n');

      errors.forEach(function error (err) {
        // some linters don't return the location -_-
        if (!err.line) return reports.push(err.message.grey, '');

        var start = err.line > 3 ? err.line - 3 : 0
          , stop = err.line + 2
          , range = content.slice(start, stop)
          , numbers = _.range(start + 1, stop + 1)
          , len = stop.toString().length;

        reports.push('Lint error: ' + err.line + ' col ' + err.column);
        range.map(function reformat (line) {
          var lineno = numbers.shift()
            , offender = lineno === err.line
            , inline = /\'[^\']+?\'/
            , slice;

          // this is the actual line with the error, so we should start finding
          // what the error is and how we could highlight it in the output
          if (offender) {
            if (line.length < err.column) {
              // we are missing something at the end of the line.. so add a red
              // square
              line += ' '.inverse.red;
            } else {
              // we have a direct match on a statement
              if (inline.test(err.message)) {
                slice = err.message.match(inline)[0].replace(/\'/g, '');
              } else {
                // it's happening in the center of things, so we can start
                // coloring inside the shizzle
                slice = line.slice(err.column - 1);
              }

              line = line.replace(slice, slice.inverse.red);
            }
          }

          reports.push('  ' + pad(lineno, len) + ' | ' + line);
        });

        reports.push('');
        reports.push(err.message.grey);
        reports.push('');

      });

      // output the shizzle
      reports.forEach(function output (line) {
        this.logger.error(line);
      }.bind(this));
    }
1212959
public void validate() throws PackagingException {
        if (control == null || !control.isDirectory()) {
            throw new PackagingException("The 'control' attribute doesn't point to a directory. " + control);
        }

        if (changesIn != null) {

            if (changesIn.exists() && (!changesIn.isFile() || !changesIn.canRead())) {
                throw new PackagingException("The 'changesIn' setting needs to point to a readable file. " + changesIn + " was not found/readable.");
            }

            if (changesOut != null && !isWritableFile(changesOut)) {
                throw new PackagingException("Cannot write the output for 'changesOut' to " + changesOut);
            }

            if (changesSave != null && !isWritableFile(changesSave)) {
                throw new PackagingException("Cannot write the output for 'changesSave' to " + changesSave);
            }

        } else {
            if (changesOut != null || changesSave != null) {
                throw new PackagingException("The 'changesOut' or 'changesSave' settings may only be used when there is a 'changesIn' specified.");
            }
        }

        if (Compression.toEnum(compression) == null) {
            throw new PackagingException("The compression method '" + compression + "' is not supported (expected 'none', 'gzip', 'bzip2' or 'xz')");
        }

        if (deb == null) {
            throw new PackagingException("You need to specify where the deb file is supposed to be created.");
        }

        getDigestCode(digest);
    }
470857
@Override
	public boolean validate(final Problems problems, final String compName, final String model) {
		try {
			final URL url = new URL(model);
			// java.net.url does not require US-ASCII host names,
			// but the spec does
			final String host = url.getHost();
			if (!"".equals(host)) { // NOI18N
				return new ValidHostNameOrIPValidator(true).validate(problems, compName, host);
			}
			final String protocol = url.getProtocol();
			if ("mailto".equals(protocol)) { // NOI18N
				String emailAddress = url.toString().substring("mailto:".length()); // NOI18N
				emailAddress = emailAddress == null ? "" : emailAddress;
				return new EmailAddressValidator().validate(problems, compName, emailAddress);
			}
			return true;
		} catch (final MalformedURLException e) {
			final String problem = ValidationBundle.getMessage(UrlValidator.class, "URL_NOT_VALID", model); // NOI18N
			problems.add(problem);
			return false;
		}
	}
864632
@Override
	public boolean validate(final Problems problems, final String compName, final String model) {
		if (model.length() == 0) {
			problems.add(ValidationBundle.getMessage(HostNameValidator.class, "INVALID_HOST_NAME", compName, model)); // NOI18N
			return false;
		}
		if (model.startsWith(".") || model.endsWith(".")) { // NOI18N
			problems.add(ValidationBundle.getMessage(IpAddressValidator.class, "HOST_STARTS_OR_ENDS_WITH_PERIOD", model)); // NOI18N
			return false;
		}
		final String[] parts = model.split("\\.");
		if (parts.length > 4) {
			problems.add(ValidationBundle.getMessage(IpAddressValidator.class, "TOO_MANY_LABELS", model)); // NOI18N
			return false;
		}
		if (!this.allowPort && model.contains(":")) { // NOI18N
			problems.add(ValidationBundle.getMessage(HostNameValidator.class, "MSG_PORT_NOT_ALLOWED", compName, model)); // NOI18N
			return false;
		}
		final boolean result = new MayNotContainSpacesValidator().validate(problems, compName, model);
		if (!result) {
			return false;
		}
		if (model.endsWith("-") || model.startsWith("-")) {
			problems.add(ValidationBundle.getMessage(HostNameValidator.class, "INVALID_HOST_NAME", compName, model)); // NOI18N
			return false;
		}

		for (int i = 0; i < parts.length; i++) {
			final String label = parts[i];
			if (label.length() > 63) {
				problems.add(ValidationBundle.getMessage(HostNameValidator.class, "LABEL_TOO_LONG", label)); // NOI18N
				return false;
			}
			if (i == parts.length - 1 && label.indexOf(":") > 0) {
				final String[] labelAndPort = label.split(":");
				if (labelAndPort.length > 2) {
					problems.add(ValidationBundle.getMessage(HostNameValidator.class, "INVALID_PORT", compName, label)); // NOI18N
					return false;
				}
				if (labelAndPort.length == 1) {
					problems.add(ValidationBundle.getMessage(HostNameValidator.class, "INVALID_PORT", compName, "''")); // NOI18N
					return false;
				} else {
					if (label.endsWith(":")) {
						problems.add(ValidationBundle.getMessage(HostNameValidator.class, "TOO_MANY_COLONS", compName, label)); // NOI18N
						return false;
					}
					try {
						final int port = Integer.parseInt(labelAndPort[1]);
						if (port < 0) {
							problems.add(ValidationBundle.getMessage(IpAddressValidator.class, "NEGATIVE_PORT", port)); // NOI18N
							return false;
						} else if (port >= 65536) {
							problems.add(ValidationBundle.getMessage(IpAddressValidator.class, "PORT_TOO_HIGH", port)); // NOI18N
							return false;
						}
					} catch (final NumberFormatException e) {
						problems.add(ValidationBundle.getMessage(HostNameValidator.class, "INVALID_PORT", compName, labelAndPort[1])); // NOI18N
						return false;
					}
					if (!checkHostPart(labelAndPort[0], problems, compName)) {
						return false;
					}
				}
			} else {
				if (!checkHostPart(label, problems, compName)) {
					return false;
				}
			}
		}
		return true;
	}
1361502
private void verifyInput() {
        if (inData == null || inStations == null) {
            throw new NullPointerException(msg.message("kriging.stationproblem"));
        }
        if (pMode < 0 || pMode > 1) {
            throw new IllegalArgumentException(msg.message("kriging.defaultMode"));
        }

        if (defaultVariogramMode != 0 && defaultVariogramMode != 1) {
            throw new IllegalArgumentException(msg.message("kriging.variogramMode"));
        }
        if (defaultVariogramMode == 0) {
            if (pVariance == 0 || pIntegralscale[0] == 0 || pIntegralscale[1] == 0 || pIntegralscale[2] == 0) {

                pm.errorMessage(msg.message("kriging.noParam"));
                pm.errorMessage("varianza " + pVariance);
                pm.errorMessage("Integral scale x " + pIntegralscale[0]);
                pm.errorMessage("Integral scale y " + pIntegralscale[1]);
                pm.errorMessage("Integral scale z " + pIntegralscale[2]);
            }
        }
        if (defaultVariogramMode == 1) {
            if (pNug == 0 || pS == 0 || pA == 0) {
                pm.errorMessage(msg.message("kriging.noParam"));
                pm.errorMessage("Nugget " + pNug);
                pm.errorMessage("Sill " + pS);
                pm.errorMessage("Range " + pA);
            }
        }

        if ((pMode == 0) && inInterpolate == null) {
            throw new ModelsIllegalargumentException(msg.message("kriging.noPoint"), this, pm);
        }
        if (pMode == 1 && inInterpolationGrid == null) {
            throw new ModelsIllegalargumentException("The gridded interpolation needs a gridgeometry in input.", this, pm);
        }

    }
713006
private static void checkPattern(String s) throws ProblemException {
        // Package names like foo.bar.gamma are allowed, and
        // package names suffixed with .* like foo.bar.* are
        // also allowed.
        Pattern p = Pattern.compile("[a-zA-Z_]{1}[a-zA-Z0-9_]*(\\.[a-zA-Z_]{1}[a-zA-Z0-9_]*)*(\\.\\*)?+");
        Matcher m = p.matcher(s);
        if (!m.matches()) {
            throw new ProblemException("The string \""+s+"\" is not a proper package name pattern.");
        }
    }