feat: 项目整体命名修改cache-schema-checker
All checks were successful
缓存序列化结构检查 / cache-schema-check (push) Has been skipped
All checks were successful
缓存序列化结构检查 / cache-schema-check (push) Has been skipped
This commit is contained in:
127
src/main/java/com/codechecker/cache/detector/WritePoint.java
vendored
Normal file
127
src/main/java/com/codechecker/cache/detector/WritePoint.java
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
package com.codechecker.cache.detector;
|
||||
|
||||
/**
|
||||
* 一个 Redis value 写入点的静态描述。
|
||||
*/
|
||||
public class WritePoint {
|
||||
|
||||
private String filePath;
|
||||
private int lineNumber;
|
||||
private String enclosingClass;
|
||||
private String enclosingMethod;
|
||||
private String pattern;
|
||||
|
||||
private String keyExpression;
|
||||
private String resolvedKeyPattern;
|
||||
|
||||
private String valueExpression;
|
||||
private String resolvedValueType;
|
||||
private boolean rootArray;
|
||||
|
||||
private double confidence = 1.0;
|
||||
|
||||
/** 稳定标识:用于在 old/new 两个版本间配对同一写入点 */
|
||||
public String signature() {
|
||||
return enclosingClass + "#" + enclosingMethod + "|" + normalizeKey();
|
||||
}
|
||||
|
||||
private String normalizeKey() {
|
||||
return keyExpression == null ? "" : keyExpression.replaceAll("\\s+", "");
|
||||
}
|
||||
|
||||
public String getFilePath() {
|
||||
return filePath;
|
||||
}
|
||||
|
||||
public void setFilePath(String filePath) {
|
||||
this.filePath = filePath;
|
||||
}
|
||||
|
||||
public int getLineNumber() {
|
||||
return lineNumber;
|
||||
}
|
||||
|
||||
public void setLineNumber(int lineNumber) {
|
||||
this.lineNumber = lineNumber;
|
||||
}
|
||||
|
||||
public String getEnclosingClass() {
|
||||
return enclosingClass;
|
||||
}
|
||||
|
||||
public void setEnclosingClass(String enclosingClass) {
|
||||
this.enclosingClass = enclosingClass;
|
||||
}
|
||||
|
||||
public String getEnclosingMethod() {
|
||||
return enclosingMethod;
|
||||
}
|
||||
|
||||
public void setEnclosingMethod(String enclosingMethod) {
|
||||
this.enclosingMethod = enclosingMethod;
|
||||
}
|
||||
|
||||
public String getPattern() {
|
||||
return pattern;
|
||||
}
|
||||
|
||||
public void setPattern(String pattern) {
|
||||
this.pattern = pattern;
|
||||
}
|
||||
|
||||
public String getKeyExpression() {
|
||||
return keyExpression;
|
||||
}
|
||||
|
||||
public void setKeyExpression(String keyExpression) {
|
||||
this.keyExpression = keyExpression;
|
||||
}
|
||||
|
||||
public String getResolvedKeyPattern() {
|
||||
return resolvedKeyPattern;
|
||||
}
|
||||
|
||||
public void setResolvedKeyPattern(String resolvedKeyPattern) {
|
||||
this.resolvedKeyPattern = resolvedKeyPattern;
|
||||
}
|
||||
|
||||
public String getValueExpression() {
|
||||
return valueExpression;
|
||||
}
|
||||
|
||||
public void setValueExpression(String valueExpression) {
|
||||
this.valueExpression = valueExpression;
|
||||
}
|
||||
|
||||
public String getResolvedValueType() {
|
||||
return resolvedValueType;
|
||||
}
|
||||
|
||||
public void setResolvedValueType(String resolvedValueType) {
|
||||
this.resolvedValueType = resolvedValueType;
|
||||
}
|
||||
|
||||
public boolean isRootArray() {
|
||||
return rootArray;
|
||||
}
|
||||
|
||||
public void setRootArray(boolean rootArray) {
|
||||
this.rootArray = rootArray;
|
||||
}
|
||||
|
||||
public double getConfidence() {
|
||||
return confidence;
|
||||
}
|
||||
|
||||
public void setConfidence(double confidence) {
|
||||
this.confidence = confidence;
|
||||
}
|
||||
|
||||
public String location() {
|
||||
String simpleClass = enclosingClass;
|
||||
if (simpleClass != null && simpleClass.contains(".")) {
|
||||
simpleClass = simpleClass.substring(simpleClass.lastIndexOf('.') + 1);
|
||||
}
|
||||
return simpleClass + "#" + enclosingMethod + ":" + lineNumber;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user