auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void reset() { Boolean goFmt = PropertiesComponent.getInstance().getBoolean(GO_ONSAVE_FMT_KEY, true); Boolean goImports = PropertiesComponent.getInstance().getBoolean(GO_ONSAVE_IMPORTS_KEY, false); doNothingOnSave.setSelected(!goFmt && !goImports); goFmtOnSave.setSelected(goFmt); goimportsOnSave.setSelected(goImports); }

Target:
public void reset() { GoApplicationSettings.GoApplicationSettingsBean settingsBean = GoApplicationSettings.getInstance().getState(); doNothingOnSave.setSelected(!settingsBean.goFmtOnSave && !settingsBean.goimportsOnSave); goFmtOnSave.setSelected(settingsBean.goFmtOnSave); goimportsOnSave.setSelected(settingsBean.goimportsOnSave); }
Source:
public Bundle getTranslations() { Bundle translations = new Bundle(); Locale defaultLocale = new Locale("en"); Resources currentResources = getResources(); Configuration configuration = currentResources.getConfiguration(); if (configuration.locale.equals(defaultLocale)) { return translations; } DisplayMetrics metrics = new DisplayMetrics(); getActivity().getWindowManager().getDefaultDisplay().getMetrics(metrics); configuration.locale = defaultLocale; Resources defaultResources = new Resources(getActivity().getAssets(), metrics, configuration); for (Field stringField : R.string.class.getFields()) { int resourceId = 0; try { resourceId = stringField.getInt(R.string.class); } catch (IllegalArgumentException | IllegalAccessException e) { e.printStackTrace(); continue; } String currentResourceString = currentResources.getString(resourceId); String defaultResourceString = defaultResources.getString(resourceId); if (currentResourceString.length() > 0 && defaultResourceString.length() > 0) { translations.putStringArrayList( defaultResourceString, new ArrayList<>(Arrays.asList(currentResourceString)) ); } } return translations; }

Target:
public Bundle getTranslations() { Bundle translations = new Bundle(); Locale defaultLocale = new Locale("en"); Resources currentResources = getActivity().getApplicationContext().getResources(); Configuration currentConfiguration = currentResources.getConfiguration(); if (currentConfiguration.locale.equals(defaultLocale)) { return translations; } DisplayMetrics metrics = new DisplayMetrics(); Configuration defaultLocaleConfiguration = new Configuration(currentConfiguration); defaultLocaleConfiguration.setLocale(defaultLocale); getActivity().getWindowManager().getDefaultDisplay().getMetrics(metrics); Resources defaultResources = new Resources(getActivity().getAssets(), metrics, defaultLocaleConfiguration); Class<?> rString; Package mainPackage = getActivity().getApplication().getClass().getPackage(); if (mainPackage == null) { return translations; } try { rString = getActivity().getApplication().getClassLoader().loadClass(mainPackage.getName() + ".R$string"); } catch (ClassNotFoundException ex) { return translations; } for (Field stringField : rString.getDeclaredFields()) { int resourceId; try { resourceId = stringField.getInt(rString); } catch (IllegalArgumentException | IllegalAccessException iae) { AppLog.e(T.EDITOR, iae); continue; } String fieldName = stringField.getName(); if (!fieldName.startsWith("gutenberg_mobile_")) { continue; } String currentResourceString = currentResources.getString(resourceId); String defaultResourceString = defaultResources.getString(resourceId); if (currentResourceString.length() > 0 && defaultResourceString.length() > 0) { translations.putStringArrayList( defaultResourceString, new ArrayList<>(Arrays.asList(currentResourceString)) ); } } return translations; }
Source:
private void createPath(String parentPath, boolean removeParentsIfCreated) { try { curator.create().creatingParentsIfNeeded().forPath(parentPath); if (removeParentsIfCreated) { parentsIBuilt.add(parentPath); } log.debug("Created parentPath[%s], %s remove on stop.", parentPath, removeParentsIfCreated ? "will" : "will not"); } catch (Exception e) { log.info(e, "Problem creating parentPath[%s], someone else created it first?", parentPath); } }

Target:
private void createPath(String parentPath, boolean removeParentsIfCreated) { try { curator.create().creatingParentsIfNeeded().forPath(parentPath); if (removeParentsIfCreated) { parentsIBuilt.add(parentPath); } log.debug("Created parentPath[%s], %s remove on stop() called.", parentPath, removeParentsIfCreated ? "will" : "will not"); } catch (Exception e) { log.error(e, "Problem creating parentPath[%s], someone else created it first?", parentPath); } }
Source:
private void matchCitation(Path file, int lineNumber, String line) { Matcher citeMatch = Pattern.compile(CITE_REGEX).matcher(line); while (citeMatch.find()) { String[] keys = citeMatch.group("key").split(","); for (String key : keys) { Citation citation = new Citation(file, lineNumber, citeMatch.start(), citeMatch.end(), line); if (!result.getCitations().containsKey(key)) { result.getCitations().put(key, new ArrayList<>()); } if (!result.getCitations().get(key).contains(citation)) { result.getCitations().get(key).add(citation); } } } }

Target:
private void matchCitation(Path file, int lineNumber, String line) { Matcher citeMatch = CITE_PATTERN.matcher(line); while (citeMatch.find()) { String[] keys = citeMatch.group(CITE_GROUP).split(","); for (String key : keys) { result.addKey(key, file, lineNumber, citeMatch.start(), citeMatch.end(), line); } } }
Source:
private void connectProject(Entry<IProject, File> entry, MultiStatus ms, IProgressMonitor monitor) throws CoreException { IProject project = entry.getKey(); String taskName = NLS.bind( CoreText.ConnectProviderOperation_ConnectingProject, project.getName()); SubMonitor subMon = SubMonitor.convert(monitor, taskName, 100); if (GitTraceLocation.CORE.isActive()) { GitTraceLocation.getTrace() .trace(GitTraceLocation.CORE.getLocation(), taskName); } RepositoryFinder finder = new RepositoryFinder(project); finder.setFindInChildren(true); Collection<RepositoryMapping> repos = finder.find(subMon.newChild(50)); if (repos.isEmpty()) { ms.add(Activator.error(NLS.bind( CoreText.ConnectProviderOperation_NoRepositoriesError, project.getName()), null)); return; } GitProjectData projectData = new GitProjectData(project); try { projectData.setRepositoryMappings(repos); projectData.store(); GitProjectData.add(project, projectData); } catch (CoreException ce) { ms.add(ce.getStatus()); deleteGitProvider(ms, project); return; } catch (RuntimeException ce) { ms.add(Activator.error(ce.getMessage(), ce)); deleteGitProvider(ms, project); return; } RepositoryProvider.map(project, GitProvider.ID); if (refreshResources) { project.refreshLocal(IResource.DEPTH_INFINITE, subMon.newChild(40)); } else { subMon.worked(40); } autoIgnoreDerivedResources(project, subMon.newChild(10)); }

