Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.monticore.refadapt;

import com.google.common.base.Preconditions;
import de.monticore.ast.ASTNode;
import de.monticore.visitor.ITraverser;
import de.se_rwth.commons.logging.Log;
Expand Down Expand Up @@ -52,10 +53,10 @@ protected ReferenceArtifactAdapter(
AdaptationContextHolder contextHolder,
Variants4Ast variants4Ast
) {
this.bindingVariantsTraverser = Log.errorIfNull(bindingVariantsTraverser);
this.adaptationTraverser = Log.errorIfNull(adaptationTraverser);
this.contextHolder = Log.errorIfNull(contextHolder);
this.variants4Ast = Log.errorIfNull(variants4Ast);
this.bindingVariantsTraverser = Preconditions.checkNotNull(bindingVariantsTraverser);
this.adaptationTraverser = Preconditions.checkNotNull(adaptationTraverser);
this.contextHolder = Preconditions.checkNotNull(contextHolder);
this.variants4Ast = Preconditions.checkNotNull(variants4Ast);
}

public ITraverser getBindingVariantsTraverser() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void handle(ASTNotEqualsExpression node) {

@Override
public void handle(ASTArrayAccessExpression node) {
Log.errorIfNull(node);
Preconditions.checkNotNull(node);
SymTypeExpression exprType = TypeCheck3.typeOf(node.getExpression());
if (exprType.isObscureType()) {
// error should be logged already
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.ocl.codegen.visitors;

import com.google.common.base.Preconditions;
import de.monticore.expressions.expressionsbasis._ast.ASTExpression;
import de.monticore.expressions.uglyexpressions._ast.ASTArrayCreator;
import de.monticore.expressions.uglyexpressions._ast.ASTArrayDimensionByExpression;
Expand Down Expand Up @@ -28,10 +29,10 @@ public class UglyExpressionsPrinter extends AbstractPrinter

public UglyExpressionsPrinter(
IndentPrinter printer, VariableNaming naming, IDerive deriver, ISynthesize synthesizer) {
this.printer = Log.errorIfNull(printer);
this.naming = Log.errorIfNull(naming);
this.deriver = Log.errorIfNull(deriver);
this.syntheziser = Log.errorIfNull(synthesizer);
this.printer = Preconditions.checkNotNull(printer);
this.naming = Preconditions.checkNotNull(naming);
this.deriver = Preconditions.checkNotNull(deriver);
this.syntheziser = Preconditions.checkNotNull(synthesizer);
}

@Override
Expand All @@ -41,7 +42,7 @@ public UglyExpressionsTraverser getTraverser() {

@Override
public void setTraverser(UglyExpressionsTraverser traverser) {
Log.errorIfNull(traverser);
Preconditions.checkNotNull(traverser);
this.traverser = traverser;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import static de.monticore.ocl.ocl._symboltable.OCLSymbolTableHelper.getImportStatements;

import com.google.common.base.Preconditions;
import de.monticore.ocl.ocl.OCLMill;
import de.monticore.ocl.ocl._ast.ASTOCLCompilationUnit;
import de.monticore.ocl.ocl._ast.ASTOCLInvariant;
Expand All @@ -19,7 +20,7 @@ public OCLScopesGenitor() {

@Override
public IOCLArtifactScope createFromAST(ASTOCLCompilationUnit node) {
Log.errorIfNull(
Preconditions.checkNotNull(
node,
"0xAE884 Error by creating of the OCLScopesGenitor symbol table: top ast node is null");
IOCLArtifactScope artifactScope = OCLMill.artifactScope();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// (c) https://github.com/MontiCore/monticore
package de.monticore.ocl.types3;

import com.google.common.base.Preconditions;
import de.monticore.symbols.basicsymbols.BasicSymbolsMill;
import de.monticore.symbols.basicsymbols._symboltable.IBasicSymbolsGlobalScope;
import de.monticore.symbols.basicsymbols._symboltable.TypeSymbol;
Expand Down Expand Up @@ -105,7 +106,7 @@ public static void reset() {
}

protected static void setDelegate(OCLCollectionSymTypeRelations newDelegate) {
OCLCollectionSymTypeRelations.delegate = Log.errorIfNull(newDelegate);
OCLCollectionSymTypeRelations.delegate = Preconditions.checkNotNull(newDelegate);
MCCollectionSymTypeRelations.setDelegate(newDelegate);
}

Expand Down
Loading