@Override
  public void meet(IsNumeric node) throws RuntimeException {
    ValueExpr arg = node.getArg();

    // operator must be a variable or a constant
    if (arg instanceof ValueConstant) {
      try {
        Double.parseDouble(((ValueConstant) arg).getValue().stringValue());
        builder.append(Boolean.toString(true));
      } catch (NumberFormatException ex) {
        builder.append(Boolean.toString(false));
      }
    } else if (arg instanceof Var) {
      String var = getVariableAlias((Var) arg);

      Preconditions.checkState(var != null, "no alias available for variable");

      builder
          .append("(")
          .append(var)
          .append(".ntype = 'int' OR ")
          .append(var)
          .append(".ntype = 'double')");
    }
  }
Example #2
0
  @Override
  public int compareTo(FSError other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetErrorCode()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, other.errorCode);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetErrorMsg()).compareTo(other.isSetErrorMsg());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetErrorMsg()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorMsg, other.errorMsg);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Example #3
0
 public NameAndValueList getMappingAssociationNames(String scheme, String version) {
   CodingSchemeVersionOrTag csvt = new CodingSchemeVersionOrTag();
   if (version != null) {
     csvt.setVersion(version);
   }
   NameAndValueList navList = new NameAndValueList();
   try {
     CodingScheme cs = lbSvc.resolveCodingScheme(scheme, csvt);
     Relations[] relations = cs.getRelations();
     for (int i = 0; i < relations.length; i++) {
       Relations relation = relations[i];
       Boolean isMapping = relation.isIsMapping();
       if (isMapping != null && isMapping.equals(Boolean.TRUE)) {
         AssociationPredicate[] associationPredicates = relation.getAssociationPredicate();
         for (int j = 0; j < associationPredicates.length; j++) {
           AssociationPredicate associationPredicate = associationPredicates[j];
           String name = associationPredicate.getAssociationName();
           NameAndValue vNameAndValue = new NameAndValue();
           vNameAndValue.setName(name);
           navList.addNameAndValue(vNameAndValue);
         }
         return navList;
       } else {
         return null;
       }
     }
   } catch (Exception ex) {
     ex.printStackTrace();
   }
   return null;
 }
  public String expandBody(MssCFGenContext genContext) {
    final String S_ProcName = "CFBamMssCFBindValueGenerateId.expandBody() ";

    if (genContext == null) {
      throw CFLib.getDefaultExceptionFactory()
          .newNullArgumentException(getClass(), "expandBody", 1, "genContext");
    }

    ICFLibAnyObj genDef = genContext.getGenDef();
    if (genDef == null) {
      throw CFLib.getDefaultExceptionFactory()
          .newNullArgumentException(getClass(), "expandBody", 1, "genContext.getGenDef()");
    }

    String ret;

    if (genDef instanceof ICFBamValueObj) {
      Boolean generateId = ((ICFBamValueObj) genDef).getOptionalGenerateId();
      if (generateId == null) {
        ret = null;
      } else if (generateId.booleanValue()) {
        ret = "yes";
      } else {
        ret = "no";
      }
    } else {
      throw CFLib.getDefaultExceptionFactory()
          .newUnsupportedClassException(
              getClass(), "expandBody", "genContext.getGenDef()", genDef, "ICFBamValueObj");
    }

    return (ret);
  }
  static class BooleanAttribute extends GenericAttribute implements RTFAttribute {
    boolean rtfDefault;
    boolean swingDefault;

    protected static final Boolean True = Boolean.valueOf(true);
    protected static final Boolean False = Boolean.valueOf(false);

    public BooleanAttribute(int d, Object s, String r, boolean ds, boolean dr) {
      super(d, s, r);
      swingDefault = ds;
      rtfDefault = dr;
    }

    public BooleanAttribute(int d, Object s, String r) {
      super(d, s, r);

      swingDefault = false;
      rtfDefault = false;
    }

    public boolean set(MutableAttributeSet target) {
      /* TODO: There's some ambiguity about whether this should
       *set* or *toggle* the attribute. */
      target.addAttribute(swingName, True);

      return true; /* true indicates we were successful */
    }

    public boolean set(MutableAttributeSet target, int parameter) {
      /* See above note in the case that parameter==1 */
      Boolean value = (parameter != 0 ? True : False);

      target.addAttribute(swingName, value);

      return true; /* true indicates we were successful */
    }

    public boolean setDefault(MutableAttributeSet target) {
      if (swingDefault != rtfDefault || (target.getAttribute(swingName) != null))
        target.addAttribute(swingName, Boolean.valueOf(rtfDefault));
      return true;
    }

    public boolean writeValue(Object o_value, RTFGenerator target, boolean force)
        throws IOException {
      Boolean val;

      if (o_value == null) val = Boolean.valueOf(swingDefault);
      else val = (Boolean) o_value;

      if (force || (val.booleanValue() != rtfDefault)) {
        if (val.booleanValue()) {
          target.writeControlWord(rtfName);
        } else {
          target.writeControlWord(rtfName, 0);
        }
      }
      return true;
    }
  }
  public boolean shouldSign(File input, List<Properties> containers) {
    Properties inf = null;

    // 1: Are we excluded from signing by our parents?
    // innermost jar is first on the list, it overrides outer jars
    for (Iterator<Properties> iterator = containers.iterator(); iterator.hasNext(); ) {
      inf = iterator.next();
      if (inf.containsKey(Utils.MARK_EXCLUDE_CHILDREN_SIGN)) {
        if (Boolean.valueOf(inf.getProperty(Utils.MARK_EXCLUDE_CHILDREN_SIGN)).booleanValue()) {
          if (verbose)
            System.out.println(
                input.getName() + "is excluded from signing by its containers."); // $NON-NLS-1$
          return false;
        }
        break;
      }
    }

    // 2: Is this jar itself marked as exclude?
    inf = Utils.getEclipseInf(input, verbose);
    if (inf != null
        && inf.containsKey(Utils.MARK_EXCLUDE_SIGN)
        && Boolean.valueOf(inf.getProperty(Utils.MARK_EXCLUDE_SIGN)).booleanValue()) {
      if (verbose)
        System.out.println(
            "Excluding " + input.getName() + " from signing."); // $NON-NLS-1$ //$NON-NLS-2$
      return false;
    }
    return true;
  }
  private static void collectFiredRules(
      ListMultimap<String, SimpleRule> firedRules, Rule rule, EvaluationContext context) {
    Predicate predicate = rule.getPredicate();
    if (predicate == null) {
      throw new InvalidFeatureException(rule);
    }

    Boolean status = PredicateUtil.evaluate(predicate, context);
    if (status == null || !status.booleanValue()) {
      return;
    } // End if

    if (rule instanceof SimpleRule) {
      SimpleRule simpleRule = (SimpleRule) rule;

      firedRules.put(simpleRule.getScore(), simpleRule);
    } else if (rule instanceof CompoundRule) {
      CompoundRule compoundRule = (CompoundRule) rule;

      List<Rule> childRules = compoundRule.getRules();
      for (Rule childRule : childRules) {
        collectFiredRules(firedRules, childRule, context);
      }
    }
  }
  static {
    System.setProperty("svnkit.log.native.calls", "true");
    final JavaSVNDebugLogger logger =
        new JavaSVNDebugLogger(
            Boolean.getBoolean(LOG_PARAMETER_NAME), Boolean.getBoolean(TRACE_NATIVE_CALLS), LOG);
    SVNDebugLog.setDefaultLog(logger);

    SVNJNAUtil.setJNAEnabled(true);
    SvnHttpAuthMethodsDefaultChecker.check();

    SVNAdminAreaFactory.setSelector(new SvnFormatSelector());

    DAVRepositoryFactory.setup();
    SVNRepositoryFactoryImpl.setup();
    FSRepositoryFactory.setup();

    // non-optimized writing is fast enough on Linux/MacOS, and somewhat more reliable
    if (SystemInfo.isWindows) {
      SVNAdminArea14.setOptimizedWritingEnabled(true);
    }

    if (!SVNJNAUtil.isJNAPresent()) {
      LOG.warn("JNA is not found by svnkit library");
    }
    initLogFilters();

    ourSSLProtocolsExplicitlySet = System.getProperty(SVNKIT_HTTP_SSL_PROTOCOLS) != null;
  }
