code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { @Nullable public IUser createPredefinedUser (@Nonnull @Nonempty final String sID, @Nonnull @Nonempty final String sLoginName, @Nullable final String sEmailAddress, @Nonnull final String sPlainTextPassword, @Nullable final String sFirstName, @Nullable final String sLastName, @Nullable final String sDescription, @Nullable final Locale aDesiredLocale, @Nullable final Map <String, String> aCustomAttrs, final boolean bDisabled) { ValueEnforcer.notEmpty (sLoginName, "LoginName"); ValueEnforcer.notNull (sPlainTextPassword, "PlainTextPassword"); if (getUserOfLoginName (sLoginName) != null) { // Another user with this login name already exists AuditHelper.onAuditCreateFailure (User.OT, "login-name-already-in-use", sLoginName, "predefined-user"); return null; } // Create user final User aUser = new User (sID, sLoginName, sEmailAddress, GlobalPasswordSettings.createUserDefaultPasswordHash (new PasswordSalt (), sPlainTextPassword), sFirstName, sLastName, sDescription, aDesiredLocale, aCustomAttrs, bDisabled); m_aRWLock.writeLocked ( () -> { internalCreateItem (aUser); }); AuditHelper.onAuditCreateSuccess (User.OT, aUser.getID (), "predefined-user", sLoginName, sEmailAddress, sFirstName, sLastName, sDescription, aDesiredLocale, aCustomAttrs, Boolean.valueOf (bDisabled)); // Execute callback as the very last action m_aCallbacks.forEach (aCB -> aCB.onUserCreated (aUser, true)); return aUser; } }
public class class_name { @Nullable public IUser createPredefinedUser (@Nonnull @Nonempty final String sID, @Nonnull @Nonempty final String sLoginName, @Nullable final String sEmailAddress, @Nonnull final String sPlainTextPassword, @Nullable final String sFirstName, @Nullable final String sLastName, @Nullable final String sDescription, @Nullable final Locale aDesiredLocale, @Nullable final Map <String, String> aCustomAttrs, final boolean bDisabled) { ValueEnforcer.notEmpty (sLoginName, "LoginName"); ValueEnforcer.notNull (sPlainTextPassword, "PlainTextPassword"); if (getUserOfLoginName (sLoginName) != null) { // Another user with this login name already exists AuditHelper.onAuditCreateFailure (User.OT, "login-name-already-in-use", sLoginName, "predefined-user"); // depends on control dependency: [if], data = [none] return null; // depends on control dependency: [if], data = [none] } // Create user final User aUser = new User (sID, sLoginName, sEmailAddress, GlobalPasswordSettings.createUserDefaultPasswordHash (new PasswordSalt (), sPlainTextPassword), sFirstName, sLastName, sDescription, aDesiredLocale, aCustomAttrs, bDisabled); m_aRWLock.writeLocked ( () -> { internalCreateItem (aUser); }); AuditHelper.onAuditCreateSuccess (User.OT, aUser.getID (), "predefined-user", sLoginName, sEmailAddress, sFirstName, sLastName, sDescription, aDesiredLocale, aCustomAttrs, Boolean.valueOf (bDisabled)); // Execute callback as the very last action m_aCallbacks.forEach (aCB -> aCB.onUserCreated (aUser, true)); return aUser; } }
public class class_name { public Observable<ServiceResponse<Page<BillingMeterInner>>> listBillingMetersWithServiceResponseAsync(final String billingLocation) { return listBillingMetersSinglePageAsync(billingLocation) .concatMap(new Func1<ServiceResponse<Page<BillingMeterInner>>, Observable<ServiceResponse<Page<BillingMeterInner>>>>() { @Override public Observable<ServiceResponse<Page<BillingMeterInner>>> call(ServiceResponse<Page<BillingMeterInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(listBillingMetersNextWithServiceResponseAsync(nextPageLink)); } }); } }
public class class_name { public Observable<ServiceResponse<Page<BillingMeterInner>>> listBillingMetersWithServiceResponseAsync(final String billingLocation) { return listBillingMetersSinglePageAsync(billingLocation) .concatMap(new Func1<ServiceResponse<Page<BillingMeterInner>>, Observable<ServiceResponse<Page<BillingMeterInner>>>>() { @Override public Observable<ServiceResponse<Page<BillingMeterInner>>> call(ServiceResponse<Page<BillingMeterInner>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); // depends on control dependency: [if], data = [none] } return Observable.just(page).concatWith(listBillingMetersNextWithServiceResponseAsync(nextPageLink)); } }); } }
public class class_name { private void upgradeLockIfNeeded() { // using clone to avoid ConcurentModificationException Iterator iter = ((List) mvOrderOfIds.clone()).iterator(); TransactionImpl tx = getTransaction(); ObjectEnvelope mod; while(iter.hasNext()) { mod = (ObjectEnvelope) mhtObjectEnvelopes.get(iter.next()); // ignore transient objects if(!mod.getModificationState().isTransient()) { /* now we check if all modified objects has a write lock. On insert of new objects we don't need a write lock. */ if(!mod.needsInsert()) { if((mod.needsDelete() || mod.needsUpdate() || mod.hasChanged(tx.getBroker()))) { needsCommit = true; // mark object dirty mod.setModificationState(mod.getModificationState().markDirty()); ClassDescriptor cld = mod.getClassDescriptor(); // if the object isn't already locked, we will do it now if(!mod.isWriteLocked()) { tx.doSingleLock(cld, mod.getObject(), mod.getIdentity(), Transaction.WRITE); } } } else { needsCommit = true; } } } } }
public class class_name { private void upgradeLockIfNeeded() { // using clone to avoid ConcurentModificationException Iterator iter = ((List) mvOrderOfIds.clone()).iterator(); TransactionImpl tx = getTransaction(); ObjectEnvelope mod; while(iter.hasNext()) { mod = (ObjectEnvelope) mhtObjectEnvelopes.get(iter.next()); // depends on control dependency: [while], data = [none] // ignore transient objects if(!mod.getModificationState().isTransient()) { /* now we check if all modified objects has a write lock. On insert of new objects we don't need a write lock. */ if(!mod.needsInsert()) { if((mod.needsDelete() || mod.needsUpdate() || mod.hasChanged(tx.getBroker()))) { needsCommit = true; // depends on control dependency: [if], data = [none] // mark object dirty mod.setModificationState(mod.getModificationState().markDirty()); // depends on control dependency: [if], data = [none] ClassDescriptor cld = mod.getClassDescriptor(); // if the object isn't already locked, we will do it now if(!mod.isWriteLocked()) { tx.doSingleLock(cld, mod.getObject(), mod.getIdentity(), Transaction.WRITE); // depends on control dependency: [if], data = [none] } } } else { needsCommit = true; // depends on control dependency: [if], data = [none] } } } } }
public class class_name { public boolean init(IScope scope, String name, boolean isAppend) { // get the file for our filename File file = getRecordFile(scope, name); if (file != null) { // If append mode is on... if (!isAppend) { if (file.exists()) { // when "live" or "record" is used, any previously recorded stream with the same stream URI is deleted. if (!file.delete()) { log.warn("Existing file: {} could not be deleted", file.getName()); return false; } } } else { if (file.exists()) { appending = true; } else { // if a recorded stream at the same URI does not already exist, "append" creates the stream as though "record" was passed. isAppend = false; } } // if the file doesn't exist yet, create it if (!file.exists()) { // Make sure the destination directory exists String path = file.getAbsolutePath(); int slashPos = path.lastIndexOf(File.separator); if (slashPos != -1) { path = path.substring(0, slashPos); } File tmp = new File(path); if (!tmp.isDirectory()) { tmp.mkdirs(); } try { file.createNewFile(); } catch (IOException e) { log.warn("New recording file could not be created for: {}", file.getName(), e); return false; } } if (log.isDebugEnabled()) { try { log.debug("Recording file: {}", file.getCanonicalPath()); } catch (IOException e) { log.warn("Exception getting file path", e); } } //remove existing meta info if (scope.getContext().hasBean("keyframe.cache")) { IKeyFrameMetaCache keyFrameCache = (IKeyFrameMetaCache) scope.getContext().getBean("keyframe.cache"); keyFrameCache.removeKeyFrameMeta(file); } // get instance via spring if (scope.getContext().hasBean("fileConsumer")) { log.debug("Context contains a file consumer"); recordingConsumer = (FileConsumer) scope.getContext().getBean("fileConsumer"); recordingConsumer.setScope(scope); recordingConsumer.setFile(file); } else { log.debug("Context does not contain a file consumer, using direct instance"); // get a new instance recordingConsumer = new FileConsumer(scope, file); } // set the mode on the consumer if (isAppend) { recordingConsumer.setMode("append"); } else { recordingConsumer.setMode("record"); } // set the filename setFileName(file.getName()); // get the scheduler scheduler = (ISchedulingService) scope.getParent().getContext().getBean(ISchedulingService.BEAN_NAME); // set recording true recording.set(true); } else { log.warn("Record file is null"); } // since init finished, return recording flag return recording.get(); } }
public class class_name { public boolean init(IScope scope, String name, boolean isAppend) { // get the file for our filename File file = getRecordFile(scope, name); if (file != null) { // If append mode is on... if (!isAppend) { if (file.exists()) { // when "live" or "record" is used, any previously recorded stream with the same stream URI is deleted. if (!file.delete()) { log.warn("Existing file: {} could not be deleted", file.getName()); // depends on control dependency: [if], data = [none] return false; // depends on control dependency: [if], data = [none] } } } else { if (file.exists()) { appending = true; // depends on control dependency: [if], data = [none] } else { // if a recorded stream at the same URI does not already exist, "append" creates the stream as though "record" was passed. isAppend = false; // depends on control dependency: [if], data = [none] } } // if the file doesn't exist yet, create it if (!file.exists()) { // Make sure the destination directory exists String path = file.getAbsolutePath(); int slashPos = path.lastIndexOf(File.separator); if (slashPos != -1) { path = path.substring(0, slashPos); // depends on control dependency: [if], data = [none] } File tmp = new File(path); if (!tmp.isDirectory()) { tmp.mkdirs(); // depends on control dependency: [if], data = [none] } try { file.createNewFile(); // depends on control dependency: [try], data = [none] } catch (IOException e) { log.warn("New recording file could not be created for: {}", file.getName(), e); return false; } // depends on control dependency: [catch], data = [none] } if (log.isDebugEnabled()) { try { log.debug("Recording file: {}", file.getCanonicalPath()); // depends on control dependency: [try], data = [none] } catch (IOException e) { log.warn("Exception getting file path", e); } // depends on control dependency: [catch], data = [none] } //remove existing meta info if (scope.getContext().hasBean("keyframe.cache")) { IKeyFrameMetaCache keyFrameCache = (IKeyFrameMetaCache) scope.getContext().getBean("keyframe.cache"); keyFrameCache.removeKeyFrameMeta(file); } // get instance via spring if (scope.getContext().hasBean("fileConsumer")) { log.debug("Context contains a file consumer"); recordingConsumer = (FileConsumer) scope.getContext().getBean("fileConsumer"); recordingConsumer.setScope(scope); recordingConsumer.setFile(file); } else { log.debug("Context does not contain a file consumer, using direct instance"); // get a new instance recordingConsumer = new FileConsumer(scope, file); } // set the mode on the consumer if (isAppend) { recordingConsumer.setMode("append"); } else { recordingConsumer.setMode("record"); } // set the filename setFileName(file.getName()); // get the scheduler scheduler = (ISchedulingService) scope.getParent().getContext().getBean(ISchedulingService.BEAN_NAME); // set recording true recording.set(true); } else { log.warn("Record file is null"); } // since init finished, return recording flag return recording.get(); } }
public class class_name { public DateTimeFormatter withResolverFields(TemporalField... resolverFields) { Set<TemporalField> fields = null; if (resolverFields != null) { fields = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(resolverFields))); } if (Objects.equals(this.resolverFields, fields)) { return this; } return new DateTimeFormatter(printerParser, locale, decimalStyle, resolverStyle, fields, chrono, zone); } }
public class class_name { public DateTimeFormatter withResolverFields(TemporalField... resolverFields) { Set<TemporalField> fields = null; if (resolverFields != null) { fields = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(resolverFields))); // depends on control dependency: [if], data = [(resolverFields] } if (Objects.equals(this.resolverFields, fields)) { return this; // depends on control dependency: [if], data = [none] } return new DateTimeFormatter(printerParser, locale, decimalStyle, resolverStyle, fields, chrono, zone); } }
public class class_name { private void flush() { try { QueuedCommand cmd; int i = 0; boolean flushedOnce = false; while ((cmd = queue.poll()) != null) { cmd.run(channel); if (++i == DEQUE_CHUNK_SIZE) { i = 0; // Flush each chunk so we are releasing buffers periodically. In theory this loop // might never end as new events are continuously added to the queue, if we never // flushed in that case we would be guaranteed to OOM. channel.flush(); flushedOnce = true; } } // Must flush at least once, even if there were no writes. if (i != 0 || !flushedOnce) { channel.flush(); } } finally { // Mark the write as done, if the queue is non-empty after marking trigger a new write. scheduled.set(false); if (!queue.isEmpty()) { scheduleFlush(); } } } }
public class class_name { private void flush() { try { QueuedCommand cmd; int i = 0; boolean flushedOnce = false; while ((cmd = queue.poll()) != null) { cmd.run(channel); // depends on control dependency: [while], data = [none] if (++i == DEQUE_CHUNK_SIZE) { i = 0; // depends on control dependency: [if], data = [none] // Flush each chunk so we are releasing buffers periodically. In theory this loop // might never end as new events are continuously added to the queue, if we never // flushed in that case we would be guaranteed to OOM. channel.flush(); // depends on control dependency: [if], data = [none] flushedOnce = true; // depends on control dependency: [if], data = [none] } } // Must flush at least once, even if there were no writes. if (i != 0 || !flushedOnce) { channel.flush(); // depends on control dependency: [if], data = [none] } } finally { // Mark the write as done, if the queue is non-empty after marking trigger a new write. scheduled.set(false); if (!queue.isEmpty()) { scheduleFlush(); // depends on control dependency: [if], data = [none] } } } }
public class class_name { private Entry insertHereWithSplit(Entry toInsert, Node insertNode, long timestamp) { //Handle root split if (insertNode.getEntries()[0].getParentEntry()==null){ root.makeOlder(timestamp, negLambda); Entry irrelevantEntry = insertNode.getIrrelevantEntry(this.weightThreshold); int numFreeEntries = insertNode.numFreeEntries(); if (irrelevantEntry != null) { irrelevantEntry.overwriteOldEntry(toInsert); } else if (numFreeEntries>0){ insertNode.addEntry(toInsert, timestamp); } else{ this.numRootSplits++; this.height += this.height < this.maxHeight ? 1 : 0; Entry oldRootEntry = new Entry(this.numberDimensions, root, timestamp, null, null); Node newRoot = new Node(this.numberDimensions, this.height); Entry newRootEntry = split(toInsert, root, oldRootEntry, timestamp); newRoot.addEntry(oldRootEntry, timestamp); newRoot.addEntry(newRootEntry, timestamp); this.root = newRoot; for (Entry c : oldRootEntry.getChild().getEntries()) c.setParentEntry(root.getEntries()[0]); for (Entry c : newRootEntry.getChild().getEntries()) c.setParentEntry(root.getEntries()[1]); } return null; } insertNode.makeOlder(timestamp, negLambda); Entry irrelevantEntry = insertNode.getIrrelevantEntry(this.weightThreshold); int numFreeEntries = insertNode.numFreeEntries(); if (irrelevantEntry != null) { irrelevantEntry.overwriteOldEntry(toInsert); } else if (numFreeEntries>0){ insertNode.addEntry(toInsert, timestamp); } else { // We have to split. Entry parentEntry = insertNode.getEntries()[0].getParentEntry(); Entry residualEntry = split(toInsert, insertNode, parentEntry, timestamp); if (alsoUpdate!=null){ alsoUpdate = residualEntry; } Node nodeForResidualEntry = insertNode.getEntries()[0].getParentEntry().getNode(); //recursive call return insertHereWithSplit(residualEntry, nodeForResidualEntry, timestamp); } //no Split return null; } }
public class class_name { private Entry insertHereWithSplit(Entry toInsert, Node insertNode, long timestamp) { //Handle root split if (insertNode.getEntries()[0].getParentEntry()==null){ root.makeOlder(timestamp, negLambda); // depends on control dependency: [if], data = [none] Entry irrelevantEntry = insertNode.getIrrelevantEntry(this.weightThreshold); int numFreeEntries = insertNode.numFreeEntries(); if (irrelevantEntry != null) { irrelevantEntry.overwriteOldEntry(toInsert); // depends on control dependency: [if], data = [none] } else if (numFreeEntries>0){ insertNode.addEntry(toInsert, timestamp); // depends on control dependency: [if], data = [none] } else{ this.numRootSplits++; // depends on control dependency: [if], data = [none] this.height += this.height < this.maxHeight ? 1 : 0; // depends on control dependency: [if], data = [none] Entry oldRootEntry = new Entry(this.numberDimensions, root, timestamp, null, null); Node newRoot = new Node(this.numberDimensions, this.height); Entry newRootEntry = split(toInsert, root, oldRootEntry, timestamp); newRoot.addEntry(oldRootEntry, timestamp); // depends on control dependency: [if], data = [none] newRoot.addEntry(newRootEntry, timestamp); // depends on control dependency: [if], data = [none] this.root = newRoot; // depends on control dependency: [if], data = [none] for (Entry c : oldRootEntry.getChild().getEntries()) c.setParentEntry(root.getEntries()[0]); for (Entry c : newRootEntry.getChild().getEntries()) c.setParentEntry(root.getEntries()[1]); } return null; // depends on control dependency: [if], data = [none] } insertNode.makeOlder(timestamp, negLambda); Entry irrelevantEntry = insertNode.getIrrelevantEntry(this.weightThreshold); int numFreeEntries = insertNode.numFreeEntries(); if (irrelevantEntry != null) { irrelevantEntry.overwriteOldEntry(toInsert); // depends on control dependency: [if], data = [none] } else if (numFreeEntries>0){ insertNode.addEntry(toInsert, timestamp); // depends on control dependency: [if], data = [none] } else { // We have to split. Entry parentEntry = insertNode.getEntries()[0].getParentEntry(); Entry residualEntry = split(toInsert, insertNode, parentEntry, timestamp); if (alsoUpdate!=null){ alsoUpdate = residualEntry; // depends on control dependency: [if], data = [none] } Node nodeForResidualEntry = insertNode.getEntries()[0].getParentEntry().getNode(); //recursive call return insertHereWithSplit(residualEntry, nodeForResidualEntry, timestamp); // depends on control dependency: [if], data = [none] } //no Split return null; } }
public class class_name { private ImageView getImageView(final int position) { if (position < mImageViewList.size()) { return mImageViewList.get(position); } else { if (mAdapter != null) { ImageView imageView = mAdapter.generateImageView(getContext()); mImageViewList.add(imageView); return imageView; } else { Log.e("9GridImageView", "你必须为LQRNineGridImageView设置LQRNineGridImageViewAdapter"); return null; } } } }
public class class_name { private ImageView getImageView(final int position) { if (position < mImageViewList.size()) { return mImageViewList.get(position); // depends on control dependency: [if], data = [(position] } else { if (mAdapter != null) { ImageView imageView = mAdapter.generateImageView(getContext()); mImageViewList.add(imageView); // depends on control dependency: [if], data = [none] return imageView; // depends on control dependency: [if], data = [none] } else { Log.e("9GridImageView", "你必须为LQRNineGridImageView设置LQRNineGridImageViewAdapter"); // depends on control dependency: [if], data = [none] return null; // depends on control dependency: [if], data = [none] } } } }
public class class_name { public JsonAsserter assertNotDefined(String path) { try { Configuration c = Configuration.defaultConfiguration(); JsonPath.using(c).parse(jsonObject).read(path); throw new AssertionError(format("Document contains the path <%s> but was expected not to.", path)); } catch (PathNotFoundException e) { } return this; } }
public class class_name { public JsonAsserter assertNotDefined(String path) { try { Configuration c = Configuration.defaultConfiguration(); JsonPath.using(c).parse(jsonObject).read(path); // depends on control dependency: [try], data = [none] throw new AssertionError(format("Document contains the path <%s> but was expected not to.", path)); } catch (PathNotFoundException e) { } // depends on control dependency: [catch], data = [none] return this; } }
public class class_name { public int writeSamples(short[] data, int numSamples) { int numBytes = numSamples<<1; byte[] theData = new byte[numBytes]; for (int y = 0, yc=0; y<numBytes; y+=2) { theData[y] = (byte) (data[yc] & 0x00FF); theData[y + 1] = (byte) ((data[yc++] >>> 8) & 0x00FF); } return write(theData, numBytes); } }
public class class_name { public int writeSamples(short[] data, int numSamples) { int numBytes = numSamples<<1; byte[] theData = new byte[numBytes]; for (int y = 0, yc=0; y<numBytes; y+=2) { theData[y] = (byte) (data[yc] & 0x00FF); // depends on control dependency: [for], data = [y] theData[y + 1] = (byte) ((data[yc++] >>> 8) & 0x00FF); // depends on control dependency: [for], data = [y] } return write(theData, numBytes); } }
public class class_name { void computePotentialSplitScore( List<Point2D_I32> contour , Element<Corner> e0 , boolean mustSplit ) { Element<Corner> e1 = next(e0); e0.object.splitable = canBeSplit(contour,e0,mustSplit); if( e0.object.splitable ) { setSplitVariables(contour, e0, e1); } } }
public class class_name { void computePotentialSplitScore( List<Point2D_I32> contour , Element<Corner> e0 , boolean mustSplit ) { Element<Corner> e1 = next(e0); e0.object.splitable = canBeSplit(contour,e0,mustSplit); if( e0.object.splitable ) { setSplitVariables(contour, e0, e1); // depends on control dependency: [if], data = [none] } } }
public class class_name { private static FacesInitializer _getFacesInitializerFromInitParam(ServletContext context) { String initializerClassName = context.getInitParameter(FACES_INITIALIZER_PARAM); if (initializerClassName != null) { try { // get Class object Class<?> clazz = ClassUtils.classForName(initializerClassName); if (!FacesInitializer.class.isAssignableFrom(clazz)) { throw new FacesException("Class " + clazz + " does not implement FacesInitializer"); } // create instance and return it return (FacesInitializer) ClassUtils.newInstance(clazz); } catch (ClassNotFoundException cnfe) { throw new FacesException("Could not find class of specified FacesInitializer", cnfe); } } return null; } }
public class class_name { private static FacesInitializer _getFacesInitializerFromInitParam(ServletContext context) { String initializerClassName = context.getInitParameter(FACES_INITIALIZER_PARAM); if (initializerClassName != null) { try { // get Class object Class<?> clazz = ClassUtils.classForName(initializerClassName); if (!FacesInitializer.class.isAssignableFrom(clazz)) { throw new FacesException("Class " + clazz + " does not implement FacesInitializer"); } // create instance and return it return (FacesInitializer) ClassUtils.newInstance(clazz); // depends on control dependency: [try], data = [none] } catch (ClassNotFoundException cnfe) { throw new FacesException("Could not find class of specified FacesInitializer", cnfe); } // depends on control dependency: [catch], data = [none] } return null; } }
public class class_name { private int getToolbarHeightAdjustment(boolean bToolbarShown) { int adjustAmount = 0; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { boolean translucentStatus = false; // check theme attrs to see if translucent statusbar is set explicitly int[] attrs = {android.R.attr.windowTranslucentStatus}; TypedArray a = getTheme().obtainStyledAttributes(attrs); try { translucentStatus = a.getBoolean(0, false); } finally { a.recycle(); } // also check window flags in case translucent statusbar is set implicitly WindowManager.LayoutParams winParams = getWindow().getAttributes(); int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS; if ((winParams.flags & bits) != 0) { translucentStatus = true; } if (translucentStatus) { if (bToolbarShown) { int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); if (resourceId > 0) { adjustAmount = getResources().getDimensionPixelSize(resourceId); } } /* Add layout listener to ensure keyboard launch resize the screen when android:windowTranslucentStatus=true * Fixing workaround found here: * http://stackoverflow.com/questions/8398102/androidwindowsoftinputmode-adjustresize-doesnt-make-any-difference */ decorView = getWindow().getDecorView(); contentView = decorView.findViewById(android.R.id.content); decorView.getViewTreeObserver().addOnGlobalLayoutListener(keyboardPresencelLayoutListener); } } return adjustAmount; } }
public class class_name { private int getToolbarHeightAdjustment(boolean bToolbarShown) { int adjustAmount = 0; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { boolean translucentStatus = false; // check theme attrs to see if translucent statusbar is set explicitly int[] attrs = {android.R.attr.windowTranslucentStatus}; TypedArray a = getTheme().obtainStyledAttributes(attrs); try { translucentStatus = a.getBoolean(0, false); // depends on control dependency: [try], data = [none] } finally { a.recycle(); } // also check window flags in case translucent statusbar is set implicitly WindowManager.LayoutParams winParams = getWindow().getAttributes(); int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS; if ((winParams.flags & bits) != 0) { translucentStatus = true; // depends on control dependency: [if], data = [none] } if (translucentStatus) { if (bToolbarShown) { int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); if (resourceId > 0) { adjustAmount = getResources().getDimensionPixelSize(resourceId); // depends on control dependency: [if], data = [(resourceId] } } /* Add layout listener to ensure keyboard launch resize the screen when android:windowTranslucentStatus=true * Fixing workaround found here: * http://stackoverflow.com/questions/8398102/androidwindowsoftinputmode-adjustresize-doesnt-make-any-difference */ decorView = getWindow().getDecorView(); // depends on control dependency: [if], data = [none] contentView = decorView.findViewById(android.R.id.content); // depends on control dependency: [if], data = [none] decorView.getViewTreeObserver().addOnGlobalLayoutListener(keyboardPresencelLayoutListener); // depends on control dependency: [if], data = [none] } } return adjustAmount; } }
public class class_name { @Override public DescriptorValue calculate(IAtom atom, IAtomContainer container) { IAtomContainer clone; IAtom localAtom; try { clone = (IAtomContainer) container.clone(); localAtom = clone.getAtom(container.indexOf(atom)); AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(clone); } catch (CDKException e) { return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult( Double.NaN), NAMES, e); } catch (CloneNotSupportedException e) { return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult( Double.NaN), NAMES, e); } double result = stabil.calculatePositive(clone, localAtom); return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(result), NAMES); } }
public class class_name { @Override public DescriptorValue calculate(IAtom atom, IAtomContainer container) { IAtomContainer clone; IAtom localAtom; try { clone = (IAtomContainer) container.clone(); // depends on control dependency: [try], data = [none] localAtom = clone.getAtom(container.indexOf(atom)); // depends on control dependency: [try], data = [none] AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(clone); // depends on control dependency: [try], data = [none] } catch (CDKException e) { return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult( Double.NaN), NAMES, e); } catch (CloneNotSupportedException e) { // depends on control dependency: [catch], data = [none] return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult( Double.NaN), NAMES, e); } // depends on control dependency: [catch], data = [none] double result = stabil.calculatePositive(clone, localAtom); return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(result), NAMES); } }
public class class_name { private URL[] generateClassPathUrls() throws MojoExecutionException { List<URL> urls = new ArrayList<URL>(); URL url; try { for (Object element : getCompileClasspath()) { String path = (String) element; if (path.endsWith(".jar")) { url = new URL("jar:" + new File(path).toURI().toString() + "!/"); } else { url = new File(path).toURI().toURL(); } urls.add(url); } } catch (MalformedURLException e) { throw new MojoExecutionException("Could not set up classpath", e); } return urls.toArray(new URL[urls.size()]); } }
public class class_name { private URL[] generateClassPathUrls() throws MojoExecutionException { List<URL> urls = new ArrayList<URL>(); URL url; try { for (Object element : getCompileClasspath()) { String path = (String) element; if (path.endsWith(".jar")) { url = new URL("jar:" + new File(path).toURI().toString() + "!/"); // depends on control dependency: [if], data = [none] } else { url = new File(path).toURI().toURL(); // depends on control dependency: [if], data = [none] } urls.add(url); // depends on control dependency: [for], data = [none] } } catch (MalformedURLException e) { throw new MojoExecutionException("Could not set up classpath", e); } return urls.toArray(new URL[urls.size()]); } }
public class class_name { public DeleteFleetsRequest withFleetIds(String... fleetIds) { if (this.fleetIds == null) { setFleetIds(new com.amazonaws.internal.SdkInternalList<String>(fleetIds.length)); } for (String ele : fleetIds) { this.fleetIds.add(ele); } return this; } }
public class class_name { public DeleteFleetsRequest withFleetIds(String... fleetIds) { if (this.fleetIds == null) { setFleetIds(new com.amazonaws.internal.SdkInternalList<String>(fleetIds.length)); // depends on control dependency: [if], data = [none] } for (String ele : fleetIds) { this.fleetIds.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public final QueryParser.equal_return equal() throws RecognitionException { QueryParser.equal_return retval = new QueryParser.equal_return(); retval.start = input.LT(1); CommonTree root_0 = null; Token WS71=null; Token EQUAL72=null; Token WS73=null; QueryParser.field_return field70 = null; QueryParser.value_return value74 = null; CommonTree WS71_tree=null; CommonTree EQUAL72_tree=null; CommonTree WS73_tree=null; try { // src/riemann/Query.g:65:7: ( field ( WS )* EQUAL ( WS )* value ) // src/riemann/Query.g:65:9: field ( WS )* EQUAL ( WS )* value { root_0 = (CommonTree)adaptor.nil(); pushFollow(FOLLOW_field_in_equal488); field70=field(); state._fsp--; adaptor.addChild(root_0, field70.getTree()); // src/riemann/Query.g:65:15: ( WS )* loop27: do { int alt27=2; int LA27_0 = input.LA(1); if ( (LA27_0==WS) ) { alt27=1; } switch (alt27) { case 1 : // src/riemann/Query.g:65:15: WS { WS71=(Token)match(input,WS,FOLLOW_WS_in_equal490); WS71_tree = (CommonTree)adaptor.create(WS71); adaptor.addChild(root_0, WS71_tree); } break; default : break loop27; } } while (true); EQUAL72=(Token)match(input,EQUAL,FOLLOW_EQUAL_in_equal493); EQUAL72_tree = (CommonTree)adaptor.create(EQUAL72); root_0 = (CommonTree)adaptor.becomeRoot(EQUAL72_tree, root_0); // src/riemann/Query.g:65:26: ( WS )* loop28: do { int alt28=2; int LA28_0 = input.LA(1); if ( (LA28_0==WS) ) { alt28=1; } switch (alt28) { case 1 : // src/riemann/Query.g:65:26: WS { WS73=(Token)match(input,WS,FOLLOW_WS_in_equal496); WS73_tree = (CommonTree)adaptor.create(WS73); adaptor.addChild(root_0, WS73_tree); } break; default : break loop28; } } while (true); pushFollow(FOLLOW_value_in_equal499); value74=value(); state._fsp--; adaptor.addChild(root_0, value74.getTree()); } retval.stop = input.LT(-1); retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); } catch (RecognitionException re) { reportError(re); recover(input,re); retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); } finally { } return retval; } }
public class class_name { public final QueryParser.equal_return equal() throws RecognitionException { QueryParser.equal_return retval = new QueryParser.equal_return(); retval.start = input.LT(1); CommonTree root_0 = null; Token WS71=null; Token EQUAL72=null; Token WS73=null; QueryParser.field_return field70 = null; QueryParser.value_return value74 = null; CommonTree WS71_tree=null; CommonTree EQUAL72_tree=null; CommonTree WS73_tree=null; try { // src/riemann/Query.g:65:7: ( field ( WS )* EQUAL ( WS )* value ) // src/riemann/Query.g:65:9: field ( WS )* EQUAL ( WS )* value { root_0 = (CommonTree)adaptor.nil(); pushFollow(FOLLOW_field_in_equal488); field70=field(); state._fsp--; adaptor.addChild(root_0, field70.getTree()); // src/riemann/Query.g:65:15: ( WS )* loop27: do { int alt27=2; int LA27_0 = input.LA(1); if ( (LA27_0==WS) ) { alt27=1; // depends on control dependency: [if], data = [none] } switch (alt27) { case 1 : // src/riemann/Query.g:65:15: WS { WS71=(Token)match(input,WS,FOLLOW_WS_in_equal490); WS71_tree = (CommonTree)adaptor.create(WS71); adaptor.addChild(root_0, WS71_tree); } break; default : break loop27; } } while (true); EQUAL72=(Token)match(input,EQUAL,FOLLOW_EQUAL_in_equal493); EQUAL72_tree = (CommonTree)adaptor.create(EQUAL72); root_0 = (CommonTree)adaptor.becomeRoot(EQUAL72_tree, root_0); // src/riemann/Query.g:65:26: ( WS )* loop28: do { int alt28=2; int LA28_0 = input.LA(1); if ( (LA28_0==WS) ) { alt28=1; // depends on control dependency: [if], data = [none] } switch (alt28) { case 1 : // src/riemann/Query.g:65:26: WS { WS73=(Token)match(input,WS,FOLLOW_WS_in_equal496); WS73_tree = (CommonTree)adaptor.create(WS73); adaptor.addChild(root_0, WS73_tree); } break; default : break loop28; } } while (true); pushFollow(FOLLOW_value_in_equal499); value74=value(); state._fsp--; adaptor.addChild(root_0, value74.getTree()); } retval.stop = input.LT(-1); retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); } catch (RecognitionException re) { reportError(re); recover(input,re); retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); } finally { } return retval; } }
public class class_name { protected void updateAddedCount() { SpiderScan sc = this.getSelectedScanner(); if (sc != null) { this.getAddedCountValueLabel().setText(Integer.toString(sc.getNumberOfNodesAdded())); } else { this.getAddedCountValueLabel().setText(ZERO_REQUESTS_LABEL_TEXT); } } }
public class class_name { protected void updateAddedCount() { SpiderScan sc = this.getSelectedScanner(); if (sc != null) { this.getAddedCountValueLabel().setText(Integer.toString(sc.getNumberOfNodesAdded())); // depends on control dependency: [if], data = [(sc] } else { this.getAddedCountValueLabel().setText(ZERO_REQUESTS_LABEL_TEXT); // depends on control dependency: [if], data = [none] } } }
public class class_name { public int fieldChanged(boolean bDisplayOption, int moveMode) { int iScreenNo = (int)((NumberField)m_owner).getValue(); if ((iScreenNo == -1) || (iScreenNo == m_iCurrentScreenNo)) return DBConstants.NORMAL_RETURN; ScreenLocation screenLocation = null; // First, find the current sub-screen this.setCurrentSubScreen(null); // Make your best guess as to the old sub-screen // Display wait cursor BaseAppletReference applet = null; if (m_screenParent.getTask() instanceof BaseAppletReference) applet = (BaseAppletReference)m_screenParent.getTask(); Object oldCursor = null; if (applet != null) oldCursor = applet.setStatus(DBConstants.WAIT, applet, null); ScreenField sField = m_screenParent.getSField(m_iScreenSeq); if ((sField != null) && (sField instanceof BaseScreen)) { // First, get rid of the old screen screenLocation = sField.getScreenLocation(); m_screenParent = sField.getParentScreen(); sField.free(); sField = null; if (m_screenParent == null) if (this.getOwner().getComponent(0) instanceof ScreenField) // Always m_screenParent = ((ScreenField)this.getOwner().getComponent(0)).getParentScreen(); } if (screenLocation == null) screenLocation = m_screenParent.getNextLocation(ScreenConstants.FLUSH_LEFT, ScreenConstants.FILL_REMAINDER); sField = this.getSubScreen(m_screenParent, screenLocation, null, iScreenNo); if (applet != null) applet.setStatus(0, applet, oldCursor); if (sField == null) m_iCurrentScreenNo = -1; else m_iCurrentScreenNo = iScreenNo; return DBConstants.NORMAL_RETURN; } }
public class class_name { public int fieldChanged(boolean bDisplayOption, int moveMode) { int iScreenNo = (int)((NumberField)m_owner).getValue(); if ((iScreenNo == -1) || (iScreenNo == m_iCurrentScreenNo)) return DBConstants.NORMAL_RETURN; ScreenLocation screenLocation = null; // First, find the current sub-screen this.setCurrentSubScreen(null); // Make your best guess as to the old sub-screen // Display wait cursor BaseAppletReference applet = null; if (m_screenParent.getTask() instanceof BaseAppletReference) applet = (BaseAppletReference)m_screenParent.getTask(); Object oldCursor = null; if (applet != null) oldCursor = applet.setStatus(DBConstants.WAIT, applet, null); ScreenField sField = m_screenParent.getSField(m_iScreenSeq); if ((sField != null) && (sField instanceof BaseScreen)) { // First, get rid of the old screen screenLocation = sField.getScreenLocation(); // depends on control dependency: [if], data = [none] m_screenParent = sField.getParentScreen(); // depends on control dependency: [if], data = [none] sField.free(); // depends on control dependency: [if], data = [none] sField = null; // depends on control dependency: [if], data = [none] if (m_screenParent == null) if (this.getOwner().getComponent(0) instanceof ScreenField) // Always m_screenParent = ((ScreenField)this.getOwner().getComponent(0)).getParentScreen(); } if (screenLocation == null) screenLocation = m_screenParent.getNextLocation(ScreenConstants.FLUSH_LEFT, ScreenConstants.FILL_REMAINDER); sField = this.getSubScreen(m_screenParent, screenLocation, null, iScreenNo); if (applet != null) applet.setStatus(0, applet, oldCursor); if (sField == null) m_iCurrentScreenNo = -1; else m_iCurrentScreenNo = iScreenNo; return DBConstants.NORMAL_RETURN; } }
public class class_name { private void afterRecord() { if (fileNamePattern != null && getRecordCounter() % splitlimit == 0) { try { endCollection(); writer.close(); newWriter(fileNamePattern, fileNameCounter, bufferSize, compress); setupEventConsumer(writer, indent); beginCollection(); } catch (IOException e) { logger.log(Level.SEVERE, e.getMessage(), e); } } } }
public class class_name { private void afterRecord() { if (fileNamePattern != null && getRecordCounter() % splitlimit == 0) { try { endCollection(); // depends on control dependency: [try], data = [none] writer.close(); // depends on control dependency: [try], data = [none] newWriter(fileNamePattern, fileNameCounter, bufferSize, compress); // depends on control dependency: [try], data = [none] setupEventConsumer(writer, indent); // depends on control dependency: [try], data = [none] beginCollection(); // depends on control dependency: [try], data = [none] } catch (IOException e) { logger.log(Level.SEVERE, e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } } }
public class class_name { public static String asStringUnchecked(final Object value) { try { return asString(value); } catch (JsonProcessingException e) { throw new RuntimeException(e); } } }
public class class_name { public static String asStringUnchecked(final Object value) { try { return asString(value); // depends on control dependency: [try], data = [none] } catch (JsonProcessingException e) { throw new RuntimeException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override protected void initGraphics() { // Set initial size if (Double.compare(clock.getPrefWidth(), 0.0) <= 0 || Double.compare(clock.getPrefHeight(), 0.0) <= 0 || Double.compare(clock.getWidth(), 0.0) <= 0 || Double.compare(clock.getHeight(), 0.0) <= 0) { if (clock.getPrefWidth() > 0 && clock.getPrefHeight() > 0) { clock.setPrefSize(clock.getPrefWidth(), clock.getPrefHeight()); } else { clock.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); } } canvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT); ctx = canvas.getGraphicsContext2D(); pane = new Pane(canvas); pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(clock.getBorderWidth())))); pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY))); getChildren().setAll(pane); } }
public class class_name { @Override protected void initGraphics() { // Set initial size if (Double.compare(clock.getPrefWidth(), 0.0) <= 0 || Double.compare(clock.getPrefHeight(), 0.0) <= 0 || Double.compare(clock.getWidth(), 0.0) <= 0 || Double.compare(clock.getHeight(), 0.0) <= 0) { if (clock.getPrefWidth() > 0 && clock.getPrefHeight() > 0) { clock.setPrefSize(clock.getPrefWidth(), clock.getPrefHeight()); // depends on control dependency: [if], data = [(clock.getPrefWidth()] } else { clock.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); // depends on control dependency: [if], data = [none] } } canvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT); ctx = canvas.getGraphicsContext2D(); pane = new Pane(canvas); pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(clock.getBorderWidth())))); pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY))); getChildren().setAll(pane); } }
public class class_name { public void closeProducersDestinationDeleted() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "closeProducersDestinationDeleted"); synchronized (_producers) { _destinationDeleted = true; Iterator<MessageProducer> i = _producers.iterator(); while(i.hasNext()) { ProducerSessionImpl producerSessionImpl = (ProducerSessionImpl) i.next(); // Close the producer session, indicating that it has been closed due to delete producerSessionImpl._closeProducerDestinationDeleted(); // Remove the producer session from the Producers ArrayList i.remove(); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "closeProducersDestinationDeleted"); } }
public class class_name { public void closeProducersDestinationDeleted() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "closeProducersDestinationDeleted"); synchronized (_producers) { _destinationDeleted = true; Iterator<MessageProducer> i = _producers.iterator(); while(i.hasNext()) { ProducerSessionImpl producerSessionImpl = (ProducerSessionImpl) i.next(); // Close the producer session, indicating that it has been closed due to delete producerSessionImpl._closeProducerDestinationDeleted(); // depends on control dependency: [while], data = [none] // Remove the producer session from the Producers ArrayList i.remove(); // depends on control dependency: [while], data = [none] } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "closeProducersDestinationDeleted"); } }
public class class_name { protected static boolean nameMatches(EObject element, String pattern) { if (element instanceof RuleCall) { return nameMatches(((RuleCall) element).getRule(), pattern); } if (element instanceof AbstractRule) { final String name = ((AbstractRule) element).getName(); final Pattern compilerPattern = Pattern.compile(pattern); final Matcher matcher = compilerPattern.matcher(name); if (matcher.find()) { return true; } } return false; } }
public class class_name { protected static boolean nameMatches(EObject element, String pattern) { if (element instanceof RuleCall) { return nameMatches(((RuleCall) element).getRule(), pattern); // depends on control dependency: [if], data = [none] } if (element instanceof AbstractRule) { final String name = ((AbstractRule) element).getName(); final Pattern compilerPattern = Pattern.compile(pattern); final Matcher matcher = compilerPattern.matcher(name); if (matcher.find()) { return true; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { public String findMostSpecific(String attributeType) { // Initialize internal state. pos = 0; beg = 0; end = 0; cur = 0; chars = dn.toCharArray(); String attType = nextAT(); if (attType == null) { return null; } while (true) { String attValue = ""; if (pos == length) { return null; } switch (chars[pos]) { case '"': attValue = quotedAV(); break; case '#': attValue = hexAV(); break; case '+': case ',': case ';': // compatibility with RFC 1779: semicolon can separate RDNs //empty attribute value break; default: attValue = escapedAV(); } // Values are ordered from most specific to least specific // due to the RFC2253 formatting. So take the first match // we see. if (attributeType.equalsIgnoreCase(attType)) { return attValue; } if (pos >= length) { return null; } if (chars[pos] == ',' || chars[pos] == ';') { } else if (chars[pos] != '+') { throw new IllegalStateException("Malformed DN: " + dn); } pos++; attType = nextAT(); if (attType == null) { throw new IllegalStateException("Malformed DN: " + dn); } } } }
public class class_name { public String findMostSpecific(String attributeType) { // Initialize internal state. pos = 0; beg = 0; end = 0; cur = 0; chars = dn.toCharArray(); String attType = nextAT(); if (attType == null) { return null; // depends on control dependency: [if], data = [none] } while (true) { String attValue = ""; if (pos == length) { return null; // depends on control dependency: [if], data = [none] } switch (chars[pos]) { case '"': attValue = quotedAV(); break; case '#': attValue = hexAV(); break; case '+': case ',': case ';': // compatibility with RFC 1779: semicolon can separate RDNs //empty attribute value break; default: attValue = escapedAV(); } // Values are ordered from most specific to least specific // due to the RFC2253 formatting. So take the first match // we see. if (attributeType.equalsIgnoreCase(attType)) { return attValue; // depends on control dependency: [if], data = [none] } if (pos >= length) { return null; // depends on control dependency: [if], data = [none] } if (chars[pos] == ',' || chars[pos] == ';') { } else if (chars[pos] != '+') { throw new IllegalStateException("Malformed DN: " + dn); } pos++; attType = nextAT(); if (attType == null) { throw new IllegalStateException("Malformed DN: " + dn); } } } }
public class class_name { public void marshall(LogsSummary logsSummary, ProtocolMarshaller protocolMarshaller) { if (logsSummary == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(logsSummary.getAudit(), AUDIT_BINDING); protocolMarshaller.marshall(logsSummary.getAuditLogGroup(), AUDITLOGGROUP_BINDING); protocolMarshaller.marshall(logsSummary.getGeneral(), GENERAL_BINDING); protocolMarshaller.marshall(logsSummary.getGeneralLogGroup(), GENERALLOGGROUP_BINDING); protocolMarshaller.marshall(logsSummary.getPending(), PENDING_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(LogsSummary logsSummary, ProtocolMarshaller protocolMarshaller) { if (logsSummary == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(logsSummary.getAudit(), AUDIT_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(logsSummary.getAuditLogGroup(), AUDITLOGGROUP_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(logsSummary.getGeneral(), GENERAL_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(logsSummary.getGeneralLogGroup(), GENERALLOGGROUP_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(logsSummary.getPending(), PENDING_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 { static public void registerTransformMaybe( String transformName, String className) { Class c; try { c = Class.forName( className); } catch (ClassNotFoundException e) { if (loadWarnings) log.warn("Coordinate Transform Class "+className+" not found."); return; } registerTransform( transformName, c); } }
public class class_name { static public void registerTransformMaybe( String transformName, String className) { Class c; try { c = Class.forName( className); // depends on control dependency: [try], data = [none] } catch (ClassNotFoundException e) { if (loadWarnings) log.warn("Coordinate Transform Class "+className+" not found."); return; } // depends on control dependency: [catch], data = [none] registerTransform( transformName, c); } }
public class class_name { synchronized void breakLinks() { if (links != null) { final Link[] l = links.clearLinks(); if (l != null) { final int len = l.length; for (int i = 0; i < len; i++) { // send exit "from" remote pids to local ones self.deliver(new OtpMsg(OtpMsg.exitTag, l[i].remote(), l[i] .local(), new OtpErlangAtom("noconnection"))); } } } } }
public class class_name { synchronized void breakLinks() { if (links != null) { final Link[] l = links.clearLinks(); if (l != null) { final int len = l.length; for (int i = 0; i < len; i++) { // send exit "from" remote pids to local ones self.deliver(new OtpMsg(OtpMsg.exitTag, l[i].remote(), l[i] .local(), new OtpErlangAtom("noconnection"))); // depends on control dependency: [for], data = [i] } } } } }
public class class_name { public void marshall(ApplicationSettingsResponse applicationSettingsResponse, ProtocolMarshaller protocolMarshaller) { if (applicationSettingsResponse == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(applicationSettingsResponse.getEnabled(), ENABLED_BINDING); protocolMarshaller.marshall(applicationSettingsResponse.getSettingsGroup(), SETTINGSGROUP_BINDING); protocolMarshaller.marshall(applicationSettingsResponse.getS3BucketName(), S3BUCKETNAME_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(ApplicationSettingsResponse applicationSettingsResponse, ProtocolMarshaller protocolMarshaller) { if (applicationSettingsResponse == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(applicationSettingsResponse.getEnabled(), ENABLED_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(applicationSettingsResponse.getSettingsGroup(), SETTINGSGROUP_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(applicationSettingsResponse.getS3BucketName(), S3BUCKETNAME_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 reset(Connection connection, JFapByteBuffer buffer, int priority, boolean isPooled, boolean isExchange, int segmentType, int conversationId, int requestNumber, Conversation conversation, SendListener sendListener, boolean isTerminal, int size) { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "reset", new Object[]{connection, buffer, ""+priority, ""+isPooled, ""+isExchange, ""+segmentType, ""+conversationId, ""+requestNumber, conversation, sendListener, ""+isTerminal, ""+size}); setFields(connection, buffer, priority, isPooled, isExchange, segmentType, conversationId, requestNumber, conversation, sendListener, isTerminal, size); int sizeIncludingHeaders = size + JFapChannelConstants.SIZEOF_PRIMARY_HEADER + JFapChannelConstants.SIZEOF_CONVERSATION_HEADER; transmissionsRemaining = true; if (sizeIncludingHeaders > connection.getMaxTransmissionSize()) { if (tc.isDebugEnabled()) SibTr.debug(this, tc, "segmenting"); layout = JFapChannelConstants.XMIT_SEGMENT_START; } else layout = JFapChannelConstants.XMIT_CONVERSATION; if (tc.isEntryEnabled()) SibTr.exit(this, tc, "reset"); } }
public class class_name { private void reset(Connection connection, JFapByteBuffer buffer, int priority, boolean isPooled, boolean isExchange, int segmentType, int conversationId, int requestNumber, Conversation conversation, SendListener sendListener, boolean isTerminal, int size) { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "reset", new Object[]{connection, buffer, ""+priority, ""+isPooled, ""+isExchange, ""+segmentType, ""+conversationId, ""+requestNumber, conversation, sendListener, ""+isTerminal, ""+size}); setFields(connection, buffer, priority, isPooled, isExchange, segmentType, conversationId, requestNumber, conversation, sendListener, isTerminal, size); int sizeIncludingHeaders = size + JFapChannelConstants.SIZEOF_PRIMARY_HEADER + JFapChannelConstants.SIZEOF_CONVERSATION_HEADER; transmissionsRemaining = true; if (sizeIncludingHeaders > connection.getMaxTransmissionSize()) { if (tc.isDebugEnabled()) SibTr.debug(this, tc, "segmenting"); layout = JFapChannelConstants.XMIT_SEGMENT_START; // depends on control dependency: [if], data = [none] } else layout = JFapChannelConstants.XMIT_CONVERSATION; if (tc.isEntryEnabled()) SibTr.exit(this, tc, "reset"); } }
public class class_name { public static boolean hasAnnotation(ExecutableElement method, Class<? extends Annotation> ann) { List<? extends AnnotationMirror> annotationMirrors = method.getAnnotationMirrors(); for (AnnotationMirror annotationMirror : annotationMirrors) { if (annotationMirror.getAnnotationType().toString().equals(ann.getName())) { return true; } } return false; } }
public class class_name { public static boolean hasAnnotation(ExecutableElement method, Class<? extends Annotation> ann) { List<? extends AnnotationMirror> annotationMirrors = method.getAnnotationMirrors(); for (AnnotationMirror annotationMirror : annotationMirrors) { if (annotationMirror.getAnnotationType().toString().equals(ann.getName())) { return true; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { private void removeEntriesStartingWith(String key) { synchronized (eventMap) { Iterator<String> iter = eventMap.keySet().iterator(); while (iter.hasNext()) { String str = iter.next(); if (str.startsWith(key)) { iter.remove(); } } } } }
public class class_name { private void removeEntriesStartingWith(String key) { synchronized (eventMap) { Iterator<String> iter = eventMap.keySet().iterator(); while (iter.hasNext()) { String str = iter.next(); if (str.startsWith(key)) { iter.remove(); // depends on control dependency: [if], data = [none] } } } } }
public class class_name { public Map<String, Group> getGroupsForUser(String userId) { ApiResponse response = apiRequest(HttpMethod.GET, null, null, organizationId, applicationId, "users", userId, "groups"); Map<String, Group> groupMap = new HashMap<String, Group>(); if (response != null) { List<Group> groups = response.getEntities(Group.class); for (Group group : groups) { groupMap.put(group.getPath(), group); } } return groupMap; } }
public class class_name { public Map<String, Group> getGroupsForUser(String userId) { ApiResponse response = apiRequest(HttpMethod.GET, null, null, organizationId, applicationId, "users", userId, "groups"); Map<String, Group> groupMap = new HashMap<String, Group>(); if (response != null) { List<Group> groups = response.getEntities(Group.class); for (Group group : groups) { groupMap.put(group.getPath(), group); // depends on control dependency: [for], data = [group] } } return groupMap; } }
public class class_name { public void redo() { if (isListChange()) { LOGGER.trace("Redoing list change: " + newList.get().toString()); setting.valueProperty().setValue(newList.get()); } else { setting.valueProperty().setValue(newValue.get()); } } }
public class class_name { public void redo() { if (isListChange()) { LOGGER.trace("Redoing list change: " + newList.get().toString()); // depends on control dependency: [if], data = [none] setting.valueProperty().setValue(newList.get()); // depends on control dependency: [if], data = [none] } else { setting.valueProperty().setValue(newValue.get()); // depends on control dependency: [if], data = [none] } } }
public class class_name { private static void insideAlgorithm(final double[][] scores, final ProjTreeChart inChart, boolean singleRoot) { final int n = scores.length; final int startIdx = singleRoot ? 1 : 0; // Initialize. for (int s = 0; s < n; s++) { inChart.setScore(s, s, RIGHT, COMPLETE, 0.0); inChart.setScore(s, s, LEFT, COMPLETE, 0.0); } // Parse. for (int width = 1; width < n; width++) { for (int s = startIdx; s < n - width; s++) { int t = s + width; // First create incomplete items. for (int r=s; r<t; r++) { for (int d=0; d<2; d++) { double edgeScore = (d==LEFT) ? scores[t][s] : scores[s][t]; double score = inChart.getScore(s, r, RIGHT, COMPLETE) + inChart.getScore(r+1, t, LEFT, COMPLETE) + edgeScore; inChart.updateCell(s, t, d, INCOMPLETE, score, r); } } // Second create complete items. // -- Left side. for (int r=s; r<t; r++) { final int d = LEFT; double score = inChart.getScore(s, r, d, COMPLETE) + inChart.getScore(r, t, d, INCOMPLETE); inChart.updateCell(s, t, d, COMPLETE, score, r); } // -- Right side. for (int r=s+1; r<=t; r++) { final int d = RIGHT; double score = inChart.getScore(s, r, d, INCOMPLETE) + inChart.getScore(r, t, d, COMPLETE); inChart.updateCell(s, t, d, COMPLETE, score, r); } } } if (singleRoot) { // Build goal constituents by combining left and right complete // constituents, on the left and right respectively. This corresponds to // left and right triangles. (Note: this is the opposite of how we // build an incomplete constituent.) for (int r=1; r<n; r++) { double score = inChart.getScore(1, r, LEFT, COMPLETE) + inChart.getScore(r, n-1, RIGHT, COMPLETE) + scores[0][r]; inChart.updateCell(0, r, RIGHT, INCOMPLETE, score, r); inChart.updateCell(0, n-1, RIGHT, COMPLETE, score, r); } } } }
public class class_name { private static void insideAlgorithm(final double[][] scores, final ProjTreeChart inChart, boolean singleRoot) { final int n = scores.length; final int startIdx = singleRoot ? 1 : 0; // Initialize. for (int s = 0; s < n; s++) { inChart.setScore(s, s, RIGHT, COMPLETE, 0.0); // depends on control dependency: [for], data = [s] inChart.setScore(s, s, LEFT, COMPLETE, 0.0); // depends on control dependency: [for], data = [s] } // Parse. for (int width = 1; width < n; width++) { for (int s = startIdx; s < n - width; s++) { int t = s + width; // First create incomplete items. for (int r=s; r<t; r++) { for (int d=0; d<2; d++) { double edgeScore = (d==LEFT) ? scores[t][s] : scores[s][t]; double score = inChart.getScore(s, r, RIGHT, COMPLETE) + inChart.getScore(r+1, t, LEFT, COMPLETE) + edgeScore; inChart.updateCell(s, t, d, INCOMPLETE, score, r); // depends on control dependency: [for], data = [d] } } // Second create complete items. // -- Left side. for (int r=s; r<t; r++) { final int d = LEFT; double score = inChart.getScore(s, r, d, COMPLETE) + inChart.getScore(r, t, d, INCOMPLETE); inChart.updateCell(s, t, d, COMPLETE, score, r); // depends on control dependency: [for], data = [r] } // -- Right side. for (int r=s+1; r<=t; r++) { final int d = RIGHT; double score = inChart.getScore(s, r, d, INCOMPLETE) + inChart.getScore(r, t, d, COMPLETE); inChart.updateCell(s, t, d, COMPLETE, score, r); // depends on control dependency: [for], data = [r] } } } if (singleRoot) { // Build goal constituents by combining left and right complete // constituents, on the left and right respectively. This corresponds to // left and right triangles. (Note: this is the opposite of how we // build an incomplete constituent.) for (int r=1; r<n; r++) { double score = inChart.getScore(1, r, LEFT, COMPLETE) + inChart.getScore(r, n-1, RIGHT, COMPLETE) + scores[0][r]; inChart.updateCell(0, r, RIGHT, INCOMPLETE, score, r); // depends on control dependency: [for], data = [r] inChart.updateCell(0, n-1, RIGHT, COMPLETE, score, r); // depends on control dependency: [for], data = [r] } } } }
public class class_name { @Bean public ServiceQueue clusteredEventManagerServiceQueue(final @Qualifier("eventBusCluster") EventBusCluster eventBusCluster) { if (eventBusCluster == null) { return null; } return eventBusCluster.eventServiceQueue(); } }
public class class_name { @Bean public ServiceQueue clusteredEventManagerServiceQueue(final @Qualifier("eventBusCluster") EventBusCluster eventBusCluster) { if (eventBusCluster == null) { return null; // depends on control dependency: [if], data = [none] } return eventBusCluster.eventServiceQueue(); } }
public class class_name { @SuppressWarnings("unchecked") static <T extends JUnitWatcher> Optional<T> getAttachedWatcher(Class<T> watcherType) { if (RunnerWatcher.class.isAssignableFrom(watcherType)) { synchronized(runnerWatcherLoader) { for (RunnerWatcher watcher : runnerWatcherLoader) { if (watcher.getClass() == watcherType) { return Optional.of((T) watcher); } } } } return Optional.absent(); } }
public class class_name { @SuppressWarnings("unchecked") static <T extends JUnitWatcher> Optional<T> getAttachedWatcher(Class<T> watcherType) { if (RunnerWatcher.class.isAssignableFrom(watcherType)) { synchronized(runnerWatcherLoader) { // depends on control dependency: [if], data = [none] for (RunnerWatcher watcher : runnerWatcherLoader) { if (watcher.getClass() == watcherType) { return Optional.of((T) watcher); // depends on control dependency: [if], data = [none] } } } } return Optional.absent(); } }
public class class_name { @Override public String selectInitialBundle(Object o) { if (o instanceof String) { String processName = (String)o; for (ProcessDefinition processDefinition :m_queueProcessmanager.getVisibleProcesses(m_permissionManager)) { if (processDefinition.getName().equals(processName)) { m_bundleManager.setBundle(processDefinition.getVersion()); return processDefinition.getVersion(); } } } m_bundleManager.setBundle("order-workflow"); log.debug("Selected bundle order-workflow"); return "order-workflow"; } }
public class class_name { @Override public String selectInitialBundle(Object o) { if (o instanceof String) { String processName = (String)o; for (ProcessDefinition processDefinition :m_queueProcessmanager.getVisibleProcesses(m_permissionManager)) { if (processDefinition.getName().equals(processName)) { m_bundleManager.setBundle(processDefinition.getVersion()); // depends on control dependency: [if], data = [none] return processDefinition.getVersion(); // depends on control dependency: [if], data = [none] } } } m_bundleManager.setBundle("order-workflow"); log.debug("Selected bundle order-workflow"); return "order-workflow"; } }
public class class_name { @Override protected void resizeDynamicText() { double maxWidth = width - size * 0.1; double fontSize = size * 0.3; timeText.setFont(Fonts.latoRegular(fontSize)); timeText.setText(timeFormatter.format(tile.getTime())); Helper.adjustTextSize(timeText, maxWidth, fontSize); timeText.setX((width - timeText.getLayoutBounds().getWidth()) * 0.5); timeText.setY(size * 0.35); //maxWidth = width - size * 0.1; fontSize = size * 0.1; dayOfWeekText.setFont(Fonts.latoRegular(fontSize)); if (dayOfWeekText.getLayoutBounds().getWidth() > maxWidth) { Helper.adjustTextSize(dayOfWeekText, maxWidth, fontSize); } dayOfWeekText.setX(size * 0.05); dayOfWeekText.setY(height - size * 0.275); dayOfWeekText.setY(timeRect.getLayoutBounds().getMaxY() + size * 0.11); //maxWidth = width - size * 0.1; dateText.setFont(Fonts.latoRegular(fontSize)); if (dateText.getLayoutBounds().getWidth() > maxWidth) { Helper.adjustTextSize(dateText, maxWidth, fontSize); } dateText.setX(size * 0.05); dateText.setY(height - size * 0.15); dateText.setY(timeRect.getLayoutBounds().getMaxY() + size * 0.235); } }
public class class_name { @Override protected void resizeDynamicText() { double maxWidth = width - size * 0.1; double fontSize = size * 0.3; timeText.setFont(Fonts.latoRegular(fontSize)); timeText.setText(timeFormatter.format(tile.getTime())); Helper.adjustTextSize(timeText, maxWidth, fontSize); timeText.setX((width - timeText.getLayoutBounds().getWidth()) * 0.5); timeText.setY(size * 0.35); //maxWidth = width - size * 0.1; fontSize = size * 0.1; dayOfWeekText.setFont(Fonts.latoRegular(fontSize)); if (dayOfWeekText.getLayoutBounds().getWidth() > maxWidth) { Helper.adjustTextSize(dayOfWeekText, maxWidth, fontSize); } // depends on control dependency: [if], data = [none] dayOfWeekText.setX(size * 0.05); dayOfWeekText.setY(height - size * 0.275); dayOfWeekText.setY(timeRect.getLayoutBounds().getMaxY() + size * 0.11); //maxWidth = width - size * 0.1; dateText.setFont(Fonts.latoRegular(fontSize)); if (dateText.getLayoutBounds().getWidth() > maxWidth) { Helper.adjustTextSize(dateText, maxWidth, fontSize); } // depends on control dependency: [if], data = [none] dateText.setX(size * 0.05); dateText.setY(height - size * 0.15); dateText.setY(timeRect.getLayoutBounds().getMaxY() + size * 0.235); } }
public class class_name { private int getMediumInt(byte b1, byte b2, byte b3) { int ret = b1 << 16 & 0xff0000 | b2 << 8 & 0xff00 | b3 & 0xff; // Check to see if the medium int is negative (high bit in b1 set) if ((b1 & 0x80) == 0x80) { // Make the the whole int negative ret |= 0xff000000; } return ret; } }
public class class_name { private int getMediumInt(byte b1, byte b2, byte b3) { int ret = b1 << 16 & 0xff0000 | b2 << 8 & 0xff00 | b3 & 0xff; // Check to see if the medium int is negative (high bit in b1 set) if ((b1 & 0x80) == 0x80) { // Make the the whole int negative ret |= 0xff000000; // depends on control dependency: [if], data = [none] } return ret; } }
public class class_name { protected ExtensionHttpSessions getExtensionHttpSessions() { if(extensionHttpSessions==null){ extensionHttpSessions = Control.getSingleton().getExtensionLoader().getExtension(ExtensionHttpSessions.class); } return extensionHttpSessions; } }
public class class_name { protected ExtensionHttpSessions getExtensionHttpSessions() { if(extensionHttpSessions==null){ extensionHttpSessions = Control.getSingleton().getExtensionLoader().getExtension(ExtensionHttpSessions.class); // depends on control dependency: [if], data = [none] } return extensionHttpSessions; } }
public class class_name { public static void annotate(String... keyValueSequence) { TracyThreadContext ctx = threadContext.get(); if (isValidContext(ctx)) { ctx.annotate(keyValueSequence); } } }
public class class_name { public static void annotate(String... keyValueSequence) { TracyThreadContext ctx = threadContext.get(); if (isValidContext(ctx)) { ctx.annotate(keyValueSequence); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static Mono<Void> waitForCompletion(CloudFoundryClient cloudFoundryClient, Duration completionTimeout, JobEntity jobEntity) { Mono<JobEntity> job; if (JobUtils.isComplete(jobEntity)) { job = Mono.just(jobEntity); } else { job = requestJobV2(cloudFoundryClient, jobEntity.getId()) .map(GetJobResponse::getEntity) .filter(JobUtils::isComplete) .repeatWhenEmpty(exponentialBackOff(Duration.ofSeconds(1), Duration.ofSeconds(15), completionTimeout)); } return job .filter(entity -> "failed".equals(entity.getStatus())) .flatMap(JobUtils::getError); } }
public class class_name { public static Mono<Void> waitForCompletion(CloudFoundryClient cloudFoundryClient, Duration completionTimeout, JobEntity jobEntity) { Mono<JobEntity> job; if (JobUtils.isComplete(jobEntity)) { job = Mono.just(jobEntity); // depends on control dependency: [if], data = [none] } else { job = requestJobV2(cloudFoundryClient, jobEntity.getId()) .map(GetJobResponse::getEntity) .filter(JobUtils::isComplete) .repeatWhenEmpty(exponentialBackOff(Duration.ofSeconds(1), Duration.ofSeconds(15), completionTimeout)); // depends on control dependency: [if], data = [none] } return job .filter(entity -> "failed".equals(entity.getStatus())) .flatMap(JobUtils::getError); } }
public class class_name { private DefBase getDefForLevel(String level) { if (LEVEL_CLASS.equals(level)) { return _curClassDef; } else if (LEVEL_FIELD.equals(level)) { return _curFieldDef; } else if (LEVEL_REFERENCE.equals(level)) { return _curReferenceDef; } else if (LEVEL_COLLECTION.equals(level)) { return _curCollectionDef; } else if (LEVEL_OBJECT_CACHE.equals(level)) { return _curObjectCacheDef; } else if (LEVEL_INDEX_DESC.equals(level)) { return _curIndexDescriptorDef; } else if (LEVEL_TABLE.equals(level)) { return _curTableDef; } else if (LEVEL_COLUMN.equals(level)) { return _curColumnDef; } else if (LEVEL_FOREIGNKEY.equals(level)) { return _curForeignkeyDef; } else if (LEVEL_INDEX.equals(level)) { return _curIndexDef; } else if (LEVEL_PROCEDURE.equals(level)) { return _curProcedureDef; } else if (LEVEL_PROCEDURE_ARGUMENT.equals(level)) { return _curProcedureArgumentDef; } else { return null; } } }
public class class_name { private DefBase getDefForLevel(String level) { if (LEVEL_CLASS.equals(level)) { return _curClassDef; // depends on control dependency: [if], data = [none] } else if (LEVEL_FIELD.equals(level)) { return _curFieldDef; // depends on control dependency: [if], data = [none] } else if (LEVEL_REFERENCE.equals(level)) { return _curReferenceDef; // depends on control dependency: [if], data = [none] } else if (LEVEL_COLLECTION.equals(level)) { return _curCollectionDef; // depends on control dependency: [if], data = [none] } else if (LEVEL_OBJECT_CACHE.equals(level)) { return _curObjectCacheDef; // depends on control dependency: [if], data = [none] } else if (LEVEL_INDEX_DESC.equals(level)) { return _curIndexDescriptorDef; // depends on control dependency: [if], data = [none] } else if (LEVEL_TABLE.equals(level)) { return _curTableDef; // depends on control dependency: [if], data = [none] } else if (LEVEL_COLUMN.equals(level)) { return _curColumnDef; // depends on control dependency: [if], data = [none] } else if (LEVEL_FOREIGNKEY.equals(level)) { return _curForeignkeyDef; // depends on control dependency: [if], data = [none] } else if (LEVEL_INDEX.equals(level)) { return _curIndexDef; // depends on control dependency: [if], data = [none] } else if (LEVEL_PROCEDURE.equals(level)) { return _curProcedureDef; // depends on control dependency: [if], data = [none] } else if (LEVEL_PROCEDURE_ARGUMENT.equals(level)) { return _curProcedureArgumentDef; // depends on control dependency: [if], data = [none] } else { return null; // depends on control dependency: [if], data = [none] } } }
public class class_name { Caffeine<Object, Object> toBuilder() { Caffeine<Object, Object> builder = Caffeine.newBuilder(); if (initialCapacity != UNSET_INT) { builder.initialCapacity(initialCapacity); } if (maximumSize != UNSET_INT) { builder.maximumSize(maximumSize); } if (maximumWeight != UNSET_INT) { builder.maximumWeight(maximumWeight); } if (keyStrength != null) { requireState(keyStrength == Strength.WEAK); builder.weakKeys(); } if (valueStrength != null) { if (valueStrength == Strength.WEAK) { builder.weakValues(); } else if (valueStrength == Strength.SOFT) { builder.softValues(); } else { throw new IllegalStateException(); } } if (expireAfterAccessTimeUnit != null) { builder.expireAfterAccess(expireAfterAccessDuration, expireAfterAccessTimeUnit); } if (expireAfterWriteTimeUnit != null) { builder.expireAfterWrite(expireAfterWriteDuration, expireAfterWriteTimeUnit); } if (refreshAfterWriteTimeUnit != null) { builder.refreshAfterWrite(refreshAfterWriteDuration, refreshAfterWriteTimeUnit); } if (recordStats) { builder.recordStats(); } return builder; } }
public class class_name { Caffeine<Object, Object> toBuilder() { Caffeine<Object, Object> builder = Caffeine.newBuilder(); if (initialCapacity != UNSET_INT) { builder.initialCapacity(initialCapacity); // depends on control dependency: [if], data = [(initialCapacity] } if (maximumSize != UNSET_INT) { builder.maximumSize(maximumSize); // depends on control dependency: [if], data = [(maximumSize] } if (maximumWeight != UNSET_INT) { builder.maximumWeight(maximumWeight); // depends on control dependency: [if], data = [(maximumWeight] } if (keyStrength != null) { requireState(keyStrength == Strength.WEAK); // depends on control dependency: [if], data = [(keyStrength] builder.weakKeys(); // depends on control dependency: [if], data = [none] } if (valueStrength != null) { if (valueStrength == Strength.WEAK) { builder.weakValues(); // depends on control dependency: [if], data = [none] } else if (valueStrength == Strength.SOFT) { builder.softValues(); // depends on control dependency: [if], data = [none] } else { throw new IllegalStateException(); } } if (expireAfterAccessTimeUnit != null) { builder.expireAfterAccess(expireAfterAccessDuration, expireAfterAccessTimeUnit); // depends on control dependency: [if], data = [none] } if (expireAfterWriteTimeUnit != null) { builder.expireAfterWrite(expireAfterWriteDuration, expireAfterWriteTimeUnit); // depends on control dependency: [if], data = [none] } if (refreshAfterWriteTimeUnit != null) { builder.refreshAfterWrite(refreshAfterWriteDuration, refreshAfterWriteTimeUnit); // depends on control dependency: [if], data = [none] } if (recordStats) { builder.recordStats(); // depends on control dependency: [if], data = [none] } return builder; } }
public class class_name { public List<FormListing> getDescendantsSynchronized( Form ... formToGetDescendantsForParam) { if(formToGetDescendantsForParam == null || formToGetDescendantsForParam.length == 0) { return null; } //Start a new request... String uniqueReqId = this.initNewRequest(); //Mass data fetch... int numberOfSentForms = 0; if(this.massFetch) { FormListing listingToSend = new FormListing(); List<Form> listOfValidForms = new ArrayList(); for(Form formToSend : formToGetDescendantsForParam) { if(formToSend == null) { throw new FluidClientException( "Cannot provide 'null' for Form.", FluidClientException.ErrorCode.ILLEGAL_STATE_ERROR); } listOfValidForms.add(new Form(formToSend.getId())); } listingToSend.setEcho(UUID.randomUUID().toString()); listingToSend.setListing(listOfValidForms); //Send the actual message... this.sendMessage(listingToSend, uniqueReqId); numberOfSentForms++; } else { //Single... //Send all the messages... for(Form formToSend : formToGetDescendantsForParam) { this.setEchoIfNotSet(formToSend); //Send the actual message... this.sendMessage(formToSend, uniqueReqId); numberOfSentForms++; } } try { List<FormListing> returnValue = this.getHandler(uniqueReqId).getCF().get( this.getTimeoutInMillis(), TimeUnit.MILLISECONDS); //Connection was closed.. this is a problem.... if(this.getHandler(uniqueReqId).isConnectionClosed()) { throw new FluidClientException( "SQLUtil-WebSocket-GetDescendants: " + "The connection was closed by the server prior to the response received.", FluidClientException.ErrorCode.IO_ERROR); } return returnValue; } catch (InterruptedException exceptParam) { //Interrupted... throw new FluidClientException( "SQLUtil-WebSocket-Interrupted-GetDescendants: " + exceptParam.getMessage(), exceptParam, FluidClientException.ErrorCode.STATEMENT_EXECUTION_ERROR); } catch (ExecutionException executeProblem) { //Error on the web-socket... Throwable cause = executeProblem.getCause(); //Fluid client exception... if(cause instanceof FluidClientException) { throw (FluidClientException)cause; } else { throw new FluidClientException( "SQLUtil-WebSocket-GetDescendants: " + cause.getMessage(), cause, FluidClientException.ErrorCode.STATEMENT_EXECUTION_ERROR); } } catch (TimeoutException eParam) { //Timeout... String errMessage = this.getExceptionMessageVerbose( "SQLUtil-WebSocket-GetDescendants", uniqueReqId, numberOfSentForms); throw new FluidClientException( errMessage, FluidClientException.ErrorCode.IO_ERROR); } finally { this.removeHandler(uniqueReqId); } } }
public class class_name { public List<FormListing> getDescendantsSynchronized( Form ... formToGetDescendantsForParam) { if(formToGetDescendantsForParam == null || formToGetDescendantsForParam.length == 0) { return null; // depends on control dependency: [if], data = [none] } //Start a new request... String uniqueReqId = this.initNewRequest(); //Mass data fetch... int numberOfSentForms = 0; if(this.massFetch) { FormListing listingToSend = new FormListing(); List<Form> listOfValidForms = new ArrayList(); for(Form formToSend : formToGetDescendantsForParam) { if(formToSend == null) { throw new FluidClientException( "Cannot provide 'null' for Form.", FluidClientException.ErrorCode.ILLEGAL_STATE_ERROR); } listOfValidForms.add(new Form(formToSend.getId())); // depends on control dependency: [for], data = [formToSend] } listingToSend.setEcho(UUID.randomUUID().toString()); // depends on control dependency: [if], data = [none] listingToSend.setListing(listOfValidForms); // depends on control dependency: [if], data = [none] //Send the actual message... this.sendMessage(listingToSend, uniqueReqId); // depends on control dependency: [if], data = [none] numberOfSentForms++; // depends on control dependency: [if], data = [none] } else { //Single... //Send all the messages... for(Form formToSend : formToGetDescendantsForParam) { this.setEchoIfNotSet(formToSend); // depends on control dependency: [for], data = [formToSend] //Send the actual message... this.sendMessage(formToSend, uniqueReqId); // depends on control dependency: [for], data = [formToSend] numberOfSentForms++; // depends on control dependency: [for], data = [none] } } try { List<FormListing> returnValue = this.getHandler(uniqueReqId).getCF().get( this.getTimeoutInMillis(), TimeUnit.MILLISECONDS); //Connection was closed.. this is a problem.... if(this.getHandler(uniqueReqId).isConnectionClosed()) { throw new FluidClientException( "SQLUtil-WebSocket-GetDescendants: " + "The connection was closed by the server prior to the response received.", FluidClientException.ErrorCode.IO_ERROR); } return returnValue; // depends on control dependency: [try], data = [none] } catch (InterruptedException exceptParam) { //Interrupted... throw new FluidClientException( "SQLUtil-WebSocket-Interrupted-GetDescendants: " + exceptParam.getMessage(), exceptParam, FluidClientException.ErrorCode.STATEMENT_EXECUTION_ERROR); } catch (ExecutionException executeProblem) { // depends on control dependency: [catch], data = [none] //Error on the web-socket... Throwable cause = executeProblem.getCause(); //Fluid client exception... if(cause instanceof FluidClientException) { throw (FluidClientException)cause; } else { throw new FluidClientException( "SQLUtil-WebSocket-GetDescendants: " + cause.getMessage(), cause, FluidClientException.ErrorCode.STATEMENT_EXECUTION_ERROR); } } catch (TimeoutException eParam) { // depends on control dependency: [catch], data = [none] //Timeout... String errMessage = this.getExceptionMessageVerbose( "SQLUtil-WebSocket-GetDescendants", uniqueReqId, numberOfSentForms); throw new FluidClientException( errMessage, FluidClientException.ErrorCode.IO_ERROR); } finally { // depends on control dependency: [catch], data = [none] this.removeHandler(uniqueReqId); } } }
public class class_name { public static final double gammaln(double x) { double ser = 1.00000000090015; double y = x; double tmp = x + 5.5; tmp -= (x + 0.5) * Math.log(tmp); for (int j = 0; j < 5; j++) { ser += COFGAMMALN[j] / ++y; } return -tmp + Math.log(ser * 2.5066282751072975 / x); } }
public class class_name { public static final double gammaln(double x) { double ser = 1.00000000090015; double y = x; double tmp = x + 5.5; tmp -= (x + 0.5) * Math.log(tmp); for (int j = 0; j < 5; j++) { ser += COFGAMMALN[j] / ++y; // depends on control dependency: [for], data = [j] } return -tmp + Math.log(ser * 2.5066282751072975 / x); } }
public class class_name { @Override public void prepare(Map conf) { _admins = new HashSet<String>(); _supervisors = new HashSet<String>(); _nimbusUsers = new HashSet<String>(); _nimbusGroups = new HashSet<String>(); if (conf.containsKey(Config.NIMBUS_ADMINS)) { _admins.addAll((Collection<String>) conf.get(Config.NIMBUS_ADMINS)); } if (conf.containsKey(Config.NIMBUS_SUPERVISOR_USERS)) { _supervisors.addAll((Collection<String>) conf.get(Config.NIMBUS_SUPERVISOR_USERS)); } if (conf.containsKey(Config.NIMBUS_USERS)) { _nimbusUsers.addAll((Collection<String>) conf.get(Config.NIMBUS_USERS)); } if (conf.containsKey(Config.NIMBUS_GROUPS)) { _nimbusGroups.addAll((Collection<String>) conf.get(Config.NIMBUS_GROUPS)); } _ptol = AuthUtils.GetPrincipalToLocalPlugin(conf); _groupMappingProvider = AuthUtils.GetGroupMappingServiceProviderPlugin(conf); } }
public class class_name { @Override public void prepare(Map conf) { _admins = new HashSet<String>(); _supervisors = new HashSet<String>(); _nimbusUsers = new HashSet<String>(); _nimbusGroups = new HashSet<String>(); if (conf.containsKey(Config.NIMBUS_ADMINS)) { _admins.addAll((Collection<String>) conf.get(Config.NIMBUS_ADMINS)); // depends on control dependency: [if], data = [none] } if (conf.containsKey(Config.NIMBUS_SUPERVISOR_USERS)) { _supervisors.addAll((Collection<String>) conf.get(Config.NIMBUS_SUPERVISOR_USERS)); // depends on control dependency: [if], data = [none] } if (conf.containsKey(Config.NIMBUS_USERS)) { _nimbusUsers.addAll((Collection<String>) conf.get(Config.NIMBUS_USERS)); // depends on control dependency: [if], data = [none] } if (conf.containsKey(Config.NIMBUS_GROUPS)) { _nimbusGroups.addAll((Collection<String>) conf.get(Config.NIMBUS_GROUPS)); // depends on control dependency: [if], data = [none] } _ptol = AuthUtils.GetPrincipalToLocalPlugin(conf); _groupMappingProvider = AuthUtils.GetGroupMappingServiceProviderPlugin(conf); } }
public class class_name { public static Result parse(String pAuthInfo) { StringTokenizer stok = new StringTokenizer(pAuthInfo); String method = stok.nextToken(); if (!HttpServletRequest.BASIC_AUTH.equalsIgnoreCase(method)) { throw new IllegalArgumentException("Only BasicAuthentication is supported"); } String b64Auth = stok.nextToken(); String auth = new String(Base64Util.decode(b64Auth)); int p = auth.indexOf(':'); String user; String password; boolean valid; if (p != -1) { user = auth.substring(0, p); password = auth.substring(p+1); valid = true; } else { valid = false; user = null; password = null; } return new Result(method,user,password,valid); } }
public class class_name { public static Result parse(String pAuthInfo) { StringTokenizer stok = new StringTokenizer(pAuthInfo); String method = stok.nextToken(); if (!HttpServletRequest.BASIC_AUTH.equalsIgnoreCase(method)) { throw new IllegalArgumentException("Only BasicAuthentication is supported"); } String b64Auth = stok.nextToken(); String auth = new String(Base64Util.decode(b64Auth)); int p = auth.indexOf(':'); String user; String password; boolean valid; if (p != -1) { user = auth.substring(0, p); // depends on control dependency: [if], data = [none] password = auth.substring(p+1); // depends on control dependency: [if], data = [(p] valid = true; // depends on control dependency: [if], data = [none] } else { valid = false; // depends on control dependency: [if], data = [none] user = null; // depends on control dependency: [if], data = [none] password = null; // depends on control dependency: [if], data = [none] } return new Result(method,user,password,valid); } }
public class class_name { private Tuple<String,String> getEntry( final String key, final Collection<String> prefixes ) { if ( CollectionUtils.isEmpty( prefixes ) ) { return getEntry( key ); } for( String prefix : prefixes ) { String prefixedKey = prefix + "." + key; Tuple<String,String> override = getOverrideEntry( prefixedKey ); if ( override != null ) { return override; } // // Above we were checking overrides of the override. Here, // just check for the first override. If that doesn't work, // then we need to just pass it on and ignore the specified override. // String value = getPropertyValue( prefixedKey ); if ( value != null ) { return new Tuple<String,String>( prefixedKey, value ); } } // // No prefixed overrides were found, so drop back to using // the standard, non-prefixed version // return getEntry( key ); } }
public class class_name { private Tuple<String,String> getEntry( final String key, final Collection<String> prefixes ) { if ( CollectionUtils.isEmpty( prefixes ) ) { return getEntry( key ); // depends on control dependency: [if], data = [none] } for( String prefix : prefixes ) { String prefixedKey = prefix + "." + key; Tuple<String,String> override = getOverrideEntry( prefixedKey ); if ( override != null ) { return override; // depends on control dependency: [if], data = [none] } // // Above we were checking overrides of the override. Here, // just check for the first override. If that doesn't work, // then we need to just pass it on and ignore the specified override. // String value = getPropertyValue( prefixedKey ); if ( value != null ) { return new Tuple<String,String>( prefixedKey, value ); // depends on control dependency: [if], data = [none] } } // // No prefixed overrides were found, so drop back to using // the standard, non-prefixed version // return getEntry( key ); } }
public class class_name { public static String extractAttributeEmptyCheck(Entry entry, String attributeType) { Attribute attribute = entry.get(attributeType); Attribute emptyFlagAttribute = entry.get(SchemaConstants.EMPTY_FLAG_ATTRIBUTE); boolean empty = false; try { if (attribute != null) { return attribute.getString(); } else if (emptyFlagAttribute != null) { empty = Boolean.valueOf(emptyFlagAttribute.getString()); } } catch (LdapInvalidAttributeValueException e) { throw new ObjectClassViolationException(e); } return empty ? new String() : null; } }
public class class_name { public static String extractAttributeEmptyCheck(Entry entry, String attributeType) { Attribute attribute = entry.get(attributeType); Attribute emptyFlagAttribute = entry.get(SchemaConstants.EMPTY_FLAG_ATTRIBUTE); boolean empty = false; try { if (attribute != null) { return attribute.getString(); // depends on control dependency: [if], data = [none] } else if (emptyFlagAttribute != null) { empty = Boolean.valueOf(emptyFlagAttribute.getString()); // depends on control dependency: [if], data = [(emptyFlagAttribute] } } catch (LdapInvalidAttributeValueException e) { throw new ObjectClassViolationException(e); } // depends on control dependency: [catch], data = [none] return empty ? new String() : null; } }
public class class_name { public BoxRequestsShare.GetSharedLink getSharedLinkRequest(String sharedLink, String password) { BoxSharedLinkSession session = null; if (mSession instanceof BoxSharedLinkSession) { session = (BoxSharedLinkSession)mSession; } else { session = new BoxSharedLinkSession(mSession); } session.setSharedLink(sharedLink); session.setPassword(password); BoxRequestsShare.GetSharedLink request = new BoxRequestsShare.GetSharedLink(getSharedItemsUrl(), session); return request; } }
public class class_name { public BoxRequestsShare.GetSharedLink getSharedLinkRequest(String sharedLink, String password) { BoxSharedLinkSession session = null; if (mSession instanceof BoxSharedLinkSession) { session = (BoxSharedLinkSession)mSession; // depends on control dependency: [if], data = [none] } else { session = new BoxSharedLinkSession(mSession); // depends on control dependency: [if], data = [none] } session.setSharedLink(sharedLink); session.setPassword(password); BoxRequestsShare.GetSharedLink request = new BoxRequestsShare.GetSharedLink(getSharedItemsUrl(), session); return request; } }
public class class_name { public void abort() { if (asyncHandle != 0) { int handle = asyncHandle; asyncHandle = 0; broker.callRPCAbort(handle); ZKUtil.fireEvent(new AsyncRPCAbortEvent(rpcName, target, handle)); rpcName = null; } } }
public class class_name { public void abort() { if (asyncHandle != 0) { int handle = asyncHandle; asyncHandle = 0; // depends on control dependency: [if], data = [none] broker.callRPCAbort(handle); // depends on control dependency: [if], data = [none] ZKUtil.fireEvent(new AsyncRPCAbortEvent(rpcName, target, handle)); // depends on control dependency: [if], data = [none] rpcName = null; // depends on control dependency: [if], data = [none] } } }
public class class_name { public UserAccessToken authenticate(String email, String pwd, String device) { Criteria criteria = this.dao.newCriteria(User.class) .add(Restrictions.eq("deleted", false)) .add(Restrictions.or( Restrictions.eq("email", email), Restrictions.eq("username", email) )) .add(Restrictions.eq("password", CryptManager.passwordHash(pwd))); User user = (User) criteria.uniqueResult(); if (user != null) { UserAccessToken token = this.generateAccessToken(user, device); this.session.login(token); return token; } return null; } }
public class class_name { public UserAccessToken authenticate(String email, String pwd, String device) { Criteria criteria = this.dao.newCriteria(User.class) .add(Restrictions.eq("deleted", false)) .add(Restrictions.or( Restrictions.eq("email", email), Restrictions.eq("username", email) )) .add(Restrictions.eq("password", CryptManager.passwordHash(pwd))); User user = (User) criteria.uniqueResult(); if (user != null) { UserAccessToken token = this.generateAccessToken(user, device); this.session.login(token); // depends on control dependency: [if], data = [none] return token; // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { private static List<Token> createTokens(final Map<String, String> properties) { List<Token> tokens = new ArrayList<Token>(); for (Entry<String, String> entry : properties.entrySet()) { if (entry.getKey().toLowerCase(Locale.ROOT).startsWith(FIELD_PREFIX)) { tokens.add(FormatPatternParser.parse(entry.getValue())); } } return tokens; } }
public class class_name { private static List<Token> createTokens(final Map<String, String> properties) { List<Token> tokens = new ArrayList<Token>(); for (Entry<String, String> entry : properties.entrySet()) { if (entry.getKey().toLowerCase(Locale.ROOT).startsWith(FIELD_PREFIX)) { tokens.add(FormatPatternParser.parse(entry.getValue())); // depends on control dependency: [if], data = [none] } } return tokens; } }
public class class_name { private Chart getChartFromParams(final PageParameters params) { String chartString; String themeString; Chart config; //If the showcase is started without any parameters //set the parameters to lineBasic and give us a line Chart if(params.getAllNamed().size() < 2){ PageParameters temp = new PageParameters(); temp.add("theme", "default"); temp.add("chart", "line"); setResponsePage(HomepageHighcharts.class, temp); config = new Chart("chart", new BasicLineOptions(), null); return config; } themeString = params.getAllNamed().get(0).getValue(); Theme theme = getThemeFromParams(themeString); chartString = params.getAllNamed().get(1).getValue(); if(chartString == null) { config = new Chart("chart", new BasicLineOptions(), theme); return config; } switch(chartString) { case "basicBar": config = new Chart("chart", new BasicBarOptions(), theme); break; case "splineWithSymbols": config = new Chart("chart", new SplineWithSymbolsOptions(), theme); break; case "irregularIntervals": config = new Chart("chart", new TimeDataWithIrregularIntervalsOptions(), theme); break; case "logarithmicAxis": config = new Chart("chart", new LogarithmicAxisOptions(), theme); break; case "scatter": config = new Chart("chart", new ScatterPlotOptions(), theme); break; case "area": config = new Chart("chart", new BasicAreaOptions(), theme); break; case "areaWithNegativeValues": config = new Chart("chart", new AreaWithNegativeValuesOptions(), theme); break; case "stackedAndGroupedColumn": config = new Chart("chart", new StackedAndGroupedColumnOptions(), theme); break; case "combo": config = new Chart("chart", new ComboOptions(), theme); break; case "donut": config = new Chart("chart", new DonutOptions(), theme); break; case "withDataLabels": config = new Chart("chart", new LineWithDataLabelsOptions(), theme); break; case "zoomableTimeSeries": config = new Chart("chart", new ZoomableTimeSeriesOptions(), theme); break; case "splineInverted": config = new Chart("chart", new SplineWithInvertedAxisOptions(), theme); break; case "splineWithPlotBands": config = new Chart("chart", new SplineWithPlotBandsOptions(), theme); break; case "polar": config = new Chart("chart", new PolarOptions(), theme); break; case "stackedArea": config = new Chart("chart", new StackedAreaOptions(), theme); break; case "percentageArea": config = new Chart("chart", new PercentageAreaOptions(), theme); break; case "areaMissing": config = new Chart("chart", new AreaMissingOptions(), theme); break; case "areaInverted": config = new Chart("chart", new AreaInvertedAxisOptions(), theme); break; case "areaSpline": config = new Chart("chart", new AreaSplineOptions(), theme); break; case "areaSplineRange": config = new Chart("chart", new AreaSplineRangeOptions(), theme); break; case "columnWithDrilldown": config = new Chart("chart", new ColumnWithDrilldownOptions(), theme); break; case "columnRotated": config = new Chart("chart", new ColumnWithRotatedLabelsOptions(), theme); break; case "stackedBar": config = new Chart("chart", new StackedBarOptions(), theme); break; case "barNegativeStack": config = new Chart("chart", new StackedBarOptions(), theme); break; case "basicColumn": config = new Chart("chart", new BasicColumnOptions(), theme); break; case "columnWithNegativeValues": config = new Chart("chart", new ColumnWithNegativeValuesOptions(), theme); break; case "stackedColumn": config = new Chart("chart", new StackedColumnOptions(), theme); break; case "stackedPercentage": config = new Chart("chart", new StackedPercentageOptions(), theme); break; case "basicPie": config = new Chart("chart", new BasicPieOptions(), theme); break; case "pieWithGradient": config = new Chart("chart", new PieWithGradientOptions(), theme); break; case "pieWithLegend": config = new Chart("chart", new PieWithLegendOptions(), theme); break; case "splineUpdating": config = new Chart("chart", new WicketSplineUpdatingOptions(), theme); break; case "bubble": config = new Chart("chart", new BubbleChartOptions(), theme); break; case "3dbubble": config = new Chart("chart", new BubbleChart3DOptions(), theme); break; case "boxplot": config = new Chart("chart", new BoxplotChartOptions(), theme); break; case "interactive": config = new Chart("chart", new InteractionOptions(), theme); break; case "angularGauge": config = new Chart("chart", new AngularGaugeOptions(), theme); break; case "spiderweb": config = new Chart("chart", new SpiderwebOptions(), theme); break; case "windrose": config = new Chart("chart", new WindroseOptions(), theme); break; case "columnrange": config = new Chart("chart", new ColumnRangeOptions(), theme); break; case "arearange": config = new Chart("chart", new AreaRangeOptions(), theme); break; case "clicktoadd": config = new Chart("chart", new ClickToAddAPointOptions(), theme); break; case "dualAxes": config = new Chart("chart", new DualAxesOptions(), theme); break; case "scatterWithRegression": config = new Chart("chart", new ScatterWithRegressionLineOptions(), theme); break; case "multipleAxes": config = new Chart("chart", new MultipleAxesOptions(), theme); break; case "errorBar": config = new Chart("chart", new ErrorBarOptions(), theme); break; case "funnel": config = new Chart("chart", new FunnelOptions(), theme); break; case "pyramid": config = new Chart("chart", new PyramidOptions(), theme); break; case "heatmap": config = new Chart("chart", new HeatmapOptions(), theme); break; default: config = new Chart("chart", new BasicLineOptions(), theme); break; } return config; } }
public class class_name { private Chart getChartFromParams(final PageParameters params) { String chartString; String themeString; Chart config; //If the showcase is started without any parameters //set the parameters to lineBasic and give us a line Chart if(params.getAllNamed().size() < 2){ PageParameters temp = new PageParameters(); temp.add("theme", "default"); // depends on control dependency: [if], data = [none] temp.add("chart", "line"); // depends on control dependency: [if], data = [none] setResponsePage(HomepageHighcharts.class, temp); // depends on control dependency: [if], data = [none] config = new Chart("chart", new BasicLineOptions(), null); // depends on control dependency: [if], data = [none] return config; // depends on control dependency: [if], data = [none] } themeString = params.getAllNamed().get(0).getValue(); Theme theme = getThemeFromParams(themeString); chartString = params.getAllNamed().get(1).getValue(); if(chartString == null) { config = new Chart("chart", new BasicLineOptions(), theme); // depends on control dependency: [if], data = [none] return config; // depends on control dependency: [if], data = [none] } switch(chartString) { case "basicBar": config = new Chart("chart", new BasicBarOptions(), theme); break; case "splineWithSymbols": config = new Chart("chart", new SplineWithSymbolsOptions(), theme); break; case "irregularIntervals": config = new Chart("chart", new TimeDataWithIrregularIntervalsOptions(), theme); break; case "logarithmicAxis": config = new Chart("chart", new LogarithmicAxisOptions(), theme); break; case "scatter": config = new Chart("chart", new ScatterPlotOptions(), theme); break; case "area": config = new Chart("chart", new BasicAreaOptions(), theme); break; case "areaWithNegativeValues": config = new Chart("chart", new AreaWithNegativeValuesOptions(), theme); break; case "stackedAndGroupedColumn": config = new Chart("chart", new StackedAndGroupedColumnOptions(), theme); break; case "combo": config = new Chart("chart", new ComboOptions(), theme); break; case "donut": config = new Chart("chart", new DonutOptions(), theme); break; case "withDataLabels": config = new Chart("chart", new LineWithDataLabelsOptions(), theme); break; case "zoomableTimeSeries": config = new Chart("chart", new ZoomableTimeSeriesOptions(), theme); break; case "splineInverted": config = new Chart("chart", new SplineWithInvertedAxisOptions(), theme); break; case "splineWithPlotBands": config = new Chart("chart", new SplineWithPlotBandsOptions(), theme); break; case "polar": config = new Chart("chart", new PolarOptions(), theme); break; case "stackedArea": config = new Chart("chart", new StackedAreaOptions(), theme); break; case "percentageArea": config = new Chart("chart", new PercentageAreaOptions(), theme); break; case "areaMissing": config = new Chart("chart", new AreaMissingOptions(), theme); break; case "areaInverted": config = new Chart("chart", new AreaInvertedAxisOptions(), theme); break; case "areaSpline": config = new Chart("chart", new AreaSplineOptions(), theme); break; case "areaSplineRange": config = new Chart("chart", new AreaSplineRangeOptions(), theme); break; case "columnWithDrilldown": config = new Chart("chart", new ColumnWithDrilldownOptions(), theme); break; case "columnRotated": config = new Chart("chart", new ColumnWithRotatedLabelsOptions(), theme); break; case "stackedBar": config = new Chart("chart", new StackedBarOptions(), theme); break; case "barNegativeStack": config = new Chart("chart", new StackedBarOptions(), theme); break; case "basicColumn": config = new Chart("chart", new BasicColumnOptions(), theme); break; case "columnWithNegativeValues": config = new Chart("chart", new ColumnWithNegativeValuesOptions(), theme); break; case "stackedColumn": config = new Chart("chart", new StackedColumnOptions(), theme); break; case "stackedPercentage": config = new Chart("chart", new StackedPercentageOptions(), theme); break; case "basicPie": config = new Chart("chart", new BasicPieOptions(), theme); break; case "pieWithGradient": config = new Chart("chart", new PieWithGradientOptions(), theme); break; case "pieWithLegend": config = new Chart("chart", new PieWithLegendOptions(), theme); break; case "splineUpdating": config = new Chart("chart", new WicketSplineUpdatingOptions(), theme); break; case "bubble": config = new Chart("chart", new BubbleChartOptions(), theme); break; case "3dbubble": config = new Chart("chart", new BubbleChart3DOptions(), theme); break; case "boxplot": config = new Chart("chart", new BoxplotChartOptions(), theme); break; case "interactive": config = new Chart("chart", new InteractionOptions(), theme); break; case "angularGauge": config = new Chart("chart", new AngularGaugeOptions(), theme); break; case "spiderweb": config = new Chart("chart", new SpiderwebOptions(), theme); break; case "windrose": config = new Chart("chart", new WindroseOptions(), theme); break; case "columnrange": config = new Chart("chart", new ColumnRangeOptions(), theme); break; case "arearange": config = new Chart("chart", new AreaRangeOptions(), theme); break; case "clicktoadd": config = new Chart("chart", new ClickToAddAPointOptions(), theme); break; case "dualAxes": config = new Chart("chart", new DualAxesOptions(), theme); break; case "scatterWithRegression": config = new Chart("chart", new ScatterWithRegressionLineOptions(), theme); break; case "multipleAxes": config = new Chart("chart", new MultipleAxesOptions(), theme); break; case "errorBar": config = new Chart("chart", new ErrorBarOptions(), theme); break; case "funnel": config = new Chart("chart", new FunnelOptions(), theme); break; case "pyramid": config = new Chart("chart", new PyramidOptions(), theme); break; case "heatmap": config = new Chart("chart", new HeatmapOptions(), theme); break; default: config = new Chart("chart", new BasicLineOptions(), theme); break; } return config; } }
public class class_name { @Override public void unset(String propName) { if (propName.equals("level")) { unsetLevel(); } if (propName.equals("inGroup")) { unsetInGroup(); } super.unset(propName); } }
public class class_name { @Override public void unset(String propName) { if (propName.equals("level")) { unsetLevel(); // depends on control dependency: [if], data = [none] } if (propName.equals("inGroup")) { unsetInGroup(); // depends on control dependency: [if], data = [none] } super.unset(propName); } }
public class class_name { public static List<Contour> contour(GrayU8 input, ConnectRule rule, GrayS32 output) { if( output == null ) { output = new GrayS32(input.width,input.height); } else { InputSanityCheck.checkSameShape(input,output); } BinaryLabelContourFinder alg = FactoryBinaryContourFinder.linearChang2004(); alg.setConnectRule(rule); alg.process(input,output); return convertContours(alg); } }
public class class_name { public static List<Contour> contour(GrayU8 input, ConnectRule rule, GrayS32 output) { if( output == null ) { output = new GrayS32(input.width,input.height); // depends on control dependency: [if], data = [none] } else { InputSanityCheck.checkSameShape(input,output); // depends on control dependency: [if], data = [none] } BinaryLabelContourFinder alg = FactoryBinaryContourFinder.linearChang2004(); alg.setConnectRule(rule); alg.process(input,output); return convertContours(alg); } }
public class class_name { public static boolean isVersionDownloadableNewer(Activity mActivity, String versionDownloadable) { String versionInstalled = null; try { versionInstalled = mActivity.getPackageManager().getPackageInfo(mActivity.getPackageName(), 0).versionName; } catch (PackageManager.NameNotFoundException ignored) { } if (versionInstalled.equals(versionDownloadable)) { // If it is equal, no new version downloadable return false; } else { return versionCompareNumerically(versionDownloadable, versionInstalled) > 0; // Return if the versionDownloadble is newer than the installed } } }
public class class_name { public static boolean isVersionDownloadableNewer(Activity mActivity, String versionDownloadable) { String versionInstalled = null; try { versionInstalled = mActivity.getPackageManager().getPackageInfo(mActivity.getPackageName(), 0).versionName; // depends on control dependency: [try], data = [none] } catch (PackageManager.NameNotFoundException ignored) { } // depends on control dependency: [catch], data = [none] if (versionInstalled.equals(versionDownloadable)) { // If it is equal, no new version downloadable return false; // depends on control dependency: [if], data = [none] } else { return versionCompareNumerically(versionDownloadable, versionInstalled) > 0; // Return if the versionDownloadble is newer than the installed // depends on control dependency: [if], data = [none] } } }
public class class_name { public void setButtons(java.util.Collection<Button> buttons) { if (buttons == null) { this.buttons = null; return; } this.buttons = new java.util.ArrayList<Button>(buttons); } }
public class class_name { public void setButtons(java.util.Collection<Button> buttons) { if (buttons == null) { this.buttons = null; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } this.buttons = new java.util.ArrayList<Button>(buttons); } }
public class class_name { public void run(String... arguments) throws Exception { final Bootstrap<T> bootstrap = new Bootstrap<>(this); addDefaultCommands(bootstrap); initialize(bootstrap); // Should be called after initialize to give an opportunity to set a custom metric registry bootstrap.registerMetrics(); final Cli cli = new Cli(new JarLocation(getClass()), bootstrap, System.out, System.err); if (!cli.run(arguments)) { // only exit if there's an error running the command onFatalError(); } } }
public class class_name { public void run(String... arguments) throws Exception { final Bootstrap<T> bootstrap = new Bootstrap<>(this); addDefaultCommands(bootstrap); initialize(bootstrap); // Should be called after initialize to give an opportunity to set a custom metric registry bootstrap.registerMetrics(); final Cli cli = new Cli(new JarLocation(getClass()), bootstrap, System.out, System.err); if (!cli.run(arguments)) { // only exit if there's an error running the command onFatalError(); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static List<Monomer> getAllMonomers(MonomerNotation not, int position) throws HELM2HandledException, MonomerException, NotationException, ChemistryException, CTKException, MonomerLoadingException { List<Monomer> monomers = new ArrayList<Monomer>(); MonomerFactory monomerFactory = MonomerFactory.getInstance(); MonomerStore monomerStore = monomerFactory.getMonomerStore(); if (not instanceof MonomerNotationUnitRNA) { monomers.addAll(getMonomersRNA((MonomerNotationUnitRNA) not, monomerStore, position)); } else if (not instanceof MonomerNotationUnit) { String id = not.getUnit(); // if (id.startsWith("[") && id.endsWith("]")) { // id = id.substring(1, id.length() - 1); // } monomers.add(MethodsMonomerUtils.getMonomer(not.getType(), id, "")); } else if (not instanceof MonomerNotationGroup) { for (MonomerNotationGroupElement groupElement : ((MonomerNotationGroup) not).getListOfElements()) { String id = groupElement.getMonomerNotation().getUnit(); /* * if (id.startsWith("[") && id.endsWith("]")) { id = * id.substring(1, id.length() - 1); } */ monomers.add(MethodsMonomerUtils.getMonomer(not.getType(), id, "")); } } else if (not instanceof MonomerNotationList) { for (MonomerNotation listElement : ((MonomerNotationList) not).getListofMonomerUnits()) { if (listElement instanceof MonomerNotationUnitRNA) { monomers.addAll(getMonomersRNA(((MonomerNotationUnitRNA) listElement), monomerStore, position)); } else { String id = listElement.getUnit(); /* * if (id.startsWith("[") && id.endsWith("]")) { id = * id.substring(1, id.length() - 1); } */ monomers.add(MethodsMonomerUtils.getMonomer(not.getType(), id, "")); } } } return monomers; } }
public class class_name { public static List<Monomer> getAllMonomers(MonomerNotation not, int position) throws HELM2HandledException, MonomerException, NotationException, ChemistryException, CTKException, MonomerLoadingException { List<Monomer> monomers = new ArrayList<Monomer>(); MonomerFactory monomerFactory = MonomerFactory.getInstance(); MonomerStore monomerStore = monomerFactory.getMonomerStore(); if (not instanceof MonomerNotationUnitRNA) { monomers.addAll(getMonomersRNA((MonomerNotationUnitRNA) not, monomerStore, position)); } else if (not instanceof MonomerNotationUnit) { String id = not.getUnit(); // if (id.startsWith("[") && id.endsWith("]")) { // id = id.substring(1, id.length() - 1); // } monomers.add(MethodsMonomerUtils.getMonomer(not.getType(), id, "")); } else if (not instanceof MonomerNotationGroup) { for (MonomerNotationGroupElement groupElement : ((MonomerNotationGroup) not).getListOfElements()) { String id = groupElement.getMonomerNotation().getUnit(); /* * if (id.startsWith("[") && id.endsWith("]")) { id = * id.substring(1, id.length() - 1); } */ monomers.add(MethodsMonomerUtils.getMonomer(not.getType(), id, "")); // depends on control dependency: [for], data = [none] } } else if (not instanceof MonomerNotationList) { for (MonomerNotation listElement : ((MonomerNotationList) not).getListofMonomerUnits()) { if (listElement instanceof MonomerNotationUnitRNA) { monomers.addAll(getMonomersRNA(((MonomerNotationUnitRNA) listElement), monomerStore, position)); // depends on control dependency: [if], data = [none] } else { String id = listElement.getUnit(); /* * if (id.startsWith("[") && id.endsWith("]")) { id = * id.substring(1, id.length() - 1); } */ monomers.add(MethodsMonomerUtils.getMonomer(not.getType(), id, "")); // depends on control dependency: [if], data = [none] } } } return monomers; } }
public class class_name { @Override public Collection<PersonDocument> findByFileAndSurnameBeginsWith( final String filename, final String beginsWith) { if (filename == null) { return Collections.emptyList(); } final List<PersonDocumentMongo> personDocuments; if (beginsWith == null || beginsWith.equals("") || beginsWith.equals("?")) { personDocuments = queryUnknownSurname(filename); } else { personDocuments = querySurnameBeginsWith(filename, beginsWith); } createGedObjects(personDocuments); return copy(personDocuments); } }
public class class_name { @Override public Collection<PersonDocument> findByFileAndSurnameBeginsWith( final String filename, final String beginsWith) { if (filename == null) { return Collections.emptyList(); // depends on control dependency: [if], data = [none] } final List<PersonDocumentMongo> personDocuments; if (beginsWith == null || beginsWith.equals("") || beginsWith.equals("?")) { personDocuments = queryUnknownSurname(filename); // depends on control dependency: [if], data = [none] } else { personDocuments = querySurnameBeginsWith(filename, beginsWith); // depends on control dependency: [if], data = [none] } createGedObjects(personDocuments); return copy(personDocuments); } }
public class class_name { @Override public String dnsResolveEx(String host) { StringBuilder result = new StringBuilder(); try { InetAddress[] list = InetAddress.getAllByName(host); for (InetAddress inetAddress : list) { result.append(inetAddress.getHostAddress()); result.append("; "); } } catch (UnknownHostException e) { log.log(Level.FINE, "DNS name not resolvable {0}.", host); } return result.toString(); } }
public class class_name { @Override public String dnsResolveEx(String host) { StringBuilder result = new StringBuilder(); try { InetAddress[] list = InetAddress.getAllByName(host); for (InetAddress inetAddress : list) { result.append(inetAddress.getHostAddress()); // depends on control dependency: [for], data = [inetAddress] result.append("; "); // depends on control dependency: [for], data = [none] } } catch (UnknownHostException e) { log.log(Level.FINE, "DNS name not resolvable {0}.", host); } // depends on control dependency: [catch], data = [none] return result.toString(); } }
public class class_name { public static void getTokens(List<String> list, String path) { int start = -1, length = path.length(), state = STATE_INITIAL; char ch; for (int index = 0; index < length; index++) { ch = path.charAt(index); switch (ch) { case '/': case '\\': { switch (state) { case STATE_INITIAL: { // skip extra leading / continue; } case STATE_MAYBE_CURRENT_PATH: { // it's '.' list.add(CURRENT_PATH); state = STATE_INITIAL; continue; } case STATE_MAYBE_REVERSE_PATH: { // it's '..' list.add(REVERSE_PATH); state = STATE_INITIAL; continue; } case STATE_NORMAL: { // it's just a normal path segment list.add(path.substring(start, index)); state = STATE_INITIAL; continue; } } continue; } case '.': { switch (state) { case STATE_INITIAL: { // . is the first char; might be a special token state = STATE_MAYBE_CURRENT_PATH; start = index; continue; } case STATE_MAYBE_CURRENT_PATH: { // the second . in a row... state = STATE_MAYBE_REVERSE_PATH; continue; } case STATE_MAYBE_REVERSE_PATH: { // the third . in a row, guess it's just a weird path name state = STATE_NORMAL; continue; } } continue; } default: { switch (state) { case STATE_INITIAL: { state = STATE_NORMAL; start = index; continue; } case STATE_MAYBE_CURRENT_PATH: case STATE_MAYBE_REVERSE_PATH: { state = STATE_NORMAL; } } } } } // handle the last token switch (state) { case STATE_INITIAL: { // trailing / break; } case STATE_MAYBE_CURRENT_PATH: { list.add(CURRENT_PATH); break; } case STATE_MAYBE_REVERSE_PATH: { list.add(REVERSE_PATH); break; } case STATE_NORMAL: { list.add(path.substring(start)); break; } } return; } }
public class class_name { public static void getTokens(List<String> list, String path) { int start = -1, length = path.length(), state = STATE_INITIAL; char ch; for (int index = 0; index < length; index++) { ch = path.charAt(index); // depends on control dependency: [for], data = [index] switch (ch) { case '/': case '\\': { switch (state) { case STATE_INITIAL: { // skip extra leading / continue; } case STATE_MAYBE_CURRENT_PATH: { // it's '.' list.add(CURRENT_PATH); state = STATE_INITIAL; continue; } case STATE_MAYBE_REVERSE_PATH: { // it's '..' list.add(REVERSE_PATH); // depends on control dependency: [for], data = [none] state = STATE_INITIAL; // depends on control dependency: [for], data = [none] continue; } case STATE_NORMAL: { // it's just a normal path segment list.add(path.substring(start, index)); state = STATE_INITIAL; continue; } } continue; } case '.': { switch (state) { case STATE_INITIAL: { // . is the first char; might be a special token state = STATE_MAYBE_CURRENT_PATH; start = index; continue; } case STATE_MAYBE_CURRENT_PATH: { // the second . in a row... state = STATE_MAYBE_REVERSE_PATH; continue; } case STATE_MAYBE_REVERSE_PATH: { // the third . in a row, guess it's just a weird path name state = STATE_NORMAL; continue; } } continue; } default: { switch (state) { case STATE_INITIAL: { state = STATE_NORMAL; start = index; continue; } case STATE_MAYBE_CURRENT_PATH: case STATE_MAYBE_REVERSE_PATH: { state = STATE_NORMAL; } } } } } // handle the last token switch (state) { case STATE_INITIAL: { // trailing / break; } case STATE_MAYBE_CURRENT_PATH: { list.add(CURRENT_PATH); break; } case STATE_MAYBE_REVERSE_PATH: { list.add(REVERSE_PATH); break; } case STATE_NORMAL: { list.add(path.substring(start)); break; } } return; } }
public class class_name { public static void main( String[] args ) { myOut.println( "NanoHTTPD 1.25 (C) 2001,2005-2011 Jarno Elonen and (C) 2010 Konstantinos Togias\n" + "(Command line options: [-p port] [-d root-dir] [--licence])\n" ); // Defaults int port = 80; File wwwroot = new File(".").getAbsoluteFile(); // Show licence if requested for ( int i=0; i<args.length; ++i ) if(args[i].equalsIgnoreCase("-p")) port = Integer.parseInt( args[i+1] ); else if(args[i].equalsIgnoreCase("-d")) wwwroot = new File( args[i+1] ).getAbsoluteFile(); else if ( args[i].toLowerCase().endsWith( "licence" )) { myOut.println( LICENCE + "\n" ); break; } try { new NanoHTTPD( port, wwwroot ); } catch( IOException ioe ) { System.err.println( "Couldn't start server:\n" + ioe ); System.exit( -1 ); } myOut.println( "Now serving files in port " + port + " from \"" + wwwroot + "\"" ); myOut.println( "Hit Enter to stop.\n" ); try { System.in.read(); } catch( Throwable t ) {} } }
public class class_name { public static void main( String[] args ) { myOut.println( "NanoHTTPD 1.25 (C) 2001,2005-2011 Jarno Elonen and (C) 2010 Konstantinos Togias\n" + "(Command line options: [-p port] [-d root-dir] [--licence])\n" ); // Defaults int port = 80; File wwwroot = new File(".").getAbsoluteFile(); // Show licence if requested for ( int i=0; i<args.length; ++i ) if(args[i].equalsIgnoreCase("-p")) port = Integer.parseInt( args[i+1] ); else if(args[i].equalsIgnoreCase("-d")) wwwroot = new File( args[i+1] ).getAbsoluteFile(); else if ( args[i].toLowerCase().endsWith( "licence" )) { myOut.println( LICENCE + "\n" ); // depends on control dependency: [if], data = [none] break; } try { new NanoHTTPD( port, wwwroot ); // depends on control dependency: [try], data = [none] } catch( IOException ioe ) { System.err.println( "Couldn't start server:\n" + ioe ); System.exit( -1 ); } // depends on control dependency: [catch], data = [none] myOut.println( "Now serving files in port " + port + " from \"" + wwwroot + "\"" ); myOut.println( "Hit Enter to stop.\n" ); try { System.in.read(); } catch( Throwable t ) {} // depends on control dependency: [try], data = [none] // depends on control dependency: [catch], data = [none] } }
public class class_name { public void setFileName(String filename, String typeName) { mSingleFileName = null; if (mFileNames == null) { mFileNames = new HashMap<String, String>(); } mFileNames.put(typeName, filename); } }
public class class_name { public void setFileName(String filename, String typeName) { mSingleFileName = null; if (mFileNames == null) { mFileNames = new HashMap<String, String>(); // depends on control dependency: [if], data = [none] } mFileNames.put(typeName, filename); } }
public class class_name { public Optional<Integer> getInteger(String key) { Objects.requireNonNull(key, Required.KEY.toString()); String value = this.values.get(key); if (StringUtils.isNotBlank(value) && NumberUtils.isCreatable(value)) { return Optional.of(Integer.valueOf(value)); } return Optional.empty(); } }
public class class_name { public Optional<Integer> getInteger(String key) { Objects.requireNonNull(key, Required.KEY.toString()); String value = this.values.get(key); if (StringUtils.isNotBlank(value) && NumberUtils.isCreatable(value)) { return Optional.of(Integer.valueOf(value)); // depends on control dependency: [if], data = [none] } return Optional.empty(); } }
public class class_name { @SuppressWarnings("FutureReturnValueIgnored") public void reportMetric(final IMetric<?> metric) { if (metric != null && isAvailable()) { try { final IMetric<?> metricSnapshot; // take snapshot synchronized (metric) { metricSnapshot = metric.getSnapshot(); } logger.debug(String .format("Submitting %s metric for metric emission pool", metricSnapshot.getName())); // report to all emitters for (final IMetricEmitter metricEmitter : this.metricEmitters) { this.executorService.submit(() -> { try { metricEmitter.reportMetric(metricSnapshot); } catch (final Exception ex) { logger.error( String.format("Failed to report %s metric due to ", metricSnapshot.getName()), ex); } }); } } catch (final CloneNotSupportedException ex) { logger.error( String.format("Failed to take snapshot for %s metric", metric.getClass().getName()), ex); } } } }
public class class_name { @SuppressWarnings("FutureReturnValueIgnored") public void reportMetric(final IMetric<?> metric) { if (metric != null && isAvailable()) { try { final IMetric<?> metricSnapshot; // take snapshot synchronized (metric) { // depends on control dependency: [try], data = [none] metricSnapshot = metric.getSnapshot(); } logger.debug(String .format("Submitting %s metric for metric emission pool", metricSnapshot.getName())); // depends on control dependency: [try], data = [none] // report to all emitters for (final IMetricEmitter metricEmitter : this.metricEmitters) { this.executorService.submit(() -> { try { metricEmitter.reportMetric(metricSnapshot); // depends on control dependency: [try], data = [none] } catch (final Exception ex) { logger.error( String.format("Failed to report %s metric due to ", metricSnapshot.getName()), ex); } // depends on control dependency: [catch], data = [none] }); } } catch (final CloneNotSupportedException ex) { logger.error( String.format("Failed to take snapshot for %s metric", metric.getClass().getName()), ex); } // depends on control dependency: [catch], data = [none] } } }
public class class_name { public BinaryString keyValue(byte split1, byte split2, BinaryString keyName) { ensureMaterialized(); if (keyName == null || keyName.getSizeInBytes() == 0) { return null; } if (inFirstSegment() && keyName.inFirstSegment()) { // position in byte int byteIdx = 0; // position of last split1 int lastSplit1Idx = -1; while (byteIdx < sizeInBytes) { // If find next split1 in str, process current kv if (segments[0].get(offset + byteIdx) == split1) { int currentKeyIdx = lastSplit1Idx + 1; // If key of current kv is keyName, return the value directly BinaryString value = findValueOfKey(split2, keyName, currentKeyIdx, byteIdx); if (value != null) { return value; } lastSplit1Idx = byteIdx; } byteIdx++; } // process the string which is not ends with split1 int currentKeyIdx = lastSplit1Idx + 1; return findValueOfKey(split2, keyName, currentKeyIdx, sizeInBytes); } else { return keyValueSlow(split1, split2, keyName); } } }
public class class_name { public BinaryString keyValue(byte split1, byte split2, BinaryString keyName) { ensureMaterialized(); if (keyName == null || keyName.getSizeInBytes() == 0) { return null; // depends on control dependency: [if], data = [none] } if (inFirstSegment() && keyName.inFirstSegment()) { // position in byte int byteIdx = 0; // position of last split1 int lastSplit1Idx = -1; while (byteIdx < sizeInBytes) { // If find next split1 in str, process current kv if (segments[0].get(offset + byteIdx) == split1) { int currentKeyIdx = lastSplit1Idx + 1; // If key of current kv is keyName, return the value directly BinaryString value = findValueOfKey(split2, keyName, currentKeyIdx, byteIdx); if (value != null) { return value; // depends on control dependency: [if], data = [none] } lastSplit1Idx = byteIdx; // depends on control dependency: [if], data = [none] } byteIdx++; // depends on control dependency: [while], data = [none] } // process the string which is not ends with split1 int currentKeyIdx = lastSplit1Idx + 1; return findValueOfKey(split2, keyName, currentKeyIdx, sizeInBytes); // depends on control dependency: [if], data = [none] } else { return keyValueSlow(split1, split2, keyName); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static void mkdirs(ZooKeeper zookeeper, String path, boolean makeLastNode, InternalACLProvider aclProvider, boolean asContainers) throws InterruptedException, KeeperException { PathUtils.validatePath(path); int pos = 1; // skip first slash, root is guaranteed to exist do { pos = path.indexOf(PATH_SEPARATOR, pos + 1); if ( pos == -1 ) { if ( makeLastNode ) { pos = path.length(); } else { break; } } String subPath = path.substring(0, pos); if ( zookeeper.exists(subPath, false) == null ) { try { List<ACL> acl = null; if ( aclProvider != null ) { acl = aclProvider.getAclForPath(subPath); if ( acl == null ) { acl = aclProvider.getDefaultAcl(); } } if ( acl == null ) { acl = ZooDefs.Ids.OPEN_ACL_UNSAFE; } zookeeper.create(subPath, new byte[0], acl, getCreateMode(asContainers)); } catch ( KeeperException.NodeExistsException e ) { // ignore... someone else has created it since we checked } } } while ( pos < path.length() ); } }
public class class_name { public static void mkdirs(ZooKeeper zookeeper, String path, boolean makeLastNode, InternalACLProvider aclProvider, boolean asContainers) throws InterruptedException, KeeperException { PathUtils.validatePath(path); int pos = 1; // skip first slash, root is guaranteed to exist do { pos = path.indexOf(PATH_SEPARATOR, pos + 1); if ( pos == -1 ) { if ( makeLastNode ) { pos = path.length(); // depends on control dependency: [if], data = [none] } else { break; } } String subPath = path.substring(0, pos); if ( zookeeper.exists(subPath, false) == null ) { try { List<ACL> acl = null; if ( aclProvider != null ) { acl = aclProvider.getAclForPath(subPath); // depends on control dependency: [if], data = [none] if ( acl == null ) { acl = aclProvider.getDefaultAcl(); // depends on control dependency: [if], data = [none] } } if ( acl == null ) { acl = ZooDefs.Ids.OPEN_ACL_UNSAFE; // depends on control dependency: [if], data = [none] } zookeeper.create(subPath, new byte[0], acl, getCreateMode(asContainers)); // depends on control dependency: [try], data = [none] } catch ( KeeperException.NodeExistsException e ) { // ignore... someone else has created it since we checked } // depends on control dependency: [catch], data = [none] } } while ( pos < path.length() ); } }
public class class_name { static List<ServiceRef> normalizeJaxWsServiceRefs(List<ServiceRef> allServiceRefs, ClassLoader classLoader) { if (allServiceRefs == null || allServiceRefs.size() == 0) { return Collections.emptyList(); } List<ServiceRef> jaxwsServiceRefs = new ArrayList<ServiceRef>(allServiceRefs.size()); for (ServiceRef serviceRef : allServiceRefs) { // A service-ref might have just the "service-ref-name" and "lookup-name" elements specified. // In that case no other elements should be present. if (serviceRef.getLookupName() != null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "The service ref: " + serviceRef.getName() + " specifies lookup-name: " + serviceRef.getLookupName()); } jaxwsServiceRefs.add(serviceRef); } else { String srClassName = serviceRef.getServiceInterfaceName(); if (StringUtils.isEmpty(srClassName)) { Tr.warning(tc, "warn.service.ref.dd.service.interface.not.set", serviceRef.getName()); continue; } Class<?> srClass; try { srClass = Class.forName(srClassName, false, classLoader); } catch (ClassNotFoundException e) { Tr.warning(tc, "warn.service.ref.dd.service.interface.class.not.found", serviceRef.getName(), srClassName); continue; } if (!Service.class.isAssignableFrom(srClass)) { Tr.warning(tc, "warn.service.ref.dd.service.interface.wrong.value", serviceRef.getName(), srClassName); continue; } jaxwsServiceRefs.add(serviceRef); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "The service ref: " + serviceRef.getName() + " refers to the service: " + srClassName); } } } return jaxwsServiceRefs; } }
public class class_name { static List<ServiceRef> normalizeJaxWsServiceRefs(List<ServiceRef> allServiceRefs, ClassLoader classLoader) { if (allServiceRefs == null || allServiceRefs.size() == 0) { return Collections.emptyList(); // depends on control dependency: [if], data = [none] } List<ServiceRef> jaxwsServiceRefs = new ArrayList<ServiceRef>(allServiceRefs.size()); for (ServiceRef serviceRef : allServiceRefs) { // A service-ref might have just the "service-ref-name" and "lookup-name" elements specified. // In that case no other elements should be present. if (serviceRef.getLookupName() != null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "The service ref: " + serviceRef.getName() + " specifies lookup-name: " + serviceRef.getLookupName()); // depends on control dependency: [if], data = [none] } jaxwsServiceRefs.add(serviceRef); // depends on control dependency: [if], data = [none] } else { String srClassName = serviceRef.getServiceInterfaceName(); if (StringUtils.isEmpty(srClassName)) { Tr.warning(tc, "warn.service.ref.dd.service.interface.not.set", serviceRef.getName()); // depends on control dependency: [if], data = [none] continue; } Class<?> srClass; try { srClass = Class.forName(srClassName, false, classLoader); // depends on control dependency: [try], data = [none] } catch (ClassNotFoundException e) { Tr.warning(tc, "warn.service.ref.dd.service.interface.class.not.found", serviceRef.getName(), srClassName); continue; } // depends on control dependency: [catch], data = [none] if (!Service.class.isAssignableFrom(srClass)) { Tr.warning(tc, "warn.service.ref.dd.service.interface.wrong.value", serviceRef.getName(), srClassName); // depends on control dependency: [if], data = [none] continue; } jaxwsServiceRefs.add(serviceRef); // depends on control dependency: [if], data = [none] if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "The service ref: " + serviceRef.getName() + " refers to the service: " + srClassName); // depends on control dependency: [if], data = [none] } } } return jaxwsServiceRefs; } }
public class class_name { public XAResourceWrapper createConnectableXAResourceWrapper(XAResource xares, boolean pad, Boolean override, String productName, String productVersion, String jndiName, ConnectableResource cr, XAResourceStatistics xastat) { if (cr instanceof org.ironjacamar.core.spi.transaction.FirstResource || cr instanceof org.jboss.tm.FirstResource) { if (xastat != null && xastat.isEnabled()) { return new FirstResourceConnectableXAResourceWrapperStatImpl(xares, pad, override, productName, productVersion, jndiName, cr, xastat); } else { return new FirstResourceConnectableXAResourceWrapperImpl(xares, pad, override, productName, productVersion, jndiName, cr); } } else { if (xastat != null && xastat.isEnabled()) { return new ConnectableXAResourceWrapperStatImpl(xares, pad, override, productName, productVersion, jndiName, cr, xastat); } else { return new ConnectableXAResourceWrapperImpl(xares, pad, override, productName, productVersion, jndiName, cr); } } } }
public class class_name { public XAResourceWrapper createConnectableXAResourceWrapper(XAResource xares, boolean pad, Boolean override, String productName, String productVersion, String jndiName, ConnectableResource cr, XAResourceStatistics xastat) { if (cr instanceof org.ironjacamar.core.spi.transaction.FirstResource || cr instanceof org.jboss.tm.FirstResource) { if (xastat != null && xastat.isEnabled()) { return new FirstResourceConnectableXAResourceWrapperStatImpl(xares, pad, override, productName, productVersion, jndiName, cr, xastat); // depends on control dependency: [if], data = [none] } else { return new FirstResourceConnectableXAResourceWrapperImpl(xares, pad, override, productName, productVersion, jndiName, cr); // depends on control dependency: [if], data = [none] } } else { if (xastat != null && xastat.isEnabled()) { return new ConnectableXAResourceWrapperStatImpl(xares, pad, override, productName, productVersion, jndiName, cr, xastat); // depends on control dependency: [if], data = [none] } else { return new ConnectableXAResourceWrapperImpl(xares, pad, override, productName, productVersion, jndiName, cr); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public InvAccess chooseDatasetAccess(List<InvAccess> accessList) { if (accessList.size() == 0) return null; InvAccess access = null; if (preferAccess != null) { for (ServiceType type : preferAccess) { access = findAccessByServiceType(accessList, type); if (access != null) break; } } // the order indicates preference if (access == null) access = findAccessByServiceType(accessList, ServiceType.CdmRemote); if (access == null) access = findAccessByServiceType(accessList, ServiceType.DODS); if (access == null) access = findAccessByServiceType(accessList, ServiceType.OPENDAP); if (access == null) access = findAccessByServiceType(accessList, ServiceType.DAP4); if (access == null) access = findAccessByServiceType(accessList, ServiceType.FILE); // should mean that it can be opened through netcdf API if (access == null) access = findAccessByServiceType(accessList, ServiceType.NETCDF); // ServiceType.NETCDF is deprecated, use FILE // look for HTTP with format we can read if (access == null) { InvAccess tryAccess = findAccessByServiceType(accessList, ServiceType.HTTPServer); if (tryAccess == null) tryAccess = findAccessByServiceType(accessList, ServiceType.HTTP); // ServiceType.HTTP should be HTTPServer if (tryAccess != null) { DataFormatType format = tryAccess.getDataFormatType(); // these are the file types we can read if ((DataFormatType.BUFR == format) || (DataFormatType.GINI == format) || (DataFormatType.GRIB1 == format) || (DataFormatType.GRIB2 == format) || (DataFormatType.HDF5 == format) || (DataFormatType.NCML == format) || (DataFormatType.NETCDF == format) || (DataFormatType.NEXRAD2 == format) || (DataFormatType.NIDS == format)) { access = tryAccess; } } } // ADDE if (access == null) access = findAccessByServiceType(accessList, ServiceType.ADDE); // RESOLVER if (access == null) { access = findAccessByServiceType(accessList, ServiceType.RESOLVER); } return access; } }
public class class_name { public InvAccess chooseDatasetAccess(List<InvAccess> accessList) { if (accessList.size() == 0) return null; InvAccess access = null; if (preferAccess != null) { for (ServiceType type : preferAccess) { access = findAccessByServiceType(accessList, type); // depends on control dependency: [for], data = [type] if (access != null) break; } } // the order indicates preference if (access == null) access = findAccessByServiceType(accessList, ServiceType.CdmRemote); if (access == null) access = findAccessByServiceType(accessList, ServiceType.DODS); if (access == null) access = findAccessByServiceType(accessList, ServiceType.OPENDAP); if (access == null) access = findAccessByServiceType(accessList, ServiceType.DAP4); if (access == null) access = findAccessByServiceType(accessList, ServiceType.FILE); // should mean that it can be opened through netcdf API if (access == null) access = findAccessByServiceType(accessList, ServiceType.NETCDF); // ServiceType.NETCDF is deprecated, use FILE // look for HTTP with format we can read if (access == null) { InvAccess tryAccess = findAccessByServiceType(accessList, ServiceType.HTTPServer); if (tryAccess == null) tryAccess = findAccessByServiceType(accessList, ServiceType.HTTP); // ServiceType.HTTP should be HTTPServer if (tryAccess != null) { DataFormatType format = tryAccess.getDataFormatType(); // these are the file types we can read if ((DataFormatType.BUFR == format) || (DataFormatType.GINI == format) || (DataFormatType.GRIB1 == format) || (DataFormatType.GRIB2 == format) || (DataFormatType.HDF5 == format) || (DataFormatType.NCML == format) || (DataFormatType.NETCDF == format) || (DataFormatType.NEXRAD2 == format) || (DataFormatType.NIDS == format)) { access = tryAccess; // depends on control dependency: [if], data = [none] } } } // ADDE if (access == null) access = findAccessByServiceType(accessList, ServiceType.ADDE); // RESOLVER if (access == null) { access = findAccessByServiceType(accessList, ServiceType.RESOLVER); // depends on control dependency: [if], data = [(access] } return access; } }
public class class_name { public void marshall(ActivityTimedOutEventDetails activityTimedOutEventDetails, ProtocolMarshaller protocolMarshaller) { if (activityTimedOutEventDetails == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(activityTimedOutEventDetails.getError(), ERROR_BINDING); protocolMarshaller.marshall(activityTimedOutEventDetails.getCause(), CAUSE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(ActivityTimedOutEventDetails activityTimedOutEventDetails, ProtocolMarshaller protocolMarshaller) { if (activityTimedOutEventDetails == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(activityTimedOutEventDetails.getError(), ERROR_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(activityTimedOutEventDetails.getCause(), CAUSE_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 String prepareUrl(String theme, String url) { // Sonderseite für Hessenschau verwenden if (theme.contains("hessenschau")) { return "http://www.hessenschau.de/tv-sendung/sendungsarchiv/index.html"; } // bei allen anderen, probieren, ob eine URL mit "sendungen" vor index.html existiert String preparedUrl = url.replaceAll("index.html", "sendungen/index.html"); if (MediathekReader.urlExists(preparedUrl)) { return preparedUrl; } return url; } }
public class class_name { private String prepareUrl(String theme, String url) { // Sonderseite für Hessenschau verwenden if (theme.contains("hessenschau")) { return "http://www.hessenschau.de/tv-sendung/sendungsarchiv/index.html"; } // bei allen anderen, probieren, ob eine URL mit "sendungen" vor index.html existiert String preparedUrl = url.replaceAll("index.html", "sendungen/index.html"); if (MediathekReader.urlExists(preparedUrl)) { return preparedUrl; // depends on control dependency: [if], data = [none] } return url; } }
public class class_name { public HadMember doAction(HadMember o) { List<QualifiedName> qq=new LinkedList<QualifiedName>(); if (o.getEntity()!=null) { for (QualifiedName eid:o.getEntity()) { qq.add(eid); } } return c.newHadMember(o.getCollection(), qq); /*remember, scruffy hadmember in provn, has a null in get(0)!! return deprecated.convertHadMember(deprecated.doAction((o.getCollection()==null) ? null: o.getCollection().getRef()), ((o.getEntity()==null || (o.getEntity().isEmpty())) ? deprecated.doAction(null) : deprecated.doAction((o.getEntity().get(0)==null) ? null : o.getEntity().get(0).getRef()))); */ } }
public class class_name { public HadMember doAction(HadMember o) { List<QualifiedName> qq=new LinkedList<QualifiedName>(); if (o.getEntity()!=null) { for (QualifiedName eid:o.getEntity()) { qq.add(eid); // depends on control dependency: [for], data = [eid] } } return c.newHadMember(o.getCollection(), qq); /*remember, scruffy hadmember in provn, has a null in get(0)!! return deprecated.convertHadMember(deprecated.doAction((o.getCollection()==null) ? null: o.getCollection().getRef()), ((o.getEntity()==null || (o.getEntity().isEmpty())) ? deprecated.doAction(null) : deprecated.doAction((o.getEntity().get(0)==null) ? null : o.getEntity().get(0).getRef()))); */ } }
public class class_name { private static boolean validateValue(String value) { if (value.length() > VALUE_MAX_SIZE || value.charAt(value.length() - 1) == ' ' /* '\u0020' */) { return false; } for (int i = 0; i < value.length(); i++) { char c = value.charAt(i); if (c == ',' || c == '=' || c < ' ' /* '\u0020' */ || c > '~' /* '\u007E' */) { return false; } } return true; } }
public class class_name { private static boolean validateValue(String value) { if (value.length() > VALUE_MAX_SIZE || value.charAt(value.length() - 1) == ' ' /* '\u0020' */) { return false; // depends on control dependency: [if], data = [none] } for (int i = 0; i < value.length(); i++) { char c = value.charAt(i); if (c == ',' || c == '=' || c < ' ' /* '\u0020' */ || c > '~' /* '\u007E' */) { return false; // depends on control dependency: [if], data = [none] } } return true; } }
public class class_name { static public Number getElementAt(Matrix matrix, int row, int column){ List<Array> arrays = matrix.getArrays(); List<MatCell> matCells = matrix.getMatCells(); Matrix.Kind kind = matrix.getKind(); switch(kind){ case DIAGONAL: { // "The content is just one Array of numbers representing the diagonal values" if(arrays.size() == 1){ Array array = arrays.get(0); List<? extends Number> elements = ArrayUtil.asNumberList(array); // Diagonal element if(row == column){ return elements.get(row - 1); } else // Off-diagonal element { int min = 1; int max = elements.size(); if((row < min || row > max) || (column < min || column > max)){ throw new IndexOutOfBoundsException(); } return matrix.getOffDiagDefault(); } } } break; case SYMMETRIC: { // "The content must be represented by Arrays" if(arrays.size() > 0){ // Make sure the specified coordinates target the lower left triangle if(column > row){ int temp = row; row = column; column = temp; } return getArrayValue(arrays, row, column); } } break; case ANY: { if(arrays.size() > 0){ return getArrayValue(arrays, row, column); } // End if if(matCells.size() > 0){ if(row < 1 || column < 1){ throw new IndexOutOfBoundsException(); } Number value = getMatCellValue(matCells, row, column); if(value == null){ if(row == column){ return matrix.getDiagDefault(); } return matrix.getOffDiagDefault(); } return value; } } break; default: throw new UnsupportedAttributeException(matrix, kind); } throw new InvalidElementException(matrix); } }
public class class_name { static public Number getElementAt(Matrix matrix, int row, int column){ List<Array> arrays = matrix.getArrays(); List<MatCell> matCells = matrix.getMatCells(); Matrix.Kind kind = matrix.getKind(); switch(kind){ case DIAGONAL: { // "The content is just one Array of numbers representing the diagonal values" if(arrays.size() == 1){ Array array = arrays.get(0); List<? extends Number> elements = ArrayUtil.asNumberList(array); // depends on control dependency: [if], data = [none] // Diagonal element if(row == column){ return elements.get(row - 1); // depends on control dependency: [if], data = [(row] } else // Off-diagonal element { int min = 1; int max = elements.size(); if((row < min || row > max) || (column < min || column > max)){ throw new IndexOutOfBoundsException(); } return matrix.getOffDiagDefault(); // depends on control dependency: [if], data = [none] } } } break; case SYMMETRIC: { // "The content must be represented by Arrays" if(arrays.size() > 0){ // Make sure the specified coordinates target the lower left triangle if(column > row){ int temp = row; row = column; // depends on control dependency: [if], data = [none] column = temp; // depends on control dependency: [if], data = [none] } return getArrayValue(arrays, row, column); // depends on control dependency: [if], data = [none] } } break; case ANY: { if(arrays.size() > 0){ return getArrayValue(arrays, row, column); } // End if if(matCells.size() > 0){ if(row < 1 || column < 1){ throw new IndexOutOfBoundsException(); } Number value = getMatCellValue(matCells, row, column); if(value == null){ if(row == column){ return matrix.getDiagDefault(); } return matrix.getOffDiagDefault(); } return value; } } break; default: throw new UnsupportedAttributeException(matrix, kind); } throw new InvalidElementException(matrix); } }
public class class_name { public static String decrypt(String encrypted) { try { return decrypt(encrypted, null); } catch (GeneralSecurityException e) { e.printStackTrace(); return null; } } }
public class class_name { public static String decrypt(String encrypted) { try { return decrypt(encrypted, null); // depends on control dependency: [try], data = [none] } catch (GeneralSecurityException e) { e.printStackTrace(); return null; } // depends on control dependency: [catch], data = [none] } }
public class class_name { public ServiceCall<DialogNodeCollection> listDialogNodes(ListDialogNodesOptions listDialogNodesOptions) { Validator.notNull(listDialogNodesOptions, "listDialogNodesOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "dialog_nodes" }; String[] pathParameters = { listDialogNodesOptions.workspaceId() }; RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters)); builder.query("version", versionDate); Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v1", "listDialogNodes"); for (Entry<String, String> header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); } builder.header("Accept", "application/json"); if (listDialogNodesOptions.pageLimit() != null) { builder.query("page_limit", String.valueOf(listDialogNodesOptions.pageLimit())); } if (listDialogNodesOptions.includeCount() != null) { builder.query("include_count", String.valueOf(listDialogNodesOptions.includeCount())); } if (listDialogNodesOptions.sort() != null) { builder.query("sort", listDialogNodesOptions.sort()); } if (listDialogNodesOptions.cursor() != null) { builder.query("cursor", listDialogNodesOptions.cursor()); } if (listDialogNodesOptions.includeAudit() != null) { builder.query("include_audit", String.valueOf(listDialogNodesOptions.includeAudit())); } return createServiceCall(builder.build(), ResponseConverterUtils.getObject(DialogNodeCollection.class)); } }
public class class_name { public ServiceCall<DialogNodeCollection> listDialogNodes(ListDialogNodesOptions listDialogNodesOptions) { Validator.notNull(listDialogNodesOptions, "listDialogNodesOptions cannot be null"); String[] pathSegments = { "v1/workspaces", "dialog_nodes" }; String[] pathParameters = { listDialogNodesOptions.workspaceId() }; RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments, pathParameters)); builder.query("version", versionDate); Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v1", "listDialogNodes"); for (Entry<String, String> header : sdkHeaders.entrySet()) { builder.header(header.getKey(), header.getValue()); // depends on control dependency: [for], data = [header] } builder.header("Accept", "application/json"); if (listDialogNodesOptions.pageLimit() != null) { builder.query("page_limit", String.valueOf(listDialogNodesOptions.pageLimit())); // depends on control dependency: [if], data = [(listDialogNodesOptions.pageLimit()] } if (listDialogNodesOptions.includeCount() != null) { builder.query("include_count", String.valueOf(listDialogNodesOptions.includeCount())); // depends on control dependency: [if], data = [(listDialogNodesOptions.includeCount()] } if (listDialogNodesOptions.sort() != null) { builder.query("sort", listDialogNodesOptions.sort()); // depends on control dependency: [if], data = [none] } if (listDialogNodesOptions.cursor() != null) { builder.query("cursor", listDialogNodesOptions.cursor()); // depends on control dependency: [if], data = [none] } if (listDialogNodesOptions.includeAudit() != null) { builder.query("include_audit", String.valueOf(listDialogNodesOptions.includeAudit())); // depends on control dependency: [if], data = [(listDialogNodesOptions.includeAudit()] } return createServiceCall(builder.build(), ResponseConverterUtils.getObject(DialogNodeCollection.class)); } }
public class class_name { @Override public Date parse(String str, ParsePosition pos) { Date result; if (str == null || str.trim().length() == 0) { result = null; pos.setIndex(-1); } else { result = parseNonNullDate(str, pos); } return result; } }
public class class_name { @Override public Date parse(String str, ParsePosition pos) { Date result; if (str == null || str.trim().length() == 0) { result = null; // depends on control dependency: [if], data = [none] pos.setIndex(-1); // depends on control dependency: [if], data = [none] } else { result = parseNonNullDate(str, pos); // depends on control dependency: [if], data = [(str] } return result; } }
public class class_name { protected AttributedCharacterIterator textIterator (Graphics2D gfx) { // first set up any attributes that apply to the entire text Font font = (_font == null) ? gfx.getFont() : _font; HashMap<TextAttribute,Object> map = new HashMap<TextAttribute,Object>(); map.put(TextAttribute.FONT, font); if ((_style & UNDERLINE) != 0) { map.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_LOW_ONE_PIXEL); } AttributedString text = new AttributedString(_text, map); addAttributes(text); return text.getIterator(); } }
public class class_name { protected AttributedCharacterIterator textIterator (Graphics2D gfx) { // first set up any attributes that apply to the entire text Font font = (_font == null) ? gfx.getFont() : _font; HashMap<TextAttribute,Object> map = new HashMap<TextAttribute,Object>(); map.put(TextAttribute.FONT, font); if ((_style & UNDERLINE) != 0) { map.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_LOW_ONE_PIXEL); // depends on control dependency: [if], data = [none] } AttributedString text = new AttributedString(_text, map); addAttributes(text); return text.getIterator(); } }
public class class_name { public static <R> R findResource( ResourceBundle.Control control, String fileName, String fileExtension, String localeToken, Locale locale, Function<String, R> function) { Set<Locale> candidateLocales = new LinkedHashSet<>(); candidateLocales.addAll(control.getCandidateLocales("", locale)); Locale fallbackLocale = control.getFallbackLocale("", locale); if (fallbackLocale != null) { candidateLocales.addAll(control.getCandidateLocales("", fallbackLocale)); } for (Locale candidateLocale : candidateLocales) { String strLocale = control.toBundleName("", candidateLocale); String prefix = fileName; if (localeToken != null && !localeToken.isEmpty()) { prefix = prefix.replaceAll(Pattern.quote(localeToken), Matcher.quoteReplacement(strLocale)); } R result = function.apply(control.toResourceName(prefix + strLocale, fileExtension)); if (result != null) { return result; } } return null; } }
public class class_name { public static <R> R findResource( ResourceBundle.Control control, String fileName, String fileExtension, String localeToken, Locale locale, Function<String, R> function) { Set<Locale> candidateLocales = new LinkedHashSet<>(); candidateLocales.addAll(control.getCandidateLocales("", locale)); Locale fallbackLocale = control.getFallbackLocale("", locale); if (fallbackLocale != null) { candidateLocales.addAll(control.getCandidateLocales("", fallbackLocale)); // depends on control dependency: [if], data = [none] } for (Locale candidateLocale : candidateLocales) { String strLocale = control.toBundleName("", candidateLocale); String prefix = fileName; if (localeToken != null && !localeToken.isEmpty()) { prefix = prefix.replaceAll(Pattern.quote(localeToken), Matcher.quoteReplacement(strLocale)); // depends on control dependency: [if], data = [(localeToken] } R result = function.apply(control.toResourceName(prefix + strLocale, fileExtension)); if (result != null) { return result; // depends on control dependency: [if], data = [none] } } return null; } }
public class class_name { private static void calc_prediction_coef(SBR sbr, float[][][] Xlow, float[][] alpha_0, float[][] alpha_1, int k) { float tmp; acorr_coef ac = new acorr_coef(); auto_correlation(sbr, ac, Xlow, k, sbr.numTimeSlotsRate+6); if(ac.det==0) { alpha_1[k][0] = 0; alpha_1[k][1] = 0; } else { tmp = 1.0f/ac.det; alpha_1[k][0] = ((ac.r01[0]*ac.r12[0])-(ac.r01[1]*ac.r12[1])-(ac.r02[0]*ac.r11[0]))*tmp; alpha_1[k][1] = ((ac.r01[1]*ac.r12[0])+(ac.r01[0]*ac.r12[1])-(ac.r02[1]*ac.r11[0]))*tmp; } if(ac.r11[0]==0) { alpha_0[k][0] = 0; alpha_0[k][1] = 0; } else { tmp = 1.0f/ac.r11[0]; alpha_0[k][0] = -(ac.r01[0]+(alpha_1[k][0]*ac.r12[0])+(alpha_1[k][1]*ac.r12[1]))*tmp; alpha_0[k][1] = -(ac.r01[1]+(alpha_1[k][1]*ac.r12[0])-(alpha_1[k][0]*ac.r12[1]))*tmp; } if(((alpha_0[k][0]*alpha_0[k][0])+(alpha_0[k][1]*alpha_0[k][1])>=16.0f) ||((alpha_1[k][0]*alpha_1[k][0])+(alpha_1[k][1]*alpha_1[k][1])>=16.0f)) { alpha_0[k][0] = 0; alpha_0[k][1] = 0; alpha_1[k][0] = 0; alpha_1[k][1] = 0; } } }
public class class_name { private static void calc_prediction_coef(SBR sbr, float[][][] Xlow, float[][] alpha_0, float[][] alpha_1, int k) { float tmp; acorr_coef ac = new acorr_coef(); auto_correlation(sbr, ac, Xlow, k, sbr.numTimeSlotsRate+6); if(ac.det==0) { alpha_1[k][0] = 0; // depends on control dependency: [if], data = [none] alpha_1[k][1] = 0; // depends on control dependency: [if], data = [none] } else { tmp = 1.0f/ac.det; // depends on control dependency: [if], data = [none] alpha_1[k][0] = ((ac.r01[0]*ac.r12[0])-(ac.r01[1]*ac.r12[1])-(ac.r02[0]*ac.r11[0]))*tmp; // depends on control dependency: [if], data = [none] alpha_1[k][1] = ((ac.r01[1]*ac.r12[0])+(ac.r01[0]*ac.r12[1])-(ac.r02[1]*ac.r11[0]))*tmp; // depends on control dependency: [if], data = [none] } if(ac.r11[0]==0) { alpha_0[k][0] = 0; // depends on control dependency: [if], data = [none] alpha_0[k][1] = 0; // depends on control dependency: [if], data = [none] } else { tmp = 1.0f/ac.r11[0]; // depends on control dependency: [if], data = [none] alpha_0[k][0] = -(ac.r01[0]+(alpha_1[k][0]*ac.r12[0])+(alpha_1[k][1]*ac.r12[1]))*tmp; // depends on control dependency: [if], data = [none] alpha_0[k][1] = -(ac.r01[1]+(alpha_1[k][1]*ac.r12[0])-(alpha_1[k][0]*ac.r12[1]))*tmp; // depends on control dependency: [if], data = [none] } if(((alpha_0[k][0]*alpha_0[k][0])+(alpha_0[k][1]*alpha_0[k][1])>=16.0f) ||((alpha_1[k][0]*alpha_1[k][0])+(alpha_1[k][1]*alpha_1[k][1])>=16.0f)) { alpha_0[k][0] = 0; // depends on control dependency: [if], data = [none] alpha_0[k][1] = 0; // depends on control dependency: [if], data = [none] alpha_1[k][0] = 0; // depends on control dependency: [if], data = [none] alpha_1[k][1] = 0; // depends on control dependency: [if], data = [none] } } }
public class class_name { public StringGrabberList split(String regexp) { final StringGrabberList retList = new StringGrabberList(); final String string = sb.toString(); String[] splitedStrings = string.split(regexp); for (String str : splitedStrings) { retList.add(new StringGrabber(str)); } return retList; } }
public class class_name { public StringGrabberList split(String regexp) { final StringGrabberList retList = new StringGrabberList(); final String string = sb.toString(); String[] splitedStrings = string.split(regexp); for (String str : splitedStrings) { retList.add(new StringGrabber(str)); // depends on control dependency: [for], data = [str] } return retList; } }
public class class_name { @Override public IoBuffer getKeyframe() { if (dataCount > 0) { IoBuffer result = IoBuffer.allocate(dataCount); result.put(blockData, 0, dataCount); result.rewind(); return result; } return null; } }
public class class_name { @Override public IoBuffer getKeyframe() { if (dataCount > 0) { IoBuffer result = IoBuffer.allocate(dataCount); result.put(blockData, 0, dataCount); // depends on control dependency: [if], data = [none] result.rewind(); // depends on control dependency: [if], data = [none] return result; // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { @Nullable protected static final Type extractTypeArgAsMemberOfSupertype( Type type, Symbol superTypeSym, int typeArgIndex, Types types) { Type collectionType = types.asSuper(type, superTypeSym); if (collectionType == null) { return null; } com.sun.tools.javac.util.List<Type> tyargs = collectionType.getTypeArguments(); if (tyargs.size() <= typeArgIndex) { // Collection is raw, nothing we can do. return null; } return tyargs.get(typeArgIndex); } }
public class class_name { @Nullable protected static final Type extractTypeArgAsMemberOfSupertype( Type type, Symbol superTypeSym, int typeArgIndex, Types types) { Type collectionType = types.asSuper(type, superTypeSym); if (collectionType == null) { return null; // depends on control dependency: [if], data = [none] } com.sun.tools.javac.util.List<Type> tyargs = collectionType.getTypeArguments(); if (tyargs.size() <= typeArgIndex) { // Collection is raw, nothing we can do. return null; // depends on control dependency: [if], data = [none] } return tyargs.get(typeArgIndex); } }
public class class_name { public final void doesNotContain(@NullableDecl Object element) { if (Iterables.contains(actual(), element)) { failWithActual("expected not to contain", element); } } }
public class class_name { public final void doesNotContain(@NullableDecl Object element) { if (Iterables.contains(actual(), element)) { failWithActual("expected not to contain", element); // depends on control dependency: [if], data = [none] } } }
public class class_name { protected String receiveResponse(Socket socket) { try { return super.receiveMessage(socket); } catch (IOException e) { getLogger().severe(String.format("Failed to receive response from EchoServer [%s]", socket.getRemoteSocketAddress())); getLogger().severe(ThrowableUtils.getStackTrace(e)); return "No Reply"; } } }
public class class_name { protected String receiveResponse(Socket socket) { try { return super.receiveMessage(socket); // depends on control dependency: [try], data = [none] } catch (IOException e) { getLogger().severe(String.format("Failed to receive response from EchoServer [%s]", socket.getRemoteSocketAddress())); getLogger().severe(ThrowableUtils.getStackTrace(e)); return "No Reply"; } // depends on control dependency: [catch], data = [none] } }
public class class_name { public <T> FluentValidator onEach(T[] t) { if (ArrayUtil.isEmpty(t)) { lastAddCount = 0; return this; } return onEach(Arrays.asList(t)); } }
public class class_name { public <T> FluentValidator onEach(T[] t) { if (ArrayUtil.isEmpty(t)) { lastAddCount = 0; // depends on control dependency: [if], data = [none] return this; // depends on control dependency: [if], data = [none] } return onEach(Arrays.asList(t)); } }
public class class_name { public void saveContext(Context ctx) { validateContextNotNull(ctx); for (ContextDataFactory cdf : this.contextDataFactories) { cdf.persistContextData(getSession(), ctx); } } }
public class class_name { public void saveContext(Context ctx) { validateContextNotNull(ctx); for (ContextDataFactory cdf : this.contextDataFactories) { cdf.persistContextData(getSession(), ctx); // depends on control dependency: [for], data = [cdf] } } }
public class class_name { @Override public boolean init(final String actionPath, final String[] separators) { String prefix = separators[0]; String split = separators[1]; String suffix = separators[2]; macrosCount = StringUtil.count(actionPath, prefix); if (macrosCount == 0) { return false; } names = new String[macrosCount]; patterns = new String[macrosCount]; fixed = new String[macrosCount + 1]; int offset = 0; int i = 0; while (true) { int[] ndx = StringUtil.indexOfRegion(actionPath, prefix, suffix, offset); if (ndx == null) { break; } fixed[i] = actionPath.substring(offset, ndx[0]); String name = actionPath.substring(ndx[1], ndx[2]); // name:pattern String pattern = null; int colonNdx = name.indexOf(split); if (colonNdx != -1) { pattern = name.substring(colonNdx + 1).trim(); name = name.substring(0, colonNdx).trim(); } this.patterns[i] = pattern; this.names[i] = name; // iterate offset = ndx[3]; i++; } if (offset < actionPath.length()) { fixed[i] = actionPath.substring(offset); } else { fixed[i] = StringPool.EMPTY; } return true; } }
public class class_name { @Override public boolean init(final String actionPath, final String[] separators) { String prefix = separators[0]; String split = separators[1]; String suffix = separators[2]; macrosCount = StringUtil.count(actionPath, prefix); if (macrosCount == 0) { return false; // depends on control dependency: [if], data = [none] } names = new String[macrosCount]; patterns = new String[macrosCount]; fixed = new String[macrosCount + 1]; int offset = 0; int i = 0; while (true) { int[] ndx = StringUtil.indexOfRegion(actionPath, prefix, suffix, offset); if (ndx == null) { break; } fixed[i] = actionPath.substring(offset, ndx[0]); // depends on control dependency: [while], data = [none] String name = actionPath.substring(ndx[1], ndx[2]); // name:pattern String pattern = null; int colonNdx = name.indexOf(split); if (colonNdx != -1) { pattern = name.substring(colonNdx + 1).trim(); // depends on control dependency: [if], data = [(colonNdx] name = name.substring(0, colonNdx).trim(); // depends on control dependency: [if], data = [none] } this.patterns[i] = pattern; // depends on control dependency: [while], data = [none] this.names[i] = name; // depends on control dependency: [while], data = [none] // iterate offset = ndx[3]; // depends on control dependency: [while], data = [none] i++; // depends on control dependency: [while], data = [none] } if (offset < actionPath.length()) { fixed[i] = actionPath.substring(offset); // depends on control dependency: [if], data = [(offset] } else { fixed[i] = StringPool.EMPTY; // depends on control dependency: [if], data = [none] } return true; } }
public class class_name { public static Type getInterfaceTarget(final Class<?> iface, final Type type) throws IllegalArgumentException { if (type instanceof ParameterizedType) { final ParameterizedType pt = (ParameterizedType) type; if (iface.isAssignableFrom((Class<?>) pt.getRawType())) { final Type t = pt.getActualTypeArguments()[0]; return t; } else { throw new IllegalArgumentException("Parameterized type " + type + " does not extend " + iface); } } else if (type instanceof Class) { final Class<?> clazz = (Class<?>) type; if (!clazz.equals(type)) { throw new IllegalArgumentException("The clazz is " + clazz + " and the type is " + type + ". They must be equal to each other."); } final ArrayList<Type> al = new ArrayList<>(); al.addAll(Arrays.asList(clazz.getGenericInterfaces())); final Type sc = clazz.getGenericSuperclass(); if (sc != null) { al.add(sc); } final Type[] interfaces = al.toArray(new Type[0]); for (final Type genericNameType : interfaces) { if (genericNameType instanceof ParameterizedType) { final ParameterizedType ptype = (ParameterizedType) genericNameType; if (ptype.getRawType().equals(iface)) { final Type t = ptype.getActualTypeArguments()[0]; return t; } } } throw new IllegalArgumentException(clazz + " does not directly implement " + iface); } else { throw new UnsupportedOperationException("Do not know how to get interface target of " + type); } } }
public class class_name { public static Type getInterfaceTarget(final Class<?> iface, final Type type) throws IllegalArgumentException { if (type instanceof ParameterizedType) { final ParameterizedType pt = (ParameterizedType) type; if (iface.isAssignableFrom((Class<?>) pt.getRawType())) { final Type t = pt.getActualTypeArguments()[0]; return t; // depends on control dependency: [if], data = [none] } else { throw new IllegalArgumentException("Parameterized type " + type + " does not extend " + iface); } } else if (type instanceof Class) { final Class<?> clazz = (Class<?>) type; if (!clazz.equals(type)) { throw new IllegalArgumentException("The clazz is " + clazz + " and the type is " + type + ". They must be equal to each other."); } final ArrayList<Type> al = new ArrayList<>(); al.addAll(Arrays.asList(clazz.getGenericInterfaces())); final Type sc = clazz.getGenericSuperclass(); if (sc != null) { al.add(sc); // depends on control dependency: [if], data = [(sc] } final Type[] interfaces = al.toArray(new Type[0]); for (final Type genericNameType : interfaces) { if (genericNameType instanceof ParameterizedType) { final ParameterizedType ptype = (ParameterizedType) genericNameType; if (ptype.getRawType().equals(iface)) { final Type t = ptype.getActualTypeArguments()[0]; return t; // depends on control dependency: [if], data = [none] } } } throw new IllegalArgumentException(clazz + " does not directly implement " + iface); } else { throw new UnsupportedOperationException("Do not know how to get interface target of " + type); } } }
public class class_name { private boolean isEqual(Object o1, Object o2) { // Both null - they are equal if (o1 == null && o2 == null) { return true; } // One is null and the other isn't - they are not equal if ((o1 == null && o2 != null) || (o1 != null && o2 == null)) { return false; } // Otherwise fight it out amongst themselves return o1.equals(o2); } }
public class class_name { private boolean isEqual(Object o1, Object o2) { // Both null - they are equal if (o1 == null && o2 == null) { return true; // depends on control dependency: [if], data = [none] } // One is null and the other isn't - they are not equal if ((o1 == null && o2 != null) || (o1 != null && o2 == null)) { return false; // depends on control dependency: [if], data = [none] } // Otherwise fight it out amongst themselves return o1.equals(o2); } }
public class class_name { protected Promise disconnect() { if (group != null) { try { group.shutdownGracefully(1, 1, TimeUnit.SECONDS).await(1, TimeUnit.SECONDS); } catch (InterruptedException ignored) { } finally { group = null; } } if (resources != null) { try { resources.shutdown(1, 1, TimeUnit.SECONDS).await(1, TimeUnit.SECONDS); } catch (InterruptedException ignored) { } finally { resources = null; } } if (acceptor != null) { try { acceptor.shutdownNow(); } catch (Exception ignored) { } finally { acceptor = null; } } return Promise.resolve(); } }
public class class_name { protected Promise disconnect() { if (group != null) { try { group.shutdownGracefully(1, 1, TimeUnit.SECONDS).await(1, TimeUnit.SECONDS); // depends on control dependency: [try], data = [none] } catch (InterruptedException ignored) { } finally { // depends on control dependency: [catch], data = [none] group = null; } } if (resources != null) { try { resources.shutdown(1, 1, TimeUnit.SECONDS).await(1, TimeUnit.SECONDS); // depends on control dependency: [try], data = [none] } catch (InterruptedException ignored) { } finally { // depends on control dependency: [catch], data = [none] resources = null; } } if (acceptor != null) { try { acceptor.shutdownNow(); // depends on control dependency: [try], data = [none] } catch (Exception ignored) { } finally { // depends on control dependency: [catch], data = [none] acceptor = null; } } return Promise.resolve(); } }
public class class_name { public PlaybackState getFurthestPlaybackState() { PlaybackState result = null; for (PlaybackState state : playbackStateMap.values()) { if (result == null || (!result.playing && state.playing) || (result.position < state.position) && (state.playing || !result.playing)) { result = state; } } return result; } }
public class class_name { public PlaybackState getFurthestPlaybackState() { PlaybackState result = null; for (PlaybackState state : playbackStateMap.values()) { if (result == null || (!result.playing && state.playing) || (result.position < state.position) && (state.playing || !result.playing)) { result = state; // depends on control dependency: [if], data = [none] } } return result; } }
public class class_name { private void setExpectedPropertiesIfNull(Properties hotRodConfiguration) { for ( int i = 0; i < expectedValuesForHotRod.length; i++ ) { String property = expectedValuesForHotRod[i][0]; String expectedValue = expectedValuesForHotRod[i][1]; if ( !hotRodConfiguration.containsKey( property ) ) { hotRodConfiguration.setProperty( property, expectedValue ); } } } }
public class class_name { private void setExpectedPropertiesIfNull(Properties hotRodConfiguration) { for ( int i = 0; i < expectedValuesForHotRod.length; i++ ) { String property = expectedValuesForHotRod[i][0]; String expectedValue = expectedValuesForHotRod[i][1]; if ( !hotRodConfiguration.containsKey( property ) ) { hotRodConfiguration.setProperty( property, expectedValue ); // depends on control dependency: [if], data = [none] } } } }
public class class_name { CRC32 fixErasedBlock( FileSystem srcFs, FileStatus srcStat, FileSystem parityFs, Path parityFile, boolean fixSource, long blockSize, long errorOffset, long limit, boolean partial, OutputStream out, StripeInfo si, Context context, boolean skipVerify) throws IOException, InterruptedException { configureBuffers(blockSize); Progressable reporter = context; if (reporter == null) { reporter = RaidUtils.NULL_PROGRESSABLE; } Path srcFile = srcStat.getPath(); LOG.info("Code: " + this.codec.id + " simulation: " + this.codec.simulateBlockFix); if (this.codec.simulateBlockFix) { String oldId = getOldCodeId(srcStat); if (oldId == null) { // Couldn't find old codec for block fixing, throw exception instead throw new IOException("Couldn't find old parity files for " + srcFile + ". Won't reconstruct the block since code " + this.codec.id + " is still under test"); } if (partial) { throw new IOException("Couldn't reconstruct the partial data because " + "old decoders don't support it"); } Decoder decoder = (oldId.equals("xor"))? new XORDecoder(conf): new ReedSolomonDecoder(conf); CRC32 newCRC = null; long newLen = 0; if (!skipVerify) { newCRC = new CRC32(); newLen = this.fixErasedBlockImpl(srcFs, srcFile, parityFs, parityFile, fixSource, blockSize, errorOffset, limit, partial, null, context, newCRC, null, false, null); } CRC32 oldCRC = (skipVerify && checksumStore == null)? null: new CRC32(); long oldLen = decoder.fixErasedBlockImpl(srcFs, srcFile, parityFs, parityFile, fixSource, blockSize, errorOffset, limit, partial, out, context, oldCRC, si, false, null); if (!skipVerify) { if (newCRC.getValue() != oldCRC.getValue() || newLen != oldLen) { LOG.error(" New code " + codec.id + " produces different data from old code " + oldId + " during fixing " + (fixSource ? srcFile.toString() : parityFile.toString()) + " (offset=" + errorOffset + ", limit=" + limit + ")" + " checksum:" + newCRC.getValue() + ", " + oldCRC.getValue() + " len:" + newLen + ", " + oldLen); LogUtils.logRaidReconstructionMetrics(LOGRESULTS.FAILURE, 0, codec, -1, -1, -1, numReadBytes, numReadBytesRemoteRack, (fixSource ? srcFile : parityFile), errorOffset, LOGTYPES.OFFLINE_RECONSTRUCTION_SIMULATION, (fixSource ? srcFs : parityFs), null, context, -1); if (context != null) { context.getCounter(RaidCounter.BLOCK_FIX_SIMULATION_FAILED).increment(1L); // The key includes the file path and simulation failure state String outkey = DistBlockIntegrityMonitor.SIMULATION_FAILED_FILE + ","; if (fixSource) { outkey += srcFile.toUri().getPath(); } else { outkey += parityFile.toUri().getPath(); } // The value is the task id String outval = context.getConfiguration().get("mapred.task.id"); context.write(new Text(outkey), new Text(outval)); } } else { LOG.info(" New code " + codec.id + " produces the same data with old code " + oldId + " during fixing " + (fixSource ? srcFile.toString() : parityFile.toString()) + " (offset=" + errorOffset + ", limit=" + limit + ")" ); if (context != null) { context.getCounter(RaidCounter.BLOCK_FIX_SIMULATION_SUCCEEDED).increment(1L); } } } return oldCRC; } else { CRC32 crc = null; if (checksumStore != null) { crc = new CRC32(); } fixErasedBlockImpl(srcFs, srcFile, parityFs, parityFile, fixSource, blockSize, errorOffset, limit, partial, out, context, crc, si, false, null); return crc; } } }
public class class_name { CRC32 fixErasedBlock( FileSystem srcFs, FileStatus srcStat, FileSystem parityFs, Path parityFile, boolean fixSource, long blockSize, long errorOffset, long limit, boolean partial, OutputStream out, StripeInfo si, Context context, boolean skipVerify) throws IOException, InterruptedException { configureBuffers(blockSize); Progressable reporter = context; if (reporter == null) { reporter = RaidUtils.NULL_PROGRESSABLE; } Path srcFile = srcStat.getPath(); LOG.info("Code: " + this.codec.id + " simulation: " + this.codec.simulateBlockFix); if (this.codec.simulateBlockFix) { String oldId = getOldCodeId(srcStat); if (oldId == null) { // Couldn't find old codec for block fixing, throw exception instead throw new IOException("Couldn't find old parity files for " + srcFile + ". Won't reconstruct the block since code " + this.codec.id + " is still under test"); } if (partial) { throw new IOException("Couldn't reconstruct the partial data because " + "old decoders don't support it"); } Decoder decoder = (oldId.equals("xor"))? new XORDecoder(conf): new ReedSolomonDecoder(conf); CRC32 newCRC = null; long newLen = 0; if (!skipVerify) { newCRC = new CRC32(); // depends on control dependency: [if], data = [none] newLen = this.fixErasedBlockImpl(srcFs, srcFile, parityFs, parityFile, fixSource, blockSize, errorOffset, limit, partial, null, context, newCRC, null, false, null); // depends on control dependency: [if], data = [none] } CRC32 oldCRC = (skipVerify && checksumStore == null)? null: new CRC32(); long oldLen = decoder.fixErasedBlockImpl(srcFs, srcFile, parityFs, parityFile, fixSource, blockSize, errorOffset, limit, partial, out, context, oldCRC, si, false, null); if (!skipVerify) { if (newCRC.getValue() != oldCRC.getValue() || newLen != oldLen) { LOG.error(" New code " + codec.id + " produces different data from old code " + oldId + " during fixing " + (fixSource ? srcFile.toString() : parityFile.toString()) + " (offset=" + errorOffset + ", limit=" + limit + ")" + " checksum:" + newCRC.getValue() + ", " + oldCRC.getValue() + " len:" + newLen + ", " + oldLen); // depends on control dependency: [if], data = [none] LogUtils.logRaidReconstructionMetrics(LOGRESULTS.FAILURE, 0, codec, -1, -1, -1, numReadBytes, numReadBytesRemoteRack, (fixSource ? srcFile : parityFile), errorOffset, LOGTYPES.OFFLINE_RECONSTRUCTION_SIMULATION, (fixSource ? srcFs : parityFs), null, context, -1); // depends on control dependency: [if], data = [none] if (context != null) { context.getCounter(RaidCounter.BLOCK_FIX_SIMULATION_FAILED).increment(1L); // depends on control dependency: [if], data = [none] // The key includes the file path and simulation failure state String outkey = DistBlockIntegrityMonitor.SIMULATION_FAILED_FILE + ","; if (fixSource) { outkey += srcFile.toUri().getPath(); // depends on control dependency: [if], data = [none] } else { outkey += parityFile.toUri().getPath(); // depends on control dependency: [if], data = [none] } // The value is the task id String outval = context.getConfiguration().get("mapred.task.id"); context.write(new Text(outkey), new Text(outval)); // depends on control dependency: [if], data = [none] } } else { LOG.info(" New code " + codec.id + " produces the same data with old code " + oldId + " during fixing " + (fixSource ? srcFile.toString() : parityFile.toString()) + " (offset=" + errorOffset + ", limit=" + limit + ")" ); // depends on control dependency: [if], data = [none] if (context != null) { context.getCounter(RaidCounter.BLOCK_FIX_SIMULATION_SUCCEEDED).increment(1L); // depends on control dependency: [if], data = [none] } } } return oldCRC; } else { CRC32 crc = null; if (checksumStore != null) { crc = new CRC32(); // depends on control dependency: [if], data = [none] } fixErasedBlockImpl(srcFs, srcFile, parityFs, parityFile, fixSource, blockSize, errorOffset, limit, partial, out, context, crc, si, false, null); return crc; } } }
public class class_name { public void marshall(CreateClusterRequest createClusterRequest, ProtocolMarshaller protocolMarshaller) { if (createClusterRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createClusterRequest.getName(), NAME_BINDING); protocolMarshaller.marshall(createClusterRequest.getVersion(), VERSION_BINDING); protocolMarshaller.marshall(createClusterRequest.getRoleArn(), ROLEARN_BINDING); protocolMarshaller.marshall(createClusterRequest.getResourcesVpcConfig(), RESOURCESVPCCONFIG_BINDING); protocolMarshaller.marshall(createClusterRequest.getLogging(), LOGGING_BINDING); protocolMarshaller.marshall(createClusterRequest.getClientRequestToken(), CLIENTREQUESTTOKEN_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(CreateClusterRequest createClusterRequest, ProtocolMarshaller protocolMarshaller) { if (createClusterRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createClusterRequest.getName(), NAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createClusterRequest.getVersion(), VERSION_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createClusterRequest.getRoleArn(), ROLEARN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createClusterRequest.getResourcesVpcConfig(), RESOURCESVPCCONFIG_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createClusterRequest.getLogging(), LOGGING_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(createClusterRequest.getClientRequestToken(), CLIENTREQUESTTOKEN_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] } }