code
stringlengths 130
281k
| code_dependency
stringlengths 182
306k
|
|---|---|
public class class_name {
public List<ZoneOffsetTransition> getTransitions() {
List<ZoneOffsetTransition> list = new ArrayList<>();
for (int i = 0; i < savingsInstantTransitions.length; i++) {
list.add(new ZoneOffsetTransition(savingsInstantTransitions[i], wallOffsets[i], wallOffsets[i + 1]));
}
return Collections.unmodifiableList(list);
} }
|
public class class_name {
public List<ZoneOffsetTransition> getTransitions() {
List<ZoneOffsetTransition> list = new ArrayList<>();
for (int i = 0; i < savingsInstantTransitions.length; i++) {
list.add(new ZoneOffsetTransition(savingsInstantTransitions[i], wallOffsets[i], wallOffsets[i + 1])); // depends on control dependency: [for], data = [i]
}
return Collections.unmodifiableList(list);
} }
|
public class class_name {
public static base_responses delete(nitro_service client, dnskey resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
dnskey deleteresources[] = new dnskey[resources.length];
for (int i=0;i<resources.length;i++){
deleteresources[i] = new dnskey();
deleteresources[i].keyname = resources[i].keyname;
}
result = delete_bulk_request(client, deleteresources);
}
return result;
} }
|
public class class_name {
public static base_responses delete(nitro_service client, dnskey resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
dnskey deleteresources[] = new dnskey[resources.length];
for (int i=0;i<resources.length;i++){
deleteresources[i] = new dnskey(); // depends on control dependency: [for], data = [i]
deleteresources[i].keyname = resources[i].keyname; // depends on control dependency: [for], data = [i]
}
result = delete_bulk_request(client, deleteresources);
}
return result;
} }
|
public class class_name {
public static <T> Class<T> getTypeParameter(Class<?> klass, Class<? super T> bound) {
Type t = requireNonNull(klass);
while (t instanceof Class<?>) {
t = ((Class<?>) t).getGenericSuperclass();
}
/* This is not guaranteed to work for all cases with convoluted piping
* of type parameters: but it can at least resolve straight-forward
* extension with single type parameter (as per [Issue-89]).
* And when it fails to do that, will indicate with specific exception.
*/
if (t instanceof ParameterizedType) {
// should typically have one of type parameters (first one) that matches:
for (Type param : ((ParameterizedType) t).getActualTypeArguments()) {
if (param instanceof Class<?>) {
final Class<T> cls = determineClass(bound, param);
if (cls != null) {
return cls;
}
} else if (param instanceof TypeVariable) {
for (Type paramBound : ((TypeVariable<?>) param).getBounds()) {
if (paramBound instanceof Class<?>) {
final Class<T> cls = determineClass(bound, paramBound);
if (cls != null) {
return cls;
}
}
}
} else if (param instanceof ParameterizedType) {
final Type rawType = ((ParameterizedType) param).getRawType();
if (rawType instanceof Class<?>) {
final Class<T> cls = determineClass(bound, rawType);
if (cls != null) {
return cls;
}
}
}
}
}
throw new IllegalStateException("Cannot figure out type parameterization for " + klass.getName());
} }
|
public class class_name {
public static <T> Class<T> getTypeParameter(Class<?> klass, Class<? super T> bound) {
Type t = requireNonNull(klass);
while (t instanceof Class<?>) {
t = ((Class<?>) t).getGenericSuperclass(); // depends on control dependency: [while], data = [)]
}
/* This is not guaranteed to work for all cases with convoluted piping
* of type parameters: but it can at least resolve straight-forward
* extension with single type parameter (as per [Issue-89]).
* And when it fails to do that, will indicate with specific exception.
*/
if (t instanceof ParameterizedType) {
// should typically have one of type parameters (first one) that matches:
for (Type param : ((ParameterizedType) t).getActualTypeArguments()) {
if (param instanceof Class<?>) {
final Class<T> cls = determineClass(bound, param);
if (cls != null) {
return cls; // depends on control dependency: [if], data = [none]
}
} else if (param instanceof TypeVariable) {
for (Type paramBound : ((TypeVariable<?>) param).getBounds()) {
if (paramBound instanceof Class<?>) {
final Class<T> cls = determineClass(bound, paramBound);
if (cls != null) {
return cls; // depends on control dependency: [if], data = [none]
}
}
}
} else if (param instanceof ParameterizedType) {
final Type rawType = ((ParameterizedType) param).getRawType();
if (rawType instanceof Class<?>) {
final Class<T> cls = determineClass(bound, rawType);
if (cls != null) {
return cls; // depends on control dependency: [if], data = [none]
}
}
}
}
}
throw new IllegalStateException("Cannot figure out type parameterization for " + klass.getName());
} }
|
public class class_name {
public void marshall(Directory directory, ProtocolMarshaller protocolMarshaller) {
if (directory == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(directory.getName(), NAME_BINDING);
protocolMarshaller.marshall(directory.getDirectoryArn(), DIRECTORYARN_BINDING);
protocolMarshaller.marshall(directory.getState(), STATE_BINDING);
protocolMarshaller.marshall(directory.getCreationDateTime(), CREATIONDATETIME_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(Directory directory, ProtocolMarshaller protocolMarshaller) {
if (directory == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(directory.getName(), NAME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(directory.getDirectoryArn(), DIRECTORYARN_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(directory.getState(), STATE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(directory.getCreationDateTime(), CREATIONDATETIME_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public void displayError(DBException ex)
{
int iWarningLevel = DBConstants.WARNING_MESSAGE;
String strMessage = DBConstants.BLANK;
if (ex instanceof DatabaseException)
{
iWarningLevel = ((DatabaseException)ex).getWarningLevel();
strMessage = ((DatabaseException)ex).getMessage(this.getTask());
}
else
strMessage = ex.getMessage();
this.displayError(strMessage, iWarningLevel);
} }
|
public class class_name {
public void displayError(DBException ex)
{
int iWarningLevel = DBConstants.WARNING_MESSAGE;
String strMessage = DBConstants.BLANK;
if (ex instanceof DatabaseException)
{
iWarningLevel = ((DatabaseException)ex).getWarningLevel(); // depends on control dependency: [if], data = [none]
strMessage = ((DatabaseException)ex).getMessage(this.getTask()); // depends on control dependency: [if], data = [none]
}
else
strMessage = ex.getMessage();
this.displayError(strMessage, iWarningLevel);
} }
|
public class class_name {
protected List<ICompositeNode> internalFindValidReplaceRootNodeForChangeRegion(List<ICompositeNode> nodesEnclosingRegion) {
List<ICompositeNode> result = new ArrayList<ICompositeNode>();
boolean mustSkipNext = false;
for (int i = 0; i < nodesEnclosingRegion.size(); i++) {
ICompositeNode node = nodesEnclosingRegion.get(i);
if (node.getGrammarElement() != null) {
if (!mustSkipNext) {
result.add(node);
if (isActionNode(node)) {
mustSkipNext = true;
}
} else {
mustSkipNext = isActionNode(node);
}
}
}
return result;
} }
|
public class class_name {
protected List<ICompositeNode> internalFindValidReplaceRootNodeForChangeRegion(List<ICompositeNode> nodesEnclosingRegion) {
List<ICompositeNode> result = new ArrayList<ICompositeNode>();
boolean mustSkipNext = false;
for (int i = 0; i < nodesEnclosingRegion.size(); i++) {
ICompositeNode node = nodesEnclosingRegion.get(i);
if (node.getGrammarElement() != null) {
if (!mustSkipNext) {
result.add(node); // depends on control dependency: [if], data = [none]
if (isActionNode(node)) {
mustSkipNext = true; // depends on control dependency: [if], data = [none]
}
} else {
mustSkipNext = isActionNode(node); // depends on control dependency: [if], data = [none]
}
}
}
return result;
} }
|
public class class_name {
public static int compareTo(final double x, final double y, final int maxUlps) {
if (equals(x, y, maxUlps)) {
return 0;
} else if (x < y) {
return -1;
}
return 1;
} }
|
public class class_name {
public static int compareTo(final double x, final double y, final int maxUlps) {
if (equals(x, y, maxUlps)) {
return 0; // depends on control dependency: [if], data = [none]
} else if (x < y) {
return -1; // depends on control dependency: [if], data = [none]
}
return 1;
} }
|
public class class_name {
private static void initPrefixHandlers()
{
PrefixHandlerConfig[] prefixHandlers = ConfigUtil.getConfig().getPrefixHandlers();
if ( prefixHandlers == null )
{
return;
}
for ( int i = 0; i < prefixHandlers.length; i++ )
{
try
{
Class prefixClass = Class.forName( prefixHandlers[i].getHandlerClass() );
String name = prefixHandlers[i].getName();
if ( name == null || name.equals( "" ) )
{
_log.warn( "The name for the prefix handler '" + prefixHandlers[i].getHandlerClass()
+ "' must not be null" );
continue;
}
Object o = prefixClass.newInstance();
if ( !( o instanceof RequestParameterHandler ) )
{
_log.warn( "The class '" + prefixHandlers[i].getHandlerClass()
+ "' must be an instance of RequestParameterHandler" );
continue;
}
ProcessPopulate.registerPrefixHandler( name, ( RequestParameterHandler ) o );
}
catch ( ClassNotFoundException e )
{
_log.warn( "Class '" + prefixHandlers[i].getHandlerClass() + "' not found", e );
}
catch ( IllegalAccessException e )
{
_log.warn( "Illegal access on Class '" + prefixHandlers[i].getHandlerClass() + "'", e );
}
catch ( InstantiationException e )
{
_log.warn( "InstantiationException on Class '" + prefixHandlers[i].getHandlerClass() + "'",
e.getCause() );
}
}
} }
|
public class class_name {
private static void initPrefixHandlers()
{
PrefixHandlerConfig[] prefixHandlers = ConfigUtil.getConfig().getPrefixHandlers();
if ( prefixHandlers == null )
{
return; // depends on control dependency: [if], data = [none]
}
for ( int i = 0; i < prefixHandlers.length; i++ )
{
try
{
Class prefixClass = Class.forName( prefixHandlers[i].getHandlerClass() );
String name = prefixHandlers[i].getName();
if ( name == null || name.equals( "" ) )
{
_log.warn( "The name for the prefix handler '" + prefixHandlers[i].getHandlerClass()
+ "' must not be null" ); // depends on control dependency: [if], data = [none]
continue;
}
Object o = prefixClass.newInstance();
if ( !( o instanceof RequestParameterHandler ) )
{
_log.warn( "The class '" + prefixHandlers[i].getHandlerClass()
+ "' must be an instance of RequestParameterHandler" ); // depends on control dependency: [if], data = [none]
continue;
}
ProcessPopulate.registerPrefixHandler( name, ( RequestParameterHandler ) o );
}
catch ( ClassNotFoundException e )
{
_log.warn( "Class '" + prefixHandlers[i].getHandlerClass() + "' not found", e );
}
catch ( IllegalAccessException e )
{
_log.warn( "Illegal access on Class '" + prefixHandlers[i].getHandlerClass() + "'", e );
}
catch ( InstantiationException e )
{
_log.warn( "InstantiationException on Class '" + prefixHandlers[i].getHandlerClass() + "'",
e.getCause() );
}
}
} }
|
public class class_name {
public String format(double number, NumberFormat numberFormat, PluralRules pluralRules) {
String formatStr = numberFormat.format(number);
StandardPlural p = selectPlural(number, numberFormat, pluralRules);
SimpleFormatter formatter = templates[p.ordinal()];
if (formatter == null) {
formatter = templates[StandardPlural.OTHER_INDEX];
assert formatter != null;
}
return formatter.format(formatStr);
} }
|
public class class_name {
public String format(double number, NumberFormat numberFormat, PluralRules pluralRules) {
String formatStr = numberFormat.format(number);
StandardPlural p = selectPlural(number, numberFormat, pluralRules);
SimpleFormatter formatter = templates[p.ordinal()];
if (formatter == null) {
formatter = templates[StandardPlural.OTHER_INDEX]; // depends on control dependency: [if], data = [none]
assert formatter != null;
}
return formatter.format(formatStr);
} }
|
public class class_name {
static Graph filteredView(GraphHopperStorage baseGraph, EdgeFilter edgeFilter) {
return new Graph() {
@Override
public Graph getBaseGraph() {
return baseGraph;
}
@Override
public int getNodes() {
return baseGraph.getNodes();
}
@Override
public int getEdges() {
return baseGraph.getEdges();
}
@Override
public NodeAccess getNodeAccess() {
return baseGraph.getNodeAccess();
}
@Override
public BBox getBounds() {
return baseGraph.getBounds();
}
@Override
public EdgeIteratorState edge(int a, int b) {
throw new UnsupportedOperationException();
}
@Override
public EdgeIteratorState edge(int a, int b, double distance, boolean bothDirections) {
throw new UnsupportedOperationException();
}
@Override
public EdgeIteratorState getEdgeIteratorState(int edgeId, int adjNode) {
throw new UnsupportedOperationException();
}
@Override
public AllEdgesIterator getAllEdges() {
final AllEdgesIterator edge = baseGraph.getAllEdges();
return new AllEdgesIterator() {
@Override
public int length() {
return edge.length();
}
@Override
public boolean next() {
while (edge.next()) {
if (edgeFilter.accept(edge)) {
return true;
}
}
return false;
}
@Override
public int getEdge() {
return edge.getEdge();
}
@Override
public int getOrigEdgeFirst() {
return getEdge();
}
@Override
public int getOrigEdgeLast() {
return getEdge();
}
@Override
public int getBaseNode() {
return edge.getBaseNode();
}
@Override
public int getAdjNode() {
return edge.getAdjNode();
}
@Override
public PointList fetchWayGeometry(int mode) {
return edge.fetchWayGeometry(mode);
}
@Override
public EdgeIteratorState setWayGeometry(PointList list) {
edge.setWayGeometry(list);
return this;
}
@Override
public double getDistance() {
return edge.getDistance();
}
@Override
public EdgeIteratorState setDistance(double dist) {
edge.setDistance(dist);
return this;
}
@Override
public IntsRef getFlags() {
return edge.getFlags();
}
@Override
public EdgeIteratorState setFlags(IntsRef flags) {
edge.setFlags(flags);
return this;
}
@Override
public int getAdditionalField() {
return edge.getAdditionalField();
}
@Override
public EdgeIteratorState setAdditionalField(int value) {
edge.setAdditionalField(value);
return this;
}
@Override
public String getName() {
return edge.getName();
}
@Override
public EdgeIteratorState setName(String name) {
edge.setName(name);
return this;
}
@Override
public EdgeIteratorState detach(boolean reverse) {
return edge.detach(reverse);
}
@Override
public boolean get(BooleanEncodedValue property) {
return edge.get(property);
}
@Override
public EdgeIteratorState set(BooleanEncodedValue property, boolean value) {
edge.set(property, value);
return this;
}
@Override
public boolean getReverse(BooleanEncodedValue property) {
return edge.getReverse(property);
}
@Override
public EdgeIteratorState setReverse(BooleanEncodedValue property, boolean value) {
edge.setReverse(property, value);
return this;
}
@Override
public int get(IntEncodedValue property) {
return edge.get(property);
}
@Override
public EdgeIteratorState set(IntEncodedValue property, int value) {
edge.set(property, value);
return this;
}
@Override
public int getReverse(IntEncodedValue property) {
return edge.getReverse(property);
}
@Override
public EdgeIteratorState setReverse(IntEncodedValue property, int value) {
edge.setReverse(property, value);
return this;
}
@Override
public double get(DecimalEncodedValue property) {
return edge.get(property);
}
@Override
public EdgeIteratorState set(DecimalEncodedValue property, double value) {
edge.set(property, value);
return this;
}
@Override
public double getReverse(DecimalEncodedValue property) {
return edge.getReverse(property);
}
@Override
public EdgeIteratorState setReverse(DecimalEncodedValue property, double value) {
edge.setReverse(property, value);
return this;
}
@Override
public <T extends Enum> T get(EnumEncodedValue<T> property) {
return edge.get(property);
}
@Override
public <T extends Enum> EdgeIteratorState set(EnumEncodedValue<T> property, T value) {
edge.set(property, value);
return this;
}
@Override
public <T extends Enum> T getReverse(EnumEncodedValue<T> property) {
return edge.getReverse(property);
}
@Override
public <T extends Enum> EdgeIteratorState setReverse(EnumEncodedValue<T> property, T value) {
edge.setReverse(property, value);
return this;
}
@Override
public EdgeIteratorState copyPropertiesFrom(EdgeIteratorState e) {
throw new UnsupportedOperationException();
}
};
}
@Override
public EdgeExplorer createEdgeExplorer(EdgeFilter filter) {
throw new UnsupportedOperationException();
}
@Override
public EdgeExplorer createEdgeExplorer() {
return baseGraph.createEdgeExplorer(edgeFilter);
}
@Override
public Graph copyTo(Graph g) {
throw new UnsupportedOperationException();
}
@Override
public GraphExtension getExtension() {
throw new UnsupportedOperationException();
}
@Override
public int getOtherNode(int edge, int node) {
throw new UnsupportedOperationException();
}
};
} }
|
public class class_name {
static Graph filteredView(GraphHopperStorage baseGraph, EdgeFilter edgeFilter) {
return new Graph() {
@Override
public Graph getBaseGraph() {
return baseGraph;
}
@Override
public int getNodes() {
return baseGraph.getNodes();
}
@Override
public int getEdges() {
return baseGraph.getEdges();
}
@Override
public NodeAccess getNodeAccess() {
return baseGraph.getNodeAccess();
}
@Override
public BBox getBounds() {
return baseGraph.getBounds();
}
@Override
public EdgeIteratorState edge(int a, int b) {
throw new UnsupportedOperationException();
}
@Override
public EdgeIteratorState edge(int a, int b, double distance, boolean bothDirections) {
throw new UnsupportedOperationException();
}
@Override
public EdgeIteratorState getEdgeIteratorState(int edgeId, int adjNode) {
throw new UnsupportedOperationException();
}
@Override
public AllEdgesIterator getAllEdges() {
final AllEdgesIterator edge = baseGraph.getAllEdges();
return new AllEdgesIterator() {
@Override
public int length() {
return edge.length();
}
@Override
public boolean next() {
while (edge.next()) {
if (edgeFilter.accept(edge)) {
return true; // depends on control dependency: [if], data = [none]
}
}
return false;
}
@Override
public int getEdge() {
return edge.getEdge();
}
@Override
public int getOrigEdgeFirst() {
return getEdge();
}
@Override
public int getOrigEdgeLast() {
return getEdge();
}
@Override
public int getBaseNode() {
return edge.getBaseNode();
}
@Override
public int getAdjNode() {
return edge.getAdjNode();
}
@Override
public PointList fetchWayGeometry(int mode) {
return edge.fetchWayGeometry(mode);
}
@Override
public EdgeIteratorState setWayGeometry(PointList list) {
edge.setWayGeometry(list);
return this;
}
@Override
public double getDistance() {
return edge.getDistance();
}
@Override
public EdgeIteratorState setDistance(double dist) {
edge.setDistance(dist);
return this;
}
@Override
public IntsRef getFlags() {
return edge.getFlags();
}
@Override
public EdgeIteratorState setFlags(IntsRef flags) {
edge.setFlags(flags);
return this;
}
@Override
public int getAdditionalField() {
return edge.getAdditionalField();
}
@Override
public EdgeIteratorState setAdditionalField(int value) {
edge.setAdditionalField(value);
return this;
}
@Override
public String getName() {
return edge.getName();
}
@Override
public EdgeIteratorState setName(String name) {
edge.setName(name);
return this;
}
@Override
public EdgeIteratorState detach(boolean reverse) {
return edge.detach(reverse);
}
@Override
public boolean get(BooleanEncodedValue property) {
return edge.get(property);
}
@Override
public EdgeIteratorState set(BooleanEncodedValue property, boolean value) {
edge.set(property, value);
return this;
}
@Override
public boolean getReverse(BooleanEncodedValue property) {
return edge.getReverse(property);
}
@Override
public EdgeIteratorState setReverse(BooleanEncodedValue property, boolean value) {
edge.setReverse(property, value);
return this;
}
@Override
public int get(IntEncodedValue property) {
return edge.get(property);
}
@Override
public EdgeIteratorState set(IntEncodedValue property, int value) {
edge.set(property, value);
return this;
}
@Override
public int getReverse(IntEncodedValue property) {
return edge.getReverse(property);
}
@Override
public EdgeIteratorState setReverse(IntEncodedValue property, int value) {
edge.setReverse(property, value);
return this;
}
@Override
public double get(DecimalEncodedValue property) {
return edge.get(property);
}
@Override
public EdgeIteratorState set(DecimalEncodedValue property, double value) {
edge.set(property, value);
return this;
}
@Override
public double getReverse(DecimalEncodedValue property) {
return edge.getReverse(property);
}
@Override
public EdgeIteratorState setReverse(DecimalEncodedValue property, double value) {
edge.setReverse(property, value);
return this;
}
@Override
public <T extends Enum> T get(EnumEncodedValue<T> property) {
return edge.get(property);
}
@Override
public <T extends Enum> EdgeIteratorState set(EnumEncodedValue<T> property, T value) {
edge.set(property, value);
return this;
}
@Override
public <T extends Enum> T getReverse(EnumEncodedValue<T> property) {
return edge.getReverse(property);
}
@Override
public <T extends Enum> EdgeIteratorState setReverse(EnumEncodedValue<T> property, T value) {
edge.setReverse(property, value);
return this;
}
@Override
public EdgeIteratorState copyPropertiesFrom(EdgeIteratorState e) {
throw new UnsupportedOperationException();
}
};
}
@Override
public EdgeExplorer createEdgeExplorer(EdgeFilter filter) {
throw new UnsupportedOperationException();
}
@Override
public EdgeExplorer createEdgeExplorer() {
return baseGraph.createEdgeExplorer(edgeFilter);
}
@Override
public Graph copyTo(Graph g) {
throw new UnsupportedOperationException();
}
@Override
public GraphExtension getExtension() {
throw new UnsupportedOperationException();
}
@Override
public int getOtherNode(int edge, int node) {
throw new UnsupportedOperationException();
}
};
} }
|
public class class_name {
public String app() {
if (d1 < 0) {
// No stack or detail is present
return asg.length() > 0 ? asg : null;
} else if (d1 == 0) {
// Application portion is empty
return null;
} else {
// Application is present along with stack, detail, or sequence
return substr(asg, 0, d1);
}
} }
|
public class class_name {
public String app() {
if (d1 < 0) {
// No stack or detail is present
return asg.length() > 0 ? asg : null; // depends on control dependency: [if], data = [none]
} else if (d1 == 0) {
// Application portion is empty
return null; // depends on control dependency: [if], data = [none]
} else {
// Application is present along with stack, detail, or sequence
return substr(asg, 0, d1); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private String parseUntilFwdSlash( DdlTokenStream tokens,
boolean stopAtStatementStart ) throws ParsingException {
StringBuilder sb = new StringBuilder();
if (stopAtStatementStart) {
while (tokens.hasNext()
&& !tokens.matches(DdlTokenizer.STATEMENT_KEY) && !tokens.matches('/')) { // !tokens.matches(DdlTokenizer.STATEMENT_KEY
// )
// &&
sb.append(SPACE).append(tokens.consume());
}
} else {
while (tokens.hasNext() && !isFwdSlashedStatement(tokens) && !tokens.matches('/')) { // !tokens.matches(DdlTokenizer.
// STATEMENT_KEY) &&
sb.append(SPACE).append(tokens.consume());
}
}
return sb.toString();
} }
|
public class class_name {
private String parseUntilFwdSlash( DdlTokenStream tokens,
boolean stopAtStatementStart ) throws ParsingException {
StringBuilder sb = new StringBuilder();
if (stopAtStatementStart) {
while (tokens.hasNext()
&& !tokens.matches(DdlTokenizer.STATEMENT_KEY) && !tokens.matches('/')) { // !tokens.matches(DdlTokenizer.STATEMENT_KEY
// )
// &&
sb.append(SPACE).append(tokens.consume()); // depends on control dependency: [while], data = [none]
}
} else {
while (tokens.hasNext() && !isFwdSlashedStatement(tokens) && !tokens.matches('/')) { // !tokens.matches(DdlTokenizer.
// STATEMENT_KEY) &&
sb.append(SPACE).append(tokens.consume()); // depends on control dependency: [while], data = [none]
}
}
return sb.toString();
} }
|
public class class_name {
protected void createFile(File stagingDirectory) throws MojoExecutionException {
File targetDirectory = newSubdirectory(stagingDirectory, "META-INF");
File newEntry = new File(targetDirectory, filename);
try (FileOutputStream out = new FileOutputStream(newEntry); PrintStream ps = new PrintStream(out);) {
Iterator<ConfigEntry> iter = entries.values().iterator();
ConfigEntry entry = null;
for (int i = 0; i < buffer.size(); i++) {
if (entry == null && iter.hasNext()) {
entry = iter.next();
}
if (entry != null && entry.placeholder == i) {
for (String line : entry.buffer) {
ps.println(line);
}
entry = null;
continue;
}
ps.println(buffer.get(i));
}
} catch (Exception e) {
throw new MojoExecutionException("Unexpected error while creating configuration file.", e);
}
} }
|
public class class_name {
protected void createFile(File stagingDirectory) throws MojoExecutionException {
File targetDirectory = newSubdirectory(stagingDirectory, "META-INF");
File newEntry = new File(targetDirectory, filename);
try (FileOutputStream out = new FileOutputStream(newEntry); PrintStream ps = new PrintStream(out);) {
Iterator<ConfigEntry> iter = entries.values().iterator();
ConfigEntry entry = null;
for (int i = 0; i < buffer.size(); i++) {
if (entry == null && iter.hasNext()) {
entry = iter.next(); // depends on control dependency: [if], data = [none]
}
if (entry != null && entry.placeholder == i) {
for (String line : entry.buffer) {
ps.println(line); // depends on control dependency: [for], data = [line]
}
entry = null; // depends on control dependency: [if], data = [none]
continue;
}
ps.println(buffer.get(i)); // depends on control dependency: [for], data = [i]
}
} catch (Exception e) {
throw new MojoExecutionException("Unexpected error while creating configuration file.", e);
}
} }
|
public class class_name {
public @NotNull FileAssert doesNotExist() {
isNotNull();
if (!actual.exists()) {
return this;
}
failIfCustomMessageIsSet();
throw failure(format("file:<%s> should not exist", actual));
} }
|
public class class_name {
public @NotNull FileAssert doesNotExist() {
isNotNull();
if (!actual.exists()) {
return this; // depends on control dependency: [if], data = [none]
}
failIfCustomMessageIsSet();
throw failure(format("file:<%s> should not exist", actual));
} }
|
public class class_name {
public static void scale(double[][] x, double lo, double hi) {
int n = x.length;
int p = x[0].length;
double[] min = colMin(x);
double[] max = colMax(x);
for (int j = 0; j < p; j++) {
double scale = max[j] - min[j];
if (!Math.isZero(scale)) {
for (int i = 0; i < n; i++) {
x[i][j] = (x[i][j] - min[j]) / scale;
}
} else {
for (int i = 0; i < n; i++) {
x[i][j] = 0.5;
}
}
}
} }
|
public class class_name {
public static void scale(double[][] x, double lo, double hi) {
int n = x.length;
int p = x[0].length;
double[] min = colMin(x);
double[] max = colMax(x);
for (int j = 0; j < p; j++) {
double scale = max[j] - min[j];
if (!Math.isZero(scale)) {
for (int i = 0; i < n; i++) {
x[i][j] = (x[i][j] - min[j]) / scale; // depends on control dependency: [for], data = [i]
}
} else {
for (int i = 0; i < n; i++) {
x[i][j] = 0.5; // depends on control dependency: [for], data = [i]
}
}
}
} }
|
public class class_name {
public List<QueryQuestionComment> list(QueryPage queryPage, PanelStamp stamp, Query query, Folder queryParentFolder, QueryQuestionComment parentComment, boolean onlyRootComments, User user, Boolean archived) {
EntityManager entityManager = getEntityManager();
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<QueryQuestionComment> criteria = criteriaBuilder.createQuery(QueryQuestionComment.class);
Root<QueryQuestionComment> root = criteria.from(QueryQuestionComment.class);
Join<QueryQuestionComment, QueryPage> queryPageJoin = root.join(QueryQuestionComment_.queryPage);
Join<QueryPage, QuerySection> querySectionJoin = queryPageJoin.join(QueryPage_.querySection);
Join<QueryQuestionComment, QueryReply> queryReplyJoin = root.join(QueryQuestionComment_.queryReply);
Join<QuerySection, Query> queryJoin = querySectionJoin.join(QuerySection_.query);
Join<Query, Folder> queryFolderJoin = queryJoin.join(Query_.parentFolder);
List<Predicate> criterias = new ArrayList<>();
if (queryPage != null) {
criterias.add(criteriaBuilder.equal(root.get(QueryQuestionComment_.queryPage), queryPage));
}
if (stamp != null) {
criterias.add(criteriaBuilder.equal(queryReplyJoin.get(QueryReply_.stamp), stamp));
}
if (query != null) {
criterias.add(criteriaBuilder.equal(querySectionJoin.get(QuerySection_.query), query));
}
if (queryParentFolder != null) {
criterias.add(criteriaBuilder.equal(queryJoin.get(Query_.parentFolder), queryParentFolder));
}
if (onlyRootComments) {
criterias.add(criteriaBuilder.isNull(root.get(QueryQuestionComment_.parentComment)));
} else if (parentComment != null) {
criterias.add(criteriaBuilder.equal(root.get(QueryQuestionComment_.parentComment), parentComment));
}
if (user != null) {
criterias.add(criteriaBuilder.equal(queryReplyJoin.get(QueryReply_.user), user));
}
if (archived != null) {
criterias.add(criteriaBuilder.equal(queryJoin.get(Query_.archived), archived));
criterias.add(criteriaBuilder.equal(queryReplyJoin.get(QueryReply_.archived), archived));
criterias.add(criteriaBuilder.equal(queryPageJoin.get(QueryPage_.archived), archived));
criterias.add(criteriaBuilder.equal(querySectionJoin.get(QuerySection_.archived), archived));
criterias.add(criteriaBuilder.equal(queryFolderJoin.get(Folder_.archived), archived));
criterias.add(criteriaBuilder.equal(root.get(QueryQuestionComment_.archived), archived));
}
criteria.select(root);
criteria.where(criteriaBuilder.and(criterias.toArray(new Predicate[0])));
return entityManager.createQuery(criteria).getResultList();
} }
|
public class class_name {
public List<QueryQuestionComment> list(QueryPage queryPage, PanelStamp stamp, Query query, Folder queryParentFolder, QueryQuestionComment parentComment, boolean onlyRootComments, User user, Boolean archived) {
EntityManager entityManager = getEntityManager();
CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<QueryQuestionComment> criteria = criteriaBuilder.createQuery(QueryQuestionComment.class);
Root<QueryQuestionComment> root = criteria.from(QueryQuestionComment.class);
Join<QueryQuestionComment, QueryPage> queryPageJoin = root.join(QueryQuestionComment_.queryPage);
Join<QueryPage, QuerySection> querySectionJoin = queryPageJoin.join(QueryPage_.querySection);
Join<QueryQuestionComment, QueryReply> queryReplyJoin = root.join(QueryQuestionComment_.queryReply);
Join<QuerySection, Query> queryJoin = querySectionJoin.join(QuerySection_.query);
Join<Query, Folder> queryFolderJoin = queryJoin.join(Query_.parentFolder);
List<Predicate> criterias = new ArrayList<>();
if (queryPage != null) {
criterias.add(criteriaBuilder.equal(root.get(QueryQuestionComment_.queryPage), queryPage)); // depends on control dependency: [if], data = [none]
}
if (stamp != null) {
criterias.add(criteriaBuilder.equal(queryReplyJoin.get(QueryReply_.stamp), stamp)); // depends on control dependency: [if], data = [none]
}
if (query != null) {
criterias.add(criteriaBuilder.equal(querySectionJoin.get(QuerySection_.query), query)); // depends on control dependency: [if], data = [(query]
}
if (queryParentFolder != null) {
criterias.add(criteriaBuilder.equal(queryJoin.get(Query_.parentFolder), queryParentFolder)); // depends on control dependency: [if], data = [none]
}
if (onlyRootComments) {
criterias.add(criteriaBuilder.isNull(root.get(QueryQuestionComment_.parentComment))); // depends on control dependency: [if], data = [none]
} else if (parentComment != null) {
criterias.add(criteriaBuilder.equal(root.get(QueryQuestionComment_.parentComment), parentComment)); // depends on control dependency: [if], data = [none]
}
if (user != null) {
criterias.add(criteriaBuilder.equal(queryReplyJoin.get(QueryReply_.user), user)); // depends on control dependency: [if], data = [none]
}
if (archived != null) {
criterias.add(criteriaBuilder.equal(queryJoin.get(Query_.archived), archived)); // depends on control dependency: [if], data = [none]
criterias.add(criteriaBuilder.equal(queryReplyJoin.get(QueryReply_.archived), archived)); // depends on control dependency: [if], data = [none]
criterias.add(criteriaBuilder.equal(queryPageJoin.get(QueryPage_.archived), archived)); // depends on control dependency: [if], data = [none]
criterias.add(criteriaBuilder.equal(querySectionJoin.get(QuerySection_.archived), archived)); // depends on control dependency: [if], data = [none]
criterias.add(criteriaBuilder.equal(queryFolderJoin.get(Folder_.archived), archived)); // depends on control dependency: [if], data = [none]
criterias.add(criteriaBuilder.equal(root.get(QueryQuestionComment_.archived), archived)); // depends on control dependency: [if], data = [none]
}
criteria.select(root);
criteria.where(criteriaBuilder.and(criterias.toArray(new Predicate[0])));
return entityManager.createQuery(criteria).getResultList();
} }
|
public class class_name {
void kill(UUID queryId) {
DocumentExtractor extractor = queries.remove(queryId);
if (extractor != null) {
extractor.close();
}
} }
|
public class class_name {
void kill(UUID queryId) {
DocumentExtractor extractor = queries.remove(queryId);
if (extractor != null) {
extractor.close(); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private void flattenReferencesToCollapsibleDescendantNames(
Name n, String alias) {
if (n.props == null || n.isCollapsingExplicitlyDenied()) {
return;
}
for (Name p : n.props) {
String propAlias = appendPropForAlias(alias, p.getBaseName());
boolean isAllowedToCollapse =
propertyCollapseLevel != PropertyCollapseLevel.MODULE_EXPORT || p.isModuleExport();
if (isAllowedToCollapse && p.canCollapse()) {
flattenReferencesTo(p, propAlias);
} else if (isAllowedToCollapse
&& p.isSimpleStubDeclaration()
&& !p.isCollapsingExplicitlyDenied()) {
flattenSimpleStubDeclaration(p, propAlias);
}
flattenReferencesToCollapsibleDescendantNames(p, propAlias);
}
} }
|
public class class_name {
private void flattenReferencesToCollapsibleDescendantNames(
Name n, String alias) {
if (n.props == null || n.isCollapsingExplicitlyDenied()) {
return; // depends on control dependency: [if], data = [none]
}
for (Name p : n.props) {
String propAlias = appendPropForAlias(alias, p.getBaseName());
boolean isAllowedToCollapse =
propertyCollapseLevel != PropertyCollapseLevel.MODULE_EXPORT || p.isModuleExport();
if (isAllowedToCollapse && p.canCollapse()) {
flattenReferencesTo(p, propAlias); // depends on control dependency: [if], data = [none]
} else if (isAllowedToCollapse
&& p.isSimpleStubDeclaration()
&& !p.isCollapsingExplicitlyDenied()) {
flattenSimpleStubDeclaration(p, propAlias); // depends on control dependency: [if], data = [none]
}
flattenReferencesToCollapsibleDescendantNames(p, propAlias); // depends on control dependency: [for], data = [p]
}
} }
|
public class class_name {
private int attributeMap(String name) {
Integer num = map.get(name);
if (num == null) {
return 0;
}
return num.intValue();
} }
|
public class class_name {
private int attributeMap(String name) {
Integer num = map.get(name);
if (num == null) {
return 0; // depends on control dependency: [if], data = [none]
}
return num.intValue();
} }
|
public class class_name {
public void diff_cleanupSemanticLossless(LinkedList<Diff> diffs) {
String equality1, edit, equality2;
String commonString;
int commonOffset;
int score, bestScore;
String bestEquality1, bestEdit, bestEquality2;
// Create a new iterator at the start.
ListIterator<Diff> pointer = diffs.listIterator();
Diff prevDiff = pointer.hasNext() ? pointer.next() : null;
Diff thisDiff = pointer.hasNext() ? pointer.next() : null;
Diff nextDiff = pointer.hasNext() ? pointer.next() : null;
// Intentionally ignore the first and last element (don't need checking).
while (nextDiff != null) {
if (prevDiff.operation == Operation.EQUAL &&
nextDiff.operation == Operation.EQUAL) {
// This is a single edit surrounded by equalities.
equality1 = prevDiff.text;
edit = thisDiff.text;
equality2 = nextDiff.text;
// First, shift the edit as far left as possible.
commonOffset = diff_commonSuffix(equality1, edit);
if (commonOffset != 0) {
commonString = edit.substring(edit.length() - commonOffset);
equality1 = equality1.substring(0, equality1.length() - commonOffset);
edit = commonString + edit.substring(0, edit.length() - commonOffset);
equality2 = commonString + equality2;
}
// Second, step character by character right, looking for the best fit.
bestEquality1 = equality1;
bestEdit = edit;
bestEquality2 = equality2;
bestScore = diff_cleanupSemanticScore(equality1, edit)
+ diff_cleanupSemanticScore(edit, equality2);
while (edit.length() != 0 && equality2.length() != 0
&& edit.charAt(0) == equality2.charAt(0)) {
equality1 += edit.charAt(0);
edit = edit.substring(1) + equality2.charAt(0);
equality2 = equality2.substring(1);
score = diff_cleanupSemanticScore(equality1, edit)
+ diff_cleanupSemanticScore(edit, equality2);
// The >= encourages trailing rather than leading whitespace on edits.
if (score >= bestScore) {
bestScore = score;
bestEquality1 = equality1;
bestEdit = edit;
bestEquality2 = equality2;
}
}
if (!prevDiff.text.equals(bestEquality1)) {
// We have an improvement, save it back to the diff.
if (bestEquality1.length() != 0) {
prevDiff.text = bestEquality1;
} else {
pointer.previous(); // Walk past nextDiff.
pointer.previous(); // Walk past thisDiff.
pointer.previous(); // Walk past prevDiff.
pointer.remove(); // Delete prevDiff.
pointer.next(); // Walk past thisDiff.
pointer.next(); // Walk past nextDiff.
}
thisDiff.text = bestEdit;
if (bestEquality2.length() != 0) {
nextDiff.text = bestEquality2;
} else {
pointer.remove(); // Delete nextDiff.
nextDiff = thisDiff;
thisDiff = prevDiff;
}
}
}
prevDiff = thisDiff;
thisDiff = nextDiff;
nextDiff = pointer.hasNext() ? pointer.next() : null;
}
} }
|
public class class_name {
public void diff_cleanupSemanticLossless(LinkedList<Diff> diffs) {
String equality1, edit, equality2;
String commonString;
int commonOffset;
int score, bestScore;
String bestEquality1, bestEdit, bestEquality2;
// Create a new iterator at the start.
ListIterator<Diff> pointer = diffs.listIterator();
Diff prevDiff = pointer.hasNext() ? pointer.next() : null;
Diff thisDiff = pointer.hasNext() ? pointer.next() : null;
Diff nextDiff = pointer.hasNext() ? pointer.next() : null;
// Intentionally ignore the first and last element (don't need checking).
while (nextDiff != null) {
if (prevDiff.operation == Operation.EQUAL &&
nextDiff.operation == Operation.EQUAL) {
// This is a single edit surrounded by equalities.
equality1 = prevDiff.text; // depends on control dependency: [if], data = [none]
edit = thisDiff.text; // depends on control dependency: [if], data = [none]
equality2 = nextDiff.text; // depends on control dependency: [if], data = [none]
// First, shift the edit as far left as possible.
commonOffset = diff_commonSuffix(equality1, edit); // depends on control dependency: [if], data = [none]
if (commonOffset != 0) {
commonString = edit.substring(edit.length() - commonOffset); // depends on control dependency: [if], data = [none]
equality1 = equality1.substring(0, equality1.length() - commonOffset); // depends on control dependency: [if], data = [none]
edit = commonString + edit.substring(0, edit.length() - commonOffset); // depends on control dependency: [if], data = [none]
equality2 = commonString + equality2; // depends on control dependency: [if], data = [none]
}
// Second, step character by character right, looking for the best fit.
bestEquality1 = equality1; // depends on control dependency: [if], data = [none]
bestEdit = edit; // depends on control dependency: [if], data = [none]
bestEquality2 = equality2; // depends on control dependency: [if], data = [none]
bestScore = diff_cleanupSemanticScore(equality1, edit)
+ diff_cleanupSemanticScore(edit, equality2); // depends on control dependency: [if], data = [none]
while (edit.length() != 0 && equality2.length() != 0
&& edit.charAt(0) == equality2.charAt(0)) {
equality1 += edit.charAt(0); // depends on control dependency: [while], data = [none]
edit = edit.substring(1) + equality2.charAt(0); // depends on control dependency: [while], data = [none]
equality2 = equality2.substring(1); // depends on control dependency: [while], data = [none]
score = diff_cleanupSemanticScore(equality1, edit)
+ diff_cleanupSemanticScore(edit, equality2); // depends on control dependency: [while], data = [none]
// The >= encourages trailing rather than leading whitespace on edits.
if (score >= bestScore) {
bestScore = score; // depends on control dependency: [if], data = [none]
bestEquality1 = equality1; // depends on control dependency: [if], data = [none]
bestEdit = edit; // depends on control dependency: [if], data = [none]
bestEquality2 = equality2; // depends on control dependency: [if], data = [none]
}
}
if (!prevDiff.text.equals(bestEquality1)) {
// We have an improvement, save it back to the diff.
if (bestEquality1.length() != 0) {
prevDiff.text = bestEquality1; // depends on control dependency: [if], data = [none]
} else {
pointer.previous(); // Walk past nextDiff. // depends on control dependency: [if], data = [none]
pointer.previous(); // Walk past thisDiff. // depends on control dependency: [if], data = [none]
pointer.previous(); // Walk past prevDiff. // depends on control dependency: [if], data = [none]
pointer.remove(); // Delete prevDiff. // depends on control dependency: [if], data = [none]
pointer.next(); // Walk past thisDiff. // depends on control dependency: [if], data = [none]
pointer.next(); // Walk past nextDiff. // depends on control dependency: [if], data = [none]
}
thisDiff.text = bestEdit; // depends on control dependency: [if], data = [none]
if (bestEquality2.length() != 0) {
nextDiff.text = bestEquality2; // depends on control dependency: [if], data = [none]
} else {
pointer.remove(); // Delete nextDiff. // depends on control dependency: [if], data = [none]
nextDiff = thisDiff; // depends on control dependency: [if], data = [none]
thisDiff = prevDiff; // depends on control dependency: [if], data = [none]
}
}
}
prevDiff = thisDiff; // depends on control dependency: [while], data = [none]
thisDiff = nextDiff; // depends on control dependency: [while], data = [none]
nextDiff = pointer.hasNext() ? pointer.next() : null; // depends on control dependency: [while], data = [none]
}
} }
|
public class class_name {
public void closeSession() {
log.debug("Closing db session");
SQLException sqlException = null;
if (queries != null) {
for (DbQueryBase query : queries) {
SQLException sex = query.closeQuery();
if (sex != null) {
if (sqlException == null) {
sqlException = sex;
} else {
sqlException.setNextException(sex);
}
}
}
}
if (connection != null) {
if (txActive) {
throw new DbSqlException("TX was not closed before closing the session");
}
connectionProvider.closeConnection(connection);
connection = null;
}
queries = null;
if (sqlException != null) {
throw new DbSqlException("Closing DbSession failed", sqlException);
}
} }
|
public class class_name {
public void closeSession() {
log.debug("Closing db session");
SQLException sqlException = null;
if (queries != null) {
for (DbQueryBase query : queries) {
SQLException sex = query.closeQuery();
if (sex != null) {
if (sqlException == null) {
sqlException = sex; // depends on control dependency: [if], data = [none]
} else {
sqlException.setNextException(sex); // depends on control dependency: [if], data = [none]
}
}
}
}
if (connection != null) {
if (txActive) {
throw new DbSqlException("TX was not closed before closing the session");
}
connectionProvider.closeConnection(connection); // depends on control dependency: [if], data = [(connection]
connection = null; // depends on control dependency: [if], data = [none]
}
queries = null;
if (sqlException != null) {
throw new DbSqlException("Closing DbSession failed", sqlException);
}
} }
|
public class class_name {
public static MetricName join(MetricName... parts) {
final StringBuilder nameBuilder = new StringBuilder();
final Map<String, String> tags = new HashMap<>();
boolean first = true;
for (MetricName part : parts) {
final String name = part.getKey();
if (name != null && !name.isEmpty()) {
if (first) {
first = false;
} else {
nameBuilder.append(SEPARATOR);
}
nameBuilder.append(name);
}
if (!part.getTags().isEmpty())
tags.putAll(part.getTags());
}
return new MetricName(nameBuilder.toString(), tags);
} }
|
public class class_name {
public static MetricName join(MetricName... parts) {
final StringBuilder nameBuilder = new StringBuilder();
final Map<String, String> tags = new HashMap<>();
boolean first = true;
for (MetricName part : parts) {
final String name = part.getKey();
if (name != null && !name.isEmpty()) {
if (first) {
first = false; // depends on control dependency: [if], data = [none]
} else {
nameBuilder.append(SEPARATOR); // depends on control dependency: [if], data = [none]
}
nameBuilder.append(name); // depends on control dependency: [if], data = [(name]
}
if (!part.getTags().isEmpty())
tags.putAll(part.getTags());
}
return new MetricName(nameBuilder.toString(), tags);
} }
|
public class class_name {
public void marshall(CreateBackupPlanRequest createBackupPlanRequest, ProtocolMarshaller protocolMarshaller) {
if (createBackupPlanRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(createBackupPlanRequest.getBackupPlan(), BACKUPPLAN_BINDING);
protocolMarshaller.marshall(createBackupPlanRequest.getBackupPlanTags(), BACKUPPLANTAGS_BINDING);
protocolMarshaller.marshall(createBackupPlanRequest.getCreatorRequestId(), CREATORREQUESTID_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(CreateBackupPlanRequest createBackupPlanRequest, ProtocolMarshaller protocolMarshaller) {
if (createBackupPlanRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(createBackupPlanRequest.getBackupPlan(), BACKUPPLAN_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(createBackupPlanRequest.getBackupPlanTags(), BACKUPPLANTAGS_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(createBackupPlanRequest.getCreatorRequestId(), CREATORREQUESTID_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private boolean checkParam(
NodeTraversal t, Node param, @Nullable String name, JSTypeExpression paramType) {
boolean nameOptional;
Node nodeToCheck = param;
if (param.isDefaultValue()) {
nodeToCheck = param.getFirstChild();
nameOptional = true;
} else if (param.isName()) {
nameOptional = param.getString().startsWith("opt_");
} else {
checkState(param.isDestructuringPattern() || param.isRest(), param);
nameOptional = false;
}
if (name == null || !nodeToCheck.isName()) {
// Skip the name check, but use "<unknown name>" for other errors that might be reported.
name = "<unknown name>";
} else if (!nodeToCheck.matchesQualifiedName(name)) {
t.report(nodeToCheck, INCORRECT_PARAM_NAME);
return true;
}
boolean jsDocOptional = paramType != null && paramType.isOptionalArg();
if (nameOptional && !jsDocOptional) {
t.report(nodeToCheck, OPTIONAL_PARAM_NOT_MARKED_OPTIONAL, name);
return true;
}
return false;
} }
|
public class class_name {
private boolean checkParam(
NodeTraversal t, Node param, @Nullable String name, JSTypeExpression paramType) {
boolean nameOptional;
Node nodeToCheck = param;
if (param.isDefaultValue()) {
nodeToCheck = param.getFirstChild(); // depends on control dependency: [if], data = [none]
nameOptional = true; // depends on control dependency: [if], data = [none]
} else if (param.isName()) {
nameOptional = param.getString().startsWith("opt_"); // depends on control dependency: [if], data = [none]
} else {
checkState(param.isDestructuringPattern() || param.isRest(), param); // depends on control dependency: [if], data = [none]
nameOptional = false; // depends on control dependency: [if], data = [none]
}
if (name == null || !nodeToCheck.isName()) {
// Skip the name check, but use "<unknown name>" for other errors that might be reported.
name = "<unknown name>"; // depends on control dependency: [if], data = [none]
} else if (!nodeToCheck.matchesQualifiedName(name)) {
t.report(nodeToCheck, INCORRECT_PARAM_NAME); // depends on control dependency: [if], data = [none]
return true; // depends on control dependency: [if], data = [none]
}
boolean jsDocOptional = paramType != null && paramType.isOptionalArg();
if (nameOptional && !jsDocOptional) {
t.report(nodeToCheck, OPTIONAL_PARAM_NOT_MARKED_OPTIONAL, name); // depends on control dependency: [if], data = [none]
return true; // depends on control dependency: [if], data = [none]
}
return false;
} }
|
public class class_name {
private synchronized void fetchCredentials() {
if (!needsToLoadCredentials()) return;
JsonNode accessKey;
JsonNode secretKey;
JsonNode node;
JsonNode token;
try {
lastInstanceProfileCheck = new Date();
String credentialsResponse = EC2CredentialsUtils.getInstance().readResource(credentailsEndpointProvider.getCredentialsEndpoint(), credentailsEndpointProvider.getRetryPolicy());
node = Jackson.jsonNodeOf(credentialsResponse);
accessKey = node.get(ACCESS_KEY_ID);
secretKey = node.get(SECRET_ACCESS_KEY);
token = node.get(TOKEN);
if (null == accessKey || null == secretKey) {
throw new SdkClientException("Unable to load credentials.");
}
if (null != token) {
credentials = new BasicSessionCredentials(accessKey.asText(),
secretKey.asText(), token.asText());
} else {
credentials = new BasicAWSCredentials(accessKey.asText(),
secretKey.asText());
}
JsonNode expirationJsonNode = node.get("Expiration");
if (null != expirationJsonNode) {
/*
* TODO: The expiration string comes in a different format
* than what we deal with in other parts of the SDK, so we
* have to convert it to the ISO8601 syntax we expect.
*/
String expiration = expirationJsonNode.asText();
expiration = expiration.replaceAll("\\+0000$", "Z");
try {
credentialsExpiration = DateUtils.parseISO8601Date(expiration);
} catch(Exception ex) {
handleError("Unable to parse credentials expiration date from Amazon EC2 instance", ex);
}
}
} catch (JsonMappingException e) {
handleError("Unable to parse response returned from service endpoint", e);
} catch (IOException e) {
handleError("Unable to load credentials from service endpoint", e);
} catch (URISyntaxException e) {
handleError("Unable to load credentials from service endpoint", e);
}
} }
|
public class class_name {
private synchronized void fetchCredentials() {
if (!needsToLoadCredentials()) return;
JsonNode accessKey;
JsonNode secretKey;
JsonNode node;
JsonNode token;
try {
lastInstanceProfileCheck = new Date(); // depends on control dependency: [try], data = [none]
String credentialsResponse = EC2CredentialsUtils.getInstance().readResource(credentailsEndpointProvider.getCredentialsEndpoint(), credentailsEndpointProvider.getRetryPolicy());
node = Jackson.jsonNodeOf(credentialsResponse); // depends on control dependency: [try], data = [none]
accessKey = node.get(ACCESS_KEY_ID); // depends on control dependency: [try], data = [none]
secretKey = node.get(SECRET_ACCESS_KEY); // depends on control dependency: [try], data = [none]
token = node.get(TOKEN); // depends on control dependency: [try], data = [none]
if (null == accessKey || null == secretKey) {
throw new SdkClientException("Unable to load credentials.");
}
if (null != token) {
credentials = new BasicSessionCredentials(accessKey.asText(),
secretKey.asText(), token.asText()); // depends on control dependency: [if], data = [none]
} else {
credentials = new BasicAWSCredentials(accessKey.asText(),
secretKey.asText()); // depends on control dependency: [if], data = [none]
}
JsonNode expirationJsonNode = node.get("Expiration");
if (null != expirationJsonNode) {
/*
* TODO: The expiration string comes in a different format
* than what we deal with in other parts of the SDK, so we
* have to convert it to the ISO8601 syntax we expect.
*/
String expiration = expirationJsonNode.asText();
expiration = expiration.replaceAll("\\+0000$", "Z"); // depends on control dependency: [if], data = [none]
try {
credentialsExpiration = DateUtils.parseISO8601Date(expiration); // depends on control dependency: [try], data = [none]
} catch(Exception ex) {
handleError("Unable to parse credentials expiration date from Amazon EC2 instance", ex);
} // depends on control dependency: [catch], data = [none]
}
} catch (JsonMappingException e) {
handleError("Unable to parse response returned from service endpoint", e);
} catch (IOException e) { // depends on control dependency: [catch], data = [none]
handleError("Unable to load credentials from service endpoint", e);
} catch (URISyntaxException e) { // depends on control dependency: [catch], data = [none]
handleError("Unable to load credentials from service endpoint", e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public void copyPackagesExcept(BuildState prev, Set<String> recompiled, Set<String> removed) {
for (String pkg : prev.packages().keySet()) {
// Do not copy recompiled or removed packages.
if (recompiled.contains(pkg) || removed.contains(pkg)) continue;
Module mnew = findModuleFromPackageName(pkg);
Package pprev = prev.packages().get(pkg);
mnew.addPackage(pprev);
// Do not forget to update the flattened data.
packages.put(pkg, pprev);
}
} }
|
public class class_name {
public void copyPackagesExcept(BuildState prev, Set<String> recompiled, Set<String> removed) {
for (String pkg : prev.packages().keySet()) {
// Do not copy recompiled or removed packages.
if (recompiled.contains(pkg) || removed.contains(pkg)) continue;
Module mnew = findModuleFromPackageName(pkg);
Package pprev = prev.packages().get(pkg);
mnew.addPackage(pprev); // depends on control dependency: [for], data = [none]
// Do not forget to update the flattened data.
packages.put(pkg, pprev); // depends on control dependency: [for], data = [pkg]
}
} }
|
public class class_name {
protected void gotBootstrap (BootstrapData data, DObjectManager omgr)
{
if (debugLogMessages()) {
log.info("Got bootstrap " + data + ".");
}
// keep these around for interested parties
_bstrap = data;
_omgr = omgr;
// extract bootstrap information
_connectionId = data.connectionId;
_cloid = data.clientOid;
// notify the communicator that we got our bootstrap data (if we have one)
if (_comm != null) {
_comm.gotBootstrap();
}
// initialize our invocation director
_invdir.init(omgr, _cloid, this);
// send a few pings to the server to establish the clock offset between this client and
// server standard time
establishClockDelta(System.currentTimeMillis());
// we can't quite call initialization completed at this point because we need for the
// invocation director to fully initialize (which requires a round trip to the server)
// before turning the client loose to do things like request invocation services
} }
|
public class class_name {
protected void gotBootstrap (BootstrapData data, DObjectManager omgr)
{
if (debugLogMessages()) {
log.info("Got bootstrap " + data + "."); // depends on control dependency: [if], data = [none]
}
// keep these around for interested parties
_bstrap = data;
_omgr = omgr;
// extract bootstrap information
_connectionId = data.connectionId;
_cloid = data.clientOid;
// notify the communicator that we got our bootstrap data (if we have one)
if (_comm != null) {
_comm.gotBootstrap(); // depends on control dependency: [if], data = [none]
}
// initialize our invocation director
_invdir.init(omgr, _cloid, this);
// send a few pings to the server to establish the clock offset between this client and
// server standard time
establishClockDelta(System.currentTimeMillis());
// we can't quite call initialization completed at this point because we need for the
// invocation director to fully initialize (which requires a round trip to the server)
// before turning the client loose to do things like request invocation services
} }
|
public class class_name {
public static PackableObject identifyByHeader(File file, List packables) throws IOException {
FileInputStream fis = null;
try {
/* Archive result */
// PackableObject packable = null;
// identify archive by header
fis = new FileInputStream(file);
byte[] headerBytes = new byte[20];
fis.read(headerBytes, 0, 20);
Iterator iter = packables.iterator();
while (iter.hasNext()) {
PackableObject p = (PackableObject) iter.next();
byte[] fieldHeader = p.getHeader();
if (fieldHeader != null) {
if (compareByteArrays(headerBytes, fieldHeader)) {
return p;
}
}
}
// if we couldn't find an archiver by header bytes, we'll give it a
// try
// with the default name extension. This is useful, cause some
// archives
// like tar have no header.
String name = file.getName();
String extension = null;
String[] s = name.split("\\.");
if (s.length > 1) {
extension = s[s.length - 1];
}
Iterator it = packables.iterator();
while (it.hasNext()) {
PackableObject p = (PackableObject) it.next();
if (p.isPackableWith(extension, PackableObject.CHOOSE_EXTENSION)) {
return p;
}
}
// No implementation found
return null;
} finally {
IOUtils.closeQuietly(fis);
}
} }
|
public class class_name {
public static PackableObject identifyByHeader(File file, List packables) throws IOException {
FileInputStream fis = null;
try {
/* Archive result */
// PackableObject packable = null;
// identify archive by header
fis = new FileInputStream(file);
byte[] headerBytes = new byte[20];
fis.read(headerBytes, 0, 20);
Iterator iter = packables.iterator();
while (iter.hasNext()) {
PackableObject p = (PackableObject) iter.next();
byte[] fieldHeader = p.getHeader();
if (fieldHeader != null) {
if (compareByteArrays(headerBytes, fieldHeader)) {
return p; // depends on control dependency: [if], data = [none]
}
}
}
// if we couldn't find an archiver by header bytes, we'll give it a
// try
// with the default name extension. This is useful, cause some
// archives
// like tar have no header.
String name = file.getName();
String extension = null;
String[] s = name.split("\\.");
if (s.length > 1) {
extension = s[s.length - 1]; // depends on control dependency: [if], data = [none]
}
Iterator it = packables.iterator();
while (it.hasNext()) {
PackableObject p = (PackableObject) it.next();
if (p.isPackableWith(extension, PackableObject.CHOOSE_EXTENSION)) {
return p; // depends on control dependency: [if], data = [none]
}
}
// No implementation found
return null;
} finally {
IOUtils.closeQuietly(fis);
}
} }
|
public class class_name {
public T allocate()
{
T value = _freeRing.allocate();
if (value != null) {
return value;
}
return _freeRingSoft.allocate();
} }
|
public class class_name {
public T allocate()
{
T value = _freeRing.allocate();
if (value != null) {
return value; // depends on control dependency: [if], data = [none]
}
return _freeRingSoft.allocate();
} }
|
public class class_name {
public void add(ScalableStatistics other) {
count += other.count;
min = Math.min(min, other.min);
max = Math.max(max, other.max);
sum += other.sum;
sumOfSquares += other.sumOfSquares;
tdigest.add(other.tdigest);
if (other.exactValues != null) {
for (int i = 0; i < other.numExactValues; i++) {
addQuantileValue(other.exactValues[i]);
}
}
} }
|
public class class_name {
public void add(ScalableStatistics other) {
count += other.count;
min = Math.min(min, other.min);
max = Math.max(max, other.max);
sum += other.sum;
sumOfSquares += other.sumOfSquares;
tdigest.add(other.tdigest);
if (other.exactValues != null) {
for (int i = 0; i < other.numExactValues; i++) {
addQuantileValue(other.exactValues[i]); // depends on control dependency: [for], data = [i]
}
}
} }
|
public class class_name {
private void breadthFirstSearch(IAtomContainer container, List<IAtom> sphere, List<IAtom> path) throws CDKException {
IAtom nextAtom;
List<IAtom> newSphere = new ArrayList<IAtom>();
//logger.debug("Start of breadthFirstSearch");
for (IAtom atom : sphere) {
//logger.debug("BreadthFirstSearch around atom " + (atomNr + 1));
List bonds = container.getConnectedBondsList(atom);
for (Object bond : bonds) {
nextAtom = ((IBond) bond).getOther(atom);
if ((container.getMaximumBondOrder(nextAtom) != IBond.Order.SINGLE
|| Math.abs(nextAtom.getFormalCharge()) >= 1 || nextAtom.getFlag(CDKConstants.ISAROMATIC)
|| nextAtom.getSymbol().equals("N") || nextAtom.getSymbol().equals("O"))
& !nextAtom.getFlag(CDKConstants.VISITED)) {
//logger.debug("BDS> AtomNr:"+container.indexOf(nextAtom)+" maxBondOrder:"+container.getMaximumBondOrder(nextAtom)+" Aromatic:"+nextAtom.getFlag(CDKConstants.ISAROMATIC)+" FormalCharge:"+nextAtom.getFormalCharge()+" Charge:"+nextAtom.getCharge()+" Flag:"+nextAtom.getFlag(CDKConstants.VISITED));
path.add(nextAtom);
//logger.debug("BreadthFirstSearch is meeting new atom " + (nextAtomNr + 1));
nextAtom.setFlag(CDKConstants.VISITED, true);
if (container.getConnectedBondsCount(nextAtom) > 1) {
newSphere.add(nextAtom);
}
} else {
nextAtom.setFlag(CDKConstants.VISITED, true);
}
}
}
if (newSphere.size() > 0) {
breadthFirstSearch(container, newSphere, path);
}
} }
|
public class class_name {
private void breadthFirstSearch(IAtomContainer container, List<IAtom> sphere, List<IAtom> path) throws CDKException {
IAtom nextAtom;
List<IAtom> newSphere = new ArrayList<IAtom>();
//logger.debug("Start of breadthFirstSearch");
for (IAtom atom : sphere) {
//logger.debug("BreadthFirstSearch around atom " + (atomNr + 1));
List bonds = container.getConnectedBondsList(atom);
for (Object bond : bonds) {
nextAtom = ((IBond) bond).getOther(atom); // depends on control dependency: [for], data = [bond]
if ((container.getMaximumBondOrder(nextAtom) != IBond.Order.SINGLE
|| Math.abs(nextAtom.getFormalCharge()) >= 1 || nextAtom.getFlag(CDKConstants.ISAROMATIC)
|| nextAtom.getSymbol().equals("N") || nextAtom.getSymbol().equals("O"))
& !nextAtom.getFlag(CDKConstants.VISITED)) {
//logger.debug("BDS> AtomNr:"+container.indexOf(nextAtom)+" maxBondOrder:"+container.getMaximumBondOrder(nextAtom)+" Aromatic:"+nextAtom.getFlag(CDKConstants.ISAROMATIC)+" FormalCharge:"+nextAtom.getFormalCharge()+" Charge:"+nextAtom.getCharge()+" Flag:"+nextAtom.getFlag(CDKConstants.VISITED));
path.add(nextAtom); // depends on control dependency: [if], data = [none]
//logger.debug("BreadthFirstSearch is meeting new atom " + (nextAtomNr + 1));
nextAtom.setFlag(CDKConstants.VISITED, true); // depends on control dependency: [if], data = [none]
if (container.getConnectedBondsCount(nextAtom) > 1) {
newSphere.add(nextAtom); // depends on control dependency: [if], data = [none]
}
} else {
nextAtom.setFlag(CDKConstants.VISITED, true); // depends on control dependency: [if], data = [none]
}
}
}
if (newSphere.size() > 0) {
breadthFirstSearch(container, newSphere, path);
}
} }
|
public class class_name {
public static synchronized DocFileFactory getFactory(Configuration configuration) {
DocFileFactory f = configuration.docFileFactory;
if (f == null) {
JavaFileManager fm = configuration.getFileManager();
if (fm instanceof StandardJavaFileManager) {
f = new StandardDocFileFactory(configuration);
} else {
throw new IllegalStateException();
}
configuration.docFileFactory = f;
}
return f;
} }
|
public class class_name {
public static synchronized DocFileFactory getFactory(Configuration configuration) {
DocFileFactory f = configuration.docFileFactory;
if (f == null) {
JavaFileManager fm = configuration.getFileManager();
if (fm instanceof StandardJavaFileManager) {
f = new StandardDocFileFactory(configuration); // depends on control dependency: [if], data = [none]
} else {
throw new IllegalStateException();
}
configuration.docFileFactory = f; // depends on control dependency: [if], data = [none]
}
return f;
} }
|
public class class_name {
@Override
public VirtualConnection finishRequestMessage(WsByteBuffer[] body, InterChannelCallback callback, boolean bForce) throws MessageSentException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "finishRequestMessage(async)");
}
if (isMessageSent()) {
throw new MessageSentException("Message already sent");
}
// if headers haven't been sent and chunked encoding is not explicitly
// configured, then set this up for Content-Length
if (!headersSent()) {
if (!getRequestImpl().isChunkedEncodingSet()) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Setting partial body false");
}
setPartialBody(false);
}
}
if (getHttpConfig().runningOnZOS()) {
// @LIDB3187-27.1
// add this to notify the xmem channel of our final request write
getVC().getStateMap().put(HttpConstants.FINAL_WRITE_MARK, "true");
}
setForceAsync(bForce);
getLink().setAllowReconnect(true);
setAppWriteCallback(callback);
VirtualConnection vc = sendFullOutgoing(body, getRequestImpl(), HttpOSCWriteCallback.getRef());
if (null != vc) {
// Note: if forcequeue is true, then we will not get a VC object as
// the lower layer will use the callback and return null
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Request write completed immediately.");
}
// LI4335 - if early reads are going, then do not bother with response
// message information here
if (this.bEarlyReads) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "finishRequestMessage(async): early read is active");
}
return getVC();
}
// if headers are parsed and this is a final response, exit out.
// if a temp response and using temps, return out. If temp and not
// using temps, keep reading for final
if (headersParsed()) {
if (this.bTempResponsesUsed || !getResponseImpl().isTemporaryStatusCode()) {
// app channel wants to see all the responses
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "finishRequestMessage(async): already parsed");
}
return getVC();
}
// the app channel does not want to see the previously parsed msg
resetRead();
readAsyncResponse();
vc = null;
} else {
// start the read for the first response
vc = startResponseRead();
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "finishRequestMessage(async): " + vc);
}
return vc;
} }
|
public class class_name {
@Override
public VirtualConnection finishRequestMessage(WsByteBuffer[] body, InterChannelCallback callback, boolean bForce) throws MessageSentException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "finishRequestMessage(async)");
}
if (isMessageSent()) {
throw new MessageSentException("Message already sent");
}
// if headers haven't been sent and chunked encoding is not explicitly
// configured, then set this up for Content-Length
if (!headersSent()) {
if (!getRequestImpl().isChunkedEncodingSet()) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Setting partial body false"); // depends on control dependency: [if], data = [none]
}
setPartialBody(false); // depends on control dependency: [if], data = [none]
}
}
if (getHttpConfig().runningOnZOS()) {
// @LIDB3187-27.1
// add this to notify the xmem channel of our final request write
getVC().getStateMap().put(HttpConstants.FINAL_WRITE_MARK, "true");
}
setForceAsync(bForce);
getLink().setAllowReconnect(true);
setAppWriteCallback(callback);
VirtualConnection vc = sendFullOutgoing(body, getRequestImpl(), HttpOSCWriteCallback.getRef());
if (null != vc) {
// Note: if forcequeue is true, then we will not get a VC object as
// the lower layer will use the callback and return null
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Request write completed immediately.");
}
// LI4335 - if early reads are going, then do not bother with response
// message information here
if (this.bEarlyReads) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "finishRequestMessage(async): early read is active");
}
return getVC();
}
// if headers are parsed and this is a final response, exit out.
// if a temp response and using temps, return out. If temp and not
// using temps, keep reading for final
if (headersParsed()) {
if (this.bTempResponsesUsed || !getResponseImpl().isTemporaryStatusCode()) {
// app channel wants to see all the responses
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "finishRequestMessage(async): already parsed");
}
return getVC();
}
// the app channel does not want to see the previously parsed msg
resetRead();
readAsyncResponse();
vc = null;
} else {
// start the read for the first response
vc = startResponseRead();
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "finishRequestMessage(async): " + vc);
}
return vc;
} }
|
public class class_name {
private static void appendTag(String tag, StringBuilder buffer) {
if (buffer.length() != 0) {
buffer.append(UNDERSCORE);
}
buffer.append(tag);
} }
|
public class class_name {
private static void appendTag(String tag, StringBuilder buffer) {
if (buffer.length() != 0) {
buffer.append(UNDERSCORE); // depends on control dependency: [if], data = [none]
}
buffer.append(tag);
} }
|
public class class_name {
private void startList(Attributes attributes) {
List listTag = null;
if (!mParagraphStyles.isEmpty()) {
AccumulatedParagraphStyle currentStyle = mParagraphStyles.peek();
ParagraphType type = currentStyle.getType();
int indent = currentStyle.getAbsoluteIndent();
boolean isIndentation = isIndentation(attributes);
if (type.isIndentation() || isIndentation) {
listTag = new UL(indent, true);
} else if (type.isNumbering()) {
listTag = new OL(indent, false);
} else if (type.isBullet()) {
listTag = new UL(indent, false);
}
} else {
listTag = new UL(0, false);
}
if (listTag != null) start(listTag);
} }
|
public class class_name {
private void startList(Attributes attributes) {
List listTag = null;
if (!mParagraphStyles.isEmpty()) {
AccumulatedParagraphStyle currentStyle = mParagraphStyles.peek();
ParagraphType type = currentStyle.getType();
int indent = currentStyle.getAbsoluteIndent();
boolean isIndentation = isIndentation(attributes);
if (type.isIndentation() || isIndentation) {
listTag = new UL(indent, true); // depends on control dependency: [if], data = [none]
} else if (type.isNumbering()) {
listTag = new OL(indent, false); // depends on control dependency: [if], data = [none]
} else if (type.isBullet()) {
listTag = new UL(indent, false); // depends on control dependency: [if], data = [none]
}
} else {
listTag = new UL(0, false); // depends on control dependency: [if], data = [none]
}
if (listTag != null) start(listTag);
} }
|
public class class_name {
public Object getParameterWithoutCache(String name) {
if (activity.getRequestAdapter() != null) {
String[] values = activity.getRequestAdapter().getParameterValues(name);
if (values != null) {
if (values.length == 1) {
return values[0];
} else {
return values;
}
}
}
return null;
} }
|
public class class_name {
public Object getParameterWithoutCache(String name) {
if (activity.getRequestAdapter() != null) {
String[] values = activity.getRequestAdapter().getParameterValues(name);
if (values != null) {
if (values.length == 1) {
return values[0]; // depends on control dependency: [if], data = [none]
} else {
return values; // depends on control dependency: [if], data = [none]
}
}
}
return null;
} }
|
public class class_name {
@Override
public int advance(int target) throws IOException
{
int doc;
while ((doc = nextDoc()) < target)
{
if (doc == NO_MORE_DOCS || doc == -1)
{
return NO_MORE_DOCS;
}
}
return doc;
} }
|
public class class_name {
@Override
public int advance(int target) throws IOException
{
int doc;
while ((doc = nextDoc()) < target)
{
if (doc == NO_MORE_DOCS || doc == -1)
{
return NO_MORE_DOCS; // depends on control dependency: [if], data = [none]
}
}
return doc;
} }
|
public class class_name {
protected final void validateAssertionSignature(final Signature signature, final SAML2MessageContext context,
final SignatureTrustEngine engine) {
final SAMLPeerEntityContext peerContext = context.getSAMLPeerEntityContext();
if (signature != null) {
final String entityId = peerContext.getEntityId();
validateSignature(signature, entityId, engine);
} else {
if (wantsAssertionsSigned(context) && !peerContext.isAuthenticated()) {
throw new SAMLSignatureRequiredException("Assertion or response must be signed");
}
}
} }
|
public class class_name {
protected final void validateAssertionSignature(final Signature signature, final SAML2MessageContext context,
final SignatureTrustEngine engine) {
final SAMLPeerEntityContext peerContext = context.getSAMLPeerEntityContext();
if (signature != null) {
final String entityId = peerContext.getEntityId();
validateSignature(signature, entityId, engine); // depends on control dependency: [if], data = [(signature]
} else {
if (wantsAssertionsSigned(context) && !peerContext.isAuthenticated()) {
throw new SAMLSignatureRequiredException("Assertion or response must be signed");
}
}
} }
|
public class class_name {
public String getMessage(final Locale local, final String code, final Object... args) {
try {
return source.getMessage(code, args, local);
} catch (final NoSuchMessageException ex) {
LOG.error("Failed to retrieve message!", ex);
return code;
}
} }
|
public class class_name {
public String getMessage(final Locale local, final String code, final Object... args) {
try {
return source.getMessage(code, args, local); // depends on control dependency: [try], data = [none]
} catch (final NoSuchMessageException ex) {
LOG.error("Failed to retrieve message!", ex);
return code;
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private static int tryParseMonth(String month, Locale locale) {
Map<String, Integer> names = getMonthNames(locale);
Integer r = names.get(month.toUpperCase());
if (r != null) {
return r;
}
return -1;
} }
|
public class class_name {
private static int tryParseMonth(String month, Locale locale) {
Map<String, Integer> names = getMonthNames(locale);
Integer r = names.get(month.toUpperCase());
if (r != null) {
return r; // depends on control dependency: [if], data = [none]
}
return -1;
} }
|
public class class_name {
public BatchGetNamedQueryResult withNamedQueries(NamedQuery... namedQueries) {
if (this.namedQueries == null) {
setNamedQueries(new java.util.ArrayList<NamedQuery>(namedQueries.length));
}
for (NamedQuery ele : namedQueries) {
this.namedQueries.add(ele);
}
return this;
} }
|
public class class_name {
public BatchGetNamedQueryResult withNamedQueries(NamedQuery... namedQueries) {
if (this.namedQueries == null) {
setNamedQueries(new java.util.ArrayList<NamedQuery>(namedQueries.length)); // depends on control dependency: [if], data = [none]
}
for (NamedQuery ele : namedQueries) {
this.namedQueries.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} }
|
public class class_name {
public Ticket add(long delay, TimerHandler handler, Object... args)
{
if (handler == null) {
return null;
}
Utils.checkArgument(delay > 0, "Delay of a ticket has to be strictly greater than 0");
final Ticket ticket = new Ticket(this, now(), delay, handler, args);
insert(ticket);
return ticket;
} }
|
public class class_name {
public Ticket add(long delay, TimerHandler handler, Object... args)
{
if (handler == null) {
return null; // depends on control dependency: [if], data = [none]
}
Utils.checkArgument(delay > 0, "Delay of a ticket has to be strictly greater than 0");
final Ticket ticket = new Ticket(this, now(), delay, handler, args);
insert(ticket);
return ticket;
} }
|
public class class_name {
public static String changeOrAddParameter(final String aUrl, final String aParameter,
final String aValue) {
final StringBuilder newUrlBuilder = new StringBuilder();
final String[] splittedUrl = aUrl.split(REGEX_ESCAPOR + URL_TO_PARAMETERS_SPLITTERATOR);
newUrlBuilder.append(splittedUrl[0]);
if (splittedUrl.length == 2) {
final String cleanedParameters = splittedUrl[1] + URL_TO_PARAMETERS_SPLITTERATOR
.replaceAll(String.format(URL_PARAMETER_REPLACEMENT_REGEX_PATTERN, aParameter), "")
.replaceAll(REGEX_ESCAPOR + WRONG_PARAMETER_START, URL_TO_PARAMETERS_SPLITTERATOR);
newUrlBuilder.append(URL_TO_PARAMETERS_SPLITTERATOR);
newUrlBuilder.append(cleanedParameters);
if (!cleanedParameters.endsWith(URL_PARAMETER_SEPPERATOR) && !cleanedParameters.isEmpty()) {
newUrlBuilder.append(URL_PARAMETER_SEPPERATOR);
}
} else {
newUrlBuilder.append(URL_TO_PARAMETERS_SPLITTERATOR);
}
newUrlBuilder.append(String.format(PARAMETER_PATTERN, aParameter, aValue));
return newUrlBuilder.toString();
} }
|
public class class_name {
public static String changeOrAddParameter(final String aUrl, final String aParameter,
final String aValue) {
final StringBuilder newUrlBuilder = new StringBuilder();
final String[] splittedUrl = aUrl.split(REGEX_ESCAPOR + URL_TO_PARAMETERS_SPLITTERATOR);
newUrlBuilder.append(splittedUrl[0]);
if (splittedUrl.length == 2) {
final String cleanedParameters = splittedUrl[1] + URL_TO_PARAMETERS_SPLITTERATOR
.replaceAll(String.format(URL_PARAMETER_REPLACEMENT_REGEX_PATTERN, aParameter), "")
.replaceAll(REGEX_ESCAPOR + WRONG_PARAMETER_START, URL_TO_PARAMETERS_SPLITTERATOR);
newUrlBuilder.append(URL_TO_PARAMETERS_SPLITTERATOR);
// depends on control dependency: [if], data = [none]
newUrlBuilder.append(cleanedParameters);
// depends on control dependency: [if], data = [none]
if (!cleanedParameters.endsWith(URL_PARAMETER_SEPPERATOR) && !cleanedParameters.isEmpty()) {
newUrlBuilder.append(URL_PARAMETER_SEPPERATOR);
// depends on control dependency: [if], data = [none]
}
} else {
newUrlBuilder.append(URL_TO_PARAMETERS_SPLITTERATOR);
// depends on control dependency: [if], data = [none]
}
newUrlBuilder.append(String.format(PARAMETER_PATTERN, aParameter, aValue));
return newUrlBuilder.toString();
} }
|
public class class_name {
public static synchronized void init(final MongoEmbeddedSettings mongoEmbeddedSettings) {
if (mongoEmbeddedLibrary != null) {
throw new MongoClientEmbeddedException("The mongo embedded library has already been initialized");
}
try {
mongoEmbeddedLibrary = MongoEmbeddedCAPI.create(mongoEmbeddedSettings.getYamlConfig(),
mongoEmbeddedSettings.getLogLevel().toCapiLogLevel(), mongoEmbeddedSettings.getLibraryPath());
} catch (Exception e) {
throw new MongoClientEmbeddedException(format("The mongo embedded library could not be initialized%n"
+ "Server error message: %s", e.getMessage()), e);
}
} }
|
public class class_name {
public static synchronized void init(final MongoEmbeddedSettings mongoEmbeddedSettings) {
if (mongoEmbeddedLibrary != null) {
throw new MongoClientEmbeddedException("The mongo embedded library has already been initialized");
}
try {
mongoEmbeddedLibrary = MongoEmbeddedCAPI.create(mongoEmbeddedSettings.getYamlConfig(),
mongoEmbeddedSettings.getLogLevel().toCapiLogLevel(), mongoEmbeddedSettings.getLibraryPath()); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new MongoClientEmbeddedException(format("The mongo embedded library could not be initialized%n"
+ "Server error message: %s", e.getMessage()), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public void inboundMessageRead(int seqNo, long optionalWireSize, long optionalUncompressedSize) {
for (StreamTracer tracer : tracers) {
tracer.inboundMessageRead(seqNo, optionalWireSize, optionalUncompressedSize);
}
} }
|
public class class_name {
public void inboundMessageRead(int seqNo, long optionalWireSize, long optionalUncompressedSize) {
for (StreamTracer tracer : tracers) {
tracer.inboundMessageRead(seqNo, optionalWireSize, optionalUncompressedSize); // depends on control dependency: [for], data = [tracer]
}
} }
|
public class class_name {
public void marshall(Upload upload, ProtocolMarshaller protocolMarshaller) {
if (upload == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(upload.getArn(), ARN_BINDING);
protocolMarshaller.marshall(upload.getName(), NAME_BINDING);
protocolMarshaller.marshall(upload.getCreated(), CREATED_BINDING);
protocolMarshaller.marshall(upload.getType(), TYPE_BINDING);
protocolMarshaller.marshall(upload.getStatus(), STATUS_BINDING);
protocolMarshaller.marshall(upload.getUrl(), URL_BINDING);
protocolMarshaller.marshall(upload.getMetadata(), METADATA_BINDING);
protocolMarshaller.marshall(upload.getContentType(), CONTENTTYPE_BINDING);
protocolMarshaller.marshall(upload.getMessage(), MESSAGE_BINDING);
protocolMarshaller.marshall(upload.getCategory(), CATEGORY_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(Upload upload, ProtocolMarshaller protocolMarshaller) {
if (upload == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(upload.getArn(), ARN_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(upload.getName(), NAME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(upload.getCreated(), CREATED_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(upload.getType(), TYPE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(upload.getStatus(), STATUS_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(upload.getUrl(), URL_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(upload.getMetadata(), METADATA_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(upload.getContentType(), CONTENTTYPE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(upload.getMessage(), MESSAGE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(upload.getCategory(), CATEGORY_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public void setAccessExpiresIn(String expiresIn) {
if (expiresIn != null) {
long expires = expiresIn.equals("0")
? 0
: System.currentTimeMillis() + Long.parseLong(expiresIn) * 1000L;
setAccessExpires(expires);
}
} }
|
public class class_name {
public void setAccessExpiresIn(String expiresIn) {
if (expiresIn != null) {
long expires = expiresIn.equals("0")
? 0
: System.currentTimeMillis() + Long.parseLong(expiresIn) * 1000L;
setAccessExpires(expires); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private void updateUplevels(final URI file) {
assert file.isAbsolute();
if (file.getPath() != null) {
final URI f = file.toString().contains(STICK)
? toURI(file.toString().substring(0, file.toString().indexOf(STICK)))
: file;
final URI relative = getRelativePath(rootFile, f).normalize();
final int lastIndex = relative.getPath().lastIndexOf(".." + URI_SEPARATOR);
if (lastIndex != -1) {
final int newUplevels = lastIndex / 3 + 1;
uplevels = Math.max(newUplevels, uplevels);
}
}
} }
|
public class class_name {
private void updateUplevels(final URI file) {
assert file.isAbsolute();
if (file.getPath() != null) {
final URI f = file.toString().contains(STICK)
? toURI(file.toString().substring(0, file.toString().indexOf(STICK)))
: file;
final URI relative = getRelativePath(rootFile, f).normalize();
final int lastIndex = relative.getPath().lastIndexOf(".." + URI_SEPARATOR);
if (lastIndex != -1) {
final int newUplevels = lastIndex / 3 + 1;
uplevels = Math.max(newUplevels, uplevels); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
public long getUserDataCheckInterval() {
if (m_userDateCheckInterval == null) {
return Long.MAX_VALUE;
} else {
return CmsStringUtil.parseDuration(m_userDateCheckInterval, Long.MAX_VALUE);
}
} }
|
public class class_name {
public long getUserDataCheckInterval() {
if (m_userDateCheckInterval == null) {
return Long.MAX_VALUE; // depends on control dependency: [if], data = [none]
} else {
return CmsStringUtil.parseDuration(m_userDateCheckInterval, Long.MAX_VALUE); // depends on control dependency: [if], data = [(m_userDateCheckInterval]
}
} }
|
public class class_name {
public boolean contains(final InternetDomainName domain) {
ImmutableList<String> otherDomainParts = domain.parts();
if (parts.size() > otherDomainParts.size()) {
return false;
}
otherDomainParts = otherDomainParts.reverse()
.subList(0, parts.size());
return parts.reverse()
.equals(otherDomainParts);
} }
|
public class class_name {
public boolean contains(final InternetDomainName domain) {
ImmutableList<String> otherDomainParts = domain.parts();
if (parts.size() > otherDomainParts.size()) {
return false; // depends on control dependency: [if], data = [none]
}
otherDomainParts = otherDomainParts.reverse()
.subList(0, parts.size());
return parts.reverse()
.equals(otherDomainParts);
} }
|
public class class_name {
private void _nonsymetricOrthes ()
{
// This is derived from the Algol procedures orthes and ortran,
// by Martin and Wilkinson, Handbook for Auto. Comp.,
// Vol.ii-Linear Algebra, and the corresponding
// Fortran subroutines in EISPACK.
final int low = 0;
final int high = m_nDim - 1;
for (int m = low + 1; m <= high - 1; m++)
{
// Scale column.
double scale = 0.0;
for (int i = m; i <= high; i++)
scale += MathHelper.abs (m_aHessenBerg[i][m - 1]);
if (scale != 0.0)
{
// Compute Householder transformation.
double h = 0.0;
for (int i = high; i >= m; i--)
{
m_aOrt[i] = m_aHessenBerg[i][m - 1] / scale;
h += m_aOrt[i] * m_aOrt[i];
}
double g = Math.sqrt (h);
if (m_aOrt[m] > 0)
{
g = -g;
}
h -= m_aOrt[m] * g;
m_aOrt[m] = m_aOrt[m] - g;
// Apply Householder similarity transformation
// H = (I-u*u'/h)*H*(I-u*u')/h)
for (int j = m; j < m_nDim; j++)
{
double f = 0.0;
for (int i = high; i >= m; i--)
{
f += m_aOrt[i] * m_aHessenBerg[i][j];
}
f /= h;
for (int i = m; i <= high; i++)
{
m_aHessenBerg[i][j] -= f * m_aOrt[i];
}
}
for (int i = 0; i <= high; i++)
{
double f = 0.0;
for (int j = high; j >= m; j--)
{
f += m_aOrt[j] * m_aHessenBerg[i][j];
}
f /= h;
for (int j = m; j <= high; j++)
{
m_aHessenBerg[i][j] -= f * m_aOrt[j];
}
}
m_aOrt[m] = scale * m_aOrt[m];
m_aHessenBerg[m][m - 1] = scale * g;
}
}
// Accumulate transformations (Algol's ortran).
for (int i = 0; i < m_nDim; i++)
{
final double [] aRow = m_aEigenVector[i];
for (int j = 0; j < m_nDim; j++)
{
aRow[j] = (i == j ? 1d : 0d);
}
}
for (int m = high - 1; m >= low + 1; m--)
{
if (m_aHessenBerg[m][m - 1] != 0.0)
{
for (int i = m + 1; i <= high; i++)
{
m_aOrt[i] = m_aHessenBerg[i][m - 1];
}
for (int j = m; j <= high; j++)
{
double g = 0.0;
for (int i = m; i <= high; i++)
{
g += m_aOrt[i] * m_aEigenVector[i][j];
}
// Double division avoids possible underflow
g = (g / m_aOrt[m]) / m_aHessenBerg[m][m - 1];
for (int i = m; i <= high; i++)
{
m_aEigenVector[i][j] += g * m_aOrt[i];
}
}
}
}
} }
|
public class class_name {
private void _nonsymetricOrthes ()
{
// This is derived from the Algol procedures orthes and ortran,
// by Martin and Wilkinson, Handbook for Auto. Comp.,
// Vol.ii-Linear Algebra, and the corresponding
// Fortran subroutines in EISPACK.
final int low = 0;
final int high = m_nDim - 1;
for (int m = low + 1; m <= high - 1; m++)
{
// Scale column.
double scale = 0.0;
for (int i = m; i <= high; i++)
scale += MathHelper.abs (m_aHessenBerg[i][m - 1]);
if (scale != 0.0)
{
// Compute Householder transformation.
double h = 0.0;
for (int i = high; i >= m; i--)
{
m_aOrt[i] = m_aHessenBerg[i][m - 1] / scale; // depends on control dependency: [for], data = [i]
h += m_aOrt[i] * m_aOrt[i]; // depends on control dependency: [for], data = [i]
}
double g = Math.sqrt (h);
if (m_aOrt[m] > 0)
{
g = -g; // depends on control dependency: [if], data = [none]
}
h -= m_aOrt[m] * g; // depends on control dependency: [if], data = [none]
m_aOrt[m] = m_aOrt[m] - g; // depends on control dependency: [if], data = [none]
// Apply Householder similarity transformation
// H = (I-u*u'/h)*H*(I-u*u')/h)
for (int j = m; j < m_nDim; j++)
{
double f = 0.0;
for (int i = high; i >= m; i--)
{
f += m_aOrt[i] * m_aHessenBerg[i][j]; // depends on control dependency: [for], data = [i]
}
f /= h; // depends on control dependency: [for], data = [none]
for (int i = m; i <= high; i++)
{
m_aHessenBerg[i][j] -= f * m_aOrt[i]; // depends on control dependency: [for], data = [i]
}
}
for (int i = 0; i <= high; i++)
{
double f = 0.0;
for (int j = high; j >= m; j--)
{
f += m_aOrt[j] * m_aHessenBerg[i][j]; // depends on control dependency: [for], data = [j]
}
f /= h; // depends on control dependency: [for], data = [none]
for (int j = m; j <= high; j++)
{
m_aHessenBerg[i][j] -= f * m_aOrt[j]; // depends on control dependency: [for], data = [j]
}
}
m_aOrt[m] = scale * m_aOrt[m]; // depends on control dependency: [if], data = [none]
m_aHessenBerg[m][m - 1] = scale * g; // depends on control dependency: [if], data = [none]
}
}
// Accumulate transformations (Algol's ortran).
for (int i = 0; i < m_nDim; i++)
{
final double [] aRow = m_aEigenVector[i];
for (int j = 0; j < m_nDim; j++)
{
aRow[j] = (i == j ? 1d : 0d); // depends on control dependency: [for], data = [j]
}
}
for (int m = high - 1; m >= low + 1; m--)
{
if (m_aHessenBerg[m][m - 1] != 0.0)
{
for (int i = m + 1; i <= high; i++)
{
m_aOrt[i] = m_aHessenBerg[i][m - 1]; // depends on control dependency: [for], data = [i]
}
for (int j = m; j <= high; j++)
{
double g = 0.0;
for (int i = m; i <= high; i++)
{
g += m_aOrt[i] * m_aEigenVector[i][j]; // depends on control dependency: [for], data = [i]
}
// Double division avoids possible underflow
g = (g / m_aOrt[m]) / m_aHessenBerg[m][m - 1]; // depends on control dependency: [for], data = [none]
for (int i = m; i <= high; i++)
{
m_aEigenVector[i][j] += g * m_aOrt[i]; // depends on control dependency: [for], data = [i]
}
}
}
}
} }
|
public class class_name {
public String getLockTokenHash(String token)
{
String hash = "";
try
{
MessageDigest m = MessageDigest.getInstance("MD5");
m.update(token.getBytes(), 0, token.length());
hash = new BigInteger(1, m.digest()).toString(16);
}
catch (NoSuchAlgorithmException e)
{
LOG.error("Can't get instanse of MD5 MessageDigest!", e);
}
return hash;
} }
|
public class class_name {
public String getLockTokenHash(String token)
{
String hash = "";
try
{
MessageDigest m = MessageDigest.getInstance("MD5");
m.update(token.getBytes(), 0, token.length()); // depends on control dependency: [try], data = [none]
hash = new BigInteger(1, m.digest()).toString(16); // depends on control dependency: [try], data = [none]
}
catch (NoSuchAlgorithmException e)
{
LOG.error("Can't get instanse of MD5 MessageDigest!", e);
} // depends on control dependency: [catch], data = [none]
return hash;
} }
|
public class class_name {
private static String getSolrSpellcheckRfsPath() {
String sPath = OpenCms.getSystemInfo().getWebInfRfsPath();
if (!OpenCms.getSystemInfo().getWebInfRfsPath().endsWith(File.separator)) {
sPath += File.separator;
}
return sPath + "solr" + File.separator + "spellcheck" + File.separator + "data";
} }
|
public class class_name {
private static String getSolrSpellcheckRfsPath() {
String sPath = OpenCms.getSystemInfo().getWebInfRfsPath();
if (!OpenCms.getSystemInfo().getWebInfRfsPath().endsWith(File.separator)) {
sPath += File.separator; // depends on control dependency: [if], data = [none]
}
return sPath + "solr" + File.separator + "spellcheck" + File.separator + "data";
} }
|
public class class_name {
private QueryBuilder nestedQueryBuilder(
List<Attribute> attributePath, QueryBuilder queryBuilder) {
if (attributePath.size() == 1) {
return queryBuilder;
} else if (attributePath.size() == 2) {
return QueryBuilders.nestedQuery(
getQueryFieldName(attributePath.get(0)), queryBuilder, ScoreMode.Avg);
} else {
throw new UnsupportedOperationException(CANNOT_FILTER_DEEP_REFERENCE_MSG);
}
} }
|
public class class_name {
private QueryBuilder nestedQueryBuilder(
List<Attribute> attributePath, QueryBuilder queryBuilder) {
if (attributePath.size() == 1) {
return queryBuilder; // depends on control dependency: [if], data = [none]
} else if (attributePath.size() == 2) {
return QueryBuilders.nestedQuery(
getQueryFieldName(attributePath.get(0)), queryBuilder, ScoreMode.Avg); // depends on control dependency: [if], data = [none]
} else {
throw new UnsupportedOperationException(CANNOT_FILTER_DEEP_REFERENCE_MSG);
}
} }
|
public class class_name {
private void process() {
Entity entity = entityClass.getAnnotation(Entity.class);
ProjectedEntity projectedEntity = entityClass.getAnnotation(ProjectedEntity.class);
if (entity != null) {
initEntityMetadata(entity);
} else if (projectedEntity != null) {
initEntityMetadata(projectedEntity);
} else {
String message = String.format("Class %s must either have %s or %s annotation",
entityClass.getName(), Entity.class.getName(), ProjectedEntity.class.getName());
throw new EntityManagerException(message);
}
processPropertyOverrides();
processFields();
// If we did not find valid Identifier...
if (entityMetadata.getIdentifierMetadata() == null) {
throw new EntityManagerException(
String.format("Class %s requires a field with annotation of %s", entityClass.getName(),
Identifier.class.getName()));
}
entityMetadata.setEntityListenersMetadata(EntityListenersIntrospector.introspect(entityClass));
entityMetadata.ensureUniqueProperties();
entityMetadata.cleanup();
} }
|
public class class_name {
private void process() {
Entity entity = entityClass.getAnnotation(Entity.class);
ProjectedEntity projectedEntity = entityClass.getAnnotation(ProjectedEntity.class);
if (entity != null) {
initEntityMetadata(entity); // depends on control dependency: [if], data = [(entity]
} else if (projectedEntity != null) {
initEntityMetadata(projectedEntity); // depends on control dependency: [if], data = [(projectedEntity]
} else {
String message = String.format("Class %s must either have %s or %s annotation",
entityClass.getName(), Entity.class.getName(), ProjectedEntity.class.getName()); // depends on control dependency: [if], data = [none]
throw new EntityManagerException(message);
}
processPropertyOverrides();
processFields();
// If we did not find valid Identifier...
if (entityMetadata.getIdentifierMetadata() == null) {
throw new EntityManagerException(
String.format("Class %s requires a field with annotation of %s", entityClass.getName(),
Identifier.class.getName()));
}
entityMetadata.setEntityListenersMetadata(EntityListenersIntrospector.introspect(entityClass));
entityMetadata.ensureUniqueProperties();
entityMetadata.cleanup();
} }
|
public class class_name {
public Type build(Type givenType){
final ClassType javersType = mapper.getJaversClassType(givenType);
//for Generics, we have list of type arguments to dehydrate
if (javersType.isGenericType()) {
List<Type> actualDehydratedTypeArguments = extractAndDehydrateTypeArguments(javersType);
return new ParametrizedDehydratedType(javersType.getBaseJavaClass(), actualDehydratedTypeArguments);
}
if (javersType instanceof ArrayType){
Type dehydratedItemType = build( javersType.getConcreteClassTypeArguments().get(0) );
if (dehydratedItemType == GlobalId.class){
return GLOBAL_ID_ARRAY_TYPE;
}
return givenType;
}
return javersType.getRawDehydratedType();
} }
|
public class class_name {
public Type build(Type givenType){
final ClassType javersType = mapper.getJaversClassType(givenType);
//for Generics, we have list of type arguments to dehydrate
if (javersType.isGenericType()) {
List<Type> actualDehydratedTypeArguments = extractAndDehydrateTypeArguments(javersType);
return new ParametrizedDehydratedType(javersType.getBaseJavaClass(), actualDehydratedTypeArguments); // depends on control dependency: [if], data = [none]
}
if (javersType instanceof ArrayType){
Type dehydratedItemType = build( javersType.getConcreteClassTypeArguments().get(0) );
if (dehydratedItemType == GlobalId.class){
return GLOBAL_ID_ARRAY_TYPE; // depends on control dependency: [if], data = [none]
}
return givenType; // depends on control dependency: [if], data = [none]
}
return javersType.getRawDehydratedType();
} }
|
public class class_name {
public static List<Node> getSiblings(Node parent, Node element) {
List<Node> result = new ArrayList<>();
NodeList list = parent.getChildNodes();
for (int i = 0; i < list.getLength(); i++) {
Node el = list.item(i);
if (el.getNodeName().equals(element.getNodeName())) {
result.add(el);
}
}
return result;
} }
|
public class class_name {
public static List<Node> getSiblings(Node parent, Node element) {
List<Node> result = new ArrayList<>();
NodeList list = parent.getChildNodes();
for (int i = 0; i < list.getLength(); i++) {
Node el = list.item(i);
if (el.getNodeName().equals(element.getNodeName())) {
result.add(el); // depends on control dependency: [if], data = [none]
}
}
return result;
} }
|
public class class_name {
private PluralAttribute<? super X, ?, ?> getPluralAttriute(String paramName)
{
if (superClazzType != null)
{
return ((AbstractManagedType<? super X>) superClazzType).getDeclaredPluralAttribute(paramName);
}
return null;
} }
|
public class class_name {
private PluralAttribute<? super X, ?, ?> getPluralAttriute(String paramName)
{
if (superClazzType != null)
{
return ((AbstractManagedType<? super X>) superClazzType).getDeclaredPluralAttribute(paramName); // depends on control dependency: [if], data = [none]
}
return null;
} }
|
public class class_name {
Optional<Container> allocateContainer(final ResourceRequestEvent requestEvent) {
Container container = null;
final Optional<String> nodeName = getPreferredNode(requestEvent.getNodeNameList());
if (nodeName.isPresent()) {
container = allocateBasedOnNode(
requestEvent.getMemorySize().orElse(this.defaultMemorySize),
requestEvent.getVirtualCores().orElse(this.defaultNumberOfCores),
nodeName.get());
} else {
final Optional<String> rackName = getPreferredRack(requestEvent.getRackNameList());
if (rackName.isPresent()) {
container = allocateBasedOnRack(
requestEvent.getMemorySize().orElse(this.defaultMemorySize),
requestEvent.getVirtualCores().orElse(this.defaultNumberOfCores),
rackName.get());
}
}
return Optional.ofNullable(container);
} }
|
public class class_name {
Optional<Container> allocateContainer(final ResourceRequestEvent requestEvent) {
Container container = null;
final Optional<String> nodeName = getPreferredNode(requestEvent.getNodeNameList());
if (nodeName.isPresent()) {
container = allocateBasedOnNode(
requestEvent.getMemorySize().orElse(this.defaultMemorySize),
requestEvent.getVirtualCores().orElse(this.defaultNumberOfCores),
nodeName.get()); // depends on control dependency: [if], data = [none]
} else {
final Optional<String> rackName = getPreferredRack(requestEvent.getRackNameList());
if (rackName.isPresent()) {
container = allocateBasedOnRack(
requestEvent.getMemorySize().orElse(this.defaultMemorySize),
requestEvent.getVirtualCores().orElse(this.defaultNumberOfCores),
rackName.get()); // depends on control dependency: [if], data = [none]
}
}
return Optional.ofNullable(container);
} }
|
public class class_name {
public static synchronized CoreSocketFactory getInstance() {
if (coreSocketFactory == null) {
logger.info("First Cloud SQL connection, generating RSA key pair.");
KeyPair keyPair = generateRsaKeyPair();
CredentialFactory credentialFactory;
if (System.getProperty(CredentialFactory.CREDENTIAL_FACTORY_PROPERTY) != null) {
try {
credentialFactory =
(CredentialFactory)
Class.forName(System.getProperty(CredentialFactory.CREDENTIAL_FACTORY_PROPERTY))
.newInstance();
} catch (Exception err) {
throw new RuntimeException(err);
}
} else {
credentialFactory = new ApplicationDefaultCredentialFactory();
}
Credential credential = credentialFactory.create();
SQLAdmin adminApi = createAdminApiClient(credential);
coreSocketFactory =
new CoreSocketFactory(
new Clock(), keyPair, credential, adminApi, DEFAULT_SERVER_PROXY_PORT);
}
return coreSocketFactory;
} }
|
public class class_name {
public static synchronized CoreSocketFactory getInstance() {
if (coreSocketFactory == null) {
logger.info("First Cloud SQL connection, generating RSA key pair."); // depends on control dependency: [if], data = [none]
KeyPair keyPair = generateRsaKeyPair();
CredentialFactory credentialFactory;
if (System.getProperty(CredentialFactory.CREDENTIAL_FACTORY_PROPERTY) != null) {
try {
credentialFactory =
(CredentialFactory)
Class.forName(System.getProperty(CredentialFactory.CREDENTIAL_FACTORY_PROPERTY))
.newInstance(); // depends on control dependency: [try], data = [none]
} catch (Exception err) {
throw new RuntimeException(err);
} // depends on control dependency: [catch], data = [none]
} else {
credentialFactory = new ApplicationDefaultCredentialFactory(); // depends on control dependency: [if], data = [none]
}
Credential credential = credentialFactory.create();
SQLAdmin adminApi = createAdminApiClient(credential);
coreSocketFactory =
new CoreSocketFactory(
new Clock(), keyPair, credential, adminApi, DEFAULT_SERVER_PROXY_PORT); // depends on control dependency: [if], data = [none]
}
return coreSocketFactory;
} }
|
public class class_name {
private synchronized void notifyConnectionLost(final IoSession session) {
new Thread("Connection-Closed-Notifier") {
@Override
public void run() {
// todo: sml: should consider rationalising these so they're all HandlerListeners..
if (connectedObjectManager != null) {
connectedObjectManager.sessionTerminated(session);
}
for (HandlerListener listener : handlerListeners) {
listener.sessionClosed(session);
}
RequestResponseManager requestResponseManager = (RequestResponseManager) session.getAttribute(RequestResponseManager.SESSION_KEY);
if (requestResponseManager != null) {
requestResponseManager.sessionClosed(session);
}
}
}.start();
} }
|
public class class_name {
private synchronized void notifyConnectionLost(final IoSession session) {
new Thread("Connection-Closed-Notifier") {
@Override
public void run() {
// todo: sml: should consider rationalising these so they're all HandlerListeners..
if (connectedObjectManager != null) {
connectedObjectManager.sessionTerminated(session); // depends on control dependency: [if], data = [none]
}
for (HandlerListener listener : handlerListeners) {
listener.sessionClosed(session); // depends on control dependency: [for], data = [listener]
}
RequestResponseManager requestResponseManager = (RequestResponseManager) session.getAttribute(RequestResponseManager.SESSION_KEY);
if (requestResponseManager != null) {
requestResponseManager.sessionClosed(session); // depends on control dependency: [if], data = [none]
}
}
}.start();
} }
|
public class class_name {
public File[] getAllFilesBelow(File dir) {
Set allFiles = new HashSet();
if (dir.isDirectory()) {
primGetAllFilesBelow(dir, allFiles);
}
return (File[]) allFiles.toArray(new File[allFiles.size()]);
} }
|
public class class_name {
public File[] getAllFilesBelow(File dir) {
Set allFiles = new HashSet();
if (dir.isDirectory()) {
primGetAllFilesBelow(dir, allFiles); // depends on control dependency: [if], data = [none]
}
return (File[]) allFiles.toArray(new File[allFiles.size()]);
} }
|
public class class_name {
private Object[] keysToValues( List<String> argKeys ) {
List<String> values = new ArrayList<>();
for ( String key : argKeys ) {
values.add( getMessage( key ) );
}
return values.toArray();
} }
|
public class class_name {
private Object[] keysToValues( List<String> argKeys ) {
List<String> values = new ArrayList<>();
for ( String key : argKeys ) {
values.add( getMessage( key ) ); // depends on control dependency: [for], data = [key]
}
return values.toArray();
} }
|
public class class_name {
CompletableFuture<Integer> updateBuckets(DirectSegmentAccess segment, Collection<BucketUpdate> bucketUpdates,
long firstIndexedOffset, long lastIndexedOffset, int processedCount, Duration timeout) {
UpdateInstructions update = new UpdateInstructions();
// Process each Key in the given Map.
// Locate the Key's Bucket, then generate necessary Attribute Updates to integrate new Keys into it.
for (BucketUpdate bucketUpdate : bucketUpdates) {
generateAttributeUpdates(bucketUpdate, update);
}
if (lastIndexedOffset > firstIndexedOffset) {
// Atomically update the Table-related attributes in the Segment's metadata, once we apply these changes.
generateTableAttributeUpdates(firstIndexedOffset, lastIndexedOffset, processedCount, update);
}
if (update.getAttributes().isEmpty()) {
// We haven't made any updates.
log.debug("IndexWriter[{}]: FirstIdxOffset={}, LastIdxOffset={}, No Changes.", segment.getSegmentId(), firstIndexedOffset, lastIndexedOffset);
return CompletableFuture.completedFuture(0);
} else {
log.debug("IndexWriter[{}]: FirstIdxOffset={}, LastIdxOffset={}, AttrUpdates={}, Processed={}, Entries+={}, Buckets+={}.",
segment.getSegmentId(), firstIndexedOffset, lastIndexedOffset, update.getAttributes().size(),
processedCount, update.getEntryCountDelta(), update.getBucketCountDelta());
return segment.updateAttributes(update.getAttributes(), timeout)
.thenApply(v -> update.getAttributes().size());
}
} }
|
public class class_name {
CompletableFuture<Integer> updateBuckets(DirectSegmentAccess segment, Collection<BucketUpdate> bucketUpdates,
long firstIndexedOffset, long lastIndexedOffset, int processedCount, Duration timeout) {
UpdateInstructions update = new UpdateInstructions();
// Process each Key in the given Map.
// Locate the Key's Bucket, then generate necessary Attribute Updates to integrate new Keys into it.
for (BucketUpdate bucketUpdate : bucketUpdates) {
generateAttributeUpdates(bucketUpdate, update); // depends on control dependency: [for], data = [bucketUpdate]
}
if (lastIndexedOffset > firstIndexedOffset) {
// Atomically update the Table-related attributes in the Segment's metadata, once we apply these changes.
generateTableAttributeUpdates(firstIndexedOffset, lastIndexedOffset, processedCount, update); // depends on control dependency: [if], data = [none]
}
if (update.getAttributes().isEmpty()) {
// We haven't made any updates.
log.debug("IndexWriter[{}]: FirstIdxOffset={}, LastIdxOffset={}, No Changes.", segment.getSegmentId(), firstIndexedOffset, lastIndexedOffset); // depends on control dependency: [if], data = [none]
return CompletableFuture.completedFuture(0); // depends on control dependency: [if], data = [none]
} else {
log.debug("IndexWriter[{}]: FirstIdxOffset={}, LastIdxOffset={}, AttrUpdates={}, Processed={}, Entries+={}, Buckets+={}.",
segment.getSegmentId(), firstIndexedOffset, lastIndexedOffset, update.getAttributes().size(),
processedCount, update.getEntryCountDelta(), update.getBucketCountDelta()); // depends on control dependency: [if], data = [none]
return segment.updateAttributes(update.getAttributes(), timeout)
.thenApply(v -> update.getAttributes().size()); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private void assertSortedByDistance(DoubleDBIDList results) {
// TODO: sort results instead?
double dist = -1.0;
boolean sorted = true;
for(DoubleDBIDListIter it = results.iter(); it.valid(); it.advance()) {
double qr = it.doubleValue();
if(qr < dist) {
sorted = false;
}
dist = qr;
}
if(!sorted) {
try {
ModifiableDoubleDBIDList.class.cast(results).sort();
}
catch(ClassCastException | UnsupportedOperationException e) {
LoggingUtil.warning("WARNING: results not sorted by distance!", e);
}
}
} }
|
public class class_name {
private void assertSortedByDistance(DoubleDBIDList results) {
// TODO: sort results instead?
double dist = -1.0;
boolean sorted = true;
for(DoubleDBIDListIter it = results.iter(); it.valid(); it.advance()) {
double qr = it.doubleValue();
if(qr < dist) {
sorted = false; // depends on control dependency: [if], data = [none]
}
dist = qr; // depends on control dependency: [for], data = [none]
}
if(!sorted) {
try {
ModifiableDoubleDBIDList.class.cast(results).sort(); // depends on control dependency: [try], data = [none]
}
catch(ClassCastException | UnsupportedOperationException e) {
LoggingUtil.warning("WARNING: results not sorted by distance!", e);
} // depends on control dependency: [catch], data = [none]
}
} }
|
public class class_name {
public void cancel() {
if (task != null && !task.isCancelled()
&& task.getStatus() != AsyncTask.Status.FINISHED) {
task.cancel(true);
}
} }
|
public class class_name {
public void cancel() {
if (task != null && !task.isCancelled()
&& task.getStatus() != AsyncTask.Status.FINISHED) {
task.cancel(true); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public void marshall(LocalVolumeResourceData localVolumeResourceData, ProtocolMarshaller protocolMarshaller) {
if (localVolumeResourceData == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(localVolumeResourceData.getDestinationPath(), DESTINATIONPATH_BINDING);
protocolMarshaller.marshall(localVolumeResourceData.getGroupOwnerSetting(), GROUPOWNERSETTING_BINDING);
protocolMarshaller.marshall(localVolumeResourceData.getSourcePath(), SOURCEPATH_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(LocalVolumeResourceData localVolumeResourceData, ProtocolMarshaller protocolMarshaller) {
if (localVolumeResourceData == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(localVolumeResourceData.getDestinationPath(), DESTINATIONPATH_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(localVolumeResourceData.getGroupOwnerSetting(), GROUPOWNERSETTING_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(localVolumeResourceData.getSourcePath(), SOURCEPATH_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public List<String> getExtraFieldNames()
{
List<String> result = new ArrayList<String>();
for (Method method : getExtraFieldMethods())
{
ExtraField extraField = method.getAnnotation( ExtraField.class );
result.add( extraField.value() );
}
return result;
} }
|
public class class_name {
public List<String> getExtraFieldNames()
{
List<String> result = new ArrayList<String>();
for (Method method : getExtraFieldMethods())
{
ExtraField extraField = method.getAnnotation( ExtraField.class );
result.add( extraField.value() ); // depends on control dependency: [for], data = [none]
}
return result;
} }
|
public class class_name {
public void setSimilarityClass(String className)
{
try
{
Class<?> similarityClass = ClassLoading.forName(className, this);
similarity = (Similarity)similarityClass.newInstance();
}
catch (ClassNotFoundException e)
{
log.warn("Invalid Similarity class: " + className, e);
}
catch (InstantiationException e)
{
log.warn("Invalid Similarity class: " + className, e);
}
catch (IllegalAccessException e)
{
log.warn("Invalid Similarity class: " + className, e);
}
} }
|
public class class_name {
public void setSimilarityClass(String className)
{
try
{
Class<?> similarityClass = ClassLoading.forName(className, this);
similarity = (Similarity)similarityClass.newInstance();
}
catch (ClassNotFoundException e)
{
log.warn("Invalid Similarity class: " + className, e);
} // depends on control dependency: [catch], data = [none]
catch (InstantiationException e)
{
log.warn("Invalid Similarity class: " + className, e);
} // depends on control dependency: [catch], data = [none]
catch (IllegalAccessException e)
{
log.warn("Invalid Similarity class: " + className, e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public final void buildCategoryList(final CTAxDataSource ctAxDs) {
List<ParsedCell> cells = new ArrayList<>();
try {
String fullRangeName = ctAxDs.getStrRef().getF();
String sheetName = WebSheetUtility
.getSheetNameFromFullCellRefName(fullRangeName);
CellRangeAddress region = CellRangeAddress.valueOf(
WebSheetUtility.removeSheetNameFromFullCellRefName(
fullRangeName));
for (int row = region.getFirstRow(); row <= region
.getLastRow(); row++) {
for (int col = region.getFirstColumn(); col <= region
.getLastColumn(); col++) {
cells.add(new ParsedCell(sheetName, row, col));
}
}
} catch (Exception ex) {
LOG.log(Level.FINE, "failed in buildCategoryList", ex);
}
this.setCategoryList(cells);
} }
|
public class class_name {
public final void buildCategoryList(final CTAxDataSource ctAxDs) {
List<ParsedCell> cells = new ArrayList<>();
try {
String fullRangeName = ctAxDs.getStrRef().getF();
String sheetName = WebSheetUtility
.getSheetNameFromFullCellRefName(fullRangeName);
CellRangeAddress region = CellRangeAddress.valueOf(
WebSheetUtility.removeSheetNameFromFullCellRefName(
fullRangeName));
for (int row = region.getFirstRow(); row <= region
.getLastRow(); row++) {
for (int col = region.getFirstColumn(); col <= region
.getLastColumn(); col++) {
cells.add(new ParsedCell(sheetName, row, col));
// depends on control dependency: [for], data = [col]
}
}
} catch (Exception ex) {
LOG.log(Level.FINE, "failed in buildCategoryList", ex);
}
// depends on control dependency: [catch], data = [none]
this.setCategoryList(cells);
} }
|
public class class_name {
private static String lowPart(final String text) {
final String sector;
final String[] sectors = MediaType.sectors(text);
if (sectors.length > 1) {
sector = sectors[1].trim();
} else {
sector = "";
}
return sector;
} }
|
public class class_name {
private static String lowPart(final String text) {
final String sector;
final String[] sectors = MediaType.sectors(text);
if (sectors.length > 1) {
sector = sectors[1].trim(); // depends on control dependency: [if], data = [none]
} else {
sector = ""; // depends on control dependency: [if], data = [none]
}
return sector;
} }
|
public class class_name {
public AT_Row setTextAlignment(TextAlignment textAlignment){
if(this.hasCells()){
for(AT_Cell cell : this.getCells()){
cell.getContext().setTextAlignment(textAlignment);
}
}
return this;
} }
|
public class class_name {
public AT_Row setTextAlignment(TextAlignment textAlignment){
if(this.hasCells()){
for(AT_Cell cell : this.getCells()){
cell.getContext().setTextAlignment(textAlignment);
// depends on control dependency: [for], data = [cell]
}
}
return this;
} }
|
public class class_name {
public void processCalendar(Row row)
{
ProjectCalendar calendar = m_project.addCalendar();
Integer id = row.getInteger("clndr_id");
m_calMap.put(id, calendar);
calendar.setName(row.getString("clndr_name"));
try
{
calendar.setMinutesPerDay(Integer.valueOf((int) NumberHelper.getDouble(row.getDouble("day_hr_cnt")) * 60));
calendar.setMinutesPerWeek(Integer.valueOf((int) (NumberHelper.getDouble(row.getDouble("week_hr_cnt")) * 60)));
calendar.setMinutesPerMonth(Integer.valueOf((int) (NumberHelper.getDouble(row.getDouble("month_hr_cnt")) * 60)));
calendar.setMinutesPerYear(Integer.valueOf((int) (NumberHelper.getDouble(row.getDouble("year_hr_cnt")) * 60)));
}
catch (ClassCastException ex)
{
// We have seen examples of malformed calendar data where fields have been missing
// from the record. We'll typically get a class cast exception here as we're trying
// to process something which isn't a double.
// We'll just return at this point as it's not clear that we can salvage anything
// sensible from this record.
return;
}
// Process data
String calendarData = row.getString("clndr_data");
if (calendarData != null && !calendarData.isEmpty())
{
Record root = Record.getRecord(calendarData);
if (root != null)
{
processCalendarDays(calendar, root);
processCalendarExceptions(calendar, root);
}
}
else
{
// if there is not DaysOfWeek data, Primavera seems to default to Mon-Fri, 8:00-16:00
DateRange defaultHourRange = new DateRange(DateHelper.getTime(8, 0), DateHelper.getTime(16, 0));
for (Day day : Day.values())
{
if (day != Day.SATURDAY && day != Day.SUNDAY)
{
calendar.setWorkingDay(day, true);
ProjectCalendarHours hours = calendar.addCalendarHours(day);
hours.addRange(defaultHourRange);
}
else
{
calendar.setWorkingDay(day, false);
}
}
}
m_eventManager.fireCalendarReadEvent(calendar);
} }
|
public class class_name {
public void processCalendar(Row row)
{
ProjectCalendar calendar = m_project.addCalendar();
Integer id = row.getInteger("clndr_id");
m_calMap.put(id, calendar);
calendar.setName(row.getString("clndr_name"));
try
{
calendar.setMinutesPerDay(Integer.valueOf((int) NumberHelper.getDouble(row.getDouble("day_hr_cnt")) * 60)); // depends on control dependency: [try], data = [none]
calendar.setMinutesPerWeek(Integer.valueOf((int) (NumberHelper.getDouble(row.getDouble("week_hr_cnt")) * 60))); // depends on control dependency: [try], data = [none]
calendar.setMinutesPerMonth(Integer.valueOf((int) (NumberHelper.getDouble(row.getDouble("month_hr_cnt")) * 60))); // depends on control dependency: [try], data = [none]
calendar.setMinutesPerYear(Integer.valueOf((int) (NumberHelper.getDouble(row.getDouble("year_hr_cnt")) * 60))); // depends on control dependency: [try], data = [none]
}
catch (ClassCastException ex)
{
// We have seen examples of malformed calendar data where fields have been missing
// from the record. We'll typically get a class cast exception here as we're trying
// to process something which isn't a double.
// We'll just return at this point as it's not clear that we can salvage anything
// sensible from this record.
return;
} // depends on control dependency: [catch], data = [none]
// Process data
String calendarData = row.getString("clndr_data");
if (calendarData != null && !calendarData.isEmpty())
{
Record root = Record.getRecord(calendarData);
if (root != null)
{
processCalendarDays(calendar, root); // depends on control dependency: [if], data = [none]
processCalendarExceptions(calendar, root); // depends on control dependency: [if], data = [none]
}
}
else
{
// if there is not DaysOfWeek data, Primavera seems to default to Mon-Fri, 8:00-16:00
DateRange defaultHourRange = new DateRange(DateHelper.getTime(8, 0), DateHelper.getTime(16, 0));
for (Day day : Day.values())
{
if (day != Day.SATURDAY && day != Day.SUNDAY)
{
calendar.setWorkingDay(day, true); // depends on control dependency: [if], data = [(day]
ProjectCalendarHours hours = calendar.addCalendarHours(day);
hours.addRange(defaultHourRange); // depends on control dependency: [if], data = [none]
}
else
{
calendar.setWorkingDay(day, false); // depends on control dependency: [if], data = [(day]
}
}
}
m_eventManager.fireCalendarReadEvent(calendar);
} }
|
public class class_name {
public static long[] hash(final long[] key, final long seed) {
final HashState hashState = new HashState(seed, seed);
final int longs = key.length; //in longs
// Number of full 128-bit blocks of 2 longs (the body).
// Possible exclusion of a remainder of 1 long.
final int nblocks = longs >>> 1; //longs / 2
// Process the 128-bit blocks (the body) into the hash
for (int i = 0; i < nblocks; i++ ) {
final long k1 = key[i << 1]; //0, 2, 4, ...
final long k2 = key[(i << 1) + 1]; //1, 3, 5, ...
hashState.blockMix128(k1, k2);
}
// Get the tail index, remainder length
final int tail = nblocks << 1; // 2 longs / block
final int rem = longs - tail; // remainder longs: 0,1
// Get the tail
final long k1 = (rem == 0) ? 0 : key[tail]; //k2 -> 0
// Mix the tail into the hash and return
return hashState.finalMix128(k1, 0, longs << 3); //convert to bytes
} }
|
public class class_name {
public static long[] hash(final long[] key, final long seed) {
final HashState hashState = new HashState(seed, seed);
final int longs = key.length; //in longs
// Number of full 128-bit blocks of 2 longs (the body).
// Possible exclusion of a remainder of 1 long.
final int nblocks = longs >>> 1; //longs / 2
// Process the 128-bit blocks (the body) into the hash
for (int i = 0; i < nblocks; i++ ) {
final long k1 = key[i << 1]; //0, 2, 4, ...
final long k2 = key[(i << 1) + 1]; //1, 3, 5, ...
hashState.blockMix128(k1, k2); // depends on control dependency: [for], data = [none]
}
// Get the tail index, remainder length
final int tail = nblocks << 1; // 2 longs / block
final int rem = longs - tail; // remainder longs: 0,1
// Get the tail
final long k1 = (rem == 0) ? 0 : key[tail]; //k2 -> 0
// Mix the tail into the hash and return
return hashState.finalMix128(k1, 0, longs << 3); //convert to bytes
} }
|
public class class_name {
public void marshall(RecurringCharge recurringCharge, ProtocolMarshaller protocolMarshaller) {
if (recurringCharge == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(recurringCharge.getRecurringChargeAmount(), RECURRINGCHARGEAMOUNT_BINDING);
protocolMarshaller.marshall(recurringCharge.getRecurringChargeFrequency(), RECURRINGCHARGEFREQUENCY_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(RecurringCharge recurringCharge, ProtocolMarshaller protocolMarshaller) {
if (recurringCharge == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(recurringCharge.getRecurringChargeAmount(), RECURRINGCHARGEAMOUNT_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(recurringCharge.getRecurringChargeFrequency(), RECURRINGCHARGEFREQUENCY_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private void setAtomsToUnVisited(IAtomContainer molecule) {
for (int i = 0; i < molecule.getAtomCount(); i++) {
molecule.getAtom(i).setFlag(CDKConstants.VISITED, false);
}
} }
|
public class class_name {
private void setAtomsToUnVisited(IAtomContainer molecule) {
for (int i = 0; i < molecule.getAtomCount(); i++) {
molecule.getAtom(i).setFlag(CDKConstants.VISITED, false); // depends on control dependency: [for], data = [i]
}
} }
|
public class class_name {
@Override
public void initSave(S config, T first, UpdateQueryBuilder queryBuilder) {
jdbcDeepJobConfig = initConfig(config, jdbcDeepJobConfig);
try {
this.jdbcWriter = new JdbcWriter<>(jdbcDeepJobConfig);
} catch(Exception e) {
throw new DeepGenericException(e);
}
} }
|
public class class_name {
@Override
public void initSave(S config, T first, UpdateQueryBuilder queryBuilder) {
jdbcDeepJobConfig = initConfig(config, jdbcDeepJobConfig);
try {
this.jdbcWriter = new JdbcWriter<>(jdbcDeepJobConfig); // depends on control dependency: [try], data = [none]
} catch(Exception e) {
throw new DeepGenericException(e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public static File getWebRoot() {
final String classPath = ClassUtil.getClassPath();
if (StrUtil.isNotBlank(classPath)) {
return getParent(file(classPath), 2);
}
return null;
} }
|
public class class_name {
public static File getWebRoot() {
final String classPath = ClassUtil.getClassPath();
if (StrUtil.isNotBlank(classPath)) {
return getParent(file(classPath), 2);
// depends on control dependency: [if], data = [none]
}
return null;
} }
|
public class class_name {
public boolean isConnected(Url url) {
Connection conn = this.rpcRemoting.connectionManager.get(url.getUniqueKey());
if (null != conn) {
return conn.isFine();
}
return false;
} }
|
public class class_name {
public boolean isConnected(Url url) {
Connection conn = this.rpcRemoting.connectionManager.get(url.getUniqueKey());
if (null != conn) {
return conn.isFine(); // depends on control dependency: [if], data = [none]
}
return false;
} }
|
public class class_name {
protected void populateAnnotationsCache(Class<?> clazz,
Map<String, String> injections) throws IllegalAccessException,
InvocationTargetException {
while (clazz != null) {
List<AnnotationCacheEntry> annotations = null;
synchronized (annotationCache) {
annotations = annotationCache.get(clazz);
}
if (annotations == null) {
annotations = new ArrayList<>();
// Initialize methods annotations
Method[] methods = null;
methods = clazz.getDeclaredMethods();
Method postConstruct = null;
Method preDestroy = null;
for (Method method : methods) {
if (method.isAnnotationPresent(PostConstruct.class)) {
if ((postConstruct != null)
|| (method.getParameterTypes().length != 0)
|| (Modifier.isStatic(method.getModifiers()))
|| (method.getExceptionTypes().length > 0)
|| (!method.getReturnType().getName()
.equals("void"))) {
throw new IllegalArgumentException(
"Invalid PostConstruct annotation");
}
postConstruct = method;
}
if (method.isAnnotationPresent(PreDestroy.class)) {
if ((preDestroy != null || method.getParameterTypes().length != 0)
|| (Modifier.isStatic(method.getModifiers()))
|| (method.getExceptionTypes().length > 0)
|| (!method.getReturnType().getName()
.equals("void"))) {
throw new IllegalArgumentException(
"Invalid PreDestroy annotation");
}
preDestroy = method;
}
}
if (postConstruct != null) {
annotations.add(new AnnotationCacheEntry(postConstruct
.getName(), postConstruct.getParameterTypes(),
null, AnnotationCacheEntryType.POST_CONSTRUCT));
}
if (preDestroy != null) {
annotations.add(new AnnotationCacheEntry(preDestroy
.getName(), preDestroy.getParameterTypes(), null,
AnnotationCacheEntryType.PRE_DESTROY));
}
if (annotations.size() == 0) {
// Use common empty list to save memory
annotations = Collections.emptyList();
}
synchronized (annotationCache) {
annotationCache.put(clazz, annotations);
}
}
// CHECKSTYLE:OFF
clazz = clazz.getSuperclass();
// CHECKSTYLE:ON
}
} }
|
public class class_name {
protected void populateAnnotationsCache(Class<?> clazz,
Map<String, String> injections) throws IllegalAccessException,
InvocationTargetException {
while (clazz != null) {
List<AnnotationCacheEntry> annotations = null;
synchronized (annotationCache) {
annotations = annotationCache.get(clazz);
}
if (annotations == null) {
annotations = new ArrayList<>();
// Initialize methods annotations
Method[] methods = null;
methods = clazz.getDeclaredMethods();
Method postConstruct = null;
Method preDestroy = null;
for (Method method : methods) {
if (method.isAnnotationPresent(PostConstruct.class)) {
if ((postConstruct != null)
|| (method.getParameterTypes().length != 0)
|| (Modifier.isStatic(method.getModifiers()))
|| (method.getExceptionTypes().length > 0)
|| (!method.getReturnType().getName()
.equals("void"))) {
throw new IllegalArgumentException(
"Invalid PostConstruct annotation");
}
postConstruct = method; // depends on control dependency: [if], data = [none]
}
if (method.isAnnotationPresent(PreDestroy.class)) {
if ((preDestroy != null || method.getParameterTypes().length != 0)
|| (Modifier.isStatic(method.getModifiers()))
|| (method.getExceptionTypes().length > 0)
|| (!method.getReturnType().getName()
.equals("void"))) {
throw new IllegalArgumentException(
"Invalid PreDestroy annotation");
}
preDestroy = method; // depends on control dependency: [if], data = [none]
}
}
if (postConstruct != null) {
annotations.add(new AnnotationCacheEntry(postConstruct
.getName(), postConstruct.getParameterTypes(),
null, AnnotationCacheEntryType.POST_CONSTRUCT));
}
if (preDestroy != null) {
annotations.add(new AnnotationCacheEntry(preDestroy
.getName(), preDestroy.getParameterTypes(), null,
AnnotationCacheEntryType.PRE_DESTROY));
}
if (annotations.size() == 0) {
// Use common empty list to save memory
annotations = Collections.emptyList();
}
synchronized (annotationCache) {
annotationCache.put(clazz, annotations);
}
}
// CHECKSTYLE:OFF
clazz = clazz.getSuperclass();
// CHECKSTYLE:ON
}
} }
|
public class class_name {
public Step<Flow<T>> getOrCreateStep()
{
List<Node> nodeList = childNode.get("step");
if (nodeList != null && nodeList.size() > 0)
{
return new StepImpl<Flow<T>>(this, "step", childNode, nodeList.get(0));
}
return createStep();
} }
|
public class class_name {
public Step<Flow<T>> getOrCreateStep()
{
List<Node> nodeList = childNode.get("step");
if (nodeList != null && nodeList.size() > 0)
{
return new StepImpl<Flow<T>>(this, "step", childNode, nodeList.get(0)); // depends on control dependency: [if], data = [none]
}
return createStep();
} }
|
public class class_name {
public void alarm (Object alarmContext)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "alarm", alarmContext);
synchronized(this) {
_alarm = null;
}
try {
completeBatch(true);
} catch(SIException e) {
//No FFDC code needed
SibTr.exception(this, tc, e);
//can't do anything else here
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "alarm");
} }
|
public class class_name {
public void alarm (Object alarmContext)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "alarm", alarmContext);
synchronized(this) {
_alarm = null;
}
try {
completeBatch(true); // depends on control dependency: [try], data = [none]
} catch(SIException e) {
//No FFDC code needed
SibTr.exception(this, tc, e);
//can't do anything else here
} // depends on control dependency: [catch], data = [none]
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "alarm");
} }
|
public class class_name {
@Nullable
@ReturnsMutableCopy
public static byte [] safeDecode (@Nullable final String sEncoded, final int nOptions)
{
if (sEncoded != null)
try
{
return decode (sEncoded, nOptions);
}
catch (final Exception ex)
{
// fall through
}
return null;
} }
|
public class class_name {
@Nullable
@ReturnsMutableCopy
public static byte [] safeDecode (@Nullable final String sEncoded, final int nOptions)
{
if (sEncoded != null)
try
{
return decode (sEncoded, nOptions); // depends on control dependency: [try], data = [none]
}
catch (final Exception ex)
{
// fall through
} // depends on control dependency: [catch], data = [none]
return null;
} }
|
public class class_name {
@ManagedAttribute
public void setSamplingLevel(int samplingLevel) {
if (samplingLevel >= MIN_LEVEL && samplingLevel <= MAX_LEVEL) {
this.samplingLevel = samplingLevel;
} else {
throw new IllegalArgumentException("Sampling level " + samplingLevel + " is not in the range [" + MIN_LEVEL + ";" + MAX_LEVEL + "[");
}
} }
|
public class class_name {
@ManagedAttribute
public void setSamplingLevel(int samplingLevel) {
if (samplingLevel >= MIN_LEVEL && samplingLevel <= MAX_LEVEL) {
this.samplingLevel = samplingLevel; // depends on control dependency: [if], data = [none]
} else {
throw new IllegalArgumentException("Sampling level " + samplingLevel + " is not in the range [" + MIN_LEVEL + ";" + MAX_LEVEL + "[");
}
} }
|
public class class_name {
public void process(Queue<String> argq, Object state) {
String command = argq.peek();
if (command != null) {
System.err.print("Unrecognzied command: ");
System.err.println(command);
}
} }
|
public class class_name {
public void process(Queue<String> argq, Object state) {
String command = argq.peek();
if (command != null) {
System.err.print("Unrecognzied command: "); // depends on control dependency: [if], data = [none]
System.err.println(command); // depends on control dependency: [if], data = [(command]
}
} }
|
public class class_name {
public void setResourceTags(java.util.Collection<ResourceTag> resourceTags) {
if (resourceTags == null) {
this.resourceTags = null;
return;
}
this.resourceTags = new java.util.ArrayList<ResourceTag>(resourceTags);
} }
|
public class class_name {
public void setResourceTags(java.util.Collection<ResourceTag> resourceTags) {
if (resourceTags == null) {
this.resourceTags = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
this.resourceTags = new java.util.ArrayList<ResourceTag>(resourceTags);
} }
|
public class class_name {
public static Object getElementFromCollection(Collection<Object> collection, int index) {
if (collection.size() < index + 1)
return null;
if (collection instanceof List)
return ((List<Object>) collection).get(index);
Iterator<Object> iterator = collection.iterator();
for (int i = 0; i < index; i++) {
iterator.next();
}
return iterator.next();
} }
|
public class class_name {
public static Object getElementFromCollection(Collection<Object> collection, int index) {
if (collection.size() < index + 1)
return null;
if (collection instanceof List)
return ((List<Object>) collection).get(index);
Iterator<Object> iterator = collection.iterator();
for (int i = 0; i < index; i++) {
iterator.next();
// depends on control dependency: [for], data = [none]
}
return iterator.next();
} }
|
public class class_name {
public GenericAttachment withButtons(Button... buttons) {
if (this.buttons == null) {
setButtons(new java.util.ArrayList<Button>(buttons.length));
}
for (Button ele : buttons) {
this.buttons.add(ele);
}
return this;
} }
|
public class class_name {
public GenericAttachment withButtons(Button... buttons) {
if (this.buttons == null) {
setButtons(new java.util.ArrayList<Button>(buttons.length)); // depends on control dependency: [if], data = [none]
}
for (Button ele : buttons) {
this.buttons.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} }
|
public class class_name {
public void marshall(WebACL webACL, ProtocolMarshaller protocolMarshaller) {
if (webACL == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(webACL.getWebACLId(), WEBACLID_BINDING);
protocolMarshaller.marshall(webACL.getName(), NAME_BINDING);
protocolMarshaller.marshall(webACL.getMetricName(), METRICNAME_BINDING);
protocolMarshaller.marshall(webACL.getDefaultAction(), DEFAULTACTION_BINDING);
protocolMarshaller.marshall(webACL.getRules(), RULES_BINDING);
protocolMarshaller.marshall(webACL.getWebACLArn(), WEBACLARN_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(WebACL webACL, ProtocolMarshaller protocolMarshaller) {
if (webACL == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(webACL.getWebACLId(), WEBACLID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(webACL.getName(), NAME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(webACL.getMetricName(), METRICNAME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(webACL.getDefaultAction(), DEFAULTACTION_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(webACL.getRules(), RULES_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(webACL.getWebACLArn(), WEBACLARN_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
@Override
protected void createForwardingMethodBody(ClassMethod classMethod, final MethodInformation methodInfo, ClassMethod staticConstructor) {
final Method method = methodInfo.getMethod();
// we can only use bytecode based invocation for some methods
// at the moment we restrict it solely to public methods with public
// return and parameter types
boolean bytecodeInvocationAllowed = Modifier.isPublic(method.getModifiers()) && Modifier.isPublic(method.getReturnType().getModifiers());
for (Class<?> paramType : method.getParameterTypes()) {
if (!Modifier.isPublic(paramType.getModifiers())) {
bytecodeInvocationAllowed = false;
break;
}
}
if (!bytecodeInvocationAllowed) {
createInterceptorBody(classMethod, methodInfo, staticConstructor);
return;
}
// create a new interceptor invocation context whenever we invoke a method on a client proxy
// we use a try-catch block in order to make sure that endInterceptorContext() is invoked regardless whether
// the method has succeeded or not
new RunWithinInterceptionDecorationContextGenerator(classMethod, this) {
@Override
void doWork(CodeAttribute b, ClassMethod classMethod) {
loadBeanInstance(classMethod.getClassFile(), methodInfo, b);
//now we should have the target bean instance on top of the stack
// we need to dup it so we still have it to compare to the return value
b.dup();
//lets create the method invocation
String methodDescriptor = methodInfo.getDescriptor();
b.loadMethodParameters();
if (method.getDeclaringClass().isInterface()) {
b.invokeinterface(methodInfo.getDeclaringClass(), methodInfo.getName(), methodDescriptor);
} else {
b.invokevirtual(methodInfo.getDeclaringClass(), methodInfo.getName(), methodDescriptor);
}
}
@Override
void doReturn(CodeAttribute b, ClassMethod classMethod) {
// assumes doWork() result is on top of the stack
// if this method returns a primitive we just return
if (method.getReturnType().isPrimitive()) {
b.returnInstruction();
} else {
// otherwise we have to check that the proxy is not returning 'this;
// now we need to check if the proxy has return 'this' and if so return
// an
// instance of the proxy.
// currently we have result, beanInstance on the stack.
b.dupX1();
// now we have result, beanInstance, result
// we need to compare result and beanInstance
// first we need to build up the inner conditional that just returns
// the
// result
final BranchEnd returnInstruction = b.ifAcmpeq();
b.returnInstruction();
b.branchEnd(returnInstruction);
// now add the case where the proxy returns 'this';
b.aload(0);
b.checkcast(methodInfo.getMethod().getReturnType().getName());
b.returnInstruction();
}
}
}.runStartIfNotEmpty();
} }
|
public class class_name {
@Override
protected void createForwardingMethodBody(ClassMethod classMethod, final MethodInformation methodInfo, ClassMethod staticConstructor) {
final Method method = methodInfo.getMethod();
// we can only use bytecode based invocation for some methods
// at the moment we restrict it solely to public methods with public
// return and parameter types
boolean bytecodeInvocationAllowed = Modifier.isPublic(method.getModifiers()) && Modifier.isPublic(method.getReturnType().getModifiers());
for (Class<?> paramType : method.getParameterTypes()) {
if (!Modifier.isPublic(paramType.getModifiers())) {
bytecodeInvocationAllowed = false; // depends on control dependency: [if], data = [none]
break;
}
}
if (!bytecodeInvocationAllowed) {
createInterceptorBody(classMethod, methodInfo, staticConstructor); // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
// create a new interceptor invocation context whenever we invoke a method on a client proxy
// we use a try-catch block in order to make sure that endInterceptorContext() is invoked regardless whether
// the method has succeeded or not
new RunWithinInterceptionDecorationContextGenerator(classMethod, this) {
@Override
void doWork(CodeAttribute b, ClassMethod classMethod) {
loadBeanInstance(classMethod.getClassFile(), methodInfo, b);
//now we should have the target bean instance on top of the stack
// we need to dup it so we still have it to compare to the return value
b.dup();
//lets create the method invocation
String methodDescriptor = methodInfo.getDescriptor();
b.loadMethodParameters();
if (method.getDeclaringClass().isInterface()) {
b.invokeinterface(methodInfo.getDeclaringClass(), methodInfo.getName(), methodDescriptor); // depends on control dependency: [if], data = [none]
} else {
b.invokevirtual(methodInfo.getDeclaringClass(), methodInfo.getName(), methodDescriptor); // depends on control dependency: [if], data = [none]
}
}
@Override
void doReturn(CodeAttribute b, ClassMethod classMethod) {
// assumes doWork() result is on top of the stack
// if this method returns a primitive we just return
if (method.getReturnType().isPrimitive()) {
b.returnInstruction(); // depends on control dependency: [if], data = [none]
} else {
// otherwise we have to check that the proxy is not returning 'this;
// now we need to check if the proxy has return 'this' and if so return
// an
// instance of the proxy.
// currently we have result, beanInstance on the stack.
b.dupX1(); // depends on control dependency: [if], data = [none]
// now we have result, beanInstance, result
// we need to compare result and beanInstance
// first we need to build up the inner conditional that just returns
// the
// result
final BranchEnd returnInstruction = b.ifAcmpeq();
b.returnInstruction(); // depends on control dependency: [if], data = [none]
b.branchEnd(returnInstruction); // depends on control dependency: [if], data = [none]
// now add the case where the proxy returns 'this';
b.aload(0); // depends on control dependency: [if], data = [none]
b.checkcast(methodInfo.getMethod().getReturnType().getName()); // depends on control dependency: [if], data = [none]
b.returnInstruction(); // depends on control dependency: [if], data = [none]
}
}
}.runStartIfNotEmpty();
} }
|
public class class_name {
private static boolean isStopChar(String word){
if(word.length() == 1){
char _char = word.charAt(0);
if(_char < 48){
return true;
}
if(_char > 57 && _char < 19968){
return true;
}
if(_char > 40869){
return true;
}
}
return false;
} }
|
public class class_name {
private static boolean isStopChar(String word){
if(word.length() == 1){
char _char = word.charAt(0);
if(_char < 48){
return true; // depends on control dependency: [if], data = [none]
}
if(_char > 57 && _char < 19968){
return true; // depends on control dependency: [if], data = [none]
}
if(_char > 40869){
return true; // depends on control dependency: [if], data = [none]
}
}
return false;
} }
|
public class class_name {
private String getEffectiveValue(Map<String, Option> options, CliOption opt) {
final String shortOpt = opt.value();
if (opt.hasArg()) {
if (options.containsKey(shortOpt)) {
return options.get(shortOpt).getValue();
}
return opt.defaultValue();
}
return Boolean.toString(options.containsKey(opt.value()));
} }
|
public class class_name {
private String getEffectiveValue(Map<String, Option> options, CliOption opt) {
final String shortOpt = opt.value();
if (opt.hasArg()) {
if (options.containsKey(shortOpt)) {
return options.get(shortOpt).getValue(); // depends on control dependency: [if], data = [none]
}
return opt.defaultValue(); // depends on control dependency: [if], data = [none]
}
return Boolean.toString(options.containsKey(opt.value()));
} }
|
public class class_name {
public MethodInfoList filter(final MethodInfoFilter filter) {
final MethodInfoList methodInfoFiltered = new MethodInfoList();
for (final MethodInfo resource : this) {
if (filter.accept(resource)) {
methodInfoFiltered.add(resource);
}
}
return methodInfoFiltered;
} }
|
public class class_name {
public MethodInfoList filter(final MethodInfoFilter filter) {
final MethodInfoList methodInfoFiltered = new MethodInfoList();
for (final MethodInfo resource : this) {
if (filter.accept(resource)) {
methodInfoFiltered.add(resource); // depends on control dependency: [if], data = [none]
}
}
return methodInfoFiltered;
} }
|
public class class_name {
private EJBException mapException(EJSDeployedSupport s, Throwable ex) //117817.1
{
EJBException ejbex;
String message = null;
// If necessary, wrap root with WsEJBException. This is done if
// root is not an instance of Exception.
Exception rootEx = ExceptionUtil.Exception(s.rootEx); // F71894.1
// Now map Throwable to a EJBException to return.
if (ex instanceof CSIException)
{
ejbex = mapCSIException(s, (CSIException) ex, rootEx);
}
else if (ex instanceof NoSuchObjectException)
{
ejbex = new NoSuchObjectLocalException(message, rootEx);
}
else if (ex instanceof EJBStoppedException) // d350987
{
ejbex = new NoSuchObjectLocalException(message, rootEx);
}
else if (ex instanceof HomeDisabledException) // d350987
{
ejbex = new NoSuchObjectLocalException(message, rootEx);
}
else if (ex instanceof TransactionRequiredException)
{
ejbex = new TransactionRequiredLocalException(message);
}
else if (ex instanceof TransactionRolledbackException)
{
ejbex = new TransactionRolledbackLocalException(message, rootEx);
}
else if (ex instanceof InvalidTransactionException)
{
ejbex = new InvalidTransactionLocalException(message, rootEx);
}
else if (ex instanceof AccessException)
{
ejbex = new AccessLocalException(message, rootEx);
}
// else if (ex instanceof ActivityRequiredException)
// {
// ejbex = new ActivityRequiredLocalException(message, rootEx);
// }
// else if (ex instanceof InvalidActivityException) //126946.3
// {
// ejbex = new InvalidActivityLocalException(message, rootEx); //126946.3
// }
// else if (ex instanceof ActivityCompletedException)
// {
// ejbex = new ActivityCompletedLocalException(message, rootEx); //126946.3
// }
else if (ex instanceof EJBException)
{
// Even though this is already an EJBException we will nest it inside another EJBException that we create.
// This is done to ensure that but the getCause() and getCausedByException() methods will work on it. //253963
ejbex = ExceptionUtil.EJBException(ex); //253963
}
else if (ex instanceof RemoteException)
{
// If the RemoteException is already wrapping an EJBException, then
// use that exception, otherwise create a new EJBException with the root //253963
if (((RemoteException) ex).detail instanceof EJBException)
{
ejbex = ExceptionUtil.EJBException(ex); //253963
}
else
ejbex = ExceptionUtil.EJBException(rootEx); //253963
}
else if (ex instanceof IllegalArgumentException) // d184523
{
ejbex = ExceptionUtil.EJBException(rootEx); //253963
}
else
{
ejbex = new UnknownLocalException(message, rootEx);
}
// EJBException doesn't normally set the cause on Throwable, so
// let's do that to be nice :-) d354591
// Geronimo EJBException.getCause returns getCausedbyException, so
// we do not expect this code to be used. F53643
if (rootEx != null &&
rootEx != ejbex &&
ejbex.getCause() == null)
{
ejbex.initCause(rootEx);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "mapException returning: " + ejbex); // d402055
}
return ejbex;
} }
|
public class class_name {
private EJBException mapException(EJSDeployedSupport s, Throwable ex) //117817.1
{
EJBException ejbex;
String message = null;
// If necessary, wrap root with WsEJBException. This is done if
// root is not an instance of Exception.
Exception rootEx = ExceptionUtil.Exception(s.rootEx); // F71894.1
// Now map Throwable to a EJBException to return.
if (ex instanceof CSIException)
{
ejbex = mapCSIException(s, (CSIException) ex, rootEx); // depends on control dependency: [if], data = [none]
}
else if (ex instanceof NoSuchObjectException)
{
ejbex = new NoSuchObjectLocalException(message, rootEx); // depends on control dependency: [if], data = [none]
}
else if (ex instanceof EJBStoppedException) // d350987
{
ejbex = new NoSuchObjectLocalException(message, rootEx); // depends on control dependency: [if], data = [none]
}
else if (ex instanceof HomeDisabledException) // d350987
{
ejbex = new NoSuchObjectLocalException(message, rootEx); // depends on control dependency: [if], data = [none]
}
else if (ex instanceof TransactionRequiredException)
{
ejbex = new TransactionRequiredLocalException(message); // depends on control dependency: [if], data = [none]
}
else if (ex instanceof TransactionRolledbackException)
{
ejbex = new TransactionRolledbackLocalException(message, rootEx); // depends on control dependency: [if], data = [none]
}
else if (ex instanceof InvalidTransactionException)
{
ejbex = new InvalidTransactionLocalException(message, rootEx); // depends on control dependency: [if], data = [none]
}
else if (ex instanceof AccessException)
{
ejbex = new AccessLocalException(message, rootEx); // depends on control dependency: [if], data = [none]
}
// else if (ex instanceof ActivityRequiredException)
// {
// ejbex = new ActivityRequiredLocalException(message, rootEx);
// }
// else if (ex instanceof InvalidActivityException) //126946.3
// {
// ejbex = new InvalidActivityLocalException(message, rootEx); //126946.3
// }
// else if (ex instanceof ActivityCompletedException)
// {
// ejbex = new ActivityCompletedLocalException(message, rootEx); //126946.3
// }
else if (ex instanceof EJBException)
{
// Even though this is already an EJBException we will nest it inside another EJBException that we create.
// This is done to ensure that but the getCause() and getCausedByException() methods will work on it. //253963
ejbex = ExceptionUtil.EJBException(ex); //253963 // depends on control dependency: [if], data = [none]
}
else if (ex instanceof RemoteException)
{
// If the RemoteException is already wrapping an EJBException, then
// use that exception, otherwise create a new EJBException with the root //253963
if (((RemoteException) ex).detail instanceof EJBException)
{
ejbex = ExceptionUtil.EJBException(ex); //253963 // depends on control dependency: [if], data = [none]
}
else
ejbex = ExceptionUtil.EJBException(rootEx); //253963
}
else if (ex instanceof IllegalArgumentException) // d184523
{
ejbex = ExceptionUtil.EJBException(rootEx); //253963 // depends on control dependency: [if], data = [none]
}
else
{
ejbex = new UnknownLocalException(message, rootEx); // depends on control dependency: [if], data = [none]
}
// EJBException doesn't normally set the cause on Throwable, so
// let's do that to be nice :-) d354591
// Geronimo EJBException.getCause returns getCausedbyException, so
// we do not expect this code to be used. F53643
if (rootEx != null &&
rootEx != ejbex &&
ejbex.getCause() == null)
{
ejbex.initCause(rootEx); // depends on control dependency: [if], data = [(rootEx]
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "mapException returning: " + ejbex); // d402055 // depends on control dependency: [if], data = [none]
}
return ejbex;
} }
|
public class class_name {
@Override
public void onTimeout()
{
try {
//request().sendError(WebRequest.INTERNAL_SERVER_ERROR);
if (true) throw new UnsupportedOperationException();
} catch (Exception e) {
log.log(Level.FINEST, e.toString(), e);
}
closeResponse();
} }
|
public class class_name {
@Override
public void onTimeout()
{
try {
//request().sendError(WebRequest.INTERNAL_SERVER_ERROR);
if (true) throw new UnsupportedOperationException();
} catch (Exception e) {
log.log(Level.FINEST, e.toString(), e);
} // depends on control dependency: [catch], data = [none]
closeResponse();
} }
|
public class class_name {
private static void setImageViewScaleTypeMatrix(ImageView imageView) {
/**
* PhotoView sets its own ScaleType to Matrix, then diverts all calls
* setScaleType to this.setScaleType automatically.
*/
if (null != imageView && !(imageView instanceof IPhotoView)) {
if (!ScaleType.MATRIX.equals(imageView.getScaleType())) {
imageView.setScaleType(ScaleType.MATRIX);
}
}
} }
|
public class class_name {
private static void setImageViewScaleTypeMatrix(ImageView imageView) {
/**
* PhotoView sets its own ScaleType to Matrix, then diverts all calls
* setScaleType to this.setScaleType automatically.
*/
if (null != imageView && !(imageView instanceof IPhotoView)) {
if (!ScaleType.MATRIX.equals(imageView.getScaleType())) {
imageView.setScaleType(ScaleType.MATRIX); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
public static BigInteger getSafePrime(UnsignedInteger32 maximumSize) {
BigInteger prime = group1;
for(Iterator<BigInteger> it = safePrimes.iterator(); it.hasNext(); ) {
BigInteger p = it.next();
int len = p.bitLength();
if(len > maximumSize.intValue()) {
break;
}
prime = p;
}
return prime;
} }
|
public class class_name {
public static BigInteger getSafePrime(UnsignedInteger32 maximumSize) {
BigInteger prime = group1;
for(Iterator<BigInteger> it = safePrimes.iterator(); it.hasNext(); ) {
BigInteger p = it.next();
int len = p.bitLength();
if(len > maximumSize.intValue()) {
break;
}
prime = p; // depends on control dependency: [for], data = [none]
}
return prime;
} }
|
public class class_name {
public List<JvmAnnotationReference> findAnnotations(Set<String> qualifiedNames, JvmAnnotationTarget annotationTarget) {
List<JvmAnnotationReference> result = new ArrayList<>();
if (annotationTarget != null) {
for (JvmAnnotationReference annotation : annotationTarget.getAnnotations()) {
String id = annotation.getAnnotation().getIdentifier();
if (qualifiedNames.contains(id)) {
result.add(annotation);
}
}
}
return result;
} }
|
public class class_name {
public List<JvmAnnotationReference> findAnnotations(Set<String> qualifiedNames, JvmAnnotationTarget annotationTarget) {
List<JvmAnnotationReference> result = new ArrayList<>();
if (annotationTarget != null) {
for (JvmAnnotationReference annotation : annotationTarget.getAnnotations()) {
String id = annotation.getAnnotation().getIdentifier();
if (qualifiedNames.contains(id)) {
result.add(annotation); // depends on control dependency: [if], data = [none]
}
}
}
return result;
} }
|
public class class_name {
private static int _escape (final StringBuilder out, final char ch, final int pos)
{
if (isEscapeChar (ch))
{
out.append (ch);
return pos + 1;
}
out.append ('\\');
return pos;
} }
|
public class class_name {
private static int _escape (final StringBuilder out, final char ch, final int pos)
{
if (isEscapeChar (ch))
{
out.append (ch); // depends on control dependency: [if], data = [none]
return pos + 1; // depends on control dependency: [if], data = [none]
}
out.append ('\\');
return pos;
} }
|
public class class_name {
public boolean shouldShowInContext(CmsContainerElementData elementData) {
CmsTemplateContextInfo contextInfo = getData().getTemplateContextInfo();
if (contextInfo.getCurrentContext() == null) {
return true;
}
CmsDefaultSet<String> allowedContexts = contextInfo.getAllowedContexts().get(elementData.getResourceType());
if ((allowedContexts != null) && !allowedContexts.contains(contextInfo.getCurrentContext())) {
return false;
}
String settingValue = elementData.getSettings().get(CmsTemplateContextInfo.SETTING);
return (settingValue == null) || settingValue.contains(contextInfo.getCurrentContext());
} }
|
public class class_name {
public boolean shouldShowInContext(CmsContainerElementData elementData) {
CmsTemplateContextInfo contextInfo = getData().getTemplateContextInfo();
if (contextInfo.getCurrentContext() == null) {
return true; // depends on control dependency: [if], data = [none]
}
CmsDefaultSet<String> allowedContexts = contextInfo.getAllowedContexts().get(elementData.getResourceType());
if ((allowedContexts != null) && !allowedContexts.contains(contextInfo.getCurrentContext())) {
return false; // depends on control dependency: [if], data = [none]
}
String settingValue = elementData.getSettings().get(CmsTemplateContextInfo.SETTING);
return (settingValue == null) || settingValue.contains(contextInfo.getCurrentContext());
} }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.