Example #9
0
  static {
    System.setProperty("svnkit.log.native.calls", "true");
    final JavaSVNDebugLogger logger =
        new JavaSVNDebugLogger(
            Boolean.getBoolean(LOG_PARAMETER_NAME), Boolean.getBoolean(TRACE_NATIVE_CALLS), LOG);
    SVNDebugLog.setDefaultLog(logger);

    SVNJNAUtil.setJNAEnabled(true);
    SvnHttpAuthMethodsDefaultChecker.check();

    SVNAdminAreaFactory.setSelector(new SvnFormatSelector());

    DAVRepositoryFactory.setup();
    SVNRepositoryFactoryImpl.setup();
    FSRepositoryFactory.setup();

    // non-optimized writing is fast enough on Linux/MacOS, and somewhat more reliable
    if (SystemInfo.isWindows) {
      SVNAdminArea14.setOptimizedWritingEnabled(true);
    }

    if (!SVNJNAUtil.isJNAPresent()) {
      LOG.warn("JNA is not found by svnkit library");
    }
    initLogFilters();

    // Alexander Kitaev says it is default value (SSLv3) - since 8254
    if (!SystemInfo.JAVA_RUNTIME_VERSION.startsWith("1.7")
        && System.getProperty(SVNKIT_HTTP_SSL_PROTOCOLS) == null) {
      System.setProperty(SVNKIT_HTTP_SSL_PROTOCOLS, "SSLv3");
    }
  }
