auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void configureTask(SonarQubeTask sonarQubeTask, Project project, Map<String, ActionBroadcast<SonarQubeProperties>> actionBroadcastMap) { ConventionMapping conventionMapping = sonarQubeTask.getConventionMapping(); conventionMapping.map("properties", () -> new SonarPropertyComputer(actionBroadcastMap, project) .computeSonarProperties()); Callable<Iterable<? extends Task>> testTasks = () -> project.getAllprojects().stream() .filter(p -> p.getPlugins().hasPlugin(JavaPlugin.class) && !p.getExtensions().getByType(SonarQubeExtension.class).isSkipProject()) .map(p -> p.getTasks().getByName(JavaPlugin.TEST_TASK_NAME)) .collect(Collectors.toList()); sonarQubeTask.mustRunAfter(testTasks); Callable<Iterable<? extends Task>> compileTasks = () -> project.getAllprojects().stream() .filter(p -> isAndroidProject(p) && !p.getExtensions().getByType(SonarQubeExtension.class).isSkipProject()) .map(p -> { BaseVariant variant = AndroidUtils.findVariant(p, p.getExtensions().getByType(SonarQubeExtension.class).getAndroidVariant()); List<Task> allCompileTasks = new ArrayList<>(); if (variant != null) { boolean unitTestTaskDepAdded = addTaskByName(p, "compile" + capitalize(variant.getName()) + "UnitTestJavaWithJavac", allCompileTasks); boolean androidTestTaskDepAdded = addTaskByName(p, "compile" + capitalize(variant.getName()) + "AndroidTestJavaWithJavac", allCompileTasks); if (!unitTestTaskDepAdded && !androidTestTaskDepAdded) { addTaskByName(p, "compile" + capitalize(variant.getName()) + "JavaWithJavac", allCompileTasks); } } return allCompileTasks; }) .flatMap(List::stream) .collect(Collectors.toList()); sonarQubeTask.mustRunAfter(compileTasks); }

Target:
private void configureTask(SonarQubeTask sonarQubeTask, Project project, Map<String, ActionBroadcast<SonarQubeProperties>> actionBroadcastMap) { ConventionMapping conventionMapping = sonarQubeTask.getConventionMapping(); conventionMapping.map("properties", () -> new SonarPropertyComputer(actionBroadcastMap, project) .computeSonarProperties()); sonarQubeTask.mustRunAfter(getJavaTestTasks(project)); sonarQubeTask.dependsOn(getJavaCompileTasks(project)); sonarQubeTask.mustRunAfter(getJacocoTasks(project)); sonarQubeTask.dependsOn(getAndroidCompileTasks(project)); }
Source:
public Dimension getDefaultDimension() { final Dimension result = DEFAULT_NODE_DIMENSION.getCopy(); if (node.getStyle() instanceof WorkspaceImage) { final WorkspaceImage workspaceImage = (WorkspaceImage) node.getStyle(); final String path = workspaceImage.getWorkspacePath(); Dimension imageDimension = WorkspaceImageFigure.getImageBounds(path); if (imageDimension != null) { if (node.getWidth() == null || Integer.valueOf(node.getWidth()) == -1) { result.width = imageDimension.width; result.height = imageDimension.height; } else { final double ratio = (double) imageDimension.width / imageDimension.height; double newHeight = node.getWidth().intValue() / ratio; result.width = node.getWidth().intValue() * LayoutUtils.SCALE; result.height = (int) (newHeight * LayoutUtils.SCALE); } } } else { if (node.getWidth() != null) { result.width = node.getWidth().intValue(); } if (node.getHeight() != null) { result.height = node.getHeight().intValue(); } result.width = result.width * LayoutUtils.SCALE; result.height = result.height * LayoutUtils.SCALE; } return result; }

Target:
public Dimension getDefaultDimension() { final Dimension result = DEFAULT_NODE_DIMENSION.getCopy(); if (node.getStyle() instanceof WorkspaceImage) { final WorkspaceImage workspaceImage = (WorkspaceImage) node.getStyle(); final String path = workspaceImage.getWorkspacePath(); Dimension imageDimension = path != null ? WorkspaceImageFigure.getImageBounds(path) : null; if (imageDimension != null) { if (node.getWidth() == null || Integer.valueOf(node.getWidth()) == -1) { result.width = imageDimension.width; result.height = imageDimension.height; } else { final double ratio = (double) imageDimension.width / imageDimension.height; double newHeight = node.getWidth().intValue() / ratio; result.width = node.getWidth().intValue() * LayoutUtils.SCALE; result.height = (int) (newHeight * LayoutUtils.SCALE); } } } else { if (node.getWidth() != null) { result.width = node.getWidth().intValue(); } if (node.getHeight() != null) { result.height = node.getHeight().intValue(); } result.width = result.width * LayoutUtils.SCALE; result.height = result.height * LayoutUtils.SCALE; } return result; }
Source:
public void dateType() { long testDatesValid[] = {-1001, -1000, -1, 0, 1, 1000, 1001}; realm.beginTransaction(); for (long value : testDatesValid) { AllTypes allTypes = realm.createObject(AllTypes.class); allTypes.setColumnDate(new Date(value)); } realm.commitTransaction(); int i = 0; for (AllTypes allTypes : realm.allObjects(AllTypes.class)) { assertEquals("Item " + i, new Date(testDatesValid[i]), allTypes.getColumnDate()); i++; } }

Target:
public void dateType() { long testDatesValid[] = {Long.MIN_VALUE, -1001, -1000, -1, 0, 1, 1000, 1001, Long.MAX_VALUE}; realm.beginTransaction(); for (long value : testDatesValid) { AllTypes allTypes = realm.createObject(AllTypes.class); allTypes.setColumnDate(new Date(value)); } realm.commitTransaction(); int i = 0; for (AllTypes allTypes : realm.allObjects(AllTypes.class)) { assertEquals("Item " + i, new Date(testDatesValid[i]), allTypes.getColumnDate()); i++; } }
Source:
public void should_fail_when_build_settlement_if_user_does_not_have_resources_in_main_stage() { startNewGame(12, 1); playPreparationStage() .nextRandomDiceValues(asList(6, 6)) .THROW_DICE(1) .BUILD_CITY(1).atNode(1, -1, "top").failsWithError("ERROR"); }

