code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
public static UnsupportedCycOperationException fromThrowable(String message, Throwable cause) {
return (cause instanceof UnsupportedCycOperationException && Objects.equals(message, cause.getMessage()))
? (UnsupportedCycOperationException) cause
: new UnsupportedCycOperationExce... | java |
public static void unregisterActivityLifecycleCallbacks(Application application, ActivityLifecycleCallbacksCompat callback) {
if (PRE_ICS) {
preIcsUnregisterActivityLifecycleCallbacks(callback);
} else {
postIcsUnregisterActivityLifecycleCallbacks(application, callback);
... | java |
public static SessionRuntimeException fromThrowable(Throwable cause) {
return (cause instanceof SessionRuntimeException)
? (SessionRuntimeException) cause
: new SessionRuntimeException(cause);
} | java |
public static SessionRuntimeException fromThrowable(String message, Throwable cause) {
return (cause instanceof SessionRuntimeException && Objects.equals(message, cause.getMessage()))
? (SessionRuntimeException) cause
: new SessionRuntimeException(message, cause);
} | java |
protected ByteSource stream(final String resourceId) {
return new ByteSource() {
@Override
public InputStream openStream() throws IOException {
return loader.getResource(resourceId).getInputStream();
}
};
} | java |
public static QueryRuntimeException fromThrowable(Throwable t) {
return (t instanceof QueryRuntimeException)
? (QueryRuntimeException) t
: new QueryRuntimeException(t);
} | java |
public static QueryRuntimeException fromThrowable(String message, Throwable t) {
return (t instanceof QueryRuntimeException && Objects.equals(message, t.getMessage()))
? (QueryRuntimeException) t
: new QueryRuntimeException(message, t);
} | java |
public static ProofViewException fromThrowable(Throwable cause) {
return (cause instanceof ProofViewException)
? (ProofViewException) cause
: new ProofViewException(cause);
} | java |
public static ProofViewException fromThrowable(String message, Throwable cause) {
return (cause instanceof ProofViewException && Objects.equals(message, cause.getMessage()))
? (ProofViewException) cause
: new ProofViewException(message, cause);
} | java |
public static KbException fromThrowable(Throwable cause) {
return (cause instanceof KbException)
? (KbException) cause
: new KbException(cause);
} | java |
public static KbException fromThrowable(String message, Throwable cause) {
return (cause instanceof KbException && Objects.equals(message, cause.getMessage()))
? (KbException) cause
: new KbException(message, cause);
} | java |
public static DeleteException fromThrowable(Throwable cause) {
return (cause instanceof DeleteException)
? (DeleteException) cause
: new DeleteException(cause);
} | java |
public static DeleteException fromThrowable(String message, Throwable cause) {
return (cause instanceof DeleteException && Objects.equals(message, cause.getMessage()))
? (DeleteException) cause
: new DeleteException(message, cause);
} | java |
@PostConstruct
public void initialize() {
if (this.initializationState.setInitializing()) {
if (this.visibility == null) {
this.visibility = VisibilityModifier.PUBLIC;
}
this.initializationState.setInitialized();
}
} | java |
public List<ModuleBuildFuture> getExtraBuilds() {
return extraBuilds == null ? Collections.<ModuleBuildFuture>emptyList() : Collections.unmodifiableList(extraBuilds);
} | java |
public double getCoverDelta(GrammarRuleRecord rule) {
// counts which uncovered points shall be covered
int new_cover = 0;
// counts overlaps with previously covered ranges
int overlapping_cover = 0;
// perform the sum computation
for (RuleInterval i : rule.getRuleIntervals()) {
int sta... | java |
private boolean isCompletelyCoveredBy(int[] isCovered, List<RuleInterval> intervals) {
for (RuleInterval i : intervals) {
for (int j = i.getStart(); j < i.getEnd(); j++) {
if (isCovered[j] == 0) {
return false;
}
}
}
return true;
} | java |
public void expand() {
join(p, r.first());
join(r.last(), n);
// Necessary so that garbage collector
// can delete rule and guard.
r.theGuard.r = null;
r.theGuard = null;
} | java |
public void insert(String str, int lineno, int colno) {
final String sourceMethod = "insert"; //$NON-NLS-1$
if (isTraceLogging) {
log.entering(JSSource.class.getName(), sourceMethod, new Object[]{str, lineno, colno});
}
PositionLocator locator = new PositionLocator(lineno, colno);
locator.insert(str)... | java |
public void appendln(String str) {
BufferedReader rdr = new BufferedReader(new StringReader(str));
while (true) {
String line = null;
try {
line = rdr.readLine();
} catch (IOException e) {
// shouldn't ever happen since we're using a StringReader
throw new RuntimeException(e);
}
... | java |
public void disposeAndValidate() throws ObjectNotFoundException, ComposedException {
List<NlsObject> errorList = this.duplicateIdErrors;
this.duplicateIdErrors = null;
for (Resolver resolver : this.id2callableMap.values()) {
if (!resolver.resolved) {
errorList.add(this.bundle.errorObjectNotFo... | java |
public void setNamespace(String prefix, String uri) {
this.prefix2namespace.put(prefix, uri);
this.namespace2prefix.put(uri, prefix);
} | java |
private ChocoConstraint build(Constraint cstr) throws SchedulerException {
ChocoMapper mapper = params.getMapper();
ChocoConstraint cc = mapper.get(cstr);
if (cc == null) {
throw new SchedulerModelingException(origin, "No implementation mapped to '" + cstr.getClass().getSimpleName() ... | java |
private static void checkNodesExistence(Model mo, Collection<Node> ns) throws SchedulerModelingException {
for (Node node : ns) {
if (!mo.getMapping().contains(node)) {
throw new SchedulerModelingException(mo, "Unknown node '" + node + "'");
}
}
} | java |
public SingleRunnerStatistics getStatistics() {
if (rp != null) {
Measures m = rp.getSolver().getMeasures();
stats.setMetrics(new Metrics(m));
stats.setCompleted(m.getSearchState().equals(SearchState.TERMINATED)
|| m.getSearchState().equals(SearchState.NEW)
... | java |
protected double calcDistTSAndPattern(double[] ts, double[] pValue) {
double INF = 10000000000000000000f;
double bestDist = INF;
int patternLen = pValue.length;
int lastStartP = ts.length - pValue.length + 1;
if (lastStartP < 1)
return bestDist;
Random rand = new Random();
... | java |
protected double eculideanDistNormEAbandon(double[] ts1, double[] ts2, double bsfDist) {
double dist = 0;
double tsLen = ts1.length;
double bsf = Math.pow(tsLen * bsfDist, 2);
for (int i = 0; i < ts1.length; i++) {
double diff = ts1[i] - ts2[i];
dist += Math.pow(diff, 2);
... | java |
protected double eculideanDistNorm(double[] ts1, double[] ts2) {
double dist = 0;
double tsLen = ts1.length;
for (int i = 0; i < ts1.length; i++) {
double diff = ts1[i] - ts2[i];
dist += Math.pow(diff, 2);
}
return Math.sqrt(dist) / tsLen;
} | java |
private static void toAbsoluteFreeResources(TIntIntHashMap changes, int[] sortedMoments) {
for (int i = 1; i < sortedMoments.length; i++) {
int t = sortedMoments[i];
int lastT = sortedMoments[i - 1];
int lastFree = changes.get(lastT);
changes.put(t, changes.get(t... | java |
private void addLinkConstraints(ReconfigurationProblem rp) {
// Links limitation
List<Task> tasksListUp = new ArrayList<>();
List<Task> tasksListDown = new ArrayList<>();
List<IntVar> heightsListUp = new ArrayList<>();
List<IntVar> heightsListDown = new ArrayList<>();
f... | java |
public static void fill(Mapping src, Mapping dst) {
for (Node off : src.getOfflineNodes()) {
dst.addOfflineNode(off);
}
for (VM r : src.getReadyVMs()) {
dst.addReadyVM(r);
}
for (Node on : src.getOnlineNodes()) {
dst.addOnlineNode(on);
... | java |
public String toRuleString() {
if (0 == this.ruleNumber) {
return this.grammar.r0String;
}
return this.first.toString() + SPACE + this.second.toString() + SPACE;
} | java |
public int[] getOccurrences() {
int[] res = new int[this.occurrences.size()];
for (int i = 0; i < this.occurrences.size(); i++) {
res[i] = this.occurrences.get(i);
}
return res;
} | java |
static public boolean isProvisional(Iterable<ICacheKeyGenerator> keyGens) {
boolean provisional = false;
for (ICacheKeyGenerator keyGen : keyGens) {
if (keyGen.isProvisional()) {
provisional = true;
break;
}
}
return provisional;
} | java |
public static <E> Collection<E> unionColl(Collection<E> c1, Collection<E> c2) {
return new UColl<E>(c1, c2);
} | java |
protected void unfoldModulesHelper(Object obj, String path, String[] aPrefixes, Map<Integer, String> modules) throws IOException, JSONException {
final String sourceMethod = "unfoldModulesHelper"; //$NON-NLS-1$
if (isTraceLogging) {
log.entering(RequestedModuleNames.class.getName(), sourceMethod, new Object[]... | java |
public static <K,V> MapFactory<K,V> cow(MapFactory<K,V> underMapFact) {
throw new UnsupportedOperationException("Not implemented yet");
} | java |
private void sealObject(ScriptableObject obj) {
obj.sealObject();
Object[] ids = obj.getIds();
for (Object id : ids) {
Object child = obj.get(id);
if (child instanceof ScriptableObject) {
sealObject((ScriptableObject)child);
}
}
} | java |
protected String _resolve(
String name,
Features features,
Set<String> dependentFeatures,
boolean resolveAliases,
boolean evaluateHasPluginConditionals,
int recursionCount,
StringBuffer sb) {
final String sourceMethod = "_resolve"; //$NON-NLS-1$
boolean isTraceLogging = log.isLoggabl... | java |
protected URI loadConfigUri() throws URISyntaxException, FileNotFoundException {
Collection<String> configNames = getAggregator().getInitParams().getValues(InitParams.CONFIG_INITPARAM);
if (configNames.size() != 1) {
throw new IllegalArgumentException(InitParams.CONFIG_INITPARAM);
}
String configName = ... | java |
protected Location loadBaseURI(Scriptable cfg) throws URISyntaxException {
Object baseObj = cfg.get(BASEURL_CONFIGPARAM, cfg);
Location result;
if (baseObj == Scriptable.NOT_FOUND) {
result = new Location(getConfigUri().resolve(".")); //$NON-NLS-1$
} else {
Location loc = loadLocation(baseObj, true... | java |
protected Scriptable loadConfig(String configScript) throws IOException {
configScript = processConfig(configScript);
Context cx = Context.enter();
Scriptable config;
try {
sharedScope = cx.initStandardObjects(null, true);
// set up options object
IOptions options = aggregator.getOptions();
... | java |
protected Map<String, IPackage> loadPackages(Scriptable cfg) throws URISyntaxException {
Object obj = cfg.get(PACKAGES_CONFIGPARAM, cfg);
Map<String, IPackage> packages = new HashMap<String, IPackage>();
if (obj instanceof Scriptable) {
for (Object id : ((Scriptable)obj).getIds()) {
if (id instanceof ... | java |
protected Map<String, Location> loadPaths(Scriptable cfg) throws URISyntaxException {
Object pathlocs = cfg.get(PATHS_CONFIGPARAM, cfg);
Map<String, Location> paths = new HashMap<String, Location>();
if (pathlocs instanceof Scriptable) {
for (Object key : ((Scriptable)pathlocs).getIds()) {
String name... | java |
protected List<IAlias> loadAliases(Scriptable cfg) throws IOException {
Object aliasList = cfg.get(ALIASES_CONFIGPARAM, cfg);
List<IAlias> aliases = new LinkedList<IAlias>();
if (aliasList instanceof Scriptable) {
for (Object id : ((Scriptable)aliasList).getIds()) {
if (id instanceof Number) {
N... | java |
protected List<String> loadDeps(Scriptable cfg) {
final String methodName = "loadDeps"; //$NON-NLS-1$
Object depsList = cfg.get(DEPS_CONFIGPARAM, cfg);
List<String> deps = new LinkedList<String>();
if (depsList instanceof Scriptable) {
for (Object id : ((Scriptable)depsList).getIds()) {
if (id inst... | java |
protected int loadExpires(Scriptable cfg) {
int expires = 0;
Object oExpires = cfg.get(EXPIRES_CONFIGPARAM, cfg);
if (oExpires != Scriptable.NOT_FOUND) {
try {
expires = Integer.parseInt(toString(oExpires));
} catch (NumberFormatException ignore) {
throw new IllegalArgumentException(EXPIRES_C... | java |
protected boolean loadDepsIncludeBaseUrl(Scriptable cfg) {
boolean result = false;
Object value = cfg.get(DEPSINCLUDEBASEURL_CONFIGPARAM, cfg);
if (value != Scriptable.NOT_FOUND) {
result = TypeUtil.asBoolean(toString(value), false);
}
return result;
} | java |
protected boolean loadCoerceUndefinedToFalse(Scriptable cfg) {
boolean result = false;
Object value = cfg.get(COERCEUNDEFINEDTOFALSE_CONFIGPARAM, cfg);
if (value != Scriptable.NOT_FOUND) {
result = TypeUtil.asBoolean(toString(value), false);
}
return result;
} | java |
protected Set<String> loadPluginDelegators(Scriptable cfg, String name) {
Set<String> result = null;
Object delegators = cfg.get(name, cfg);
if (delegators != Scriptable.NOT_FOUND && delegators instanceof Scriptable) {
result = new HashSet<String>();
for (Object id : ((Scriptable)delegators).getIds())... | java |
protected void callConfigModifiers(Scriptable rawConfig) {
if( aggregator.getPlatformServices() != null){
IServiceReference[] refs = null;
try {
refs = aggregator.getPlatformServices().getServiceReferences(IConfigModifier.class.getName(), "(name="+getAggregator().getName()+")"); //$NON-NLS-1$ //$NON-N... | java |
protected void callConfigScopeModifiers(Scriptable scope) {
if( aggregator.getPlatformServices() != null){
IServiceReference[] refs = null;
try {
refs = aggregator.getPlatformServices().getServiceReferences(IConfigScopeModifier.class.getName(), "(name="+getAggregator().getName()+")"); //$NON-NLS-1$ //... | java |
protected boolean isValidType(Class<?> type, Annotation[] classAnnotations) {
if (type == null)
return false;
if (annotated) {
return checkAnnotation(type);
} else if (scanpackages != null) {
String classPackage = type.getPackage().getName();
for (String pkg : scanpackages) {
if (classPackag... | java |
public void writeTo(Object t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders,
OutputStream entityStream) throws IOException, WebApplicationException {
SerializeFilter filter = null;
if(pretty) {
if (fastJsonConfig.serializerFea... | java |
public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders,
InputStream entityStream) throws IOException, WebApplicationException {
String input = null;
try {
input = IOUtils.inputStreamToString(entityStream);
} catc... | java |
public static ArrayList<SameLengthMotifs> performPruning(double[] ts, GrammarRules grammarRules,
double thresholdLength, double thresholdCom, double fractionTopDist) {
RuleOrganizer ro = new RuleOrganizer();
ArrayList<SameLengthMotifs> allClassifiedMotifs = ro.classifyMotifs(thresholdLength,
... | java |
public static ArrayList<PackedRuleRecord> getPackedRule(
ArrayList<SameLengthMotifs> newAllClassifiedMotifs) {
ArrayList<PackedRuleRecord> arrPackedRuleRecords = new ArrayList<PackedRuleRecord>();
int i = 0;
for (SameLengthMotifs subsequencesInClass : newAllClassifiedMotifs) {
int classIn... | java |
protected Dictionary<?, ?> getBundleHeaders(String bundleName) throws NotFoundException {
final String sourceMethod = "getBundleHeaders"; //$NON-NLS-1$
boolean isTraceLogging = log.isLoggable(Level.FINER);
if (isTraceLogging) {
log.entering(BundleVersionsHashBase.class.getName(), sourceMethod, new Object[]... | java |
public boolean checkConformance(BtrPlaceTree t, List<BtrpOperand> ops) {
//Arity error
if (ops.size() != getParameters().length) {
t.ignoreError("'" + pretty(ops) + "' cannot be casted to '" + getSignature() + "'");
return false;
}
//Type checking
for (in... | java |
public Script build(File f) throws ScriptBuilderException {
int k = f.getAbsolutePath().hashCode();
if (dates.containsKey(k) && dates.get(k) == f.lastModified() && cache.containsKey(f.getPath())) {
LOGGER.debug("get '" + f.getName() + "' from the cache");
return cache.get(f.getPa... | java |
@SuppressWarnings("squid:S1166") //For the UnsupportedOperationException
private Script build(CharStream cs) throws ScriptBuilderException {
Script v = new Script();
ANTLRBtrplaceSL2Lexer lexer = new ANTLRBtrplaceSL2Lexer(cs);
ErrorReporter errorReporter = errBuilder.build(v);
le... | java |
public Graph generateRandomMMapGraph(String graphName, int size, float dens) {
Graph graph = null;
String dir = "graphs/MMap/" + graphName;
SerializationUtils.deleteMMapGraph(dir);
graph = new Graph(new MMapGraphStructure(dir));
Random rand = new Random();
for (int i = 0; i < size; i++)
graph... | java |
public static Map<IntVar, VM> makePlacementMap(ReconfigurationProblem rp) {
Map<IntVar, VM> m = new HashMap<>(rp.getFutureRunningVMs().size());
for (VM vm : rp.getFutureRunningVMs()) {
IntVar v = rp.getVMAction(vm).getDSlice().getHoster();
m.put(v, vm);
}
return m... | java |
public final void validate(StringBuilder source) {
int length = source.length();
source.append('/');
source.append(getSourceIdentifier());
doValidate(source);
// reset source for recursive invocation...
source.setLength(length);
} | java |
public ShareableResource setConsumption(VM vm, int val) {
if (val < 0) {
throw new IllegalArgumentException(String.format("The '%s' consumption of VM '%s' must be >= 0", rcId, vm));
}
vmsConsumption.put(vm, val);
return this;
} | java |
public ShareableResource setConsumption(int val, VM... vms) {
Stream.of(vms).forEach(v -> setConsumption(v, val));
return this;
} | java |
public ShareableResource setCapacity(Node n, int val) {
if (val < 0) {
throw new IllegalArgumentException(String.format("The '%s' capacity of node '%s' must be >= 0", rcId, n));
}
nodesCapacity.put(n, val);
return this;
} | java |
public ShareableResource setCapacity(int val, Node... nodes) {
Stream.of(nodes).forEach(n -> this.setCapacity(n, val));
return this;
} | java |
public int sumConsumptions(Collection<VM> ids, boolean undef) {
int s = 0;
for (VM u: ids) {
if (consumptionDefined(u) || undef) {
s += vmsConsumption.get(u);
}
}
return s;
} | java |
public int sumCapacities(Collection<Node> ids, boolean undef) {
int s = 0;
for (Node u: ids) {
if (capacityDefined(u) || undef) {
s += nodesCapacity.get(u);
}
}
return s;
} | java |
public static ShareableResource get(Model mo, String id) {
return (ShareableResource) mo.getView(VIEW_ID_BASE + id);
} | java |
public String getlocalName() {
if (fqn.contains(".")) {
return this.fqn.substring(fqn.lastIndexOf('.') + 1, this.fqn.length());
}
return fqn;
} | java |
public boolean add(Collection<BtrpElement> elems) {
boolean ret = false;
for (BtrpElement el : elems) {
ret |= add(el);
}
return ret;
} | java |
public boolean add(BtrpElement el) {
switch (el.type()) {
case VM:
if (!this.vms.add((VM) el.getElement())) {
return false;
}
break;
case NODE:
if (!this.nodes.add((Node) el.getElement())) {
... | java |
public List<BtrpOperand> getImportables(String ns) {
List<BtrpOperand> importable = new ArrayList<>();
for (String symbol : getExported()) {
if (canImport(symbol, ns)) {
importable.add(getImportable(symbol, ns));
}
}
return importable;
} | java |
public BtrpOperand getImportable(String label, String namespace) {
if (canImport(label, namespace)) {
return exported.get(label);
}
return null;
} | java |
public boolean canImport(String label, String namespace) {
if (!exported.containsKey(label)) {
return false;
}
Set<String> scopes = exportScopes.get(label);
for (String scope : scopes) {
if (scope.equals(namespace)) {
return true;
} els... | java |
public String fullyQualifiedSymbolName(String name) {
if (name.equals(SymbolsTable.ME)) {
return "$".concat(id());
} else if (name.startsWith("$")) {
return "$" + id() + '.' + name.substring(1);
}
return id() + '.' + name;
} | java |
public String prettyDependencies() {
StringBuilder b = new StringBuilder();
b.append(id()).append('\n');
for (Iterator<Script> ite = dependencies.iterator(); ite.hasNext(); ) {
Script n = ite.next();
prettyDependencies(b, !ite.hasNext(), 0, n);
}
return b.... | java |
public void addNode(Node n) {
try {
structure.addNode(n);
for (NodeListener listener : nodeListeners)
listener.onInsert(n);
} catch (DuplicatedNodeException e) {
duplicatedNodesCounter++;
}
} | java |
public void addEdge(Edge e) {
structure.addEdge(e);
for (EdgeListener listener : edgeListeners)
listener.onInsert(e);
} | java |
public Iterator<Long> getNeighborhoodIterator(final long id) {
return new Iterator<Long>() {
Iterator<Edge> iter = structure.getExistingOutEdgesIterator(id);
@Override
public boolean hasNext() {
return iter.hasNext();
}
@Override
public Long next() {
Edge e = iter.next();
return... | java |
public static JSONObject toJSON(Attributes attributes) {
JSONObject res = new JSONObject();
JSONObject vms = new JSONObject();
JSONObject nodes = new JSONObject();
for (Element e : attributes.getDefined()) {
JSONObject el = new JSONObject();
for (String k : attrib... | java |
private void fullKnapsack() throws ContradictionException {
for (int bin = 0; bin < prop.nbBins; bin++) {
for (int d = 0; d < prop.nbDims; d++) {
knapsack(bin, d);
}
}
} | java |
public void postInitialize() throws ContradictionException {
final int[] biggest = new int[prop.nbDims];
for (int i = 0; i < prop.bins.length; i++) {
for (int d = 0; d < prop.nbDims; d++) {
biggest[d] = Math.max(biggest[d], prop.iSizes[d][i]);
}
if (!p... | java |
@SuppressWarnings("squid:S3346")
public void postRemoveItem(int item, int bin) {
assert candidate.get(bin).get(item);
candidate.get(bin).clear(item);
} | java |
private void knapsack(int bin, int d) throws ContradictionException {
final int maxLoad = prop.loads[d][bin].getUB();
final int free = maxLoad - prop.assignedLoad[d][bin].get();
if (free >= dynBiggest[d][bin].get()) {
// fail fast. The remaining space > the biggest item.
... | java |
public void add(Metrics m) {
timeCount += m.timeCount;
readingTimeCount += m.readingTimeCount;
nodes += m.nodes;
backtracks += m.backtracks;
fails += m.fails;
restarts += m.restarts;
} | java |
protected String generateCacheKey(HttpServletRequest request, Map<String, ICacheKeyGenerator> cacheKeyGenerators) throws IOException {
String cacheKey = null;
if (cacheKeyGenerators != null) {
// First, decompose any composite cache key generators into their
// constituent cache key generators so that we ... | java |
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
// Call the default implementation to de-serialize our object
in.defaultReadObject();
// init transients
_validateLastModified = new AtomicBoolean(true);
_cacheKeyGenMutex = new Semaphore(1);
_isReportCacheInfo ... | java |
protected long getLastModified(IAggregator aggregator, ModuleList modules) {
long result = 0L;
for (ModuleList.ModuleListEntry entry : modules) {
IResource resource = entry.getModule().getResource(aggregator);
long lastMod = resource.lastModified();
result = Math.max(result, lastMod);
}
return r... | java |
public static void verify(short value, Path path) {
Approval.of(short.class)
.withReporter(reporter)
.build()
.verify(value, path);
} | java |
public static String prettyType(BtrpOperand o) {
if (o == IgnorableOperand.getInstance()) {
return "??";
}
return prettyType(o.degree(), o.type());
} | java |
public static String prettyType(int degree, Type t) {
StringBuilder b = new StringBuilder();
for (int i = degree; i > 0; i--) {
b.append("set<");
}
b.append(t.toString().toLowerCase());
for (int i = 0; i < degree; i++) {
b.append(">");
}
re... | java |
@Override
public void addDim(List<IntVar> c, int[] cUse, IntVar[] dUse) {
capacities.add(c);
cUsages.add(cUse);
dUsages.add(dUse);
} | java |
@Override
@SuppressWarnings("squid:S3346")
public boolean beforeSolve(ReconfigurationProblem rp) {
super.beforeSolve(rp);
if (rp.getSourceModel().getMapping().getNbNodes() == 0 || capacities.isEmpty()) {
return true;
}
int nbDims = capacities.size();
int nbRe... | java |
private boolean symmetryBreakingForStayingVMs(ReconfigurationProblem rp) {
for (VM vm : rp.getFutureRunningVMs()) {
VMTransition a = rp.getVMAction(vm);
Slice dSlice = a.getDSlice();
Slice cSlice = a.getCSlice();
if (dSlice != null && cSlice != null) {
... | java |
protected StringBuilder getPath(StringBuilder path, int startIndex, boolean addPoint) {
boolean simple = true;
if (key != null) {
if (addPoint && path.length() > 0) {
path.insert(0, '.');
}
if (key instanceof Integer) {
path.insert(0, ']');
if (startIndex == 0) {
path.insert(0, ke... | java |
public Tree setType(Class<?> type) {
if (value == null || value.getClass() == type) {
return this;
}
value = DataConverterRegistry.convert(type, value);
if (parent != null && key != null) {
if (key instanceof String) {
parent.putObjectInternal((String) key, value, false);
} else {
pare... | java |
public Tree insert(int index, byte[] value, boolean asBase64String) {
if (asBase64String) {
return insertObjectInternal(index, BASE64.encode(value));
}
return insertObjectInternal(index, value);
} | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.