Example #10
0
 /** Returns true if a hader compiler is available, otherwise false. */
 public static boolean isShaderCompilerAvailable(final GL _gl) {
   final GL2ES2 gl = _gl.getGL2ES2();
   final ProfileInformation info = getProfileInformation(gl);
   if (null == info.shaderCompilerAvailable) {
     if (gl.isGLES2()) {
       boolean queryOK = false;
       try {
         final byte[] param = new byte[1];
         gl.glGetBooleanv(GL2ES2.GL_SHADER_COMPILER, param, 0);
         final int err = gl.glGetError();
         boolean v = GL.GL_NO_ERROR == err && param[0] != (byte) 0x00;
         if (!v) {
           final Set<Integer> bfs = getShaderBinaryFormats(gl);
           if (bfs.size() == 0) {
             // no supported binary formats, hence a compiler must be available!
             v = true;
           }
         }
         info.shaderCompilerAvailable = Boolean.valueOf(v);
         queryOK = true;
       } catch (final GLException gle) {
         System.err.println("Caught exception on thread " + Thread.currentThread().getName());
         gle.printStackTrace();
       }
       if (!queryOK) {
         info.shaderCompilerAvailable = Boolean.valueOf(true);
       }
     } else if (gl.isGL2ES2()) {
       info.shaderCompilerAvailable = new Boolean(true);
     } else {
       throw new GLException("Invalid OpenGL profile");
     }
   }
   return info.shaderCompilerAvailable.booleanValue();
 }
Example #11
0
  /**
   * @return true, if the element contains a reference to a different class than fullyQualifiedName
   *     but which has the same class name
   */
  public static boolean containsConflictingReference(PsiFile element, String fullyQualifiedName) {
    final Map<String, Boolean> cachedValue =
        CachedValuesManager.getManager(element.getProject())
            .getCachedValue(
                element,
                new CachedValueProvider<Map<String, Boolean>>() {
                  @Nullable
                  @Override
                  public Result<Map<String, Boolean>> compute() {
                    return new Result<Map<String, Boolean>>(
                        Collections.synchronizedMap(new HashMap<String, Boolean>()),
                        PsiModificationTracker.MODIFICATION_COUNT);
                  }
                });
    Boolean conflictingRef = cachedValue.get(fullyQualifiedName);
    if (conflictingRef != null) {
      return conflictingRef.booleanValue();
    }

    final ConflictingClassReferenceVisitor visitor =
        new ConflictingClassReferenceVisitor(fullyQualifiedName);
    element.accept(visitor);
    conflictingRef = visitor.isConflictingReferenceFound();
    cachedValue.put(fullyQualifiedName, conflictingRef);

    return conflictingRef.booleanValue();
  }
  // ***** VDMTOOLS START Name=init KEEP=NO
  public void init(final HashMap data) throws CGException {

    String fname = new String("expression");
    Boolean cond_4 = null;
    cond_4 = new Boolean(data.containsKey(fname));
    if (cond_4.booleanValue()) setExpression((IOmlExpression) data.get(fname));
  }
  // ***** VDMTOOLS START Name=init KEEP=NO
  public void init(final HashMap data) throws CGException {

    String fname = new String("name_list");
    Boolean cond_4 = null;
    cond_4 = new Boolean(data.containsKey(fname));
    if (cond_4.booleanValue()) setNameList((Vector) data.get(fname));
  }
 private boolean belongsToScope(final PsiElement psiElement, final boolean ignoreScope) {
   if (psiElement == null || !psiElement.isValid()) return false;
   if (psiElement instanceof PsiCompiledElement) return false;
   final PsiFile containingFile =
       ApplicationManager.getApplication()
           .runReadAction(
               new Computable<PsiFile>() {
                 @Override
                 public PsiFile compute() {
                   return psiElement.getContainingFile();
                 }
               });
   if (containingFile == null) {
     return false;
   }
   for (RefManagerExtension extension : myExtensions.values()) {
     if (!extension.belongsToScope(psiElement)) return false;
   }
   final Boolean inProject =
       ApplicationManager.getApplication()
           .runReadAction(
               new Computable<Boolean>() {
                 @Override
                 public Boolean compute() {
                   return psiElement.getManager().isInProject(psiElement);
                 }
               });
   return inProject.booleanValue()
       && (ignoreScope || getScope() == null || getScope().contains(psiElement));
 }