Target:
private void connectProject(Entry<IProject, File> entry, MultiStatus ms, IProgressMonitor monitor) throws CoreException { IProject project = entry.getKey(); String taskName = NLS.bind( CoreText.ConnectProviderOperation_ConnectingProject, project.getName()); SubMonitor subMon = SubMonitor.convert(monitor, taskName, 100); if (GitTraceLocation.CORE.isActive()) { GitTraceLocation.getTrace() .trace(GitTraceLocation.CORE.getLocation(), taskName); } RepositoryFinder finder = new RepositoryFinder(project); finder.setFindInChildren(false); Collection<RepositoryMapping> repos = finder.find(subMon.newChild(50)); if (repos.isEmpty()) { ms.add(Activator.error(NLS.bind( CoreText.ConnectProviderOperation_NoRepositoriesError, project.getName()), null)); return; } RepositoryMapping actualMapping = findActualRepository(repos, entry.getValue()); if (actualMapping == null) { ms.add(Activator.error(NLS.bind( CoreText.ConnectProviderOperation_UnexpectedRepositoryError, new Object[] { project.getName(), entry.getValue().toString(), repos.toString() }), null)); return; } GitProjectData projectData = new GitProjectData(project); try { projectData.setRepositoryMappings(Arrays.asList(actualMapping)); projectData.store(); GitProjectData.add(project, projectData); } catch (CoreException ce) { ms.add(ce.getStatus()); deleteGitProvider(ms, project); return; } catch (RuntimeException ce) { ms.add(Activator.error(ce.getMessage(), ce)); deleteGitProvider(ms, project); return; } RepositoryProvider.map(project, GitProvider.ID); if (refreshResources) { project.refreshLocal(IResource.DEPTH_INFINITE, subMon.newChild(40)); } else { subMon.worked(40); } autoIgnoreDerivedResources(project, subMon.newChild(10)); }
Source:
public void testTriggerWithComplexActionValues() throws Exception { String json = "{\"id\":12345678,\"title\":\"Test Trigger\",\"active\":true,\"position\":45,\"conditions\":{\"all\":[],\"any\":[{\"field\":\"comment_includes_word\",\"operator\":\"includes\",\"value\":\"@triggerTest\"}]},\"actions\":[{\"field\":\"notification_target\",\"value\":[\"1234567890\",[[\"key1\",\"value1\"],[\"key2\",\"value2\"]]]}],\"createdAt\":null,\"updatedAt\":null}"; Trigger trigger = parseJson(json.getBytes()); assertNotNull(trigger); assertEquals("Test Trigger", trigger.getTitle()); assertEquals(1, trigger.getActions().size()); assertEquals("notification_target", trigger.getActions().get(0).getField()); assertArrayEquals(new Object {"1234567890", Arrays.asList(Arrays.asList("key1", "value1"), Arrays.asList("key2", "value2"))}, trigger.getActions().get(0).getValue()); assertEquals(0, trigger.getConditions().getAll().size()); assertEquals(1, trigger.getConditions().getAny().size()); assertEquals("comment_includes_word", trigger.getConditions().getAny().get(0).getField()); assertEquals("includes", trigger.getConditions().getAny().get(0).getOperator()); assertEquals("@triggerTest", trigger.getConditions().getAny().get(0).getValue()); assertEquals(json, new String(writeJson(trigger))); }

Target:
public void testTriggerWithComplexActionValues() throws Exception { String json = Utils.resourceToString(getClass().getName().replace('.', '/') + "/triggerWithComplexActions.json"); Trigger trigger = parseJson(json.getBytes()); assertNotNull(trigger); assertEquals("Test Trigger", trigger.getTitle()); assertEquals(1, trigger.getActions().size()); assertEquals("notification_target", trigger.getActions().get(0).getField()); assertArrayEquals(new Object {"1234567890", Arrays.asList(Arrays.asList("key1", "value1"), Arrays.asList("key2", "value2"))}, trigger.getActions().get(0).getValue()); assertEquals(0, trigger.getConditions().getAll().size()); assertEquals(1, trigger.getConditions().getAny().size()); assertEquals("comment_includes_word", trigger.getConditions().getAny().get(0).getField()); assertEquals("includes", trigger.getConditions().getAny().get(0).getOperator()); assertEquals("@triggerTest", trigger.getConditions().getAny().get(0).getValue()); assertEquals(json, new String(writeJson(trigger))); }
Source:
private void refreshTarget(final Object target) { Display.getDefault().asyncExec(() -> { if (viewer != null) { final TreePath[] treePaths = viewer.getExpandedTreePaths(); viewer.refresh(target, true); viewer.setExpandedTreePaths(treePaths); } }); }

Target:
private void refreshTarget(final Object target) { Display.getDefault().asyncExec(() -> { if (viewer != null && !viewer.getControl().isDisposed()) { final TreePath[] treePaths = viewer.getExpandedTreePaths(); viewer.refresh(target, true); viewer.setExpandedTreePaths(treePaths); } }); }
Source:
private void handleAddLabel() { int i = 1; }

Target:
private void handleAddLabel() { }
Source:
private void mockHttpRequestAndResponse() { when(request.getProtocol()).thenReturn(Protocol.HTTP_1_1); MultiHashMap responseHeaders = new MultiHashMap(); responseHeaders.put("Transfer-Encoding", "true"); response = new DefaultHttpResponse(new ResponseStatus(), responseHeaders, new OutputHandlerHttpEntity(this)); when(ctx.getConnection()).thenReturn(connection); when(ctx.getFilterChain()).thenReturn(filterChain); when(connection.getTransport()).thenReturn(transport); when(transport.getMemoryManager()).thenReturn(memoryManager); }

Target:
private void mockHttpRequestAndResponse() { when(request.getProtocol()).thenReturn(HTTP_1_1); MultiHashMap responseHeaders = new MultiHashMap(); responseHeaders.put(TRANSFER_ENCODING, TRUE); response = new DefaultHttpResponse(new ResponseStatus(), responseHeaders, new OutputHandlerHttpEntity(this)); when(ctx.getConnection()).thenReturn(connection); when(ctx.getFilterChain()).thenReturn(filterChain); when(connection.getTransport()).thenReturn(transport); when(transport.getMemoryManager()).thenReturn(memoryManager); }
Source:
public static long toLong(byte[] bytes, int offset, final int length) { if (length != SIZEOF_LONG || offset + length > bytes.length) { throw explainWrongLengthOrOffset(bytes, offset, length, SIZEOF_LONG); } return ConverterHolder.getBestConverter().toLong(bytes, offset, length); }

