code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { public void marshall(DeleteFileShareRequest deleteFileShareRequest, ProtocolMarshaller protocolMarshaller) { if (deleteFileShareRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteFileShareRequest.getFileShareARN(), FILESHAREARN_BINDING); protocolMarshaller.marshall(deleteFileShareRequest.getForceDelete(), FORCEDELETE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(DeleteFileShareRequest deleteFileShareRequest, ProtocolMarshaller protocolMarshaller) { if (deleteFileShareRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteFileShareRequest.getFileShareARN(), FILESHAREARN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(deleteFileShareRequest.getForceDelete(), FORCEDELETE_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 double blackScholesOptionValue( double initialStockValue, double riskFreeRate, double volatility, double optionMaturity, double optionStrike, boolean isCall) { double callValue = blackScholesOptionValue(initialStockValue, riskFreeRate, volatility, optionMaturity, optionStrike); if(isCall) { return callValue; } else { double putValue = callValue - (initialStockValue-optionStrike * Math.exp(-riskFreeRate * optionMaturity)); return putValue; } } }
public class class_name { public static double blackScholesOptionValue( double initialStockValue, double riskFreeRate, double volatility, double optionMaturity, double optionStrike, boolean isCall) { double callValue = blackScholesOptionValue(initialStockValue, riskFreeRate, volatility, optionMaturity, optionStrike); if(isCall) { return callValue; // depends on control dependency: [if], data = [none] } else { double putValue = callValue - (initialStockValue-optionStrike * Math.exp(-riskFreeRate * optionMaturity)); return putValue; // depends on control dependency: [if], data = [none] } } }
public class class_name { public String getUserCertFile() { String location; location = System.getProperty("X509_USER_CERT"); if (location != null) { return location; } location = getProperty("usercert"); if (location != null) { return location; } return ConfigUtil.discoverUserCertLocation(); } }
public class class_name { public String getUserCertFile() { String location; location = System.getProperty("X509_USER_CERT"); if (location != null) { return location; // depends on control dependency: [if], data = [none] } location = getProperty("usercert"); if (location != null) { return location; // depends on control dependency: [if], data = [none] } return ConfigUtil.discoverUserCertLocation(); } }
public class class_name { private AstNumList parseNumList() { ArrayList<Double> bases = new ArrayList<>(); ArrayList<Double> strides = new ArrayList<>(); ArrayList<Long> counts = new ArrayList<>(); while (skipWS() != ']') { double base = number(); double count = 1; double stride = 1; if (skipWS() == ':') { eatChar(':'); skipWS(); count = number(); if (count < 1 || ((long) count) != count) throw new IllegalASTException("Count must be a positive integer, got " + count); } if (skipWS() == ':') { eatChar(':'); skipWS(); stride = number(); if (stride < 0 || Double.isNaN(stride)) throw new IllegalASTException("Stride must be positive, got " + stride); } if (count == 1 && stride != 1) throw new IllegalASTException("If count is 1, then stride must be one (and ignored)"); bases.add(base); counts.add((long) count); strides.add(stride); // Optional comma separating span if (skipWS() == ',') eatChar(','); } return new AstNumList(bases, strides, counts); } }
public class class_name { private AstNumList parseNumList() { ArrayList<Double> bases = new ArrayList<>(); ArrayList<Double> strides = new ArrayList<>(); ArrayList<Long> counts = new ArrayList<>(); while (skipWS() != ']') { double base = number(); double count = 1; double stride = 1; if (skipWS() == ':') { eatChar(':'); // depends on control dependency: [if], data = [':')] skipWS(); // depends on control dependency: [if], data = [none] count = number(); // depends on control dependency: [if], data = [none] if (count < 1 || ((long) count) != count) throw new IllegalASTException("Count must be a positive integer, got " + count); } if (skipWS() == ':') { eatChar(':'); // depends on control dependency: [if], data = [':')] skipWS(); // depends on control dependency: [if], data = [none] stride = number(); // depends on control dependency: [if], data = [none] if (stride < 0 || Double.isNaN(stride)) throw new IllegalASTException("Stride must be positive, got " + stride); } if (count == 1 && stride != 1) throw new IllegalASTException("If count is 1, then stride must be one (and ignored)"); bases.add(base); // depends on control dependency: [while], data = [none] counts.add((long) count); // depends on control dependency: [while], data = [none] strides.add(stride); // depends on control dependency: [while], data = [none] // Optional comma separating span if (skipWS() == ',') eatChar(','); } return new AstNumList(bases, strides, counts); } }
public class class_name { public static Point3dfx convert(Tuple3D<?> tuple) { if (tuple instanceof Point3dfx) { return (Point3dfx) tuple; } return new Point3dfx(tuple.getX(), tuple.getY(), tuple.getZ()); } }
public class class_name { public static Point3dfx convert(Tuple3D<?> tuple) { if (tuple instanceof Point3dfx) { return (Point3dfx) tuple; // depends on control dependency: [if], data = [none] } return new Point3dfx(tuple.getX(), tuple.getY(), tuple.getZ()); } }
public class class_name { @Override @SuppressWarnings("deprecation") public byte[] takeScreenshot() { ViewHierarchyAnalyzer viewAnalyzer = ViewHierarchyAnalyzer.getDefaultInstance(); // TODO ddary review later, but with getRecentDecorView() it seems to work better // long drawingTime = 0; // View container = null; // for (View view : viewAnalyzer.getTopLevelViews()) { // if (view != null && view.isShown() && view.hasWindowFocus() // && view.getDrawingTime() > drawingTime) { // container = view; // drawingTime = view.getDrawingTime(); // } // } // final View mainView = container; final View mainView = viewAnalyzer.getRecentDecorView(); if (mainView == null) { throw new SelendroidException("No open windows."); } done = false; long end = System.currentTimeMillis() + serverInstrumentation.getAndroidWait().getTimeoutInMillis(); final byte[][] rawPng = new byte[1][1]; serverInstrumentation.getCurrentActivity().runOnUiThread(new Runnable() { public void run() { synchronized (syncObject) { Display display = serverInstrumentation.getCurrentActivity().getWindowManager().getDefaultDisplay(); Point size = new Point(); try { display.getSize(size); } catch (NoSuchMethodError ignore) { // Older than api level 13 size.x = display.getWidth(); size.y = display.getHeight(); } // Get root view View view = mainView.getRootView(); // Create the bitmap to use to draw the screenshot final Bitmap bitmap = Bitmap.createBitmap(size.x, size.y, Bitmap.Config.ARGB_8888); final Canvas canvas = new Canvas(bitmap); // Get current theme to know which background to use final Activity activity = serverInstrumentation.getCurrentActivity(); final Theme theme = activity.getTheme(); final TypedArray ta = theme.obtainStyledAttributes(new int[] {android.R.attr.windowBackground}); final int res = ta.getResourceId(0, 0); final Drawable background = activity.getResources().getDrawable(res); // Draw background background.draw(canvas); // Draw views view.draw(canvas); ByteArrayOutputStream stream = new ByteArrayOutputStream(); if (!bitmap.compress(Bitmap.CompressFormat.PNG, 70, stream)) { throw new RuntimeException("Error while compressing screenshot image."); } try { stream.flush(); stream.close(); } catch (IOException e) { throw new RuntimeException("I/O Error while capturing screenshot: " + e.getMessage()); } finally { Closeable closeable = (Closeable) stream; try { if (closeable != null) { closeable.close(); } } catch (IOException ioe) { // ignore } } rawPng[0] = stream.toByteArray(); mainView.destroyDrawingCache(); done = true; syncObject.notify(); } } }); waitForDone(end, serverInstrumentation.getAndroidWait().getTimeoutInMillis(), "Failed to take screenshot."); return rawPng[0]; } }
public class class_name { @Override @SuppressWarnings("deprecation") public byte[] takeScreenshot() { ViewHierarchyAnalyzer viewAnalyzer = ViewHierarchyAnalyzer.getDefaultInstance(); // TODO ddary review later, but with getRecentDecorView() it seems to work better // long drawingTime = 0; // View container = null; // for (View view : viewAnalyzer.getTopLevelViews()) { // if (view != null && view.isShown() && view.hasWindowFocus() // && view.getDrawingTime() > drawingTime) { // container = view; // drawingTime = view.getDrawingTime(); // } // } // final View mainView = container; final View mainView = viewAnalyzer.getRecentDecorView(); if (mainView == null) { throw new SelendroidException("No open windows."); } done = false; long end = System.currentTimeMillis() + serverInstrumentation.getAndroidWait().getTimeoutInMillis(); final byte[][] rawPng = new byte[1][1]; serverInstrumentation.getCurrentActivity().runOnUiThread(new Runnable() { public void run() { synchronized (syncObject) { Display display = serverInstrumentation.getCurrentActivity().getWindowManager().getDefaultDisplay(); Point size = new Point(); try { display.getSize(size); // depends on control dependency: [try], data = [none] } catch (NoSuchMethodError ignore) { // Older than api level 13 size.x = display.getWidth(); size.y = display.getHeight(); } // depends on control dependency: [catch], data = [none] // Get root view View view = mainView.getRootView(); // Create the bitmap to use to draw the screenshot final Bitmap bitmap = Bitmap.createBitmap(size.x, size.y, Bitmap.Config.ARGB_8888); final Canvas canvas = new Canvas(bitmap); // Get current theme to know which background to use final Activity activity = serverInstrumentation.getCurrentActivity(); final Theme theme = activity.getTheme(); final TypedArray ta = theme.obtainStyledAttributes(new int[] {android.R.attr.windowBackground}); final int res = ta.getResourceId(0, 0); final Drawable background = activity.getResources().getDrawable(res); // Draw background background.draw(canvas); // Draw views view.draw(canvas); ByteArrayOutputStream stream = new ByteArrayOutputStream(); if (!bitmap.compress(Bitmap.CompressFormat.PNG, 70, stream)) { throw new RuntimeException("Error while compressing screenshot image."); } try { stream.flush(); // depends on control dependency: [try], data = [none] stream.close(); // depends on control dependency: [try], data = [none] } catch (IOException e) { throw new RuntimeException("I/O Error while capturing screenshot: " + e.getMessage()); } finally { // depends on control dependency: [catch], data = [none] Closeable closeable = (Closeable) stream; try { if (closeable != null) { closeable.close(); // depends on control dependency: [if], data = [none] } } catch (IOException ioe) { // ignore } // depends on control dependency: [catch], data = [none] } rawPng[0] = stream.toByteArray(); mainView.destroyDrawingCache(); done = true; syncObject.notify(); } } }); waitForDone(end, serverInstrumentation.getAndroidWait().getTimeoutInMillis(), "Failed to take screenshot."); return rawPng[0]; } }
public class class_name { public static String getPreparedSql(String patternSql) { Matcher matcher = PATTERN.matcher(patternSql); StringBuilder preparedSql = new StringBuilder(); int i = 0; int start = 0; while (matcher.find()) { i++; preparedSql.append(patternSql.substring(start, matcher.start())).append(" $").append(i).append(" "); start = matcher.end(); } if (preparedSql.length() == 0) { // no pattern elements in the pattern sql, return the pattern sql directly as prepared sql. return patternSql; } return preparedSql.toString(); } }
public class class_name { public static String getPreparedSql(String patternSql) { Matcher matcher = PATTERN.matcher(patternSql); StringBuilder preparedSql = new StringBuilder(); int i = 0; int start = 0; while (matcher.find()) { i++; // depends on control dependency: [while], data = [none] preparedSql.append(patternSql.substring(start, matcher.start())).append(" $").append(i).append(" "); // depends on control dependency: [while], data = [none] start = matcher.end(); // depends on control dependency: [while], data = [none] } if (preparedSql.length() == 0) { // no pattern elements in the pattern sql, return the pattern sql directly as prepared sql. return patternSql; // depends on control dependency: [if], data = [none] } return preparedSql.toString(); } }
public class class_name { public static TimeZone getBrowserTimeZone() { if (!StringUtils.isEmpty(fixedTimeZoneProperty)) { return TimeZone.getTimeZone(fixedTimeZoneProperty); } final WebBrowser webBrowser = com.vaadin.server.Page.getCurrent().getWebBrowser(); final String[] timeZones = TimeZone.getAvailableIDs(webBrowser.getRawTimezoneOffset()); TimeZone tz = TimeZone.getDefault(); for (final String string : timeZones) { final TimeZone t = TimeZone.getTimeZone(string); if (t.getRawOffset() == webBrowser.getRawTimezoneOffset()) { tz = t; } } return tz; } }
public class class_name { public static TimeZone getBrowserTimeZone() { if (!StringUtils.isEmpty(fixedTimeZoneProperty)) { return TimeZone.getTimeZone(fixedTimeZoneProperty); // depends on control dependency: [if], data = [none] } final WebBrowser webBrowser = com.vaadin.server.Page.getCurrent().getWebBrowser(); final String[] timeZones = TimeZone.getAvailableIDs(webBrowser.getRawTimezoneOffset()); TimeZone tz = TimeZone.getDefault(); for (final String string : timeZones) { final TimeZone t = TimeZone.getTimeZone(string); if (t.getRawOffset() == webBrowser.getRawTimezoneOffset()) { tz = t; // depends on control dependency: [if], data = [none] } } return tz; } }
public class class_name { @Override public synchronized void stop(final StopContext context) { Runnable r = new Runnable() { @Override public void run() { try { StreamUtils.safeClose(connection); responseAttachmentSupport.shutdown(); } finally { context.complete(); } } }; try { executor.execute(r); } catch (RejectedExecutionException e) { r.run(); } finally { context.asynchronous(); } } }
public class class_name { @Override public synchronized void stop(final StopContext context) { Runnable r = new Runnable() { @Override public void run() { try { StreamUtils.safeClose(connection); // depends on control dependency: [try], data = [none] responseAttachmentSupport.shutdown(); // depends on control dependency: [try], data = [none] } finally { context.complete(); } } }; try { executor.execute(r); // depends on control dependency: [try], data = [none] } catch (RejectedExecutionException e) { r.run(); } finally { // depends on control dependency: [catch], data = [none] context.asynchronous(); } } }
public class class_name { private Map<Integer, Class<? extends T>> findInstanceAbleScript(Set<Class<? extends T>> scriptClazzs) throws InstantiationException, IllegalAccessException { Map<Integer, Class<? extends T>> codeMap = new ConcurrentHashMap<Integer, Class<? extends T>>(); for (Class<? extends T> scriptClazz : scriptClazzs) { T script = getInstacne(scriptClazz); if(script==null) { continue; } if(skipRegistScript(script)) { _log.warn("skil regist script,code="+script.getMessageCode()+",class=" + script.getClass()); continue; } int code = script.getMessageCode(); if (codeMap.containsKey(script.getMessageCode())) {// 重复脚本code定义 _log.error("find Repeat ScriptClass,code="+code+",addingScript:" + script.getClass() + ",existScript:" + codeMap.get(code)); } else { codeMap.put(code, scriptClazz); _log.info("regist ScriptClass:code="+code+",class=" + scriptClazz); } } return codeMap; } }
public class class_name { private Map<Integer, Class<? extends T>> findInstanceAbleScript(Set<Class<? extends T>> scriptClazzs) throws InstantiationException, IllegalAccessException { Map<Integer, Class<? extends T>> codeMap = new ConcurrentHashMap<Integer, Class<? extends T>>(); for (Class<? extends T> scriptClazz : scriptClazzs) { T script = getInstacne(scriptClazz); if(script==null) { continue; } if(skipRegistScript(script)) { _log.warn("skil regist script,code="+script.getMessageCode()+",class=" + script.getClass()); // depends on control dependency: [if], data = [none] continue; } int code = script.getMessageCode(); if (codeMap.containsKey(script.getMessageCode())) {// 重复脚本code定义 _log.error("find Repeat ScriptClass,code="+code+",addingScript:" + script.getClass() + ",existScript:" + codeMap.get(code)); // depends on control dependency: [if], data = [none] } else { codeMap.put(code, scriptClazz); // depends on control dependency: [if], data = [none] _log.info("regist ScriptClass:code="+code+",class=" + scriptClazz); // depends on control dependency: [if], data = [none] } } return codeMap; } }
public class class_name { @Override public Iterable<Object> loadAllKeys() { if (isMapLoader()) { Iterable<Object> allKeys; try { allKeys = mapLoader.loadAllKeys(); } catch (AbstractMethodError e) { // Invoke reflectively to preserve backwards binary compatibility. Removable in v4.x allKeys = ReflectionHelper.invokeMethod(mapLoader, "loadAllKeys"); } return allKeys; } return null; } }
public class class_name { @Override public Iterable<Object> loadAllKeys() { if (isMapLoader()) { Iterable<Object> allKeys; try { allKeys = mapLoader.loadAllKeys(); // depends on control dependency: [try], data = [none] } catch (AbstractMethodError e) { // Invoke reflectively to preserve backwards binary compatibility. Removable in v4.x allKeys = ReflectionHelper.invokeMethod(mapLoader, "loadAllKeys"); } // depends on control dependency: [catch], data = [none] return allKeys; // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { @Override public boolean subscribe(IConsumer consumer, Map<String, Object> paramMap) { if (consumer instanceof IPushableConsumer) { boolean success = super.subscribe(consumer, paramMap); if (log.isDebugEnabled()) { log.debug("Consumer subscribe{} {} params: {}", new Object[] { (success ? "d" : " failed"), consumer, paramMap }); } if (success) { fireConsumerConnectionEvent(consumer, PipeConnectionEvent.EventType.CONSUMER_CONNECT_PUSH, paramMap); } return success; } else { throw new IllegalArgumentException("Non-pushable consumer not supported by PushPushPipe"); } } }
public class class_name { @Override public boolean subscribe(IConsumer consumer, Map<String, Object> paramMap) { if (consumer instanceof IPushableConsumer) { boolean success = super.subscribe(consumer, paramMap); if (log.isDebugEnabled()) { log.debug("Consumer subscribe{} {} params: {}", new Object[] { (success ? "d" : " failed"), consumer, paramMap }); // depends on control dependency: [if], data = [none] } if (success) { fireConsumerConnectionEvent(consumer, PipeConnectionEvent.EventType.CONSUMER_CONNECT_PUSH, paramMap); // depends on control dependency: [if], data = [none] } return success; // depends on control dependency: [if], data = [none] } else { throw new IllegalArgumentException("Non-pushable consumer not supported by PushPushPipe"); } } }
public class class_name { public static String get( String calendarType, DisplayStyle style, Locale locale ) { DisplayMode mode = DisplayMode.ofStyle(style.getStyleValue()); if (calendarType.equals(CalendarText.ISO_CALENDAR_TYPE)) { return CalendarText.patternForDate(mode, locale); } StringBuilder sb = new StringBuilder(); sb.append("F("); sb.append(Character.toLowerCase(mode.name().charAt(0))); sb.append(')'); String key = sb.toString(); PropertyBundle rb = GenericTextProviderSPI.getBundle(calendarType, locale); if (!rb.containsKey(key)) { rb = GenericTextProviderSPI.getBundle("generic", locale); } return rb.getString(key); } }
public class class_name { public static String get( String calendarType, DisplayStyle style, Locale locale ) { DisplayMode mode = DisplayMode.ofStyle(style.getStyleValue()); if (calendarType.equals(CalendarText.ISO_CALENDAR_TYPE)) { return CalendarText.patternForDate(mode, locale); // depends on control dependency: [if], data = [none] } StringBuilder sb = new StringBuilder(); sb.append("F("); sb.append(Character.toLowerCase(mode.name().charAt(0))); sb.append(')'); String key = sb.toString(); PropertyBundle rb = GenericTextProviderSPI.getBundle(calendarType, locale); if (!rb.containsKey(key)) { rb = GenericTextProviderSPI.getBundle("generic", locale); // depends on control dependency: [if], data = [none] } return rb.getString(key); } }
public class class_name { public EEnum getIfcSurfaceSide() { if (ifcSurfaceSideEEnum == null) { ifcSurfaceSideEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(908); } return ifcSurfaceSideEEnum; } }
public class class_name { public EEnum getIfcSurfaceSide() { if (ifcSurfaceSideEEnum == null) { ifcSurfaceSideEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(908); // depends on control dependency: [if], data = [none] } return ifcSurfaceSideEEnum; } }
public class class_name { public static double normInf(double[] x) { int n = x.length; double f = Math.abs(x[0]); for (int i = 1; i < n; i++) { f = Math.max(f, Math.abs(x[i])); } return f; } }
public class class_name { public static double normInf(double[] x) { int n = x.length; double f = Math.abs(x[0]); for (int i = 1; i < n; i++) { f = Math.max(f, Math.abs(x[i])); // depends on control dependency: [for], data = [i] } return f; } }
public class class_name { public int getServerPort() { if (WCCustomProperties.CHECK_REQUEST_OBJECT_IN_USE){ checkRequestObjectInUse(); } // 321485 int port = this._request.getServerPort(); if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15 logger.logp(Level.FINE, CLASS_NAME,"getServerPort", "this->"+this+": "+" port --> " + String.valueOf(port)); } return port; } }
public class class_name { public int getServerPort() { if (WCCustomProperties.CHECK_REQUEST_OBJECT_IN_USE){ checkRequestObjectInUse(); // depends on control dependency: [if], data = [none] } // 321485 int port = this._request.getServerPort(); if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15 logger.logp(Level.FINE, CLASS_NAME,"getServerPort", "this->"+this+": "+" port --> " + String.valueOf(port)); // depends on control dependency: [if], data = [none] } return port; } }
public class class_name { public int skip(int maxSize) { int s = maxSize; while (hasRemaining()) { ByteBuf buf = bufs[first]; int remaining = buf.readRemaining(); if (s < remaining) { buf.moveHead(s); return maxSize; } else { buf.recycle(); first = next(first); s -= remaining; } } return maxSize - s; } }
public class class_name { public int skip(int maxSize) { int s = maxSize; while (hasRemaining()) { ByteBuf buf = bufs[first]; int remaining = buf.readRemaining(); if (s < remaining) { buf.moveHead(s); // depends on control dependency: [if], data = [(s] return maxSize; // depends on control dependency: [if], data = [none] } else { buf.recycle(); // depends on control dependency: [if], data = [none] first = next(first); // depends on control dependency: [if], data = [none] s -= remaining; // depends on control dependency: [if], data = [none] } } return maxSize - s; } }
public class class_name { public void updateValue() { try { Method method = m_propertyMetadata.getSetMethod(); //Object convertedValue = ValidationUtils.convertTo(getClazz(), m_currentValue); if (m_currentValue == null && method.getParameterTypes()[0].isPrimitive()) { method.invoke(m_proxyObject.getObject(), ConvertUtils.getPrimitiveTypeForNull(method.getParameterTypes()[0])); } else { method.invoke(m_proxyObject.getObject(), m_currentValue); } m_useCurrentValue = false; m_notKnown = false; } catch (Exception e) { throw new RuntimeException(e); } } }
public class class_name { public void updateValue() { try { Method method = m_propertyMetadata.getSetMethod(); //Object convertedValue = ValidationUtils.convertTo(getClazz(), m_currentValue); if (m_currentValue == null && method.getParameterTypes()[0].isPrimitive()) { method.invoke(m_proxyObject.getObject(), ConvertUtils.getPrimitiveTypeForNull(method.getParameterTypes()[0])); // depends on control dependency: [if], data = [none] } else { method.invoke(m_proxyObject.getObject(), m_currentValue); // depends on control dependency: [if], data = [none] } m_useCurrentValue = false; // depends on control dependency: [try], data = [none] m_notKnown = false; // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new RuntimeException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private boolean checkParents( boolean exclusive ) { if (path.equals("/")) { return true; } if (owner == null) { // no owner, checking parents return parent != null && parent.checkParents(exclusive); } // there already is a owner return !(this.exclusive || exclusive) && parent.checkParents(exclusive); } }
public class class_name { private boolean checkParents( boolean exclusive ) { if (path.equals("/")) { return true; // depends on control dependency: [if], data = [none] } if (owner == null) { // no owner, checking parents return parent != null && parent.checkParents(exclusive); // depends on control dependency: [if], data = [none] } // there already is a owner return !(this.exclusive || exclusive) && parent.checkParents(exclusive); } }
public class class_name { @Override protected void readRow(int uniqueID, byte[] data) { if (data[0] != (byte) 0xFF) { Map<String, Object> map = new HashMap<String, Object>(); map.put("UNIQUE_ID", Integer.valueOf(uniqueID)); map.put("NAME", PEPUtility.getString(data, 1, 8)); map.put("START", PEPUtility.getStartDate(data, 9)); map.put("BASE_CALENDAR_ID", Integer.valueOf(PEPUtility.getShort(data, 11))); map.put("FIRST_CALENDAR_EXCEPTION_ID", Integer.valueOf(PEPUtility.getShort(data, 13))); map.put("SUNDAY", Boolean.valueOf((data[17] & 0x40) == 0)); map.put("MONDAY", Boolean.valueOf((data[17] & 0x02) == 0)); map.put("TUESDAY", Boolean.valueOf((data[17] & 0x04) == 0)); map.put("WEDNESDAY", Boolean.valueOf((data[17] & 0x08) == 0)); map.put("THURSDAY", Boolean.valueOf((data[17] & 0x10) == 0)); map.put("FRIDAY", Boolean.valueOf((data[17] & 0x20) == 0)); map.put("SATURDAY", Boolean.valueOf((data[17] & 0x01) == 0)); addRow(uniqueID, map); } } }
public class class_name { @Override protected void readRow(int uniqueID, byte[] data) { if (data[0] != (byte) 0xFF) { Map<String, Object> map = new HashMap<String, Object>(); map.put("UNIQUE_ID", Integer.valueOf(uniqueID)); // depends on control dependency: [if], data = [none] map.put("NAME", PEPUtility.getString(data, 1, 8)); // depends on control dependency: [if], data = [none] map.put("START", PEPUtility.getStartDate(data, 9)); // depends on control dependency: [if], data = [none] map.put("BASE_CALENDAR_ID", Integer.valueOf(PEPUtility.getShort(data, 11))); // depends on control dependency: [if], data = [none] map.put("FIRST_CALENDAR_EXCEPTION_ID", Integer.valueOf(PEPUtility.getShort(data, 13))); // depends on control dependency: [if], data = [none] map.put("SUNDAY", Boolean.valueOf((data[17] & 0x40) == 0)); // depends on control dependency: [if], data = [none] map.put("MONDAY", Boolean.valueOf((data[17] & 0x02) == 0)); // depends on control dependency: [if], data = [none] map.put("TUESDAY", Boolean.valueOf((data[17] & 0x04) == 0)); // depends on control dependency: [if], data = [none] map.put("WEDNESDAY", Boolean.valueOf((data[17] & 0x08) == 0)); // depends on control dependency: [if], data = [none] map.put("THURSDAY", Boolean.valueOf((data[17] & 0x10) == 0)); // depends on control dependency: [if], data = [none] map.put("FRIDAY", Boolean.valueOf((data[17] & 0x20) == 0)); // depends on control dependency: [if], data = [none] map.put("SATURDAY", Boolean.valueOf((data[17] & 0x01) == 0)); // depends on control dependency: [if], data = [none] addRow(uniqueID, map); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void printInferredRelations(ClassDoc c) { // check if the source is excluded from inference if (hidden(c)) return; Options opt = optionProvider.getOptionsFor(c); for (FieldDoc field : c.fields(false)) { if(hidden(field)) continue; // skip statics if(field.isStatic()) continue; // skip primitives FieldRelationInfo fri = getFieldRelationInfo(field); if (fri == null) continue; // check if the destination is excluded from inference if (hidden(fri.cd)) continue; // if source and dest are not already linked, add a dependency RelationPattern rp = getClassInfo(c, true).getRelation(fri.cd.toString()); if (rp == null) { String destAdornment = fri.multiple ? "*" : ""; relation(opt, opt.inferRelationshipType, c, fri.cd, "", "", destAdornment); } } } }
public class class_name { public void printInferredRelations(ClassDoc c) { // check if the source is excluded from inference if (hidden(c)) return; Options opt = optionProvider.getOptionsFor(c); for (FieldDoc field : c.fields(false)) { if(hidden(field)) continue; // skip statics if(field.isStatic()) continue; // skip primitives FieldRelationInfo fri = getFieldRelationInfo(field); if (fri == null) continue; // check if the destination is excluded from inference if (hidden(fri.cd)) continue; // if source and dest are not already linked, add a dependency RelationPattern rp = getClassInfo(c, true).getRelation(fri.cd.toString()); if (rp == null) { String destAdornment = fri.multiple ? "*" : ""; relation(opt, opt.inferRelationshipType, c, fri.cd, "", "", destAdornment); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public void stop() { // Invalidate all sessions to cause unbind events ArrayList sessions = new ArrayList(_sessions.values()); for (Iterator i = sessions.iterator(); i.hasNext(); ) { Session session = (Session)i.next(); session.invalidate(); } _sessions.clear(); // stop the scavenger SessionScavenger scavenger = _scavenger; _scavenger=null; if (scavenger!=null) scavenger.interrupt(); } }
public class class_name { public void stop() { // Invalidate all sessions to cause unbind events ArrayList sessions = new ArrayList(_sessions.values()); for (Iterator i = sessions.iterator(); i.hasNext(); ) { Session session = (Session)i.next(); session.invalidate(); // depends on control dependency: [for], data = [none] } _sessions.clear(); // stop the scavenger SessionScavenger scavenger = _scavenger; _scavenger=null; if (scavenger!=null) scavenger.interrupt(); } }
public class class_name { @Override @Transactional(propagation = Propagation.NEVER) public List<Long> getResources(final String theUuid, int theFrom, int theTo) { TransactionTemplate txTemplate = new TransactionTemplate(myManagedTxManager); txTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); Search search; StopWatch sw = new StopWatch(); while (true) { if (myNeverUseLocalSearchForUnitTests == false) { BaseTask task = myIdToSearchTask.get(theUuid); if (task != null) { ourLog.trace("Local search found"); List<Long> resourcePids = task.getResourcePids(theFrom, theTo); if (resourcePids != null) { return resourcePids; } } } search = txTemplate.execute(t -> mySearchDao.findByUuid(theUuid)); if (search == null) { ourLog.debug("Client requested unknown paging ID[{}]", theUuid); String msg = myContext.getLocalizer().getMessage(PageMethodBinding.class, "unknownSearchId", theUuid); throw new ResourceGoneException(msg); } verifySearchHasntFailedOrThrowInternalErrorException(search); if (search.getStatus() == SearchStatusEnum.FINISHED) { ourLog.debug("Search entity marked as finished with {} results", search.getNumFound()); break; } if (search.getNumFound() >= theTo) { ourLog.debug("Search entity has {} results so far", search.getNumFound()); break; } if (sw.getMillis() > myMaxMillisToWaitForRemoteResults) { ourLog.error("Search {} of type {} for {}{} timed out after {}ms", search.getId(), search.getSearchType(), search.getResourceType(), search.getSearchQueryString(), sw.getMillis()); throw new InternalErrorException("Request timed out after " + sw.getMillis() + "ms"); } // If the search was saved in "pass complete mode" it's probably time to // start a new pass if (search.getStatus() == SearchStatusEnum.PASSCMPLET) { Optional<Search> newSearch = tryToMarkSearchAsInProgress(search); if (newSearch.isPresent()) { search = newSearch.get(); String resourceType = search.getResourceType(); SearchParameterMap params = search.getSearchParameterMap(); IFhirResourceDao<?> resourceDao = myDaoRegistry.getResourceDao(resourceType); SearchContinuationTask task = new SearchContinuationTask(search, resourceDao, params, resourceType); myIdToSearchTask.put(search.getUuid(), task); myExecutor.submit(task); } } try { Thread.sleep(500); } catch (InterruptedException e) { // ignore } } final Pageable page = toPage(theFrom, theTo); if (page == null) { return Collections.emptyList(); } final Search foundSearch = search; ourLog.trace("Loading stored search"); List<Long> retVal = txTemplate.execute(theStatus -> { final List<Long> resultPids = new ArrayList<>(); Page<Long> searchResultPids = mySearchResultDao.findWithSearchUuid(foundSearch, page); for (Long next : searchResultPids) { resultPids.add(next); } return resultPids; }); return retVal; } }
public class class_name { @Override @Transactional(propagation = Propagation.NEVER) public List<Long> getResources(final String theUuid, int theFrom, int theTo) { TransactionTemplate txTemplate = new TransactionTemplate(myManagedTxManager); txTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); Search search; StopWatch sw = new StopWatch(); while (true) { if (myNeverUseLocalSearchForUnitTests == false) { BaseTask task = myIdToSearchTask.get(theUuid); if (task != null) { ourLog.trace("Local search found"); // depends on control dependency: [if], data = [none] List<Long> resourcePids = task.getResourcePids(theFrom, theTo); if (resourcePids != null) { return resourcePids; // depends on control dependency: [if], data = [none] } } } search = txTemplate.execute(t -> mySearchDao.findByUuid(theUuid)); if (search == null) { ourLog.debug("Client requested unknown paging ID[{}]", theUuid); String msg = myContext.getLocalizer().getMessage(PageMethodBinding.class, "unknownSearchId", theUuid); // depends on control dependency: [if], data = [none] throw new ResourceGoneException(msg); } verifySearchHasntFailedOrThrowInternalErrorException(search); if (search.getStatus() == SearchStatusEnum.FINISHED) { ourLog.debug("Search entity marked as finished with {} results", search.getNumFound()); // depends on control dependency: [if], data = [none] break; } if (search.getNumFound() >= theTo) { ourLog.debug("Search entity has {} results so far", search.getNumFound()); // depends on control dependency: [if], data = [none] break; } if (sw.getMillis() > myMaxMillisToWaitForRemoteResults) { ourLog.error("Search {} of type {} for {}{} timed out after {}ms", search.getId(), search.getSearchType(), search.getResourceType(), search.getSearchQueryString(), sw.getMillis()); throw new InternalErrorException("Request timed out after " + sw.getMillis() + "ms"); } // If the search was saved in "pass complete mode" it's probably time to // start a new pass if (search.getStatus() == SearchStatusEnum.PASSCMPLET) { Optional<Search> newSearch = tryToMarkSearchAsInProgress(search); if (newSearch.isPresent()) { search = newSearch.get(); String resourceType = search.getResourceType(); SearchParameterMap params = search.getSearchParameterMap(); IFhirResourceDao<?> resourceDao = myDaoRegistry.getResourceDao(resourceType); SearchContinuationTask task = new SearchContinuationTask(search, resourceDao, params, resourceType); myIdToSearchTask.put(search.getUuid(), task); myExecutor.submit(task); } } try { Thread.sleep(500); } catch (InterruptedException e) { // ignore } } final Pageable page = toPage(theFrom, theTo); if (page == null) { return Collections.emptyList(); } final Search foundSearch = search; ourLog.trace("Loading stored search"); List<Long> retVal = txTemplate.execute(theStatus -> { final List<Long> resultPids = new ArrayList<>(); Page<Long> searchResultPids = mySearchResultDao.findWithSearchUuid(foundSearch, page); for (Long next : searchResultPids) { resultPids.add(next); } return resultPids; }); return retVal; } }
public class class_name { public void join() { try { if (server != null) server.join(); if (triggerThread != null) triggerThread.join(); if (urfThread != null) urfThread.join(); if (blockFixerThread != null) blockFixerThread.join(); if (blockCopierThread != null) blockCopierThread.join(); if (corruptFileCounterThread != null) corruptFileCounterThread.join(); if (purgeThread != null) purgeThread.join(); if (statsCollectorThread != null) statsCollectorThread.join(); } catch (InterruptedException ie) { // do nothing } } }
public class class_name { public void join() { try { if (server != null) server.join(); if (triggerThread != null) triggerThread.join(); if (urfThread != null) urfThread.join(); if (blockFixerThread != null) blockFixerThread.join(); if (blockCopierThread != null) blockCopierThread.join(); if (corruptFileCounterThread != null) corruptFileCounterThread.join(); if (purgeThread != null) purgeThread.join(); if (statsCollectorThread != null) statsCollectorThread.join(); } catch (InterruptedException ie) { // do nothing } // depends on control dependency: [catch], data = [none] } }
public class class_name { protected boolean performEditOperation(HttpServletRequest request) throws CmsException { boolean useTempfileProject = Boolean.valueOf(getParamUsetempfileproject()).booleanValue(); try { if (useTempfileProject) { switchToTempProject(); } // write the common properties defined in the explorer type settings Iterator<String> i = getExplorerTypeSettings().getProperties().iterator(); // iterate over the properties while (i.hasNext()) { String curProperty = i.next(); String paramValue = request.getParameter(PREFIX_VALUE + curProperty); String oldValue = request.getParameter(PREFIX_HIDDEN + curProperty); writeProperty(curProperty, paramValue, oldValue); } // write the navigation properties if enabled if (showNavigation()) { // get the navigation enabled parameter String paramValue = request.getParameter("enablenav"); String oldValue = null; if (Boolean.valueOf(paramValue).booleanValue()) { // navigation enabled, update params paramValue = request.getParameter("navpos"); if (!"-1".equals(paramValue) && !String.valueOf(Float.MAX_VALUE).equals(paramValue)) { // update the property only when it is different from "-1" (meaning no change) oldValue = request.getParameter(PREFIX_HIDDEN + CmsPropertyDefinition.PROPERTY_NAVPOS); writeProperty(CmsPropertyDefinition.PROPERTY_NAVPOS, paramValue, oldValue); } paramValue = request.getParameter(PREFIX_VALUE + CmsPropertyDefinition.PROPERTY_NAVTEXT); oldValue = request.getParameter(PREFIX_HIDDEN + CmsPropertyDefinition.PROPERTY_NAVTEXT); writeProperty(CmsPropertyDefinition.PROPERTY_NAVTEXT, paramValue, oldValue); } else { // navigation disabled, delete property values writeProperty(CmsPropertyDefinition.PROPERTY_NAVPOS, null, null); writeProperty(CmsPropertyDefinition.PROPERTY_NAVTEXT, null, null); } } } finally { if (useTempfileProject) { switchToCurrentProject(); } } return true; } }
public class class_name { protected boolean performEditOperation(HttpServletRequest request) throws CmsException { boolean useTempfileProject = Boolean.valueOf(getParamUsetempfileproject()).booleanValue(); try { if (useTempfileProject) { switchToTempProject(); // depends on control dependency: [if], data = [none] } // write the common properties defined in the explorer type settings Iterator<String> i = getExplorerTypeSettings().getProperties().iterator(); // iterate over the properties while (i.hasNext()) { String curProperty = i.next(); String paramValue = request.getParameter(PREFIX_VALUE + curProperty); String oldValue = request.getParameter(PREFIX_HIDDEN + curProperty); writeProperty(curProperty, paramValue, oldValue); // depends on control dependency: [while], data = [none] } // write the navigation properties if enabled if (showNavigation()) { // get the navigation enabled parameter String paramValue = request.getParameter("enablenav"); String oldValue = null; if (Boolean.valueOf(paramValue).booleanValue()) { // navigation enabled, update params paramValue = request.getParameter("navpos"); // depends on control dependency: [if], data = [none] if (!"-1".equals(paramValue) && !String.valueOf(Float.MAX_VALUE).equals(paramValue)) { // update the property only when it is different from "-1" (meaning no change) oldValue = request.getParameter(PREFIX_HIDDEN + CmsPropertyDefinition.PROPERTY_NAVPOS); // depends on control dependency: [if], data = [none] writeProperty(CmsPropertyDefinition.PROPERTY_NAVPOS, paramValue, oldValue); // depends on control dependency: [if], data = [none] } paramValue = request.getParameter(PREFIX_VALUE + CmsPropertyDefinition.PROPERTY_NAVTEXT); // depends on control dependency: [if], data = [none] oldValue = request.getParameter(PREFIX_HIDDEN + CmsPropertyDefinition.PROPERTY_NAVTEXT); // depends on control dependency: [if], data = [none] writeProperty(CmsPropertyDefinition.PROPERTY_NAVTEXT, paramValue, oldValue); // depends on control dependency: [if], data = [none] } else { // navigation disabled, delete property values writeProperty(CmsPropertyDefinition.PROPERTY_NAVPOS, null, null); // depends on control dependency: [if], data = [none] writeProperty(CmsPropertyDefinition.PROPERTY_NAVTEXT, null, null); // depends on control dependency: [if], data = [none] } } } finally { if (useTempfileProject) { switchToCurrentProject(); // depends on control dependency: [if], data = [none] } } return true; } }
public class class_name { @Override public Integer getInteger(final String key, final Integer defaultValue) { try { String value = get(key); if (value == null) { return defaultValue; } return Integer.valueOf(value); } catch (NumberFormatException ex) { throw new ConversionException(ex); } } }
public class class_name { @Override public Integer getInteger(final String key, final Integer defaultValue) { try { String value = get(key); if (value == null) { return defaultValue; // depends on control dependency: [if], data = [none] } return Integer.valueOf(value); // depends on control dependency: [try], data = [none] } catch (NumberFormatException ex) { throw new ConversionException(ex); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static void configure(Job conf, SimpleConfiguration config) { try { FluoConfiguration fconfig = new FluoConfiguration(config); try (Environment env = new Environment(fconfig)) { long ts = env.getSharedResources().getTimestampTracker().allocateTimestamp().getTxTimestamp(); conf.getConfiguration().setLong(TIMESTAMP_CONF_KEY, ts); ByteArrayOutputStream baos = new ByteArrayOutputStream(); config.save(baos); conf.getConfiguration().set(PROPS_CONF_KEY, new String(baos.toByteArray(), StandardCharsets.UTF_8)); AccumuloInputFormat.setZooKeeperInstance(conf, fconfig.getAccumuloInstance(), fconfig.getAccumuloZookeepers()); AccumuloInputFormat.setConnectorInfo(conf, fconfig.getAccumuloUser(), new PasswordToken(fconfig.getAccumuloPassword())); AccumuloInputFormat.setInputTableName(conf, env.getTable()); AccumuloInputFormat.setScanAuthorizations(conf, env.getAuthorizations()); } } catch (Exception e) { throw new RuntimeException(e); } } }
public class class_name { public static void configure(Job conf, SimpleConfiguration config) { try { FluoConfiguration fconfig = new FluoConfiguration(config); try (Environment env = new Environment(fconfig)) { long ts = env.getSharedResources().getTimestampTracker().allocateTimestamp().getTxTimestamp(); conf.getConfiguration().setLong(TIMESTAMP_CONF_KEY, ts); // depends on control dependency: [try], data = [none] ByteArrayOutputStream baos = new ByteArrayOutputStream(); config.save(baos); // depends on control dependency: [try], data = [none] conf.getConfiguration().set(PROPS_CONF_KEY, new String(baos.toByteArray(), StandardCharsets.UTF_8)); // depends on control dependency: [try], data = [none] AccumuloInputFormat.setZooKeeperInstance(conf, fconfig.getAccumuloInstance(), fconfig.getAccumuloZookeepers()); // depends on control dependency: [try], data = [none] AccumuloInputFormat.setConnectorInfo(conf, fconfig.getAccumuloUser(), new PasswordToken(fconfig.getAccumuloPassword())); // depends on control dependency: [try], data = [none] AccumuloInputFormat.setInputTableName(conf, env.getTable()); // depends on control dependency: [try], data = [none] AccumuloInputFormat.setScanAuthorizations(conf, env.getAuthorizations()); // depends on control dependency: [try], data = [none] } } catch (Exception e) { throw new RuntimeException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public int purge() { int result = 0; synchronized(queue) { for (int i = queue.size(); i > 0; i--) { if (queue.get(i).state == TimerTask.CANCELLED) { queue.quickRemove(i); result++; } } if (result != 0) queue.heapify(); } return result; } }
public class class_name { public int purge() { int result = 0; synchronized(queue) { for (int i = queue.size(); i > 0; i--) { if (queue.get(i).state == TimerTask.CANCELLED) { queue.quickRemove(i); // depends on control dependency: [if], data = [none] result++; // depends on control dependency: [if], data = [none] } } if (result != 0) queue.heapify(); } return result; } }
public class class_name { public static List<Node> getParentChangeScopeNodes(List<Node> scopeNodes) { Set<Node> parentScopeNodes = new LinkedHashSet<>(scopeNodes); for (Node scopeNode : scopeNodes) { parentScopeNodes.add(getEnclosingChangeScopeRoot(scopeNode)); } return new ArrayList<>(parentScopeNodes); } }
public class class_name { public static List<Node> getParentChangeScopeNodes(List<Node> scopeNodes) { Set<Node> parentScopeNodes = new LinkedHashSet<>(scopeNodes); for (Node scopeNode : scopeNodes) { parentScopeNodes.add(getEnclosingChangeScopeRoot(scopeNode)); // depends on control dependency: [for], data = [scopeNode] } return new ArrayList<>(parentScopeNodes); } }
public class class_name { public void addExtensions(Collection<ExtensionElement> extensions) { if (extensions == null) return; for (ExtensionElement packetExtension : extensions) { addExtension(packetExtension); } } }
public class class_name { public void addExtensions(Collection<ExtensionElement> extensions) { if (extensions == null) return; for (ExtensionElement packetExtension : extensions) { addExtension(packetExtension); // depends on control dependency: [for], data = [packetExtension] } } }
public class class_name { private void _processQueue () { SoftValue <K, V> aSoftValue; while ((aSoftValue = GenericReflection.uncheckedCast (m_aQueue.poll ())) != null) { m_aSrcMap.remove (aSoftValue.m_aKey); } } }
public class class_name { private void _processQueue () { SoftValue <K, V> aSoftValue; while ((aSoftValue = GenericReflection.uncheckedCast (m_aQueue.poll ())) != null) { m_aSrcMap.remove (aSoftValue.m_aKey); // depends on control dependency: [while], data = [none] } } }
public class class_name { public Object execute(final Map<Object, Object> iArgs) { ODatabaseDocumentInternal db = getDatabase(); db.begin(); if (className == null && clusterName == null) throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet"); OModifiableBoolean shutdownGraph = new OModifiableBoolean(); final boolean txAlreadyBegun = getDatabase().getTransaction().isActive(); try { final Set<OIdentifiable> sourceRIDs = OSQLEngine.getInstance().parseRIDTarget(db, source, context, iArgs); // CREATE EDGES final List<ODocument> result = new ArrayList<ODocument>(sourceRIDs.size()); for (OIdentifiable from : sourceRIDs) { final OVertex fromVertex = toVertex(from); if (fromVertex == null) continue; final ORID oldVertex = fromVertex.getIdentity().copy(); final ORID newVertex = fromVertex.moveTo(className, clusterName); final ODocument newVertexDoc = newVertex.getRecord(); if (fields != null) { // EVALUATE FIELDS for (final OPair<String, Object> f : fields) { if (f.getValue() instanceof OSQLFunctionRuntime) f.setValue(((OSQLFunctionRuntime) f.getValue()).getValue(newVertex.getRecord(), null, context)); } OSQLHelper.bindParameters(newVertexDoc, fields, new OCommandParameters(iArgs), context); } if (merge != null) newVertexDoc.merge(merge, true, false); // SAVE CHANGES newVertexDoc.save(); // PUT THE MOVE INTO THE RESULT result .add(new ODocument().setTrackingChanges(false).field("old", oldVertex, OType.LINK).field("new", newVertex, OType.LINK)); if (batch > 0 && result.size() % batch == 0) { db.commit(); db.begin(); } } db.commit(); return result; } finally { // if (!txAlreadyBegun) // db.commit(); } } }
public class class_name { public Object execute(final Map<Object, Object> iArgs) { ODatabaseDocumentInternal db = getDatabase(); db.begin(); if (className == null && clusterName == null) throw new OCommandExecutionException("Cannot execute the command because it has not been parsed yet"); OModifiableBoolean shutdownGraph = new OModifiableBoolean(); final boolean txAlreadyBegun = getDatabase().getTransaction().isActive(); try { final Set<OIdentifiable> sourceRIDs = OSQLEngine.getInstance().parseRIDTarget(db, source, context, iArgs); // CREATE EDGES final List<ODocument> result = new ArrayList<ODocument>(sourceRIDs.size()); for (OIdentifiable from : sourceRIDs) { final OVertex fromVertex = toVertex(from); if (fromVertex == null) continue; final ORID oldVertex = fromVertex.getIdentity().copy(); final ORID newVertex = fromVertex.moveTo(className, clusterName); final ODocument newVertexDoc = newVertex.getRecord(); if (fields != null) { // EVALUATE FIELDS for (final OPair<String, Object> f : fields) { if (f.getValue() instanceof OSQLFunctionRuntime) f.setValue(((OSQLFunctionRuntime) f.getValue()).getValue(newVertex.getRecord(), null, context)); } OSQLHelper.bindParameters(newVertexDoc, fields, new OCommandParameters(iArgs), context); // depends on control dependency: [if], data = [none] } if (merge != null) newVertexDoc.merge(merge, true, false); // SAVE CHANGES newVertexDoc.save(); // PUT THE MOVE INTO THE RESULT result .add(new ODocument().setTrackingChanges(false).field("old", oldVertex, OType.LINK).field("new", newVertex, OType.LINK)); if (batch > 0 && result.size() % batch == 0) { db.commit(); // depends on control dependency: [if], data = [none] db.begin(); // depends on control dependency: [if], data = [none] } } db.commit(); // depends on control dependency: [try], data = [none] return result; // depends on control dependency: [try], data = [none] } finally { // if (!txAlreadyBegun) // db.commit(); } } }
public class class_name { @Override public Location translate() { if (this.location == null) { // In OCPP 1.5, OUTLET is the default value. return Location.OUTLET; } switch (this.location) { case INLET: return Location.INLET; case OUTLET: return Location.OUTLET; case BODY: return Location.BODY; default: throw new AssertionError(String.format("Unknown value for Location: '%s'", location)); } } }
public class class_name { @Override public Location translate() { if (this.location == null) { // In OCPP 1.5, OUTLET is the default value. return Location.OUTLET; // depends on control dependency: [if], data = [none] } switch (this.location) { case INLET: return Location.INLET; case OUTLET: return Location.OUTLET; case BODY: return Location.BODY; default: throw new AssertionError(String.format("Unknown value for Location: '%s'", location)); } } }
public class class_name { public static byte getByte(MemorySegment[] segments, int offset) { if (inFirstSegment(segments, offset, 1)) { return segments[0].get(offset); } else { return getByteMultiSegments(segments, offset); } } }
public class class_name { public static byte getByte(MemorySegment[] segments, int offset) { if (inFirstSegment(segments, offset, 1)) { return segments[0].get(offset); // depends on control dependency: [if], data = [none] } else { return getByteMultiSegments(segments, offset); // depends on control dependency: [if], data = [none] } } }
public class class_name { private VectorServerLayer searchLayer(MapPresenter mapPresenter, String layerId) { if (layerId != null) { for (int i = 0; i < mapPresenter.getLayersModel().getLayerCount(); i++) { Layer layer = mapPresenter.getLayersModel().getLayer(i); if (layer instanceof VectorServerLayer) { VectorServerLayer serverLayer = (VectorServerLayer) layer; if (layerId.equals(serverLayer.getServerLayerId())) { return (VectorServerLayer) layer; } } } } return null; } }
public class class_name { private VectorServerLayer searchLayer(MapPresenter mapPresenter, String layerId) { if (layerId != null) { for (int i = 0; i < mapPresenter.getLayersModel().getLayerCount(); i++) { Layer layer = mapPresenter.getLayersModel().getLayer(i); if (layer instanceof VectorServerLayer) { VectorServerLayer serverLayer = (VectorServerLayer) layer; if (layerId.equals(serverLayer.getServerLayerId())) { return (VectorServerLayer) layer; // depends on control dependency: [if], data = [none] } } } } return null; } }
public class class_name { public static String toBinaryString(byte[] bytes, boolean isMSB) { StringBuilder sb = new StringBuilder(); for (byte b : bytes) { String binary = String.format("%8s", Integer.toBinaryString(b & 0xFF)) .replace(' ', '0'); if (isMSB) sb.append(binary); else sb.append(new StringBuilder(binary).reverse()); } return sb.toString(); } }
public class class_name { public static String toBinaryString(byte[] bytes, boolean isMSB) { StringBuilder sb = new StringBuilder(); for (byte b : bytes) { String binary = String.format("%8s", Integer.toBinaryString(b & 0xFF)) .replace(' ', '0'); // depends on control dependency: [for], data = [none] if (isMSB) sb.append(binary); else sb.append(new StringBuilder(binary).reverse()); } return sb.toString(); } }
public class class_name { protected void writeObject(Object o) { if (o == null) { return; } getPersistenceDelegate(o.getClass()).writeObject(o, this); } }
public class class_name { protected void writeObject(Object o) { if (o == null) { return; // depends on control dependency: [if], data = [none] } getPersistenceDelegate(o.getClass()).writeObject(o, this); } }
public class class_name { private void addDryRun(GitAddOptions options, GitAddResponseImpl response) { if (options.dryRun()) { response.setDryRun(true); } } }
public class class_name { private void addDryRun(GitAddOptions options, GitAddResponseImpl response) { if (options.dryRun()) { response.setDryRun(true); // depends on control dependency: [if], data = [none] } } }
public class class_name { public DescribeAutomationExecutionsRequest withFilters(AutomationExecutionFilter... filters) { if (this.filters == null) { setFilters(new com.amazonaws.internal.SdkInternalList<AutomationExecutionFilter>(filters.length)); } for (AutomationExecutionFilter ele : filters) { this.filters.add(ele); } return this; } }
public class class_name { public DescribeAutomationExecutionsRequest withFilters(AutomationExecutionFilter... filters) { if (this.filters == null) { setFilters(new com.amazonaws.internal.SdkInternalList<AutomationExecutionFilter>(filters.length)); // depends on control dependency: [if], data = [none] } for (AutomationExecutionFilter ele : filters) { this.filters.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public void marshall(ElasticsearchSettings elasticsearchSettings, ProtocolMarshaller protocolMarshaller) { if (elasticsearchSettings == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(elasticsearchSettings.getServiceAccessRoleArn(), SERVICEACCESSROLEARN_BINDING); protocolMarshaller.marshall(elasticsearchSettings.getEndpointUri(), ENDPOINTURI_BINDING); protocolMarshaller.marshall(elasticsearchSettings.getFullLoadErrorPercentage(), FULLLOADERRORPERCENTAGE_BINDING); protocolMarshaller.marshall(elasticsearchSettings.getErrorRetryDuration(), ERRORRETRYDURATION_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(ElasticsearchSettings elasticsearchSettings, ProtocolMarshaller protocolMarshaller) { if (elasticsearchSettings == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(elasticsearchSettings.getServiceAccessRoleArn(), SERVICEACCESSROLEARN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(elasticsearchSettings.getEndpointUri(), ENDPOINTURI_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(elasticsearchSettings.getFullLoadErrorPercentage(), FULLLOADERRORPERCENTAGE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(elasticsearchSettings.getErrorRetryDuration(), ERRORRETRYDURATION_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override public void export(ITextNode[] nodes, String masterlanguage, String language, Status[] states) { LOG.info("Exporting CSV file..."); String[][] values = getValues(nodes, masterlanguage, language, states); try { printer.print(values); } catch (IOException e) { throw new IllegalStateException(e); } LOG.info("Exporting of CSV file finished."); } }
public class class_name { @Override public void export(ITextNode[] nodes, String masterlanguage, String language, Status[] states) { LOG.info("Exporting CSV file..."); String[][] values = getValues(nodes, masterlanguage, language, states); try { printer.print(values); // depends on control dependency: [try], data = [none] } catch (IOException e) { throw new IllegalStateException(e); } // depends on control dependency: [catch], data = [none] LOG.info("Exporting of CSV file finished."); } }
public class class_name { public synchronized KeyStroke getNextCharacter(boolean blockingIO) throws IOException { KeyStroke bestMatch = null; int bestLen = 0; int curLen = 0; while(true) { if ( curLen < currentMatching.size() ) { // (re-)consume characters previously read: curLen++; } else { // If we already have a bestMatch but a chance for a longer match // then we poll for the configured number of timeout units: // It would be much better, if we could just read with a timeout, // but lacking that, we wait 1/4s units and check for readiness. if (bestMatch != null) { int timeout = getTimeoutUnits(); while (timeout > 0 && ! source.ready() ) { try { timeout--; Thread.sleep(250); } catch (InterruptedException e) { timeout = 0; } } } // if input is available, we can just read a char without waiting, // otherwise, for readInput() with no bestMatch found yet, // we have to wait blocking for more input: if ( source.ready() || ( blockingIO && bestMatch == null ) ) { int readChar = source.read(); if (readChar == -1) { seenEOF = true; if(currentMatching.isEmpty()) { return new KeyStroke(KeyType.EOF); } break; } currentMatching.add( (char)readChar ); curLen++; } else { // no more available input at this time. // already found something: if (bestMatch != null) { break; // it's something... } // otherwise: no KeyStroke yet return null; } } List<Character> curSub = currentMatching.subList(0, curLen); Matching matching = getBestMatch( curSub ); // fullMatch found... if (matching.fullMatch != null) { bestMatch = matching.fullMatch; bestLen = curLen; if (! matching.partialMatch) { // that match and no more break; } else { // that match, but maybe more //noinspection UnnecessaryContinue continue; } } // No match found yet, but there's still potential... else if ( matching.partialMatch ) { //noinspection UnnecessaryContinue continue; } // no longer match possible at this point: else { if (bestMatch != null ) { // there was already a previous full-match, use it: break; } else { // invalid input! // remove the whole fail and re-try finding a KeyStroke... curSub.clear(); // or just 1 char? currentMatching.remove(0); curLen = 0; //noinspection UnnecessaryContinue continue; } } } //Did we find anything? Otherwise return null if(bestMatch == null) { if(seenEOF) { currentMatching.clear(); return new KeyStroke(KeyType.EOF); } return null; } List<Character> bestSub = currentMatching.subList(0, bestLen ); bestSub.clear(); // remove matched characters from input return bestMatch; } }
public class class_name { public synchronized KeyStroke getNextCharacter(boolean blockingIO) throws IOException { KeyStroke bestMatch = null; int bestLen = 0; int curLen = 0; while(true) { if ( curLen < currentMatching.size() ) { // (re-)consume characters previously read: curLen++; // depends on control dependency: [if], data = [none] } else { // If we already have a bestMatch but a chance for a longer match // then we poll for the configured number of timeout units: // It would be much better, if we could just read with a timeout, // but lacking that, we wait 1/4s units and check for readiness. if (bestMatch != null) { int timeout = getTimeoutUnits(); while (timeout > 0 && ! source.ready() ) { try { timeout--; Thread.sleep(250); // depends on control dependency: [try], data = [none] // depends on control dependency: [try], data = [none] } catch (InterruptedException e) { timeout = 0; } // depends on control dependency: [catch], data = [none] } } // if input is available, we can just read a char without waiting, // otherwise, for readInput() with no bestMatch found yet, // we have to wait blocking for more input: if ( source.ready() || ( blockingIO && bestMatch == null ) ) { int readChar = source.read(); if (readChar == -1) { seenEOF = true; // depends on control dependency: [if], data = [none] if(currentMatching.isEmpty()) { return new KeyStroke(KeyType.EOF); // depends on control dependency: [if], data = [none] } break; } currentMatching.add( (char)readChar ); // depends on control dependency: [if], data = [none] curLen++; // depends on control dependency: [if], data = [none] } else { // no more available input at this time. // already found something: if (bestMatch != null) { break; // it's something... } // otherwise: no KeyStroke yet return null; // depends on control dependency: [if], data = [none] } } List<Character> curSub = currentMatching.subList(0, curLen); Matching matching = getBestMatch( curSub ); // fullMatch found... if (matching.fullMatch != null) { bestMatch = matching.fullMatch; // depends on control dependency: [if], data = [none] bestLen = curLen; // depends on control dependency: [if], data = [none] if (! matching.partialMatch) { // that match and no more break; } else { // that match, but maybe more //noinspection UnnecessaryContinue continue; } } // No match found yet, but there's still potential... else if ( matching.partialMatch ) { //noinspection UnnecessaryContinue continue; } // no longer match possible at this point: else { if (bestMatch != null ) { // there was already a previous full-match, use it: break; } else { // invalid input! // remove the whole fail and re-try finding a KeyStroke... curSub.clear(); // or just 1 char? currentMatching.remove(0); // depends on control dependency: [if], data = [none] curLen = 0; // depends on control dependency: [if], data = [none] //noinspection UnnecessaryContinue continue; } } } //Did we find anything? Otherwise return null if(bestMatch == null) { if(seenEOF) { currentMatching.clear(); return new KeyStroke(KeyType.EOF); } return null; } List<Character> bestSub = currentMatching.subList(0, bestLen ); bestSub.clear(); // remove matched characters from input return bestMatch; } }
public class class_name { @SuppressWarnings("unchecked") public static <E> E getObject(String className) { if (className == null) { return (E) null; } try { return (E) Class.forName(className).newInstance(); } catch (InstantiationException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } }
public class class_name { @SuppressWarnings("unchecked") public static <E> E getObject(String className) { if (className == null) { return (E) null; // depends on control dependency: [if], data = [none] } try { return (E) Class.forName(className).newInstance(); // depends on control dependency: [try], data = [none] } catch (InstantiationException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { // depends on control dependency: [catch], data = [none] throw new RuntimeException(e); } catch (ClassNotFoundException e) { // depends on control dependency: [catch], data = [none] throw new RuntimeException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void marshall(ListSimulationApplicationsRequest listSimulationApplicationsRequest, ProtocolMarshaller protocolMarshaller) { if (listSimulationApplicationsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listSimulationApplicationsRequest.getVersionQualifier(), VERSIONQUALIFIER_BINDING); protocolMarshaller.marshall(listSimulationApplicationsRequest.getNextToken(), NEXTTOKEN_BINDING); protocolMarshaller.marshall(listSimulationApplicationsRequest.getMaxResults(), MAXRESULTS_BINDING); protocolMarshaller.marshall(listSimulationApplicationsRequest.getFilters(), FILTERS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(ListSimulationApplicationsRequest listSimulationApplicationsRequest, ProtocolMarshaller protocolMarshaller) { if (listSimulationApplicationsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listSimulationApplicationsRequest.getVersionQualifier(), VERSIONQUALIFIER_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(listSimulationApplicationsRequest.getNextToken(), NEXTTOKEN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(listSimulationApplicationsRequest.getMaxResults(), MAXRESULTS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(listSimulationApplicationsRequest.getFilters(), FILTERS_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private List<GovernmentBodyAnnualOutcomeSummary> readCsvContent(final InputStream is,final String[] specificFields) throws IOException { final CSVParser parser = CSVParser.parse(new InputStreamReader(is,Charsets.UTF_8), CSVFormat.EXCEL.withHeader().withDelimiter(';')); final List<CSVRecord> records = parser.getRecords(); records.remove(0); final Map<Integer, Map<String,String>> orgMinistryMap = createOrgMinistryMap(esvExcelReader.getDataPerMinistry(null)); final List<GovernmentBodyAnnualOutcomeSummary> list = new ArrayList<>(); for (final CSVRecord csvRecord : records) { final GovernmentBodyAnnualOutcomeSummary governmentBodyAnnualOutcomeSummary = new GovernmentBodyAnnualOutcomeSummary(csvRecord.get(MYNDIGHET), csvRecord.get(ORGANISATIONSNUMMER), orgMinistryMap.get(Integer.valueOf(csvRecord.get(YEAR))).get(csvRecord.get(ORGANISATIONSNUMMER).replaceAll("-", "")), Integer.parseInt(csvRecord.get(YEAR))); for (final String field : specificFields) { governmentBodyAnnualOutcomeSummary.addDescriptionField(field,csvRecord.get(field)); } addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.JANUARY.getValue(),csvRecord.get(UTFALL_JANUARI)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.FEBRUARY.getValue(),csvRecord.get(UTFALL_FEBRUARI)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.MARCH.getValue(),csvRecord.get(UTFALL_MARS)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.APRIL.getValue(),csvRecord.get(UTFALL_APRIL)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.MAY.getValue(),csvRecord.get(UTFALL_MAJ)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.JUNE.getValue(),csvRecord.get(UTFALL_JUNI)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.JULY.getValue(),csvRecord.get(UTFALL_JULI)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.AUGUST.getValue(),csvRecord.get(UTFALL_AUGUSTI)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.SEPTEMBER.getValue(),csvRecord.get(UTFALL_SEPTEMBER)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.OCTOBER.getValue(),csvRecord.get(UTFALL_OKTOBER)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.NOVEMBER.getValue(),csvRecord.get(UTFALL_NOVEMBER)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.DECEMBER.getValue(),csvRecord.get(UTFALL_DECEMBER)); list.add(governmentBodyAnnualOutcomeSummary); } return list; } }
public class class_name { private List<GovernmentBodyAnnualOutcomeSummary> readCsvContent(final InputStream is,final String[] specificFields) throws IOException { final CSVParser parser = CSVParser.parse(new InputStreamReader(is,Charsets.UTF_8), CSVFormat.EXCEL.withHeader().withDelimiter(';')); final List<CSVRecord> records = parser.getRecords(); records.remove(0); final Map<Integer, Map<String,String>> orgMinistryMap = createOrgMinistryMap(esvExcelReader.getDataPerMinistry(null)); final List<GovernmentBodyAnnualOutcomeSummary> list = new ArrayList<>(); for (final CSVRecord csvRecord : records) { final GovernmentBodyAnnualOutcomeSummary governmentBodyAnnualOutcomeSummary = new GovernmentBodyAnnualOutcomeSummary(csvRecord.get(MYNDIGHET), csvRecord.get(ORGANISATIONSNUMMER), orgMinistryMap.get(Integer.valueOf(csvRecord.get(YEAR))).get(csvRecord.get(ORGANISATIONSNUMMER).replaceAll("-", "")), Integer.parseInt(csvRecord.get(YEAR))); for (final String field : specificFields) { governmentBodyAnnualOutcomeSummary.addDescriptionField(field,csvRecord.get(field)); // depends on control dependency: [for], data = [field] } addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.JANUARY.getValue(),csvRecord.get(UTFALL_JANUARI)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.FEBRUARY.getValue(),csvRecord.get(UTFALL_FEBRUARI)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.MARCH.getValue(),csvRecord.get(UTFALL_MARS)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.APRIL.getValue(),csvRecord.get(UTFALL_APRIL)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.MAY.getValue(),csvRecord.get(UTFALL_MAJ)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.JUNE.getValue(),csvRecord.get(UTFALL_JUNI)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.JULY.getValue(),csvRecord.get(UTFALL_JULI)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.AUGUST.getValue(),csvRecord.get(UTFALL_AUGUSTI)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.SEPTEMBER.getValue(),csvRecord.get(UTFALL_SEPTEMBER)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.OCTOBER.getValue(),csvRecord.get(UTFALL_OKTOBER)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.NOVEMBER.getValue(),csvRecord.get(UTFALL_NOVEMBER)); addResultForMonth(governmentBodyAnnualOutcomeSummary,Month.DECEMBER.getValue(),csvRecord.get(UTFALL_DECEMBER)); list.add(governmentBodyAnnualOutcomeSummary); } return list; } }
public class class_name { public Actions sendKeys(CharSequence... keys) { if (isBuildingActions()) { action.addAction(new SendKeysAction(jsonKeyboard, jsonMouse, null, keys)); } return sendKeysInTicks(keys); } }
public class class_name { public Actions sendKeys(CharSequence... keys) { if (isBuildingActions()) { action.addAction(new SendKeysAction(jsonKeyboard, jsonMouse, null, keys)); // depends on control dependency: [if], data = [none] } return sendKeysInTicks(keys); } }
public class class_name { private void generateTableAttributeUpdates(long currentOffset, long newOffset, int processedCount, UpdateInstructions update) { // Add an Update for the INDEX_OFFSET to indicate we have indexed everything up to this offset. Preconditions.checkArgument(currentOffset <= newOffset, "newOffset must be larger than existingOffset"); update.withAttribute(new AttributeUpdate(TableAttributes.INDEX_OFFSET, AttributeUpdateType.ReplaceIfEquals, newOffset, currentOffset)); // Update Bucket and Entry counts. if (update.getEntryCountDelta() != 0) { update.withAttribute(new AttributeUpdate(TableAttributes.ENTRY_COUNT, AttributeUpdateType.Accumulate, update.getEntryCountDelta())); } if (update.getBucketCountDelta() != 0) { update.withAttribute(new AttributeUpdate(TableAttributes.BUCKET_COUNT, AttributeUpdateType.Accumulate, update.getBucketCountDelta())); } if (processedCount > 0) { update.withAttribute(new AttributeUpdate(TableAttributes.TOTAL_ENTRY_COUNT, AttributeUpdateType.Accumulate, processedCount)); } } }
public class class_name { private void generateTableAttributeUpdates(long currentOffset, long newOffset, int processedCount, UpdateInstructions update) { // Add an Update for the INDEX_OFFSET to indicate we have indexed everything up to this offset. Preconditions.checkArgument(currentOffset <= newOffset, "newOffset must be larger than existingOffset"); update.withAttribute(new AttributeUpdate(TableAttributes.INDEX_OFFSET, AttributeUpdateType.ReplaceIfEquals, newOffset, currentOffset)); // Update Bucket and Entry counts. if (update.getEntryCountDelta() != 0) { update.withAttribute(new AttributeUpdate(TableAttributes.ENTRY_COUNT, AttributeUpdateType.Accumulate, update.getEntryCountDelta())); // depends on control dependency: [if], data = [none] } if (update.getBucketCountDelta() != 0) { update.withAttribute(new AttributeUpdate(TableAttributes.BUCKET_COUNT, AttributeUpdateType.Accumulate, update.getBucketCountDelta())); // depends on control dependency: [if], data = [none] } if (processedCount > 0) { update.withAttribute(new AttributeUpdate(TableAttributes.TOTAL_ENTRY_COUNT, AttributeUpdateType.Accumulate, processedCount)); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void pauseAll() { FileDownloadTaskLauncher.getImpl().expireAll(); final BaseDownloadTask.IRunningTask[] downloadList = FileDownloadList.getImpl().copy(); for (BaseDownloadTask.IRunningTask task : downloadList) { task.getOrigin().pause(); } // double check, for case: File Download progress alive but ui progress has died and relived // so FileDownloadList not always contain all running task exactly. if (FileDownloadServiceProxy.getImpl().isConnected()) { FileDownloadServiceProxy.getImpl().pauseAllTasks(); } else { PauseAllMarker.createMarker(); } } }
public class class_name { public void pauseAll() { FileDownloadTaskLauncher.getImpl().expireAll(); final BaseDownloadTask.IRunningTask[] downloadList = FileDownloadList.getImpl().copy(); for (BaseDownloadTask.IRunningTask task : downloadList) { task.getOrigin().pause(); // depends on control dependency: [for], data = [task] } // double check, for case: File Download progress alive but ui progress has died and relived // so FileDownloadList not always contain all running task exactly. if (FileDownloadServiceProxy.getImpl().isConnected()) { FileDownloadServiceProxy.getImpl().pauseAllTasks(); // depends on control dependency: [if], data = [none] } else { PauseAllMarker.createMarker(); // depends on control dependency: [if], data = [none] } } }
public class class_name { public int getFontNumber(RtfFont font) { if(font instanceof RtfParagraphStyle) { font = new RtfFont(this.document, font); } int fontIndex = -1; for(int i = 0; i < fontList.size(); i++) { if(fontList.get(i).equals(font)) { fontIndex = i; } } if(fontIndex == -1) { fontIndex = fontList.size(); fontList.add(font); } return fontIndex; } }
public class class_name { public int getFontNumber(RtfFont font) { if(font instanceof RtfParagraphStyle) { font = new RtfFont(this.document, font); // depends on control dependency: [if], data = [none] } int fontIndex = -1; for(int i = 0; i < fontList.size(); i++) { if(fontList.get(i).equals(font)) { fontIndex = i; // depends on control dependency: [if], data = [none] } } if(fontIndex == -1) { fontIndex = fontList.size(); // depends on control dependency: [if], data = [none] fontList.add(font); // depends on control dependency: [if], data = [none] } return fontIndex; } }
public class class_name { public static String urlEncode(String value) { try { return URLEncoder.encode(value, StandardCharsets.UTF_8.displayName()); } catch (UnsupportedEncodingException ex) { throw new Utf8EncodingException(ex); } } }
public class class_name { public static String urlEncode(String value) { try { return URLEncoder.encode(value, StandardCharsets.UTF_8.displayName()); // depends on control dependency: [try], data = [none] } catch (UnsupportedEncodingException ex) { throw new Utf8EncodingException(ex); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private static void bodyWithBuilderAndSeparator( SourceBuilder code, Datatype datatype, Map<Property, PropertyCodeGenerator> generatorsByProperty, String typename) { Variable result = new Variable("result"); Variable separator = new Variable("separator"); code.addLine(" %1$s %2$s = new %1$s(\"%3$s{\");", StringBuilder.class, result, typename); if (generatorsByProperty.size() > 1) { // If there's a single property, we don't actually use the separator variable code.addLine(" %s %s = \"\";", String.class, separator); } Property first = generatorsByProperty.keySet().iterator().next(); Property last = getLast(generatorsByProperty.keySet()); for (Property property : generatorsByProperty.keySet()) { PropertyCodeGenerator generator = generatorsByProperty.get(property); switch (generator.initialState()) { case HAS_DEFAULT: throw new RuntimeException("Internal error: unexpected default field"); case OPTIONAL: code.addLine(" if (%s) {", (Excerpt) generator::addToStringCondition); break; case REQUIRED: code.addLine(" if (!%s.contains(%s.%s)) {", UNSET_PROPERTIES, datatype.getPropertyEnum(), property.getAllCapsName()); break; } code.add(" ").add(result); if (property != first) { code.add(".append(%s)", separator); } code.add(".append(\"%s=\").append(%s)", property.getName(), (Excerpt) generator::addToStringValue); if (property != last) { code.add(";%n %s = \", \"", separator); } code.add(";%n }%n"); } code.addLine(" return %s.append(\"}\").toString();", result); } }
public class class_name { private static void bodyWithBuilderAndSeparator( SourceBuilder code, Datatype datatype, Map<Property, PropertyCodeGenerator> generatorsByProperty, String typename) { Variable result = new Variable("result"); Variable separator = new Variable("separator"); code.addLine(" %1$s %2$s = new %1$s(\"%3$s{\");", StringBuilder.class, result, typename); if (generatorsByProperty.size() > 1) { // If there's a single property, we don't actually use the separator variable code.addLine(" %s %s = \"\";", String.class, separator); // depends on control dependency: [if], data = [none] } Property first = generatorsByProperty.keySet().iterator().next(); Property last = getLast(generatorsByProperty.keySet()); for (Property property : generatorsByProperty.keySet()) { PropertyCodeGenerator generator = generatorsByProperty.get(property); switch (generator.initialState()) { case HAS_DEFAULT: throw new RuntimeException("Internal error: unexpected default field"); case OPTIONAL: code.addLine(" if (%s) {", (Excerpt) generator::addToStringCondition); // depends on control dependency: [for], data = [none] break; case REQUIRED: code.addLine(" if (!%s.contains(%s.%s)) {", UNSET_PROPERTIES, datatype.getPropertyEnum(), property.getAllCapsName()); break; } code.add(" ").add(result); // depends on control dependency: [for], data = [none] if (property != first) { code.add(".append(%s)", separator); // depends on control dependency: [if], data = [none] } code.add(".append(\"%s=\").append(%s)", property.getName(), (Excerpt) generator::addToStringValue); // depends on control dependency: [for], data = [none] if (property != last) { code.add(";%n %s = \", \"", separator); // depends on control dependency: [if], data = [none] } code.add(";%n }%n"); // depends on control dependency: [for], data = [none] } code.addLine(" return %s.append(\"}\").toString();", result); } }
public class class_name { public final void commitPersistUnlock(PersistentTransaction transaction) throws SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "commitPersistUnlock", transaction); AbstractItem item = null; boolean hasBecomeAvailable = false; boolean linkHasBecomeReleasable = false; synchronized (this) { if (ItemLinkState.STATE_UNLOCKING_PERSISTENTLY_LOCKED == _itemLinkState) { _assertCorrectTransaction(transaction); item = getItem(); ListStatistics stats = getParentStatistics(); synchronized (stats) { stats.decrementLocked(); stats.incrementAvailable(); } // Save the item before we change the state _lockID = NO_LOCK_ID; _unlockCount++; linkHasBecomeReleasable = _declareDiscardable(); _itemLinkState = ItemLinkState.STATE_AVAILABLE; hasBecomeAvailable = true; } else { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Invalid Item state: " + _itemLinkState); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "commitPersistUnlock"); throw new StateException(_itemLinkState.toString()); } _transactionId = null; } // this stuff has to be done outside the synchronized block if (linkHasBecomeReleasable) { _declareReleasable(item); } // PK37596 // Now we have completed an unlock we have become available again // and so need to inform our containing list in case we need to // be added to a cursors jumpback list. if (hasBecomeAvailable) { // all items are discardable in avaialable state. if (_owningStreamLink != null) { _owningStreamLink.linkAvailable(this); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "commitPersistUnlock"); } }
public class class_name { public final void commitPersistUnlock(PersistentTransaction transaction) throws SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "commitPersistUnlock", transaction); AbstractItem item = null; boolean hasBecomeAvailable = false; boolean linkHasBecomeReleasable = false; synchronized (this) { if (ItemLinkState.STATE_UNLOCKING_PERSISTENTLY_LOCKED == _itemLinkState) { _assertCorrectTransaction(transaction); // depends on control dependency: [if], data = [none] item = getItem(); // depends on control dependency: [if], data = [none] ListStatistics stats = getParentStatistics(); synchronized (stats) // depends on control dependency: [if], data = [none] { stats.decrementLocked(); stats.incrementAvailable(); } // Save the item before we change the state _lockID = NO_LOCK_ID; // depends on control dependency: [if], data = [none] _unlockCount++; // depends on control dependency: [if], data = [none] linkHasBecomeReleasable = _declareDiscardable(); // depends on control dependency: [if], data = [none] _itemLinkState = ItemLinkState.STATE_AVAILABLE; // depends on control dependency: [if], data = [none] hasBecomeAvailable = true; // depends on control dependency: [if], data = [none] } else { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Invalid Item state: " + _itemLinkState); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "commitPersistUnlock"); throw new StateException(_itemLinkState.toString()); } _transactionId = null; } // this stuff has to be done outside the synchronized block if (linkHasBecomeReleasable) { _declareReleasable(item); } // PK37596 // Now we have completed an unlock we have become available again // and so need to inform our containing list in case we need to // be added to a cursors jumpback list. if (hasBecomeAvailable) { // all items are discardable in avaialable state. if (_owningStreamLink != null) { _owningStreamLink.linkAvailable(this); // depends on control dependency: [if], data = [none] } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "commitPersistUnlock"); } }
public class class_name { protected Collection childrenNamesSpi(String nodePath) { HashSet allKids = new HashSet(); try { if (nodeExists( nodePath)) { PreferencesExt node = (PreferencesExt) node( nodePath); allKids.addAll( node.children.keySet()); } } catch (java.util.prefs.BackingStoreException e) { } PreferencesExt sd = getStoredDefaults(); if (sd != null) allKids.addAll( sd.childrenNamesSpi(nodePath)); return allKids; } }
public class class_name { protected Collection childrenNamesSpi(String nodePath) { HashSet allKids = new HashSet(); try { if (nodeExists( nodePath)) { PreferencesExt node = (PreferencesExt) node( nodePath); allKids.addAll( node.children.keySet()); // depends on control dependency: [if], data = [none] } } catch (java.util.prefs.BackingStoreException e) { } // depends on control dependency: [catch], data = [none] PreferencesExt sd = getStoredDefaults(); if (sd != null) allKids.addAll( sd.childrenNamesSpi(nodePath)); return allKids; } }
public class class_name { private void fireTangoArchiveEvent(TangoArchive tangoArchive, EventData eventData) { TangoArchiveEvent archiveEvent = new TangoArchiveEvent(tangoArchive, eventData); // Notifying those that are interested in this event ArrayList<EventListener> listeners = event_listeners.getListeners(ITangoArchiveListener.class); for (EventListener eventListener : listeners) { ((ITangoArchiveListener) eventListener).archive(archiveEvent); } } }
public class class_name { private void fireTangoArchiveEvent(TangoArchive tangoArchive, EventData eventData) { TangoArchiveEvent archiveEvent = new TangoArchiveEvent(tangoArchive, eventData); // Notifying those that are interested in this event ArrayList<EventListener> listeners = event_listeners.getListeners(ITangoArchiveListener.class); for (EventListener eventListener : listeners) { ((ITangoArchiveListener) eventListener).archive(archiveEvent); // depends on control dependency: [for], data = [eventListener] } } }
public class class_name { private <T> MembersInjectorImpl<T> createWithListeners(TypeLiteral<T> type, Errors errors) throws ErrorsException { int numErrorsBefore = errors.size(); Set<InjectionPoint> injectionPoints; try { injectionPoints = InjectionPoint.forInstanceMethodsAndFields(type); } catch (ConfigurationException e) { errors.merge(e.getErrorMessages()); injectionPoints = e.getPartialValue(); } ImmutableList<SingleMemberInjector> injectors = getInjectors(injectionPoints, errors); errors.throwIfNewErrors(numErrorsBefore); EncounterImpl<T> encounter = new EncounterImpl<>(errors, injector.lookups); Set<TypeListener> alreadySeenListeners = Sets.newHashSet(); for (TypeListenerBinding binding : typeListenerBindings) { TypeListener typeListener = binding.getListener(); if (!alreadySeenListeners.contains(typeListener) && binding.getTypeMatcher().matches(type)) { alreadySeenListeners.add(typeListener); try { typeListener.hear(type, encounter); } catch (RuntimeException e) { errors.errorNotifyingTypeListener(binding, type, e); } } } encounter.invalidate(); errors.throwIfNewErrors(numErrorsBefore); return new MembersInjectorImpl<T>(injector, type, encounter, injectors); } }
public class class_name { private <T> MembersInjectorImpl<T> createWithListeners(TypeLiteral<T> type, Errors errors) throws ErrorsException { int numErrorsBefore = errors.size(); Set<InjectionPoint> injectionPoints; try { injectionPoints = InjectionPoint.forInstanceMethodsAndFields(type); } catch (ConfigurationException e) { errors.merge(e.getErrorMessages()); injectionPoints = e.getPartialValue(); } ImmutableList<SingleMemberInjector> injectors = getInjectors(injectionPoints, errors); errors.throwIfNewErrors(numErrorsBefore); EncounterImpl<T> encounter = new EncounterImpl<>(errors, injector.lookups); Set<TypeListener> alreadySeenListeners = Sets.newHashSet(); for (TypeListenerBinding binding : typeListenerBindings) { TypeListener typeListener = binding.getListener(); if (!alreadySeenListeners.contains(typeListener) && binding.getTypeMatcher().matches(type)) { alreadySeenListeners.add(typeListener); // depends on control dependency: [if], data = [none] try { typeListener.hear(type, encounter); // depends on control dependency: [try], data = [none] } catch (RuntimeException e) { errors.errorNotifyingTypeListener(binding, type, e); } // depends on control dependency: [catch], data = [none] } } encounter.invalidate(); errors.throwIfNewErrors(numErrorsBefore); return new MembersInjectorImpl<T>(injector, type, encounter, injectors); } }
public class class_name { public ColumnValueSelector<?> makeColumnValueSelector(String columnName, ColumnSelectorFactory factory) { final VirtualColumn virtualColumn = getVirtualColumn(columnName); if (virtualColumn == null) { throw new IAE("No such virtual column[%s]", columnName); } else { final ColumnValueSelector<?> selector = virtualColumn.makeColumnValueSelector(columnName, factory); Preconditions.checkNotNull(selector, "selector"); return selector; } } }
public class class_name { public ColumnValueSelector<?> makeColumnValueSelector(String columnName, ColumnSelectorFactory factory) { final VirtualColumn virtualColumn = getVirtualColumn(columnName); if (virtualColumn == null) { throw new IAE("No such virtual column[%s]", columnName); } else { final ColumnValueSelector<?> selector = virtualColumn.makeColumnValueSelector(columnName, factory); Preconditions.checkNotNull(selector, "selector"); // depends on control dependency: [if], data = [none] return selector; // depends on control dependency: [if], data = [none] } } }
public class class_name { protected void parseBindType(RoundEnvironment roundEnv) { for (Element item : roundEnv.getElementsAnnotatedWith(BindType.class)) { AssertKripton.assertTrueOrInvalidKindForAnnotationException(item.getKind() == ElementKind.CLASS, item, BindType.class); globalBeanElements.put(item.toString(), (TypeElement) item); } } }
public class class_name { protected void parseBindType(RoundEnvironment roundEnv) { for (Element item : roundEnv.getElementsAnnotatedWith(BindType.class)) { AssertKripton.assertTrueOrInvalidKindForAnnotationException(item.getKind() == ElementKind.CLASS, item, BindType.class); // depends on control dependency: [for], data = [item] globalBeanElements.put(item.toString(), (TypeElement) item); // depends on control dependency: [for], data = [item] } } }
public class class_name { private void convert(final int iIndex) { if (converted || !convertToRecord) return; final Object o = list.get(iIndex); final ODatabaseRecord database = ODatabaseRecordThreadLocal.INSTANCE.get(); if (o != null) { ODocument doc = new ODocument(); if (o instanceof ORID) { doc = database.load((ORID) o, fetchPlan); } else if (o instanceof ODocument) { doc = (ODocument) o; } list.set(iIndex, (TYPE) database.getUserObjectByRecord((ORecordInternal<?>) o, fetchPlan)); } } }
public class class_name { private void convert(final int iIndex) { if (converted || !convertToRecord) return; final Object o = list.get(iIndex); final ODatabaseRecord database = ODatabaseRecordThreadLocal.INSTANCE.get(); if (o != null) { ODocument doc = new ODocument(); if (o instanceof ORID) { doc = database.load((ORID) o, fetchPlan); // depends on control dependency: [if], data = [none] } else if (o instanceof ODocument) { doc = (ODocument) o; // depends on control dependency: [if], data = [none] } list.set(iIndex, (TYPE) database.getUserObjectByRecord((ORecordInternal<?>) o, fetchPlan)); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void releaseCache() { if (originalThunks != null) { // OPTIMIZATION: // Rather than use the standard iterator, which creates lots of int[] arrays on the heap, which need to be GC'd, // we use the fast version that just mutates one array. Since this is read once for us here, this is ideal. Iterator<int[]> fastPassByReferenceIterator = fastPassByReferenceIterator(); int[] assignment = fastPassByReferenceIterator.next(); while (true) { setAssignmentValue(assignment, originalThunks.getAssignmentValue(assignment)); // Set the assignment arrays correctly if (fastPassByReferenceIterator.hasNext()) fastPassByReferenceIterator.next(); else break; } // Release our replicated set of original thunks originalThunks = null; } } }
public class class_name { public void releaseCache() { if (originalThunks != null) { // OPTIMIZATION: // Rather than use the standard iterator, which creates lots of int[] arrays on the heap, which need to be GC'd, // we use the fast version that just mutates one array. Since this is read once for us here, this is ideal. Iterator<int[]> fastPassByReferenceIterator = fastPassByReferenceIterator(); int[] assignment = fastPassByReferenceIterator.next(); while (true) { setAssignmentValue(assignment, originalThunks.getAssignmentValue(assignment)); // depends on control dependency: [while], data = [none] // Set the assignment arrays correctly if (fastPassByReferenceIterator.hasNext()) fastPassByReferenceIterator.next(); else break; } // Release our replicated set of original thunks originalThunks = null; // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public void accept(double value) { writeLock.lock(); try { eliminate(); endIncr(); PrimitiveIterator.OfInt rev = modReverseIterator(); int e = rev.nextInt(); assign(e, value); while (rev.hasNext()) { e = rev.nextInt(); if (exceedsBounds(e, value)) { assign(e, value); } else { break; } } } finally { writeLock.unlock(); } } }
public class class_name { @Override public void accept(double value) { writeLock.lock(); try { eliminate(); // depends on control dependency: [try], data = [none] endIncr(); // depends on control dependency: [try], data = [none] PrimitiveIterator.OfInt rev = modReverseIterator(); int e = rev.nextInt(); assign(e, value); // depends on control dependency: [try], data = [none] while (rev.hasNext()) { e = rev.nextInt(); // depends on control dependency: [while], data = [none] if (exceedsBounds(e, value)) { assign(e, value); // depends on control dependency: [if], data = [none] } else { break; } } } finally { writeLock.unlock(); } } }
public class class_name { public boolean isValid() { if (name == null) { return false; } if (type == null || !type.isValid()) { return false; } else if (type == Type.Link) { if (url == null) { return false; } } // Check actions if (this.getActions() != null) { for (DesktopAction a : this.getActions()) { if (!a.isValid()) { return false; } } } // Everything ok return true; } }
public class class_name { public boolean isValid() { if (name == null) { return false; // depends on control dependency: [if], data = [none] } if (type == null || !type.isValid()) { return false; // depends on control dependency: [if], data = [none] } else if (type == Type.Link) { if (url == null) { return false; // depends on control dependency: [if], data = [none] } } // Check actions if (this.getActions() != null) { for (DesktopAction a : this.getActions()) { if (!a.isValid()) { return false; // depends on control dependency: [if], data = [none] } } } // Everything ok return true; } }
public class class_name { public String digest(String message) { final byte[] messageAsByteArray; try { messageAsByteArray = message.getBytes(charsetName); } catch (UnsupportedEncodingException e) { throw new DigestException("error converting message to byte array: charsetName=" + charsetName, e); } final byte[] digest = digest(messageAsByteArray); switch (outputMode) { case BASE64: return Base64.encodeBase64String(digest); case HEX: return Hex.encodeHexString(digest); default: return null; } } }
public class class_name { public String digest(String message) { final byte[] messageAsByteArray; try { messageAsByteArray = message.getBytes(charsetName); // depends on control dependency: [try], data = [none] } catch (UnsupportedEncodingException e) { throw new DigestException("error converting message to byte array: charsetName=" + charsetName, e); } // depends on control dependency: [catch], data = [none] final byte[] digest = digest(messageAsByteArray); switch (outputMode) { case BASE64: return Base64.encodeBase64String(digest); case HEX: return Hex.encodeHexString(digest); default: return null; } } }
public class class_name { public void marshall(InputAttachment inputAttachment, ProtocolMarshaller protocolMarshaller) { if (inputAttachment == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(inputAttachment.getInputAttachmentName(), INPUTATTACHMENTNAME_BINDING); protocolMarshaller.marshall(inputAttachment.getInputId(), INPUTID_BINDING); protocolMarshaller.marshall(inputAttachment.getInputSettings(), INPUTSETTINGS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(InputAttachment inputAttachment, ProtocolMarshaller protocolMarshaller) { if (inputAttachment == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(inputAttachment.getInputAttachmentName(), INPUTATTACHMENTNAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(inputAttachment.getInputId(), INPUTID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(inputAttachment.getInputSettings(), INPUTSETTINGS_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override @SuppressWarnings("unchecked") public void visit(final Visitable visitable) { if (visitable instanceof Identifiable) { ((Identifiable) visitable).setId(null); } } }
public class class_name { @Override @SuppressWarnings("unchecked") public void visit(final Visitable visitable) { if (visitable instanceof Identifiable) { ((Identifiable) visitable).setId(null); // depends on control dependency: [if], data = [none] } } }
public class class_name { @HiddenApi @Implementation(minSdk = LOLLIPOP) public void recycleUnchecked() { if (getApiLevel() >= LOLLIPOP) { unschedule(); directlyOn(realMessage, Message.class, "recycleUnchecked"); } else { // provide forward compatibility with SDK 21. recycle(); } } }
public class class_name { @HiddenApi @Implementation(minSdk = LOLLIPOP) public void recycleUnchecked() { if (getApiLevel() >= LOLLIPOP) { unschedule(); // depends on control dependency: [if], data = [none] directlyOn(realMessage, Message.class, "recycleUnchecked"); // depends on control dependency: [if], data = [none] } else { // provide forward compatibility with SDK 21. recycle(); // depends on control dependency: [if], data = [none] } } }
public class class_name { void endOfRunDb() { DbConn cnx = null; try { cnx = Helpers.getNewDbSession(); // Done: put inside history & remove instance from queue. History.create(cnx, this.ji, this.resultStatus, endDate); jqmlogger.trace("An History was just created for job instance " + this.ji.getId()); cnx.runUpdate("ji_delete_by_id", this.ji.getId()); cnx.commit(); } catch (RuntimeException e) { endBlockDbFailureAnalysis(e); } finally { Helpers.closeQuietly(cnx); } } }
public class class_name { void endOfRunDb() { DbConn cnx = null; try { cnx = Helpers.getNewDbSession(); // depends on control dependency: [try], data = [none] // Done: put inside history & remove instance from queue. History.create(cnx, this.ji, this.resultStatus, endDate); // depends on control dependency: [try], data = [none] jqmlogger.trace("An History was just created for job instance " + this.ji.getId()); // depends on control dependency: [try], data = [none] cnx.runUpdate("ji_delete_by_id", this.ji.getId()); // depends on control dependency: [try], data = [none] cnx.commit(); // depends on control dependency: [try], data = [none] } catch (RuntimeException e) { endBlockDbFailureAnalysis(e); } // depends on control dependency: [catch], data = [none] finally { Helpers.closeQuietly(cnx); } } }
public class class_name { private static void validateFiles(File zipFile, File... srcFiles) throws UtilException { if(zipFile.isDirectory()) { throw new UtilException("Zip file [{}] must not be a directory !", zipFile.getAbsoluteFile()); } for (File srcFile : srcFiles) { if(null == srcFile) { continue; } if (false == srcFile.exists()) { throw new UtilException(StrUtil.format("File [{}] not exist!", srcFile.getAbsolutePath())); } try { final File parentFile = zipFile.getCanonicalFile().getParentFile(); // 压缩文件不能位于被压缩的目录内 if (srcFile.isDirectory() && parentFile.getCanonicalPath().contains(srcFile.getCanonicalPath())) { throw new UtilException("Zip file path [{}] must not be the child directory of [{}] !", zipFile.getCanonicalPath(), srcFile.getCanonicalPath()); } } catch (IOException e) { throw new UtilException(e); } } } }
public class class_name { private static void validateFiles(File zipFile, File... srcFiles) throws UtilException { if(zipFile.isDirectory()) { throw new UtilException("Zip file [{}] must not be a directory !", zipFile.getAbsoluteFile()); } for (File srcFile : srcFiles) { if(null == srcFile) { continue; } if (false == srcFile.exists()) { throw new UtilException(StrUtil.format("File [{}] not exist!", srcFile.getAbsolutePath())); } try { final File parentFile = zipFile.getCanonicalFile().getParentFile(); // 压缩文件不能位于被压缩的目录内 if (srcFile.isDirectory() && parentFile.getCanonicalPath().contains(srcFile.getCanonicalPath())) { throw new UtilException("Zip file path [{}] must not be the child directory of [{}] !", zipFile.getCanonicalPath(), srcFile.getCanonicalPath()); } } catch (IOException e) { throw new UtilException(e); } // depends on control dependency: [catch], data = [none] } } }
public class class_name { final void recycleVideoBuffer(BaseVideoFrame frame) { // Make sure we are in started state if (state.isStarted()) { enqueueBuffer(object, frame.getBufferInex()); synchronized(availableVideoFrames){ availableVideoFrames.add(frame); availableVideoFrames.notify(); } } } }
public class class_name { final void recycleVideoBuffer(BaseVideoFrame frame) { // Make sure we are in started state if (state.isStarted()) { enqueueBuffer(object, frame.getBufferInex()); // depends on control dependency: [if], data = [none] synchronized(availableVideoFrames){ // depends on control dependency: [if], data = [none] availableVideoFrames.add(frame); availableVideoFrames.notify(); } } } }
public class class_name { @Override public int read(byte[] buffer, int offset, int length) { if (offset < 0 || length < 0 || offset + length > buffer.length) { throw new ArrayIndexOutOfBoundsException( "length=" + buffer.length + "; regionStart=" + offset + "; regionLength=" + length); } final int available = available(); if (available <= 0) { return -1; } if (length <= 0) { return 0; } int numToRead = Math.min(available, length); mPooledByteBuffer.read(mOffset, buffer, offset, numToRead); mOffset += numToRead; return numToRead; } }
public class class_name { @Override public int read(byte[] buffer, int offset, int length) { if (offset < 0 || length < 0 || offset + length > buffer.length) { throw new ArrayIndexOutOfBoundsException( "length=" + buffer.length + "; regionStart=" + offset + "; regionLength=" + length); } final int available = available(); if (available <= 0) { return -1; // depends on control dependency: [if], data = [none] } if (length <= 0) { return 0; // depends on control dependency: [if], data = [none] } int numToRead = Math.min(available, length); mPooledByteBuffer.read(mOffset, buffer, offset, numToRead); mOffset += numToRead; return numToRead; } }
public class class_name { public Object getAttributeValue(FeatureDescriptor feature, String attributeName) { if (feature == null || attributeName == null) { return null; } return feature.getValue(attributeName); } }
public class class_name { public Object getAttributeValue(FeatureDescriptor feature, String attributeName) { if (feature == null || attributeName == null) { return null; // depends on control dependency: [if], data = [none] } return feature.getValue(attributeName); } }
public class class_name { void findVertexNeighbors(Vertex target , List<ChessboardCorner> corners ) { // if( target.index == 18 ) { // System.out.println("Vertex Neighbors "+target.index); // } ChessboardCorner targetCorner = corners.get(target.index); // distance is Euclidean squared double maxDist = Double.MAX_VALUE==maxNeighborDistance?maxNeighborDistance:maxNeighborDistance*maxNeighborDistance; nnSearch.findNearest(corners.get(target.index),maxDist,maxNeighbors,nnResults); // storage distances here to find median distance of closest neighbors distanceTmp.reset(); for (int i = 0; i < nnResults.size; i++) { NnData<ChessboardCorner> r = nnResults.get(i); if( r.index == target.index) continue; distanceTmp.add( r.distance ); double oriDiff = UtilAngle.distHalf( targetCorner.orientation , r.point.orientation ); Edge edge = edges.grow(); boolean parallel; if( oriDiff <= orientationTol) { // see if it's parallel parallel = true; } else if( Math.abs(oriDiff-Math.PI/2.0) <= orientationTol) { // see if it's perpendicular parallel = false; } else { edges.removeTail(); continue; } // Use the relative angles of orientation and direction to prune more obviously bad matches double dx = r.point.x - targetCorner.x; double dy = r.point.y - targetCorner.y; edge.distance = Math.sqrt(r.distance); edge.dst = vertexes.get(r.index); edge.direction = Math.atan2(dy,dx); double direction180 = UtilAngle.boundHalf(edge.direction); double directionDiff = UtilAngle.distHalf(direction180,r.point.orientation); boolean remove; EdgeSet edgeSet; if( parallel ) { // test to see if direction and orientation are aligned or off by 90 degrees remove = directionDiff > 2* directionTol && Math.abs(directionDiff-Math.PI/2.0) > 2* directionTol; edgeSet = target.parallel; } else { // should be at 45 degree angle remove = Math.abs(directionDiff-Math.PI/4.0) > 2* directionTol; edgeSet = target.perpendicular; } if( remove ) { edges.removeTail(); continue; } edgeSet.add(edge); } // Compute the distance of the closest neighbors. This is used later on to identify ambiguous corners. // If it's a graph corner there should be at least 3 right next to the node. if( distanceTmp.size == 0 ) { target.neighborDistance = 0; } else { sorter.sort(distanceTmp.data, distanceTmp.size); int idx = Math.min(3,distanceTmp.size-1); target.neighborDistance = Math.sqrt(distanceTmp.data[idx]); // NN distance is Euclidean squared } } }
public class class_name { void findVertexNeighbors(Vertex target , List<ChessboardCorner> corners ) { // if( target.index == 18 ) { // System.out.println("Vertex Neighbors "+target.index); // } ChessboardCorner targetCorner = corners.get(target.index); // distance is Euclidean squared double maxDist = Double.MAX_VALUE==maxNeighborDistance?maxNeighborDistance:maxNeighborDistance*maxNeighborDistance; nnSearch.findNearest(corners.get(target.index),maxDist,maxNeighbors,nnResults); // storage distances here to find median distance of closest neighbors distanceTmp.reset(); for (int i = 0; i < nnResults.size; i++) { NnData<ChessboardCorner> r = nnResults.get(i); if( r.index == target.index) continue; distanceTmp.add( r.distance ); // depends on control dependency: [for], data = [none] double oriDiff = UtilAngle.distHalf( targetCorner.orientation , r.point.orientation ); Edge edge = edges.grow(); boolean parallel; if( oriDiff <= orientationTol) { // see if it's parallel parallel = true; // depends on control dependency: [if], data = [none] } else if( Math.abs(oriDiff-Math.PI/2.0) <= orientationTol) { // see if it's perpendicular parallel = false; // depends on control dependency: [if], data = [none] } else { edges.removeTail(); // depends on control dependency: [if], data = [none] continue; } // Use the relative angles of orientation and direction to prune more obviously bad matches double dx = r.point.x - targetCorner.x; double dy = r.point.y - targetCorner.y; edge.distance = Math.sqrt(r.distance); // depends on control dependency: [for], data = [none] edge.dst = vertexes.get(r.index); // depends on control dependency: [for], data = [none] edge.direction = Math.atan2(dy,dx); // depends on control dependency: [for], data = [none] double direction180 = UtilAngle.boundHalf(edge.direction); double directionDiff = UtilAngle.distHalf(direction180,r.point.orientation); boolean remove; EdgeSet edgeSet; if( parallel ) { // test to see if direction and orientation are aligned or off by 90 degrees remove = directionDiff > 2* directionTol && Math.abs(directionDiff-Math.PI/2.0) > 2* directionTol; // depends on control dependency: [if], data = [none] edgeSet = target.parallel; // depends on control dependency: [if], data = [none] } else { // should be at 45 degree angle remove = Math.abs(directionDiff-Math.PI/4.0) > 2* directionTol; // depends on control dependency: [if], data = [none] edgeSet = target.perpendicular; // depends on control dependency: [if], data = [none] } if( remove ) { edges.removeTail(); // depends on control dependency: [if], data = [none] continue; } edgeSet.add(edge); // depends on control dependency: [for], data = [none] } // Compute the distance of the closest neighbors. This is used later on to identify ambiguous corners. // If it's a graph corner there should be at least 3 right next to the node. if( distanceTmp.size == 0 ) { target.neighborDistance = 0; // depends on control dependency: [if], data = [none] } else { sorter.sort(distanceTmp.data, distanceTmp.size); // depends on control dependency: [if], data = [none] int idx = Math.min(3,distanceTmp.size-1); target.neighborDistance = Math.sqrt(distanceTmp.data[idx]); // NN distance is Euclidean squared // depends on control dependency: [if], data = [none] } } }
public class class_name { JPAPUnitInfo findPersistenceUnitInfo(JPAPuId puId) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "findPersistenceUnitInfo : " + puId); if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "Current application list : " + getSortedAppNames()); JPAPUnitInfo rtnVal = null; JPAApplInfo applInfo = applList.get(puId.getApplName()); if (applInfo != null) { rtnVal = applInfo.getPersistenceUnitInfo(puId.getModJarName(), puId.getPuName()); } else { Tr.warning(tc, "APPL_NOT_FOUND_DURING_PU_LOOKUP_CWWJP0010W", puId.getApplName(), puId.getModJarName(), puId.getPuName()); } if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "findPersistenceUnitInfo : " + rtnVal); return rtnVal; } }
public class class_name { JPAPUnitInfo findPersistenceUnitInfo(JPAPuId puId) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "findPersistenceUnitInfo : " + puId); if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "Current application list : " + getSortedAppNames()); JPAPUnitInfo rtnVal = null; JPAApplInfo applInfo = applList.get(puId.getApplName()); if (applInfo != null) { rtnVal = applInfo.getPersistenceUnitInfo(puId.getModJarName(), puId.getPuName()); // depends on control dependency: [if], data = [none] } else { Tr.warning(tc, "APPL_NOT_FOUND_DURING_PU_LOOKUP_CWWJP0010W", puId.getApplName(), puId.getModJarName(), puId.getPuName()); // depends on control dependency: [if], data = [none] } if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "findPersistenceUnitInfo : " + rtnVal); return rtnVal; } }
public class class_name { private void addPostParams(final Request request) { if (defaults != null) { request.addPostParam("Defaults", Converter.mapToJson(defaults)); } } }
public class class_name { private void addPostParams(final Request request) { if (defaults != null) { request.addPostParam("Defaults", Converter.mapToJson(defaults)); // depends on control dependency: [if], data = [(defaults] } } }
public class class_name { boolean isLeaf(treeNode node){ if(node.lc == null && node.rc == null){ return true; } else { return false; } } }
public class class_name { boolean isLeaf(treeNode node){ if(node.lc == null && node.rc == null){ return true; // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } }
public class class_name { public boolean setKDR(int keyDefinitionRate) { boolean res = true; if ((keyDefinitionRate > 64) || (keyDefinitionRate <= 0)) { log("setKDR() - invalid parameter " + keyDefinitionRate); res = false; } else { kdr = keyDefinitionRate; } return res; } }
public class class_name { public boolean setKDR(int keyDefinitionRate) { boolean res = true; if ((keyDefinitionRate > 64) || (keyDefinitionRate <= 0)) { log("setKDR() - invalid parameter " + keyDefinitionRate); // depends on control dependency: [if], data = [none] res = false; // depends on control dependency: [if], data = [none] } else { kdr = keyDefinitionRate; // depends on control dependency: [if], data = [none] } return res; } }
public class class_name { public void setParamTabExWorkplaceSearchResult(String style) { if (style == null) { style = OpenCms.getWorkplaceManager().getDefaultUserSettings().getWorkplaceSearchViewStyle().getMode(); } m_userSettings.setWorkplaceSearchViewStyle(CmsSearchResultStyle.valueOf(style)); } }
public class class_name { public void setParamTabExWorkplaceSearchResult(String style) { if (style == null) { style = OpenCms.getWorkplaceManager().getDefaultUserSettings().getWorkplaceSearchViewStyle().getMode(); // depends on control dependency: [if], data = [none] } m_userSettings.setWorkplaceSearchViewStyle(CmsSearchResultStyle.valueOf(style)); } }
public class class_name { public void close(int requestNumber) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "close", requestNumber); try { ConsumerSession cs = getConsumerSession(); if (cs !=null) cs.close(); try { getConversation().send(poolManager.allocate(), JFapChannelConstants.SEG_CLOSE_CONSUMER_SESS_R, requestNumber, getLowestPriority(), true, ThrottlingPolicy.BLOCK_THREAD, null); } catch (SIException e) { FFDCFilter.processException(e, CLASS_NAME + ".close", CommsConstants.CATCONSUMER_CLOSE_02, this); SibTr.error(tc, "COMMUNICATION_ERROR_SICO2013", e); } } catch (SIException e) { //No FFDC code needed //Only FFDC if we haven't received a meTerminated event. if(!((ConversationState)getConversation().getAttachment()).hasMETerminated()) { FFDCFilter.processException(e, CLASS_NAME + ".close", CommsConstants.CATCONSUMER_CLOSE_01, this); } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, e.getMessage(), e); StaticCATHelper.sendExceptionToClient(e, CommsConstants.CATCONSUMER_CLOSE_01, getConversation(), requestNumber); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "close"); } }
public class class_name { public void close(int requestNumber) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "close", requestNumber); try { ConsumerSession cs = getConsumerSession(); if (cs !=null) cs.close(); try { getConversation().send(poolManager.allocate(), JFapChannelConstants.SEG_CLOSE_CONSUMER_SESS_R, requestNumber, getLowestPriority(), true, ThrottlingPolicy.BLOCK_THREAD, null); // depends on control dependency: [try], data = [none] } catch (SIException e) { FFDCFilter.processException(e, CLASS_NAME + ".close", CommsConstants.CATCONSUMER_CLOSE_02, this); SibTr.error(tc, "COMMUNICATION_ERROR_SICO2013", e); } // depends on control dependency: [catch], data = [none] } catch (SIException e) { //No FFDC code needed //Only FFDC if we haven't received a meTerminated event. if(!((ConversationState)getConversation().getAttachment()).hasMETerminated()) { FFDCFilter.processException(e, CLASS_NAME + ".close", CommsConstants.CATCONSUMER_CLOSE_01, this); // depends on control dependency: [if], data = [none] } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, e.getMessage(), e); StaticCATHelper.sendExceptionToClient(e, CommsConstants.CATCONSUMER_CLOSE_01, getConversation(), requestNumber); } // depends on control dependency: [catch], data = [none] if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "close"); } }
public class class_name { @Override public void replaceUnsolvedElements(NamedConcreteElement elementWrapper) { super.replaceUnsolvedElements(elementWrapper); XsdAbstractElement element = elementWrapper.getElement(); if (element instanceof XsdSimpleType && simpleType != null && type.equals(elementWrapper.getName())){ this.simpleType = elementWrapper; } } }
public class class_name { @Override public void replaceUnsolvedElements(NamedConcreteElement elementWrapper) { super.replaceUnsolvedElements(elementWrapper); XsdAbstractElement element = elementWrapper.getElement(); if (element instanceof XsdSimpleType && simpleType != null && type.equals(elementWrapper.getName())){ this.simpleType = elementWrapper; // depends on control dependency: [if], data = [none] } } }
public class class_name { public void onShutdown(){ CacheRegistry.getInstance().clearDynamicServices();// clear dynamic cache services synchronized (allCaches) { for (String cacheName : allCaches.keySet()) { CacheService cachingObj= allCaches.get(cacheName); cachingObj.clearCache(); } } } }
public class class_name { public void onShutdown(){ CacheRegistry.getInstance().clearDynamicServices();// clear dynamic cache services synchronized (allCaches) { for (String cacheName : allCaches.keySet()) { CacheService cachingObj= allCaches.get(cacheName); cachingObj.clearCache(); // depends on control dependency: [for], data = [none] } } } }
public class class_name { public void setValue(List<Token[]> tokensList) { if (type == null) { type = ItemType.LIST; } if (!isListableType()) { throw new IllegalArgumentException("The item type must be 'array', 'list' or 'set' for this item " + this); } this.tokensList = tokensList; } }
public class class_name { public void setValue(List<Token[]> tokensList) { if (type == null) { type = ItemType.LIST; // depends on control dependency: [if], data = [none] } if (!isListableType()) { throw new IllegalArgumentException("The item type must be 'array', 'list' or 'set' for this item " + this); } this.tokensList = tokensList; } }
public class class_name { private static boolean isSupersededBy(List<Problem> apars1, List<Problem> apars2) { boolean result = true; // Now iterate over the current list of problems, and see if the incoming IFixInfo contains all of the problems from this IfixInfo. // If it does then return true, to indicate that this IFixInfo object has been superseded. for (Iterator<Problem> iter1 = apars1.iterator(); iter1.hasNext();) { boolean currAparMatch = false; Problem currApar1 = iter1.next(); for (Iterator<Problem> iter2 = apars2.iterator(); iter2.hasNext();) { Problem currApar2 = iter2.next(); if (currApar1.getDisplayId().equals(currApar2.getDisplayId())) { currAparMatch = true; } } if (!currAparMatch) result = false; } return result; } }
public class class_name { private static boolean isSupersededBy(List<Problem> apars1, List<Problem> apars2) { boolean result = true; // Now iterate over the current list of problems, and see if the incoming IFixInfo contains all of the problems from this IfixInfo. // If it does then return true, to indicate that this IFixInfo object has been superseded. for (Iterator<Problem> iter1 = apars1.iterator(); iter1.hasNext();) { boolean currAparMatch = false; Problem currApar1 = iter1.next(); for (Iterator<Problem> iter2 = apars2.iterator(); iter2.hasNext();) { Problem currApar2 = iter2.next(); if (currApar1.getDisplayId().equals(currApar2.getDisplayId())) { currAparMatch = true; // depends on control dependency: [if], data = [none] } } if (!currAparMatch) result = false; } return result; } }
public class class_name { private static boolean isStartOfDoubleBond(IAtomContainer container, IAtom a, IAtom parent, boolean[] doubleBondConfiguration) { int hcount; if (a.getImplicitHydrogenCount() == CDKConstants.UNSET) hcount = 0; else hcount = a.getImplicitHydrogenCount(); int lengthAtom = container.getConnectedAtomsList(a).size() + hcount; if (lengthAtom != 3 && (lengthAtom != 2 && !(a.getSymbol().equals("N")))) { return (false); } List<IAtom> atoms = container.getConnectedAtomsList(a); IAtom one = null; IAtom two = null; boolean doubleBond = false; IAtom nextAtom = null; for (IAtom atom : atoms) { if (!atom.equals(parent) && container.getBond(atom, a).getOrder() == Order.DOUBLE && isEndOfDoubleBond(container, atom, a, doubleBondConfiguration)) { doubleBond = true; nextAtom = atom; } if (!atom.equals(nextAtom) && one == null) { one = atom; } else if (!atom.equals(nextAtom) && one != null) { two = atom; } } String[] morgannumbers = MorganNumbersTools.getMorganNumbersWithElementSymbol(container); if (one != null && ((!a.getSymbol().equals("N") && two != null && !morgannumbers[container.indexOf(one)].equals(morgannumbers[container .indexOf(two)]) && doubleBond && doubleBondConfiguration[container.indexOf(container.getBond( a, nextAtom))]) || (doubleBond && a.getSymbol().equals("N") && Math.abs(giveAngleBothMethods( nextAtom, a, parent, true)) > Math.PI / 10))) { return (true); } else { return (false); } } }
public class class_name { private static boolean isStartOfDoubleBond(IAtomContainer container, IAtom a, IAtom parent, boolean[] doubleBondConfiguration) { int hcount; if (a.getImplicitHydrogenCount() == CDKConstants.UNSET) hcount = 0; else hcount = a.getImplicitHydrogenCount(); int lengthAtom = container.getConnectedAtomsList(a).size() + hcount; if (lengthAtom != 3 && (lengthAtom != 2 && !(a.getSymbol().equals("N")))) { return (false); // depends on control dependency: [if], data = [none] } List<IAtom> atoms = container.getConnectedAtomsList(a); IAtom one = null; IAtom two = null; boolean doubleBond = false; IAtom nextAtom = null; for (IAtom atom : atoms) { if (!atom.equals(parent) && container.getBond(atom, a).getOrder() == Order.DOUBLE && isEndOfDoubleBond(container, atom, a, doubleBondConfiguration)) { doubleBond = true; // depends on control dependency: [if], data = [none] nextAtom = atom; // depends on control dependency: [if], data = [none] } if (!atom.equals(nextAtom) && one == null) { one = atom; // depends on control dependency: [if], data = [none] } else if (!atom.equals(nextAtom) && one != null) { two = atom; // depends on control dependency: [if], data = [none] } } String[] morgannumbers = MorganNumbersTools.getMorganNumbersWithElementSymbol(container); if (one != null && ((!a.getSymbol().equals("N") && two != null && !morgannumbers[container.indexOf(one)].equals(morgannumbers[container .indexOf(two)]) && doubleBond && doubleBondConfiguration[container.indexOf(container.getBond( a, nextAtom))]) || (doubleBond && a.getSymbol().equals("N") && Math.abs(giveAngleBothMethods( nextAtom, a, parent, true)) > Math.PI / 10))) { return (true); // depends on control dependency: [if], data = [none] } else { return (false); // depends on control dependency: [if], data = [none] } } }
public class class_name { public EEnum getPPORGObjType() { if (pporgObjTypeEEnum == null) { pporgObjTypeEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(122); } return pporgObjTypeEEnum; } }
public class class_name { public EEnum getPPORGObjType() { if (pporgObjTypeEEnum == null) { pporgObjTypeEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(122); // depends on control dependency: [if], data = [none] } return pporgObjTypeEEnum; } }
public class class_name { @Override public Object read(List<Slice> slices) throws DapException { switch (this.scheme) { case ATOMIC: return readAtomic(slices); case STRUCTURE: if(((DapVariable) this.getTemplate()).getRank() > 0 || DapUtil.isScalarSlices(slices)) throw new DapException("Cannot slice a scalar variable"); CDMCursor[] instances = new CDMCursor[1]; instances[0] = this; return instances; case SEQUENCE: if(((DapVariable) this.getTemplate()).getRank() > 0 || DapUtil.isScalarSlices(slices)) throw new DapException("Cannot slice a scalar variable"); instances = new CDMCursor[1]; instances[0] = this; return instances; case STRUCTARRAY: Odometer odom = Odometer.factory(slices); instances = new CDMCursor[(int) odom.totalSize()]; for(int i = 0; odom.hasNext(); i++) { instances[i] = readStructure(odom.next()); } return instances; case SEQARRAY: instances = readSequence(slices); return instances; default: throw new DapException("Attempt to slice a scalar object"); } } }
public class class_name { @Override public Object read(List<Slice> slices) throws DapException { switch (this.scheme) { case ATOMIC: return readAtomic(slices); case STRUCTURE: if(((DapVariable) this.getTemplate()).getRank() > 0 || DapUtil.isScalarSlices(slices)) throw new DapException("Cannot slice a scalar variable"); CDMCursor[] instances = new CDMCursor[1]; instances[0] = this; return instances; case SEQUENCE: if(((DapVariable) this.getTemplate()).getRank() > 0 || DapUtil.isScalarSlices(slices)) throw new DapException("Cannot slice a scalar variable"); instances = new CDMCursor[1]; instances[0] = this; return instances; case STRUCTARRAY: Odometer odom = Odometer.factory(slices); instances = new CDMCursor[(int) odom.totalSize()]; for(int i = 0; odom.hasNext(); i++) { instances[i] = readStructure(odom.next()); // depends on control dependency: [for], data = [i] } return instances; case SEQARRAY: instances = readSequence(slices); return instances; default: throw new DapException("Attempt to slice a scalar object"); } } }
public class class_name { public void removeConverter() { if (m_converter != null) { Converter converter = m_converter; m_converter = null; // This keeps this from being called twice converter.removeComponent(null); // Just in case a converter was used (removes converter, leaves field!) if (m_converter instanceof BaseField) { // Special case - free this field if it is temporary and belongs to no records. if (((BaseField)m_converter).getRecord() == null) m_converter.free(); } } m_converter = null; } }
public class class_name { public void removeConverter() { if (m_converter != null) { Converter converter = m_converter; m_converter = null; // This keeps this from being called twice // depends on control dependency: [if], data = [none] converter.removeComponent(null); // Just in case a converter was used (removes converter, leaves field!) // depends on control dependency: [if], data = [null)] if (m_converter instanceof BaseField) { // Special case - free this field if it is temporary and belongs to no records. if (((BaseField)m_converter).getRecord() == null) m_converter.free(); } } m_converter = null; } }
public class class_name { @Override public void release(Pointer pointer, MemoryKind kind) { if (kind == MemoryKind.DEVICE) { NativeOpsHolder.getInstance().getDeviceNativeOps().freeDevice(pointer, 0); pointer.setNull(); } else if (kind == MemoryKind.HOST) { NativeOpsHolder.getInstance().getDeviceNativeOps().freeHost(pointer); pointer.setNull(); } } }
public class class_name { @Override public void release(Pointer pointer, MemoryKind kind) { if (kind == MemoryKind.DEVICE) { NativeOpsHolder.getInstance().getDeviceNativeOps().freeDevice(pointer, 0); // depends on control dependency: [if], data = [none] pointer.setNull(); // depends on control dependency: [if], data = [none] } else if (kind == MemoryKind.HOST) { NativeOpsHolder.getInstance().getDeviceNativeOps().freeHost(pointer); // depends on control dependency: [if], data = [none] pointer.setNull(); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public String getTrimmedPath(String path) { if (path == null) { return "/"; } if (!path.startsWith("/")) { try { path = new URL(path).getPath(); } catch (MalformedURLException ex) { // ignore Logger.getLogger(JBossWSDestinationRegistryImpl.class).trace(ex); } if (!path.startsWith("/")) { path = "/" + path; } } return path; } }
public class class_name { @Override public String getTrimmedPath(String path) { if (path == null) { return "/"; // depends on control dependency: [if], data = [none] } if (!path.startsWith("/")) { try { path = new URL(path).getPath(); // depends on control dependency: [try], data = [none] } catch (MalformedURLException ex) { // ignore Logger.getLogger(JBossWSDestinationRegistryImpl.class).trace(ex); } // depends on control dependency: [catch], data = [none] if (!path.startsWith("/")) { path = "/" + path; // depends on control dependency: [if], data = [none] } } return path; } }
public class class_name { @Override public String permissionsToString() { if (this.permissions == null) { return Constants.EMPTY_STRING; } // The service supports a fixed order => raud final StringBuilder builder = new StringBuilder(); if (this.permissions.contains(SharedAccessTablePermissions.QUERY)) { builder.append("r"); } if (this.permissions.contains(SharedAccessTablePermissions.ADD)) { builder.append("a"); } if (this.permissions.contains(SharedAccessTablePermissions.UPDATE)) { builder.append("u"); } if (this.permissions.contains(SharedAccessTablePermissions.DELETE)) { builder.append("d"); } return builder.toString(); } }
public class class_name { @Override public String permissionsToString() { if (this.permissions == null) { return Constants.EMPTY_STRING; // depends on control dependency: [if], data = [none] } // The service supports a fixed order => raud final StringBuilder builder = new StringBuilder(); if (this.permissions.contains(SharedAccessTablePermissions.QUERY)) { builder.append("r"); // depends on control dependency: [if], data = [none] } if (this.permissions.contains(SharedAccessTablePermissions.ADD)) { builder.append("a"); // depends on control dependency: [if], data = [none] } if (this.permissions.contains(SharedAccessTablePermissions.UPDATE)) { builder.append("u"); // depends on control dependency: [if], data = [none] } if (this.permissions.contains(SharedAccessTablePermissions.DELETE)) { builder.append("d"); // depends on control dependency: [if], data = [none] } return builder.toString(); } }
public class class_name { int refreshAndGetMin() { int min = Integer.MAX_VALUE; ResultSubpartition[] allPartitions = partition.getAllPartitions(); if (allPartitions.length == 0) { // meaningful value when no channels exist: return 0; } for (ResultSubpartition part : allPartitions) { int size = part.unsynchronizedGetNumberOfQueuedBuffers(); min = Math.min(min, size); } return min; } }
public class class_name { int refreshAndGetMin() { int min = Integer.MAX_VALUE; ResultSubpartition[] allPartitions = partition.getAllPartitions(); if (allPartitions.length == 0) { // meaningful value when no channels exist: return 0; // depends on control dependency: [if], data = [none] } for (ResultSubpartition part : allPartitions) { int size = part.unsynchronizedGetNumberOfQueuedBuffers(); min = Math.min(min, size); // depends on control dependency: [for], data = [none] } return min; } }
public class class_name { @GET @Path("/{variantId}") @Produces(MediaType.APPLICATION_JSON) public Response findVariantById(@PathParam("variantId") String variantId) { Variant variant = variantService.findByVariantID(variantId); if (variant == null) { return Response.status(Response.Status.NOT_FOUND).entity("Could not find requested Variant").build(); } if (!type.isInstance(variant)) { return Response.status(Response.Status.BAD_REQUEST).entity("Requested Variant is of another type/platform").build(); } return Response.ok(variant).build(); } }
public class class_name { @GET @Path("/{variantId}") @Produces(MediaType.APPLICATION_JSON) public Response findVariantById(@PathParam("variantId") String variantId) { Variant variant = variantService.findByVariantID(variantId); if (variant == null) { return Response.status(Response.Status.NOT_FOUND).entity("Could not find requested Variant").build(); // depends on control dependency: [if], data = [none] } if (!type.isInstance(variant)) { return Response.status(Response.Status.BAD_REQUEST).entity("Requested Variant is of another type/platform").build(); // depends on control dependency: [if], data = [none] } return Response.ok(variant).build(); } }
public class class_name { public PropsEntries profile(final String... profiles) { if (profiles == null) { return this; } for (String profile : profiles) { addProfiles(profile); } return this; } }
public class class_name { public PropsEntries profile(final String... profiles) { if (profiles == null) { return this; // depends on control dependency: [if], data = [none] } for (String profile : profiles) { addProfiles(profile); // depends on control dependency: [for], data = [profile] } return this; } }
public class class_name { private void addWrapper(MethodSpec.Builder method, String pattern) { method.addComment("$S", pattern); for (Node node : WRAPPER_PARSER.parseWrapper(pattern)) { if (node instanceof Text) { method.addStatement("b.append($S)", ((Text)node).text()); } else if (node instanceof Field) { Field field = (Field)node; switch (field.ch()) { case '0': method.beginControlFlow("if (timeType != null)"); method.addStatement("formatTime(timeType, d, b)"); method.nextControlFlow("else"); method.addStatement("formatSkeleton(timeSkel, d, b)"); method.endControlFlow(); break; case '1': method.beginControlFlow("if (dateType != null)"); method.addStatement("formatDate(dateType, d, b)"); method.nextControlFlow("else"); method.addStatement("formatSkeleton(dateSkel, d, b)"); method.endControlFlow(); break; } } } } }
public class class_name { private void addWrapper(MethodSpec.Builder method, String pattern) { method.addComment("$S", pattern); for (Node node : WRAPPER_PARSER.parseWrapper(pattern)) { if (node instanceof Text) { method.addStatement("b.append($S)", ((Text)node).text()); // depends on control dependency: [if], data = [none] } else if (node instanceof Field) { Field field = (Field)node; switch (field.ch()) { case '0': method.beginControlFlow("if (timeType != null)"); method.addStatement("formatTime(timeType, d, b)"); // depends on control dependency: [if], data = [none] method.nextControlFlow("else"); // depends on control dependency: [if], data = [none] method.addStatement("formatSkeleton(timeSkel, d, b)"); // depends on control dependency: [if], data = [none] method.endControlFlow(); // depends on control dependency: [if], data = [none] break; case '1': method.beginControlFlow("if (dateType != null)"); method.addStatement("formatDate(dateType, d, b)"); // depends on control dependency: [if], data = [none] method.nextControlFlow("else"); // depends on control dependency: [if], data = [none] method.addStatement("formatSkeleton(dateSkel, d, b)"); // depends on control dependency: [if], data = [none] method.endControlFlow(); // depends on control dependency: [if], data = [none] break; } } } } }
public class class_name { public boolean validateMinimumVersion( @NonNull Context context, @NonNull PackageInfo packageInfo, int minimumVersion) { if (isDebug(context)) { return true; } return packageInfo.versionCode >= minimumVersion; } }
public class class_name { public boolean validateMinimumVersion( @NonNull Context context, @NonNull PackageInfo packageInfo, int minimumVersion) { if (isDebug(context)) { return true; // depends on control dependency: [if], data = [none] } return packageInfo.versionCode >= minimumVersion; } }
public class class_name { @Pure public static List<UUID> getAttributeUUIDs(Node document, boolean caseSensitive, String... path) { assert document != null : AssertMessages.notNullParameter(0); final List<UUID> ids = new ArrayList<>(); final String v = getAttributeValue(document, caseSensitive, 0, path); if (v != null && !v.isEmpty()) { for (final String id : v.split(COLUMN_SEPARATOR)) { try { ids.add(UUID.fromString(id)); } catch (Exception e) { // } } } return ids; } }
public class class_name { @Pure public static List<UUID> getAttributeUUIDs(Node document, boolean caseSensitive, String... path) { assert document != null : AssertMessages.notNullParameter(0); final List<UUID> ids = new ArrayList<>(); final String v = getAttributeValue(document, caseSensitive, 0, path); if (v != null && !v.isEmpty()) { for (final String id : v.split(COLUMN_SEPARATOR)) { try { ids.add(UUID.fromString(id)); // depends on control dependency: [try], data = [none] } catch (Exception e) { // } // depends on control dependency: [catch], data = [none] } } return ids; } }
public class class_name { public Action onFragment(final DirectBuffer buffer, final int offset, final int length, final Header header) { final byte flags = header.flags(); Action action = Action.CONTINUE; if ((flags & UNFRAGMENTED) == UNFRAGMENTED) { action = delegate.onFragment(buffer, offset, length, header); } else { if ((flags & BEGIN_FRAG_FLAG) == BEGIN_FRAG_FLAG) { builder.reset().append(buffer, offset, length); } else { final int limit = builder.limit(); builder.append(buffer, offset, length); if ((flags & END_FRAG_FLAG) == END_FRAG_FLAG) { final int msgLength = builder.limit(); action = delegate.onFragment(builder.buffer(), 0, msgLength, header); if (Action.ABORT == action) { builder.limit(limit); } else { builder.reset(); } } } } return action; } }
public class class_name { public Action onFragment(final DirectBuffer buffer, final int offset, final int length, final Header header) { final byte flags = header.flags(); Action action = Action.CONTINUE; if ((flags & UNFRAGMENTED) == UNFRAGMENTED) { action = delegate.onFragment(buffer, offset, length, header); // depends on control dependency: [if], data = [none] } else { if ((flags & BEGIN_FRAG_FLAG) == BEGIN_FRAG_FLAG) { builder.reset().append(buffer, offset, length); // depends on control dependency: [if], data = [none] } else { final int limit = builder.limit(); builder.append(buffer, offset, length); // depends on control dependency: [if], data = [none] if ((flags & END_FRAG_FLAG) == END_FRAG_FLAG) { final int msgLength = builder.limit(); action = delegate.onFragment(builder.buffer(), 0, msgLength, header); // depends on control dependency: [if], data = [none] if (Action.ABORT == action) { builder.limit(limit); // depends on control dependency: [if], data = [none] } else { builder.reset(); // depends on control dependency: [if], data = [none] } } } } return action; } }
public class class_name { public void addUniqueField(int field) { if (this.uniqueFields == null) { this.uniqueFields = new HashSet<FieldSet>(); } this.uniqueFields.add(new FieldSet(field)); } }
public class class_name { public void addUniqueField(int field) { if (this.uniqueFields == null) { this.uniqueFields = new HashSet<FieldSet>(); // depends on control dependency: [if], data = [none] } this.uniqueFields.add(new FieldSet(field)); } }
public class class_name { @Nullable public static View getViewForPosition(@NonNull final ListViewWrapper listViewWrapper, final int position) { int childCount = listViewWrapper.getChildCount(); View downView = null; for (int i = 0; i < childCount && downView == null; i++) { View child = listViewWrapper.getChildAt(i); if (child != null && getPositionForView(listViewWrapper, child) == position) { downView = child; } } return downView; } }
public class class_name { @Nullable public static View getViewForPosition(@NonNull final ListViewWrapper listViewWrapper, final int position) { int childCount = listViewWrapper.getChildCount(); View downView = null; for (int i = 0; i < childCount && downView == null; i++) { View child = listViewWrapper.getChildAt(i); if (child != null && getPositionForView(listViewWrapper, child) == position) { downView = child; // depends on control dependency: [if], data = [none] } } return downView; } }
public class class_name { public void sendMessage(BaseMessage messageOut, BaseInternalMessageProcessor messageOutProcessor) { int iErrorCode = this.convertToExternal(messageOut, messageOutProcessor); // Convert my standard message to the external format for this message BaseMessage messageReplyIn = null; if (iErrorCode != DBConstants.NORMAL_RETURN) { String strMessageDescription = this.getTask().getLastError(iErrorCode); if ((strMessageDescription == null) || (strMessageDescription.length() == 0)) strMessageDescription = "Error converting to external format"; iErrorCode = this.getTask().setLastError(strMessageDescription); messageReplyIn = BaseMessageProcessor.processErrorMessage(this, messageOut, strMessageDescription); } else { Utility.getLogger().info("sendMessage externalTrxMessage = " + messageOut); messageReplyIn = this.sendMessageRequest(messageOut); } if (messageReplyIn != null) // No reply if null. { this.setupReplyMessage(messageReplyIn, messageOut, MessageInfoTypeModel.REPLY, MessageTypeModel.MESSAGE_IN); Utility.getLogger().info("externalMessageReply: " + messageReplyIn); this.processIncomingMessage(messageReplyIn, messageOut); } } }
public class class_name { public void sendMessage(BaseMessage messageOut, BaseInternalMessageProcessor messageOutProcessor) { int iErrorCode = this.convertToExternal(messageOut, messageOutProcessor); // Convert my standard message to the external format for this message BaseMessage messageReplyIn = null; if (iErrorCode != DBConstants.NORMAL_RETURN) { String strMessageDescription = this.getTask().getLastError(iErrorCode); if ((strMessageDescription == null) || (strMessageDescription.length() == 0)) strMessageDescription = "Error converting to external format"; iErrorCode = this.getTask().setLastError(strMessageDescription); // depends on control dependency: [if], data = [none] messageReplyIn = BaseMessageProcessor.processErrorMessage(this, messageOut, strMessageDescription); // depends on control dependency: [if], data = [none] } else { Utility.getLogger().info("sendMessage externalTrxMessage = " + messageOut); // depends on control dependency: [if], data = [none] messageReplyIn = this.sendMessageRequest(messageOut); // depends on control dependency: [if], data = [none] } if (messageReplyIn != null) // No reply if null. { this.setupReplyMessage(messageReplyIn, messageOut, MessageInfoTypeModel.REPLY, MessageTypeModel.MESSAGE_IN); // depends on control dependency: [if], data = [(messageReplyIn] Utility.getLogger().info("externalMessageReply: " + messageReplyIn); // depends on control dependency: [if], data = [none] this.processIncomingMessage(messageReplyIn, messageOut); // depends on control dependency: [if], data = [(messageReplyIn] } } }
public class class_name { public String get(String key) { if (properties.get(key) != null) { return properties.get(key); } else { return getConfigurationValue(key); } } }
public class class_name { public String get(String key) { if (properties.get(key) != null) { return properties.get(key); // depends on control dependency: [if], data = [none] } else { return getConfigurationValue(key); // depends on control dependency: [if], data = [none] } } }
public class class_name { public Decimal minus(Decimal subtrahend) { if ((this == NaN) || (subtrahend == NaN)) { return NaN; } return new Decimal(delegate.subtract(subtrahend.delegate, MATH_CONTEXT)); } }
public class class_name { public Decimal minus(Decimal subtrahend) { if ((this == NaN) || (subtrahend == NaN)) { return NaN; // depends on control dependency: [if], data = [none] } return new Decimal(delegate.subtract(subtrahend.delegate, MATH_CONTEXT)); } }