Example #15
0
  @Override
  protected Map<String, String> getSystemPropertyDefaults() {
    // FIXME: some threads must be kept alive that prevent JVM
    // from shutting down
    FrameworkImpl.killAfterShutdown = true;

    Map<String, String> defaults = super.getSystemPropertyDefaults();
    String true_ = Boolean.toString(true);
    String false_ = Boolean.toString(false);

    // Audio system should not be disabled
    defaults.put(MediaServiceImpl.DISABLE_AUDIO_SUPPORT_PNAME, false_);

    defaults.put(DeviceConfiguration.PROP_AUDIO_SYSTEM, AudioSystem.LOCATOR_PROTOCOL_AUDIOSILENCE);
    defaults.put("org.jitsi.impl.neomedia.device.PortAudioSystem.disabled", true_);
    defaults.put("org.jitsi.impl.neomedia.device.PulseAudioSystem.disabled", true_);

    // Disables COIN notifications
    defaults.put(OperationSetTelephonyConferencingJabberImpl.DISABLE_COIN_PROP_NAME, true_);

    // FIXME not sure about this one
    // It makes no sense for Jitsi Videobridge to pace its RTP output.
    defaults.put(
        DeviceConfiguration.PROP_VIDEO_RTP_PACING_THRESHOLD, Integer.toString(Integer.MAX_VALUE));

    // FIXME not sure about this one
    /*
     * XXX Explicitly support JitMeet by default because is is the primary
     * use case of Jitsi Videobridge right now.
     */
    defaults.put(SsrcTransformEngine.DROP_MUTED_AUDIO_SOURCE_IN_REVERSE_TRANSFORM, true_);
    defaults.put(SRTPCryptoContext.CHECK_REPLAY_PNAME, false_);

    return defaults;
  }
Example #16
0
  public boolean visit(LambdaFunctionDeclaration s) throws Exception {
    Map<String, String> parameters = createInitialParameters(s);
    parameters.put("isReference", Boolean.toString(s.isReference()));
    if (s.isStatic()) {
      parameters.put("isStatic", Boolean.toString(s.isStatic()));
    }
    xmlWriter.startTag("LambdaFunctionDeclaration", parameters);

    xmlWriter.startTag("Arguments", new HashMap<String, String>());
    for (FormalParameter p : s.getArguments()) {
      p.traverse(this);
    }
    xmlWriter.endTag("Arguments");

    Collection<? extends Expression> lexicalVars = s.getLexicalVars();
    if (lexicalVars != null) {
      xmlWriter.startTag("LexicalVars", new HashMap<String, String>());
      for (Expression var : lexicalVars) {
        var.traverse(this);
      }
      xmlWriter.endTag("LexicalVars");
    }

    s.getBody().traverse(this);

    return false;
  }