Target:
public static long toLong(byte[] bytes, int offset, final int length) { if (length != SIZEOF_LONG || offset + length > bytes.length) { throw explainWrongLengthOrOffset(bytes, offset, length, SIZEOF_LONG); } return ConverterHolder.BEST_CONVERTER.toLong(bytes, offset, length); }
Source:
default <U> Seq<U> map(Function<? super Tuple2<K, V>, ? extends U> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return Stream.ofAll(iterator()).map(mapper); }

Target:
default <U> Seq<U> map(Function<? super Tuple2<K, V>, ? extends U> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return (Seq<U>) iterator().map(mapper).toStream(); }
Source:
public void process(MessageContainer msg) throws Exception { if (Strings.isNullOrEmpty(msg.getRoutingKey())) { DynamicCounter.increment("emptyRoutingKeyCount"); return; } RoutingMap.RoutingInfo info = routingMap.getRoutingInfo(msg.getRoutingKey()); if (info == null) { sinkManager.getSink("default").writeTo(msg); } else if (info.doFilter(msg)) { List<Route> routes = info.getWhere(); for (Route route : routes) { if (route.doFilter(msg)) { if (!Strings.isNullOrEmpty(route.getAlias())) { sinkManager.getSink(route.getSink()).writeTo( new DefaultMessageContainer( new Message(route.getAlias(), msg.getMessage().getPayload()), jsonMapper)); } else { sinkManager.getSink(route.getSink()).writeTo(msg); } } } } }

Target:
public void process(MessageContainer msg) throws Exception { if (Strings.isNullOrEmpty(msg.getRoutingKey())) { DynamicCounter.increment( MonitorConfig.builder(TagKey.DROPPED_COUNT).withTag("reason", "emptyRoutingKey").build()); return; } RoutingMap.RoutingInfo info = routingMap.getRoutingInfo(msg.getRoutingKey()); if (info == null) { sinkManager.getSink("default").writeTo(msg); } else if (info.doFilter(msg)) { List<Route> routes = info.getWhere(); for (Route route : routes) { if (route.doFilter(msg)) { if (!Strings.isNullOrEmpty(route.getAlias())) { sinkManager.getSink(route.getSink()).writeTo( new DefaultMessageContainer( new Message(route.getAlias(), msg.getMessage().getPayload()), jsonMapper)); } else { sinkManager.getSink(route.getSink()).writeTo(msg); } } } } }
Source:
private void printCacheHelp() { log(i("The '" + CACHE.text() + " subcommand' is used to get information about and perform actions with caches. The command has the following syntax:")); nl(); log(i(UTILITY_NAME_WITH_COMMON_OPTIONS + " " + CACHE.text() + "[subcommand] <subcommand_parameters>")); nl(); log(i("The subcommands that take [nodeId] as an argument ('" + LIST.text() + "', '" + CONTENTION.text() + "' and '" + VALIDATE_INDEXES.text() + "') will be executed on the given node or on all server nodes if the option is not specified. Other commands will run on a random server node.")); nl(); nl(); log(i("Subcommands:")); usageCache(LIST, "regexPattern", "[groups|seq]", "[nodeId]", op(CONFIG), op(OUTPUT_FORMAT, MULTI_LINE.text())); usageCache(CONTENTION, "minQueueSize", "[nodeId]", "[maxPrint]"); usageCache(IDLE_VERIFY, op(CMD_DUMP), op(CMD_SKIP_ZEROS), "[cache1,...,cacheN]", op(CACHE_KIND), "[ALL|SYSTEM|PERSISTENT|NOT_PERSISTENT]"); usageCache(VALIDATE_INDEXES, "[cache1,...,cacheN]", "[nodeId]", op(or(VI_CHECK_FIRST + " N", VI_CHECK_THROUGH + " K"))); usageCache(DISTRIBUTION, or("nodeId", NULL), "[cacheName1,...,cacheNameN]", op(CMD_USER_ATTRIBUTES, "attName1,...,attrNameN")); usageCache(RESET_LOST_PARTITIONS, "cacheName1,...,cacheNameN"); nl(); }

Target:
private void printCacheHelp() { log(i("The '" + CACHE.text() + " subcommand' is used to get information about and perform actions with caches. The command has the following syntax:")); nl(); log(i(UTILITY_NAME_WITH_COMMON_OPTIONS + " " + CACHE.text() + "[subcommand] <subcommand_parameters>")); nl(); log(i("The subcommands that take [nodeId] as an argument ('" + LIST.text() + "', '" + CONTENTION.text() + "' and '" + VALIDATE_INDEXES.text() + "') will be executed on the given node or on all server nodes if the option is not specified. Other commands will run on a random server node.")); nl(); nl(); log(i("Subcommands:")); usageCache(LIST, "regexPattern", op(or("groups","seq")), op("nodeId"), op(CONFIG), op(OUTPUT_FORMAT, MULTI_LINE .text())); usageCache(CONTENTION, "minQueueSize", op("nodeId"), op("maxPrint")); usageCache(IDLE_VERIFY, op(CMD_DUMP), op(CMD_SKIP_ZEROS), "[cache1,...,cacheN]", op(CACHE_FILTER, or(CacheFilterEnum.ALL.toString(), CacheFilterEnum.SYSTEM.toString(), CacheFilterEnum.PERSISTENT.toString(), CacheFilterEnum.NOT_PERSISTENT.toString()))); usageCache(VALIDATE_INDEXES, "[cache1,...,cacheN]", op("nodeId"), op(or(VI_CHECK_FIRST + " N", VI_CHECK_THROUGH + " K"))); usageCache(DISTRIBUTION, or("nodeId", NULL), "[cacheName1,...,cacheNameN]", op(CMD_USER_ATTRIBUTES, "attName1,...,attrNameN")); usageCache(RESET_LOST_PARTITIONS, "cacheName1,...,cacheNameN"); nl(); }
Source:
private void doWork() { ArrayList<TimeRequest> request = new ArrayList<>(); while (true) { try { request.clear(); TimeRequest trh = null; while (trh == null) { if (closed.get()) { return; } trh = queue.poll(1, TimeUnit.SECONDS); } request.add(trh); queue.drainTo(request); long start; long gcStamp; while (true) { try { String currentLeaderId; OracleService.Client localClient; synchronized (this) { currentLeaderId = getOracle(); localClient = client; } final Context timerContext = responseTimer.time(); Stamps stamps = localClient.getTimestamps(env.getFluoApplicationID(), request.size()); start = stamps.stampStart; gcStamp = stamps.gcStamp; String leaderId = getOracle(); if (leaderId != null && !leaderId.equals(currentLeaderId)) { reconnect(); continue; } stampsHistogram.update(request.size()); timerContext.close(); break; } catch (TTransportException tte) { log.info("Oracle connection lost. Retrying..."); reconnect(); } catch (TException e) { log.error("TException occurred in doWork() method", e); } } for (int i = 0; i < request.size(); i++) { TimeRequest tr = request.get(i); tr.timestamp.set(start + i); tr.gcStamp.set(gcStamp); tr.cdl.countDown(); } } catch (InterruptedException e) { if (!closed.get()) { log.error("InterruptedException occurred in doWork() method", e); } else { log.debug("InterruptedException occurred in doWork() method", e); } } catch (Exception e) { log.error("Exception occurred in doWork() method", e); } } }

