code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { public <T> String marshal(final T object) { if (object == null) { throw new IllegalArgumentException("object parameter is null"); } ObjectWriter writer = objectMapper.writer().withDefaultPrettyPrinter(); String results = null; try { results = writer.writeValueAsString(object); } catch (JsonGenerationException e) { System.err.println("JsonGenerationException, message=" + e.getMessage()); } catch (JsonMappingException e) { e.printStackTrace(); System.err.println("JsonMappingException, message=" + e.getMessage()); } catch (IOException e) { System.err.println("IOException, message=" + e.getMessage()); } return (results); } }
public class class_name { public <T> String marshal(final T object) { if (object == null) { throw new IllegalArgumentException("object parameter is null"); } ObjectWriter writer = objectMapper.writer().withDefaultPrettyPrinter(); String results = null; try { results = writer.writeValueAsString(object); // depends on control dependency: [try], data = [none] } catch (JsonGenerationException e) { System.err.println("JsonGenerationException, message=" + e.getMessage()); } catch (JsonMappingException e) { // depends on control dependency: [catch], data = [none] e.printStackTrace(); System.err.println("JsonMappingException, message=" + e.getMessage()); } catch (IOException e) { // depends on control dependency: [catch], data = [none] System.err.println("IOException, message=" + e.getMessage()); } // depends on control dependency: [catch], data = [none] return (results); } }
public class class_name { public GetInventoryResult withEntities(InventoryResultEntity... entities) { if (this.entities == null) { setEntities(new com.amazonaws.internal.SdkInternalList<InventoryResultEntity>(entities.length)); } for (InventoryResultEntity ele : entities) { this.entities.add(ele); } return this; } }
public class class_name { public GetInventoryResult withEntities(InventoryResultEntity... entities) { if (this.entities == null) { setEntities(new com.amazonaws.internal.SdkInternalList<InventoryResultEntity>(entities.length)); // depends on control dependency: [if], data = [none] } for (InventoryResultEntity ele : entities) { this.entities.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public void forceFlushWithBestEffort() { LOG.info("Forcing to flush data to socket with best effort."); while (!outgoingPacketsToWrite.isEmpty()) { int writeState = outgoingPacketsToWrite.poll().writeToChannel(socketChannel); if (writeState != 0) { LOG.info("Failed to write more to Socket. Clear and finish the flush."); clear(); return; } } } }
public class class_name { public void forceFlushWithBestEffort() { LOG.info("Forcing to flush data to socket with best effort."); while (!outgoingPacketsToWrite.isEmpty()) { int writeState = outgoingPacketsToWrite.poll().writeToChannel(socketChannel); if (writeState != 0) { LOG.info("Failed to write more to Socket. Clear and finish the flush."); // depends on control dependency: [if], data = [none] clear(); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } } } }
public class class_name { @Override public int compareTo(ChronoLocalDate other) { int cmp = Jdk8Methods.compareLongs(toEpochDay(), other.toEpochDay()); if (cmp == 0) { cmp = getChronology().compareTo(other.getChronology()); } return cmp; } }
public class class_name { @Override public int compareTo(ChronoLocalDate other) { int cmp = Jdk8Methods.compareLongs(toEpochDay(), other.toEpochDay()); if (cmp == 0) { cmp = getChronology().compareTo(other.getChronology()); // depends on control dependency: [if], data = [none] } return cmp; } }
public class class_name { public void updateDates(long dateLastModified, long dateExpires) { int pos = m_flexContextInfoList.size() - 1; if (pos < 0) { // ensure a valid position is used return; } (m_flexContextInfoList.get(pos)).updateDates(dateLastModified, dateExpires); } }
public class class_name { public void updateDates(long dateLastModified, long dateExpires) { int pos = m_flexContextInfoList.size() - 1; if (pos < 0) { // ensure a valid position is used return; // depends on control dependency: [if], data = [none] } (m_flexContextInfoList.get(pos)).updateDates(dateLastModified, dateExpires); } }
public class class_name { protected void open() { if (!m_enabled) { return; } m_openClose.setDown(true); if (m_maxCellWidth == 0) { initMaxCellWidth(); } int selectorWidth = m_maxCellWidth; // should not be any wider than the actual window int windowWidth = Window.getClientWidth(); if (m_maxCellWidth > windowWidth) { selectorWidth = windowWidth - 10; } // if the resize option is deactivated the popup should not be wider than the selectbox. // Default its true. if (!m_resizePopup) { selectorWidth = m_opener.getOffsetWidth() - 2; } m_popup.setWidth(selectorWidth + "px"); m_popup.setWidget(m_selector); m_popup.show(); positionPopup(); } }
public class class_name { protected void open() { if (!m_enabled) { return; // depends on control dependency: [if], data = [none] } m_openClose.setDown(true); if (m_maxCellWidth == 0) { initMaxCellWidth(); // depends on control dependency: [if], data = [none] } int selectorWidth = m_maxCellWidth; // should not be any wider than the actual window int windowWidth = Window.getClientWidth(); if (m_maxCellWidth > windowWidth) { selectorWidth = windowWidth - 10; // depends on control dependency: [if], data = [none] } // if the resize option is deactivated the popup should not be wider than the selectbox. // Default its true. if (!m_resizePopup) { selectorWidth = m_opener.getOffsetWidth() - 2; // depends on control dependency: [if], data = [none] } m_popup.setWidth(selectorWidth + "px"); m_popup.setWidget(m_selector); m_popup.show(); positionPopup(); } }
public class class_name { public void reportAsHeaders(HttpServletResponse rsp) { rsp.addHeader("X-You-Are-Authenticated-As",authentication.getName()); if (REPORT_GROUP_HEADERS) { for (GrantedAuthority auth : authentication.getAuthorities()) { rsp.addHeader("X-You-Are-In-Group",auth.getAuthority()); } } else { rsp.addHeader("X-You-Are-In-Group-Disabled", "JENKINS-39402: use -Dhudson.security.AccessDeniedException2.REPORT_GROUP_HEADERS=true or use /whoAmI to diagnose"); } rsp.addHeader("X-Required-Permission", permission.getId()); for (Permission p=permission.impliedBy; p!=null; p=p.impliedBy) { rsp.addHeader("X-Permission-Implied-By", p.getId()); } } }
public class class_name { public void reportAsHeaders(HttpServletResponse rsp) { rsp.addHeader("X-You-Are-Authenticated-As",authentication.getName()); if (REPORT_GROUP_HEADERS) { for (GrantedAuthority auth : authentication.getAuthorities()) { rsp.addHeader("X-You-Are-In-Group",auth.getAuthority()); // depends on control dependency: [for], data = [auth] } } else { rsp.addHeader("X-You-Are-In-Group-Disabled", "JENKINS-39402: use -Dhudson.security.AccessDeniedException2.REPORT_GROUP_HEADERS=true or use /whoAmI to diagnose"); // depends on control dependency: [if], data = [none] } rsp.addHeader("X-Required-Permission", permission.getId()); for (Permission p=permission.impliedBy; p!=null; p=p.impliedBy) { rsp.addHeader("X-Permission-Implied-By", p.getId()); // depends on control dependency: [for], data = [p] } } }
public class class_name { public static void setAndroidLScanningDisabled(boolean disabled) { sAndroidLScanningDisabled = disabled; BeaconManager instance = sInstance; if (instance != null) { instance.applySettings(); } } }
public class class_name { public static void setAndroidLScanningDisabled(boolean disabled) { sAndroidLScanningDisabled = disabled; BeaconManager instance = sInstance; if (instance != null) { instance.applySettings(); // depends on control dependency: [if], data = [none] } } }
public class class_name { public java.util.List<RoleUsageType> getRoleUsageList() { if (roleUsageList == null) { roleUsageList = new com.amazonaws.internal.SdkInternalList<RoleUsageType>(); } return roleUsageList; } }
public class class_name { public java.util.List<RoleUsageType> getRoleUsageList() { if (roleUsageList == null) { roleUsageList = new com.amazonaws.internal.SdkInternalList<RoleUsageType>(); // depends on control dependency: [if], data = [none] } return roleUsageList; } }
public class class_name { private boolean possiblySuspendOrResumeSupervisorInternal(String id, boolean suspend) { Pair<Supervisor, SupervisorSpec> pair = supervisors.get(id); if (pair == null || pair.rhs.isSuspended() == suspend) { return false; } SupervisorSpec nextState = suspend ? pair.rhs.createSuspendedSpec() : pair.rhs.createRunningSpec(); possiblyStopAndRemoveSupervisorInternal(nextState.getId(), false); return createAndStartSupervisorInternal(nextState, true); } }
public class class_name { private boolean possiblySuspendOrResumeSupervisorInternal(String id, boolean suspend) { Pair<Supervisor, SupervisorSpec> pair = supervisors.get(id); if (pair == null || pair.rhs.isSuspended() == suspend) { return false; // depends on control dependency: [if], data = [none] } SupervisorSpec nextState = suspend ? pair.rhs.createSuspendedSpec() : pair.rhs.createRunningSpec(); possiblyStopAndRemoveSupervisorInternal(nextState.getId(), false); return createAndStartSupervisorInternal(nextState, true); } }
public class class_name { protected int unicodeEscapeLexer(int c) throws IOException { int ret = 0; // ignore 'u' (assume c==\ now) and read 4 hex digits c = in.read(); code.clear(); try { for (int i = 0; i < 4; i++) { c = in.read(); if (isEndOfFile(c) || isEndOfLine(c)) { throw new NumberFormatException("number too short"); } code.append((char) c); } ret = Integer.parseInt(code.toString(), 16); } catch (NumberFormatException e) { throw new IOException( "(line " + getLineNumber() + ") Wrong unicode escape sequence found '" + code.toString() + "'" + e.toString()); } return ret; } }
public class class_name { protected int unicodeEscapeLexer(int c) throws IOException { int ret = 0; // ignore 'u' (assume c==\ now) and read 4 hex digits c = in.read(); code.clear(); try { for (int i = 0; i < 4; i++) { c = in.read(); // depends on control dependency: [for], data = [none] if (isEndOfFile(c) || isEndOfLine(c)) { throw new NumberFormatException("number too short"); } code.append((char) c); // depends on control dependency: [for], data = [none] } ret = Integer.parseInt(code.toString(), 16); } catch (NumberFormatException e) { throw new IOException( "(line " + getLineNumber() + ") Wrong unicode escape sequence found '" + code.toString() + "'" + e.toString()); } return ret; } }
public class class_name { public boolean saveJMXSettings() { Log log = config.getLog(); // create and validate file File settingsFile = getSettingsFile(); // create the jmx properties state Properties properties = new Properties(); saveSetting(properties, "EdenSpace", edenSpace); saveSetting(properties, "SurvivorSpace", survivorSpace); saveSetting(properties, "PermGen", permGen); saveSetting(properties, "TenuredGen", tenuredGen); saveSetting(properties, "YoungCollector", youngCollector); saveSetting(properties, "TenuredCollector", tenuredCollector); // save the properties String comment = "Saved JMX settings on " + new Date(); FileOutputStream out = null; try { out = new FileOutputStream(settingsFile); properties.store(out, comment); } catch (IOException ioe) { log.error("Unable to save JMX settings: " + ioe.getMessage()); log.error(ioe); return false; } finally { try { if (out != null) { out.close(); } } catch (IOException e) { /* ignore */ } } // success return true; } }
public class class_name { public boolean saveJMXSettings() { Log log = config.getLog(); // create and validate file File settingsFile = getSettingsFile(); // create the jmx properties state Properties properties = new Properties(); saveSetting(properties, "EdenSpace", edenSpace); saveSetting(properties, "SurvivorSpace", survivorSpace); saveSetting(properties, "PermGen", permGen); saveSetting(properties, "TenuredGen", tenuredGen); saveSetting(properties, "YoungCollector", youngCollector); saveSetting(properties, "TenuredCollector", tenuredCollector); // save the properties String comment = "Saved JMX settings on " + new Date(); FileOutputStream out = null; try { out = new FileOutputStream(settingsFile); // depends on control dependency: [try], data = [none] properties.store(out, comment); // depends on control dependency: [try], data = [none] } catch (IOException ioe) { log.error("Unable to save JMX settings: " + ioe.getMessage()); log.error(ioe); return false; } // depends on control dependency: [catch], data = [none] finally { try { if (out != null) { out.close(); } } // depends on control dependency: [if], data = [none] catch (IOException e) { /* ignore */ } // depends on control dependency: [catch], data = [none] } // success return true; } }
public class class_name { public void negotiateFormats(MediaDescriptionField media) { // Clean currently offered formats this.offeredFormats.clean(); // Map payload types to RTP Format for (String payloadType : media.getPayloadTypes()) { RTPFormat format; try { int payloadTypeInt = Integer.parseInt(payloadType); if(payloadTypeInt < AVProfile.DYNAMIC_PT_MIN || payloadTypeInt > AVProfile.DYNAMIC_PT_MAX) { // static payload type format = AVProfile.getFormat(payloadTypeInt, AVProfile.AUDIO); } else { // dynamic payload type final RtpMapAttribute codecSdp = media.getFormat(payloadTypeInt); final String codecName = codecSdp.getCodec(); final RTPFormat staticFormat = AVProfile.getFormat(codecName); // Check if code is supported final boolean supported = staticFormat != null && staticFormat.getClockRate() == codecSdp.getClockRate(); if(supported) { format = new RTPFormat(payloadTypeInt, staticFormat.getFormat(), staticFormat.getClockRate()); } else { format = null; } } } catch (NumberFormatException e) { format = null; } if(format != null) { this.offeredFormats.add(format); } else { if (logger.isDebugEnabled()) { logger.debug(this.mediaType + " channel " + this.ssrc + " dropped unsupported RTP payload type " + payloadType); } } } // Negotiate the formats and store intersection this.negotiatedFormats.clean(); this.supportedFormats.intersection(this.offeredFormats, this.negotiatedFormats); // Apply formats setFormats(this.negotiatedFormats); this.negotiated = true; } }
public class class_name { public void negotiateFormats(MediaDescriptionField media) { // Clean currently offered formats this.offeredFormats.clean(); // Map payload types to RTP Format for (String payloadType : media.getPayloadTypes()) { RTPFormat format; try { int payloadTypeInt = Integer.parseInt(payloadType); if(payloadTypeInt < AVProfile.DYNAMIC_PT_MIN || payloadTypeInt > AVProfile.DYNAMIC_PT_MAX) { // static payload type format = AVProfile.getFormat(payloadTypeInt, AVProfile.AUDIO); // depends on control dependency: [if], data = [none] } else { // dynamic payload type final RtpMapAttribute codecSdp = media.getFormat(payloadTypeInt); final String codecName = codecSdp.getCodec(); final RTPFormat staticFormat = AVProfile.getFormat(codecName); // Check if code is supported final boolean supported = staticFormat != null && staticFormat.getClockRate() == codecSdp.getClockRate(); if(supported) { format = new RTPFormat(payloadTypeInt, staticFormat.getFormat(), staticFormat.getClockRate()); // depends on control dependency: [if], data = [none] } else { format = null; // depends on control dependency: [if], data = [none] } } } catch (NumberFormatException e) { format = null; } // depends on control dependency: [catch], data = [none] if(format != null) { this.offeredFormats.add(format); // depends on control dependency: [if], data = [(format] } else { if (logger.isDebugEnabled()) { logger.debug(this.mediaType + " channel " + this.ssrc + " dropped unsupported RTP payload type " + payloadType); // depends on control dependency: [if], data = [none] } } } // Negotiate the formats and store intersection this.negotiatedFormats.clean(); this.supportedFormats.intersection(this.offeredFormats, this.negotiatedFormats); // Apply formats setFormats(this.negotiatedFormats); this.negotiated = true; } }
public class class_name { public EClass getIfcLuminousFluxMeasure() { if (ifcLuminousFluxMeasureEClass == null) { ifcLuminousFluxMeasureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(700); } return ifcLuminousFluxMeasureEClass; } }
public class class_name { public EClass getIfcLuminousFluxMeasure() { if (ifcLuminousFluxMeasureEClass == null) { ifcLuminousFluxMeasureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(700); // depends on control dependency: [if], data = [none] } return ifcLuminousFluxMeasureEClass; } }
public class class_name { public static <T> T objectDeepCopyWithBlackList(Object from, Object to, Class<?> baseClass, String... blockFields) { List<String> bFields = getDeclaredFields(baseClass); for (String blockField : blockFields) { bFields.add(blockField); } return objectDeepCopyWithBlackList(from, to, bFields.toArray(new String[bFields.size()])); } }
public class class_name { public static <T> T objectDeepCopyWithBlackList(Object from, Object to, Class<?> baseClass, String... blockFields) { List<String> bFields = getDeclaredFields(baseClass); for (String blockField : blockFields) { bFields.add(blockField); // depends on control dependency: [for], data = [blockField] } return objectDeepCopyWithBlackList(from, to, bFields.toArray(new String[bFields.size()])); } }
public class class_name { @Override public void store(final URI type, final Record record) { if (KS.RESOURCE.equals(type)) { getHbaseUtils().processPut(record, hbaseUtils.getHbaseTableNamePrefix() + DEFAULT_RES_TAB_NAME, DEFAULT_RES_FAM_NAME, DEFAULT_RES_QUA_NAME); } else if (KS.MENTION.equals(type)) { getHbaseUtils().processPut(record, hbaseUtils.getHbaseTableNamePrefix() + DEFAULT_MEN_TAB_NAME, DEFAULT_MEN_FAM_NAME, DEFAULT_MEN_QUA_NAME); } else if (KS.ENTITY.equals(type)) { getHbaseUtils().processPut(record, hbaseUtils.getHbaseTableNamePrefix() + DEFAULT_ENT_TAB_NAME, DEFAULT_ENT_FAM_NAME, DEFAULT_ENT_QUA_NAME); } else if (KS.CONTEXT.equals(type)) { getHbaseUtils().processPut(record, hbaseUtils.getHbaseTableNamePrefix() + DEFAULT_CON_TAB_NAME, DEFAULT_CON_FAM_NAME, DEFAULT_CON_QUA_NAME); } else if (KS.USER.equals(type)) { getHbaseUtils().processPut(record, hbaseUtils.getHbaseTableNamePrefix() + DEFAULT_USR_TAB_NAME, DEFAULT_USR_FAM_NAME, DEFAULT_USR_QUA_NAME); } else { throw new IllegalArgumentException("Unsupported record:\n" + record.toString(Data.getNamespaceMap(), true)); } } }
public class class_name { @Override public void store(final URI type, final Record record) { if (KS.RESOURCE.equals(type)) { getHbaseUtils().processPut(record, hbaseUtils.getHbaseTableNamePrefix() + DEFAULT_RES_TAB_NAME, DEFAULT_RES_FAM_NAME, DEFAULT_RES_QUA_NAME); // depends on control dependency: [if], data = [none] } else if (KS.MENTION.equals(type)) { getHbaseUtils().processPut(record, hbaseUtils.getHbaseTableNamePrefix() + DEFAULT_MEN_TAB_NAME, DEFAULT_MEN_FAM_NAME, DEFAULT_MEN_QUA_NAME); // depends on control dependency: [if], data = [none] } else if (KS.ENTITY.equals(type)) { getHbaseUtils().processPut(record, hbaseUtils.getHbaseTableNamePrefix() + DEFAULT_ENT_TAB_NAME, DEFAULT_ENT_FAM_NAME, DEFAULT_ENT_QUA_NAME); // depends on control dependency: [if], data = [none] } else if (KS.CONTEXT.equals(type)) { getHbaseUtils().processPut(record, hbaseUtils.getHbaseTableNamePrefix() + DEFAULT_CON_TAB_NAME, DEFAULT_CON_FAM_NAME, DEFAULT_CON_QUA_NAME); // depends on control dependency: [if], data = [none] } else if (KS.USER.equals(type)) { getHbaseUtils().processPut(record, hbaseUtils.getHbaseTableNamePrefix() + DEFAULT_USR_TAB_NAME, DEFAULT_USR_FAM_NAME, DEFAULT_USR_QUA_NAME); // depends on control dependency: [if], data = [none] } else { throw new IllegalArgumentException("Unsupported record:\n" + record.toString(Data.getNamespaceMap(), true)); } } }
public class class_name { public Object repushContextClassLoader(Object origLoader, ClassLoader loader) { if (origLoader == UNCHANGED) { return pushContextClassLoader(loader); } setContextClassLoader(Thread.currentThread(), loader); return origLoader; } }
public class class_name { public Object repushContextClassLoader(Object origLoader, ClassLoader loader) { if (origLoader == UNCHANGED) { return pushContextClassLoader(loader); // depends on control dependency: [if], data = [none] } setContextClassLoader(Thread.currentThread(), loader); return origLoader; } }
public class class_name { public static SObject of(String key, InputStream is) { try { return new InputStreamSObject(key, $.requireNotNull(is)); } catch (Exception e) { return getInvalidObject(key, e); } } }
public class class_name { public static SObject of(String key, InputStream is) { try { return new InputStreamSObject(key, $.requireNotNull(is)); // depends on control dependency: [try], data = [none] } catch (Exception e) { return getInvalidObject(key, e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void marshall(GetWorkGroupRequest getWorkGroupRequest, ProtocolMarshaller protocolMarshaller) { if (getWorkGroupRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getWorkGroupRequest.getWorkGroup(), WORKGROUP_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(GetWorkGroupRequest getWorkGroupRequest, ProtocolMarshaller protocolMarshaller) { if (getWorkGroupRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(getWorkGroupRequest.getWorkGroup(), WORKGROUP_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 { protected void error(E error) { this.error = checkNotNull(error); this.completed = true; for (Callback<T, E> callback : toBeNotified) { callback.error(error); } } }
public class class_name { protected void error(E error) { this.error = checkNotNull(error); this.completed = true; for (Callback<T, E> callback : toBeNotified) { callback.error(error); // depends on control dependency: [for], data = [callback] } } }
public class class_name { public static void main(String[] args) throws IOException, NoSuchAlgorithmException, InvalidKeyException, XmlPullParserException { try { /* play.min.io for test and development. */ MinioClient minioClient = new MinioClient("https://play.min.io:9000", "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"); /* Amazon S3: */ // MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID", // "YOUR-SECRETACCESSKEY"); // Check whether 'my-bucketname' exist or not. boolean found = minioClient.bucketExists("my-bucketname"); if (found) { // List all incomplete multipart upload of objects in 'my-bucketname' Iterable<Result<Upload>> myObjects = minioClient.listIncompleteUploads("my-bucketname"); for (Result<Upload> result : myObjects) { Upload upload = result.get(); System.out.println(upload.uploadId() + ", " + upload.objectName()); } } else { System.out.println("my-bucketname does not exist"); } } catch (MinioException e) { System.out.println("Error occurred: " + e); } } }
public class class_name { public static void main(String[] args) throws IOException, NoSuchAlgorithmException, InvalidKeyException, XmlPullParserException { try { /* play.min.io for test and development. */ MinioClient minioClient = new MinioClient("https://play.min.io:9000", "Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"); /* Amazon S3: */ // MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID", // "YOUR-SECRETACCESSKEY"); // Check whether 'my-bucketname' exist or not. boolean found = minioClient.bucketExists("my-bucketname"); if (found) { // List all incomplete multipart upload of objects in 'my-bucketname' Iterable<Result<Upload>> myObjects = minioClient.listIncompleteUploads("my-bucketname"); for (Result<Upload> result : myObjects) { Upload upload = result.get(); System.out.println(upload.uploadId() + ", " + upload.objectName()); // depends on control dependency: [for], data = [none] } } else { System.out.println("my-bucketname does not exist"); } } catch (MinioException e) { System.out.println("Error occurred: " + e); } } }
public class class_name { public Observable<JobDetails> findScheduledJobs(Date timeSlice, rx.Scheduler scheduler) { return session.executeAndFetch(findAllScheduled.bind(), scheduler) .filter(filterNullJobs) .filter(row -> row.getTimestamp(0).compareTo(timeSlice) <= 0) .map(row -> createJobDetails( row.getUUID(1), row.getString(2), row.getString(3), row.getMap(4, String.class, String.class), getTrigger(row.getUDTValue(5)), JobStatus.fromCode(row.getByte(6)), timeSlice)) .collect(HashMap::new, (Map<UUID, SortedSet<JobDetails>> map, JobDetails details) -> { SortedSet<JobDetails> set = map.get(details.getJobId()); if (set == null) { set = new TreeSet<>((JobDetails d1, JobDetails d2) -> Long.compare(d1.getTrigger().getTriggerTime(), d2.getTrigger().getTriggerTime())); } set.add(details); map.put(details.getJobId(), set); }) .flatMap(map -> Observable.from(map.entrySet())) .map(entry -> entry.getValue().first()); } }
public class class_name { public Observable<JobDetails> findScheduledJobs(Date timeSlice, rx.Scheduler scheduler) { return session.executeAndFetch(findAllScheduled.bind(), scheduler) .filter(filterNullJobs) .filter(row -> row.getTimestamp(0).compareTo(timeSlice) <= 0) .map(row -> createJobDetails( row.getUUID(1), row.getString(2), row.getString(3), row.getMap(4, String.class, String.class), getTrigger(row.getUDTValue(5)), JobStatus.fromCode(row.getByte(6)), timeSlice)) .collect(HashMap::new, (Map<UUID, SortedSet<JobDetails>> map, JobDetails details) -> { SortedSet<JobDetails> set = map.get(details.getJobId()); if (set == null) { set = new TreeSet<>((JobDetails d1, JobDetails d2) -> Long.compare(d1.getTrigger().getTriggerTime(), d2.getTrigger().getTriggerTime())); // depends on control dependency: [if], data = [none] } set.add(details); map.put(details.getJobId(), set); }) .flatMap(map -> Observable.from(map.entrySet())) .map(entry -> entry.getValue().first()); } }
public class class_name { public String getObjectId(Object obj) { Identity oid = null; PersistenceBroker broker = null; try { if (getCurrentDatabase() != null) { /** * is there an open database we are calling getObjectId against? if yes, use it */ broker = PersistenceBrokerFactory.createPersistenceBroker(getCurrentDatabase().getPBKey()); } else { log.warn("Can't find open database, try to use the default configuration"); /** * otherwise, use default. */ broker = PersistenceBrokerFactory.defaultPersistenceBroker(); } oid = broker.serviceIdentity().buildIdentity(obj); } finally { if(broker != null) { broker.close(); } } return new String(SerializationUtils.serialize(oid)); } }
public class class_name { public String getObjectId(Object obj) { Identity oid = null; PersistenceBroker broker = null; try { if (getCurrentDatabase() != null) { /** * is there an open database we are calling getObjectId against? if yes, use it */ broker = PersistenceBrokerFactory.createPersistenceBroker(getCurrentDatabase().getPBKey()); // depends on control dependency: [if], data = [(getCurrentDatabase()] } else { log.warn("Can't find open database, try to use the default configuration"); // depends on control dependency: [if], data = [none] /** * otherwise, use default. */ broker = PersistenceBrokerFactory.defaultPersistenceBroker(); // depends on control dependency: [if], data = [none] } oid = broker.serviceIdentity().buildIdentity(obj); // depends on control dependency: [try], data = [none] } finally { if(broker != null) { broker.close(); // depends on control dependency: [if], data = [none] } } return new String(SerializationUtils.serialize(oid)); } }
public class class_name { @Override public final void setPickUpPlace(final PickUpPlace pPickUpPlace) { this.pickUpPlace = pPickUpPlace; if (this.itsId == null) { this.itsId = new SeServicePlaceId(); } this.itsId.setPickUpPlace(this.pickUpPlace); } }
public class class_name { @Override public final void setPickUpPlace(final PickUpPlace pPickUpPlace) { this.pickUpPlace = pPickUpPlace; if (this.itsId == null) { this.itsId = new SeServicePlaceId(); // depends on control dependency: [if], data = [none] } this.itsId.setPickUpPlace(this.pickUpPlace); } }
public class class_name { public boolean postProcess() { boolean success = true; if ( options.getStylesheetFile() == null ) { success &= copyResource(options.getJavadocVersion().getStylesheet(), "stylesheet.css", "CSS stylesheet"); } if ( options.isHighlightEnabled() ) { success &= copyResource("highlight.pack.7.3.js", "highlight.pack.js", "highlight.js"); success &= copyResource("highlight-LICENSE.txt", "highlight-LICENSE.txt", "highlight.js license"); success &= copyResource("classref.txt", "classref.txt", "highlight.js class reference"); success &= copyResource("highlight-styles/" + options.getHighlightStyle() + ".css", "highlight.css", "highlight.js style '" + options.getHighlightStyle() + "'"); } else { success &= copyResource("no-highlight.css", "highlight.css", "no-highlight CSS"); } return success; } }
public class class_name { public boolean postProcess() { boolean success = true; if ( options.getStylesheetFile() == null ) { success &= copyResource(options.getJavadocVersion().getStylesheet(), "stylesheet.css", "CSS stylesheet"); // depends on control dependency: [if], data = [none] } if ( options.isHighlightEnabled() ) { success &= copyResource("highlight.pack.7.3.js", "highlight.pack.js", "highlight.js"); // depends on control dependency: [if], data = [none] success &= copyResource("highlight-LICENSE.txt", "highlight-LICENSE.txt", "highlight.js license"); // depends on control dependency: [if], data = [none] success &= copyResource("classref.txt", "classref.txt", "highlight.js class reference"); // depends on control dependency: [if], data = [none] success &= copyResource("highlight-styles/" + options.getHighlightStyle() + ".css", "highlight.css", "highlight.js style '" + options.getHighlightStyle() + "'"); // depends on control dependency: [if], data = [none] } else { success &= copyResource("no-highlight.css", "highlight.css", "no-highlight CSS"); // depends on control dependency: [if], data = [none] } return success; } }
public class class_name { @Override public String marshall(final T obj) { try { return obj.name(); } catch (final RuntimeException e) { throw failure(e, "Unable to marshall the instance of " + obj.getClass() + " into a string"); } } }
public class class_name { @Override public String marshall(final T obj) { try { return obj.name(); // depends on control dependency: [try], data = [none] } catch (final RuntimeException e) { throw failure(e, "Unable to marshall the instance of " + obj.getClass() + " into a string"); } // depends on control dependency: [catch], data = [none] } }
public class class_name { protected MongodbQueue<ID, DATA> setMongoClient(MongoClient mongoClient, boolean setMyOwnMongoClient) { if (myOwnMongoClient && this.mongoClient != null) { this.mongoClient.close(); } this.mongoClient = mongoClient; myOwnMongoClient = setMyOwnMongoClient; return this; } }
public class class_name { protected MongodbQueue<ID, DATA> setMongoClient(MongoClient mongoClient, boolean setMyOwnMongoClient) { if (myOwnMongoClient && this.mongoClient != null) { this.mongoClient.close(); // depends on control dependency: [if], data = [none] } this.mongoClient = mongoClient; myOwnMongoClient = setMyOwnMongoClient; return this; } }
public class class_name { public static void main(String[] args) { if (args.length != 2) { System.err.println("Usage: StyleImport <url> <output_file>"); System.exit(0); } try { StyleImport si = new StyleImport(args[0]); FileOutputStream os = new FileOutputStream(args[1]); si.dumpTo(os); os.close(); System.out.println("Done."); } catch (Exception e) { System.err.println("Error: "+e.getMessage()); e.printStackTrace(); } } }
public class class_name { public static void main(String[] args) { if (args.length != 2) { System.err.println("Usage: StyleImport <url> <output_file>"); // depends on control dependency: [if], data = [none] System.exit(0); // depends on control dependency: [if], data = [none] } try { StyleImport si = new StyleImport(args[0]); FileOutputStream os = new FileOutputStream(args[1]); si.dumpTo(os); // depends on control dependency: [try], data = [none] os.close(); // depends on control dependency: [try], data = [none] System.out.println("Done."); // depends on control dependency: [try], data = [none] } catch (Exception e) { System.err.println("Error: "+e.getMessage()); e.printStackTrace(); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private JsDocToken recordDescription(JsDocToken token) { // Find marker's description (if applicable). if (jsdocBuilder.shouldParseDocumentation()) { ExtractionInfo descriptionInfo = extractMultilineTextualBlock(token); token = descriptionInfo.token; } else { token = eatTokensUntilEOL(token); } return token; } }
public class class_name { private JsDocToken recordDescription(JsDocToken token) { // Find marker's description (if applicable). if (jsdocBuilder.shouldParseDocumentation()) { ExtractionInfo descriptionInfo = extractMultilineTextualBlock(token); token = descriptionInfo.token; // depends on control dependency: [if], data = [none] } else { token = eatTokensUntilEOL(token); // depends on control dependency: [if], data = [none] } return token; } }
public class class_name { public static void invokeInThread(DirectInvocation invocation) { boolean retry = true; while (retry) { invocation.run(); if (invocation.retry == null) { retry = false; } else { try { if (invocation.retry.task != null) { invocation.retry.task.get(); } else { Thread.sleep(invocation.retry.timeout); } } catch (Exception e) { throw new UnexpectedException(e); } retry = true; } } } }
public class class_name { public static void invokeInThread(DirectInvocation invocation) { boolean retry = true; while (retry) { invocation.run(); // depends on control dependency: [while], data = [none] if (invocation.retry == null) { retry = false; // depends on control dependency: [if], data = [none] } else { try { if (invocation.retry.task != null) { invocation.retry.task.get(); // depends on control dependency: [if], data = [none] } else { Thread.sleep(invocation.retry.timeout); // depends on control dependency: [if], data = [none] } } catch (Exception e) { throw new UnexpectedException(e); } // depends on control dependency: [catch], data = [none] retry = true; // depends on control dependency: [if], data = [none] } } } }
public class class_name { public int doFilter(Workspace ws, DataBinder binder, ExecutionContext ctx) throws DataException, ServiceException { String configFileName = (String) ctx.getCachedObject("filterParameter"); try { ClassLoader cl = getClass().getClassLoader(); Enumeration<URL> propFiles = cl.getResources(configFileName); // There should be at least one entry (TwineLib contains an example file) if (!propFiles.hasMoreElements()) { propFiles = getResources11g(cl, configFileName); } while (propFiles.hasMoreElements()) { URL propFile = propFiles.nextElement(); if (SystemUtils.m_verbose) { SystemUtils.trace("twine", "Loading config file: " + propFile.toString()); } IClassInjector filterInjector = new FilterInjector(); filterInjector.injectClasses(propFile); IClassInjector serviceInjector = new ServiceInjector(); serviceInjector.injectClasses(propFile); IClassInjector scriptInjector = new IdocScriptInjector(); scriptInjector.injectClasses(propFile); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return CONTINUE; } }
public class class_name { public int doFilter(Workspace ws, DataBinder binder, ExecutionContext ctx) throws DataException, ServiceException { String configFileName = (String) ctx.getCachedObject("filterParameter"); try { ClassLoader cl = getClass().getClassLoader(); Enumeration<URL> propFiles = cl.getResources(configFileName); // There should be at least one entry (TwineLib contains an example file) if (!propFiles.hasMoreElements()) { propFiles = getResources11g(cl, configFileName); // depends on control dependency: [if], data = [none] } while (propFiles.hasMoreElements()) { URL propFile = propFiles.nextElement(); if (SystemUtils.m_verbose) { SystemUtils.trace("twine", "Loading config file: " + propFile.toString()); // depends on control dependency: [if], data = [none] } IClassInjector filterInjector = new FilterInjector(); filterInjector.injectClasses(propFile); // depends on control dependency: [while], data = [none] IClassInjector serviceInjector = new ServiceInjector(); serviceInjector.injectClasses(propFile); // depends on control dependency: [while], data = [none] IClassInjector scriptInjector = new IdocScriptInjector(); scriptInjector.injectClasses(propFile); // depends on control dependency: [while], data = [none] } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return CONTINUE; } }
public class class_name { public void applyProperties(Properties props) { Iterator<?> iter = props.keySet().iterator(); while (iter.hasNext()) { String fullName = (String) iter.next(); String value = props.getProperty(fullName).trim(); if (fullName.indexOf(":") != -1 && value != null && value.length() > 0) { String name = fullName.substring(fullName.lastIndexOf(":") + 1); if (fullName.startsWith("server:")) { if (name.endsWith(".class")) { m_className = value; } else { setParameterValue(name, value, true); } } else if (fullName.startsWith("module.")) { String role = fullName.substring(7, fullName.lastIndexOf(":")); ModuleConfiguration module = getModuleConfiguration(role); if (module == null) { module = new ModuleConfiguration(new ArrayList<Parameter>(), role, null, null); m_moduleConfigurations.add(module); } if (name.endsWith(".class")) { module.setClassName(value); } else { module.setParameterValue(name, value, true); } } else if (fullName.startsWith("datastore.")) { String id = fullName.substring(10, fullName.lastIndexOf(":")); DatastoreConfiguration datastore = getDatastoreConfiguration(id); if (datastore == null) { datastore = new DatastoreConfiguration(new ArrayList<Parameter>(), id, null); m_datastoreConfigurations.add(datastore); } datastore.setParameterValue(name, value, true); } } } } }
public class class_name { public void applyProperties(Properties props) { Iterator<?> iter = props.keySet().iterator(); while (iter.hasNext()) { String fullName = (String) iter.next(); String value = props.getProperty(fullName).trim(); if (fullName.indexOf(":") != -1 && value != null && value.length() > 0) { String name = fullName.substring(fullName.lastIndexOf(":") + 1); if (fullName.startsWith("server:")) { if (name.endsWith(".class")) { m_className = value; // depends on control dependency: [if], data = [none] } else { setParameterValue(name, value, true); // depends on control dependency: [if], data = [none] } } else if (fullName.startsWith("module.")) { String role = fullName.substring(7, fullName.lastIndexOf(":")); ModuleConfiguration module = getModuleConfiguration(role); if (module == null) { module = new ModuleConfiguration(new ArrayList<Parameter>(), role, null, null); // depends on control dependency: [if], data = [none] m_moduleConfigurations.add(module); // depends on control dependency: [if], data = [(module] } if (name.endsWith(".class")) { module.setClassName(value); // depends on control dependency: [if], data = [none] } else { module.setParameterValue(name, value, true); // depends on control dependency: [if], data = [none] } } else if (fullName.startsWith("datastore.")) { String id = fullName.substring(10, fullName.lastIndexOf(":")); DatastoreConfiguration datastore = getDatastoreConfiguration(id); if (datastore == null) { datastore = new DatastoreConfiguration(new ArrayList<Parameter>(), id, null); // depends on control dependency: [if], data = [none] m_datastoreConfigurations.add(datastore); // depends on control dependency: [if], data = [(datastore] } datastore.setParameterValue(name, value, true); // depends on control dependency: [if], data = [none] } } } } }
public class class_name { @Deactivate protected synchronized void deactivate(int reason) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Deactivated: " + reason); } super.deactivate(MY_ALIAS, reason); repertoireMap.clear(); repertoirePIDMap.clear(); keystoreIdMap.clear(); keystorePidMap.clear(); SSLConfigManager.getInstance().clearSSLConfigMap(); KeyStoreManager.getInstance().clearKSMap(); AbstractJSSEProvider.clearSSLContextCache(); processConfig(true); this.componentContext = null; } }
public class class_name { @Deactivate protected synchronized void deactivate(int reason) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Deactivated: " + reason); // depends on control dependency: [if], data = [none] } super.deactivate(MY_ALIAS, reason); repertoireMap.clear(); repertoirePIDMap.clear(); keystoreIdMap.clear(); keystorePidMap.clear(); SSLConfigManager.getInstance().clearSSLConfigMap(); KeyStoreManager.getInstance().clearKSMap(); AbstractJSSEProvider.clearSSLContextCache(); processConfig(true); this.componentContext = null; } }
public class class_name { void addColumn(String family, String qualifier, Class<?> clazz) { Preconditions.checkNotNull(family, "family name"); Preconditions.checkNotNull(qualifier, "qualifier name"); Preconditions.checkNotNull(clazz, "class type"); Map<String, TypeInformation<?>> qualifierMap = this.familyMap.get(family); if (!HBaseRowInputFormat.isSupportedType(clazz)) { // throw exception throw new IllegalArgumentException("Unsupported class type found " + clazz + ". " + "Better to use byte[].class and deserialize using user defined scalar functions"); } if (qualifierMap == null) { qualifierMap = new LinkedHashMap<>(); } qualifierMap.put(qualifier, TypeExtractor.getForClass(clazz)); familyMap.put(family, qualifierMap); } }
public class class_name { void addColumn(String family, String qualifier, Class<?> clazz) { Preconditions.checkNotNull(family, "family name"); Preconditions.checkNotNull(qualifier, "qualifier name"); Preconditions.checkNotNull(clazz, "class type"); Map<String, TypeInformation<?>> qualifierMap = this.familyMap.get(family); if (!HBaseRowInputFormat.isSupportedType(clazz)) { // throw exception throw new IllegalArgumentException("Unsupported class type found " + clazz + ". " + "Better to use byte[].class and deserialize using user defined scalar functions"); } if (qualifierMap == null) { qualifierMap = new LinkedHashMap<>(); // depends on control dependency: [if], data = [none] } qualifierMap.put(qualifier, TypeExtractor.getForClass(clazz)); familyMap.put(family, qualifierMap); } }
public class class_name { @Override public int countByG_K_T(long groupId, String key, int type) { FinderPath finderPath = FINDER_PATH_COUNT_BY_G_K_T; Object[] finderArgs = new Object[] { groupId, key, type }; Long count = (Long)finderCache.getResult(finderPath, finderArgs, this); if (count == null) { StringBundler query = new StringBundler(4); query.append(_SQL_COUNT_CPMEASUREMENTUNIT_WHERE); query.append(_FINDER_COLUMN_G_K_T_GROUPID_2); boolean bindKey = false; if (key == null) { query.append(_FINDER_COLUMN_G_K_T_KEY_1); } else if (key.equals("")) { query.append(_FINDER_COLUMN_G_K_T_KEY_3); } else { bindKey = true; query.append(_FINDER_COLUMN_G_K_T_KEY_2); } query.append(_FINDER_COLUMN_G_K_T_TYPE_2); String sql = query.toString(); Session session = null; try { session = openSession(); Query q = session.createQuery(sql); QueryPos qPos = QueryPos.getInstance(q); qPos.add(groupId); if (bindKey) { qPos.add(StringUtil.toLowerCase(key)); } qPos.add(type); count = (Long)q.uniqueResult(); finderCache.putResult(finderPath, finderArgs, count); } catch (Exception e) { finderCache.removeResult(finderPath, finderArgs); throw processException(e); } finally { closeSession(session); } } return count.intValue(); } }
public class class_name { @Override public int countByG_K_T(long groupId, String key, int type) { FinderPath finderPath = FINDER_PATH_COUNT_BY_G_K_T; Object[] finderArgs = new Object[] { groupId, key, type }; Long count = (Long)finderCache.getResult(finderPath, finderArgs, this); if (count == null) { StringBundler query = new StringBundler(4); query.append(_SQL_COUNT_CPMEASUREMENTUNIT_WHERE); // depends on control dependency: [if], data = [none] query.append(_FINDER_COLUMN_G_K_T_GROUPID_2); // depends on control dependency: [if], data = [none] boolean bindKey = false; if (key == null) { query.append(_FINDER_COLUMN_G_K_T_KEY_1); // depends on control dependency: [if], data = [none] } else if (key.equals("")) { query.append(_FINDER_COLUMN_G_K_T_KEY_3); // depends on control dependency: [if], data = [none] } else { bindKey = true; // depends on control dependency: [if], data = [none] query.append(_FINDER_COLUMN_G_K_T_KEY_2); // depends on control dependency: [if], data = [none] } query.append(_FINDER_COLUMN_G_K_T_TYPE_2); // depends on control dependency: [if], data = [none] String sql = query.toString(); Session session = null; try { session = openSession(); // depends on control dependency: [try], data = [none] Query q = session.createQuery(sql); QueryPos qPos = QueryPos.getInstance(q); qPos.add(groupId); // depends on control dependency: [try], data = [none] if (bindKey) { qPos.add(StringUtil.toLowerCase(key)); // depends on control dependency: [if], data = [none] } qPos.add(type); // depends on control dependency: [try], data = [none] count = (Long)q.uniqueResult(); // depends on control dependency: [try], data = [none] finderCache.putResult(finderPath, finderArgs, count); // depends on control dependency: [try], data = [none] } catch (Exception e) { finderCache.removeResult(finderPath, finderArgs); throw processException(e); } // depends on control dependency: [catch], data = [none] finally { closeSession(session); } } return count.intValue(); } }
public class class_name { protected String getEncryptionKey() { if (extendedMetadata != null && extendedMetadata.getEncryptionKey() != null) { return extendedMetadata.getEncryptionKey(); } else { return keyManager.getDefaultCredentialName(); } } }
public class class_name { protected String getEncryptionKey() { if (extendedMetadata != null && extendedMetadata.getEncryptionKey() != null) { return extendedMetadata.getEncryptionKey(); // depends on control dependency: [if], data = [none] } else { return keyManager.getDefaultCredentialName(); // depends on control dependency: [if], data = [none] } } }
public class class_name { private static Map<String,String> getRankMap(Object[] params){ if (params == null) { return null; } HashMap<String,String> result = new HashMap<>(); for (int i = 0; i < params.length; i++) { String name = params[i] instanceof Parameter ? ((Parameter) params[i]).name() : ((TypeVariable) params[i]).typeName(); result.put(name, String.valueOf(i)); } return result; } }
public class class_name { private static Map<String,String> getRankMap(Object[] params){ if (params == null) { return null; // depends on control dependency: [if], data = [none] } HashMap<String,String> result = new HashMap<>(); for (int i = 0; i < params.length; i++) { String name = params[i] instanceof Parameter ? ((Parameter) params[i]).name() : ((TypeVariable) params[i]).typeName(); result.put(name, String.valueOf(i)); // depends on control dependency: [for], data = [i] } return result; } }
public class class_name { public static LongStream of(final Supplier<LongList> supplier) { final LongIterator iter = new LongIteratorEx() { private LongIterator iterator = null; @Override public boolean hasNext() { if (iterator == null) { init(); } return iterator.hasNext(); } @Override public long nextLong() { if (iterator == null) { init(); } return iterator.nextLong(); } private void init() { final LongList c = supplier.get(); if (N.isNullOrEmpty(c)) { iterator = LongIterator.empty(); } else { iterator = c.iterator(); } } }; return of(iter); } }
public class class_name { public static LongStream of(final Supplier<LongList> supplier) { final LongIterator iter = new LongIteratorEx() { private LongIterator iterator = null; @Override public boolean hasNext() { if (iterator == null) { init(); // depends on control dependency: [if], data = [none] } return iterator.hasNext(); } @Override public long nextLong() { if (iterator == null) { init(); // depends on control dependency: [if], data = [none] } return iterator.nextLong(); } private void init() { final LongList c = supplier.get(); if (N.isNullOrEmpty(c)) { iterator = LongIterator.empty(); // depends on control dependency: [if], data = [none] } else { iterator = c.iterator(); // depends on control dependency: [if], data = [none] } } }; return of(iter); } }
public class class_name { protected <T> TypedResult<T> handleMissingResult() { // check if the monitoring thread is still there // we need to wait until we know what is going on if (monitoringThread.isAlive()) { return TypedResult.empty(); } // the job finished with an exception else if (executionException != null) { throw executionException; } // we assume that a bounded job finished else { return TypedResult.endOfStream(); } } }
public class class_name { protected <T> TypedResult<T> handleMissingResult() { // check if the monitoring thread is still there // we need to wait until we know what is going on if (monitoringThread.isAlive()) { return TypedResult.empty(); // depends on control dependency: [if], data = [none] } // the job finished with an exception else if (executionException != null) { throw executionException; } // we assume that a bounded job finished else { return TypedResult.endOfStream(); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public String getUserFacingMessage() { final StringBuilder bldr = new StringBuilder(); if (causes != null && causes.size() > 1) { bldr.append("SYMBOL WARNINGS"); } else { bldr.append("SYMBOL WARNING"); } final String name = getName(); if (name != null) { bldr.append(" in "); bldr.append(name); } bldr.append("\n\treason: "); final String msg = getMessage(); if (msg != null) { bldr.append(msg); } else { bldr.append("Unknown"); } if (causes != null) { Set<String> messages = new HashSet<String>(); for (final ResourceSyntaxWarning rsw : causes) { messages.add(rsw.getUserFacingMessage()); } final int numMessages = messages.size(), numCauses = causes.size(); if (numCauses > numMessages) { bldr.append(format(", %d unique warning(s)", numMessages)); } bldr.append("\n"); for (final String message : messages) { bldr.append("\t\t"); bldr.append(message); bldr.append("\n"); } } else { bldr.append("\n"); } return bldr.toString(); } }
public class class_name { @Override public String getUserFacingMessage() { final StringBuilder bldr = new StringBuilder(); if (causes != null && causes.size() > 1) { bldr.append("SYMBOL WARNINGS"); // depends on control dependency: [if], data = [none] } else { bldr.append("SYMBOL WARNING"); // depends on control dependency: [if], data = [none] } final String name = getName(); if (name != null) { bldr.append(" in "); // depends on control dependency: [if], data = [none] bldr.append(name); // depends on control dependency: [if], data = [(name] } bldr.append("\n\treason: "); final String msg = getMessage(); if (msg != null) { bldr.append(msg); // depends on control dependency: [if], data = [(msg] } else { bldr.append("Unknown"); // depends on control dependency: [if], data = [none] } if (causes != null) { Set<String> messages = new HashSet<String>(); for (final ResourceSyntaxWarning rsw : causes) { messages.add(rsw.getUserFacingMessage()); // depends on control dependency: [for], data = [rsw] } final int numMessages = messages.size(), numCauses = causes.size(); if (numCauses > numMessages) { bldr.append(format(", %d unique warning(s)", numMessages)); // depends on control dependency: [if], data = [numMessages)] } bldr.append("\n"); // depends on control dependency: [if], data = [none] for (final String message : messages) { bldr.append("\t\t"); // depends on control dependency: [for], data = [none] bldr.append(message); // depends on control dependency: [for], data = [message] bldr.append("\n"); // depends on control dependency: [for], data = [none] } } else { bldr.append("\n"); // depends on control dependency: [if], data = [none] } return bldr.toString(); } }
public class class_name { public void marshall(S3ContentLocation s3ContentLocation, ProtocolMarshaller protocolMarshaller) { if (s3ContentLocation == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(s3ContentLocation.getBucketARN(), BUCKETARN_BINDING); protocolMarshaller.marshall(s3ContentLocation.getFileKey(), FILEKEY_BINDING); protocolMarshaller.marshall(s3ContentLocation.getObjectVersion(), OBJECTVERSION_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(S3ContentLocation s3ContentLocation, ProtocolMarshaller protocolMarshaller) { if (s3ContentLocation == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(s3ContentLocation.getBucketARN(), BUCKETARN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(s3ContentLocation.getFileKey(), FILEKEY_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(s3ContentLocation.getObjectVersion(), OBJECTVERSION_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static MaskedText maskInUrl(String url){ MaskedText result = new MaskedText(); result.setClearText(url); result.setText(url); result.setMasked(null); if (url != null){ Matcher urlMatcher = URL_PATTERN.matcher(url); if (urlMatcher.find()) { Matcher pwdMatcher = PASSWORD_IN_URL_PATTERN.matcher(url); if (pwdMatcher.find()){ result.setText(pwdMatcher.replaceFirst(PASSWORD_IN_URL_MASK)); String s = pwdMatcher.group(); // with leading ":" and trailing "@" result.setMasked(s.substring(1, s.length()-1)); } } } return result; } }
public class class_name { public static MaskedText maskInUrl(String url){ MaskedText result = new MaskedText(); result.setClearText(url); result.setText(url); result.setMasked(null); if (url != null){ Matcher urlMatcher = URL_PATTERN.matcher(url); if (urlMatcher.find()) { Matcher pwdMatcher = PASSWORD_IN_URL_PATTERN.matcher(url); if (pwdMatcher.find()){ result.setText(pwdMatcher.replaceFirst(PASSWORD_IN_URL_MASK)); // depends on control dependency: [if], data = [none] String s = pwdMatcher.group(); // with leading ":" and trailing "@" result.setMasked(s.substring(1, s.length()-1)); // depends on control dependency: [if], data = [none] } } } return result; } }
public class class_name { public static void apply(Face type, TextView... textViews){ if(textViews.length == 0) return; for (int i = 0; i < textViews.length; i++) { apply(textViews[i], type); } } }
public class class_name { public static void apply(Face type, TextView... textViews){ if(textViews.length == 0) return; for (int i = 0; i < textViews.length; i++) { apply(textViews[i], type); // depends on control dependency: [for], data = [i] } } }
public class class_name { private boolean isSwitcherChange(boolean switcherStatus) { boolean ret = false; if (switcherStatus != lastHeartBeatSwitcherStatus) { ret = true; lastHeartBeatSwitcherStatus = switcherStatus; logger.info("heartbeat switcher change to " + switcherStatus); } return ret; } }
public class class_name { private boolean isSwitcherChange(boolean switcherStatus) { boolean ret = false; if (switcherStatus != lastHeartBeatSwitcherStatus) { ret = true; // depends on control dependency: [if], data = [none] lastHeartBeatSwitcherStatus = switcherStatus; // depends on control dependency: [if], data = [none] logger.info("heartbeat switcher change to " + switcherStatus); // depends on control dependency: [if], data = [none] } return ret; } }
public class class_name { static String concatFilePathNames(String leftPath, String rightPath, String fileSep) { String leftPathTrimmed = leftPath.trim(); String rightPathTrimmed = rightPath.trim(); if (leftPathTrimmed.isEmpty()) { return rightPath; } if (leftPathTrimmed.endsWith(fileSep) && rightPathTrimmed.startsWith(fileSep)) { return leftPathTrimmed + rightPathTrimmed.substring(1); } else if (!leftPathTrimmed.endsWith(fileSep) && !rightPathTrimmed.startsWith(fileSep)) { return leftPathTrimmed + fileSep + rightPathTrimmed; } else { return leftPathTrimmed + rightPathTrimmed; } } }
public class class_name { static String concatFilePathNames(String leftPath, String rightPath, String fileSep) { String leftPathTrimmed = leftPath.trim(); String rightPathTrimmed = rightPath.trim(); if (leftPathTrimmed.isEmpty()) { return rightPath; // depends on control dependency: [if], data = [none] } if (leftPathTrimmed.endsWith(fileSep) && rightPathTrimmed.startsWith(fileSep)) { return leftPathTrimmed + rightPathTrimmed.substring(1); // depends on control dependency: [if], data = [none] } else if (!leftPathTrimmed.endsWith(fileSep) && !rightPathTrimmed.startsWith(fileSep)) { return leftPathTrimmed + fileSep + rightPathTrimmed; // depends on control dependency: [if], data = [none] } else { return leftPathTrimmed + rightPathTrimmed; // depends on control dependency: [if], data = [none] } } }
public class class_name { private final boolean addSlot(final int slot, final int key) { if (slot < allocated) { moveElementsRight(keys, slot); } allocated++; keys[slot] = key; return true; } }
public class class_name { private final boolean addSlot(final int slot, final int key) { if (slot < allocated) { moveElementsRight(keys, slot); // depends on control dependency: [if], data = [none] } allocated++; keys[slot] = key; return true; } }
public class class_name { public float[][] getPhi() { float[][] phi = new float[K][V]; if (SAMPLE_LAG > 0) { for (int k = 0; k < K; k++) { for (int w = 0; w < V; w++) { phi[k][w] = phisum[k][w] / numstats; } } } else { for (int k = 0; k < K; k++) { for (int w = 0; w < V; w++) { phi[k][w] = (word_topic_matrix[w][k] + beta) / (nwsum[k] + V * beta); } } } return phi; } }
public class class_name { public float[][] getPhi() { float[][] phi = new float[K][V]; if (SAMPLE_LAG > 0) { for (int k = 0; k < K; k++) { for (int w = 0; w < V; w++) { phi[k][w] = phisum[k][w] / numstats; // depends on control dependency: [for], data = [w] } } } else { for (int k = 0; k < K; k++) { for (int w = 0; w < V; w++) { phi[k][w] = (word_topic_matrix[w][k] + beta) / (nwsum[k] + V * beta); // depends on control dependency: [for], data = [w] } } } return phi; } }
public class class_name { public static DoubleList toDoubleList(Collection<?> inputList, String propertyPath) { if (inputList.size() == 0) { return new DoubleList(0); } DoubleList outputList = new DoubleList(inputList.size()); if (propertyPath.contains(".") || propertyPath.contains("[")) { String[] properties = StringScanner.splitByDelimiters(propertyPath, ".[]"); for (Object o : inputList) { outputList.add(BeanUtils.getPropertyDouble(o, properties)); } } else { Map<String, FieldAccess> fields = BeanUtils.getFieldsFromObject(inputList.iterator().next()); FieldAccess fieldAccess = fields.get(propertyPath); for (Object o : inputList) { outputList.add(fieldAccess.getDouble(o)); } } return outputList; } }
public class class_name { public static DoubleList toDoubleList(Collection<?> inputList, String propertyPath) { if (inputList.size() == 0) { return new DoubleList(0); // depends on control dependency: [if], data = [0)] } DoubleList outputList = new DoubleList(inputList.size()); if (propertyPath.contains(".") || propertyPath.contains("[")) { String[] properties = StringScanner.splitByDelimiters(propertyPath, ".[]"); for (Object o : inputList) { outputList.add(BeanUtils.getPropertyDouble(o, properties)); // depends on control dependency: [for], data = [o] } } else { Map<String, FieldAccess> fields = BeanUtils.getFieldsFromObject(inputList.iterator().next()); FieldAccess fieldAccess = fields.get(propertyPath); for (Object o : inputList) { outputList.add(fieldAccess.getDouble(o)); // depends on control dependency: [for], data = [o] } } return outputList; } }
public class class_name { private void apply(HyphenationPattern pattern, int pos) { int internalOffset = pos - 2; HyphenationPatternPosition[] positions = pattern.getHyphenationPositions(); for (HyphenationPatternPosition hyphenationPosition : positions) { int i = hyphenationPosition.index + internalOffset; if ((i >= 0) && (i < this.rankings.length) && (hyphenationPosition.ranking > this.rankings[i])) { this.rankings[i] = hyphenationPosition.ranking; } } } }
public class class_name { private void apply(HyphenationPattern pattern, int pos) { int internalOffset = pos - 2; HyphenationPatternPosition[] positions = pattern.getHyphenationPositions(); for (HyphenationPatternPosition hyphenationPosition : positions) { int i = hyphenationPosition.index + internalOffset; if ((i >= 0) && (i < this.rankings.length) && (hyphenationPosition.ranking > this.rankings[i])) { this.rankings[i] = hyphenationPosition.ranking; // depends on control dependency: [if], data = [none] } } } }
public class class_name { private void processUDF(UDFTypeType udf) { FieldTypeClass fieldType = FIELD_TYPE_MAP.get(udf.getSubjectArea()); if (fieldType != null) { UserFieldDataType dataType = UserFieldDataType.getInstanceFromXmlName(udf.getDataType()); String name = udf.getTitle(); FieldType field = addUserDefinedField(fieldType, dataType, name); if (field != null) { m_fieldTypeMap.put(udf.getObjectId(), field); } } } }
public class class_name { private void processUDF(UDFTypeType udf) { FieldTypeClass fieldType = FIELD_TYPE_MAP.get(udf.getSubjectArea()); if (fieldType != null) { UserFieldDataType dataType = UserFieldDataType.getInstanceFromXmlName(udf.getDataType()); String name = udf.getTitle(); FieldType field = addUserDefinedField(fieldType, dataType, name); if (field != null) { m_fieldTypeMap.put(udf.getObjectId(), field); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public static Titan0Edge createEdge(Titan0Graph graph, Edge source) { if (source == null) { return null; } return new Titan0Edge(graph, source); } }
public class class_name { public static Titan0Edge createEdge(Titan0Graph graph, Edge source) { if (source == null) { return null; // depends on control dependency: [if], data = [none] } return new Titan0Edge(graph, source); } }
public class class_name { public Iterable<GitHub> findGithubConfig(Predicate<GitHubServerConfig> match) { Function<GitHubServerConfig, GitHub> loginFunction = loginToGithub(); if (Objects.isNull(loginFunction)) { return Collections.emptyList(); } // try all the credentials since we don't know which one would work return from(getConfigs()) .filter(match) .transform(loginFunction) .filter(Predicates.notNull()); } }
public class class_name { public Iterable<GitHub> findGithubConfig(Predicate<GitHubServerConfig> match) { Function<GitHubServerConfig, GitHub> loginFunction = loginToGithub(); if (Objects.isNull(loginFunction)) { return Collections.emptyList(); // depends on control dependency: [if], data = [none] } // try all the credentials since we don't know which one would work return from(getConfigs()) .filter(match) .transform(loginFunction) .filter(Predicates.notNull()); } }
public class class_name { protected final PackageDescr compilationUnit(PackageDescrBuilder pkg) throws RecognitionException { try { // package declaration? if (input.LA(1) != DRL6Lexer.EOF && helper.validateIdentifierKey(DroolsSoftKeywords.PACKAGE)) { String pkgName = packageStatement(pkg); pkg.name(pkgName); if (state.failed) return pkg.getDescr(); // unit declaration? // this is only allowed immediately after the package declaration if (input.LA(1) != DRL6Lexer.EOF && helper.validateIdentifierKey(DroolsSoftKeywords.UNIT)) { unitStatement(pkg); } } // statements while (input.LA(1) != DRL6Lexer.EOF) { int next = input.index(); if (helper.validateStatement(1)) { statement(pkg); if (state.failed) return pkg.getDescr(); if (next == input.index()) { // no token consumed, so, report problem: resyncToNextStatement(); } } else { resyncToNextStatement(); } if (input.LA(1) == DRL6Lexer.SEMICOLON) { match(input, DRL6Lexer.SEMICOLON, null, null, DroolsEditorType.SYMBOL); if (state.failed) return pkg.getDescr(); } } } catch (RecognitionException e) { helper.reportError(e); } catch (Exception e) { helper.reportError(e); } finally { helper.setEnd(pkg); } return pkg.getDescr(); } }
public class class_name { protected final PackageDescr compilationUnit(PackageDescrBuilder pkg) throws RecognitionException { try { // package declaration? if (input.LA(1) != DRL6Lexer.EOF && helper.validateIdentifierKey(DroolsSoftKeywords.PACKAGE)) { String pkgName = packageStatement(pkg); pkg.name(pkgName); if (state.failed) return pkg.getDescr(); // unit declaration? // this is only allowed immediately after the package declaration if (input.LA(1) != DRL6Lexer.EOF && helper.validateIdentifierKey(DroolsSoftKeywords.UNIT)) { unitStatement(pkg); // depends on control dependency: [if], data = [none] } } // statements while (input.LA(1) != DRL6Lexer.EOF) { int next = input.index(); if (helper.validateStatement(1)) { statement(pkg); // depends on control dependency: [if], data = [none] if (state.failed) return pkg.getDescr(); if (next == input.index()) { // no token consumed, so, report problem: resyncToNextStatement(); // depends on control dependency: [if], data = [none] } } else { resyncToNextStatement(); // depends on control dependency: [if], data = [none] } if (input.LA(1) == DRL6Lexer.SEMICOLON) { match(input, DRL6Lexer.SEMICOLON, null, null, DroolsEditorType.SYMBOL); // depends on control dependency: [if], data = [none] if (state.failed) return pkg.getDescr(); } } } catch (RecognitionException e) { helper.reportError(e); } catch (Exception e) { helper.reportError(e); } finally { helper.setEnd(pkg); } return pkg.getDescr(); } }
public class class_name { @SuppressWarnings({"unused", "WeakerAccess"}) void pushInAppNotificationStateEvent(boolean clicked, CTInAppNotification data, Bundle customData) { JSONObject event = new JSONObject(); try { JSONObject notif = getWzrkFields(data); if (customData != null) { for (String x : customData.keySet()) { Object value = customData.get(x); if (value != null) notif.put(x, value); } } if (clicked) { try { setWzrkParams(notif); } catch (Throwable t) { // no-op } event.put("evtName", Constants.NOTIFICATION_CLICKED_EVENT_NAME); } else { event.put("evtName", Constants.NOTIFICATION_VIEWED_EVENT_NAME); } event.put("evtData", notif); queueEvent(context, event, Constants.RAISED_EVENT); } catch (Throwable ignored) { // We won't get here } } }
public class class_name { @SuppressWarnings({"unused", "WeakerAccess"}) void pushInAppNotificationStateEvent(boolean clicked, CTInAppNotification data, Bundle customData) { JSONObject event = new JSONObject(); try { JSONObject notif = getWzrkFields(data); if (customData != null) { for (String x : customData.keySet()) { Object value = customData.get(x); if (value != null) notif.put(x, value); } } if (clicked) { try { setWzrkParams(notif); // depends on control dependency: [try], data = [none] } catch (Throwable t) { // no-op } // depends on control dependency: [catch], data = [none] event.put("evtName", Constants.NOTIFICATION_CLICKED_EVENT_NAME); // depends on control dependency: [if], data = [none] } else { event.put("evtName", Constants.NOTIFICATION_VIEWED_EVENT_NAME); // depends on control dependency: [if], data = [none] } event.put("evtData", notif); // depends on control dependency: [try], data = [none] queueEvent(context, event, Constants.RAISED_EVENT); // depends on control dependency: [try], data = [none] } catch (Throwable ignored) { // We won't get here } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static void loadPropsBySuffix(final File jobPath, final Props props, final String... suffixes) { try { if (jobPath.isDirectory()) { final File[] files = jobPath.listFiles(); if (files != null) { for (final File file : files) { loadPropsBySuffix(file, props, suffixes); } } } else if (endsWith(jobPath, suffixes)) { props.putAll(new Props(null, jobPath.getAbsolutePath())); } } catch (final IOException e) { throw new RuntimeException("Error loading schedule properties.", e); } } }
public class class_name { public static void loadPropsBySuffix(final File jobPath, final Props props, final String... suffixes) { try { if (jobPath.isDirectory()) { final File[] files = jobPath.listFiles(); if (files != null) { for (final File file : files) { loadPropsBySuffix(file, props, suffixes); // depends on control dependency: [for], data = [file] } } } else if (endsWith(jobPath, suffixes)) { props.putAll(new Props(null, jobPath.getAbsolutePath())); // depends on control dependency: [if], data = [none] } } catch (final IOException e) { throw new RuntimeException("Error loading schedule properties.", e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static Router register(Router router, Object... restApi) { Assert.notNull(router, "Missing vertx router!"); Assert.isTrue(restApi != null && restApi.length > 0, "Missing REST API class object!"); assert restApi != null; for (Object api : restApi) { if (api == null) { continue; } if (api instanceof Handler) { Handler handler = (Handler) api; router.route().handler(handler); continue; } // check if api is an instance of a class or a class type if (api instanceof Class) { Class inspectApi = (Class) api; try { api = ClassFactory.newInstanceOf(inspectApi, injectionProvider, null); } catch (ClassFactoryException | ContextException e) { throw new IllegalArgumentException(e.getMessage()); } } Map<RouteDefinition, Method> definitions = AnnotationProcessor.get(api.getClass()); for (RouteDefinition definition : definitions.keySet()) { // bind method execution Route route; if (definition.pathIsRegEx()) { route = router.routeWithRegex(definition.getMethod(), definition.getRoutePath()); } else { route = router.route(definition.getMethod(), definition.getRoutePath()); } log.info("Registering route: " + definition); if (definition.requestHasBody() && definition.getConsumes() != null) { // only register if request with body for (MediaType item : definition.getConsumes()) { route.consumes(MediaTypeHelper.getKey(item)); // ignore charset when binding } } if (definition.getProduces() != null) { for (MediaType item : definition.getProduces()) { route.produces(MediaTypeHelper.getKey(item)); // ignore charset when binding } } if (definition.getOrder() != 0) { route.order(definition.getOrder()); } // check body and reader compatibility beforehand checkBodyReader(definition); // add BodyHandler in case request has a body ... if (definition.requestHasBody()) { route.handler(BodyHandler.create()); } // add CookieHandler in case cookies are expected if (definition.hasCookies()) { route.handler(CookieHandler.create()); } // add security check handler in front of regular route handler if (definition.checkSecurity()) { route.handler(getSecurityHandler(definition)); } // bind handler // blocking or async Handler<RoutingContext> handler; Method method = definitions.get(definition); if (definition.isAsync()) { handler = getAsyncHandler(api, definition, method); } else { checkWriterCompatibility(definition); handler = getHandler(api, definition, method); } route.handler(handler); } } return router; } }
public class class_name { public static Router register(Router router, Object... restApi) { Assert.notNull(router, "Missing vertx router!"); Assert.isTrue(restApi != null && restApi.length > 0, "Missing REST API class object!"); assert restApi != null; for (Object api : restApi) { if (api == null) { continue; } if (api instanceof Handler) { Handler handler = (Handler) api; router.route().handler(handler); continue; } // check if api is an instance of a class or a class type if (api instanceof Class) { Class inspectApi = (Class) api; try { api = ClassFactory.newInstanceOf(inspectApi, injectionProvider, null); // depends on control dependency: [try], data = [none] } catch (ClassFactoryException | ContextException e) { throw new IllegalArgumentException(e.getMessage()); } // depends on control dependency: [catch], data = [none] } Map<RouteDefinition, Method> definitions = AnnotationProcessor.get(api.getClass()); for (RouteDefinition definition : definitions.keySet()) { // bind method execution Route route; if (definition.pathIsRegEx()) { route = router.routeWithRegex(definition.getMethod(), definition.getRoutePath()); } else { route = router.route(definition.getMethod(), definition.getRoutePath()); } log.info("Registering route: " + definition); if (definition.requestHasBody() && definition.getConsumes() != null) { // only register if request with body for (MediaType item : definition.getConsumes()) { route.consumes(MediaTypeHelper.getKey(item)); // ignore charset when binding // depends on control dependency: [for], data = [item] } } if (definition.getProduces() != null) { for (MediaType item : definition.getProduces()) { route.produces(MediaTypeHelper.getKey(item)); // ignore charset when binding } } if (definition.getOrder() != 0) { route.order(definition.getOrder()); } // check body and reader compatibility beforehand checkBodyReader(definition); // add BodyHandler in case request has a body ... if (definition.requestHasBody()) { route.handler(BodyHandler.create()); } // add CookieHandler in case cookies are expected if (definition.hasCookies()) { route.handler(CookieHandler.create()); } // add security check handler in front of regular route handler if (definition.checkSecurity()) { route.handler(getSecurityHandler(definition)); } // bind handler // blocking or async Handler<RoutingContext> handler; Method method = definitions.get(definition); if (definition.isAsync()) { handler = getAsyncHandler(api, definition, method); } else { checkWriterCompatibility(definition); handler = getHandler(api, definition, method); } route.handler(handler); } } return router; } }
public class class_name { public boolean add(String field, RDFNode result) { if (!this.result.containsKey(field)) { this.result.put(field, new ArrayList<RDFNode>()); } this.result.get(field).add(result); return true; } }
public class class_name { public boolean add(String field, RDFNode result) { if (!this.result.containsKey(field)) { this.result.put(field, new ArrayList<RDFNode>()); // depends on control dependency: [if], data = [none] } this.result.get(field).add(result); return true; } }
public class class_name { protected static StatementGroup findStatementGroup(PropertyIdValue pid, StatementDocument document) { for (StatementGroup sg : document.getStatementGroups()) { if (pid.equals(sg.getProperty())) { return sg; } } return null; } }
public class class_name { protected static StatementGroup findStatementGroup(PropertyIdValue pid, StatementDocument document) { for (StatementGroup sg : document.getStatementGroups()) { if (pid.equals(sg.getProperty())) { return sg; // depends on control dependency: [if], data = [none] } } return null; } }
public class class_name { public static Schema switchNamespace(Schema schema, Map<String, String> namespaceOverride) { Schema newSchema; String newNamespace = StringUtils.EMPTY; // Process all Schema Types // (Primitives are simply cloned) switch (schema.getType()) { case ENUM: newNamespace = namespaceOverride.containsKey(schema.getNamespace()) ? namespaceOverride.get(schema.getNamespace()) : schema.getNamespace(); newSchema = Schema.createEnum(schema.getName(), schema.getDoc(), newNamespace, schema.getEnumSymbols()); break; case FIXED: newNamespace = namespaceOverride.containsKey(schema.getNamespace()) ? namespaceOverride.get(schema.getNamespace()) : schema.getNamespace(); newSchema = Schema.createFixed(schema.getName(), schema.getDoc(), newNamespace, schema.getFixedSize()); break; case MAP: newSchema = Schema.createMap(switchNamespace(schema.getValueType(), namespaceOverride)); break; case RECORD: newNamespace = namespaceOverride.containsKey(schema.getNamespace()) ? namespaceOverride.get(schema.getNamespace()) : schema.getNamespace(); List<Schema.Field> newFields = new ArrayList<>(); if (schema.getFields().size() > 0) { for (Schema.Field oldField : schema.getFields()) { Field newField = new Field(oldField.name(), switchNamespace(oldField.schema(), namespaceOverride), oldField.doc(), oldField.defaultValue(), oldField.order()); newFields.add(newField); } } newSchema = Schema.createRecord(schema.getName(), schema.getDoc(), newNamespace, schema.isError()); newSchema.setFields(newFields); break; case UNION: List<Schema> newUnionMembers = new ArrayList<>(); if (null != schema.getTypes() && schema.getTypes().size() > 0) { for (Schema oldUnionMember : schema.getTypes()) { newUnionMembers.add(switchNamespace(oldUnionMember, namespaceOverride)); } } newSchema = Schema.createUnion(newUnionMembers); break; case ARRAY: newSchema = Schema.createArray(switchNamespace(schema.getElementType(), namespaceOverride)); break; case BOOLEAN: case BYTES: case DOUBLE: case FLOAT: case INT: case LONG: case NULL: case STRING: newSchema = Schema.create(schema.getType()); break; default: String exceptionMessage = String.format("Schema namespace replacement failed for \"%s\" ", schema); LOG.error(exceptionMessage); throw new AvroRuntimeException(exceptionMessage); } // Copy schema metadata copyProperties(schema, newSchema); return newSchema; } }
public class class_name { public static Schema switchNamespace(Schema schema, Map<String, String> namespaceOverride) { Schema newSchema; String newNamespace = StringUtils.EMPTY; // Process all Schema Types // (Primitives are simply cloned) switch (schema.getType()) { case ENUM: newNamespace = namespaceOverride.containsKey(schema.getNamespace()) ? namespaceOverride.get(schema.getNamespace()) : schema.getNamespace(); newSchema = Schema.createEnum(schema.getName(), schema.getDoc(), newNamespace, schema.getEnumSymbols()); break; case FIXED: newNamespace = namespaceOverride.containsKey(schema.getNamespace()) ? namespaceOverride.get(schema.getNamespace()) : schema.getNamespace(); newSchema = Schema.createFixed(schema.getName(), schema.getDoc(), newNamespace, schema.getFixedSize()); break; case MAP: newSchema = Schema.createMap(switchNamespace(schema.getValueType(), namespaceOverride)); break; case RECORD: newNamespace = namespaceOverride.containsKey(schema.getNamespace()) ? namespaceOverride.get(schema.getNamespace()) : schema.getNamespace(); List<Schema.Field> newFields = new ArrayList<>(); if (schema.getFields().size() > 0) { for (Schema.Field oldField : schema.getFields()) { Field newField = new Field(oldField.name(), switchNamespace(oldField.schema(), namespaceOverride), oldField.doc(), oldField.defaultValue(), oldField.order()); newFields.add(newField); // depends on control dependency: [for], data = [none] } } newSchema = Schema.createRecord(schema.getName(), schema.getDoc(), newNamespace, schema.isError()); newSchema.setFields(newFields); break; case UNION: List<Schema> newUnionMembers = new ArrayList<>(); if (null != schema.getTypes() && schema.getTypes().size() > 0) { for (Schema oldUnionMember : schema.getTypes()) { newUnionMembers.add(switchNamespace(oldUnionMember, namespaceOverride)); // depends on control dependency: [for], data = [oldUnionMember] } } newSchema = Schema.createUnion(newUnionMembers); break; case ARRAY: newSchema = Schema.createArray(switchNamespace(schema.getElementType(), namespaceOverride)); break; case BOOLEAN: case BYTES: case DOUBLE: case FLOAT: case INT: case LONG: case NULL: case STRING: newSchema = Schema.create(schema.getType()); break; default: String exceptionMessage = String.format("Schema namespace replacement failed for \"%s\" ", schema); LOG.error(exceptionMessage); throw new AvroRuntimeException(exceptionMessage); } // Copy schema metadata copyProperties(schema, newSchema); return newSchema; } }
public class class_name { public void makeConfigParserLive() { if(stagedConfigParser != null) { notifyListeners(listeners, stagedConfigParser, log); liveConfigParser = stagedConfigParser; latch.countDown(); } } }
public class class_name { public void makeConfigParserLive() { if(stagedConfigParser != null) { notifyListeners(listeners, stagedConfigParser, log); // depends on control dependency: [if], data = [none] liveConfigParser = stagedConfigParser; // depends on control dependency: [if], data = [none] latch.countDown(); // depends on control dependency: [if], data = [none] } } }
public class class_name { void displayResourceInfo(CmsResultItemBean info) { if (m_hasImage) { setImagePreview(info.getPath(), info.getViewLink()); m_resourceInfoPanel.add(new CmsImageInfo(info, info.getDimension())); } else { CmsListItemWidget widget = new CmsListItemWidget(info); OpenCloseHandler handler = new OpenCloseHandler(); widget.addCloseHandler(handler); widget.addOpenHandler(handler); m_resourceInfoPanel.add(widget); int width = m_resourceInfoPanel.getOffsetWidth(); if (width > 0) { widget.truncate("STANDARD", width); } } fireResize(); } }
public class class_name { void displayResourceInfo(CmsResultItemBean info) { if (m_hasImage) { setImagePreview(info.getPath(), info.getViewLink()); // depends on control dependency: [if], data = [none] m_resourceInfoPanel.add(new CmsImageInfo(info, info.getDimension())); // depends on control dependency: [if], data = [none] } else { CmsListItemWidget widget = new CmsListItemWidget(info); OpenCloseHandler handler = new OpenCloseHandler(); widget.addCloseHandler(handler); // depends on control dependency: [if], data = [none] widget.addOpenHandler(handler); // depends on control dependency: [if], data = [none] m_resourceInfoPanel.add(widget); // depends on control dependency: [if], data = [none] int width = m_resourceInfoPanel.getOffsetWidth(); if (width > 0) { widget.truncate("STANDARD", width); // depends on control dependency: [if], data = [none] } } fireResize(); } }
public class class_name { public boolean evaluate(Object feature) { // Checks to ensure that the attribute has been set if (attribute == null) { return false; } // Note that this converts the attribute to a string // for comparison. Unlike the math or geometry filters, which // require specific types to function correctly, this filter // using the mandatory string representation in Java // Of course, this does not guarantee a meaningful result, but it // does guarantee a valid result. // LOGGER.finest("pattern: " + pattern); // LOGGER.finest("string: " + attribute.getValue(feature)); // return attribute.getValue(feature).toString().matches(pattern); Object value = attribute.evaluate(feature); if (null == value) { return false; } Matcher matcher = getMatcher(); matcher.reset(value.toString()); return matcher.matches(); } }
public class class_name { public boolean evaluate(Object feature) { // Checks to ensure that the attribute has been set if (attribute == null) { return false; // depends on control dependency: [if], data = [none] } // Note that this converts the attribute to a string // for comparison. Unlike the math or geometry filters, which // require specific types to function correctly, this filter // using the mandatory string representation in Java // Of course, this does not guarantee a meaningful result, but it // does guarantee a valid result. // LOGGER.finest("pattern: " + pattern); // LOGGER.finest("string: " + attribute.getValue(feature)); // return attribute.getValue(feature).toString().matches(pattern); Object value = attribute.evaluate(feature); if (null == value) { return false; // depends on control dependency: [if], data = [none] } Matcher matcher = getMatcher(); matcher.reset(value.toString()); return matcher.matches(); } }
public class class_name { void kickOffTimer() throws UnavailableException { final String methodName = "kickOffTimer"; if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, methodName); } synchronized (_timerLock) { // Another timer is already running - no need to create a new one if (_timer != null) { return; } _timer = _bootstrapContext.createTimer(); _timer.schedule(new TimerTask() { @Override public void run() { try { synchronized (_timerLock) { _timer.cancel(); _timer = null; timerLoop(); } } catch (final ResourceException exception) { FFDCFilter.processException(exception, CLASS_NAME + "." + methodName, "1:420:1.45", this); SibTr.error(TRACE, "CONNECT_FAILED_CWSIV0783", new Object[] { _endpointConfiguration.getDestination() .getDestinationName(), _endpointConfiguration.getBusName(), this, exception }); } } }, _retryInterval); } if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.exit(TRACE, methodName); } } }
public class class_name { void kickOffTimer() throws UnavailableException { final String methodName = "kickOffTimer"; if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, methodName); } synchronized (_timerLock) { // Another timer is already running - no need to create a new one if (_timer != null) { return; // depends on control dependency: [if], data = [none] } _timer = _bootstrapContext.createTimer(); _timer.schedule(new TimerTask() { @Override public void run() { try { synchronized (_timerLock) // depends on control dependency: [try], data = [none] { _timer.cancel(); _timer = null; timerLoop(); } } catch (final ResourceException exception) { FFDCFilter.processException(exception, CLASS_NAME + "." + methodName, "1:420:1.45", this); SibTr.error(TRACE, "CONNECT_FAILED_CWSIV0783", new Object[] { _endpointConfiguration.getDestination() .getDestinationName(), _endpointConfiguration.getBusName(), this, exception }); } // depends on control dependency: [catch], data = [none] } }, _retryInterval); } if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.exit(TRACE, methodName); } } }
public class class_name { public void registerJsonValueProcessor( String key, JsonValueProcessor jsonValueProcessor ) { if( key != null && jsonValueProcessor != null ) { keyMap.put( key, jsonValueProcessor ); } } }
public class class_name { public void registerJsonValueProcessor( String key, JsonValueProcessor jsonValueProcessor ) { if( key != null && jsonValueProcessor != null ) { keyMap.put( key, jsonValueProcessor ); // depends on control dependency: [if], data = [( key] } } }
public class class_name { public static String toJSONString(Object o) { try { return objectMapper.writer().without(SerializationFeature.INDENT_OUTPUT).writeValueAsString(o); } catch (JsonProcessingException e) { throw new RuntimeException(e); } } }
public class class_name { public static String toJSONString(Object o) { try { return objectMapper.writer().without(SerializationFeature.INDENT_OUTPUT).writeValueAsString(o); // 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 { void decreaseKBy1() { if (k_ <= 1) { throw new SketchesStateException("Cannot decrease k below 1 in union"); } if ((h_ == 0) && (r_ == 0)) { // exact mode, but no data yet; this reduction is somewhat gratuitous --k_; } else if ((h_ > 0) && (r_ == 0)) { // exact mode, but we have some data --k_; if (h_ > k_) { transitionFromWarmup(); } } else if ((h_ > 0) && (r_ > 0)) { // reservoir mode, but we have some exact samples. // Our strategy will be to pull an item out of H (which we are allowed to do since it's // still just data), reduce k, and then re-insert the item // first, slide the R zone to the left by 1, temporarily filling the gap final int oldGapIdx = h_; final int oldFinalRIdx = (h_ + 1 + r_) - 1; assert oldFinalRIdx == k_; swapValues(oldFinalRIdx, oldGapIdx); // now we pull an item out of H; any item is ok, but if we grab the rightmost and then // reduce h_, the heap invariant will be preserved (and the gap will be restored), plus // the push() of the item that will probably happen later will be cheap. final int pulledIdx = h_ - 1; final T pulledItem = data_.get(pulledIdx); final double pulledWeight = weights_.get(pulledIdx); final boolean pulledMark = marks_.get(pulledIdx); if (pulledMark) { --numMarksInH_; } weights_.set(pulledIdx, -1.0); // to make bugs easier to spot --h_; --k_; --n_; // will be re-incremented with the update update(pulledItem, pulledWeight, pulledMark); } else if ((h_ == 0) && (r_ > 0)) { // pure reservoir mode, so can simply eject a randomly chosen sample from the reservoir assert r_ >= 2; final int rIdxToDelete = 1 + SamplingUtil.rand.nextInt(r_); // 1 for the gap final int rightmostRIdx = (1 + r_) - 1; swapValues(rIdxToDelete, rightmostRIdx); weights_.set(rightmostRIdx, -1.0); --k_; --r_; } } }
public class class_name { void decreaseKBy1() { if (k_ <= 1) { throw new SketchesStateException("Cannot decrease k below 1 in union"); } if ((h_ == 0) && (r_ == 0)) { // exact mode, but no data yet; this reduction is somewhat gratuitous --k_; // depends on control dependency: [if], data = [none] } else if ((h_ > 0) && (r_ == 0)) { // exact mode, but we have some data --k_; // depends on control dependency: [if], data = [none] if (h_ > k_) { transitionFromWarmup(); // depends on control dependency: [if], data = [none] } } else if ((h_ > 0) && (r_ > 0)) { // reservoir mode, but we have some exact samples. // Our strategy will be to pull an item out of H (which we are allowed to do since it's // still just data), reduce k, and then re-insert the item // first, slide the R zone to the left by 1, temporarily filling the gap final int oldGapIdx = h_; final int oldFinalRIdx = (h_ + 1 + r_) - 1; assert oldFinalRIdx == k_; swapValues(oldFinalRIdx, oldGapIdx); // depends on control dependency: [if], data = [none] // now we pull an item out of H; any item is ok, but if we grab the rightmost and then // reduce h_, the heap invariant will be preserved (and the gap will be restored), plus // the push() of the item that will probably happen later will be cheap. final int pulledIdx = h_ - 1; final T pulledItem = data_.get(pulledIdx); final double pulledWeight = weights_.get(pulledIdx); final boolean pulledMark = marks_.get(pulledIdx); if (pulledMark) { --numMarksInH_; } // depends on control dependency: [if], data = [none] weights_.set(pulledIdx, -1.0); // to make bugs easier to spot // depends on control dependency: [if], data = [none] --h_; // depends on control dependency: [if], data = [none] --k_; // depends on control dependency: [if], data = [none] --n_; // will be re-incremented with the update // depends on control dependency: [if], data = [none] update(pulledItem, pulledWeight, pulledMark); // depends on control dependency: [if], data = [none] } else if ((h_ == 0) && (r_ > 0)) { // pure reservoir mode, so can simply eject a randomly chosen sample from the reservoir assert r_ >= 2; final int rIdxToDelete = 1 + SamplingUtil.rand.nextInt(r_); // 1 for the gap final int rightmostRIdx = (1 + r_) - 1; swapValues(rIdxToDelete, rightmostRIdx); // depends on control dependency: [if], data = [none] weights_.set(rightmostRIdx, -1.0); // depends on control dependency: [if], data = [none] --k_; // depends on control dependency: [if], data = [none] --r_; // depends on control dependency: [if], data = [none] } } }
public class class_name { public final void increaseWrittenBytes(int increment, long currentTime) { if (increment <= 0) { return; } writtenBytes += increment; lastWriteTime = currentTime; idleCountForBoth.set(0); idleCountForWrite.set(0); if (getService() instanceof AbstractIoService) { getService().getStatistics().increaseWrittenBytes(increment, currentTime); } increaseScheduledWriteBytes(-increment); } }
public class class_name { public final void increaseWrittenBytes(int increment, long currentTime) { if (increment <= 0) { return; // depends on control dependency: [if], data = [none] } writtenBytes += increment; lastWriteTime = currentTime; idleCountForBoth.set(0); idleCountForWrite.set(0); if (getService() instanceof AbstractIoService) { getService().getStatistics().increaseWrittenBytes(increment, currentTime); // depends on control dependency: [if], data = [none] } increaseScheduledWriteBytes(-increment); } }
public class class_name { public synchronized InstanceStatus setStatus(InstanceStatus status) { if (this.status != status) { InstanceStatus prev = this.status; this.status = status; setIsDirty(); return prev; } return null; } }
public class class_name { public synchronized InstanceStatus setStatus(InstanceStatus status) { if (this.status != status) { InstanceStatus prev = this.status; this.status = status; // depends on control dependency: [if], data = [none] setIsDirty(); // depends on control dependency: [if], data = [none] return prev; // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { public String generateAliasForSharedKey() { String alias = null; if (serverName != null) { alias = serverName + "Alias" + new Integer(aliasIncrement).toString(); } aliasIncrement++; return alias; } }
public class class_name { public String generateAliasForSharedKey() { String alias = null; if (serverName != null) { alias = serverName + "Alias" + new Integer(aliasIncrement).toString(); // depends on control dependency: [if], data = [none] } aliasIncrement++; return alias; } }
public class class_name { public void suspend() { if (suspension.compareAndSet(null, new CountDownLatch(1))) { try { suspendBarrier.await(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } catch (BrokenBarrierException e) { LOG.error("Exception during suspend: " + flowletContext, e); } } } }
public class class_name { public void suspend() { if (suspension.compareAndSet(null, new CountDownLatch(1))) { try { suspendBarrier.await(); // depends on control dependency: [try], data = [none] } catch (InterruptedException e) { Thread.currentThread().interrupt(); } catch (BrokenBarrierException e) { // depends on control dependency: [catch], data = [none] LOG.error("Exception during suspend: " + flowletContext, e); } // depends on control dependency: [catch], data = [none] } } }
public class class_name { private void remapComposite(FontFileReader in, Map glyphs, int glyphOffset, Integer glyphIdx) throws IOException { int offset = glyphOffset + (int)mtxTab[glyphIdx.intValue()].getOffset() + 10; Integer compositeIdx = null; int flags = 0; boolean moreComposites = true; while (moreComposites) { flags = in.readTTFUShort(offset); compositeIdx = new Integer(in.readTTFUShort(offset + 2)); Integer newIdx = (Integer)glyphs.get(compositeIdx); if (newIdx == null) { // This errormessage would look much better // if the fontname was printed to //log.error("An embedded font " // + "contains bad glyph data. " // + "Characters might not display " // + "correctly."); moreComposites = false; continue; } in.writeTTFUShort(offset + 2, newIdx.intValue()); offset += 4; if ((flags & 1) > 0) { // ARG_1_AND_ARG_2_ARE_WORDS offset += 4; } else { offset += 2; } if ((flags & 8) > 0) { offset += 2; // WE_HAVE_A_SCALE } else if ((flags & 64) > 0) { offset += 4; // WE_HAVE_AN_X_AND_Y_SCALE } else if ((flags & 128) > 0) { offset += 8; // WE_HAVE_A_TWO_BY_TWO } if ((flags & 32) > 0) { moreComposites = true; } else { moreComposites = false; } } } }
public class class_name { private void remapComposite(FontFileReader in, Map glyphs, int glyphOffset, Integer glyphIdx) throws IOException { int offset = glyphOffset + (int)mtxTab[glyphIdx.intValue()].getOffset() + 10; Integer compositeIdx = null; int flags = 0; boolean moreComposites = true; while (moreComposites) { flags = in.readTTFUShort(offset); compositeIdx = new Integer(in.readTTFUShort(offset + 2)); Integer newIdx = (Integer)glyphs.get(compositeIdx); if (newIdx == null) { // This errormessage would look much better // if the fontname was printed to //log.error("An embedded font " // + "contains bad glyph data. " // + "Characters might not display " // + "correctly."); moreComposites = false; // depends on control dependency: [if], data = [none] continue; } in.writeTTFUShort(offset + 2, newIdx.intValue()); offset += 4; if ((flags & 1) > 0) { // ARG_1_AND_ARG_2_ARE_WORDS offset += 4; // depends on control dependency: [if], data = [none] } else { offset += 2; // depends on control dependency: [if], data = [none] } if ((flags & 8) > 0) { offset += 2; // WE_HAVE_A_SCALE // depends on control dependency: [if], data = [none] } else if ((flags & 64) > 0) { offset += 4; // WE_HAVE_AN_X_AND_Y_SCALE // depends on control dependency: [if], data = [none] } else if ((flags & 128) > 0) { offset += 8; // WE_HAVE_A_TWO_BY_TWO // depends on control dependency: [if], data = [none] } if ((flags & 32) > 0) { moreComposites = true; // depends on control dependency: [if], data = [none] } else { moreComposites = false; // depends on control dependency: [if], data = [none] } } } }
public class class_name { @SuppressWarnings({"unused", "WeakerAccess"}) private void showNotificationIfAvailable(final Context context){ if(!this.config.isAnalyticsOnly()) { runOnNotificationQueue(new Runnable() { @Override public void run() { _showNotificationIfAvailable(context); } }); } } }
public class class_name { @SuppressWarnings({"unused", "WeakerAccess"}) private void showNotificationIfAvailable(final Context context){ if(!this.config.isAnalyticsOnly()) { runOnNotificationQueue(new Runnable() { @Override public void run() { _showNotificationIfAvailable(context); } }); // depends on control dependency: [if], data = [none] } } }
public class class_name { public int getMaxEndPosition(int docId, int position) throws IOException { if (ignoreSpans != null && docId == currentDocId) { if (position < minimumPosition) { throw new IOException( "Unexpected position, should be >= " + minimumPosition + "!"); } computeFullEndPositionList(position); if (maxFullEndPosition.containsKey(position)) { return maxFullEndPosition.get(position); } else { return 0; } } else { return 0; } } }
public class class_name { public int getMaxEndPosition(int docId, int position) throws IOException { if (ignoreSpans != null && docId == currentDocId) { if (position < minimumPosition) { throw new IOException( "Unexpected position, should be >= " + minimumPosition + "!"); } computeFullEndPositionList(position); if (maxFullEndPosition.containsKey(position)) { return maxFullEndPosition.get(position); // depends on control dependency: [if], data = [none] } else { return 0; // depends on control dependency: [if], data = [none] } } else { return 0; } } }
public class class_name { protected ScriptBuilder bigNum(int index, long num) { final byte[] data; if (num == 0) { data = new byte[0]; } else { Stack<Byte> result = new Stack<>(); final boolean neg = num < 0; long absvalue = Math.abs(num); while (absvalue != 0) { result.push((byte) (absvalue & 0xff)); absvalue >>= 8; } if ((result.peek() & 0x80) != 0) { // The most significant byte is >= 0x80, so push an extra byte that // contains just the sign of the value. result.push((byte) (neg ? 0x80 : 0)); } else if (neg) { // The most significant byte is < 0x80 and the value is negative, // set the sign bit so it is subtracted and interpreted as a // negative when converting back to an integral. result.push((byte) (result.pop() | 0x80)); } data = new byte[result.size()]; for (int byteIdx = 0; byteIdx < data.length; byteIdx++) { data[byteIdx] = result.get(byteIdx); } } // At most the encoded value could take up to 8 bytes, so we don't need // to use OP_PUSHDATA opcodes return addChunk(index, new ScriptChunk(data.length, data)); } }
public class class_name { protected ScriptBuilder bigNum(int index, long num) { final byte[] data; if (num == 0) { data = new byte[0]; // depends on control dependency: [if], data = [none] } else { Stack<Byte> result = new Stack<>(); final boolean neg = num < 0; long absvalue = Math.abs(num); while (absvalue != 0) { result.push((byte) (absvalue & 0xff)); // depends on control dependency: [while], data = [(absvalue] absvalue >>= 8; // depends on control dependency: [while], data = [none] } if ((result.peek() & 0x80) != 0) { // The most significant byte is >= 0x80, so push an extra byte that // contains just the sign of the value. result.push((byte) (neg ? 0x80 : 0)); // depends on control dependency: [if], data = [0)] } else if (neg) { // The most significant byte is < 0x80 and the value is negative, // set the sign bit so it is subtracted and interpreted as a // negative when converting back to an integral. result.push((byte) (result.pop() | 0x80)); // depends on control dependency: [if], data = [none] } data = new byte[result.size()]; // depends on control dependency: [if], data = [none] for (int byteIdx = 0; byteIdx < data.length; byteIdx++) { data[byteIdx] = result.get(byteIdx); // depends on control dependency: [for], data = [byteIdx] } } // At most the encoded value could take up to 8 bytes, so we don't need // to use OP_PUSHDATA opcodes return addChunk(index, new ScriptChunk(data.length, data)); } }
public class class_name { static void assertEquals(String message, Object comparison1, Object comparison2) { if(comparison1 == comparison2) { return; } if(comparison1.equals(comparison2)) { return; } System.err.println(message); } }
public class class_name { static void assertEquals(String message, Object comparison1, Object comparison2) { if(comparison1 == comparison2) { return; // depends on control dependency: [if], data = [none] } if(comparison1.equals(comparison2)) { return; // depends on control dependency: [if], data = [none] } System.err.println(message); } }
public class class_name { public void marshall(EnableSharingWithAwsOrganizationRequest enableSharingWithAwsOrganizationRequest, ProtocolMarshaller protocolMarshaller) { if (enableSharingWithAwsOrganizationRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(EnableSharingWithAwsOrganizationRequest enableSharingWithAwsOrganizationRequest, ProtocolMarshaller protocolMarshaller) { if (enableSharingWithAwsOrganizationRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { } 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 IOException ioeToSocketException(IOException ioe) { if (ioe.getClass().equals(IOException.class)) { // "se" could be a new class in stead of SocketException. IOException se = new SocketException("Original Exception : " + ioe); se.initCause(ioe); /* Change the stacktrace so that original trace is not truncated * when printed.*/ se.setStackTrace(ioe.getStackTrace()); return se; } // otherwise just return the same exception. return ioe; } }
public class class_name { static IOException ioeToSocketException(IOException ioe) { if (ioe.getClass().equals(IOException.class)) { // "se" could be a new class in stead of SocketException. IOException se = new SocketException("Original Exception : " + ioe); se.initCause(ioe); // depends on control dependency: [if], data = [none] /* Change the stacktrace so that original trace is not truncated * when printed.*/ se.setStackTrace(ioe.getStackTrace()); // depends on control dependency: [if], data = [none] return se; // depends on control dependency: [if], data = [none] } // otherwise just return the same exception. return ioe; } }
public class class_name { void assign(IAtomContainer container, String[] symbs, EdgeToBondMap bonds, int[][] graph, Set<IBond> mmffArom) { int[] contribution = new int[graph.length]; int[] doubleBonds = new int[graph.length]; Arrays.fill(doubleBonds, -1); setupContributionAndDoubleBonds(container, bonds, graph, contribution, doubleBonds); int[][] cycles = findAromaticRings(cyclesOfSizeFiveOrSix(container, graph), contribution, doubleBonds); for (int[] cycle : cycles) { int len = cycle.length - 1; if (len == 6) { updateAromaticTypesInSixMemberRing(cycle, symbs); } if (len == 5 && normaliseCycle(cycle, contribution)) { updateAromaticTypesInFiveMemberRing(cycle, symbs); } // mark aromatic bonds for (int i = 1; i < cycle.length; i++) mmffArom.add(bonds.get(cycle[i], cycle[i - 1])); } } }
public class class_name { void assign(IAtomContainer container, String[] symbs, EdgeToBondMap bonds, int[][] graph, Set<IBond> mmffArom) { int[] contribution = new int[graph.length]; int[] doubleBonds = new int[graph.length]; Arrays.fill(doubleBonds, -1); setupContributionAndDoubleBonds(container, bonds, graph, contribution, doubleBonds); int[][] cycles = findAromaticRings(cyclesOfSizeFiveOrSix(container, graph), contribution, doubleBonds); for (int[] cycle : cycles) { int len = cycle.length - 1; if (len == 6) { updateAromaticTypesInSixMemberRing(cycle, symbs); // depends on control dependency: [if], data = [none] } if (len == 5 && normaliseCycle(cycle, contribution)) { updateAromaticTypesInFiveMemberRing(cycle, symbs); // depends on control dependency: [if], data = [none] } // mark aromatic bonds for (int i = 1; i < cycle.length; i++) mmffArom.add(bonds.get(cycle[i], cycle[i - 1])); } } }
public class class_name { public Object getLambdaArgument(String name) { for (Map<String,Object> arguments : lambdaArguments) { Object result = arguments.get(name); if (result != null) { return result; } } return null; } }
public class class_name { public Object getLambdaArgument(String name) { for (Map<String,Object> arguments : lambdaArguments) { Object result = arguments.get(name); if (result != null) { return result; // depends on control dependency: [if], data = [none] } } return null; } }
public class class_name { public static String md5Encode(String strIn) { try { MessageDigest md5 = MessageDigest.getInstance("md5"); byte[] bin = toBytes(strIn); byte[] bout = md5.digest(bin); String strOut = javax.xml.bind.DatatypeConverter.printBase64Binary(bout); return strOut; }catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } } }
public class class_name { public static String md5Encode(String strIn) { try { MessageDigest md5 = MessageDigest.getInstance("md5"); byte[] bin = toBytes(strIn); byte[] bout = md5.digest(bin); String strOut = javax.xml.bind.DatatypeConverter.printBase64Binary(bout); return strOut; // depends on control dependency: [try], data = [none] }catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override public Schema transform(Schema inputSchema) { Schema.Builder newSchema = new Schema.Builder(); for (int i = 0; i < inputSchema.numColumns(); i++) { if (inputSchema.getType(i) == ColumnType.String) { newSchema.addColumnDouble(inputSchema.getMetaData(i).getName()); } else newSchema.addColumn(inputSchema.getMetaData(i)); } return newSchema.build(); } }
public class class_name { @Override public Schema transform(Schema inputSchema) { Schema.Builder newSchema = new Schema.Builder(); for (int i = 0; i < inputSchema.numColumns(); i++) { if (inputSchema.getType(i) == ColumnType.String) { newSchema.addColumnDouble(inputSchema.getMetaData(i).getName()); // depends on control dependency: [if], data = [none] } else newSchema.addColumn(inputSchema.getMetaData(i)); } return newSchema.build(); } }
public class class_name { public URLTemplate getURLTemplate( String name ) { URLTemplate urlTemplate = null; if ( _servletContext != null ) { URLTemplatesFactory urlTemplatesFactory = URLTemplatesFactory.getURLTemplatesFactory( _servletContext ); if ( urlTemplatesFactory != null ) { urlTemplate = urlTemplatesFactory.getURLTemplate( name ); } } return urlTemplate; } }
public class class_name { public URLTemplate getURLTemplate( String name ) { URLTemplate urlTemplate = null; if ( _servletContext != null ) { URLTemplatesFactory urlTemplatesFactory = URLTemplatesFactory.getURLTemplatesFactory( _servletContext ); if ( urlTemplatesFactory != null ) { urlTemplate = urlTemplatesFactory.getURLTemplate( name ); // depends on control dependency: [if], data = [none] } } return urlTemplate; } }
public class class_name { @Override public void release(final T t, final boolean prune) { if (t == null) { throw new IllegalArgumentException("Can not return a null item to the pool"); } if (closed) { close(t); return; } if (prune) { close(t); } else { available.addLast(t); } releasePermit(); } }
public class class_name { @Override public void release(final T t, final boolean prune) { if (t == null) { throw new IllegalArgumentException("Can not return a null item to the pool"); } if (closed) { close(t); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } if (prune) { close(t); // depends on control dependency: [if], data = [none] } else { available.addLast(t); // depends on control dependency: [if], data = [none] } releasePermit(); } }
public class class_name { private boolean validInstanceOfExpression(Node expr) { // The expression must have two children: // - The instanceOf keyword // - A string if (!checkParameterCount(expr, Keywords.INSTANCEOF)) { return false; } if (!validTypeTransformationExpression(getCallArgument(expr, 0))) { warnInvalidInside(Keywords.INSTANCEOF.name, expr); return false; } return true; } }
public class class_name { private boolean validInstanceOfExpression(Node expr) { // The expression must have two children: // - The instanceOf keyword // - A string if (!checkParameterCount(expr, Keywords.INSTANCEOF)) { return false; // depends on control dependency: [if], data = [none] } if (!validTypeTransformationExpression(getCallArgument(expr, 0))) { warnInvalidInside(Keywords.INSTANCEOF.name, expr); // depends on control dependency: [if], data = [none] return false; // depends on control dependency: [if], data = [none] } return true; } }
public class class_name { public synchronized String formatMessage(LogRecord record) { String format = record.getMessage(); java.util.ResourceBundle catalog = record.getResourceBundle(); if (catalog != null) { try { format = catalog.getString(record.getMessage()); } catch (java.util.MissingResourceException ex) { // Drop through. Use record message as format format = record.getMessage(); } } // Do the formatting. try { Object parameters[] = record.getParameters(); if (parameters == null || parameters.length == 0) { // No parameters. Just return format string. return format; } // Is it a java.text style format? // Ideally we could match with // Pattern.compile("\\{\\d").matcher(format).find()) // However the cost is 14% higher, so we cheaply check for // 1 of the first 4 parameters if (format.indexOf("{0") >= 0 || format.indexOf("{1") >=0 || format.indexOf("{2") >=0|| format.indexOf("{3") >=0) { return java.text.MessageFormat.format(format, parameters); } return format; } catch (Exception ex) { // Formatting failed: use localized format string. return format; } } }
public class class_name { public synchronized String formatMessage(LogRecord record) { String format = record.getMessage(); java.util.ResourceBundle catalog = record.getResourceBundle(); if (catalog != null) { try { format = catalog.getString(record.getMessage()); // depends on control dependency: [try], data = [none] } catch (java.util.MissingResourceException ex) { // Drop through. Use record message as format format = record.getMessage(); } // depends on control dependency: [catch], data = [none] } // Do the formatting. try { Object parameters[] = record.getParameters(); if (parameters == null || parameters.length == 0) { // No parameters. Just return format string. return format; // depends on control dependency: [if], data = [none] } // Is it a java.text style format? // Ideally we could match with // Pattern.compile("\\{\\d").matcher(format).find()) // However the cost is 14% higher, so we cheaply check for // 1 of the first 4 parameters if (format.indexOf("{0") >= 0 || format.indexOf("{1") >=0 || format.indexOf("{2") >=0|| format.indexOf("{3") >=0) { return java.text.MessageFormat.format(format, parameters); // depends on control dependency: [if], data = [none] } return format; // depends on control dependency: [try], data = [none] } catch (Exception ex) { // Formatting failed: use localized format string. return format; } // depends on control dependency: [catch], data = [none] } }
public class class_name { @SuppressWarnings("unchecked") public <Input,Output> Adapter<Input,Output> findAdapter(Object in, Class<Input> input, Class<Output> output) { ArrayList<Adapter> acceptInput = new ArrayList<>(); ArrayList<Adapter> matching = new ArrayList<>(); for (Adapter a : adapters) { if (!a.getInputType().isAssignableFrom(input)) continue; if (!a.canAdapt(in)) continue; acceptInput.add(a); if (output.equals(a.getOutputType())) return a; if (output.isAssignableFrom(a.getOutputType())) matching.add(a); } if (acceptInput.isEmpty()) return null; if (matching.size() == 1) return matching.get(0); if (!matching.isEmpty()) return getBest(matching); LinkedList<LinkedList<Adapter>> paths = findPathsTo(input, acceptInput, output); LinkedList<Adapter> best = null; while (!paths.isEmpty()) { LinkedList<Adapter> path = paths.removeFirst(); if (best != null && best.size() <= path.size()) continue; Object o = in; boolean valid = true; int i = 0; for (Adapter a : path) { if (!a.canAdapt(o)) { valid = false; break; } if (i == path.size() - 1) break; // we are on the last, so no need to do it i++; try { o = a.adapt(o); } catch (Exception e) { valid = false; break; } } if (valid) best = path; } if (best == null) return null; return new LinkedAdapter(best); } }
public class class_name { @SuppressWarnings("unchecked") public <Input,Output> Adapter<Input,Output> findAdapter(Object in, Class<Input> input, Class<Output> output) { ArrayList<Adapter> acceptInput = new ArrayList<>(); ArrayList<Adapter> matching = new ArrayList<>(); for (Adapter a : adapters) { if (!a.getInputType().isAssignableFrom(input)) continue; if (!a.canAdapt(in)) continue; acceptInput.add(a); // depends on control dependency: [for], data = [a] if (output.equals(a.getOutputType())) return a; if (output.isAssignableFrom(a.getOutputType())) matching.add(a); } if (acceptInput.isEmpty()) return null; if (matching.size() == 1) return matching.get(0); if (!matching.isEmpty()) return getBest(matching); LinkedList<LinkedList<Adapter>> paths = findPathsTo(input, acceptInput, output); LinkedList<Adapter> best = null; while (!paths.isEmpty()) { LinkedList<Adapter> path = paths.removeFirst(); if (best != null && best.size() <= path.size()) continue; Object o = in; boolean valid = true; int i = 0; for (Adapter a : path) { if (!a.canAdapt(o)) { valid = false; // depends on control dependency: [if], data = [none] break; } if (i == path.size() - 1) break; // we are on the last, so no need to do it i++; // depends on control dependency: [for], data = [none] try { o = a.adapt(o); // depends on control dependency: [try], data = [none] } catch (Exception e) { valid = false; break; } // depends on control dependency: [catch], data = [none] } if (valid) best = path; } if (best == null) return null; return new LinkedAdapter(best); } }
public class class_name { public static Usage getUsage(String cobolUsage) { if (cobolUsage == null) { return null; } if (cobolUsage.equals(BINARY)) { return Usage.BINARY; } else if (cobolUsage.equals("COMP")) { return Usage.BINARY; } else if (cobolUsage.equals("COMPUTATIONAL")) { return Usage.BINARY; } else if (cobolUsage.equals("COMP-4")) { return Usage.BINARY; } else if (cobolUsage.equals("COMPUTATIONAL-4")) { return Usage.BINARY; } else if (cobolUsage.equals(COMP_1)) { return Usage.SINGLEFLOAT; } else if (cobolUsage.equals(COMP_2)) { return Usage.DOUBLEFLOAT; } else if (cobolUsage.equals(PACKED_DECIMAL)) { return Usage.PACKEDDECIMAL; } else if (cobolUsage.equals("PACKED-DECIMAL")) { return Usage.PACKEDDECIMAL; } else if (cobolUsage.equals("COMPUTATIONAL-3")) { return Usage.PACKEDDECIMAL; } else if (cobolUsage.equals(COMP_5)) { return Usage.NATIVEBINARY; } else if (cobolUsage.equals("COMPUTATIONAL-5")) { return Usage.NATIVEBINARY; } else if (cobolUsage.equals(DISPLAY)) { return Usage.DISPLAY; } else if (cobolUsage.equals(DISPLAY_1)) { return Usage.DISPLAY1; } else if (cobolUsage.equals(INDEX)) { return Usage.INDEX; } else if (cobolUsage.equals(NATIONAL)) { return Usage.NATIONAL; } else if (cobolUsage.equals(POINTER)) { return Usage.POINTER; } else if (cobolUsage.equals(PROCEDURE_POINTER)) { return Usage.PROCEDUREPOINTER; } else if (cobolUsage.equals(FUNCTION_POINTER)) { return Usage.FUNCTIONPOINTER; } else { throw new IllegalArgumentException("Unknown COBOL usage: " + cobolUsage); } } }
public class class_name { public static Usage getUsage(String cobolUsage) { if (cobolUsage == null) { return null; // depends on control dependency: [if], data = [none] } if (cobolUsage.equals(BINARY)) { return Usage.BINARY; // depends on control dependency: [if], data = [none] } else if (cobolUsage.equals("COMP")) { return Usage.BINARY; // depends on control dependency: [if], data = [none] } else if (cobolUsage.equals("COMPUTATIONAL")) { return Usage.BINARY; // depends on control dependency: [if], data = [none] } else if (cobolUsage.equals("COMP-4")) { return Usage.BINARY; // depends on control dependency: [if], data = [none] } else if (cobolUsage.equals("COMPUTATIONAL-4")) { return Usage.BINARY; // depends on control dependency: [if], data = [none] } else if (cobolUsage.equals(COMP_1)) { return Usage.SINGLEFLOAT; // depends on control dependency: [if], data = [none] } else if (cobolUsage.equals(COMP_2)) { return Usage.DOUBLEFLOAT; // depends on control dependency: [if], data = [none] } else if (cobolUsage.equals(PACKED_DECIMAL)) { return Usage.PACKEDDECIMAL; // depends on control dependency: [if], data = [none] } else if (cobolUsage.equals("PACKED-DECIMAL")) { return Usage.PACKEDDECIMAL; // depends on control dependency: [if], data = [none] } else if (cobolUsage.equals("COMPUTATIONAL-3")) { return Usage.PACKEDDECIMAL; // depends on control dependency: [if], data = [none] } else if (cobolUsage.equals(COMP_5)) { return Usage.NATIVEBINARY; // depends on control dependency: [if], data = [none] } else if (cobolUsage.equals("COMPUTATIONAL-5")) { return Usage.NATIVEBINARY; // depends on control dependency: [if], data = [none] } else if (cobolUsage.equals(DISPLAY)) { return Usage.DISPLAY; // depends on control dependency: [if], data = [none] } else if (cobolUsage.equals(DISPLAY_1)) { return Usage.DISPLAY1; // depends on control dependency: [if], data = [none] } else if (cobolUsage.equals(INDEX)) { return Usage.INDEX; // depends on control dependency: [if], data = [none] } else if (cobolUsage.equals(NATIONAL)) { return Usage.NATIONAL; // depends on control dependency: [if], data = [none] } else if (cobolUsage.equals(POINTER)) { return Usage.POINTER; // depends on control dependency: [if], data = [none] } else if (cobolUsage.equals(PROCEDURE_POINTER)) { return Usage.PROCEDUREPOINTER; // depends on control dependency: [if], data = [none] } else if (cobolUsage.equals(FUNCTION_POINTER)) { return Usage.FUNCTIONPOINTER; // depends on control dependency: [if], data = [none] } else { throw new IllegalArgumentException("Unknown COBOL usage: " + cobolUsage); } } }
public class class_name { public static SimpleGraph<String, DefaultEdge> getSimpleGraphFromUser() { Scanner sc = new Scanner(System.in); SimpleGraph<String, DefaultEdge> graph = new SimpleGraph<String, DefaultEdge>(DefaultEdge.class); // input number of vertices int verticeAmount; do { System.out.print("Enter the number of vertices (more than one): "); verticeAmount = sc.nextInt(); } while (verticeAmount <= 1); // input vertices for (int i = 1; i <= verticeAmount; i++) { System.out.print("Enter vertex name " + i + ": "); String input = sc.next(); if (graph.vertexSet().contains(input)) { System.err.println("vertex with that name already exists"); i--; } else { graph.addVertex(input); } } // input edges System.out.println("\nEnter edge (name => name)"); String userWantsToContinue; do { String e1, e2; do { System.out.print("Edge from: "); e1 = sc.next(); } while (!graph.vertexSet().contains(e1)); do { System.out.print("Edge to: "); e2 = sc.next(); } while (!graph.vertexSet().contains(e2)); graph.addEdge(e1, e2); // add another edge? System.out.print("Add more edges? (y/n): "); userWantsToContinue = sc.next(); }while (userWantsToContinue.equals("y") || userWantsToContinue.equals("yes") || userWantsToContinue.equals("1")); return graph; } }
public class class_name { public static SimpleGraph<String, DefaultEdge> getSimpleGraphFromUser() { Scanner sc = new Scanner(System.in); SimpleGraph<String, DefaultEdge> graph = new SimpleGraph<String, DefaultEdge>(DefaultEdge.class); // input number of vertices int verticeAmount; do { System.out.print("Enter the number of vertices (more than one): "); verticeAmount = sc.nextInt(); } while (verticeAmount <= 1); // input vertices for (int i = 1; i <= verticeAmount; i++) { System.out.print("Enter vertex name " + i + ": "); // depends on control dependency: [for], data = [i] String input = sc.next(); if (graph.vertexSet().contains(input)) { System.err.println("vertex with that name already exists"); // depends on control dependency: [if], data = [none] i--; // depends on control dependency: [if], data = [none] } else { graph.addVertex(input); // depends on control dependency: [if], data = [none] } } // input edges System.out.println("\nEnter edge (name => name)"); String userWantsToContinue; do { String e1, e2; do { System.out.print("Edge from: "); e1 = sc.next(); } while (!graph.vertexSet().contains(e1)); do { System.out.print("Edge to: "); e2 = sc.next(); } while (!graph.vertexSet().contains(e2)); graph.addEdge(e1, e2); // add another edge? System.out.print("Add more edges? (y/n): "); userWantsToContinue = sc.next(); }while (userWantsToContinue.equals("y") || userWantsToContinue.equals("yes") || userWantsToContinue.equals("1")); return graph; } }
public class class_name { @Override public void setContentLengthLong (long len) { String methodName = "setContentLengthLong"; if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { logger.entering(CLASS_NAME, methodName, "length --> " + String.valueOf(len) + " ["+this+"]"); } // check the include flag WebAppDispatcherContext dispatchContext = (WebAppDispatcherContext) getRequest().getWebAppDispatcherContext(); if (dispatchContext.isInclude() == true) { if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { logger.logp(Level.FINE, CLASS_NAME, methodName, nls.getString("Illegal.from.included.servlet", "Illegal from included servlet"), methodName + " length --> " + String.valueOf(len)); //311717 } } else { if (_response!=null) { if (!_response.isCommitted()) { ((IResponse31)_response).setContentLengthLong(len); } } _contentLength = len; _bufferedWriter.setLimitLong(_contentLength); //still want to try to set the header even if the response is committed to throw the warning setHeader(HEADER_CONTENT_LENGTH, Long.toString(_contentLength)); // TODO SERVLET 3.1 - Need "long" implementation?? } if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15 logger.exiting(CLASS_NAME, methodName); } } }
public class class_name { @Override public void setContentLengthLong (long len) { String methodName = "setContentLengthLong"; if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { logger.entering(CLASS_NAME, methodName, "length --> " + String.valueOf(len) + " ["+this+"]"); // depends on control dependency: [if], data = [none] } // check the include flag WebAppDispatcherContext dispatchContext = (WebAppDispatcherContext) getRequest().getWebAppDispatcherContext(); if (dispatchContext.isInclude() == true) { if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { logger.logp(Level.FINE, CLASS_NAME, methodName, nls.getString("Illegal.from.included.servlet", "Illegal from included servlet"), methodName + " length --> " + String.valueOf(len)); //311717 // depends on control dependency: [if], data = [none] } } else { if (_response!=null) { if (!_response.isCommitted()) { ((IResponse31)_response).setContentLengthLong(len); // depends on control dependency: [if], data = [none] } } _contentLength = len; // depends on control dependency: [if], data = [none] _bufferedWriter.setLimitLong(_contentLength); // depends on control dependency: [if], data = [none] //still want to try to set the header even if the response is committed to throw the warning setHeader(HEADER_CONTENT_LENGTH, Long.toString(_contentLength)); // TODO SERVLET 3.1 - Need "long" implementation?? // depends on control dependency: [if], data = [none] } if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15 logger.exiting(CLASS_NAME, methodName); // depends on control dependency: [if], data = [none] } } }
public class class_name { private void updateFinishedCounters(ThisStatistics localStatistics) throws InterruptedException { int snapshotJobsProcessed = countJobsProcessedLower_.get(); /* * ensure that all contexts for processed jobs are marked as saturated */ for (;;) { int snapshotCountContextsSaturatedLower = countContextsSaturatedLower_ .get(); saturationState_ .setContextsSaturated(snapshotCountContextsSaturatedLower); if (saturationState_ .getContextSetSaturatedCount() < snapshotCountContextsSaturatedLower) { /* * this means that some other worker also sets contexts as * saturated, then it will mark the finished jobs instead */ return; } /* * ensure that the counter for processed jobs is still up to date */ int updatedSnapshotJobsProcessed = countJobsProcessedLower_.get(); if (updatedSnapshotJobsProcessed == snapshotJobsProcessed) { break; } /* else refresh counters */ snapshotJobsProcessed = updatedSnapshotJobsProcessed; } /* * ensure that all processed jobs are finished */ for (;;) { int snapshotJobsFinished = countJobsFinishedUpper_.get(); if (snapshotJobsFinished >= snapshotJobsProcessed) { break; } /* * update the finished context counter at least to the taken * snapshot value and mark the corresponding number of jobs as * processed */ if (!countJobsFinishedUpper_.compareAndSet(snapshotJobsFinished, snapshotJobsFinished + 1)) { /* retry */ continue; } // else J nextJob = jobsInProgress_.poll(); IndexedContextRoot root = nextJob.getInput(); Context rootSaturation = saturationState_.getContext(root); if (rootSaturation.isInitialized() && !rootSaturation.isSaturated()) { LOGGER_.error("{}: context for a finished job not saturated!", rootSaturation); } nextJob.setOutput(rootSaturation); LOGGER_.trace("{}: saturation finished", root); localStatistics.jobsProcessedNo++; listener_.notifyFinished(nextJob);// can be interrupted } } }
public class class_name { private void updateFinishedCounters(ThisStatistics localStatistics) throws InterruptedException { int snapshotJobsProcessed = countJobsProcessedLower_.get(); /* * ensure that all contexts for processed jobs are marked as saturated */ for (;;) { int snapshotCountContextsSaturatedLower = countContextsSaturatedLower_ .get(); saturationState_ .setContextsSaturated(snapshotCountContextsSaturatedLower); if (saturationState_ .getContextSetSaturatedCount() < snapshotCountContextsSaturatedLower) { /* * this means that some other worker also sets contexts as * saturated, then it will mark the finished jobs instead */ return; // depends on control dependency: [if], data = [none] } /* * ensure that the counter for processed jobs is still up to date */ int updatedSnapshotJobsProcessed = countJobsProcessedLower_.get(); if (updatedSnapshotJobsProcessed == snapshotJobsProcessed) { break; } /* else refresh counters */ snapshotJobsProcessed = updatedSnapshotJobsProcessed; } /* * ensure that all processed jobs are finished */ for (;;) { int snapshotJobsFinished = countJobsFinishedUpper_.get(); if (snapshotJobsFinished >= snapshotJobsProcessed) { break; } /* * update the finished context counter at least to the taken * snapshot value and mark the corresponding number of jobs as * processed */ if (!countJobsFinishedUpper_.compareAndSet(snapshotJobsFinished, snapshotJobsFinished + 1)) { /* retry */ continue; } // else J nextJob = jobsInProgress_.poll(); IndexedContextRoot root = nextJob.getInput(); Context rootSaturation = saturationState_.getContext(root); if (rootSaturation.isInitialized() && !rootSaturation.isSaturated()) { LOGGER_.error("{}: context for a finished job not saturated!", rootSaturation); // depends on control dependency: [if], data = [none] } nextJob.setOutput(rootSaturation); LOGGER_.trace("{}: saturation finished", root); localStatistics.jobsProcessedNo++; listener_.notifyFinished(nextJob);// can be interrupted } } }
public class class_name { public static String getRequestURIForGrailsDispatchURI(HttpServletRequest request) { UrlPathHelper pathHelper = new UrlPathHelper(); if (request.getRequestURI().endsWith(GRAILS_DISPATCH_EXTENSION)) { String path = pathHelper.getPathWithinApplication(request); if (path.startsWith(GRAILS_SERVLET_PATH)) { path = path.substring(GRAILS_SERVLET_PATH.length(),path.length()); } return path.substring(0, path.length() - GRAILS_DISPATCH_EXTENSION.length()); } return pathHelper.getPathWithinApplication(request); } }
public class class_name { public static String getRequestURIForGrailsDispatchURI(HttpServletRequest request) { UrlPathHelper pathHelper = new UrlPathHelper(); if (request.getRequestURI().endsWith(GRAILS_DISPATCH_EXTENSION)) { String path = pathHelper.getPathWithinApplication(request); if (path.startsWith(GRAILS_SERVLET_PATH)) { path = path.substring(GRAILS_SERVLET_PATH.length(),path.length()); // depends on control dependency: [if], data = [none] } return path.substring(0, path.length() - GRAILS_DISPATCH_EXTENSION.length()); // depends on control dependency: [if], data = [none] } return pathHelper.getPathWithinApplication(request); } }
public class class_name { @Override public void increment(long amount) { spectatorCounter.increment(amount); if (amount > 0L) { count.addAndGet(amount); } } }
public class class_name { @Override public void increment(long amount) { spectatorCounter.increment(amount); if (amount > 0L) { count.addAndGet(amount); // depends on control dependency: [if], data = [(amount] } } }
public class class_name { public void generateWitherForField(EclipseNode fieldNode, EclipseNode sourceNode, AccessLevel level) { for (EclipseNode child : fieldNode.down()) { if (child.getKind() == Kind.ANNOTATION) { if (annotationTypeMatches(Wither.class, child)) { //The annotation will make it happen, so we can skip it. return; } } } List<Annotation> empty = Collections.emptyList(); createWitherForField(level, fieldNode, sourceNode, false, empty, empty); } }
public class class_name { public void generateWitherForField(EclipseNode fieldNode, EclipseNode sourceNode, AccessLevel level) { for (EclipseNode child : fieldNode.down()) { if (child.getKind() == Kind.ANNOTATION) { if (annotationTypeMatches(Wither.class, child)) { //The annotation will make it happen, so we can skip it. return; // depends on control dependency: [if], data = [none] } } } List<Annotation> empty = Collections.emptyList(); createWitherForField(level, fieldNode, sourceNode, false, empty, empty); } }
public class class_name { public static boolean classExistsAndIsLoadable(String className) { try { Class.forName(className); return true; } catch (ClassNotFoundException e) { // Exception noted and ignored. e = null; return false; } } }
public class class_name { public static boolean classExistsAndIsLoadable(String className) { try { Class.forName(className); return true; // depends on control dependency: [try], data = [none] } catch (ClassNotFoundException e) { // Exception noted and ignored. e = null; return false; } // depends on control dependency: [catch], data = [none] } }
public class class_name { public byte[] getFingerprintFromFile(String fingerprintFile) { byte[] fingerprint = null; try { InputStream fis = new FileInputStream(fingerprintFile); fingerprint = getFingerprintFromInputStream(fis); fis.close(); } catch (IOException e) { e.printStackTrace(); } return fingerprint; } }
public class class_name { public byte[] getFingerprintFromFile(String fingerprintFile) { byte[] fingerprint = null; try { InputStream fis = new FileInputStream(fingerprintFile); fingerprint = getFingerprintFromInputStream(fis); // depends on control dependency: [try], data = [none] fis.close(); // depends on control dependency: [try], data = [none] } catch (IOException e) { e.printStackTrace(); } // depends on control dependency: [catch], data = [none] return fingerprint; } }
public class class_name { private void readObject(WebContext ctx, String bucketName, String objectId) throws IOException { Bucket bucket = storage.getBucket(bucketName); String id = objectId.replace('/', '_'); String uploadId = ctx.get("uploadId").asString(); if (!checkObjectRequest(ctx, bucket, id)) { return; } HttpMethod method = ctx.getRequest().method(); if (HEAD == method) { getObject(ctx, bucket, id, false); } else if (GET == method) { if (Strings.isFilled(uploadId)) { getPartList(ctx, bucket, id, uploadId); } else { getObject(ctx, bucket, id, true); } } else if (DELETE == method) { if (Strings.isFilled(uploadId)) { abortMultipartUpload(ctx, uploadId); } else { deleteObject(ctx, bucket, id); } } else { throw new IllegalArgumentException(ctx.getRequest().method().name()); } } }
public class class_name { private void readObject(WebContext ctx, String bucketName, String objectId) throws IOException { Bucket bucket = storage.getBucket(bucketName); String id = objectId.replace('/', '_'); String uploadId = ctx.get("uploadId").asString(); if (!checkObjectRequest(ctx, bucket, id)) { return; } HttpMethod method = ctx.getRequest().method(); if (HEAD == method) { getObject(ctx, bucket, id, false); } else if (GET == method) { if (Strings.isFilled(uploadId)) { getPartList(ctx, bucket, id, uploadId); // depends on control dependency: [if], data = [none] } else { getObject(ctx, bucket, id, true); // depends on control dependency: [if], data = [none] } } else if (DELETE == method) { if (Strings.isFilled(uploadId)) { abortMultipartUpload(ctx, uploadId); // depends on control dependency: [if], data = [none] } else { deleteObject(ctx, bucket, id); // depends on control dependency: [if], data = [none] } } else { throw new IllegalArgumentException(ctx.getRequest().method().name()); } } }
public class class_name { public Point3D_F64 getCorner(int index , Point3D_F64 corner ) { if( corner == null ) corner = new Point3D_F64(); corner.set(p); if( (index & 0x01) != 0 ) { corner.x += lengthX; } if( (index & 0x02) != 0 ) { corner.y += lengthY; } if( (index & 0x04) != 0 ) { corner.z += lengthZ; } return corner; } }
public class class_name { public Point3D_F64 getCorner(int index , Point3D_F64 corner ) { if( corner == null ) corner = new Point3D_F64(); corner.set(p); if( (index & 0x01) != 0 ) { corner.x += lengthX; // depends on control dependency: [if], data = [none] } if( (index & 0x02) != 0 ) { corner.y += lengthY; // depends on control dependency: [if], data = [none] } if( (index & 0x04) != 0 ) { corner.z += lengthZ; // depends on control dependency: [if], data = [none] } return corner; } }
public class class_name { public static double logGamma( double x ) { double ret; if (Double.isNaN(x) || (x <= 0.0)) { ret = Double.NaN; } else { double g = 607.0 / 128.0; double sum = 0.0; for( int i = LANCZOS.length - 1; i > 0; --i ) { sum = sum + (LANCZOS[i] / (x + i)); } sum = sum + LANCZOS[0]; double tmp = x + g + .5; ret = ((x + .5) * log(tmp)) - tmp + HALF_LOG_2_PI + log(sum / x); } return ret; } }
public class class_name { public static double logGamma( double x ) { double ret; if (Double.isNaN(x) || (x <= 0.0)) { ret = Double.NaN; // depends on control dependency: [if], data = [none] } else { double g = 607.0 / 128.0; double sum = 0.0; for( int i = LANCZOS.length - 1; i > 0; --i ) { sum = sum + (LANCZOS[i] / (x + i)); // depends on control dependency: [for], data = [i] } sum = sum + LANCZOS[0]; // depends on control dependency: [if], data = [none] double tmp = x + g + .5; ret = ((x + .5) * log(tmp)) - tmp + HALF_LOG_2_PI + log(sum / x); // depends on control dependency: [if], data = [none] } return ret; } }
public class class_name { public String queryCatalogClassName () { String className = System.getProperty(pClassname); if (className == null) { if (resources==null) readProperties(); if (resources==null) return null; try { return resources.getString("catalog-class-name"); } catch (MissingResourceException e) { return null; } } return className; } }
public class class_name { public String queryCatalogClassName () { String className = System.getProperty(pClassname); if (className == null) { if (resources==null) readProperties(); if (resources==null) return null; try { return resources.getString("catalog-class-name"); // depends on control dependency: [try], data = [none] } catch (MissingResourceException e) { return null; } // depends on control dependency: [catch], data = [none] } return className; } }
public class class_name { private void initializeVerifier() { ManifestEntryVerifier mev = null; // Verify "META-INF/" entries... try { String[] names = getMetaInfEntryNames(); if (names != null) { for (int i = 0; i < names.length; i++) { JarEntry e = getJarEntry(names[i]); if (e == null) { throw new JarException("corrupted jar file"); } if (!e.isDirectory()) { if (mev == null) { mev = new ManifestEntryVerifier (getManifestFromReference()); } byte[] b = getBytes(e); if (b != null && b.length > 0) { jv.beginEntry(e, mev); jv.update(b.length, b, 0, b.length, mev); jv.update(-1, null, 0, 0, mev); } } } } } catch (IOException ex) { // if we had an error parsing any blocks, just // treat the jar file as being unsigned jv = null; verify = false; if (JarVerifier.debug != null) { JarVerifier.debug.println("jarfile parsing error!"); ex.printStackTrace(); } } // if after initializing the verifier we have nothing // signed, we null it out. if (jv != null) { jv.doneWithMeta(); if (JarVerifier.debug != null) { JarVerifier.debug.println("done with meta!"); } if (jv.nothingToVerify()) { if (JarVerifier.debug != null) { JarVerifier.debug.println("nothing to verify!"); } jv = null; verify = false; } } } }
public class class_name { private void initializeVerifier() { ManifestEntryVerifier mev = null; // Verify "META-INF/" entries... try { String[] names = getMetaInfEntryNames(); if (names != null) { for (int i = 0; i < names.length; i++) { JarEntry e = getJarEntry(names[i]); if (e == null) { throw new JarException("corrupted jar file"); } if (!e.isDirectory()) { if (mev == null) { mev = new ManifestEntryVerifier (getManifestFromReference()); // depends on control dependency: [if], data = [none] } byte[] b = getBytes(e); if (b != null && b.length > 0) { jv.beginEntry(e, mev); // depends on control dependency: [if], data = [none] jv.update(b.length, b, 0, b.length, mev); // depends on control dependency: [if], data = [(b] jv.update(-1, null, 0, 0, mev); // depends on control dependency: [if], data = [none] } } } } } catch (IOException ex) { // if we had an error parsing any blocks, just // treat the jar file as being unsigned jv = null; verify = false; if (JarVerifier.debug != null) { JarVerifier.debug.println("jarfile parsing error!"); // depends on control dependency: [if], data = [none] ex.printStackTrace(); // depends on control dependency: [if], data = [none] } } // depends on control dependency: [catch], data = [none] // if after initializing the verifier we have nothing // signed, we null it out. if (jv != null) { jv.doneWithMeta(); // depends on control dependency: [if], data = [none] if (JarVerifier.debug != null) { JarVerifier.debug.println("done with meta!"); // depends on control dependency: [if], data = [none] } if (jv.nothingToVerify()) { if (JarVerifier.debug != null) { JarVerifier.debug.println("nothing to verify!"); // depends on control dependency: [if], data = [none] } jv = null; // depends on control dependency: [if], data = [none] verify = false; // depends on control dependency: [if], data = [none] } } } }