Target:
public void should_fail_when_build_settlement_if_user_does_not_have_resources_in_main_stage() { startNewGame(12, 1); playPreparationStage() .nextRandomDiceValues(asList(6, 6)) .THROW_DICE(1) .getGameDetails(1).gameUser(1).check("resources.wheat", is(0)) .getGameDetails(1).gameUser(1).check("resources.stone", is(0)) .getGameDetails(1).gameUser(1).doesntHaveAvailableAction("BUILD_CITY") .BUILD_CITY(1).atNode(1, -1, "top").failsWithError("ERROR"); }
Source:
public void reconnectPolicy() throws ConfigurationException, MqttException, InterruptedException, ConfigurationException { MqttBrokerConnectionEx a = spy( new MqttBrokerConnectionEx("123.123.123.123", null, false, "MqttBrokerConnectionTests")); a.setConnectionCallback(a, mock(IMqttToken.class)); a.setReconnectStrategy(new PeriodicReconnectStrategy()); assertThat(a.getReconnectStrategy().getBrokerConnection(), equalTo(a)); PeriodicReconnectStrategy mockPolicy = spy(new PeriodicReconnectStrategy(10000, 0)); doNothing().when(a).start(); mockPolicy.start(); a.setReconnectStrategy(mockPolicy); doReturn(MqttConnectionState.DISCONNECTED).when(a).connectionState(); IMqttToken token = mock(IMqttToken.class); when(token.getException()).thenReturn(new org.eclipse.paho.client.mqttv3.MqttException(1)); a.isConnecting = true; a.connectionCallbacks.onFailure(token, null); verify(mockPolicy).lostConnection(); Thread.sleep(10); verify(a).start(); assertTrue(mockPolicy.isReconnecting()); a.connectionCallbacks.onSuccess(token); assertFalse(mockPolicy.isReconnecting()); }

Target:
public void reconnectPolicy() throws ConfigurationException, MqttException, InterruptedException, ConfigurationException { MqttBrokerConnectionEx connection = spy( new MqttBrokerConnectionEx("123.123.123.123", null, false, "MqttBrokerConnectionTests")); connection.setConnectionCallback(connection, mock(IMqttToken.class)); connection.setReconnectStrategy(new PeriodicReconnectStrategy()); assertThat(connection.getReconnectStrategy().getBrokerConnection(), equalTo(connection)); PeriodicReconnectStrategy mockPolicy = spy(new PeriodicReconnectStrategy(10000, 0)); doNothing().when(connection).start(); mockPolicy.start(); connection.setReconnectStrategy(mockPolicy); doReturn(MqttConnectionState.DISCONNECTED).when(connection).connectionState(); IMqttToken token = mock(IMqttToken.class); when(token.getException()).thenReturn(new org.eclipse.paho.client.mqttv3.MqttException(1)); connection.isConnecting = true; connection.connectionCallbacks.onFailure(token, null); verify(mockPolicy).lostConnection(); Thread.sleep(10); verify(connection).start(); assertTrue(mockPolicy.isReconnecting()); connection.connectionCallbacks.onSuccess(token); assertFalse(mockPolicy.isReconnecting()); }
Source:
public BitVector<BigInteger> sdiv(BitVector<BigInteger> bitVector) { if (!bitVector.signedValue().equals(BigInteger.ZERO) && !(signedValue().equals(signedMin()) && bitVector.signedValue().equals(BigInteger.valueOf(-1)))) { return BigIntegerBitVector.of( signedValue().divide(bitVector.signedValue()), bitwidth); } else { return null; } }

Target:
public BuiltinList sdiv(BitVector<BigInteger> bitVector) { if (!bitVector.signedValue().equals(BigInteger.ZERO)) { BigInteger result = signedValue().divide(bitVector.signedValue()); return getBuiltinList(result, checkSignedOverflow(result)); } else { return null; } }
Source:
public static boolean preValidate(String path) throws CTFException { String metadataPath = path + Utils.SEPARATOR + METADATA_FILENAME; File metadataFile = new File(metadataPath); if (metadataFile.exists() && metadataFile.length() > PREVALIDATION_SIZE) { if(CTFTrace.isCTFPacketBasedFile(metadataFile)!= null){ return true; } try(BufferedReader br = new BufferedReader(new FileReader(metadataFile))){ String text = br.readLine(); return text.startsWith(TEXT_ONLY_METADATA_HEADER_PREFIX); } catch (IOException e) { throw new CTFException(e.getMessage(), e); } } return false; }

Target:
public static boolean preValidate(String path) throws CTFException { String metadataPath = path + Utils.SEPARATOR + METADATA_FILENAME; File metadataFile = new File(metadataPath); if (metadataFile.exists() && metadataFile.length() > PREVALIDATION_SIZE) { if (CTFTrace.startsWithMagicNumber(metadataFile, Utils.TSDL_MAGIC) != null) { return true; } try (BufferedReader br = new BufferedReader(new FileReader(metadataFile))) { String text = br.readLine(); return text.startsWith(TEXT_ONLY_METADATA_HEADER_PREFIX); } catch (IOException e) { throw new CTFException(e.getMessage(), e); } } return false; }
Source:
protected int runWithJob(final Namespace options, final HeliosClient client, final PrintStream out, final boolean json, final Job job, final BufferedReader stdin) throws ExecutionException, InterruptedException { final JobId jobId = job.getId(); final List<String> hosts = options.getList(hostsArg.getDest()); final Deployment deployment = Deployment.of(jobId, options.getBoolean(noStartArg.getDest()) ? STOP : START); if (!json) { out.printf("Deploying %s on %s%n", deployment, hosts); } int code = 0; final HostResolver resolver = HostResolver.create(client); final List<String> resolvedHosts = Lists.newArrayList(); for (final String candidateHost : hosts) { final String host = resolver.resolveName(candidateHost); resolvedHosts.add(host); if (!json) { out.printf("%s: ", host); } final String token = options.getString(tokenArg.getDest()); final JobDeployResponse result = client.deploy(deployment, host, token).get(); if (result.getStatus() == JobDeployResponse.Status.OK) { if (!json) { out.printf("done%n"); } else { out.print(result.toJsonString()); } } else { if (!json) { out.printf("failed: %s%n", result); } else { out.print(result.toJsonString()); } code = 1; } } if (code == 0 && options.getBoolean(watchArg.getDest())) { JobWatchCommand.watchJobsOnHosts(out, true, resolvedHosts, singletonList(jobId), options.getInt(intervalArg.getDest()), client); } return code; }