Target:
private void doWork() { ArrayList<TimeRequest> request = new ArrayList<>(); while (true) { try { request.clear(); TimeRequest trh = null; while (trh == null) { if (closed.get()) { return; } trh = queue.poll(1, TimeUnit.SECONDS); } request.add(trh); queue.drainTo(request); long txStampsStart; long gcStamp; while (true) { try { String currentLeaderId; OracleService.Client localClient; synchronized (this) { currentLeaderId = getOracle(); localClient = client; } final Context timerContext = responseTimer.time(); Stamps stamps = localClient.getTimestamps(env.getFluoApplicationID(), request.size()); txStampsStart = stamps.txStampsStart; gcStamp = stamps.gcStamp; String leaderId = getOracle(); if (leaderId != null && !leaderId.equals(currentLeaderId)) { reconnect(); continue; } stampsHistogram.update(request.size()); timerContext.close(); break; } catch (TTransportException tte) { log.info("Oracle connection lost. Retrying..."); reconnect(); } catch (TException e) { log.error("TException occurred in doWork() method", e); } } for (int i = 0; i < request.size(); i++) { TimeRequest tr = request.get(i); tr.stampRef.set(new Stamp(txStampsStart + i, gcStamp)); tr.cdl.countDown(); } } catch (InterruptedException e) { if (!closed.get()) { log.error("InterruptedException occurred in doWork() method", e); } else { log.debug("InterruptedException occurred in doWork() method", e); } } catch (Exception e) { log.error("Exception occurred in doWork() method", e); } } }
Source:
public synchronized void onPackageRemoved(String packageName) { if (!mPackageNameUidMap.containsKey(packageName)) { return; } int uid = mPackageNameUidMap.get(packageName); SparseIntArray netdPermissionsAppIds = new SparseIntArray(); netdPermissionsAppIds.put(uid, INetd.NO_PERMISSIONS); sendPackagesPermissionsToNetd(netdPermissionsAppIds); mPackageNameUidMap.remove(packageName); }

Target:
public void onPackageRemoved(String packageName) { int uid; synchronized (mPackageNameUidMap) { if (!mPackageNameUidMap.containsKey(packageName)) { return; } uid = mPackageNameUidMap.get(packageName); mPackageNameUidMap.remove(packageName); } SparseIntArray netdPermissionsAppIds = new SparseIntArray(); netdPermissionsAppIds.put(uid, INetd.NO_PERMISSIONS); sendPackagePermissionsToNetd(netdPermissionsAppIds); }
Source:
public KafkaContainer(String confluentPlatformVersion) { this(TestcontainersConfiguration.getInstance().getPulsarDockerImageName().withTag(confluentPlatformVersion)); }

Target:
public KafkaContainer(String confluentPlatformVersion) { this(TestcontainersConfiguration.getInstance().getKafkaDockerImageName().withTag(confluentPlatformVersion)); }
Source:
private String getYmlFromPath(String path, String username) throws AppException { DsPath ymlPath = pathValidator.validatePath(this.project, path); ymlPath.validatePathExists(inodes,false); org.apache.hadoop.fs.Path fullPath = ymlPath.getFullPath(); String ymlFileName = fullPath.getName(); DistributedFileSystemOps udfso = null; FSDataInputStream is = null; try { udfso = dfs.getDfsOps(username); is = udfso.open(fullPath); long fileSize = udfso.getFileStatus(fullPath).getLen(); byte[] ymlFileInBytes = new byte[(int) fileSize]; if (fileSize < 10000) { try (DataInputStream dis = new DataInputStream(is)) { dis.readFully(ymlFileInBytes, 0, (int)fileSize); String ymlFileContents = new String(ymlFileInBytes); return ymlFileContents; } } else{ throw new AppException(Response.Status.INTERNAL_SERVER_ERROR. getStatusCode(), ".yml file too large. Maximum size is 10000 bytes."); } } catch(IOException ioe) { throw new AppException(Response.Status.INTERNAL_SERVER_ERROR. getStatusCode(), "Failed to create Anaconda environment from .yml file."); } }

Target:
private String getYmlFromPath(String path, String username) throws AppException { DsPath ymlPath = pathValidator.validatePath(this.project, path); ymlPath.validatePathExists(inodes,false); org.apache.hadoop.fs.Path fullPath = ymlPath.getFullPath(); String ymlFileName = fullPath.getName(); DistributedFileSystemOps udfso = null; FSDataInputStream is = null; try { udfso = dfs.getDfsOps(username); is = udfso.open(fullPath); long fileSize = udfso.getFileStatus(fullPath).getLen(); byte[] ymlFileInBytes = new byte[(int) fileSize]; if (fileSize < 10000) { try (DataInputStream dis = new DataInputStream(is)) { dis.readFully(ymlFileInBytes, 0, (int)fileSize); String ymlFileContents = new String(ymlFileInBytes); return ymlFileContents; } } else{ throw new AppException(Response.Status.INTERNAL_SERVER_ERROR. getStatusCode(), ".yml file too large. Maximum size is 10000 bytes."); } } catch(IOException ioe) { throw new AppException(Response.Status.INTERNAL_SERVER_ERROR. getStatusCode(), "Failed to create Anaconda environment from .yml file."); } finally { if (udfso != null) { dfs.closeDfsClient(udfso); } } }
Source:
public IndexedInts get() { final boolean powerOf2 = sizePer == (1 << Integer.numberOfTrailingZeros(sizePer)); if(powerOf2) { if(numBytes == Ints.BYTES) { return new CompressedFullSizeIndexedInts() { @Override public int get(int index) { return get2(index); } }; } else if(numBytes == Shorts.BYTES) { return new CompressedShortSizeIndexedInts() { @Override public int get(int index) { return get2(index); } }; } else if (numBytes == 1) { return new CompressedByteSizeIndexedInts() { @Override public int get(int index) { return get2(index); } }; } else { return new CompressedVSizeIndexedInts() { @Override public int get(int index) { return get2(index); } }; } } else { if(numBytes == Ints.BYTES) { return new CompressedFullSizeIndexedInts(); } else if (numBytes == Shorts.BYTES) { return new CompressedShortSizeIndexedInts(); } else if (numBytes == 1) { return new CompressedByteSizeIndexedInts(); } else { return new CompressedVSizeIndexedInts(); } } }