Example #17
0
 public void addServerTypeToSnooper(PlayerUsageSnooper playerSnooper) {
   playerSnooper.addStatToSnooper("singleplayer", Boolean.valueOf(this.isSinglePlayer()));
   playerSnooper.addStatToSnooper("server_brand", this.getServerModName());
   playerSnooper.addStatToSnooper(
       "gui_supported", GraphicsEnvironment.isHeadless() ? "headless" : "supported");
   playerSnooper.addStatToSnooper("dedicated", Boolean.valueOf(this.isDedicatedServer()));
 }
 private void handleBranchingInstruction(
     ProblemsHolder holder,
     StandardInstructionVisitor visitor,
     Set<Instruction> trueSet,
     Set<Instruction> falseSet,
     HashSet<PsiElement> reportedAnchors,
     BranchingInstruction instruction,
     final boolean onTheFly) {
   PsiElement psiAnchor = instruction.getPsiAnchor();
   boolean underBinary = isAtRHSOfBooleanAnd(psiAnchor);
   if (instruction instanceof InstanceofInstruction
       && visitor.isInstanceofRedundant((InstanceofInstruction) instruction)) {
     if (visitor.canBeNull((BinopInstruction) instruction)) {
       holder.registerProblem(
           psiAnchor,
           InspectionsBundle.message("dataflow.message.redundant.instanceof"),
           new RedundantInstanceofFix());
     } else {
       final LocalQuickFix localQuickFix = createSimplifyBooleanExpressionFix(psiAnchor, true);
       holder.registerProblem(
           psiAnchor,
           InspectionsBundle.message(
               underBinary
                   ? "dataflow.message.constant.condition.when.reached"
                   : "dataflow.message.constant.condition",
               Boolean.toString(true)),
           localQuickFix == null ? null : new LocalQuickFix[] {localQuickFix});
     }
   } else if (psiAnchor instanceof PsiSwitchLabelStatement) {
     if (falseSet.contains(instruction)) {
       holder.registerProblem(
           psiAnchor, InspectionsBundle.message("dataflow.message.unreachable.switch.label"));
     }
   } else if (psiAnchor != null
       && !reportedAnchors.contains(psiAnchor)
       && !isFlagCheck(psiAnchor)) {
     boolean evaluatesToTrue = trueSet.contains(instruction);
     final PsiElement parent = psiAnchor.getParent();
     if (parent instanceof PsiAssignmentExpression
         && ((PsiAssignmentExpression) parent).getLExpression() == psiAnchor) {
       holder.registerProblem(
           psiAnchor,
           InspectionsBundle.message(
               "dataflow.message.pointless.assignment.expression",
               Boolean.toString(evaluatesToTrue)),
           createConditionalAssignmentFixes(
               evaluatesToTrue, (PsiAssignmentExpression) parent, onTheFly));
     } else if (!skipReportingConstantCondition(visitor, psiAnchor, evaluatesToTrue)) {
       final LocalQuickFix fix = createSimplifyBooleanExpressionFix(psiAnchor, evaluatesToTrue);
       String message =
           InspectionsBundle.message(
               underBinary
                   ? "dataflow.message.constant.condition.when.reached"
                   : "dataflow.message.constant.condition",
               Boolean.toString(evaluatesToTrue));
       holder.registerProblem(psiAnchor, message, fix == null ? null : new LocalQuickFix[] {fix});
     }
     reportedAnchors.add(psiAnchor);
   }
 }
 /** INTERNAL: Return if the expression is for a direct mapped attribute. */
 public boolean isAttribute() {
   if (isAttributeExpression == null) {
     if (getSession() == null) {
       // We can't tell, so say no.
       return false;
     }
     QueryKey queryKey = getQueryKeyOrNull();
     if (queryKey != null) {
       isAttributeExpression = Boolean.valueOf(queryKey.isDirectQueryKey());
     } else {
       DatabaseMapping mapping = getMapping();
       if (mapping != null) {
         if (mapping.isVariableOneToOneMapping()) {
           throw QueryException.cannotQueryAcrossAVariableOneToOneMapping(
               mapping, mapping.getDescriptor());
         } else {
           isAttributeExpression = Boolean.valueOf(mapping.isDirectToFieldMapping());
         }
       } else {
         isAttributeExpression = Boolean.FALSE;
       }
     }
   }
   return isAttributeExpression.booleanValue();
 }
 static boolean depends(PsiType type, TypeParamsChecker visitor, PsiTypeParameter... param2Check) {
   if (!visitor.startedInference()) return false;
   final Boolean accept = type.accept(visitor);
   if (param2Check.length > 0) {
     return visitor.used(param2Check);
   }
   return accept != null && accept.booleanValue();
 }