Target:
protected int runWithJob(final Namespace options, final HeliosClient client, final PrintStream out, final boolean json, final Job job, final BufferedReader stdin) throws ExecutionException, InterruptedException { final JobId jobId = job.getId(); final List<String> hosts = options.getList(hostsArg.getDest()); final Deployment deployment = Deployment.of(jobId, options.getBoolean(noStartArg.getDest()) ? STOP : START); if (!json) { out.printf("Deploying %s on %s%n", deployment, hosts); } int code = 0; final HostResolver resolver = HostResolver.create(client); final List<String> resolvedHosts = Lists.newArrayList(); for (final String candidateHost : hosts) { final String host = resolver.resolveName(candidateHost); resolvedHosts.add(host); if (!json) { out.printf("%s: ", host); } final String token = options.getString(tokenArg.getDest()); final JobDeployResponse result = client.deploy(deployment, host, token).get(); if (result.getStatus() == JobDeployResponse.Status.OK) { if (!json) { out.printf("done%n"); } else { out.print(result.toJsonString()); } } else { if (!json) { out.printf("failed: %s%n", result); } else { out.print(result.toJsonString()); } code = 1; } } if (code == 0 && options.getBoolean(watchArg.getDest())) { JobWatchCommand.watchJobsOnHosts(out, true, resolvedHosts, ImmutableList.of(jobId), options.getInt(intervalArg.getDest()), client); } return code; }
Source:
protected IManageablePage getPersistedPage(String sessionIdentifier, int id) { String type = (String) client.get(makeKey(sessionIdentifier, id, PAGE_TYPE)); byte[] data = (byte[]) client.get(makeKey(sessionIdentifier, id, PAGE_DATA)); if (data != null) { if (LOG.isDebugEnabled()) { LOG.debug("Got page for session '{}' and page id '{}'", sessionIdentifier, id); } return new SerializedPage(id, type, data); } return null; }

Target:
protected IManageablePage getPersistedPage(String sessionIdentifier, int id) { byte[] data = (byte[]) client.get(makeKey(sessionIdentifier, id, PAGE_DATA)); if (data != null) { String type = (String) client.get(makeKey(sessionIdentifier, id, PAGE_TYPE)); LOG.debug("Got page for session '{}' and page id '{}'", sessionIdentifier, id); return new SerializedPage(id, type, data); } return null; }
Source:
void startCommonServices(Configuration conf, HAContext haContext) throws IOException { this.registerMBean(); writeLock(); this.haContext = haContext; try { nnResourceChecker = new NameNodeResourceChecker(conf); checkAvailableResources(); assert !blockManager.isPopulatingReplQueues(); StartupProgress prog = NameNode.getStartupProgress(); prog.beginPhase(Phase.SAFEMODE); long completeBlocksTotal = getCompleteBlocksTotal(); prog.setTotal(Phase.SAFEMODE, STEP_AWAITING_REPORTED_BLOCKS, completeBlocksTotal); blockManager.activate(conf, completeBlocksTotal); } finally { writeUnlock("startCommonServices"); } registerMXBean(); DefaultMetricsSystem.instance().register(this); if (inodeAttributeProvider != null) { inodeAttributeProvider.start(); dir.setINodeAttributeProvider(inodeAttributeProvider); } snapshotManager.registerMXBean(); snapshotDeletionGc.schedule(); InetSocketAddress serviceAddress = NameNode.getServiceAddress(conf, true); this.nameNodeHostName = (serviceAddress != null) ? serviceAddress.getHostName() : ""; }

Target:
void startCommonServices(Configuration conf, HAContext haContext) throws IOException { this.registerMBean(); writeLock(); this.haContext = haContext; try { nnResourceChecker = new NameNodeResourceChecker(conf); checkAvailableResources(); assert !blockManager.isPopulatingReplQueues(); StartupProgress prog = NameNode.getStartupProgress(); prog.beginPhase(Phase.SAFEMODE); long completeBlocksTotal = getCompleteBlocksTotal(); prog.setTotal(Phase.SAFEMODE, STEP_AWAITING_REPORTED_BLOCKS, completeBlocksTotal); blockManager.activate(conf, completeBlocksTotal); } finally { writeUnlock("startCommonServices"); } registerMXBean(); DefaultMetricsSystem.instance().register(this); if (inodeAttributeProvider != null) { inodeAttributeProvider.start(); dir.setINodeAttributeProvider(inodeAttributeProvider); } snapshotManager.registerMXBean(); InetSocketAddress serviceAddress = NameNode.getServiceAddress(conf, true); this.nameNodeHostName = (serviceAddress != null) ? serviceAddress.getHostName() : ""; }
Source:
public void close(IProgressMonitor monitor) throws CoreException { if (!isOpen()) return; try { String msg = Messages.resources_closing_0; int rootCount = tree.getChildCount(Path.ROOT); SubMonitor subMonitor = SubMonitor.convert(monitor, msg, rootCount + 3); subMonitor.subTask(msg); try { stringPoolJob.cancel(); saveManager.shutdown(null); saveManager.reportSnapshotRequestor(); prepareOperation(getRoot(), subMonitor.newChild(1)); notificationManager.shutdown(null); beginOperation(true); IProject[] projects = getRoot().getProjects(IContainer.INCLUDE_HIDDEN); for (int i = 0; i < projects.length; i++) { broadcastEvent(LifecycleEvent.newEvent(LifecycleEvent.PRE_PROJECT_CLOSE, projects[i])); subMonitor.worked(1); } deleteResource(getRoot()); openFlag = false; } finally { shutdown(subMonitor.newChild(2, SubMonitor.SUPPRESS_SUBTASK)); } } finally { Job.getJobManager().endRule(getRoot()); } }

Target:
public void close(IProgressMonitor monitor) throws CoreException { if (!isOpen()) return; try { String msg = Messages.resources_closing_0; SubMonitor subMonitor = SubMonitor.convert(monitor, msg, 20); subMonitor.subTask(msg); try { stringPoolJob.cancel(); saveManager.shutdown(null); saveManager.reportSnapshotRequestor(); prepareOperation(getRoot(), subMonitor.newChild(1)); notificationManager.shutdown(null); beginOperation(true); IProject[] projects = getRoot().getProjects(IContainer.INCLUDE_HIDDEN); subMonitor.setWorkRemaining(projects.length + 2); for (int i = 0; i < projects.length; i++) { broadcastEvent(LifecycleEvent.newEvent(LifecycleEvent.PRE_PROJECT_CLOSE, projects[i])); subMonitor.worked(1); } deleteResource(getRoot()); openFlag = false; } finally { shutdown(subMonitor.newChild(2, SubMonitor.SUPPRESS_SUBTASK)); } } finally { Job.getJobManager().endRule(getRoot()); } }
Source:
private int instrumentZip(final InputStream input, final OutputStream output, final String name) throws IOException { final ZipInputStream zipin = new ZipInputStream(input); final ZipOutputStream zipout = new ZipOutputStream(output); ZipEntry entry; int count = 0; while ((entry = nextEntry(zipin, name)) != null) { final String entryName = entry.getName(); if (signatureRemover.removeEntry(entryName)) { continue; } final ZipEntry newEntry = new ZipEntry(entryName); if (entry.getMethod() == ZipEntry.DEFLATED) { newEntry.setMethod(ZipEntry.DEFLATED); zipout.putNextEntry(newEntry); count += filterOrInstrument(zipin, zipout, name, entryName); } else { newEntry.setMethod(ZipEntry.STORED); final ByteArrayOutputStream buffer = new ByteArrayOutputStream(); count += filterOrInstrument(zipin, buffer, name, entryName); final byte[] bytes = buffer.toByteArray(); count += filterOrInstrument(zipin, buffer, name, entryName); newEntry.setSize(bytes.length); newEntry.setCompressedSize(bytes.length); final CRC32 crc = new CRC32(); crc.update(bytes); newEntry.setCrc(crc.getValue()); zipout.putNextEntry(newEntry); zipout.write(bytes); } zipout.closeEntry(); } zipout.finish(); return count; }