Target:
public IndexedInts get() { if(numBytes == Ints.BYTES) { return new CompressedFullSizeIndexedInts(); } else if (numBytes == Shorts.BYTES) { return new CompressedShortSizeIndexedInts(); } else if (numBytes == 1) { return new CompressedByteSizeIndexedInts(); } else { return new CompressedVSizeIndexedInts(); } }
Source:
private void manageRegions() { if (regionContainersToLayoutWithImpactStatus.isEmpty()) { return; } List<View> newArrayList = Lists.newArrayList(regionContainersToLayoutWithImpactStatus.keySet()); ListIterator<View> regionToLayoutListIterator = newArrayList.listIterator(newArrayList.size()); while (regionToLayoutListIterator.hasPrevious()) { View regionContainer = regionToLayoutListIterator.previous(); if (regionContainer instanceof Node) { if (regionContainersToLayoutWithImpactStatus.get(regionContainer)) { new RegionContainerUpdateLayoutOperation((Node) regionContainer).execute(); } } } regionContainersToLayoutWithImpactStatus.clear(); }

Target:
private void manageRegions() { if (regionsContainersToLayoutWithImpactStatus.isEmpty()) { return; } List<View> newArrayList = Lists.newArrayList(regionsContainersToLayoutWithImpactStatus.keySet()); ListIterator<View> regionsContainersToLayoutListIterator = newArrayList.listIterator(newArrayList.size()); while (regionsContainersToLayoutListIterator.hasPrevious()) { View regionsContainer = regionsContainersToLayoutListIterator.previous(); if (regionsContainer instanceof Node) { if (regionsContainersToLayoutWithImpactStatus.get(regionsContainer)) { new RegionContainerUpdateLayoutOperation((Node) regionsContainer).execute(); } } } regionsContainersToLayoutWithImpactStatus.clear(); }
Source:
public void onRequestComplete(RestRequestMetadata restRequestMetadata) { if (restRequestMetadata != null) { if (requestsInFlight.remove(restRequestMetadata) != null) { restServerMetrics.dequeuedRequestHandlerRequestCompletionRate.mark(); restRequestMetadata.release(); logger.debug("Request completed - {}", restRequestMetadata); } } }

Target:
public void onRequestComplete(RestRequestMetadata restRequestMetadata) { if (restRequestMetadata != null) { if (requestsInFlight.remove(restRequestMetadata) != null) { restServerMetrics.dequeuedRequestHandlerRequestCompletionRate.mark(); restRequestMetadata.release(); logger.trace("Request completed - {}", restRequestMetadata.getUri()); } } }
Source:
public OLSyntaxNode protocolId() { OLSyntaxNode p = this.protocol; if( p instanceof SumExpressionNode ) { OLSyntaxNode prodNode = ((SumExpressionNode) protocol).operands().iterator().next().value(); p = ((ProductExpressionNode) prodNode).operands().iterator().next().value(); } if( p instanceof InlineTreeExpressionNode ) { return ((InlineTreeExpressionNode) p).rootExpression(); } else { return p; } }

Target:
public String protocolId() { return PortInfo.extractProtocolId( this.protocol ); }
Source:
public final void fetchesSize() throws Exception { final Content content = Mockito.mock(Content.class); Mockito.doReturn( Json.createObjectBuilder() .add("size", 5555) .build() ).when(content).json(); MatcherAssert.assertThat( new Content.Smart(content).size(), Matchers.notNullValue() ); }

Target:
public final void fetchesSize() throws Exception { final Content content = Mockito.mock(Content.class); final int prop = 5555; Mockito.doReturn( Json.createObjectBuilder() .add("size", prop) .build() ).when(content).json(); MatcherAssert.assertThat( new Content.Smart(content).size(), Matchers.is(prop) ); }
Source:
public static LibraryTemplateDto asDto(LibraryTemplate from) { LibraryTemplateDto dto = null; if (from instanceof DetailedLibraryTemplate) { dto = asDetailedLibraryTemplateDto((DetailedLibraryTemplate) from); } else { dto = new LibraryTemplateDto(); } dto.setId(from.getId()); dto.setAlias(from.getAlias()); dto.setProjectId(from.getProject().getId()); dto.setDefaultVolume(from.getDefaultVolume() != null ? from.getDefaultVolume().toString() : ""); dto.setPlatformType(from.getPlatformType() != null ? from.getPlatformType().getKey() : ""); dto.setLibraryTypeId(from.getLibraryType() != null ? from.getLibraryType().getId().toString() : ""); dto.setSelectionTypeId(from.getLibrarySelectionType() != null ? from.getLibrarySelectionType().getId().toString() : ""); dto.setStrategyTypeId(from.getLibraryStrategyType() != null ? from.getLibraryStrategyType().getId().toString() : ""); dto.setKitDescriptorId(from.getKitDescriptor() != null ? from.getKitDescriptor().getId().toString() : ""); dto.setIndexFamilyId(from.getIndexFamily() != null ? from.getIndexFamily().getId().toString() : ""); if (from.getIndexFamily() != null) { if (from.getIndexOnes() != null) { dto.setIndexOneIds(from.getIndexOnes().entrySet().stream() .collect(Collectors.toMap(Entry::getKey, entry -> entry.getValue().getId()))); } if (from.getIndexTwos() != null) { dto.setIndexTwoIds(from.getIndexTwos().entrySet().stream() .collect(Collectors.toMap(Entry::getKey, entry -> entry.getValue().getId()))); } } return dto; }