Example #21
0
 public boolean visit(NamespaceReference s) throws Exception {
   Map<String, String> parameters = createInitialParameters(s);
   parameters.put("name", s.getName());
   parameters.put("global", Boolean.toString(s.isGlobal()));
   parameters.put("local", Boolean.toString(s.isLocal()));
   xmlWriter.startTag("NamespaceReference", parameters);
   return true;
 }
  private JavaResolveResult advancedResolveInner(final PsiElement psiElement, final String qName) {
    final PsiManager manager = psiElement.getManager();
    final GlobalSearchScope scope = getScope();
    if (myIndex == myJavaClassReferenceSet.getReferences().length - 1) {
      final PsiClass aClass =
          JavaPsiFacade.getInstance(manager.getProject()).findClass(qName, scope);
      if (aClass != null) {
        return new ClassCandidateInfo(aClass, PsiSubstitutor.EMPTY, false, psiElement);
      } else {
        if (!JavaClassReferenceProvider.ADVANCED_RESOLVE.getBooleanValue(getOptions())) {
          return JavaResolveResult.EMPTY;
        }
      }
    }
    PsiElement resolveResult = JavaPsiFacade.getInstance(manager.getProject()).findPackage(qName);
    if (resolveResult == null) {
      resolveResult = JavaPsiFacade.getInstance(manager.getProject()).findClass(qName, scope);
    }
    if (myInStaticImport && resolveResult == null) {
      resolveResult = resolveMember(qName, manager, getElement().getResolveScope());
    }
    if (resolveResult == null) {
      PsiFile containingFile = psiElement.getContainingFile();

      if (containingFile instanceof PsiJavaFile) {
        if (containingFile instanceof JspFile) {
          containingFile = containingFile.getViewProvider().getPsi(StdLanguages.JAVA);
          if (containingFile == null) return JavaResolveResult.EMPTY;
        }

        final ClassResolverProcessor processor =
            new ClassResolverProcessor(getCanonicalText(), psiElement);
        containingFile.processDeclarations(processor, ResolveState.initial(), null, psiElement);

        if (processor.getResult().length == 1) {
          final JavaResolveResult javaResolveResult = processor.getResult()[0];

          if (javaResolveResult != JavaResolveResult.EMPTY && getOptions() != null) {
            final Boolean value =
                JavaClassReferenceProvider.RESOLVE_QUALIFIED_CLASS_NAME.getValue(getOptions());
            final PsiClass psiClass = (PsiClass) javaResolveResult.getElement();
            if (value != null && value.booleanValue() && psiClass != null) {
              final String qualifiedName = psiClass.getQualifiedName();

              if (!qName.equals(qualifiedName)) {
                return JavaResolveResult.EMPTY;
              }
            }
          }

          return javaResolveResult;
        }
      }
    }
    return resolveResult != null
        ? new CandidateInfo(resolveResult, PsiSubstitutor.EMPTY, false, false, psiElement)
        : JavaResolveResult.EMPTY;
  }
  public static void addNodeSetParams(
      final HashMap<String, String> params,
      final NodeSet nodeSet,
      final Boolean isKeepgoing,
      final String prefix) {

    if (null == nodeSet) {
      return;
    }
    if (nodeSet.getThreadCount() > 0) {
      params.put(prefix + "nodeThreadcount", Integer.toString(nodeSet.getThreadCount()));
    }
    if (null != isKeepgoing) {
      params.put(prefix + "nodeKeepgoing", Boolean.toString(isKeepgoing));
    }
    if (nodeSet.isBlank()) {
      return;
    }
    params.put(prefix + "doNodedispatch", "true");
    boolean excludeprecedence = true;
    if (null != nodeSet.getExclude() && nodeSet.getExclude().isDominant()) {
      excludeprecedence = true;
    } else if (null != nodeSet.getInclude() && nodeSet.getInclude().isDominant()) {
      excludeprecedence = false;
    }
    params.put(prefix + "nodeExcludePrecedence", Boolean.toString(excludeprecedence));

    final NodeSet.Include include = nodeSet.getInclude();

    for (NodeSet.FILTER_ENUM filter : NodeSet.FILTER_ENUM.values()) {
      String value = null;
      if (null != include && !include.isBlank()) {
        value = filter.value(include);
      }

      String key = nodeFilterParams.get(filter.getName());
      if (null != value && !"".equals(value)) {
        params.put(prefix + "nodeInclude" + key, value);
      } else {
        params.put(prefix + "nodeInclude" + key, "");
      }
    }
    final NodeSet.Exclude exclude = nodeSet.getExclude();

    for (NodeSet.FILTER_ENUM filter : NodeSet.FILTER_ENUM.values()) {
      String value = null;
      if (null != exclude && !exclude.isBlank()) {
        value = filter.value(exclude);
      }
      String key = nodeFilterParams.get(filter.getName());
      if (null != value && !"".equals(value)) {
        params.put(prefix + "nodeExclude" + key, value);
      } else {
        params.put(prefix + "nodeExclude" + key, "");
      }
    }
  }