Target:
private int instrumentZip(final InputStream input, final OutputStream output, final String name) throws IOException { final ZipInputStream zipin = new ZipInputStream(input); final ZipOutputStream zipout = new ZipOutputStream(output); ZipEntry entry; int count = 0; while ((entry = nextEntry(zipin, name)) != null) { final String entryName = entry.getName(); if (signatureRemover.removeEntry(entryName)) { continue; } final ZipEntry newEntry = new ZipEntry(entryName); newEntry.setMethod(entry.getMethod()); switch (entry.getMethod()) { case ZipEntry.DEFLATED: zipout.putNextEntry(newEntry); count += filterOrInstrument(zipin, zipout, name, entryName); break; case ZipEntry.STORED: final ByteArrayOutputStream buffer = new ByteArrayOutputStream(); count += filterOrInstrument(zipin, buffer, name, entryName); final byte[] bytes = buffer.toByteArray(); newEntry.setSize(bytes.length); newEntry.setCompressedSize(bytes.length); newEntry.setCrc(crc(bytes)); zipout.putNextEntry(newEntry); zipout.write(bytes); break; default: throw new AssertionError(entry.getMethod()); } zipout.closeEntry(); } zipout.finish(); return count; }
Source:
public void addTemplateChange(ChangeType type, int ordinal) { Timber.d("addTemplateChange() type %s for ordinal %s", type, ordinal); if (mTemplateChanges == null) { mTemplateChanges = new ArrayList<>(); } Object[] change = new Object[] {ordinal, type}; if (type == ChangeType.DELETE) { int ordinalAdjustment = 0; for (int i = mTemplateChanges.size() - 1; i >= 0; i--) { Object[] oldChange = mTemplateChanges.get(i ); switch ((ChangeType)oldChange[1]) { case DELETE: { if ((Integer)oldChange[0] - ordinalAdjustment <= ordinal) { ordinalAdjustment++; continue; } break; } case ADD: if (ordinal == (Integer)oldChange[0] - ordinalAdjustment) { compactTemplateChanges((Integer)oldChange[0]); return; } break; default: break; } } } Timber.d("addTemplateChange() added ord/type: %s/%s", change[0], change[1]); mTemplateChanges.add(change); dumpChanges(); }

Target:
public void addTemplateChange(ChangeType type, int ordinal) { Timber.d("addTemplateChange() type %s for ordinal %s", type, ordinal); ArrayList<Object[]> templateChanges = getTemplateChanges(); Object[] change = new Object[] {ordinal, type}; if (type == ChangeType.DELETE) { int ordinalAdjustment = 0; for (int i = templateChanges.size() - 1; i >= 0; i--) { Object[] oldChange = templateChanges.get(i ); switch ((ChangeType)oldChange[1]) { case DELETE: { if ((Integer)oldChange[0] - ordinalAdjustment <= ordinal) { ordinalAdjustment++; continue; } break; } case ADD: if (ordinal == (Integer)oldChange[0] - ordinalAdjustment) { compactTemplateChanges((Integer)oldChange[0]); return; } break; default: break; } } } Timber.d("addTemplateChange() added ord/type: %s/%s", change[0], change[1]); templateChanges.add(change); dumpChanges(); }
Source:
protected void onResume() { super.onResume(); Log.d("Niels", "onResume called: queue=" + ESM_Queue.getQueueSize(this)); try { FragmentManager fragmentManager = getSupportFragmentManager(); Cursor current_esm; if (ESM.isESMVisible(getApplicationContext())) { current_esm = getContentResolver().query(ESM_Data.CONTENT_URI, null, ESM_Data.STATUS + "=" + ESM.STATUS_VISIBLE, null, ESM_Data.TIMESTAMP + " ASC LIMIT 1"); } else { current_esm = getContentResolver().query(ESM_Data.CONTENT_URI, null, ESM_Data.STATUS + "=" + ESM.STATUS_NEW, null, ESM_Data.TIMESTAMP + " ASC LIMIT 1"); } if (current_esm != null && current_esm.moveToFirst()) { int _id = current_esm.getInt(current_esm.getColumnIndex(ESM_Data._ID)); ContentValues update_state = new ContentValues(); update_state.put(ESM_Data.STATUS, ESM.STATUS_VISIBLE); getContentResolver().update(ESM_Data.CONTENT_URI, update_state, ESM_Data._ID + "=" + _id, null); JSONObject esm_question = new JSONObject(current_esm.getString(current_esm.getColumnIndex(ESM_Data.JSON))); ESM_Question esm = esmFactory.getESM(esm_question.getInt(ESM_Question.esm_type), esm_question, current_esm.getInt(current_esm.getColumnIndex(ESM_Data._ID))); if (esm != null) { esm.show(fragmentManager, TAG); } } if (current_esm != null && !current_esm.isClosed()) current_esm.close(); } catch (JSONException e) { e.printStackTrace(); } }