Target:
public static LibraryTemplateDto asDto(LibraryTemplate from) { LibraryTemplateDto dto = null; if (from instanceof DetailedLibraryTemplate) { dto = asDetailedLibraryTemplateDto((DetailedLibraryTemplate) from); } else { dto = new LibraryTemplateDto(); } dto.setId(from.getId()); dto.setAlias(from.getAlias()); dto.setProjectIds(from.getProjects().stream().map(Project::getId).collect(Collectors.toList())); dto.setDefaultVolume(from.getDefaultVolume()); dto.setPlatformType(from.getPlatformType() != null ? from.getPlatformType().toString() : null); dto.setLibraryTypeId(from.getLibraryType() != null ? from.getLibraryType().getId() : null); dto.setSelectionTypeId(from.getLibrarySelectionType() != null ? from.getLibrarySelectionType().getId() : null); dto.setStrategyTypeId(from.getLibraryStrategyType() != null ? from.getLibraryStrategyType().getId() : null); dto.setKitDescriptorId(from.getKitDescriptor() != null ? from.getKitDescriptor().getId() : null); dto.setIndexFamilyId(from.getIndexFamily() != null ? from.getIndexFamily().getId() : null); if (from.getIndexFamily() != null) { if (from.getIndexOnes() != null) { dto.setIndexOneIds(from.getIndexOnes().entrySet().stream() .collect(Collectors.toMap(Entry::getKey, entry -> entry.getValue().getId()))); } if (from.getIndexTwos() != null) { dto.setIndexTwoIds(from.getIndexTwos().entrySet().stream() .collect(Collectors.toMap(Entry::getKey, entry -> entry.getValue().getId()))); } } return dto; }
Source:
private void updateStoragePoolFormatType() { final StoragePool storagePool = getStoragePool(); final Guid spId = storagePool.getId(); final Version spVersion = storagePool.getcompatibility_version(); final Version oldSpVersion = _oldStoragePool.getcompatibility_version(); if (oldSpVersion.equals(spVersion)) { return; } final StorageFormatType targetFormat = VersionStorageFormatUtil.getPreferredForVersion(spVersion, getMasterDomain() == null ? null : getMasterDomain().getStorageType()); storagePool.setStoragePoolFormatType(targetFormat); TransactionSupport.executeInScope(TransactionScopeOption.RequiresNew, new TransactionMethod<Object>() { @Override public Object runInTransaction() { getStoragePoolDAO().updatePartial(storagePool); if (getMasterDomain() != null) { updateMemberDomainsFormat(targetFormat); } return null; } }); if (_oldStoragePool.getStatus() == StoragePoolStatus.Up && getMasterDomain() != null) { try { runVdsCommand(VDSCommandType.UpgradeStoragePool, new UpgradeStoragePoolVDSCommandParameters(spId, targetFormat)); } catch (VdcBLLException e) { log.warnFormat("Upgrade procees of Storage Pool {0} has encountered a problem due to following reason: {1}", spId, e.getMessage()); AuditLogDirector.log(this, AuditLogType.UPGRADE_STORAGE_POOL_ENCOUNTERED_PROBLEMS); } } }

Target:
private void updateStoragePoolFormatType() { final StoragePool storagePool = getStoragePool(); final Guid spId = storagePool.getId(); final Version spVersion = storagePool.getcompatibility_version(); final Version oldSpVersion = _oldStoragePool.getcompatibility_version(); if (oldSpVersion.equals(spVersion)) { return; } StorageType spType = storagePool.getStorageType(); final StorageFormatType targetFormat = VersionStorageFormatUtil.getPreferredForVersion(spVersion, spType); storagePool.setStoragePoolFormatType(targetFormat); TransactionSupport.executeInScope(TransactionScopeOption.RequiresNew, new TransactionMethod<Object>() { @Override public Object runInTransaction() { getStoragePoolDAO().updatePartial(storagePool); if (getMasterDomain() != null) { updateMemberDomainsFormat(targetFormat); } return null; } }); if (_oldStoragePool.getStatus() == StoragePoolStatus.Up && getMasterDomain() != null) { try { runVdsCommand(VDSCommandType.UpgradeStoragePool, new UpgradeStoragePoolVDSCommandParameters(spId, targetFormat)); } catch (VdcBLLException e) { log.warnFormat("Upgrade procees of Storage Pool {0} has encountered a problem due to following reason: {1}", spId, e.getMessage()); AuditLogDirector.log(this, AuditLogType.UPGRADE_STORAGE_POOL_ENCOUNTERED_PROBLEMS); } } }
Source:
public void beforeBlockElement(ProgramState currentState, Tree element, ProgramPoint programPoint) { if (element.is(Tree.Kind.CALL_EXPRESSION)) { CallExpressionTree callExpression = (CallExpressionTree) element; if (callExpression.callee().is(Tree.Kind.DOT_MEMBER_EXPRESSION)) { MemberExpressionTree memberExpression = (MemberExpressionTree) callExpression.callee(); ExpressionTree object = memberExpression.object(); if (!isReverseMethod(memberExpression.property())) { return; } if (!object.is(Tree.Kind.IDENTIFIER_REFERENCE)) { return; } ((IdentifierTree) object).symbol().ifPresent(objectSymbol -> { if (isArray(objectSymbol, currentState) && isBeingPassedElsewhere(objectSymbol, element)) this.addUniqueIssue(element, MESSAGE); }); } } }

Target:
public void beforeBlockElement(ProgramState currentState, Tree element, ProgramPoint programPoint) { if (element.is(Tree.Kind.CALL_EXPRESSION)) { CallExpressionTree callExpression = (CallExpressionTree) element; if (callExpression.callee().is(Tree.Kind.DOT_MEMBER_EXPRESSION)) { MemberExpressionTree memberExpression = (MemberExpressionTree) callExpression.callee(); checkMemberExpression(currentState, callExpression, memberExpression); } } }
Source:
static Discover parse(String s) { if (s == null || s.isEmpty()) return Discover.none; return Discover.valueOf(s); }

Target:
static Discover parse(String s) { if (s == null || (s = s.trim()).isEmpty()) return Discover.none; return Discover.valueOf(s); }
Source:
private Guid getBrickId(List<GlusterBrickEntity> bricksList, String qualifiedBrickName) { String[] brickParts = qualifiedBrickName.split(":", -1); if (brickParts.length != 2) { throw new RuntimeException("Invalid brick representation [" + qualifiedBrickName + "]"); } for (GlusterBrickEntity brick : bricksList) { if (brick.getQualifiedName().equals(qualifiedBrickName)) { return brick.getId(); } } return null; }