Example #24
0
 void SaveConfig() {
   String id = Long.toString(robot_uid);
   prefs.put(id + "_limit_top", Double.toString(limit_top));
   prefs.put(id + "_limit_bottom", Double.toString(limit_bottom));
   prefs.put(id + "_limit_right", Double.toString(limit_right));
   prefs.put(id + "_limit_left", Double.toString(limit_left));
   prefs.put(id + "_m1invert", Boolean.toString(m1invert));
   prefs.put(id + "_m2invert", Boolean.toString(m2invert));
 }
 private void setMarked(int rowIndex, final boolean marked) {
   final T element = myElements.get(rowIndex);
   final Boolean newValue = marked ? Boolean.TRUE : Boolean.FALSE;
   final Boolean prevValue = myMarkedMap.put(element, newValue);
   fireTableRowsUpdated(rowIndex, rowIndex);
   if (!newValue.equals(prevValue)) {
     notifyElementMarked(element, marked);
   }
 }
 public boolean isDefault() {
   final Map<String, Boolean> map = getDisplayLevelMap();
   if (map != null) {
     for (Boolean def : map.values()) {
       if (!def.booleanValue()) return false;
     }
   }
   return true;
 }
Example #27
0
 void LoadConfig() {
   String id = Long.toString(robot_uid);
   limit_top = Double.valueOf(prefs.get(id + "_limit_top", "0"));
   limit_bottom = Double.valueOf(prefs.get(id + "_limit_bottom", "0"));
   limit_left = Double.valueOf(prefs.get(id + "_limit_left", "0"));
   limit_right = Double.valueOf(prefs.get(id + "_limit_right", "0"));
   m1invert = Boolean.parseBoolean(prefs.get(id + "_m1invert", "false"));
   m2invert = Boolean.parseBoolean(prefs.get(id + "_m2invert", "false"));
 }
Example #28
0
  /** Synchronizes the state of the actions to the current state of this host. */
  private void updateActions() {
    final DeviceController currentDeviceController = getDeviceController();

    final boolean deviceControllerSet = currentDeviceController != null;
    final boolean deviceCapturing = deviceControllerSet && currentDeviceController.isCapturing();
    final boolean deviceSetup =
        deviceControllerSet && !deviceCapturing && currentDeviceController.isSetup();

    getAction(CaptureAction.ID).setEnabled(deviceControllerSet);
    getAction(CancelCaptureAction.ID).setEnabled(deviceCapturing);
    getAction(RepeatCaptureAction.ID).setEnabled(deviceSetup);

    final boolean projectChanged = this.projectManager.getCurrentProject().isChanged();
    final boolean projectSavedBefore =
        this.projectManager.getCurrentProject().getFilename() != null;
    final boolean dataAvailable = this.dataContainer.hasCapturedData();

    getAction(SaveProjectAction.ID).setEnabled(projectChanged);
    getAction(SaveProjectAsAction.ID).setEnabled(projectSavedBefore && projectChanged);
    getAction(SaveDataFileAction.ID).setEnabled(dataAvailable);

    getAction(ZoomInAction.ID).setEnabled(dataAvailable);
    getAction(ZoomOutAction.ID).setEnabled(dataAvailable);
    getAction(ZoomDefaultAction.ID).setEnabled(dataAvailable);
    getAction(ZoomFitAction.ID).setEnabled(dataAvailable);

    final boolean triggerEnable = dataAvailable && this.dataContainer.hasTriggerData();
    getAction(GotoTriggerAction.ID).setEnabled(triggerEnable);

    // Update the cursor actions accordingly...
    final boolean enableCursors = dataAvailable && this.dataContainer.isCursorsEnabled();

    for (int c = 0; c < CapturedData.MAX_CURSORS; c++) {
      final boolean enabled = enableCursors && this.dataContainer.isCursorPositionSet(c);
      getAction(GotoNthCursorAction.getID(c)).setEnabled(enabled);
    }

    getAction(GotoFirstCursorAction.ID).setEnabled(enableCursors);
    getAction(GotoLastCursorAction.ID).setEnabled(enableCursors);

    getAction(SetCursorModeAction.ID).setEnabled(dataAvailable);
    getAction(SetCursorModeAction.ID)
        .putValue(Action.SELECTED_KEY, Boolean.valueOf(this.dataContainer.isCursorsEnabled()));

    boolean anyCursorSet = false;
    for (int c = 0; c < CapturedData.MAX_CURSORS; c++) {
      final boolean cursorPositionSet = this.dataContainer.isCursorPositionSet(c);
      anyCursorSet |= cursorPositionSet;

      final Action action = getAction(SetCursorAction.getCursorId(c));
      action.setEnabled(dataAvailable);
      action.putValue(Action.SELECTED_KEY, Boolean.valueOf(cursorPositionSet));
    }

    getAction(ClearCursors.ID).setEnabled(enableCursors && anyCursorSet);
  }