Target:
protected void onResume() { super.onResume(); try { FragmentManager fragmentManager = getSupportFragmentManager(); Cursor current_esm; if (ESM.isESMVisible(getApplicationContext())) { current_esm = getContentResolver().query(ESM_Data.CONTENT_URI, null, ESM_Data.STATUS + "=" + ESM.STATUS_VISIBLE, null, ESM_Data.TIMESTAMP + " ASC LIMIT 1"); } else { current_esm = getContentResolver().query(ESM_Data.CONTENT_URI, null, ESM_Data.STATUS + "=" + ESM.STATUS_NEW, null, ESM_Data.TIMESTAMP + " ASC LIMIT 1"); } if (current_esm != null && current_esm.moveToFirst()) { int _id = current_esm.getInt(current_esm.getColumnIndex(ESM_Data._ID)); ContentValues update_state = new ContentValues(); update_state.put(ESM_Data.STATUS, ESM.STATUS_VISIBLE); getContentResolver().update(ESM_Data.CONTENT_URI, update_state, ESM_Data._ID + "=" + _id, null); JSONObject esm_question = new JSONObject(current_esm.getString(current_esm.getColumnIndex(ESM_Data.JSON))); ESM_Question esm = esmFactory.getESM(esm_question.getInt(ESM_Question.esm_type), esm_question, current_esm.getInt(current_esm.getColumnIndex(ESM_Data._ID))); if (esm != null) { esm.show(fragmentManager, TAG); } } if (current_esm != null && !current_esm.isClosed()) current_esm.close(); } catch (JSONException e) { e.printStackTrace(); } }
Source:
public void should_fail_requests_when_session_is_closed() throws Exception { simulacronRule .cluster() .prime(when(QUERY_STRING).then(noRows()).delay(20, TimeUnit.MILLISECONDS)); CqlSession session = SessionUtils.newSession(simulacronRule); Set<String> unexpectedErrors = new ConcurrentSkipListSet<>(); ExecutorService requestExecutor = Executors.newFixedThreadPool(4); Semaphore semaphore = new Semaphore(1024); CountDownLatch gotSessionClosedError = new CountDownLatch(1); for (int i = 0; i < 4; i++) { requestExecutor.execute( () -> { try { while (!Thread.currentThread().isInterrupted()) { semaphore.acquire(); session .executeAsync(QUERY_STRING) .whenComplete( (ignoredResult, error) -> { semaphore.release(); if (error instanceof IllegalStateException && "Session is closed".equals(error.getMessage())) { gotSessionClosedError.countDown(); } else if (error != null && !(error instanceof ClosedConnectionException || error instanceof NoNodeAvailableException)) { unexpectedErrors.add(error.toString()); } }); } } catch (InterruptedException e) { } }); } TimeUnit.MILLISECONDS.sleep(100); session.forceCloseAsync(); assertThat(gotSessionClosedError.await(1, TimeUnit.SECONDS)) .as("Expected to get the 'Session was closed' error shortly after shutting down") .isTrue(); requestExecutor.shutdownNow(); assertThat(unexpectedErrors).isEmpty(); }

Target:
public void should_fail_requests_when_session_is_closed() throws Exception { simulacronRule .cluster() .prime(when(QUERY_STRING).then(noRows()).delay(20, TimeUnit.MILLISECONDS)); CqlSession session = SessionUtils.newSession(simulacronRule); Set<String> unexpectedErrors = new ConcurrentSkipListSet<>(); ExecutorService requestExecutor = Executors.newFixedThreadPool(4); int maxConcurrentRequests = session .getContext() .getConfig() .getDefaultProfile() .getInt(DefaultDriverOption.CONNECTION_MAX_REQUESTS); Semaphore semaphore = new Semaphore(maxConcurrentRequests); CountDownLatch gotSessionClosedError = new CountDownLatch(1); for (int i = 0; i < 4; i++) { requestExecutor.execute( () -> { try { while (!Thread.currentThread().isInterrupted()) { semaphore.acquire(); session .executeAsync(QUERY_STRING) .whenComplete( (ignoredResult, error) -> { semaphore.release(); if (error instanceof IllegalStateException && "Session is closed".equals(error.getMessage())) { gotSessionClosedError.countDown(); } else if (error != null && !(error instanceof ClosedConnectionException || error instanceof NoNodeAvailableException)) { unexpectedErrors.add(error.toString()); } }); } } catch (InterruptedException e) { } }); } TimeUnit.MILLISECONDS.sleep(100); session.forceCloseAsync(); assertThat(gotSessionClosedError.await(1, TimeUnit.SECONDS)) .as("Expected to get the 'Session is closed' error shortly after shutting down") .isTrue(); requestExecutor.shutdownNow(); assertThat(unexpectedErrors).isEmpty(); }
Source:
public void assessEmptyFile() { getAssert("file3.js").isFalse(); }

Target:
public void assessEmptyFile() { getAssert("empty.js").isFalse(); }
Source:
public org.codice.solr.client.solrj.SolrClient newClient(String core) { String solrUrl = StringUtils.defaultIfBlank( AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty(SOLR_HTTP_URL)), getDefaultHttpsAddress()); final String coreUrl = solrUrl + "/" + core; final String solrDataDir = AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty(SOLR_DATA_DIR)); if (solrDataDir != null) { ConfigurationStore.getInstance().setDataDirectoryPath(solrDataDir); } LOGGER.debug("Solr({}): Creating an HTTP Solr client using url [{}]", core, coreUrl); SolrClientAdapter adaptor = new SolrClientAdapter(core, () -> createSolrHttpClient(solrUrl, core, coreUrl)); try { if (!adaptor.isAvailable(30, 5, TimeUnit.SECONDS)) { LOGGER.warn("Solr Client is not available after 30 seconds", core); } } catch (InterruptedException e) { LOGGER.error("Unable to connect to solr client {}: ", core, e.getStackTrace()); Thread.currentThread().interrupt(); } return adaptor; }

Target:
public org.codice.solr.client.solrj.SolrClient newClient(String core) { String solrUrl = StringUtils.defaultIfBlank( AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty(SOLR_HTTP_URL)), getDefaultHttpsAddress()); final String coreUrl = solrUrl + "/" + core; final String solrDataDir = AccessController.doPrivileged( (PrivilegedAction<String>) () -> System.getProperty(SOLR_DATA_DIR)); if (solrDataDir != null) { ConfigurationStore.getInstance().setDataDirectoryPath(solrDataDir); } LOGGER.debug("Solr({}): Creating an HTTP Solr client using url [{}]", core, coreUrl); return new SolrClientAdapter(core, () -> createSolrHttpClient(solrUrl, core, coreUrl)); }
Source:
public void testDateParsingWithoutReaderVersion() throws ParseException { AbstractNitfSegmentParser parser = Mockito.mock(AbstractNitfSegmentParser.class, Mockito.CALLS_REAL_METHODS); NitfReader mockReader = Mockito.mock(NitfReader.class); parser.reader = mockReader; Mockito.when(mockReader.getFileType()).thenReturn(FileType.UNKNOWN); exception.expect(ParseException.class); exception.expectMessage("Need to set NITF file type prior to reading dates"); NitfDateTime date = parser.readNitfDateTime(); }

Target:
public void testDateParsingWithoutReaderVersion() throws ParseException { AbstractNitfSegmentParser parser = mock(AbstractNitfSegmentParser.class, CALLS_REAL_METHODS); NitfReader mockReader = mock(NitfReader.class); parser.reader = mockReader; when(mockReader.getFileType()).thenReturn(FileType.UNKNOWN); exception.expect(ParseException.class); exception.expectMessage("Need to set NITF file type prior to reading dates"); NitfDateTime date = parser.readNitfDateTime(); }
Source:
Dataset<Row> withPairedQueriesAndReformulations(Dataset<Row> df) { return df .withColumn("query", explode(col("queries"))) .withColumn("sugg", explode(col("queries"))) .drop("queries"); }