Target:
private Guid getBrickId(List<GlusterBrickEntity> bricksList, String qualifiedBrickName) { for (GlusterBrickEntity brick : bricksList) { if (brick.getQualifiedName().equals(qualifiedBrickName)) { return brick.getId(); } } return null; }
Source:
protected void onStart() { super.onStart(); mapView.onStart(); sensorManager.registerListener(this, gyro , 200); sensorManager.registerListener(this, magnetic , 200); }

Target:
protected void onStart() { super.onStart(); mapView.onStart(); sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); sensorControl = new SensorControl(sensorManager); registerSensorListeners(); }
Source:
private RdapObject getRdapObject(final String requestUrl, final RpslObject rpslObject, final LocalDateTime lastChangedTimestamp, @Nullable final RpslObject abuseContact) { RdapObject rdapResponse; final ObjectType rpslObjectType = rpslObject.getType(); switch (rpslObjectType) { case DOMAIN: rdapResponse = createDomain(rpslObject); break; case AUT_NUM: rdapResponse = createAutnumResponse(rpslObject); break; case AS_BLOCK: rdapResponse = createAsBlockResponse(rpslObject); break; case INETNUM: case INET6NUM: rdapResponse = createIp(rpslObject); break; case PERSON: case ROLE: case ORGANISATION: rdapResponse = createEntity(rpslObject); break; default: throw new IllegalArgumentException("Unhandled object type: " + rpslObject.getType()); } if (hasRemark(rpslObject)) { rdapResponse.getRemarks().add(createRemark(rpslObject)); } rdapResponse.getEvents().add(createEvent(lastChangedTimestamp)); rdapResponse.getNotices().addAll(noticeFactory.generateNotices(requestUrl, rpslObject)); if (abuseContact != null) { rdapResponse.getEntitySearchResults().add(createEntity(abuseContact, Role.ABUSE)); } return rdapResponse; }

Target:
private RdapObject getRdapObject(final String requestUrl, final RpslObject rpslObject, final LocalDateTime lastChangedTimestamp, @Nullable final RpslObject abuseContact) { RdapObject rdapResponse; final ObjectType rpslObjectType = rpslObject.getType(); switch (rpslObjectType) { case DOMAIN: rdapResponse = createDomain(rpslObject); break; case AUT_NUM: rdapResponse = createAutnumResponse(rpslObject); break; case AS_BLOCK: rdapResponse = createAsBlockResponse(rpslObject); break; case INETNUM: case INET6NUM: rdapResponse = createIp(rpslObject); break; case PERSON: case ROLE: case MNTNER: case ORGANISATION: rdapResponse = createEntity(rpslObject); break; default: throw new IllegalArgumentException("Unhandled object type: " + rpslObject.getType()); } if (hasRemark(rpslObject)) { rdapResponse.getRemarks().add(createRemark(rpslObject)); } rdapResponse.getEvents().add(createEvent(lastChangedTimestamp)); rdapResponse.getNotices().addAll(noticeFactory.generateNotices(requestUrl, rpslObject)); if (abuseContact != null) { rdapResponse.getEntitySearchResults().add(createEntity(abuseContact, Role.ABUSE)); } return rdapResponse; }
Source:
public Response enableDatasourceSegments( @PathParam("dataSourceName") String dataSourceName, MarkDatasourceSegmentsPayload payload ) { if (payload == null || !payload.isValid()) { return Response.status(Response.Status.BAD_REQUEST).entity( ImmutableMap.of( "error", "Either interval or segments can be specified" ) ).build(); } final ImmutableDruidDataSource dataSource = getDataSource(dataSourceName); if (dataSource == null) { return Response.noContent().build(); } boolean success; try { if (payload.getInterval() != null) { success = databaseSegmentManager.enableSegments(dataSource.getName(), payload.getInterval()); } else { success = databaseSegmentManager.enableSegments(dataSource.getName(), payload.getSegmentIds()); } } catch (Exception e) { return Response.serverError().entity( ImmutableMap.of( "error", "Exception occurred.", "message", e.toString() ) ).build(); } if (!success) { return Response.noContent().build(); } return Response.ok().build(); }

Target:
public Response enableDatasourceSegments( @PathParam("dataSourceName") String dataSourceName, MarkDatasourceSegmentsPayload payload ) { if (payload == null || !payload.isValid()) { return Response.status(Response.Status.BAD_REQUEST) .entity("Invalid request payload, either interval or segmentIds array must be specified") .build(); } final ImmutableDruidDataSource dataSource = getDataSource(dataSourceName); if (dataSource == null) { return Response.noContent().build(); } int modified; try { if (payload.getInterval() != null) { modified = databaseSegmentManager.enableSegments(dataSource.getName(), payload.getInterval()); } else { modified = databaseSegmentManager.enableSegments(dataSource.getName(), payload.getSegmentIds()); } } catch (Exception e) { if (e.getCause() instanceof UnknownSegmentIdException) { return Response.status(Response.Status.NOT_FOUND).entity( ImmutableMap.of( "message", e.getCause().getMessage() ) ).build(); } return Response.serverError().entity( ImmutableMap.of( "error", "Exception occurred.", "message", e.getMessage() ) ).build(); } if (modified == 0) { return Response.noContent().build(); } return Response.ok().build(); }
Source:
private VariantEvaluationContext composeNonTruthOverlappingVariantContext(final VariantContext call, final TargetCollection<Target> targets) { final VariantEvaluationContextBuilder result = new VariantEvaluationContextBuilder(); result.loc(call.getContig(), call.getStart(), call.getEnd()); result.attribute(VCFConstants.END_KEY, call.getEnd()); result.id(call.getID()); result.alleles(call.getAlleles()); result.genotypes( call.getGenotypes().stream() .map(g -> composeNonTruthOverlappingGenotype(call, g)) .collect(Collectors.toList())); result.attribute(GenotypeCopyNumberTriStateSegments.NUMBER_OF_TARGETS_KEY, targets.targetCount(call)); result.evidence(null, Collections.singletonList(call)); return result.make(); }