Example #29
0
 /**
  * @attribute syn
  * @aspect GenericsSubtype
  * @declaredat
  *     /Users/eric/Documents/workspaces/clara-soot/JastAddJ/Java1.5Frontend/GenericsSubtype.jrag:212
  */
 @SuppressWarnings({"unchecked", "cast"})
 public boolean sameStructure(TypeDecl t) {
   Object _parameters = t;
   if (sameStructure_TypeDecl_values == null)
     sameStructure_TypeDecl_values = new java.util.HashMap(4);
   ASTNode$State.CircularValue _value;
   if (sameStructure_TypeDecl_values.containsKey(_parameters)) {
     Object _o = sameStructure_TypeDecl_values.get(_parameters);
     if (!(_o instanceof ASTNode$State.CircularValue)) {
       return ((Boolean) _o).booleanValue();
     } else _value = (ASTNode$State.CircularValue) _o;
   } else {
     _value = new ASTNode$State.CircularValue();
     sameStructure_TypeDecl_values.put(_parameters, _value);
     _value.value = Boolean.valueOf(true);
   }
   ASTNode$State state = state();
   if (!state.IN_CIRCLE) {
     state.IN_CIRCLE = true;
     int num = state.boundariesCrossed;
     boolean isFinal = this.is$Final();
     boolean new_sameStructure_TypeDecl_value;
     do {
       _value.visited = new Integer(state.CIRCLE_INDEX);
       state.CHANGE = false;
       new_sameStructure_TypeDecl_value = sameStructure_compute(t);
       if (new_sameStructure_TypeDecl_value != ((Boolean) _value.value).booleanValue()) {
         state.CHANGE = true;
         _value.value = Boolean.valueOf(new_sameStructure_TypeDecl_value);
       }
       state.CIRCLE_INDEX++;
     } while (state.CHANGE);
     if (isFinal && num == state().boundariesCrossed) {
       sameStructure_TypeDecl_values.put(_parameters, new_sameStructure_TypeDecl_value);
     } else {
       sameStructure_TypeDecl_values.remove(_parameters);
       state.RESET_CYCLE = true;
       sameStructure_compute(t);
       state.RESET_CYCLE = false;
     }
     state.IN_CIRCLE = false;
     return new_sameStructure_TypeDecl_value;
   }
   if (!new Integer(state.CIRCLE_INDEX).equals(_value.visited)) {
     _value.visited = new Integer(state.CIRCLE_INDEX);
     boolean new_sameStructure_TypeDecl_value = sameStructure_compute(t);
     if (state.RESET_CYCLE) {
       sameStructure_TypeDecl_values.remove(_parameters);
     } else if (new_sameStructure_TypeDecl_value != ((Boolean) _value.value).booleanValue()) {
       state.CHANGE = true;
       _value.value = new_sameStructure_TypeDecl_value;
     }
     return new_sameStructure_TypeDecl_value;
   }
   return ((Boolean) _value.value).booleanValue();
 }
Example #30
0
  /**
   * Set Environment key to value
   *
   * @param key variable name ('#' will be converted to '_')
   * @param stringValue try to convert to Object
   */
  public void setEnvironment(String key, String stringValue) {
    if (key == null || key.length() == 0) return;
    //	log.fine( "Scriptlet.setEnvironment " + key, stringValue);
    if (stringValue == null) {
      m_ctx.remove(key);
      return;
    }

    //  Boolean
    if (stringValue.equals("Y")) {
      m_ctx.put(convertKey(key), Boolean.valueOf(true));
      return;
    }
    if (stringValue.equals("N")) {
      m_ctx.put(convertKey(key), Boolean.valueOf(false));
      return;
    }

    //  Timestamp
    Timestamp timeValue = null;
    try {
      timeValue = Timestamp.valueOf(stringValue);
      m_ctx.put(convertKey(key), timeValue);
      return;
    } catch (Exception e) {
    }

    //  Numeric
    Integer intValue = null;
    try {
      intValue = Integer.valueOf(stringValue);
    } catch (NumberFormatException e) {
    }
    Double doubleValue = null;
    try {
      doubleValue = Double.valueOf(stringValue);
    } catch (NumberFormatException e) {
    }
    if (doubleValue != null) {
      if (intValue != null) {
        double di = Double.parseDouble(intValue.toString());
        //  the numbers are the same -> integer
        if (Double.compare(di, doubleValue.doubleValue()) == 0) {
          m_ctx.put(convertKey(key), intValue);
          return;
        }
      }
      m_ctx.put(convertKey(key), doubleValue);
      return;
    }
    if (intValue != null) {
      m_ctx.put(convertKey(key), intValue);
      return;
    }
    m_ctx.put(convertKey(key), stringValue);
  } //  SetEnvironment