Target:
Dataset<Row> withPairedQueriesAndReformulations(Dataset<Row> df) { return df .withColumn("query", explode(col("queries"))) .withColumn("sugg", explode(col("queries"))) .where(col("sugg.ts").gt(col("query.ts"))) .select("wikiid", "query", "sugg"); }
Source:
protected void setDisplayDecimalValueFromModel() { Double d = getDoubleAnswerValue(); if (d != null) { NumberFormat nf = NumberFormat.getNumberInstance(Locale.US); nf.setMaximumFractionDigits(15); nf.setMaximumIntegerDigits(15); nf.setGroupingUsed(false); answerText.setText(nf.format(d)); Selection.setSelection(answerText.getText(), answerText.getText().length()); } }

Target:
private void setDisplayDecimalValueFromModel() { Double d = getDoubleAnswerValue(); if (d != null) { NumberFormat nf = NumberFormat.getNumberInstance(Locale.US); nf.setMaximumFractionDigits(15); nf.setMaximumIntegerDigits(15); nf.setGroupingUsed(false); answerText.setText(nf.format(d)); } }
Source:
public FunctionRequirements requirements(IborFutureTrade trade) { IborFuture fra = trade.getProduct(); QuoteKey quoteKey = QuoteKey.of(trade.getSecurity().getStandardId()); IborIndexRatesKey indexForwardCurveKey = IborIndexRatesKey.of(fra.getIndex()); DiscountFactorsKey discountFactorsKey = DiscountFactorsKey.of(fra.getCurrency()); IndexRateKey indexTimeSeriesKey = IndexRateKey.of(fra.getIndex()); return FunctionRequirements.builder() .singleValueRequirements(quoteKey, indexForwardCurveKey, discountFactorsKey) .timeSeriesRequirements(indexTimeSeriesKey) .outputCurrencies(fra.getCurrency()) .build(); }

Target:
public FunctionRequirements requirements(IborFutureTrade trade) { IborFuture product = trade.getProduct(); QuoteKey quoteKey = QuoteKey.of(trade.getSecurity().getStandardId()); IborIndexRatesKey indexForwardCurveKey = IborIndexRatesKey.of(product.getIndex()); DiscountFactorsKey discountFactorsKey = DiscountFactorsKey.of(product.getCurrency()); IndexRateKey indexTimeSeriesKey = IndexRateKey.of(product.getIndex()); return FunctionRequirements.builder() .singleValueRequirements(quoteKey, indexForwardCurveKey, discountFactorsKey) .timeSeriesRequirements(indexTimeSeriesKey) .outputCurrencies(product.getCurrency()) .build(); }
Source:
void putBlob(BlobId blobId, BlobProperties properties, byte[] encryptionKey, byte[] usermetadata, byte[] data, ConnectedChannel channel) throws IOException { PutRequest putRequest0 = new PutRequest(1, "client1", blobId, properties, ByteBuffer.wrap(usermetadata), Unpooled.wrappedBuffer(data), properties.getBlobSize(), BlobType.DataBlob, encryptionKey == null ? null : ByteBuffer.wrap(encryptionKey)); channel.send(putRequest0); DataInputStream putResponseStream = channel.receive().getInputStream(); PutResponse response0 = PutResponse.readFrom(putResponseStream); Assert.assertEquals(ServerErrorCode.No_Error, response0.getError()); }

Target:
void putBlob(BlobId blobId, BlobProperties properties, byte[] encryptionKey, byte[] usermetadata, byte[] data, ConnectedChannel channel) throws IOException { PutRequest putRequest0 = new PutRequest(1, "client1", blobId, properties, ByteBuffer.wrap(usermetadata), Unpooled.wrappedBuffer(data), properties.getBlobSize(), BlobType.DataBlob, encryptionKey == null ? null : ByteBuffer.wrap(encryptionKey)); PutResponse response0 = PutResponse.readFrom(channel.sendAndReceive(putRequest0).getInputStream()); Assert.assertEquals(ServerErrorCode.No_Error, response0.getError()); }
Source:
public String toString() { return MoreObjects.toStringHelper(this) .add("updateNeighbors", this.updateNeighbors) .add("performBlockPhysics", this.performBlockPhysics) .toString(); }

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("rawFlag", this.rawFlag) .add("updateNeighbors", this.updateNeighbors) .add("performBlockPhysics", this.performBlockPhysics) .add("notifyObservers", this.notifyObservers) .add("notifyClients", this.notifyClients) .add("ignoreRender", this.ignoreRender) .add("forceReRender", this.forceReRender) .toString(); }
Source:
public VisualizationAttribute getAttributeFromCollection(final CollectionType type) { return getContent().getBuckets().stream() .filter(bucket -> bucket.getLocalIdentifier().equals(type.getName())) .findFirst() .map(bucket -> bucket.getOnlyAttribute()) .orElse(null); }

Target:
public VisualizationAttribute getAttributeFromCollection(final CollectionType type) { return getContent().getBuckets().stream() .filter(bucket -> type.isValueOf(bucket.getLocalIdentifier())) .findFirst() .map(Bucket::getOnlyAttribute) .orElse(null); }
Source:
public Set<Long> inventory(AccessToken creds, TransactionToken transaction, String environment) throws TException { checkAccess(creds, transaction); return getEngine(environment).getAllRecords(); }

Target:
public Set<Long> inventory(AccessToken creds, TransactionToken transaction, String environment) throws TException { checkAccess(creds, transaction); return getStore(transaction, environment).getAllRecords(); }
Source:
private void createSocket() throws X509Exception, IOException { if (self.isSslQuorum()) { if (x509Util == null) { x509Util = new QuorumX509Util(); } sock = x509Util.createSSLSocket(); } else { sock = new Socket(); } sock.setSoTimeout(self.tickTime * self.initLimit); }

Target:
private Socket createSocket() throws X509Exception, IOException { Socket sock; if (self.isSslQuorum()) { if (x509Util == null) { x509Util = new QuorumX509Util(); } sock = x509Util.createSSLSocket(); } else { sock = new Socket(); } sock.setSoTimeout(self.tickTime * self.initLimit); return sock; }
Source:
private void encodeStatusCode(Iterator<String> iterator, StringBuilder builder) { String code = (String) (iterator.next()); if (iterator.hasNext()) { builder.append("<StatusCode Value=\"").append(code).append("\">"); encodeStatusCode(iterator, builder); builder.append("</StatusCode>"); } else { builder.append("<StatusCode Value=\"").append(code).append("\"/>"); } }