Target:
private VariantEvaluationContext composeNonTruthOverlappingVariantContext(final VariantContext call, final TargetCollection<Target> targets) { return composeEvaluationVariantContext(call, call.getAlleles(), s -> composeNonTruthOverlappingGenotype(call, call.getGenotype(s)), targets, null, Collections.singletonList(call)); }
Source:
public void testReloadColumnSortListWhenInitListTable() { ListTable<T> listTable = mock(ListTable.class); when(getView().getListGrid()).thenReturn(listTable); GridPreferencesStore gridPreferencesStore = mock(GridPreferencesStore.class); when(listTable.getGridPreferencesStore()).thenReturn(gridPreferencesStore); GridSortedColumnPreference gridSortedColumnPreference = new GridSortedColumnPreference("test", true); when(gridPreferencesStore.getGridSortedColumnPreference()).thenReturn(gridSortedColumnPreference); ColumnSortList columnSortList = getColumnSortList("startDate", null); when(listTable.getColumnSortList()).thenReturn(columnSortList); ColumnMeta columnMeta = new ColumnMeta(getColumn("test"), "test"); when(listTable.getColumnMetaList()).thenReturn(Arrays.asList(columnMeta)); assertEquals(1, columnSortList.size()); doAnswer(answer -> { Column<T, String> column = new Column<T, String>(new TextCell()) { @Override public String getValue(T domain) { return null; } }; column.setSortable(true); column.setDataStoreName("test"); columnSortList.push(column); return columnSortList.get(0); }).when(getView()).defferredColumnSortListPush(any(),any()); getView().reloadColumnSortList(); assertEquals("test", columnSortList.get(0).getColumn().getDataStoreName()); assertEquals("startDate", columnSortList.get(1).getColumn().getDataStoreName()); assertEquals(2, columnSortList.size()); }

Target:
public void testReloadColumnSortListWhenInitListTable() { ListTable<T> listTable = mock(ListTable.class); when(getView().getListGrid()).thenReturn(listTable); GridPreferencesStore gridPreferencesStore = mock(GridPreferencesStore.class); when(listTable.getGridPreferencesStore()).thenReturn(gridPreferencesStore); GridSortedColumnPreference gridSortedColumnPreference = new GridSortedColumnPreference("test", true); when(gridPreferencesStore.getGridSortedColumnPreference()).thenReturn(gridSortedColumnPreference); ColumnSortList columnSortList = getColumnSortList("startDate", null); when(listTable.getColumnSortList()).thenReturn(columnSortList); ColumnMeta columnMeta = new ColumnMeta(getColumn("test"), "test"); when(listTable.getColumnMetaList()).thenReturn(Arrays.asList(columnMeta)); assertEquals(1, columnSortList.size()); getView().reloadColumnSortList(); assertEquals("test", columnSortList.get(0).getColumn().getDataStoreName()); assertEquals("startDate", columnSortList.get(1).getColumn().getDataStoreName()); assertEquals(2, columnSortList.size()); }
Source:
protected void configureMoveCommand(final String source, final String destination) { command = new LocalMoveFileCommand(); ((LocalMoveFileCommand) command).setConfiguration(source, destination); }

Target:
protected void configureMoveCommand(final String source, final String destination) { LocalMoveFileCommand cmd = new LocalMoveFileCommand(); cmd.setConfiguration(source, destination); command.set(cmd); }
Source:
private void hotPlugUnplugCpus() { if (getVm().getNumOfCpus() != getParameters().getVm().getNumOfCpus()) { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.SetNumberOfCpus, new SetNumberOfCpusVDSCommand.Params( getVm().getRunOnVds(), getVm().getId(), getParameters().getVm().getNumOfCpus())); AuditLogableBase logable = new AuditLogableBase(); logable.setVmId(getVmId()); logable.addCustomValue("numberOfCpus", String.valueOf(getParameters().getVm().getNumOfCpus())); logable.addCustomValue("ErrorMessage", returnValue.getExceptionString() + " " + returnValue.getVdsError().getMessage()); AuditLogDirector.log(logable, returnValue.getSucceeded() ? AuditLogType.SET_NUMBER_OF_CPUS : AuditLogType.FAILED_SET_NUMBER_OF_CPUS); if (!returnValue.getSucceeded()) { newVmStatic.setNumOfSockets(oldVm.getNumOfSockets()); } } }

Target:
private void hotPlugUnplugCpus() { int currentSockets = getVm().getNumOfSockets(); int newSockets = getParameters().getVm().getNumOfSockets(); if (getVm().getStatus() == VMStatus.Up && currentSockets != newSockets) { setNumberOfCpusResult = getBackend().runInternalAction( VdcActionType.SetNumberOfCpus, new VmManagementParametersBase(newVmStatic)); getVm().setNumOfSockets(setNumberOfCpusResult.getSucceeded() ? newSockets : currentSockets); } }
Source:
public static Object convertTo(JdbcConnection conn, Value v, Class<?> paramClass) { if (paramClass == Blob.class) { return new JdbcBlob(conn, v, 0); } else if (paramClass == Clob.class) { return new JdbcClob(conn, v, 0); } else if (paramClass == Array.class) { return new JdbcArray(conn, v, 0); } if (v.getType() == Value.JAVA_OBJECT) { Object o = SysProperties.serializeJavaObject ? JdbcUtils.deserialize(v.getBytes(), conn.getSession().getDataHandler()) : v.getObject(); if (paramClass.isAssignableFrom(o.getClass())) { return o; } } if (JdbcUtils.customDataTypesHandler != null) { return JdbcUtils.customDataTypesHandler.getObject(v, paramClass); } throw DbException.getUnsupportedException("converting to class " + paramClass.getName()); }

Target:
public static Object convertTo(JdbcConnection conn, Value v, Class<?> paramClass) { if (paramClass == Blob.class) { return new JdbcBlob(conn, v, 0); } else if (paramClass == Clob.class) { return new JdbcClob(conn, v, 0); } else if (paramClass == Array.class) { return new JdbcArray(conn, v, 0); } switch (v.getType()) { case Value.JAVA_OBJECT: { Object o = SysProperties.serializeJavaObject ? JdbcUtils.deserialize(v.getBytes(), conn.getSession().getDataHandler()) : v.getObject(); if (paramClass.isAssignableFrom(o.getClass())) { return o; } break; } case Value.BOOLEAN: case Value.BYTE: case Value.SHORT: case Value.INT: case Value.LONG: case Value.DECIMAL: case Value.TIME: case Value.DATE: case Value.TIMESTAMP: case Value.TIMESTAMP_TZ: case Value.BYTES: case Value.UUID: case Value.STRING: case Value.STRING_IGNORECASE: case Value.STRING_FIXED: case Value.BLOB: case Value.CLOB: case Value.DOUBLE: case Value.FLOAT: case Value.NULL: case Value.UNKNOWN: case Value.ARRAY: case Value.RESULT_SET: case Value.GEOMETRY: break; default: if (JdbcUtils.customDataTypesHandler != null) { return JdbcUtils.customDataTypesHandler.getObject(v, paramClass); } } throw DbException.getUnsupportedException("converting to class " + paramClass.getName()); }