Target:
private void encodeStatusCode(Iterator<String> iterator, StringBuilder builder) { String code = iterator.next(); if (iterator.hasNext()) { builder.append("<StatusCode Value=\"").append(code).append("\">"); encodeStatusCode(iterator, builder); builder.append("</StatusCode>"); } else { builder.append("<StatusCode Value=\"").append(code).append("\"/>"); } }
Source:
public void testDirectoryHeaders() throws Exception { MockHttpServletResponse response = getAsServletResponse("/rest/resource/mydir?format=xml"); Assert.assertEquals(FORMAT_HEADER.format(myRes.lastmodified()), response.getHeader("Last-modified")); Assert.assertEquals("/", response.getHeader("Resource-parent")); Assert.assertEquals("directory", response.getHeader("Resource-type")); Assert.assertEquals("application/xml", response.getHeader("Content-type")); }

Target:
public void testDirectoryHeaders() throws Exception { MockHttpServletResponse response = getAsServletResponse("/rest/resource/mydir?format=xml"); Assert.assertEquals(FORMAT_HEADER.format(myRes.lastmodified()), response.getHeader("Last-Modified")); Assert.assertEquals("/", response.getHeader("Resource-Parent")); Assert.assertEquals("directory", response.getHeader("Resource-Type")); Assert.assertEquals("application/xml", response.getHeader("Content-Type")); }
Source:
private Set<String> getProxyBypass(OMElement profile) { Set<String> bypassSet = new HashSet<String>(); QName bypassQName = new QName("bypass"); OMElement bypassEle = profile.getFirstChildWithName(bypassQName); if (bypassEle != null && !bypassEle.getText().equals("")) { String[] bypass = bypassEle.getText().split(","); for (String s : bypass) { bypassSet.add(s.trim()); } } return bypassSet; }

Target:
private Set<String> getProxyBypass(OMElement profile) { Set<String> bypassSet = new HashSet<String>(); OMElement bypassEle = profile.getFirstChildWithName(Q_BYPASS); if (bypassEle != null && !bypassEle.getText().isEmpty()) { String[] bypassHosts = bypassEle.getText().split(","); for (String bypassHost : bypassHosts) { bypassSet.add(bypassHost.trim()); } } return bypassSet; }
Source:
public void loseLife() { lives--; addToLog("The player lost a life, total lives is now: " + lives); }

Target:
public void loseLife() { lives--; addToLog("[PLAYER]\t Player lost a life, total lives is now: " + lives); }
Source:
public BurstableUnlimitedMode getBurstableUnlimitedMode() { if (burstableUnlimitedMode == null) { return t2Unlimited ? BurstableUnlimitedMode.ENABLED : BurstableUnlimitedMode.DEFAULT; } return burstableUnlimitedMode; }

Target:
public BurstableUnlimitedMode getBurstableUnlimitedMode() { return burstableUnlimitedMode; }
Source:
public Collection<Integer> getSsrcs() { synchronized (critSect) { Collection<Integer> ssrcs = new ArrayList<>(); for (Long ssrcValue : ssrcs_.keySet()) { Number value = ssrcValue; ssrcs.add(value.intValue()); } return ssrcs; } }

Target:
public Collection<Integer> getSsrcs() { synchronized (critSect) { Collection<Integer> ssrcValue = new ArrayList<>(); for (Long ssrc : ssrcs.keySet()) { Number value = ssrc; ssrcValue.add(value.intValue()); } return ssrcValue; } }
Source:
GtkBorder getGtkBorderPadding () { if (OS.GTK3) { GtkBorder gtkBorderPadding = new GtkBorder (); long context = OS.gtk_widget_get_style_context (textEntryHandle); if (OS.GTK_VERSION < OS.VERSION(3, 18 , 0)) { OS.gtk_style_context_get_padding (context, OS.GTK_STATE_FLAG_NORMAL, gtkBorderPadding); } else { int styleState = OS.gtk_widget_get_state_flags(textEntryHandle); OS.gtk_style_context_get_padding (context, styleState, gtkBorderPadding); } return gtkBorderPadding; } else { GtkBorder padding = new GtkBorder (); padding.bottom = padding.top = padding.left = padding.right = GTK2_MANUAL_BORDER_PADDING; return padding; } }

Target:
GtkBorder getGtkBorderPadding () { if (OS.GTK3) { GtkBorder gtkBorderPadding = new GtkBorder (); long context = OS.gtk_widget_get_style_context (textEntryHandle); int styleState = OS.gtk_widget_get_state_flags(textEntryHandle); OS.gtk_style_context_get_padding (context, styleState, gtkBorderPadding); return gtkBorderPadding; } else { GtkBorder padding = new GtkBorder (); padding.bottom = padding.top = padding.left = padding.right = GTK2_MANUAL_BORDER_PADDING; return padding; } }
Source:
public void notB(final Sketch<S> skB) { if (empty_ || (skB == null) || skB.isEmpty()) { return; } final long thetaLongB = skB.getThetaLong(); thetaLong_ = Math.min(thetaLong_, thetaLongB); final int countB = skB.getRetainedEntries(); CompactSketch<S> cskB = null; QuickSelectSketch<S> qskB = null; final long[] hashTableB; if (skB instanceof CompactSketch) { cskB = (CompactSketch<S>) skB; hashTableB = convertToHashTable(cskB.getHashArr(), countB, thetaLong_); } else { qskB = (QuickSelectSketch<S>) skB; hashTableB = convertToHashTable(qskB.getHashTable(), countB, thetaLong_); } final long[] tmpHashArrA = new long[count_]; final Class<S> summaryType = (Class<S>) summaryArr_.getClass().getComponentType(); final S[] tmpSummaryArrA = (S[]) Array.newInstance(summaryType, count_); int nonMatches = 0; for (int i = 0; i < count_; i++) { final long hash = hashArr_[i]; if ((hash != 0) && (hash < thetaLong_)) { final int index = HashOperations.hashSearch(hashTableB, simpleIntLog2(hashTableB.length), hash); if (index == -1) { tmpHashArrA[nonMatches] = hash; tmpSummaryArrA[nonMatches] = summaryArr_[i]; nonMatches++; } } } hashArr_ = Arrays.copyOfRange(tmpHashArrA, 0, nonMatches); summaryArr_ = Arrays.copyOfRange(tmpSummaryArrA, 0, nonMatches); count_ = nonMatches; }

Target:
public void notB(final Sketch<S> skB) { if (empty_ || (skB == null) || skB.isEmpty()) { return; } final long thetaLongB = skB.getThetaLong(); thetaLong_ = Math.min(thetaLong_, thetaLongB); final int countB = skB.getRetainedEntries(); CompactSketch<S> cskB = null; QuickSelectSketch<S> qskB = null; final long[] hashTableB; if (skB instanceof CompactSketch) { cskB = (CompactSketch<S>) skB; hashTableB = convertToHashTable(cskB.getHashArr(), countB, thetaLong_); } else { qskB = (QuickSelectSketch<S>) skB; hashTableB = (thetaLong_ < thetaLongB) ? convertToHashTable(qskB.getHashTable(), countB, thetaLong_) : qskB.getHashTable(); } final long[] tmpHashArrA = new long[count_]; final Class<S> summaryType = (Class<S>) summaryArr_.getClass().getComponentType(); final S[] tmpSummaryArrA = (S[]) Array.newInstance(summaryType, count_); int nonMatches = 0; for (int i = 0; i < count_; i++) { final long hash = hashArr_[i]; if ((hash != 0) && (hash < thetaLong_)) { final int index = HashOperations.hashSearch(hashTableB, simpleIntLog2(hashTableB.length), hash); if (index == -1) { tmpHashArrA[nonMatches] = hash; tmpSummaryArrA[nonMatches] = summaryArr_[i]; nonMatches++; } } } hashArr_ = Arrays.copyOfRange(tmpHashArrA, 0, nonMatches); summaryArr_ = Arrays.copyOfRange(tmpSummaryArrA, 0, nonMatches); count_ = nonMatches; }
Source:
public GitConnection getConnection(File workDir) throws GitException { final List<Attribute> profileAttributes; try { profileAttributes = userProfileDao.getById(EnvironmentContext.getCurrent().getUser().getId()).getAttributes(); } catch (UserProfileException e) { LOG.warn("Failed to obtain user information.", e); throw new GitException("Failed to obtain user information."); } String firstName = null, lastName = null; for (Attribute attribute : profileAttributes) { if ("firstName".equals(attribute.getName())) { firstName = attribute.getValue(); } else if ("lastName".equals(attribute.getName())) { lastName = attribute.getValue(); } } GitUser gitUser = DtoFactory.getInstance().createDto(GitUser.class); if (firstName != null || lastName != null) { gitUser.withEmail(Strings.join(" ", Strings.nullToEmpty(firstName), Strings.nullToEmpty(lastName))) .withEmail(EnvironmentContext.getCurrent().getUser().getName()); } else { gitUser.withEmail(EnvironmentContext.getCurrent().getUser().getName()); } return getConnection(workDir, gitUser); }

Target:
public GitConnection getConnection(File workDir) throws GitException { final List<Attribute> profileAttributes; try { profileAttributes = userProfileDao.getById(EnvironmentContext.getCurrent().getUser().getId()).getAttributes(); } catch (UserProfileException e) { LOG.warn("Failed to obtain user information.", e); throw new GitException("Failed to obtain user information."); } String firstName = null, lastName = null; if (profileAttributes != null) { for (Attribute attribute : profileAttributes) { if ("firstName".equals(attribute.getName())) { firstName = attribute.getValue(); } else if ("lastName".equals(attribute.getName())) { lastName = attribute.getValue(); } } } GitUser gitUser = DtoFactory.getInstance().createDto(GitUser.class); if (firstName != null || lastName != null) { gitUser.withEmail(Strings.join(" ", Strings.nullToEmpty(firstName), Strings.nullToEmpty(lastName))) .withEmail(EnvironmentContext.getCurrent().getUser().getName()); } else { gitUser.withEmail(EnvironmentContext.getCurrent().getUser().getName()); } return getConnection(workDir, gitUser); }
Source:
public void onCreate(SQLiteDatabase db) { db.execSQL("create table " + "accounts ( id integer primary key autoincrement," + " bib text," + " label text," + " name text," + " password text," + " cached integer," + " pendingFees text," + " validUntil text," + " warning text," + " passwordValid integer" + ");"); db.execSQL( "create table " + "accountdata_lent (" + "id integer primary key autoincrement," + "account integer," + "title text," + "author text," + "format text," + "itemid text," + "status text," + "barcode text," + "deadline text," + "homebranch text," + "lending_branch text," + "prolong_data text," + "renewable integer," + "download_data text," + "ebook integer" + "mediatype text," + "cover text," + ");"); db.execSQL("create table " + "accountdata_reservations (" + "id integer primary key autoincrement," + "account integer," + "title text," + "author text," + "format text," + "itemid text," + "status text," + "ready text," + "expiration text," + "branch text," + "cancel_data text," + "booking_data text," + "mediatype text," + "cover text," + ");"); db.execSQL("create table " + "alarms (" + "id integer primary key autoincrement," + "deadline text," + "media text," + "alarm text," + "notified integer," + "finished integer" + ");"); }

Target:
public void onCreate(SQLiteDatabase db) { db.execSQL("create table " + "accounts ( id integer primary key autoincrement," + " bib text," + " label text," + " name text," + " password text," + " cached integer," + " pendingFees text," + " validUntil text," + " warning text," + " passwordValid integer" + ");"); db.execSQL( "create table " + "accountdata_lent (" + "id integer primary key autoincrement," + "account integer," + "title text," + "author text," + "format text," + "itemid text," + "status text," + "barcode text," + "deadline text," + "homebranch text," + "lending_branch text," + "prolong_data text," + "renewable integer," + "download_data text," + "ebook integer," + "mediatype text," + "cover text" + ");"); db.execSQL("create table " + "accountdata_reservations (" + "id integer primary key autoincrement," + "account integer," + "title text," + "author text," + "format text," + "itemid text," + "status text," + "ready text," + "expiration text," + "branch text," + "cancel_data text," + "booking_data text," + "mediatype text," + "cover text" + ");"); db.execSQL("create table " + "alarms (" + "id integer primary key autoincrement," + "deadline text," + "media text," + "alarm text," + "notified integer," + "finished integer" + ");"); }
Source:
public static BrandingManager getInstance(final File etcDir) { if (instance == null) { instance = new BrandingManager(etcDir); } return instance; }

Target:
public static synchronized BrandingManager getInstance(final File etcDir) { if (instance == null) { instance = new BrandingManager(etcDir); } return instance; }
Source:
public void start() throws Exception { Preconditions.checkNotNull(m_businessServiceDao, "businessServiceDao cannot be null"); Preconditions.checkNotNull(m_alarmDao, "alarmDao cannot be null"); Preconditions.checkNotNull(m_eventIpcManager, "eventIpcManager cannot be null"); Preconditions.checkNotNull(m_eventConfDao, "eventConfDao cannot be null"); handleConfigurationChanged(); }

Target:
public void start() throws Exception { Objects.requireNonNull(m_businessServiceDao, "businessServiceDao cannot be null"); Objects.requireNonNull(m_alarmDao, "alarmDao cannot be null"); Objects.requireNonNull(m_eventIpcManager, "eventIpcManager cannot be null"); Objects.requireNonNull(m_eventConfDao, "eventConfDao cannot be null"); handleConfigurationChanged(); }